Subversion Repositories SmartDukaan

Rev

Rev 11592 | Rev 13521 | 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
 
7746 amit.gupta 32
    public long removeAllCouponsByPromotionId(long promotionId) throws PromotionException, org.apache.thrift.TException;
33
 
6301 amit.gupta 34
    public Coupon getCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
35
 
36
    public boolean isGiftVoucher(String couponCode) throws PromotionException, org.apache.thrift.TException;
37
 
11819 amit.gupta 38
    public boolean isCodApplicable(Cart cart) throws PromotionException, org.apache.thrift.TException;
6356 amit.gupta 39
 
3430 rajveer 40
    public List<Promotion> getAllPromotions() throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 41
 
3430 rajveer 42
    public Promotion getPromotionById(long promotionId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 43
 
3430 rajveer 44
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 45
 
3430 rajveer 46
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 47
 
6736 amit.gupta 48
    public Map<Long,Double> getEmiDiscount(long cartId) throws PromotionException, org.apache.thrift.TException;
49
 
6433 anupam.sin 50
    public Map<Long,String> applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws PromotionException, org.apache.thrift.TException;
51
 
3430 rajveer 52
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 53
 
3430 rajveer 54
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 55
 
6497 amit.gupta 56
    public List<Coupon> getActiveCodes(long promotionId) throws PromotionException, org.apache.thrift.TException;
57
 
58
    public void deleteCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
59
 
7092 amit.gupta 60
    public List<Coupon> getAllCouponsByPromotionId(long promotionId) throws PromotionException, org.apache.thrift.TException;
61
 
3385 varun.gupt 62
    /**
63
     * Returns a list of active coupons
64
     */
3430 rajveer 65
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException;
3385 varun.gupt 66
 
67
    /**
6561 amit.gupta 68
     * Creates a coupon with prefix (optional, pass null)and returns couponcode if successfully created.
6250 amit.gupta 69
     * 
70
     * @param promotionId
8707 manish.sha 71
     * @param couponCategory
6730 anupam.sin 72
     * @param couponCode
6679 anupam.sin 73
     * @param arguments
6356 amit.gupta 74
     * @param isCod
6561 amit.gupta 75
     * @param prefix
6250 amit.gupta 76
     */
8707 manish.sha 77
    public String createCoupon(long promotionId, long couponCategory, String couponCode, String arguments, boolean isCod, String prefix) throws PromotionException, org.apache.thrift.TException;
6250 amit.gupta 78
 
79
    /**
3385 varun.gupt 80
     * Returns the count of successful payments done using a given coupon
81
     * 
82
     * @param couponCode
83
     */
3430 rajveer 84
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
3385 varun.gupt 85
 
86
    /**
87
     * Returns the doc string of the rule module
88
     * 
89
     * @param ruleName
90
     */
3430 rajveer 91
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException;
3385 varun.gupt 92
 
4189 varun.gupt 93
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException;
94
 
4494 varun.gupt 95
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException;
96
 
5469 rajveer 97
    public void addVoucher(Voucher voucher) throws org.apache.thrift.TException;
98
 
99
    public Voucher assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException;
100
 
101
    public boolean markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException;
102
 
1982 varun.gupt 103
  }
104
 
3430 rajveer 105
  public interface AsyncIface extends in.shop2020.generic.GenericService .AsyncIface {
1982 varun.gupt 106
 
3430 rajveer 107
    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 108
 
7746 amit.gupta 109
    public void removeAllCouponsByPromotionId(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.removeAllCouponsByPromotionId_call> resultHandler) throws org.apache.thrift.TException;
110
 
6301 amit.gupta 111
    public void getCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCoupon_call> resultHandler) throws org.apache.thrift.TException;
112
 
113
    public void isGiftVoucher(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.isGiftVoucher_call> resultHandler) throws org.apache.thrift.TException;
114
 
11819 amit.gupta 115
    public void isCodApplicable(Cart cart, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.isCodApplicable_call> resultHandler) throws org.apache.thrift.TException;
6356 amit.gupta 116
 
3430 rajveer 117
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllPromotions_call> resultHandler) throws org.apache.thrift.TException;
118
 
119
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPromotionById_call> resultHandler) throws org.apache.thrift.TException;
120
 
121
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException;
122
 
123
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyCoupon_call> resultHandler) throws org.apache.thrift.TException;
124
 
6736 amit.gupta 125
    public void getEmiDiscount(long cartId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getEmiDiscount_call> resultHandler) throws org.apache.thrift.TException;
126
 
6433 anupam.sin 127
    public void applyRechargeCoupon(String couponCode, long totalAmount, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyRechargeCoupon_call> resultHandler) throws org.apache.thrift.TException;
128
 
3430 rajveer 129
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException;
130
 
131
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException;
132
 
6497 amit.gupta 133
    public void getActiveCodes(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getActiveCodes_call> resultHandler) throws org.apache.thrift.TException;
134
 
135
    public void deleteCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.deleteCoupon_call> resultHandler) throws org.apache.thrift.TException;
136
 
7092 amit.gupta 137
    public void getAllCouponsByPromotionId(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllCouponsByPromotionId_call> resultHandler) throws org.apache.thrift.TException;
138
 
3430 rajveer 139
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException;
140
 
8707 manish.sha 141
    public void createCoupon(long promotionId, long couponCategory, String couponCode, String arguments, boolean isCod, String prefix, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.createCoupon_call> resultHandler) throws org.apache.thrift.TException;
6250 amit.gupta 142
 
3430 rajveer 143
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException;
144
 
145
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getRuleDocString_call> resultHandler) throws org.apache.thrift.TException;
146
 
4189 varun.gupt 147
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException;
148
 
4494 varun.gupt 149
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException;
150
 
5469 rajveer 151
    public void addVoucher(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.addVoucher_call> resultHandler) throws org.apache.thrift.TException;
152
 
153
    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;
154
 
155
    public void markVoucherAsRedeemed(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.markVoucherAsRedeemed_call> resultHandler) throws org.apache.thrift.TException;
156
 
3430 rajveer 157
  }
158
 
159
  public static class Client extends in.shop2020.generic.GenericService.Client implements Iface {
160
    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
161
      public Factory() {}
162
      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
163
        return new Client(prot);
164
      }
165
      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
166
        return new Client(iprot, oprot);
167
      }
1982 varun.gupt 168
    }
169
 
3430 rajveer 170
    public Client(org.apache.thrift.protocol.TProtocol prot)
1982 varun.gupt 171
    {
3430 rajveer 172
      super(prot, prot);
1982 varun.gupt 173
    }
174
 
3430 rajveer 175
    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
176
      super(iprot, oprot);
1982 varun.gupt 177
    }
178
 
3430 rajveer 179
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 180
    {
181
      send_createPromotion(name, ruleExecutionSrc, startOn, endOn);
182
      recv_createPromotion();
183
    }
184
 
3430 rajveer 185
    public void send_createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws org.apache.thrift.TException
1982 varun.gupt 186
    {
187
      createPromotion_args args = new createPromotion_args();
3430 rajveer 188
      args.setName(name);
189
      args.setRuleExecutionSrc(ruleExecutionSrc);
190
      args.setStartOn(startOn);
191
      args.setEndOn(endOn);
192
      sendBase("createPromotion", args);
1982 varun.gupt 193
    }
194
 
3430 rajveer 195
    public void recv_createPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 196
    {
197
      createPromotion_result result = new createPromotion_result();
3430 rajveer 198
      receiveBase(result, "createPromotion");
1982 varun.gupt 199
      if (result.pex != null) {
200
        throw result.pex;
201
      }
202
      return;
203
    }
204
 
7746 amit.gupta 205
    public long removeAllCouponsByPromotionId(long promotionId) throws PromotionException, org.apache.thrift.TException
206
    {
207
      send_removeAllCouponsByPromotionId(promotionId);
208
      return recv_removeAllCouponsByPromotionId();
209
    }
210
 
211
    public void send_removeAllCouponsByPromotionId(long promotionId) throws org.apache.thrift.TException
212
    {
213
      removeAllCouponsByPromotionId_args args = new removeAllCouponsByPromotionId_args();
214
      args.setPromotionId(promotionId);
215
      sendBase("removeAllCouponsByPromotionId", args);
216
    }
217
 
218
    public long recv_removeAllCouponsByPromotionId() throws PromotionException, org.apache.thrift.TException
219
    {
220
      removeAllCouponsByPromotionId_result result = new removeAllCouponsByPromotionId_result();
221
      receiveBase(result, "removeAllCouponsByPromotionId");
222
      if (result.isSetSuccess()) {
223
        return result.success;
224
      }
225
      if (result.pex != null) {
226
        throw result.pex;
227
      }
228
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "removeAllCouponsByPromotionId failed: unknown result");
229
    }
230
 
6301 amit.gupta 231
    public Coupon getCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
232
    {
233
      send_getCoupon(couponCode);
234
      return recv_getCoupon();
235
    }
236
 
237
    public void send_getCoupon(String couponCode) throws org.apache.thrift.TException
238
    {
239
      getCoupon_args args = new getCoupon_args();
240
      args.setCouponCode(couponCode);
241
      sendBase("getCoupon", args);
242
    }
243
 
244
    public Coupon recv_getCoupon() throws PromotionException, org.apache.thrift.TException
245
    {
246
      getCoupon_result result = new getCoupon_result();
247
      receiveBase(result, "getCoupon");
248
      if (result.isSetSuccess()) {
249
        return result.success;
250
      }
251
      if (result.pex != null) {
252
        throw result.pex;
253
      }
254
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCoupon failed: unknown result");
255
    }
256
 
257
    public boolean isGiftVoucher(String couponCode) throws PromotionException, org.apache.thrift.TException
258
    {
259
      send_isGiftVoucher(couponCode);
260
      return recv_isGiftVoucher();
261
    }
262
 
263
    public void send_isGiftVoucher(String couponCode) throws org.apache.thrift.TException
264
    {
265
      isGiftVoucher_args args = new isGiftVoucher_args();
266
      args.setCouponCode(couponCode);
267
      sendBase("isGiftVoucher", args);
268
    }
269
 
270
    public boolean recv_isGiftVoucher() throws PromotionException, org.apache.thrift.TException
271
    {
272
      isGiftVoucher_result result = new isGiftVoucher_result();
273
      receiveBase(result, "isGiftVoucher");
274
      if (result.isSetSuccess()) {
275
        return result.success;
276
      }
277
      if (result.pex != null) {
278
        throw result.pex;
279
      }
280
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isGiftVoucher failed: unknown result");
281
    }
282
 
11819 amit.gupta 283
    public boolean isCodApplicable(Cart cart) throws PromotionException, org.apache.thrift.TException
6356 amit.gupta 284
    {
11819 amit.gupta 285
      send_isCodApplicable(cart);
6356 amit.gupta 286
      return recv_isCodApplicable();
287
    }
288
 
11819 amit.gupta 289
    public void send_isCodApplicable(Cart cart) throws org.apache.thrift.TException
6356 amit.gupta 290
    {
291
      isCodApplicable_args args = new isCodApplicable_args();
11819 amit.gupta 292
      args.setCart(cart);
6356 amit.gupta 293
      sendBase("isCodApplicable", args);
294
    }
295
 
296
    public boolean recv_isCodApplicable() throws PromotionException, org.apache.thrift.TException
297
    {
298
      isCodApplicable_result result = new isCodApplicable_result();
299
      receiveBase(result, "isCodApplicable");
300
      if (result.isSetSuccess()) {
301
        return result.success;
302
      }
303
      if (result.pex != null) {
304
        throw result.pex;
305
      }
306
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isCodApplicable failed: unknown result");
307
    }
308
 
3430 rajveer 309
    public List<Promotion> getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 310
    {
311
      send_getAllPromotions();
312
      return recv_getAllPromotions();
313
    }
314
 
3430 rajveer 315
    public void send_getAllPromotions() throws org.apache.thrift.TException
1982 varun.gupt 316
    {
317
      getAllPromotions_args args = new getAllPromotions_args();
3430 rajveer 318
      sendBase("getAllPromotions", args);
1982 varun.gupt 319
    }
320
 
3430 rajveer 321
    public List<Promotion> recv_getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 322
    {
323
      getAllPromotions_result result = new getAllPromotions_result();
3430 rajveer 324
      receiveBase(result, "getAllPromotions");
1982 varun.gupt 325
      if (result.isSetSuccess()) {
326
        return result.success;
327
      }
328
      if (result.pex != null) {
329
        throw result.pex;
330
      }
3430 rajveer 331
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllPromotions failed: unknown result");
1982 varun.gupt 332
    }
333
 
3430 rajveer 334
    public Promotion getPromotionById(long promotionId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 335
    {
336
      send_getPromotionById(promotionId);
337
      return recv_getPromotionById();
338
    }
339
 
3430 rajveer 340
    public void send_getPromotionById(long promotionId) throws org.apache.thrift.TException
1982 varun.gupt 341
    {
342
      getPromotionById_args args = new getPromotionById_args();
3430 rajveer 343
      args.setPromotionId(promotionId);
344
      sendBase("getPromotionById", args);
1982 varun.gupt 345
    }
346
 
3430 rajveer 347
    public Promotion recv_getPromotionById() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 348
    {
349
      getPromotionById_result result = new getPromotionById_result();
3430 rajveer 350
      receiveBase(result, "getPromotionById");
1982 varun.gupt 351
      if (result.isSetSuccess()) {
352
        return result.success;
353
      }
354
      if (result.pex != null) {
355
        throw result.pex;
356
      }
3430 rajveer 357
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPromotionById failed: unknown result");
1982 varun.gupt 358
    }
359
 
3430 rajveer 360
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 361
    {
362
      send_generateCouponsForPromotion(promotionId, couponCode);
363
      recv_generateCouponsForPromotion();
364
    }
365
 
3430 rajveer 366
    public void send_generateCouponsForPromotion(long promotionId, String couponCode) throws org.apache.thrift.TException
1982 varun.gupt 367
    {
368
      generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
3430 rajveer 369
      args.setPromotionId(promotionId);
370
      args.setCouponCode(couponCode);
371
      sendBase("generateCouponsForPromotion", args);
1982 varun.gupt 372
    }
373
 
3430 rajveer 374
    public void recv_generateCouponsForPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 375
    {
376
      generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
3430 rajveer 377
      receiveBase(result, "generateCouponsForPromotion");
1982 varun.gupt 378
      if (result.pex != null) {
379
        throw result.pex;
380
      }
381
      return;
382
    }
383
 
3430 rajveer 384
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 385
    {
386
      send_applyCoupon(couponCode, cartId);
387
      return recv_applyCoupon();
388
    }
389
 
3430 rajveer 390
    public void send_applyCoupon(String couponCode, long cartId) throws org.apache.thrift.TException
1982 varun.gupt 391
    {
392
      applyCoupon_args args = new applyCoupon_args();
3430 rajveer 393
      args.setCouponCode(couponCode);
394
      args.setCartId(cartId);
395
      sendBase("applyCoupon", args);
1982 varun.gupt 396
    }
397
 
3430 rajveer 398
    public Cart recv_applyCoupon() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 399
    {
400
      applyCoupon_result result = new applyCoupon_result();
3430 rajveer 401
      receiveBase(result, "applyCoupon");
1982 varun.gupt 402
      if (result.isSetSuccess()) {
403
        return result.success;
404
      }
405
      if (result.pex != null) {
406
        throw result.pex;
407
      }
3430 rajveer 408
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "applyCoupon failed: unknown result");
1982 varun.gupt 409
    }
410
 
6736 amit.gupta 411
    public Map<Long,Double> getEmiDiscount(long cartId) throws PromotionException, org.apache.thrift.TException
412
    {
413
      send_getEmiDiscount(cartId);
414
      return recv_getEmiDiscount();
415
    }
416
 
417
    public void send_getEmiDiscount(long cartId) throws org.apache.thrift.TException
418
    {
419
      getEmiDiscount_args args = new getEmiDiscount_args();
420
      args.setCartId(cartId);
421
      sendBase("getEmiDiscount", args);
422
    }
423
 
424
    public Map<Long,Double> recv_getEmiDiscount() throws PromotionException, org.apache.thrift.TException
425
    {
426
      getEmiDiscount_result result = new getEmiDiscount_result();
427
      receiveBase(result, "getEmiDiscount");
428
      if (result.isSetSuccess()) {
429
        return result.success;
430
      }
431
      if (result.pex != null) {
432
        throw result.pex;
433
      }
434
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getEmiDiscount failed: unknown result");
435
    }
436
 
6433 anupam.sin 437
    public Map<Long,String> applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws PromotionException, org.apache.thrift.TException
438
    {
439
      send_applyRechargeCoupon(couponCode, totalAmount, userId);
440
      return recv_applyRechargeCoupon();
441
    }
442
 
443
    public void send_applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws org.apache.thrift.TException
444
    {
445
      applyRechargeCoupon_args args = new applyRechargeCoupon_args();
446
      args.setCouponCode(couponCode);
447
      args.setTotalAmount(totalAmount);
448
      args.setUserId(userId);
449
      sendBase("applyRechargeCoupon", args);
450
    }
451
 
452
    public Map<Long,String> recv_applyRechargeCoupon() throws PromotionException, org.apache.thrift.TException
453
    {
454
      applyRechargeCoupon_result result = new applyRechargeCoupon_result();
455
      receiveBase(result, "applyRechargeCoupon");
456
      if (result.isSetSuccess()) {
457
        return result.success;
458
      }
459
      if (result.pex != null) {
460
        throw result.pex;
461
      }
462
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "applyRechargeCoupon failed: unknown result");
463
    }
464
 
3430 rajveer 465
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 466
    {
467
      send_trackCouponUsage(couponCode, transactionId, userId);
468
      recv_trackCouponUsage();
469
    }
470
 
3430 rajveer 471
    public void send_trackCouponUsage(String couponCode, long transactionId, long userId) throws org.apache.thrift.TException
1982 varun.gupt 472
    {
473
      trackCouponUsage_args args = new trackCouponUsage_args();
3430 rajveer 474
      args.setCouponCode(couponCode);
475
      args.setTransactionId(transactionId);
476
      args.setUserId(userId);
477
      sendBase("trackCouponUsage", args);
1982 varun.gupt 478
    }
479
 
3430 rajveer 480
    public void recv_trackCouponUsage() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 481
    {
482
      trackCouponUsage_result result = new trackCouponUsage_result();
3430 rajveer 483
      receiveBase(result, "trackCouponUsage");
1982 varun.gupt 484
      if (result.pex != null) {
485
        throw result.pex;
486
      }
487
      return;
488
    }
489
 
3430 rajveer 490
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 491
    {
492
      send_getCouponUsageCountByUser(couponCode, userId);
493
      return recv_getCouponUsageCountByUser();
494
    }
495
 
3430 rajveer 496
    public void send_getCouponUsageCountByUser(String couponCode, long userId) throws org.apache.thrift.TException
1982 varun.gupt 497
    {
498
      getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
3430 rajveer 499
      args.setCouponCode(couponCode);
500
      args.setUserId(userId);
501
      sendBase("getCouponUsageCountByUser", args);
1982 varun.gupt 502
    }
503
 
3430 rajveer 504
    public long recv_getCouponUsageCountByUser() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 505
    {
506
      getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
3430 rajveer 507
      receiveBase(result, "getCouponUsageCountByUser");
1982 varun.gupt 508
      if (result.isSetSuccess()) {
509
        return result.success;
510
      }
511
      if (result.pex != null) {
512
        throw result.pex;
513
      }
3430 rajveer 514
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCouponUsageCountByUser failed: unknown result");
1982 varun.gupt 515
    }
516
 
6497 amit.gupta 517
    public List<Coupon> getActiveCodes(long promotionId) throws PromotionException, org.apache.thrift.TException
518
    {
519
      send_getActiveCodes(promotionId);
520
      return recv_getActiveCodes();
521
    }
522
 
523
    public void send_getActiveCodes(long promotionId) throws org.apache.thrift.TException
524
    {
525
      getActiveCodes_args args = new getActiveCodes_args();
526
      args.setPromotionId(promotionId);
527
      sendBase("getActiveCodes", args);
528
    }
529
 
530
    public List<Coupon> recv_getActiveCodes() throws PromotionException, org.apache.thrift.TException
531
    {
532
      getActiveCodes_result result = new getActiveCodes_result();
533
      receiveBase(result, "getActiveCodes");
534
      if (result.isSetSuccess()) {
535
        return result.success;
536
      }
537
      if (result.pex != null) {
538
        throw result.pex;
539
      }
540
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getActiveCodes failed: unknown result");
541
    }
542
 
543
    public void deleteCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
544
    {
545
      send_deleteCoupon(couponCode);
546
      recv_deleteCoupon();
547
    }
548
 
549
    public void send_deleteCoupon(String couponCode) throws org.apache.thrift.TException
550
    {
551
      deleteCoupon_args args = new deleteCoupon_args();
552
      args.setCouponCode(couponCode);
553
      sendBase("deleteCoupon", args);
554
    }
555
 
556
    public void recv_deleteCoupon() throws PromotionException, org.apache.thrift.TException
557
    {
558
      deleteCoupon_result result = new deleteCoupon_result();
559
      receiveBase(result, "deleteCoupon");
560
      if (result.pex != null) {
561
        throw result.pex;
562
      }
563
      return;
564
    }
565
 
7092 amit.gupta 566
    public List<Coupon> getAllCouponsByPromotionId(long promotionId) throws PromotionException, org.apache.thrift.TException
567
    {
568
      send_getAllCouponsByPromotionId(promotionId);
569
      return recv_getAllCouponsByPromotionId();
570
    }
571
 
572
    public void send_getAllCouponsByPromotionId(long promotionId) throws org.apache.thrift.TException
573
    {
574
      getAllCouponsByPromotionId_args args = new getAllCouponsByPromotionId_args();
575
      args.setPromotionId(promotionId);
576
      sendBase("getAllCouponsByPromotionId", args);
577
    }
578
 
579
    public List<Coupon> recv_getAllCouponsByPromotionId() throws PromotionException, org.apache.thrift.TException
580
    {
581
      getAllCouponsByPromotionId_result result = new getAllCouponsByPromotionId_result();
582
      receiveBase(result, "getAllCouponsByPromotionId");
583
      if (result.isSetSuccess()) {
584
        return result.success;
585
      }
586
      if (result.pex != null) {
587
        throw result.pex;
588
      }
589
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllCouponsByPromotionId failed: unknown result");
590
    }
591
 
3430 rajveer 592
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 593
    {
594
      send_getActiveCoupons();
595
      return recv_getActiveCoupons();
596
    }
597
 
3430 rajveer 598
    public void send_getActiveCoupons() throws org.apache.thrift.TException
3385 varun.gupt 599
    {
600
      getActiveCoupons_args args = new getActiveCoupons_args();
3430 rajveer 601
      sendBase("getActiveCoupons", args);
3385 varun.gupt 602
    }
603
 
3430 rajveer 604
    public List<Coupon> recv_getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 605
    {
606
      getActiveCoupons_result result = new getActiveCoupons_result();
3430 rajveer 607
      receiveBase(result, "getActiveCoupons");
3385 varun.gupt 608
      if (result.isSetSuccess()) {
609
        return result.success;
610
      }
611
      if (result.pex != null) {
612
        throw result.pex;
613
      }
3430 rajveer 614
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getActiveCoupons failed: unknown result");
3385 varun.gupt 615
    }
616
 
8707 manish.sha 617
    public String createCoupon(long promotionId, long couponCategory, String couponCode, String arguments, boolean isCod, String prefix) throws PromotionException, org.apache.thrift.TException
6250 amit.gupta 618
    {
8707 manish.sha 619
      send_createCoupon(promotionId, couponCategory, couponCode, arguments, isCod, prefix);
6250 amit.gupta 620
      return recv_createCoupon();
621
    }
622
 
8707 manish.sha 623
    public void send_createCoupon(long promotionId, long couponCategory, String couponCode, String arguments, boolean isCod, String prefix) throws org.apache.thrift.TException
6250 amit.gupta 624
    {
625
      createCoupon_args args = new createCoupon_args();
626
      args.setPromotionId(promotionId);
8707 manish.sha 627
      args.setCouponCategory(couponCategory);
6730 anupam.sin 628
      args.setCouponCode(couponCode);
6679 anupam.sin 629
      args.setArguments(arguments);
6356 amit.gupta 630
      args.setIsCod(isCod);
6561 amit.gupta 631
      args.setPrefix(prefix);
6250 amit.gupta 632
      sendBase("createCoupon", args);
633
    }
634
 
635
    public String recv_createCoupon() throws PromotionException, org.apache.thrift.TException
636
    {
637
      createCoupon_result result = new createCoupon_result();
638
      receiveBase(result, "createCoupon");
639
      if (result.isSetSuccess()) {
640
        return result.success;
641
      }
642
      if (result.pex != null) {
643
        throw result.pex;
644
      }
645
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createCoupon failed: unknown result");
646
    }
647
 
3430 rajveer 648
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 649
    {
650
      send_getSuccessfulPaymentCountForCoupon(couponCode);
651
      return recv_getSuccessfulPaymentCountForCoupon();
652
    }
653
 
3430 rajveer 654
    public void send_getSuccessfulPaymentCountForCoupon(String couponCode) throws org.apache.thrift.TException
3385 varun.gupt 655
    {
656
      getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
3430 rajveer 657
      args.setCouponCode(couponCode);
658
      sendBase("getSuccessfulPaymentCountForCoupon", args);
3385 varun.gupt 659
    }
660
 
3430 rajveer 661
    public long recv_getSuccessfulPaymentCountForCoupon() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 662
    {
663
      getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
3430 rajveer 664
      receiveBase(result, "getSuccessfulPaymentCountForCoupon");
3385 varun.gupt 665
      if (result.isSetSuccess()) {
666
        return result.success;
667
      }
668
      if (result.pex != null) {
669
        throw result.pex;
670
      }
3430 rajveer 671
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSuccessfulPaymentCountForCoupon failed: unknown result");
3385 varun.gupt 672
    }
673
 
3430 rajveer 674
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 675
    {
676
      send_getRuleDocString(ruleName);
677
      return recv_getRuleDocString();
678
    }
679
 
3430 rajveer 680
    public void send_getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 681
    {
682
      getRuleDocString_args args = new getRuleDocString_args();
3430 rajveer 683
      args.setRuleName(ruleName);
684
      sendBase("getRuleDocString", args);
3385 varun.gupt 685
    }
686
 
3430 rajveer 687
    public String recv_getRuleDocString() throws org.apache.thrift.TException
3385 varun.gupt 688
    {
689
      getRuleDocString_result result = new getRuleDocString_result();
3430 rajveer 690
      receiveBase(result, "getRuleDocString");
3385 varun.gupt 691
      if (result.isSetSuccess()) {
692
        return result.success;
693
      }
3430 rajveer 694
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRuleDocString failed: unknown result");
3385 varun.gupt 695
    }
696
 
4189 varun.gupt 697
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException
698
    {
699
      send_getItemDiscountMap(itemIds);
700
      return recv_getItemDiscountMap();
701
    }
702
 
703
    public void send_getItemDiscountMap(List<Long> itemIds) throws org.apache.thrift.TException
704
    {
705
      getItemDiscountMap_args args = new getItemDiscountMap_args();
706
      args.setItemIds(itemIds);
707
      sendBase("getItemDiscountMap", args);
708
    }
709
 
710
    public List<ItemCouponDiscount> recv_getItemDiscountMap() throws PromotionException, org.apache.thrift.TException
711
    {
712
      getItemDiscountMap_result result = new getItemDiscountMap_result();
713
      receiveBase(result, "getItemDiscountMap");
714
      if (result.isSetSuccess()) {
715
        return result.success;
716
      }
717
      if (result.pex != null) {
718
        throw result.pex;
719
      }
720
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemDiscountMap failed: unknown result");
721
    }
722
 
4494 varun.gupt 723
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
724
    {
725
      send_getDiscountsForEntity(entityId);
726
      return recv_getDiscountsForEntity();
727
    }
728
 
729
    public void send_getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
730
    {
731
      getDiscountsForEntity_args args = new getDiscountsForEntity_args();
732
      args.setEntityId(entityId);
733
      sendBase("getDiscountsForEntity", args);
734
    }
735
 
736
    public Map<String,Double> recv_getDiscountsForEntity() throws org.apache.thrift.TException
737
    {
738
      getDiscountsForEntity_result result = new getDiscountsForEntity_result();
739
      receiveBase(result, "getDiscountsForEntity");
740
      if (result.isSetSuccess()) {
741
        return result.success;
742
      }
743
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getDiscountsForEntity failed: unknown result");
744
    }
745
 
5469 rajveer 746
    public void addVoucher(Voucher voucher) throws org.apache.thrift.TException
747
    {
748
      send_addVoucher(voucher);
749
      recv_addVoucher();
750
    }
751
 
752
    public void send_addVoucher(Voucher voucher) throws org.apache.thrift.TException
753
    {
754
      addVoucher_args args = new addVoucher_args();
755
      args.setVoucher(voucher);
756
      sendBase("addVoucher", args);
757
    }
758
 
759
    public void recv_addVoucher() throws org.apache.thrift.TException
760
    {
761
      addVoucher_result result = new addVoucher_result();
762
      receiveBase(result, "addVoucher");
763
      return;
764
    }
765
 
766
    public Voucher assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException
767
    {
768
      send_assignVoucher(userId, userEmail, voucherType, amount);
769
      return recv_assignVoucher();
770
    }
771
 
772
    public void send_assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException
773
    {
774
      assignVoucher_args args = new assignVoucher_args();
775
      args.setUserId(userId);
776
      args.setUserEmail(userEmail);
777
      args.setVoucherType(voucherType);
778
      args.setAmount(amount);
779
      sendBase("assignVoucher", args);
780
    }
781
 
782
    public Voucher recv_assignVoucher() throws org.apache.thrift.TException
783
    {
784
      assignVoucher_result result = new assignVoucher_result();
785
      receiveBase(result, "assignVoucher");
786
      if (result.isSetSuccess()) {
787
        return result.success;
788
      }
789
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "assignVoucher failed: unknown result");
790
    }
791
 
792
    public boolean markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException
793
    {
794
      send_markVoucherAsRedeemed(voucherCode, redeemedOn);
795
      return recv_markVoucherAsRedeemed();
796
    }
797
 
798
    public void send_markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException
799
    {
800
      markVoucherAsRedeemed_args args = new markVoucherAsRedeemed_args();
801
      args.setVoucherCode(voucherCode);
802
      args.setRedeemedOn(redeemedOn);
803
      sendBase("markVoucherAsRedeemed", args);
804
    }
805
 
806
    public boolean recv_markVoucherAsRedeemed() throws org.apache.thrift.TException
807
    {
808
      markVoucherAsRedeemed_result result = new markVoucherAsRedeemed_result();
809
      receiveBase(result, "markVoucherAsRedeemed");
810
      if (result.isSetSuccess()) {
811
        return result.success;
812
      }
813
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "markVoucherAsRedeemed failed: unknown result");
814
    }
815
 
1982 varun.gupt 816
  }
3430 rajveer 817
  public static class AsyncClient extends in.shop2020.generic.GenericService.AsyncClient implements AsyncIface {
818
    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
819
      private org.apache.thrift.async.TAsyncClientManager clientManager;
820
      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
821
      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
822
        this.clientManager = clientManager;
823
        this.protocolFactory = protocolFactory;
824
      }
825
      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
826
        return new AsyncClient(protocolFactory, clientManager, transport);
827
      }
1982 varun.gupt 828
    }
829
 
3430 rajveer 830
    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
831
      super(protocolFactory, clientManager, transport);
832
    }
1982 varun.gupt 833
 
3430 rajveer 834
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn, org.apache.thrift.async.AsyncMethodCallback<createPromotion_call> resultHandler) throws org.apache.thrift.TException {
835
      checkReady();
836
      createPromotion_call method_call = new createPromotion_call(name, ruleExecutionSrc, startOn, endOn, resultHandler, this, ___protocolFactory, ___transport);
837
      this.___currentMethod = method_call;
838
      ___manager.call(method_call);
1982 varun.gupt 839
    }
840
 
3430 rajveer 841
    public static class createPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
842
      private String name;
843
      private String ruleExecutionSrc;
844
      private long startOn;
845
      private long endOn;
846
      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 {
847
        super(client, protocolFactory, transport, resultHandler, false);
848
        this.name = name;
849
        this.ruleExecutionSrc = ruleExecutionSrc;
850
        this.startOn = startOn;
851
        this.endOn = endOn;
1982 varun.gupt 852
      }
853
 
3430 rajveer 854
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
855
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
1982 varun.gupt 856
        createPromotion_args args = new createPromotion_args();
3430 rajveer 857
        args.setName(name);
858
        args.setRuleExecutionSrc(ruleExecutionSrc);
859
        args.setStartOn(startOn);
860
        args.setEndOn(endOn);
861
        args.write(prot);
862
        prot.writeMessageEnd();
1982 varun.gupt 863
      }
864
 
3430 rajveer 865
      public void getResult() throws PromotionException, org.apache.thrift.TException {
866
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
867
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 868
        }
3430 rajveer 869
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
870
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
871
        (new Client(prot)).recv_createPromotion();
1982 varun.gupt 872
      }
3430 rajveer 873
    }
1982 varun.gupt 874
 
7746 amit.gupta 875
    public void removeAllCouponsByPromotionId(long promotionId, org.apache.thrift.async.AsyncMethodCallback<removeAllCouponsByPromotionId_call> resultHandler) throws org.apache.thrift.TException {
876
      checkReady();
877
      removeAllCouponsByPromotionId_call method_call = new removeAllCouponsByPromotionId_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
878
      this.___currentMethod = method_call;
879
      ___manager.call(method_call);
880
    }
881
 
882
    public static class removeAllCouponsByPromotionId_call extends org.apache.thrift.async.TAsyncMethodCall {
883
      private long promotionId;
884
      public removeAllCouponsByPromotionId_call(long promotionId, org.apache.thrift.async.AsyncMethodCallback<removeAllCouponsByPromotionId_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 {
885
        super(client, protocolFactory, transport, resultHandler, false);
886
        this.promotionId = promotionId;
887
      }
888
 
889
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
890
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("removeAllCouponsByPromotionId", org.apache.thrift.protocol.TMessageType.CALL, 0));
891
        removeAllCouponsByPromotionId_args args = new removeAllCouponsByPromotionId_args();
892
        args.setPromotionId(promotionId);
893
        args.write(prot);
894
        prot.writeMessageEnd();
895
      }
896
 
897
      public long getResult() throws PromotionException, org.apache.thrift.TException {
898
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
899
          throw new IllegalStateException("Method call not finished!");
900
        }
901
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
902
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
903
        return (new Client(prot)).recv_removeAllCouponsByPromotionId();
904
      }
905
    }
906
 
6301 amit.gupta 907
    public void getCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getCoupon_call> resultHandler) throws org.apache.thrift.TException {
908
      checkReady();
909
      getCoupon_call method_call = new getCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
910
      this.___currentMethod = method_call;
911
      ___manager.call(method_call);
912
    }
913
 
914
    public static class getCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
915
      private String couponCode;
916
      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 {
917
        super(client, protocolFactory, transport, resultHandler, false);
918
        this.couponCode = couponCode;
919
      }
920
 
921
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
922
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
923
        getCoupon_args args = new getCoupon_args();
924
        args.setCouponCode(couponCode);
925
        args.write(prot);
926
        prot.writeMessageEnd();
927
      }
928
 
929
      public Coupon getResult() throws PromotionException, org.apache.thrift.TException {
930
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
931
          throw new IllegalStateException("Method call not finished!");
932
        }
933
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
934
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
935
        return (new Client(prot)).recv_getCoupon();
936
      }
937
    }
938
 
939
    public void isGiftVoucher(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isGiftVoucher_call> resultHandler) throws org.apache.thrift.TException {
940
      checkReady();
941
      isGiftVoucher_call method_call = new isGiftVoucher_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
942
      this.___currentMethod = method_call;
943
      ___manager.call(method_call);
944
    }
945
 
946
    public static class isGiftVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
947
      private String couponCode;
948
      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 {
949
        super(client, protocolFactory, transport, resultHandler, false);
950
        this.couponCode = couponCode;
951
      }
952
 
953
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
954
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isGiftVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
955
        isGiftVoucher_args args = new isGiftVoucher_args();
956
        args.setCouponCode(couponCode);
957
        args.write(prot);
958
        prot.writeMessageEnd();
959
      }
960
 
961
      public boolean getResult() throws PromotionException, org.apache.thrift.TException {
962
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
963
          throw new IllegalStateException("Method call not finished!");
964
        }
965
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
966
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
967
        return (new Client(prot)).recv_isGiftVoucher();
968
      }
969
    }
970
 
11819 amit.gupta 971
    public void isCodApplicable(Cart cart, org.apache.thrift.async.AsyncMethodCallback<isCodApplicable_call> resultHandler) throws org.apache.thrift.TException {
6356 amit.gupta 972
      checkReady();
11819 amit.gupta 973
      isCodApplicable_call method_call = new isCodApplicable_call(cart, resultHandler, this, ___protocolFactory, ___transport);
6356 amit.gupta 974
      this.___currentMethod = method_call;
975
      ___manager.call(method_call);
976
    }
977
 
978
    public static class isCodApplicable_call extends org.apache.thrift.async.TAsyncMethodCall {
11819 amit.gupta 979
      private Cart cart;
980
      public isCodApplicable_call(Cart cart, 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 {
6356 amit.gupta 981
        super(client, protocolFactory, transport, resultHandler, false);
11819 amit.gupta 982
        this.cart = cart;
6356 amit.gupta 983
      }
984
 
985
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
986
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isCodApplicable", org.apache.thrift.protocol.TMessageType.CALL, 0));
987
        isCodApplicable_args args = new isCodApplicable_args();
11819 amit.gupta 988
        args.setCart(cart);
6356 amit.gupta 989
        args.write(prot);
990
        prot.writeMessageEnd();
991
      }
992
 
993
      public boolean getResult() throws PromotionException, org.apache.thrift.TException {
994
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
995
          throw new IllegalStateException("Method call not finished!");
996
        }
997
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
998
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
999
        return (new Client(prot)).recv_isCodApplicable();
1000
      }
1001
    }
1002
 
3430 rajveer 1003
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<getAllPromotions_call> resultHandler) throws org.apache.thrift.TException {
1004
      checkReady();
1005
      getAllPromotions_call method_call = new getAllPromotions_call(resultHandler, this, ___protocolFactory, ___transport);
1006
      this.___currentMethod = method_call;
1007
      ___manager.call(method_call);
1982 varun.gupt 1008
    }
1009
 
3430 rajveer 1010
    public static class getAllPromotions_call extends org.apache.thrift.async.TAsyncMethodCall {
1011
      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 {
1012
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 1013
      }
1014
 
3430 rajveer 1015
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1016
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllPromotions", org.apache.thrift.protocol.TMessageType.CALL, 0));
1017
        getAllPromotions_args args = new getAllPromotions_args();
1018
        args.write(prot);
1019
        prot.writeMessageEnd();
1020
      }
1982 varun.gupt 1021
 
3430 rajveer 1022
      public List<Promotion> getResult() throws PromotionException, org.apache.thrift.TException {
1023
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1024
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 1025
        }
3430 rajveer 1026
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1027
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1028
        return (new Client(prot)).recv_getAllPromotions();
1982 varun.gupt 1029
      }
3430 rajveer 1030
    }
1982 varun.gupt 1031
 
3430 rajveer 1032
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getPromotionById_call> resultHandler) throws org.apache.thrift.TException {
1033
      checkReady();
1034
      getPromotionById_call method_call = new getPromotionById_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
1035
      this.___currentMethod = method_call;
1036
      ___manager.call(method_call);
1982 varun.gupt 1037
    }
1038
 
3430 rajveer 1039
    public static class getPromotionById_call extends org.apache.thrift.async.TAsyncMethodCall {
1040
      private long promotionId;
1041
      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 {
1042
        super(client, protocolFactory, transport, resultHandler, false);
1043
        this.promotionId = promotionId;
1982 varun.gupt 1044
      }
1045
 
3430 rajveer 1046
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1047
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPromotionById", org.apache.thrift.protocol.TMessageType.CALL, 0));
1048
        getPromotionById_args args = new getPromotionById_args();
1049
        args.setPromotionId(promotionId);
1050
        args.write(prot);
1051
        prot.writeMessageEnd();
1052
      }
1982 varun.gupt 1053
 
3430 rajveer 1054
      public Promotion getResult() throws PromotionException, org.apache.thrift.TException {
1055
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1056
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 1057
        }
3430 rajveer 1058
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1059
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1060
        return (new Client(prot)).recv_getPromotionById();
1982 varun.gupt 1061
      }
3430 rajveer 1062
    }
1982 varun.gupt 1063
 
3430 rajveer 1064
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException {
1065
      checkReady();
1066
      generateCouponsForPromotion_call method_call = new generateCouponsForPromotion_call(promotionId, couponCode, resultHandler, this, ___protocolFactory, ___transport);
1067
      this.___currentMethod = method_call;
1068
      ___manager.call(method_call);
1982 varun.gupt 1069
    }
1070
 
3430 rajveer 1071
    public static class generateCouponsForPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
1072
      private long promotionId;
1073
      private String couponCode;
1074
      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 {
1075
        super(client, protocolFactory, transport, resultHandler, false);
1076
        this.promotionId = promotionId;
1077
        this.couponCode = couponCode;
1982 varun.gupt 1078
      }
1079
 
3430 rajveer 1080
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1081
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("generateCouponsForPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
1082
        generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
1083
        args.setPromotionId(promotionId);
1084
        args.setCouponCode(couponCode);
1085
        args.write(prot);
1086
        prot.writeMessageEnd();
3385 varun.gupt 1087
      }
1088
 
3430 rajveer 1089
      public void getResult() throws PromotionException, org.apache.thrift.TException {
1090
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1091
          throw new IllegalStateException("Method call not finished!");
3385 varun.gupt 1092
        }
3430 rajveer 1093
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1094
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1095
        (new Client(prot)).recv_generateCouponsForPromotion();
3385 varun.gupt 1096
      }
1097
    }
1098
 
3430 rajveer 1099
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<applyCoupon_call> resultHandler) throws org.apache.thrift.TException {
1100
      checkReady();
1101
      applyCoupon_call method_call = new applyCoupon_call(couponCode, cartId, resultHandler, this, ___protocolFactory, ___transport);
1102
      this.___currentMethod = method_call;
1103
      ___manager.call(method_call);
3385 varun.gupt 1104
    }
1105
 
3430 rajveer 1106
    public static class applyCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1107
      private String couponCode;
1108
      private long cartId;
1109
      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 {
1110
        super(client, protocolFactory, transport, resultHandler, false);
1111
        this.couponCode = couponCode;
1112
        this.cartId = cartId;
1982 varun.gupt 1113
      }
1114
 
3430 rajveer 1115
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1116
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("applyCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1117
        applyCoupon_args args = new applyCoupon_args();
1118
        args.setCouponCode(couponCode);
1119
        args.setCartId(cartId);
1120
        args.write(prot);
1121
        prot.writeMessageEnd();
1982 varun.gupt 1122
      }
1123
 
3430 rajveer 1124
      public Cart getResult() throws PromotionException, org.apache.thrift.TException {
1125
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1126
          throw new IllegalStateException("Method call not finished!");
1127
        }
1128
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1129
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1130
        return (new Client(prot)).recv_applyCoupon();
1982 varun.gupt 1131
      }
3430 rajveer 1132
    }
1982 varun.gupt 1133
 
6736 amit.gupta 1134
    public void getEmiDiscount(long cartId, org.apache.thrift.async.AsyncMethodCallback<getEmiDiscount_call> resultHandler) throws org.apache.thrift.TException {
1135
      checkReady();
1136
      getEmiDiscount_call method_call = new getEmiDiscount_call(cartId, resultHandler, this, ___protocolFactory, ___transport);
1137
      this.___currentMethod = method_call;
1138
      ___manager.call(method_call);
1139
    }
1140
 
1141
    public static class getEmiDiscount_call extends org.apache.thrift.async.TAsyncMethodCall {
1142
      private long cartId;
1143
      public getEmiDiscount_call(long cartId, org.apache.thrift.async.AsyncMethodCallback<getEmiDiscount_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 {
1144
        super(client, protocolFactory, transport, resultHandler, false);
1145
        this.cartId = cartId;
1146
      }
1147
 
1148
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1149
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getEmiDiscount", org.apache.thrift.protocol.TMessageType.CALL, 0));
1150
        getEmiDiscount_args args = new getEmiDiscount_args();
1151
        args.setCartId(cartId);
1152
        args.write(prot);
1153
        prot.writeMessageEnd();
1154
      }
1155
 
1156
      public Map<Long,Double> getResult() throws PromotionException, org.apache.thrift.TException {
1157
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1158
          throw new IllegalStateException("Method call not finished!");
1159
        }
1160
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1161
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1162
        return (new Client(prot)).recv_getEmiDiscount();
1163
      }
1164
    }
1165
 
6433 anupam.sin 1166
    public void applyRechargeCoupon(String couponCode, long totalAmount, long userId, org.apache.thrift.async.AsyncMethodCallback<applyRechargeCoupon_call> resultHandler) throws org.apache.thrift.TException {
1167
      checkReady();
1168
      applyRechargeCoupon_call method_call = new applyRechargeCoupon_call(couponCode, totalAmount, userId, resultHandler, this, ___protocolFactory, ___transport);
1169
      this.___currentMethod = method_call;
1170
      ___manager.call(method_call);
1171
    }
1172
 
1173
    public static class applyRechargeCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1174
      private String couponCode;
1175
      private long totalAmount;
1176
      private long userId;
1177
      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 {
1178
        super(client, protocolFactory, transport, resultHandler, false);
1179
        this.couponCode = couponCode;
1180
        this.totalAmount = totalAmount;
1181
        this.userId = userId;
1182
      }
1183
 
1184
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1185
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("applyRechargeCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1186
        applyRechargeCoupon_args args = new applyRechargeCoupon_args();
1187
        args.setCouponCode(couponCode);
1188
        args.setTotalAmount(totalAmount);
1189
        args.setUserId(userId);
1190
        args.write(prot);
1191
        prot.writeMessageEnd();
1192
      }
1193
 
1194
      public Map<Long,String> getResult() throws PromotionException, org.apache.thrift.TException {
1195
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1196
          throw new IllegalStateException("Method call not finished!");
1197
        }
1198
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1199
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1200
        return (new Client(prot)).recv_applyRechargeCoupon();
1201
      }
1202
    }
1203
 
3430 rajveer 1204
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException {
1205
      checkReady();
1206
      trackCouponUsage_call method_call = new trackCouponUsage_call(couponCode, transactionId, userId, resultHandler, this, ___protocolFactory, ___transport);
1207
      this.___currentMethod = method_call;
1208
      ___manager.call(method_call);
1209
    }
1982 varun.gupt 1210
 
3430 rajveer 1211
    public static class trackCouponUsage_call extends org.apache.thrift.async.TAsyncMethodCall {
1212
      private String couponCode;
1213
      private long transactionId;
1214
      private long userId;
1215
      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 {
1216
        super(client, protocolFactory, transport, resultHandler, false);
1217
        this.couponCode = couponCode;
1218
        this.transactionId = transactionId;
1219
        this.userId = userId;
1982 varun.gupt 1220
      }
1221
 
3430 rajveer 1222
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1223
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("trackCouponUsage", org.apache.thrift.protocol.TMessageType.CALL, 0));
1224
        trackCouponUsage_args args = new trackCouponUsage_args();
1225
        args.setCouponCode(couponCode);
1226
        args.setTransactionId(transactionId);
1227
        args.setUserId(userId);
1228
        args.write(prot);
1229
        prot.writeMessageEnd();
1982 varun.gupt 1230
      }
1231
 
3430 rajveer 1232
      public void getResult() throws PromotionException, org.apache.thrift.TException {
1233
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1234
          throw new IllegalStateException("Method call not finished!");
1235
        }
1236
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1237
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1238
        (new Client(prot)).recv_trackCouponUsage();
1982 varun.gupt 1239
      }
1240
    }
1241
 
3430 rajveer 1242
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException {
1243
      checkReady();
1244
      getCouponUsageCountByUser_call method_call = new getCouponUsageCountByUser_call(couponCode, userId, resultHandler, this, ___protocolFactory, ___transport);
1245
      this.___currentMethod = method_call;
1246
      ___manager.call(method_call);
1982 varun.gupt 1247
    }
1248
 
3430 rajveer 1249
    public static class getCouponUsageCountByUser_call extends org.apache.thrift.async.TAsyncMethodCall {
1250
      private String couponCode;
1251
      private long userId;
1252
      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 {
1253
        super(client, protocolFactory, transport, resultHandler, false);
1254
        this.couponCode = couponCode;
1255
        this.userId = userId;
1256
      }
1982 varun.gupt 1257
 
3430 rajveer 1258
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1259
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCouponUsageCountByUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
1260
        getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
1261
        args.setCouponCode(couponCode);
1262
        args.setUserId(userId);
1263
        args.write(prot);
1264
        prot.writeMessageEnd();
1265
      }
1982 varun.gupt 1266
 
3430 rajveer 1267
      public long getResult() throws PromotionException, org.apache.thrift.TException {
1268
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1269
          throw new IllegalStateException("Method call not finished!");
1270
        }
1271
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1272
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1273
        return (new Client(prot)).recv_getCouponUsageCountByUser();
1274
      }
1982 varun.gupt 1275
    }
1276
 
6497 amit.gupta 1277
    public void getActiveCodes(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getActiveCodes_call> resultHandler) throws org.apache.thrift.TException {
1278
      checkReady();
1279
      getActiveCodes_call method_call = new getActiveCodes_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
1280
      this.___currentMethod = method_call;
1281
      ___manager.call(method_call);
1282
    }
1283
 
1284
    public static class getActiveCodes_call extends org.apache.thrift.async.TAsyncMethodCall {
1285
      private long promotionId;
1286
      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 {
1287
        super(client, protocolFactory, transport, resultHandler, false);
1288
        this.promotionId = promotionId;
1289
      }
1290
 
1291
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1292
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getActiveCodes", org.apache.thrift.protocol.TMessageType.CALL, 0));
1293
        getActiveCodes_args args = new getActiveCodes_args();
1294
        args.setPromotionId(promotionId);
1295
        args.write(prot);
1296
        prot.writeMessageEnd();
1297
      }
1298
 
1299
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
1300
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1301
          throw new IllegalStateException("Method call not finished!");
1302
        }
1303
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1304
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1305
        return (new Client(prot)).recv_getActiveCodes();
1306
      }
1307
    }
1308
 
1309
    public void deleteCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<deleteCoupon_call> resultHandler) throws org.apache.thrift.TException {
1310
      checkReady();
1311
      deleteCoupon_call method_call = new deleteCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
1312
      this.___currentMethod = method_call;
1313
      ___manager.call(method_call);
1314
    }
1315
 
1316
    public static class deleteCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1317
      private String couponCode;
1318
      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 {
1319
        super(client, protocolFactory, transport, resultHandler, false);
1320
        this.couponCode = couponCode;
1321
      }
1322
 
1323
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1324
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1325
        deleteCoupon_args args = new deleteCoupon_args();
1326
        args.setCouponCode(couponCode);
1327
        args.write(prot);
1328
        prot.writeMessageEnd();
1329
      }
1330
 
1331
      public void getResult() throws PromotionException, org.apache.thrift.TException {
1332
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1333
          throw new IllegalStateException("Method call not finished!");
1334
        }
1335
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1336
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1337
        (new Client(prot)).recv_deleteCoupon();
1338
      }
1339
    }
1340
 
7092 amit.gupta 1341
    public void getAllCouponsByPromotionId(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getAllCouponsByPromotionId_call> resultHandler) throws org.apache.thrift.TException {
1342
      checkReady();
1343
      getAllCouponsByPromotionId_call method_call = new getAllCouponsByPromotionId_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
1344
      this.___currentMethod = method_call;
1345
      ___manager.call(method_call);
1346
    }
1347
 
1348
    public static class getAllCouponsByPromotionId_call extends org.apache.thrift.async.TAsyncMethodCall {
1349
      private long promotionId;
1350
      public getAllCouponsByPromotionId_call(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getAllCouponsByPromotionId_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 {
1351
        super(client, protocolFactory, transport, resultHandler, false);
1352
        this.promotionId = promotionId;
1353
      }
1354
 
1355
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1356
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllCouponsByPromotionId", org.apache.thrift.protocol.TMessageType.CALL, 0));
1357
        getAllCouponsByPromotionId_args args = new getAllCouponsByPromotionId_args();
1358
        args.setPromotionId(promotionId);
1359
        args.write(prot);
1360
        prot.writeMessageEnd();
1361
      }
1362
 
1363
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
1364
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1365
          throw new IllegalStateException("Method call not finished!");
1366
        }
1367
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1368
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1369
        return (new Client(prot)).recv_getAllCouponsByPromotionId();
1370
      }
1371
    }
1372
 
3430 rajveer 1373
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException {
1374
      checkReady();
1375
      getActiveCoupons_call method_call = new getActiveCoupons_call(resultHandler, this, ___protocolFactory, ___transport);
1376
      this.___currentMethod = method_call;
1377
      ___manager.call(method_call);
1982 varun.gupt 1378
    }
1379
 
3430 rajveer 1380
    public static class getActiveCoupons_call extends org.apache.thrift.async.TAsyncMethodCall {
1381
      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 {
1382
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 1383
      }
1384
 
3430 rajveer 1385
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1386
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getActiveCoupons", org.apache.thrift.protocol.TMessageType.CALL, 0));
1387
        getActiveCoupons_args args = new getActiveCoupons_args();
1388
        args.write(prot);
1389
        prot.writeMessageEnd();
1390
      }
1982 varun.gupt 1391
 
3430 rajveer 1392
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
1393
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1394
          throw new IllegalStateException("Method call not finished!");
1395
        }
1396
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1397
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1398
        return (new Client(prot)).recv_getActiveCoupons();
1982 varun.gupt 1399
      }
1400
    }
1401
 
8707 manish.sha 1402
    public void createCoupon(long promotionId, long couponCategory, String couponCode, String arguments, boolean isCod, String prefix, org.apache.thrift.async.AsyncMethodCallback<createCoupon_call> resultHandler) throws org.apache.thrift.TException {
6250 amit.gupta 1403
      checkReady();
8707 manish.sha 1404
      createCoupon_call method_call = new createCoupon_call(promotionId, couponCategory, couponCode, arguments, isCod, prefix, resultHandler, this, ___protocolFactory, ___transport);
6250 amit.gupta 1405
      this.___currentMethod = method_call;
1406
      ___manager.call(method_call);
1407
    }
1408
 
1409
    public static class createCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1410
      private long promotionId;
8707 manish.sha 1411
      private long couponCategory;
6730 anupam.sin 1412
      private String couponCode;
6679 anupam.sin 1413
      private String arguments;
6356 amit.gupta 1414
      private boolean isCod;
6561 amit.gupta 1415
      private String prefix;
8707 manish.sha 1416
      public createCoupon_call(long promotionId, long couponCategory, String couponCode, String arguments, boolean isCod, 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 1417
        super(client, protocolFactory, transport, resultHandler, false);
1418
        this.promotionId = promotionId;
8707 manish.sha 1419
        this.couponCategory = couponCategory;
6730 anupam.sin 1420
        this.couponCode = couponCode;
6679 anupam.sin 1421
        this.arguments = arguments;
6356 amit.gupta 1422
        this.isCod = isCod;
6561 amit.gupta 1423
        this.prefix = prefix;
6250 amit.gupta 1424
      }
1425
 
1426
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1427
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1428
        createCoupon_args args = new createCoupon_args();
1429
        args.setPromotionId(promotionId);
8707 manish.sha 1430
        args.setCouponCategory(couponCategory);
6730 anupam.sin 1431
        args.setCouponCode(couponCode);
6679 anupam.sin 1432
        args.setArguments(arguments);
6356 amit.gupta 1433
        args.setIsCod(isCod);
6561 amit.gupta 1434
        args.setPrefix(prefix);
6250 amit.gupta 1435
        args.write(prot);
1436
        prot.writeMessageEnd();
1437
      }
1438
 
1439
      public String getResult() throws PromotionException, org.apache.thrift.TException {
1440
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1441
          throw new IllegalStateException("Method call not finished!");
1442
        }
1443
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1444
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1445
        return (new Client(prot)).recv_createCoupon();
1446
      }
1447
    }
1448
 
3430 rajveer 1449
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException {
1450
      checkReady();
1451
      getSuccessfulPaymentCountForCoupon_call method_call = new getSuccessfulPaymentCountForCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
1452
      this.___currentMethod = method_call;
1453
      ___manager.call(method_call);
1982 varun.gupt 1454
    }
1455
 
3430 rajveer 1456
    public static class getSuccessfulPaymentCountForCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1457
      private String couponCode;
1458
      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 {
1459
        super(client, protocolFactory, transport, resultHandler, false);
1460
        this.couponCode = couponCode;
1982 varun.gupt 1461
      }
1462
 
3430 rajveer 1463
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1464
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSuccessfulPaymentCountForCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1465
        getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
1466
        args.setCouponCode(couponCode);
1467
        args.write(prot);
1468
        prot.writeMessageEnd();
1469
      }
1982 varun.gupt 1470
 
3430 rajveer 1471
      public long getResult() throws PromotionException, org.apache.thrift.TException {
1472
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1473
          throw new IllegalStateException("Method call not finished!");
1474
        }
1475
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1476
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1477
        return (new Client(prot)).recv_getSuccessfulPaymentCountForCoupon();
1478
      }
1982 varun.gupt 1479
    }
1480
 
3430 rajveer 1481
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<getRuleDocString_call> resultHandler) throws org.apache.thrift.TException {
1482
      checkReady();
1483
      getRuleDocString_call method_call = new getRuleDocString_call(ruleName, resultHandler, this, ___protocolFactory, ___transport);
1484
      this.___currentMethod = method_call;
1485
      ___manager.call(method_call);
1982 varun.gupt 1486
    }
1487
 
3430 rajveer 1488
    public static class getRuleDocString_call extends org.apache.thrift.async.TAsyncMethodCall {
1489
      private String ruleName;
1490
      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 {
1491
        super(client, protocolFactory, transport, resultHandler, false);
1492
        this.ruleName = ruleName;
1493
      }
1982 varun.gupt 1494
 
3430 rajveer 1495
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1496
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRuleDocString", org.apache.thrift.protocol.TMessageType.CALL, 0));
1497
        getRuleDocString_args args = new getRuleDocString_args();
1498
        args.setRuleName(ruleName);
1499
        args.write(prot);
1500
        prot.writeMessageEnd();
1982 varun.gupt 1501
      }
1502
 
3430 rajveer 1503
      public String getResult() throws org.apache.thrift.TException {
1504
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1505
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 1506
        }
3430 rajveer 1507
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1508
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1509
        return (new Client(prot)).recv_getRuleDocString();
1982 varun.gupt 1510
      }
1511
    }
1512
 
4189 varun.gupt 1513
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException {
1514
      checkReady();
1515
      getItemDiscountMap_call method_call = new getItemDiscountMap_call(itemIds, resultHandler, this, ___protocolFactory, ___transport);
1516
      this.___currentMethod = method_call;
1517
      ___manager.call(method_call);
1518
    }
1519
 
1520
    public static class getItemDiscountMap_call extends org.apache.thrift.async.TAsyncMethodCall {
1521
      private List<Long> itemIds;
1522
      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 {
1523
        super(client, protocolFactory, transport, resultHandler, false);
1524
        this.itemIds = itemIds;
1525
      }
1526
 
1527
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1528
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getItemDiscountMap", org.apache.thrift.protocol.TMessageType.CALL, 0));
1529
        getItemDiscountMap_args args = new getItemDiscountMap_args();
1530
        args.setItemIds(itemIds);
1531
        args.write(prot);
1532
        prot.writeMessageEnd();
1533
      }
1534
 
1535
      public List<ItemCouponDiscount> getResult() throws PromotionException, org.apache.thrift.TException {
1536
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1537
          throw new IllegalStateException("Method call not finished!");
1538
        }
1539
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1540
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1541
        return (new Client(prot)).recv_getItemDiscountMap();
1542
      }
1543
    }
1544
 
4494 varun.gupt 1545
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException {
1546
      checkReady();
1547
      getDiscountsForEntity_call method_call = new getDiscountsForEntity_call(entityId, resultHandler, this, ___protocolFactory, ___transport);
1548
      this.___currentMethod = method_call;
1549
      ___manager.call(method_call);
1550
    }
1551
 
1552
    public static class getDiscountsForEntity_call extends org.apache.thrift.async.TAsyncMethodCall {
1553
      private long entityId;
1554
      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 {
1555
        super(client, protocolFactory, transport, resultHandler, false);
1556
        this.entityId = entityId;
1557
      }
1558
 
1559
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1560
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getDiscountsForEntity", org.apache.thrift.protocol.TMessageType.CALL, 0));
1561
        getDiscountsForEntity_args args = new getDiscountsForEntity_args();
1562
        args.setEntityId(entityId);
1563
        args.write(prot);
1564
        prot.writeMessageEnd();
1565
      }
1566
 
1567
      public Map<String,Double> getResult() throws org.apache.thrift.TException {
1568
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1569
          throw new IllegalStateException("Method call not finished!");
1570
        }
1571
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1572
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1573
        return (new Client(prot)).recv_getDiscountsForEntity();
1574
      }
1575
    }
1576
 
5469 rajveer 1577
    public void addVoucher(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<addVoucher_call> resultHandler) throws org.apache.thrift.TException {
1578
      checkReady();
1579
      addVoucher_call method_call = new addVoucher_call(voucher, resultHandler, this, ___protocolFactory, ___transport);
1580
      this.___currentMethod = method_call;
1581
      ___manager.call(method_call);
1582
    }
1583
 
1584
    public static class addVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
1585
      private Voucher voucher;
1586
      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 {
1587
        super(client, protocolFactory, transport, resultHandler, false);
1588
        this.voucher = voucher;
1589
      }
1590
 
1591
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1592
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
1593
        addVoucher_args args = new addVoucher_args();
1594
        args.setVoucher(voucher);
1595
        args.write(prot);
1596
        prot.writeMessageEnd();
1597
      }
1598
 
1599
      public void getResult() throws org.apache.thrift.TException {
1600
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1601
          throw new IllegalStateException("Method call not finished!");
1602
        }
1603
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1604
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1605
        (new Client(prot)).recv_addVoucher();
1606
      }
1607
    }
1608
 
1609
    public void assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount, org.apache.thrift.async.AsyncMethodCallback<assignVoucher_call> resultHandler) throws org.apache.thrift.TException {
1610
      checkReady();
1611
      assignVoucher_call method_call = new assignVoucher_call(userId, userEmail, voucherType, amount, resultHandler, this, ___protocolFactory, ___transport);
1612
      this.___currentMethod = method_call;
1613
      ___manager.call(method_call);
1614
    }
1615
 
1616
    public static class assignVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
1617
      private long userId;
1618
      private String userEmail;
1619
      private VoucherType voucherType;
1620
      private long amount;
1621
      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 {
1622
        super(client, protocolFactory, transport, resultHandler, false);
1623
        this.userId = userId;
1624
        this.userEmail = userEmail;
1625
        this.voucherType = voucherType;
1626
        this.amount = amount;
1627
      }
1628
 
1629
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1630
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("assignVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
1631
        assignVoucher_args args = new assignVoucher_args();
1632
        args.setUserId(userId);
1633
        args.setUserEmail(userEmail);
1634
        args.setVoucherType(voucherType);
1635
        args.setAmount(amount);
1636
        args.write(prot);
1637
        prot.writeMessageEnd();
1638
      }
1639
 
1640
      public Voucher getResult() throws org.apache.thrift.TException {
1641
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1642
          throw new IllegalStateException("Method call not finished!");
1643
        }
1644
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1645
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1646
        return (new Client(prot)).recv_assignVoucher();
1647
      }
1648
    }
1649
 
1650
    public void markVoucherAsRedeemed(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<markVoucherAsRedeemed_call> resultHandler) throws org.apache.thrift.TException {
1651
      checkReady();
1652
      markVoucherAsRedeemed_call method_call = new markVoucherAsRedeemed_call(voucherCode, redeemedOn, resultHandler, this, ___protocolFactory, ___transport);
1653
      this.___currentMethod = method_call;
1654
      ___manager.call(method_call);
1655
    }
1656
 
1657
    public static class markVoucherAsRedeemed_call extends org.apache.thrift.async.TAsyncMethodCall {
1658
      private String voucherCode;
1659
      private long redeemedOn;
1660
      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 {
1661
        super(client, protocolFactory, transport, resultHandler, false);
1662
        this.voucherCode = voucherCode;
1663
        this.redeemedOn = redeemedOn;
1664
      }
1665
 
1666
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1667
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("markVoucherAsRedeemed", org.apache.thrift.protocol.TMessageType.CALL, 0));
1668
        markVoucherAsRedeemed_args args = new markVoucherAsRedeemed_args();
1669
        args.setVoucherCode(voucherCode);
1670
        args.setRedeemedOn(redeemedOn);
1671
        args.write(prot);
1672
        prot.writeMessageEnd();
1673
      }
1674
 
1675
      public boolean getResult() throws org.apache.thrift.TException {
1676
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1677
          throw new IllegalStateException("Method call not finished!");
1678
        }
1679
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1680
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1681
        return (new Client(prot)).recv_markVoucherAsRedeemed();
1682
      }
1683
    }
1684
 
3430 rajveer 1685
  }
1982 varun.gupt 1686
 
3430 rajveer 1687
  public static class Processor<I extends Iface> extends in.shop2020.generic.GenericService.Processor implements org.apache.thrift.TProcessor {
1688
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
1689
    public Processor(I iface) {
1690
      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
1982 varun.gupt 1691
    }
1692
 
3430 rajveer 1693
    protected Processor(I iface, Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
1694
      super(iface, getProcessMap(processMap));
1982 varun.gupt 1695
    }
1696
 
3430 rajveer 1697
    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) {
1698
      processMap.put("createPromotion", new createPromotion());
7746 amit.gupta 1699
      processMap.put("removeAllCouponsByPromotionId", new removeAllCouponsByPromotionId());
6301 amit.gupta 1700
      processMap.put("getCoupon", new getCoupon());
1701
      processMap.put("isGiftVoucher", new isGiftVoucher());
6356 amit.gupta 1702
      processMap.put("isCodApplicable", new isCodApplicable());
3430 rajveer 1703
      processMap.put("getAllPromotions", new getAllPromotions());
1704
      processMap.put("getPromotionById", new getPromotionById());
1705
      processMap.put("generateCouponsForPromotion", new generateCouponsForPromotion());
1706
      processMap.put("applyCoupon", new applyCoupon());
6736 amit.gupta 1707
      processMap.put("getEmiDiscount", new getEmiDiscount());
6433 anupam.sin 1708
      processMap.put("applyRechargeCoupon", new applyRechargeCoupon());
3430 rajveer 1709
      processMap.put("trackCouponUsage", new trackCouponUsage());
1710
      processMap.put("getCouponUsageCountByUser", new getCouponUsageCountByUser());
6497 amit.gupta 1711
      processMap.put("getActiveCodes", new getActiveCodes());
1712
      processMap.put("deleteCoupon", new deleteCoupon());
7092 amit.gupta 1713
      processMap.put("getAllCouponsByPromotionId", new getAllCouponsByPromotionId());
3430 rajveer 1714
      processMap.put("getActiveCoupons", new getActiveCoupons());
6250 amit.gupta 1715
      processMap.put("createCoupon", new createCoupon());
3430 rajveer 1716
      processMap.put("getSuccessfulPaymentCountForCoupon", new getSuccessfulPaymentCountForCoupon());
1717
      processMap.put("getRuleDocString", new getRuleDocString());
4189 varun.gupt 1718
      processMap.put("getItemDiscountMap", new getItemDiscountMap());
4494 varun.gupt 1719
      processMap.put("getDiscountsForEntity", new getDiscountsForEntity());
5469 rajveer 1720
      processMap.put("addVoucher", new addVoucher());
1721
      processMap.put("assignVoucher", new assignVoucher());
1722
      processMap.put("markVoucherAsRedeemed", new markVoucherAsRedeemed());
3430 rajveer 1723
      return processMap;
1982 varun.gupt 1724
    }
1725
 
3430 rajveer 1726
    private static class createPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createPromotion_args> {
1727
      public createPromotion() {
1728
        super("createPromotion");
1729
      }
1982 varun.gupt 1730
 
3430 rajveer 1731
      protected createPromotion_args getEmptyArgsInstance() {
1732
        return new createPromotion_args();
1733
      }
1982 varun.gupt 1734
 
3430 rajveer 1735
      protected createPromotion_result getResult(I iface, createPromotion_args args) throws org.apache.thrift.TException {
1736
        createPromotion_result result = new createPromotion_result();
1737
        try {
1738
          iface.createPromotion(args.name, args.ruleExecutionSrc, args.startOn, args.endOn);
1739
        } catch (PromotionException pex) {
1740
          result.pex = pex;
1982 varun.gupt 1741
        }
3430 rajveer 1742
        return result;
1982 varun.gupt 1743
      }
3430 rajveer 1744
    }
1982 varun.gupt 1745
 
7746 amit.gupta 1746
    private static class removeAllCouponsByPromotionId<I extends Iface> extends org.apache.thrift.ProcessFunction<I, removeAllCouponsByPromotionId_args> {
1747
      public removeAllCouponsByPromotionId() {
1748
        super("removeAllCouponsByPromotionId");
1749
      }
1750
 
1751
      protected removeAllCouponsByPromotionId_args getEmptyArgsInstance() {
1752
        return new removeAllCouponsByPromotionId_args();
1753
      }
1754
 
1755
      protected removeAllCouponsByPromotionId_result getResult(I iface, removeAllCouponsByPromotionId_args args) throws org.apache.thrift.TException {
1756
        removeAllCouponsByPromotionId_result result = new removeAllCouponsByPromotionId_result();
1757
        try {
1758
          result.success = iface.removeAllCouponsByPromotionId(args.promotionId);
1759
          result.setSuccessIsSet(true);
1760
        } catch (PromotionException pex) {
1761
          result.pex = pex;
1762
        }
1763
        return result;
1764
      }
1765
    }
1766
 
6301 amit.gupta 1767
    private static class getCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCoupon_args> {
1768
      public getCoupon() {
1769
        super("getCoupon");
1770
      }
1771
 
1772
      protected getCoupon_args getEmptyArgsInstance() {
1773
        return new getCoupon_args();
1774
      }
1775
 
1776
      protected getCoupon_result getResult(I iface, getCoupon_args args) throws org.apache.thrift.TException {
1777
        getCoupon_result result = new getCoupon_result();
1778
        try {
1779
          result.success = iface.getCoupon(args.couponCode);
1780
        } catch (PromotionException pex) {
1781
          result.pex = pex;
1782
        }
1783
        return result;
1784
      }
1785
    }
1786
 
1787
    private static class isGiftVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isGiftVoucher_args> {
1788
      public isGiftVoucher() {
1789
        super("isGiftVoucher");
1790
      }
1791
 
1792
      protected isGiftVoucher_args getEmptyArgsInstance() {
1793
        return new isGiftVoucher_args();
1794
      }
1795
 
1796
      protected isGiftVoucher_result getResult(I iface, isGiftVoucher_args args) throws org.apache.thrift.TException {
1797
        isGiftVoucher_result result = new isGiftVoucher_result();
1798
        try {
1799
          result.success = iface.isGiftVoucher(args.couponCode);
1800
          result.setSuccessIsSet(true);
1801
        } catch (PromotionException pex) {
1802
          result.pex = pex;
1803
        }
1804
        return result;
1805
      }
1806
    }
1807
 
6356 amit.gupta 1808
    private static class isCodApplicable<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isCodApplicable_args> {
1809
      public isCodApplicable() {
1810
        super("isCodApplicable");
1811
      }
1812
 
1813
      protected isCodApplicable_args getEmptyArgsInstance() {
1814
        return new isCodApplicable_args();
1815
      }
1816
 
1817
      protected isCodApplicable_result getResult(I iface, isCodApplicable_args args) throws org.apache.thrift.TException {
1818
        isCodApplicable_result result = new isCodApplicable_result();
1819
        try {
11819 amit.gupta 1820
          result.success = iface.isCodApplicable(args.cart);
6356 amit.gupta 1821
          result.setSuccessIsSet(true);
1822
        } catch (PromotionException pex) {
1823
          result.pex = pex;
1824
        }
1825
        return result;
1826
      }
1827
    }
1828
 
3430 rajveer 1829
    private static class getAllPromotions<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllPromotions_args> {
1830
      public getAllPromotions() {
1831
        super("getAllPromotions");
1982 varun.gupt 1832
      }
1833
 
3430 rajveer 1834
      protected getAllPromotions_args getEmptyArgsInstance() {
1835
        return new getAllPromotions_args();
1982 varun.gupt 1836
      }
1837
 
3430 rajveer 1838
      protected getAllPromotions_result getResult(I iface, getAllPromotions_args args) throws org.apache.thrift.TException {
1839
        getAllPromotions_result result = new getAllPromotions_result();
1840
        try {
1841
          result.success = iface.getAllPromotions();
1842
        } catch (PromotionException pex) {
1843
          result.pex = pex;
1844
        }
1845
        return result;
1982 varun.gupt 1846
      }
3430 rajveer 1847
    }
1982 varun.gupt 1848
 
3430 rajveer 1849
    private static class getPromotionById<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPromotionById_args> {
1850
      public getPromotionById() {
1851
        super("getPromotionById");
1982 varun.gupt 1852
      }
1853
 
3430 rajveer 1854
      protected getPromotionById_args getEmptyArgsInstance() {
1855
        return new getPromotionById_args();
1982 varun.gupt 1856
      }
1857
 
3430 rajveer 1858
      protected getPromotionById_result getResult(I iface, getPromotionById_args args) throws org.apache.thrift.TException {
1859
        getPromotionById_result result = new getPromotionById_result();
1860
        try {
1861
          result.success = iface.getPromotionById(args.promotionId);
1862
        } catch (PromotionException pex) {
1863
          result.pex = pex;
1864
        }
1865
        return result;
1982 varun.gupt 1866
      }
1867
    }
1868
 
3430 rajveer 1869
    private static class generateCouponsForPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, generateCouponsForPromotion_args> {
1870
      public generateCouponsForPromotion() {
1871
        super("generateCouponsForPromotion");
1872
      }
1982 varun.gupt 1873
 
3430 rajveer 1874
      protected generateCouponsForPromotion_args getEmptyArgsInstance() {
1875
        return new generateCouponsForPromotion_args();
1876
      }
1982 varun.gupt 1877
 
3430 rajveer 1878
      protected generateCouponsForPromotion_result getResult(I iface, generateCouponsForPromotion_args args) throws org.apache.thrift.TException {
1879
        generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
1880
        try {
1881
          iface.generateCouponsForPromotion(args.promotionId, args.couponCode);
1882
        } catch (PromotionException pex) {
1883
          result.pex = pex;
1884
        }
1885
        return result;
1886
      }
1982 varun.gupt 1887
    }
1888
 
3430 rajveer 1889
    private static class applyCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, applyCoupon_args> {
1890
      public applyCoupon() {
1891
        super("applyCoupon");
1892
      }
1982 varun.gupt 1893
 
3430 rajveer 1894
      protected applyCoupon_args getEmptyArgsInstance() {
1895
        return new applyCoupon_args();
1896
      }
1982 varun.gupt 1897
 
3430 rajveer 1898
      protected applyCoupon_result getResult(I iface, applyCoupon_args args) throws org.apache.thrift.TException {
1899
        applyCoupon_result result = new applyCoupon_result();
1900
        try {
1901
          result.success = iface.applyCoupon(args.couponCode, args.cartId);
1902
        } catch (PromotionException pex) {
1903
          result.pex = pex;
1904
        }
1905
        return result;
1982 varun.gupt 1906
      }
1907
    }
1908
 
6736 amit.gupta 1909
    private static class getEmiDiscount<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getEmiDiscount_args> {
1910
      public getEmiDiscount() {
1911
        super("getEmiDiscount");
1912
      }
1913
 
1914
      protected getEmiDiscount_args getEmptyArgsInstance() {
1915
        return new getEmiDiscount_args();
1916
      }
1917
 
1918
      protected getEmiDiscount_result getResult(I iface, getEmiDiscount_args args) throws org.apache.thrift.TException {
1919
        getEmiDiscount_result result = new getEmiDiscount_result();
1920
        try {
1921
          result.success = iface.getEmiDiscount(args.cartId);
1922
        } catch (PromotionException pex) {
1923
          result.pex = pex;
1924
        }
1925
        return result;
1926
      }
1927
    }
1928
 
6433 anupam.sin 1929
    private static class applyRechargeCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, applyRechargeCoupon_args> {
1930
      public applyRechargeCoupon() {
1931
        super("applyRechargeCoupon");
1932
      }
1933
 
1934
      protected applyRechargeCoupon_args getEmptyArgsInstance() {
1935
        return new applyRechargeCoupon_args();
1936
      }
1937
 
1938
      protected applyRechargeCoupon_result getResult(I iface, applyRechargeCoupon_args args) throws org.apache.thrift.TException {
1939
        applyRechargeCoupon_result result = new applyRechargeCoupon_result();
1940
        try {
1941
          result.success = iface.applyRechargeCoupon(args.couponCode, args.totalAmount, args.userId);
1942
        } catch (PromotionException pex) {
1943
          result.pex = pex;
1944
        }
1945
        return result;
1946
      }
1947
    }
1948
 
3430 rajveer 1949
    private static class trackCouponUsage<I extends Iface> extends org.apache.thrift.ProcessFunction<I, trackCouponUsage_args> {
1950
      public trackCouponUsage() {
1951
        super("trackCouponUsage");
1952
      }
1982 varun.gupt 1953
 
3430 rajveer 1954
      protected trackCouponUsage_args getEmptyArgsInstance() {
1955
        return new trackCouponUsage_args();
1982 varun.gupt 1956
      }
1957
 
3430 rajveer 1958
      protected trackCouponUsage_result getResult(I iface, trackCouponUsage_args args) throws org.apache.thrift.TException {
1959
        trackCouponUsage_result result = new trackCouponUsage_result();
1960
        try {
1961
          iface.trackCouponUsage(args.couponCode, args.transactionId, args.userId);
1962
        } catch (PromotionException pex) {
1963
          result.pex = pex;
1964
        }
1965
        return result;
1966
      }
1982 varun.gupt 1967
    }
1968
 
3430 rajveer 1969
    private static class getCouponUsageCountByUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCouponUsageCountByUser_args> {
1970
      public getCouponUsageCountByUser() {
1971
        super("getCouponUsageCountByUser");
1982 varun.gupt 1972
      }
1973
 
3430 rajveer 1974
      protected getCouponUsageCountByUser_args getEmptyArgsInstance() {
1975
        return new getCouponUsageCountByUser_args();
1976
      }
1982 varun.gupt 1977
 
3430 rajveer 1978
      protected getCouponUsageCountByUser_result getResult(I iface, getCouponUsageCountByUser_args args) throws org.apache.thrift.TException {
1979
        getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
1980
        try {
1981
          result.success = iface.getCouponUsageCountByUser(args.couponCode, args.userId);
1982
          result.setSuccessIsSet(true);
1983
        } catch (PromotionException pex) {
1984
          result.pex = pex;
1985
        }
1986
        return result;
1987
      }
1982 varun.gupt 1988
    }
1989
 
6497 amit.gupta 1990
    private static class getActiveCodes<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getActiveCodes_args> {
1991
      public getActiveCodes() {
1992
        super("getActiveCodes");
1993
      }
1994
 
1995
      protected getActiveCodes_args getEmptyArgsInstance() {
1996
        return new getActiveCodes_args();
1997
      }
1998
 
1999
      protected getActiveCodes_result getResult(I iface, getActiveCodes_args args) throws org.apache.thrift.TException {
2000
        getActiveCodes_result result = new getActiveCodes_result();
2001
        try {
2002
          result.success = iface.getActiveCodes(args.promotionId);
2003
        } catch (PromotionException pex) {
2004
          result.pex = pex;
2005
        }
2006
        return result;
2007
      }
2008
    }
2009
 
2010
    private static class deleteCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, deleteCoupon_args> {
2011
      public deleteCoupon() {
2012
        super("deleteCoupon");
2013
      }
2014
 
2015
      protected deleteCoupon_args getEmptyArgsInstance() {
2016
        return new deleteCoupon_args();
2017
      }
2018
 
2019
      protected deleteCoupon_result getResult(I iface, deleteCoupon_args args) throws org.apache.thrift.TException {
2020
        deleteCoupon_result result = new deleteCoupon_result();
2021
        try {
2022
          iface.deleteCoupon(args.couponCode);
2023
        } catch (PromotionException pex) {
2024
          result.pex = pex;
2025
        }
2026
        return result;
2027
      }
2028
    }
2029
 
7092 amit.gupta 2030
    private static class getAllCouponsByPromotionId<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllCouponsByPromotionId_args> {
2031
      public getAllCouponsByPromotionId() {
2032
        super("getAllCouponsByPromotionId");
2033
      }
2034
 
2035
      protected getAllCouponsByPromotionId_args getEmptyArgsInstance() {
2036
        return new getAllCouponsByPromotionId_args();
2037
      }
2038
 
2039
      protected getAllCouponsByPromotionId_result getResult(I iface, getAllCouponsByPromotionId_args args) throws org.apache.thrift.TException {
2040
        getAllCouponsByPromotionId_result result = new getAllCouponsByPromotionId_result();
2041
        try {
2042
          result.success = iface.getAllCouponsByPromotionId(args.promotionId);
2043
        } catch (PromotionException pex) {
2044
          result.pex = pex;
2045
        }
2046
        return result;
2047
      }
2048
    }
2049
 
3430 rajveer 2050
    private static class getActiveCoupons<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getActiveCoupons_args> {
2051
      public getActiveCoupons() {
2052
        super("getActiveCoupons");
2053
      }
1982 varun.gupt 2054
 
3430 rajveer 2055
      protected getActiveCoupons_args getEmptyArgsInstance() {
2056
        return new getActiveCoupons_args();
2057
      }
1982 varun.gupt 2058
 
3430 rajveer 2059
      protected getActiveCoupons_result getResult(I iface, getActiveCoupons_args args) throws org.apache.thrift.TException {
2060
        getActiveCoupons_result result = new getActiveCoupons_result();
2061
        try {
2062
          result.success = iface.getActiveCoupons();
2063
        } catch (PromotionException pex) {
2064
          result.pex = pex;
2065
        }
2066
        return result;
2067
      }
1982 varun.gupt 2068
    }
2069
 
6250 amit.gupta 2070
    private static class createCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createCoupon_args> {
2071
      public createCoupon() {
2072
        super("createCoupon");
2073
      }
2074
 
2075
      protected createCoupon_args getEmptyArgsInstance() {
2076
        return new createCoupon_args();
2077
      }
2078
 
2079
      protected createCoupon_result getResult(I iface, createCoupon_args args) throws org.apache.thrift.TException {
2080
        createCoupon_result result = new createCoupon_result();
2081
        try {
8707 manish.sha 2082
          result.success = iface.createCoupon(args.promotionId, args.couponCategory, args.couponCode, args.arguments, args.isCod, args.prefix);
6250 amit.gupta 2083
        } catch (PromotionException pex) {
2084
          result.pex = pex;
2085
        }
2086
        return result;
2087
      }
2088
    }
2089
 
3430 rajveer 2090
    private static class getSuccessfulPaymentCountForCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSuccessfulPaymentCountForCoupon_args> {
2091
      public getSuccessfulPaymentCountForCoupon() {
2092
        super("getSuccessfulPaymentCountForCoupon");
1982 varun.gupt 2093
      }
2094
 
3430 rajveer 2095
      protected getSuccessfulPaymentCountForCoupon_args getEmptyArgsInstance() {
2096
        return new getSuccessfulPaymentCountForCoupon_args();
2097
      }
1982 varun.gupt 2098
 
3430 rajveer 2099
      protected getSuccessfulPaymentCountForCoupon_result getResult(I iface, getSuccessfulPaymentCountForCoupon_args args) throws org.apache.thrift.TException {
2100
        getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
2101
        try {
2102
          result.success = iface.getSuccessfulPaymentCountForCoupon(args.couponCode);
2103
          result.setSuccessIsSet(true);
2104
        } catch (PromotionException pex) {
2105
          result.pex = pex;
1982 varun.gupt 2106
        }
3430 rajveer 2107
        return result;
1982 varun.gupt 2108
      }
2109
    }
2110
 
3430 rajveer 2111
    private static class getRuleDocString<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getRuleDocString_args> {
2112
      public getRuleDocString() {
2113
        super("getRuleDocString");
2114
      }
1982 varun.gupt 2115
 
3430 rajveer 2116
      protected getRuleDocString_args getEmptyArgsInstance() {
2117
        return new getRuleDocString_args();
2118
      }
1982 varun.gupt 2119
 
3430 rajveer 2120
      protected getRuleDocString_result getResult(I iface, getRuleDocString_args args) throws org.apache.thrift.TException {
2121
        getRuleDocString_result result = new getRuleDocString_result();
2122
        result.success = iface.getRuleDocString(args.ruleName);
2123
        return result;
2124
      }
1982 varun.gupt 2125
    }
2126
 
4189 varun.gupt 2127
    private static class getItemDiscountMap<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getItemDiscountMap_args> {
2128
      public getItemDiscountMap() {
2129
        super("getItemDiscountMap");
2130
      }
2131
 
2132
      protected getItemDiscountMap_args getEmptyArgsInstance() {
2133
        return new getItemDiscountMap_args();
2134
      }
2135
 
2136
      protected getItemDiscountMap_result getResult(I iface, getItemDiscountMap_args args) throws org.apache.thrift.TException {
2137
        getItemDiscountMap_result result = new getItemDiscountMap_result();
2138
        try {
2139
          result.success = iface.getItemDiscountMap(args.itemIds);
2140
        } catch (PromotionException pex) {
2141
          result.pex = pex;
2142
        }
2143
        return result;
2144
      }
2145
    }
2146
 
4494 varun.gupt 2147
    private static class getDiscountsForEntity<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getDiscountsForEntity_args> {
2148
      public getDiscountsForEntity() {
2149
        super("getDiscountsForEntity");
2150
      }
2151
 
2152
      protected getDiscountsForEntity_args getEmptyArgsInstance() {
2153
        return new getDiscountsForEntity_args();
2154
      }
2155
 
2156
      protected getDiscountsForEntity_result getResult(I iface, getDiscountsForEntity_args args) throws org.apache.thrift.TException {
2157
        getDiscountsForEntity_result result = new getDiscountsForEntity_result();
2158
        result.success = iface.getDiscountsForEntity(args.entityId);
2159
        return result;
2160
      }
2161
    }
2162
 
5469 rajveer 2163
    private static class addVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addVoucher_args> {
2164
      public addVoucher() {
2165
        super("addVoucher");
2166
      }
2167
 
2168
      protected addVoucher_args getEmptyArgsInstance() {
2169
        return new addVoucher_args();
2170
      }
2171
 
2172
      protected addVoucher_result getResult(I iface, addVoucher_args args) throws org.apache.thrift.TException {
2173
        addVoucher_result result = new addVoucher_result();
2174
        iface.addVoucher(args.voucher);
2175
        return result;
2176
      }
2177
    }
2178
 
2179
    private static class assignVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, assignVoucher_args> {
2180
      public assignVoucher() {
2181
        super("assignVoucher");
2182
      }
2183
 
2184
      protected assignVoucher_args getEmptyArgsInstance() {
2185
        return new assignVoucher_args();
2186
      }
2187
 
2188
      protected assignVoucher_result getResult(I iface, assignVoucher_args args) throws org.apache.thrift.TException {
2189
        assignVoucher_result result = new assignVoucher_result();
2190
        result.success = iface.assignVoucher(args.userId, args.userEmail, args.voucherType, args.amount);
2191
        return result;
2192
      }
2193
    }
2194
 
2195
    private static class markVoucherAsRedeemed<I extends Iface> extends org.apache.thrift.ProcessFunction<I, markVoucherAsRedeemed_args> {
2196
      public markVoucherAsRedeemed() {
2197
        super("markVoucherAsRedeemed");
2198
      }
2199
 
2200
      protected markVoucherAsRedeemed_args getEmptyArgsInstance() {
2201
        return new markVoucherAsRedeemed_args();
2202
      }
2203
 
2204
      protected markVoucherAsRedeemed_result getResult(I iface, markVoucherAsRedeemed_args args) throws org.apache.thrift.TException {
2205
        markVoucherAsRedeemed_result result = new markVoucherAsRedeemed_result();
2206
        result.success = iface.markVoucherAsRedeemed(args.voucherCode, args.redeemedOn);
2207
        result.setSuccessIsSet(true);
2208
        return result;
2209
      }
2210
    }
2211
 
1982 varun.gupt 2212
  }
2213
 
3430 rajveer 2214
  public static class createPromotion_args implements org.apache.thrift.TBase<createPromotion_args, createPromotion_args._Fields>, java.io.Serializable, Cloneable   {
2215
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_args");
1982 varun.gupt 2216
 
3430 rajveer 2217
    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);
2218
    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);
2219
    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);
2220
    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 2221
 
3430 rajveer 2222
    private String name; // required
2223
    private String ruleExecutionSrc; // required
2224
    private long startOn; // required
2225
    private long endOn; // required
1982 varun.gupt 2226
 
2227
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2228
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2229
      NAME((short)1, "name"),
2230
      RULE_EXECUTION_SRC((short)2, "ruleExecutionSrc"),
2231
      START_ON((short)3, "startOn"),
2232
      END_ON((short)4, "endOn");
2233
 
2234
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2235
 
2236
      static {
2237
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2238
          byName.put(field.getFieldName(), field);
2239
        }
2240
      }
2241
 
2242
      /**
2243
       * Find the _Fields constant that matches fieldId, or null if its not found.
2244
       */
2245
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2246
        switch(fieldId) {
2247
          case 1: // NAME
2248
            return NAME;
2249
          case 2: // RULE_EXECUTION_SRC
2250
            return RULE_EXECUTION_SRC;
2251
          case 3: // START_ON
2252
            return START_ON;
2253
          case 4: // END_ON
2254
            return END_ON;
2255
          default:
2256
            return null;
2257
        }
1982 varun.gupt 2258
      }
2259
 
2260
      /**
2261
       * Find the _Fields constant that matches fieldId, throwing an exception
2262
       * if it is not found.
2263
       */
2264
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2265
        _Fields fields = findByThriftId(fieldId);
2266
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2267
        return fields;
2268
      }
2269
 
2270
      /**
2271
       * Find the _Fields constant that matches name, or null if its not found.
2272
       */
2273
      public static _Fields findByName(String name) {
2274
        return byName.get(name);
2275
      }
2276
 
2277
      private final short _thriftId;
2278
      private final String _fieldName;
2279
 
2280
      _Fields(short thriftId, String fieldName) {
2281
        _thriftId = thriftId;
2282
        _fieldName = fieldName;
2283
      }
2284
 
2285
      public short getThriftFieldId() {
2286
        return _thriftId;
2287
      }
2288
 
2289
      public String getFieldName() {
2290
        return _fieldName;
2291
      }
2292
    }
2293
 
2294
    // isset id assignments
2295
    private static final int __STARTON_ISSET_ID = 0;
2296
    private static final int __ENDON_ISSET_ID = 1;
2297
    private BitSet __isset_bit_vector = new BitSet(2);
2298
 
3430 rajveer 2299
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2300
    static {
3430 rajveer 2301
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2302
      tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2303
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
2304
      tmpMap.put(_Fields.RULE_EXECUTION_SRC, new org.apache.thrift.meta_data.FieldMetaData("ruleExecutionSrc", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2305
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
2306
      tmpMap.put(_Fields.START_ON, new org.apache.thrift.meta_data.FieldMetaData("startOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2307
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
2308
      tmpMap.put(_Fields.END_ON, new org.apache.thrift.meta_data.FieldMetaData("endOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2309
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
2310
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2311
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_args.class, metaDataMap);
1982 varun.gupt 2312
    }
2313
 
2314
    public createPromotion_args() {
2315
    }
2316
 
2317
    public createPromotion_args(
2318
      String name,
2319
      String ruleExecutionSrc,
2320
      long startOn,
2321
      long endOn)
2322
    {
2323
      this();
2324
      this.name = name;
2325
      this.ruleExecutionSrc = ruleExecutionSrc;
2326
      this.startOn = startOn;
2327
      setStartOnIsSet(true);
2328
      this.endOn = endOn;
2329
      setEndOnIsSet(true);
2330
    }
2331
 
2332
    /**
2333
     * Performs a deep copy on <i>other</i>.
2334
     */
2335
    public createPromotion_args(createPromotion_args other) {
2336
      __isset_bit_vector.clear();
2337
      __isset_bit_vector.or(other.__isset_bit_vector);
2338
      if (other.isSetName()) {
2339
        this.name = other.name;
2340
      }
2341
      if (other.isSetRuleExecutionSrc()) {
2342
        this.ruleExecutionSrc = other.ruleExecutionSrc;
2343
      }
2344
      this.startOn = other.startOn;
2345
      this.endOn = other.endOn;
2346
    }
2347
 
2348
    public createPromotion_args deepCopy() {
2349
      return new createPromotion_args(this);
2350
    }
2351
 
3430 rajveer 2352
    @Override
2353
    public void clear() {
2354
      this.name = null;
2355
      this.ruleExecutionSrc = null;
2356
      setStartOnIsSet(false);
2357
      this.startOn = 0;
2358
      setEndOnIsSet(false);
2359
      this.endOn = 0;
1982 varun.gupt 2360
    }
2361
 
2362
    public String getName() {
2363
      return this.name;
2364
    }
2365
 
3430 rajveer 2366
    public void setName(String name) {
1982 varun.gupt 2367
      this.name = name;
2368
    }
2369
 
2370
    public void unsetName() {
2371
      this.name = null;
2372
    }
2373
 
3430 rajveer 2374
    /** Returns true if field name is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2375
    public boolean isSetName() {
2376
      return this.name != null;
2377
    }
2378
 
2379
    public void setNameIsSet(boolean value) {
2380
      if (!value) {
2381
        this.name = null;
2382
      }
2383
    }
2384
 
2385
    public String getRuleExecutionSrc() {
2386
      return this.ruleExecutionSrc;
2387
    }
2388
 
3430 rajveer 2389
    public void setRuleExecutionSrc(String ruleExecutionSrc) {
1982 varun.gupt 2390
      this.ruleExecutionSrc = ruleExecutionSrc;
2391
    }
2392
 
2393
    public void unsetRuleExecutionSrc() {
2394
      this.ruleExecutionSrc = null;
2395
    }
2396
 
3430 rajveer 2397
    /** Returns true if field ruleExecutionSrc is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2398
    public boolean isSetRuleExecutionSrc() {
2399
      return this.ruleExecutionSrc != null;
2400
    }
2401
 
2402
    public void setRuleExecutionSrcIsSet(boolean value) {
2403
      if (!value) {
2404
        this.ruleExecutionSrc = null;
2405
      }
2406
    }
2407
 
2408
    public long getStartOn() {
2409
      return this.startOn;
2410
    }
2411
 
3430 rajveer 2412
    public void setStartOn(long startOn) {
1982 varun.gupt 2413
      this.startOn = startOn;
2414
      setStartOnIsSet(true);
2415
    }
2416
 
2417
    public void unsetStartOn() {
2418
      __isset_bit_vector.clear(__STARTON_ISSET_ID);
2419
    }
2420
 
3430 rajveer 2421
    /** Returns true if field startOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2422
    public boolean isSetStartOn() {
2423
      return __isset_bit_vector.get(__STARTON_ISSET_ID);
2424
    }
2425
 
2426
    public void setStartOnIsSet(boolean value) {
2427
      __isset_bit_vector.set(__STARTON_ISSET_ID, value);
2428
    }
2429
 
2430
    public long getEndOn() {
2431
      return this.endOn;
2432
    }
2433
 
3430 rajveer 2434
    public void setEndOn(long endOn) {
1982 varun.gupt 2435
      this.endOn = endOn;
2436
      setEndOnIsSet(true);
2437
    }
2438
 
2439
    public void unsetEndOn() {
2440
      __isset_bit_vector.clear(__ENDON_ISSET_ID);
2441
    }
2442
 
3430 rajveer 2443
    /** Returns true if field endOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2444
    public boolean isSetEndOn() {
2445
      return __isset_bit_vector.get(__ENDON_ISSET_ID);
2446
    }
2447
 
2448
    public void setEndOnIsSet(boolean value) {
2449
      __isset_bit_vector.set(__ENDON_ISSET_ID, value);
2450
    }
2451
 
2452
    public void setFieldValue(_Fields field, Object value) {
2453
      switch (field) {
2454
      case NAME:
2455
        if (value == null) {
2456
          unsetName();
2457
        } else {
2458
          setName((String)value);
2459
        }
2460
        break;
2461
 
2462
      case RULE_EXECUTION_SRC:
2463
        if (value == null) {
2464
          unsetRuleExecutionSrc();
2465
        } else {
2466
          setRuleExecutionSrc((String)value);
2467
        }
2468
        break;
2469
 
2470
      case START_ON:
2471
        if (value == null) {
2472
          unsetStartOn();
2473
        } else {
2474
          setStartOn((Long)value);
2475
        }
2476
        break;
2477
 
2478
      case END_ON:
2479
        if (value == null) {
2480
          unsetEndOn();
2481
        } else {
2482
          setEndOn((Long)value);
2483
        }
2484
        break;
2485
 
2486
      }
2487
    }
2488
 
2489
    public Object getFieldValue(_Fields field) {
2490
      switch (field) {
2491
      case NAME:
2492
        return getName();
2493
 
2494
      case RULE_EXECUTION_SRC:
2495
        return getRuleExecutionSrc();
2496
 
2497
      case START_ON:
3430 rajveer 2498
        return Long.valueOf(getStartOn());
1982 varun.gupt 2499
 
2500
      case END_ON:
3430 rajveer 2501
        return Long.valueOf(getEndOn());
1982 varun.gupt 2502
 
2503
      }
2504
      throw new IllegalStateException();
2505
    }
2506
 
3430 rajveer 2507
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2508
    public boolean isSet(_Fields field) {
2509
      if (field == null) {
2510
        throw new IllegalArgumentException();
2511
      }
1982 varun.gupt 2512
 
2513
      switch (field) {
2514
      case NAME:
2515
        return isSetName();
2516
      case RULE_EXECUTION_SRC:
2517
        return isSetRuleExecutionSrc();
2518
      case START_ON:
2519
        return isSetStartOn();
2520
      case END_ON:
2521
        return isSetEndOn();
2522
      }
2523
      throw new IllegalStateException();
2524
    }
2525
 
2526
    @Override
2527
    public boolean equals(Object that) {
2528
      if (that == null)
2529
        return false;
2530
      if (that instanceof createPromotion_args)
2531
        return this.equals((createPromotion_args)that);
2532
      return false;
2533
    }
2534
 
2535
    public boolean equals(createPromotion_args that) {
2536
      if (that == null)
2537
        return false;
2538
 
2539
      boolean this_present_name = true && this.isSetName();
2540
      boolean that_present_name = true && that.isSetName();
2541
      if (this_present_name || that_present_name) {
2542
        if (!(this_present_name && that_present_name))
2543
          return false;
2544
        if (!this.name.equals(that.name))
2545
          return false;
2546
      }
2547
 
2548
      boolean this_present_ruleExecutionSrc = true && this.isSetRuleExecutionSrc();
2549
      boolean that_present_ruleExecutionSrc = true && that.isSetRuleExecutionSrc();
2550
      if (this_present_ruleExecutionSrc || that_present_ruleExecutionSrc) {
2551
        if (!(this_present_ruleExecutionSrc && that_present_ruleExecutionSrc))
2552
          return false;
2553
        if (!this.ruleExecutionSrc.equals(that.ruleExecutionSrc))
2554
          return false;
2555
      }
2556
 
2557
      boolean this_present_startOn = true;
2558
      boolean that_present_startOn = true;
2559
      if (this_present_startOn || that_present_startOn) {
2560
        if (!(this_present_startOn && that_present_startOn))
2561
          return false;
2562
        if (this.startOn != that.startOn)
2563
          return false;
2564
      }
2565
 
2566
      boolean this_present_endOn = true;
2567
      boolean that_present_endOn = true;
2568
      if (this_present_endOn || that_present_endOn) {
2569
        if (!(this_present_endOn && that_present_endOn))
2570
          return false;
2571
        if (this.endOn != that.endOn)
2572
          return false;
2573
      }
2574
 
2575
      return true;
2576
    }
2577
 
2578
    @Override
2579
    public int hashCode() {
2580
      return 0;
2581
    }
2582
 
2583
    public int compareTo(createPromotion_args other) {
2584
      if (!getClass().equals(other.getClass())) {
2585
        return getClass().getName().compareTo(other.getClass().getName());
2586
      }
2587
 
2588
      int lastComparison = 0;
2589
      createPromotion_args typedOther = (createPromotion_args)other;
2590
 
3430 rajveer 2591
      lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
1982 varun.gupt 2592
      if (lastComparison != 0) {
2593
        return lastComparison;
2594
      }
3430 rajveer 2595
      if (isSetName()) {
2596
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
2597
        if (lastComparison != 0) {
2598
          return lastComparison;
2599
        }
1982 varun.gupt 2600
      }
3430 rajveer 2601
      lastComparison = Boolean.valueOf(isSetRuleExecutionSrc()).compareTo(typedOther.isSetRuleExecutionSrc());
1982 varun.gupt 2602
      if (lastComparison != 0) {
2603
        return lastComparison;
2604
      }
3430 rajveer 2605
      if (isSetRuleExecutionSrc()) {
2606
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleExecutionSrc, typedOther.ruleExecutionSrc);
2607
        if (lastComparison != 0) {
2608
          return lastComparison;
2609
        }
1982 varun.gupt 2610
      }
3430 rajveer 2611
      lastComparison = Boolean.valueOf(isSetStartOn()).compareTo(typedOther.isSetStartOn());
1982 varun.gupt 2612
      if (lastComparison != 0) {
2613
        return lastComparison;
2614
      }
3430 rajveer 2615
      if (isSetStartOn()) {
2616
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startOn, typedOther.startOn);
2617
        if (lastComparison != 0) {
2618
          return lastComparison;
2619
        }
1982 varun.gupt 2620
      }
3430 rajveer 2621
      lastComparison = Boolean.valueOf(isSetEndOn()).compareTo(typedOther.isSetEndOn());
1982 varun.gupt 2622
      if (lastComparison != 0) {
2623
        return lastComparison;
2624
      }
3430 rajveer 2625
      if (isSetEndOn()) {
2626
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endOn, typedOther.endOn);
2627
        if (lastComparison != 0) {
2628
          return lastComparison;
2629
        }
1982 varun.gupt 2630
      }
2631
      return 0;
2632
    }
2633
 
3430 rajveer 2634
    public _Fields fieldForId(int fieldId) {
2635
      return _Fields.findByThriftId(fieldId);
2636
    }
2637
 
2638
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2639
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2640
      iprot.readStructBegin();
2641
      while (true)
2642
      {
2643
        field = iprot.readFieldBegin();
3430 rajveer 2644
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2645
          break;
2646
        }
3430 rajveer 2647
        switch (field.id) {
2648
          case 1: // NAME
2649
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
2650
              this.name = iprot.readString();
2651
            } else { 
2652
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2653
            }
2654
            break;
2655
          case 2: // RULE_EXECUTION_SRC
2656
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
2657
              this.ruleExecutionSrc = iprot.readString();
2658
            } else { 
2659
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2660
            }
2661
            break;
2662
          case 3: // START_ON
2663
            if (field.type == org.apache.thrift.protocol.TType.I64) {
2664
              this.startOn = iprot.readI64();
2665
              setStartOnIsSet(true);
2666
            } else { 
2667
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2668
            }
2669
            break;
2670
          case 4: // END_ON
2671
            if (field.type == org.apache.thrift.protocol.TType.I64) {
2672
              this.endOn = iprot.readI64();
2673
              setEndOnIsSet(true);
2674
            } else { 
2675
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2676
            }
2677
            break;
2678
          default:
2679
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2680
        }
3430 rajveer 2681
        iprot.readFieldEnd();
1982 varun.gupt 2682
      }
2683
      iprot.readStructEnd();
2684
      validate();
2685
    }
2686
 
3430 rajveer 2687
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2688
      validate();
2689
 
2690
      oprot.writeStructBegin(STRUCT_DESC);
2691
      if (this.name != null) {
2692
        oprot.writeFieldBegin(NAME_FIELD_DESC);
2693
        oprot.writeString(this.name);
2694
        oprot.writeFieldEnd();
2695
      }
2696
      if (this.ruleExecutionSrc != null) {
2697
        oprot.writeFieldBegin(RULE_EXECUTION_SRC_FIELD_DESC);
2698
        oprot.writeString(this.ruleExecutionSrc);
2699
        oprot.writeFieldEnd();
2700
      }
2701
      oprot.writeFieldBegin(START_ON_FIELD_DESC);
2702
      oprot.writeI64(this.startOn);
2703
      oprot.writeFieldEnd();
2704
      oprot.writeFieldBegin(END_ON_FIELD_DESC);
2705
      oprot.writeI64(this.endOn);
2706
      oprot.writeFieldEnd();
2707
      oprot.writeFieldStop();
2708
      oprot.writeStructEnd();
2709
    }
2710
 
2711
    @Override
2712
    public String toString() {
2713
      StringBuilder sb = new StringBuilder("createPromotion_args(");
2714
      boolean first = true;
2715
 
2716
      sb.append("name:");
2717
      if (this.name == null) {
2718
        sb.append("null");
2719
      } else {
2720
        sb.append(this.name);
2721
      }
2722
      first = false;
2723
      if (!first) sb.append(", ");
2724
      sb.append("ruleExecutionSrc:");
2725
      if (this.ruleExecutionSrc == null) {
2726
        sb.append("null");
2727
      } else {
2728
        sb.append(this.ruleExecutionSrc);
2729
      }
2730
      first = false;
2731
      if (!first) sb.append(", ");
2732
      sb.append("startOn:");
2733
      sb.append(this.startOn);
2734
      first = false;
2735
      if (!first) sb.append(", ");
2736
      sb.append("endOn:");
2737
      sb.append(this.endOn);
2738
      first = false;
2739
      sb.append(")");
2740
      return sb.toString();
2741
    }
2742
 
3430 rajveer 2743
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2744
      // check for required fields
2745
    }
2746
 
3430 rajveer 2747
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2748
      try {
2749
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2750
      } catch (org.apache.thrift.TException te) {
2751
        throw new java.io.IOException(te);
2752
      }
2753
    }
2754
 
2755
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2756
      try {
2757
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
2758
        __isset_bit_vector = new BitSet(1);
2759
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2760
      } catch (org.apache.thrift.TException te) {
2761
        throw new java.io.IOException(te);
2762
      }
2763
    }
2764
 
1982 varun.gupt 2765
  }
2766
 
3430 rajveer 2767
  public static class createPromotion_result implements org.apache.thrift.TBase<createPromotion_result, createPromotion_result._Fields>, java.io.Serializable, Cloneable   {
2768
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_result");
1982 varun.gupt 2769
 
3430 rajveer 2770
    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 2771
 
3430 rajveer 2772
    private PromotionException pex; // required
1982 varun.gupt 2773
 
2774
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2775
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2776
      PEX((short)1, "pex");
2777
 
2778
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2779
 
2780
      static {
2781
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2782
          byName.put(field.getFieldName(), field);
2783
        }
2784
      }
2785
 
2786
      /**
2787
       * Find the _Fields constant that matches fieldId, or null if its not found.
2788
       */
2789
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2790
        switch(fieldId) {
2791
          case 1: // PEX
2792
            return PEX;
2793
          default:
2794
            return null;
2795
        }
1982 varun.gupt 2796
      }
2797
 
2798
      /**
2799
       * Find the _Fields constant that matches fieldId, throwing an exception
2800
       * if it is not found.
2801
       */
2802
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2803
        _Fields fields = findByThriftId(fieldId);
2804
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2805
        return fields;
2806
      }
2807
 
2808
      /**
2809
       * Find the _Fields constant that matches name, or null if its not found.
2810
       */
2811
      public static _Fields findByName(String name) {
2812
        return byName.get(name);
2813
      }
2814
 
2815
      private final short _thriftId;
2816
      private final String _fieldName;
2817
 
2818
      _Fields(short thriftId, String fieldName) {
2819
        _thriftId = thriftId;
2820
        _fieldName = fieldName;
2821
      }
2822
 
2823
      public short getThriftFieldId() {
2824
        return _thriftId;
2825
      }
2826
 
2827
      public String getFieldName() {
2828
        return _fieldName;
2829
      }
2830
    }
2831
 
2832
    // isset id assignments
2833
 
3430 rajveer 2834
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2835
    static {
3430 rajveer 2836
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2837
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2838
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
2839
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2840
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_result.class, metaDataMap);
1982 varun.gupt 2841
    }
2842
 
2843
    public createPromotion_result() {
2844
    }
2845
 
2846
    public createPromotion_result(
2847
      PromotionException pex)
2848
    {
2849
      this();
2850
      this.pex = pex;
2851
    }
2852
 
2853
    /**
2854
     * Performs a deep copy on <i>other</i>.
2855
     */
2856
    public createPromotion_result(createPromotion_result other) {
2857
      if (other.isSetPex()) {
2858
        this.pex = new PromotionException(other.pex);
2859
      }
2860
    }
2861
 
2862
    public createPromotion_result deepCopy() {
2863
      return new createPromotion_result(this);
2864
    }
2865
 
3430 rajveer 2866
    @Override
2867
    public void clear() {
2868
      this.pex = null;
1982 varun.gupt 2869
    }
2870
 
2871
    public PromotionException getPex() {
2872
      return this.pex;
2873
    }
2874
 
3430 rajveer 2875
    public void setPex(PromotionException pex) {
1982 varun.gupt 2876
      this.pex = pex;
2877
    }
2878
 
2879
    public void unsetPex() {
2880
      this.pex = null;
2881
    }
2882
 
3430 rajveer 2883
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2884
    public boolean isSetPex() {
2885
      return this.pex != null;
2886
    }
2887
 
2888
    public void setPexIsSet(boolean value) {
2889
      if (!value) {
2890
        this.pex = null;
2891
      }
2892
    }
2893
 
2894
    public void setFieldValue(_Fields field, Object value) {
2895
      switch (field) {
2896
      case PEX:
2897
        if (value == null) {
2898
          unsetPex();
2899
        } else {
2900
          setPex((PromotionException)value);
2901
        }
2902
        break;
2903
 
2904
      }
2905
    }
2906
 
2907
    public Object getFieldValue(_Fields field) {
2908
      switch (field) {
2909
      case PEX:
2910
        return getPex();
2911
 
2912
      }
2913
      throw new IllegalStateException();
2914
    }
2915
 
3430 rajveer 2916
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2917
    public boolean isSet(_Fields field) {
2918
      if (field == null) {
2919
        throw new IllegalArgumentException();
2920
      }
1982 varun.gupt 2921
 
2922
      switch (field) {
2923
      case PEX:
2924
        return isSetPex();
2925
      }
2926
      throw new IllegalStateException();
2927
    }
2928
 
2929
    @Override
2930
    public boolean equals(Object that) {
2931
      if (that == null)
2932
        return false;
2933
      if (that instanceof createPromotion_result)
2934
        return this.equals((createPromotion_result)that);
2935
      return false;
2936
    }
2937
 
2938
    public boolean equals(createPromotion_result that) {
2939
      if (that == null)
2940
        return false;
2941
 
2942
      boolean this_present_pex = true && this.isSetPex();
2943
      boolean that_present_pex = true && that.isSetPex();
2944
      if (this_present_pex || that_present_pex) {
2945
        if (!(this_present_pex && that_present_pex))
2946
          return false;
2947
        if (!this.pex.equals(that.pex))
2948
          return false;
2949
      }
2950
 
2951
      return true;
2952
    }
2953
 
2954
    @Override
2955
    public int hashCode() {
2956
      return 0;
2957
    }
2958
 
2959
    public int compareTo(createPromotion_result other) {
2960
      if (!getClass().equals(other.getClass())) {
2961
        return getClass().getName().compareTo(other.getClass().getName());
2962
      }
2963
 
2964
      int lastComparison = 0;
2965
      createPromotion_result typedOther = (createPromotion_result)other;
2966
 
3430 rajveer 2967
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 2968
      if (lastComparison != 0) {
2969
        return lastComparison;
2970
      }
3430 rajveer 2971
      if (isSetPex()) {
2972
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
2973
        if (lastComparison != 0) {
2974
          return lastComparison;
2975
        }
1982 varun.gupt 2976
      }
2977
      return 0;
2978
    }
2979
 
3430 rajveer 2980
    public _Fields fieldForId(int fieldId) {
2981
      return _Fields.findByThriftId(fieldId);
2982
    }
2983
 
2984
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2985
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2986
      iprot.readStructBegin();
2987
      while (true)
2988
      {
2989
        field = iprot.readFieldBegin();
3430 rajveer 2990
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2991
          break;
2992
        }
3430 rajveer 2993
        switch (field.id) {
2994
          case 1: // PEX
2995
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
2996
              this.pex = new PromotionException();
2997
              this.pex.read(iprot);
2998
            } else { 
2999
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3000
            }
3001
            break;
3002
          default:
3003
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 3004
        }
3430 rajveer 3005
        iprot.readFieldEnd();
1982 varun.gupt 3006
      }
3007
      iprot.readStructEnd();
3008
      validate();
3009
    }
3010
 
3430 rajveer 3011
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 3012
      oprot.writeStructBegin(STRUCT_DESC);
3013
 
3014
      if (this.isSetPex()) {
3015
        oprot.writeFieldBegin(PEX_FIELD_DESC);
3016
        this.pex.write(oprot);
3017
        oprot.writeFieldEnd();
3018
      }
3019
      oprot.writeFieldStop();
3020
      oprot.writeStructEnd();
3021
    }
3022
 
3023
    @Override
3024
    public String toString() {
3025
      StringBuilder sb = new StringBuilder("createPromotion_result(");
3026
      boolean first = true;
3027
 
3028
      sb.append("pex:");
3029
      if (this.pex == null) {
3030
        sb.append("null");
3031
      } else {
3032
        sb.append(this.pex);
3033
      }
3034
      first = false;
3035
      sb.append(")");
3036
      return sb.toString();
3037
    }
3038
 
3430 rajveer 3039
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 3040
      // check for required fields
3041
    }
3042
 
3430 rajveer 3043
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3044
      try {
3045
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3046
      } catch (org.apache.thrift.TException te) {
3047
        throw new java.io.IOException(te);
3048
      }
3049
    }
3050
 
3051
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3052
      try {
3053
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3054
      } catch (org.apache.thrift.TException te) {
3055
        throw new java.io.IOException(te);
3056
      }
3057
    }
3058
 
1982 varun.gupt 3059
  }
3060
 
7746 amit.gupta 3061
  public static class removeAllCouponsByPromotionId_args implements org.apache.thrift.TBase<removeAllCouponsByPromotionId_args, removeAllCouponsByPromotionId_args._Fields>, java.io.Serializable, Cloneable   {
3062
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("removeAllCouponsByPromotionId_args");
3063
 
3064
    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);
3065
 
3066
    private long promotionId; // required
3067
 
3068
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3069
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3070
      PROMOTION_ID((short)1, "promotionId");
3071
 
3072
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3073
 
3074
      static {
3075
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3076
          byName.put(field.getFieldName(), field);
3077
        }
3078
      }
3079
 
3080
      /**
3081
       * Find the _Fields constant that matches fieldId, or null if its not found.
3082
       */
3083
      public static _Fields findByThriftId(int fieldId) {
3084
        switch(fieldId) {
3085
          case 1: // PROMOTION_ID
3086
            return PROMOTION_ID;
3087
          default:
3088
            return null;
3089
        }
3090
      }
3091
 
3092
      /**
3093
       * Find the _Fields constant that matches fieldId, throwing an exception
3094
       * if it is not found.
3095
       */
3096
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3097
        _Fields fields = findByThriftId(fieldId);
3098
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3099
        return fields;
3100
      }
3101
 
3102
      /**
3103
       * Find the _Fields constant that matches name, or null if its not found.
3104
       */
3105
      public static _Fields findByName(String name) {
3106
        return byName.get(name);
3107
      }
3108
 
3109
      private final short _thriftId;
3110
      private final String _fieldName;
3111
 
3112
      _Fields(short thriftId, String fieldName) {
3113
        _thriftId = thriftId;
3114
        _fieldName = fieldName;
3115
      }
3116
 
3117
      public short getThriftFieldId() {
3118
        return _thriftId;
3119
      }
3120
 
3121
      public String getFieldName() {
3122
        return _fieldName;
3123
      }
3124
    }
3125
 
3126
    // isset id assignments
3127
    private static final int __PROMOTIONID_ISSET_ID = 0;
3128
    private BitSet __isset_bit_vector = new BitSet(1);
3129
 
3130
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3131
    static {
3132
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3133
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3134
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
3135
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3136
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(removeAllCouponsByPromotionId_args.class, metaDataMap);
3137
    }
3138
 
3139
    public removeAllCouponsByPromotionId_args() {
3140
    }
3141
 
3142
    public removeAllCouponsByPromotionId_args(
3143
      long promotionId)
3144
    {
3145
      this();
3146
      this.promotionId = promotionId;
3147
      setPromotionIdIsSet(true);
3148
    }
3149
 
3150
    /**
3151
     * Performs a deep copy on <i>other</i>.
3152
     */
3153
    public removeAllCouponsByPromotionId_args(removeAllCouponsByPromotionId_args other) {
3154
      __isset_bit_vector.clear();
3155
      __isset_bit_vector.or(other.__isset_bit_vector);
3156
      this.promotionId = other.promotionId;
3157
    }
3158
 
3159
    public removeAllCouponsByPromotionId_args deepCopy() {
3160
      return new removeAllCouponsByPromotionId_args(this);
3161
    }
3162
 
3163
    @Override
3164
    public void clear() {
3165
      setPromotionIdIsSet(false);
3166
      this.promotionId = 0;
3167
    }
3168
 
3169
    public long getPromotionId() {
3170
      return this.promotionId;
3171
    }
3172
 
3173
    public void setPromotionId(long promotionId) {
3174
      this.promotionId = promotionId;
3175
      setPromotionIdIsSet(true);
3176
    }
3177
 
3178
    public void unsetPromotionId() {
3179
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
3180
    }
3181
 
3182
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
3183
    public boolean isSetPromotionId() {
3184
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
3185
    }
3186
 
3187
    public void setPromotionIdIsSet(boolean value) {
3188
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
3189
    }
3190
 
3191
    public void setFieldValue(_Fields field, Object value) {
3192
      switch (field) {
3193
      case PROMOTION_ID:
3194
        if (value == null) {
3195
          unsetPromotionId();
3196
        } else {
3197
          setPromotionId((Long)value);
3198
        }
3199
        break;
3200
 
3201
      }
3202
    }
3203
 
3204
    public Object getFieldValue(_Fields field) {
3205
      switch (field) {
3206
      case PROMOTION_ID:
3207
        return Long.valueOf(getPromotionId());
3208
 
3209
      }
3210
      throw new IllegalStateException();
3211
    }
3212
 
3213
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3214
    public boolean isSet(_Fields field) {
3215
      if (field == null) {
3216
        throw new IllegalArgumentException();
3217
      }
3218
 
3219
      switch (field) {
3220
      case PROMOTION_ID:
3221
        return isSetPromotionId();
3222
      }
3223
      throw new IllegalStateException();
3224
    }
3225
 
3226
    @Override
3227
    public boolean equals(Object that) {
3228
      if (that == null)
3229
        return false;
3230
      if (that instanceof removeAllCouponsByPromotionId_args)
3231
        return this.equals((removeAllCouponsByPromotionId_args)that);
3232
      return false;
3233
    }
3234
 
3235
    public boolean equals(removeAllCouponsByPromotionId_args that) {
3236
      if (that == null)
3237
        return false;
3238
 
3239
      boolean this_present_promotionId = true;
3240
      boolean that_present_promotionId = true;
3241
      if (this_present_promotionId || that_present_promotionId) {
3242
        if (!(this_present_promotionId && that_present_promotionId))
3243
          return false;
3244
        if (this.promotionId != that.promotionId)
3245
          return false;
3246
      }
3247
 
3248
      return true;
3249
    }
3250
 
3251
    @Override
3252
    public int hashCode() {
3253
      return 0;
3254
    }
3255
 
3256
    public int compareTo(removeAllCouponsByPromotionId_args other) {
3257
      if (!getClass().equals(other.getClass())) {
3258
        return getClass().getName().compareTo(other.getClass().getName());
3259
      }
3260
 
3261
      int lastComparison = 0;
3262
      removeAllCouponsByPromotionId_args typedOther = (removeAllCouponsByPromotionId_args)other;
3263
 
3264
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
3265
      if (lastComparison != 0) {
3266
        return lastComparison;
3267
      }
3268
      if (isSetPromotionId()) {
3269
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
3270
        if (lastComparison != 0) {
3271
          return lastComparison;
3272
        }
3273
      }
3274
      return 0;
3275
    }
3276
 
3277
    public _Fields fieldForId(int fieldId) {
3278
      return _Fields.findByThriftId(fieldId);
3279
    }
3280
 
3281
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3282
      org.apache.thrift.protocol.TField field;
3283
      iprot.readStructBegin();
3284
      while (true)
3285
      {
3286
        field = iprot.readFieldBegin();
3287
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3288
          break;
3289
        }
3290
        switch (field.id) {
3291
          case 1: // PROMOTION_ID
3292
            if (field.type == org.apache.thrift.protocol.TType.I64) {
3293
              this.promotionId = iprot.readI64();
3294
              setPromotionIdIsSet(true);
3295
            } else { 
3296
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3297
            }
3298
            break;
3299
          default:
3300
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3301
        }
3302
        iprot.readFieldEnd();
3303
      }
3304
      iprot.readStructEnd();
3305
      validate();
3306
    }
3307
 
3308
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3309
      validate();
3310
 
3311
      oprot.writeStructBegin(STRUCT_DESC);
3312
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
3313
      oprot.writeI64(this.promotionId);
3314
      oprot.writeFieldEnd();
3315
      oprot.writeFieldStop();
3316
      oprot.writeStructEnd();
3317
    }
3318
 
3319
    @Override
3320
    public String toString() {
3321
      StringBuilder sb = new StringBuilder("removeAllCouponsByPromotionId_args(");
3322
      boolean first = true;
3323
 
3324
      sb.append("promotionId:");
3325
      sb.append(this.promotionId);
3326
      first = false;
3327
      sb.append(")");
3328
      return sb.toString();
3329
    }
3330
 
3331
    public void validate() throws org.apache.thrift.TException {
3332
      // check for required fields
3333
    }
3334
 
3335
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3336
      try {
3337
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3338
      } catch (org.apache.thrift.TException te) {
3339
        throw new java.io.IOException(te);
3340
      }
3341
    }
3342
 
3343
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3344
      try {
3345
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
3346
        __isset_bit_vector = new BitSet(1);
3347
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3348
      } catch (org.apache.thrift.TException te) {
3349
        throw new java.io.IOException(te);
3350
      }
3351
    }
3352
 
3353
  }
3354
 
3355
  public static class removeAllCouponsByPromotionId_result implements org.apache.thrift.TBase<removeAllCouponsByPromotionId_result, removeAllCouponsByPromotionId_result._Fields>, java.io.Serializable, Cloneable   {
3356
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("removeAllCouponsByPromotionId_result");
3357
 
3358
    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);
3359
    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);
3360
 
3361
    private long success; // required
3362
    private PromotionException pex; // required
3363
 
3364
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3365
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3366
      SUCCESS((short)0, "success"),
3367
      PEX((short)1, "pex");
3368
 
3369
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3370
 
3371
      static {
3372
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3373
          byName.put(field.getFieldName(), field);
3374
        }
3375
      }
3376
 
3377
      /**
3378
       * Find the _Fields constant that matches fieldId, or null if its not found.
3379
       */
3380
      public static _Fields findByThriftId(int fieldId) {
3381
        switch(fieldId) {
3382
          case 0: // SUCCESS
3383
            return SUCCESS;
3384
          case 1: // PEX
3385
            return PEX;
3386
          default:
3387
            return null;
3388
        }
3389
      }
3390
 
3391
      /**
3392
       * Find the _Fields constant that matches fieldId, throwing an exception
3393
       * if it is not found.
3394
       */
3395
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3396
        _Fields fields = findByThriftId(fieldId);
3397
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3398
        return fields;
3399
      }
3400
 
3401
      /**
3402
       * Find the _Fields constant that matches name, or null if its not found.
3403
       */
3404
      public static _Fields findByName(String name) {
3405
        return byName.get(name);
3406
      }
3407
 
3408
      private final short _thriftId;
3409
      private final String _fieldName;
3410
 
3411
      _Fields(short thriftId, String fieldName) {
3412
        _thriftId = thriftId;
3413
        _fieldName = fieldName;
3414
      }
3415
 
3416
      public short getThriftFieldId() {
3417
        return _thriftId;
3418
      }
3419
 
3420
      public String getFieldName() {
3421
        return _fieldName;
3422
      }
3423
    }
3424
 
3425
    // isset id assignments
3426
    private static final int __SUCCESS_ISSET_ID = 0;
3427
    private BitSet __isset_bit_vector = new BitSet(1);
3428
 
3429
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3430
    static {
3431
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3432
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3433
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
3434
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3435
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
3436
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3437
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(removeAllCouponsByPromotionId_result.class, metaDataMap);
3438
    }
3439
 
3440
    public removeAllCouponsByPromotionId_result() {
3441
    }
3442
 
3443
    public removeAllCouponsByPromotionId_result(
3444
      long success,
3445
      PromotionException pex)
3446
    {
3447
      this();
3448
      this.success = success;
3449
      setSuccessIsSet(true);
3450
      this.pex = pex;
3451
    }
3452
 
3453
    /**
3454
     * Performs a deep copy on <i>other</i>.
3455
     */
3456
    public removeAllCouponsByPromotionId_result(removeAllCouponsByPromotionId_result other) {
3457
      __isset_bit_vector.clear();
3458
      __isset_bit_vector.or(other.__isset_bit_vector);
3459
      this.success = other.success;
3460
      if (other.isSetPex()) {
3461
        this.pex = new PromotionException(other.pex);
3462
      }
3463
    }
3464
 
3465
    public removeAllCouponsByPromotionId_result deepCopy() {
3466
      return new removeAllCouponsByPromotionId_result(this);
3467
    }
3468
 
3469
    @Override
3470
    public void clear() {
3471
      setSuccessIsSet(false);
3472
      this.success = 0;
3473
      this.pex = null;
3474
    }
3475
 
3476
    public long getSuccess() {
3477
      return this.success;
3478
    }
3479
 
3480
    public void setSuccess(long success) {
3481
      this.success = success;
3482
      setSuccessIsSet(true);
3483
    }
3484
 
3485
    public void unsetSuccess() {
3486
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
3487
    }
3488
 
3489
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3490
    public boolean isSetSuccess() {
3491
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
3492
    }
3493
 
3494
    public void setSuccessIsSet(boolean value) {
3495
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
3496
    }
3497
 
3498
    public PromotionException getPex() {
3499
      return this.pex;
3500
    }
3501
 
3502
    public void setPex(PromotionException pex) {
3503
      this.pex = pex;
3504
    }
3505
 
3506
    public void unsetPex() {
3507
      this.pex = null;
3508
    }
3509
 
3510
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3511
    public boolean isSetPex() {
3512
      return this.pex != null;
3513
    }
3514
 
3515
    public void setPexIsSet(boolean value) {
3516
      if (!value) {
3517
        this.pex = null;
3518
      }
3519
    }
3520
 
3521
    public void setFieldValue(_Fields field, Object value) {
3522
      switch (field) {
3523
      case SUCCESS:
3524
        if (value == null) {
3525
          unsetSuccess();
3526
        } else {
3527
          setSuccess((Long)value);
3528
        }
3529
        break;
3530
 
3531
      case PEX:
3532
        if (value == null) {
3533
          unsetPex();
3534
        } else {
3535
          setPex((PromotionException)value);
3536
        }
3537
        break;
3538
 
3539
      }
3540
    }
3541
 
3542
    public Object getFieldValue(_Fields field) {
3543
      switch (field) {
3544
      case SUCCESS:
3545
        return Long.valueOf(getSuccess());
3546
 
3547
      case PEX:
3548
        return getPex();
3549
 
3550
      }
3551
      throw new IllegalStateException();
3552
    }
3553
 
3554
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3555
    public boolean isSet(_Fields field) {
3556
      if (field == null) {
3557
        throw new IllegalArgumentException();
3558
      }
3559
 
3560
      switch (field) {
3561
      case SUCCESS:
3562
        return isSetSuccess();
3563
      case PEX:
3564
        return isSetPex();
3565
      }
3566
      throw new IllegalStateException();
3567
    }
3568
 
3569
    @Override
3570
    public boolean equals(Object that) {
3571
      if (that == null)
3572
        return false;
3573
      if (that instanceof removeAllCouponsByPromotionId_result)
3574
        return this.equals((removeAllCouponsByPromotionId_result)that);
3575
      return false;
3576
    }
3577
 
3578
    public boolean equals(removeAllCouponsByPromotionId_result that) {
3579
      if (that == null)
3580
        return false;
3581
 
3582
      boolean this_present_success = true;
3583
      boolean that_present_success = true;
3584
      if (this_present_success || that_present_success) {
3585
        if (!(this_present_success && that_present_success))
3586
          return false;
3587
        if (this.success != that.success)
3588
          return false;
3589
      }
3590
 
3591
      boolean this_present_pex = true && this.isSetPex();
3592
      boolean that_present_pex = true && that.isSetPex();
3593
      if (this_present_pex || that_present_pex) {
3594
        if (!(this_present_pex && that_present_pex))
3595
          return false;
3596
        if (!this.pex.equals(that.pex))
3597
          return false;
3598
      }
3599
 
3600
      return true;
3601
    }
3602
 
3603
    @Override
3604
    public int hashCode() {
3605
      return 0;
3606
    }
3607
 
3608
    public int compareTo(removeAllCouponsByPromotionId_result other) {
3609
      if (!getClass().equals(other.getClass())) {
3610
        return getClass().getName().compareTo(other.getClass().getName());
3611
      }
3612
 
3613
      int lastComparison = 0;
3614
      removeAllCouponsByPromotionId_result typedOther = (removeAllCouponsByPromotionId_result)other;
3615
 
3616
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3617
      if (lastComparison != 0) {
3618
        return lastComparison;
3619
      }
3620
      if (isSetSuccess()) {
3621
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
3622
        if (lastComparison != 0) {
3623
          return lastComparison;
3624
        }
3625
      }
3626
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3627
      if (lastComparison != 0) {
3628
        return lastComparison;
3629
      }
3630
      if (isSetPex()) {
3631
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
3632
        if (lastComparison != 0) {
3633
          return lastComparison;
3634
        }
3635
      }
3636
      return 0;
3637
    }
3638
 
3639
    public _Fields fieldForId(int fieldId) {
3640
      return _Fields.findByThriftId(fieldId);
3641
    }
3642
 
3643
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3644
      org.apache.thrift.protocol.TField field;
3645
      iprot.readStructBegin();
3646
      while (true)
3647
      {
3648
        field = iprot.readFieldBegin();
3649
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3650
          break;
3651
        }
3652
        switch (field.id) {
3653
          case 0: // SUCCESS
3654
            if (field.type == org.apache.thrift.protocol.TType.I64) {
3655
              this.success = iprot.readI64();
3656
              setSuccessIsSet(true);
3657
            } else { 
3658
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3659
            }
3660
            break;
3661
          case 1: // PEX
3662
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3663
              this.pex = new PromotionException();
3664
              this.pex.read(iprot);
3665
            } else { 
3666
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3667
            }
3668
            break;
3669
          default:
3670
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3671
        }
3672
        iprot.readFieldEnd();
3673
      }
3674
      iprot.readStructEnd();
3675
      validate();
3676
    }
3677
 
3678
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3679
      oprot.writeStructBegin(STRUCT_DESC);
3680
 
3681
      if (this.isSetSuccess()) {
3682
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
3683
        oprot.writeI64(this.success);
3684
        oprot.writeFieldEnd();
3685
      } else if (this.isSetPex()) {
3686
        oprot.writeFieldBegin(PEX_FIELD_DESC);
3687
        this.pex.write(oprot);
3688
        oprot.writeFieldEnd();
3689
      }
3690
      oprot.writeFieldStop();
3691
      oprot.writeStructEnd();
3692
    }
3693
 
3694
    @Override
3695
    public String toString() {
3696
      StringBuilder sb = new StringBuilder("removeAllCouponsByPromotionId_result(");
3697
      boolean first = true;
3698
 
3699
      sb.append("success:");
3700
      sb.append(this.success);
3701
      first = false;
3702
      if (!first) sb.append(", ");
3703
      sb.append("pex:");
3704
      if (this.pex == null) {
3705
        sb.append("null");
3706
      } else {
3707
        sb.append(this.pex);
3708
      }
3709
      first = false;
3710
      sb.append(")");
3711
      return sb.toString();
3712
    }
3713
 
3714
    public void validate() throws org.apache.thrift.TException {
3715
      // check for required fields
3716
    }
3717
 
3718
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3719
      try {
3720
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3721
      } catch (org.apache.thrift.TException te) {
3722
        throw new java.io.IOException(te);
3723
      }
3724
    }
3725
 
3726
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3727
      try {
3728
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3729
      } catch (org.apache.thrift.TException te) {
3730
        throw new java.io.IOException(te);
3731
      }
3732
    }
3733
 
3734
  }
3735
 
6301 amit.gupta 3736
  public static class getCoupon_args implements org.apache.thrift.TBase<getCoupon_args, getCoupon_args._Fields>, java.io.Serializable, Cloneable   {
3737
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCoupon_args");
3738
 
3739
    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);
3740
 
3741
    private String couponCode; // required
3742
 
3743
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3744
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3745
      COUPON_CODE((short)1, "couponCode");
3746
 
3747
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3748
 
3749
      static {
3750
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3751
          byName.put(field.getFieldName(), field);
3752
        }
3753
      }
3754
 
3755
      /**
3756
       * Find the _Fields constant that matches fieldId, or null if its not found.
3757
       */
3758
      public static _Fields findByThriftId(int fieldId) {
3759
        switch(fieldId) {
3760
          case 1: // COUPON_CODE
3761
            return COUPON_CODE;
3762
          default:
3763
            return null;
3764
        }
3765
      }
3766
 
3767
      /**
3768
       * Find the _Fields constant that matches fieldId, throwing an exception
3769
       * if it is not found.
3770
       */
3771
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3772
        _Fields fields = findByThriftId(fieldId);
3773
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3774
        return fields;
3775
      }
3776
 
3777
      /**
3778
       * Find the _Fields constant that matches name, or null if its not found.
3779
       */
3780
      public static _Fields findByName(String name) {
3781
        return byName.get(name);
3782
      }
3783
 
3784
      private final short _thriftId;
3785
      private final String _fieldName;
3786
 
3787
      _Fields(short thriftId, String fieldName) {
3788
        _thriftId = thriftId;
3789
        _fieldName = fieldName;
3790
      }
3791
 
3792
      public short getThriftFieldId() {
3793
        return _thriftId;
3794
      }
3795
 
3796
      public String getFieldName() {
3797
        return _fieldName;
3798
      }
3799
    }
3800
 
3801
    // isset id assignments
3802
 
3803
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3804
    static {
3805
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3806
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3807
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
3808
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3809
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCoupon_args.class, metaDataMap);
3810
    }
3811
 
3812
    public getCoupon_args() {
3813
    }
3814
 
3815
    public getCoupon_args(
3816
      String couponCode)
3817
    {
3818
      this();
3819
      this.couponCode = couponCode;
3820
    }
3821
 
3822
    /**
3823
     * Performs a deep copy on <i>other</i>.
3824
     */
3825
    public getCoupon_args(getCoupon_args other) {
3826
      if (other.isSetCouponCode()) {
3827
        this.couponCode = other.couponCode;
3828
      }
3829
    }
3830
 
3831
    public getCoupon_args deepCopy() {
3832
      return new getCoupon_args(this);
3833
    }
3834
 
3835
    @Override
3836
    public void clear() {
3837
      this.couponCode = null;
3838
    }
3839
 
3840
    public String getCouponCode() {
3841
      return this.couponCode;
3842
    }
3843
 
3844
    public void setCouponCode(String couponCode) {
3845
      this.couponCode = couponCode;
3846
    }
3847
 
3848
    public void unsetCouponCode() {
3849
      this.couponCode = null;
3850
    }
3851
 
3852
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3853
    public boolean isSetCouponCode() {
3854
      return this.couponCode != null;
3855
    }
3856
 
3857
    public void setCouponCodeIsSet(boolean value) {
3858
      if (!value) {
3859
        this.couponCode = null;
3860
      }
3861
    }
3862
 
3863
    public void setFieldValue(_Fields field, Object value) {
3864
      switch (field) {
3865
      case COUPON_CODE:
3866
        if (value == null) {
3867
          unsetCouponCode();
3868
        } else {
3869
          setCouponCode((String)value);
3870
        }
3871
        break;
3872
 
3873
      }
3874
    }
3875
 
3876
    public Object getFieldValue(_Fields field) {
3877
      switch (field) {
3878
      case COUPON_CODE:
3879
        return getCouponCode();
3880
 
3881
      }
3882
      throw new IllegalStateException();
3883
    }
3884
 
3885
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3886
    public boolean isSet(_Fields field) {
3887
      if (field == null) {
3888
        throw new IllegalArgumentException();
3889
      }
3890
 
3891
      switch (field) {
3892
      case COUPON_CODE:
3893
        return isSetCouponCode();
3894
      }
3895
      throw new IllegalStateException();
3896
    }
3897
 
3898
    @Override
3899
    public boolean equals(Object that) {
3900
      if (that == null)
3901
        return false;
3902
      if (that instanceof getCoupon_args)
3903
        return this.equals((getCoupon_args)that);
3904
      return false;
3905
    }
3906
 
3907
    public boolean equals(getCoupon_args that) {
3908
      if (that == null)
3909
        return false;
3910
 
3911
      boolean this_present_couponCode = true && this.isSetCouponCode();
3912
      boolean that_present_couponCode = true && that.isSetCouponCode();
3913
      if (this_present_couponCode || that_present_couponCode) {
3914
        if (!(this_present_couponCode && that_present_couponCode))
3915
          return false;
3916
        if (!this.couponCode.equals(that.couponCode))
3917
          return false;
3918
      }
3919
 
3920
      return true;
3921
    }
3922
 
3923
    @Override
3924
    public int hashCode() {
3925
      return 0;
3926
    }
3927
 
3928
    public int compareTo(getCoupon_args other) {
3929
      if (!getClass().equals(other.getClass())) {
3930
        return getClass().getName().compareTo(other.getClass().getName());
3931
      }
3932
 
3933
      int lastComparison = 0;
3934
      getCoupon_args typedOther = (getCoupon_args)other;
3935
 
3936
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3937
      if (lastComparison != 0) {
3938
        return lastComparison;
3939
      }
3940
      if (isSetCouponCode()) {
3941
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
3942
        if (lastComparison != 0) {
3943
          return lastComparison;
3944
        }
3945
      }
3946
      return 0;
3947
    }
3948
 
3949
    public _Fields fieldForId(int fieldId) {
3950
      return _Fields.findByThriftId(fieldId);
3951
    }
3952
 
3953
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3954
      org.apache.thrift.protocol.TField field;
3955
      iprot.readStructBegin();
3956
      while (true)
3957
      {
3958
        field = iprot.readFieldBegin();
3959
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3960
          break;
3961
        }
3962
        switch (field.id) {
3963
          case 1: // COUPON_CODE
3964
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
3965
              this.couponCode = iprot.readString();
3966
            } else { 
3967
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3968
            }
3969
            break;
3970
          default:
3971
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3972
        }
3973
        iprot.readFieldEnd();
3974
      }
3975
      iprot.readStructEnd();
3976
      validate();
3977
    }
3978
 
3979
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3980
      validate();
3981
 
3982
      oprot.writeStructBegin(STRUCT_DESC);
3983
      if (this.couponCode != null) {
3984
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
3985
        oprot.writeString(this.couponCode);
3986
        oprot.writeFieldEnd();
3987
      }
3988
      oprot.writeFieldStop();
3989
      oprot.writeStructEnd();
3990
    }
3991
 
3992
    @Override
3993
    public String toString() {
3994
      StringBuilder sb = new StringBuilder("getCoupon_args(");
3995
      boolean first = true;
3996
 
3997
      sb.append("couponCode:");
3998
      if (this.couponCode == null) {
3999
        sb.append("null");
4000
      } else {
4001
        sb.append(this.couponCode);
4002
      }
4003
      first = false;
4004
      sb.append(")");
4005
      return sb.toString();
4006
    }
4007
 
4008
    public void validate() throws org.apache.thrift.TException {
4009
      // check for required fields
4010
    }
4011
 
4012
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4013
      try {
4014
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4015
      } catch (org.apache.thrift.TException te) {
4016
        throw new java.io.IOException(te);
4017
      }
4018
    }
4019
 
4020
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4021
      try {
4022
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4023
      } catch (org.apache.thrift.TException te) {
4024
        throw new java.io.IOException(te);
4025
      }
4026
    }
4027
 
4028
  }
4029
 
4030
  public static class getCoupon_result implements org.apache.thrift.TBase<getCoupon_result, getCoupon_result._Fields>, java.io.Serializable, Cloneable   {
4031
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCoupon_result");
4032
 
4033
    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);
4034
    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);
4035
 
4036
    private Coupon success; // required
4037
    private PromotionException pex; // required
4038
 
4039
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4040
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4041
      SUCCESS((short)0, "success"),
4042
      PEX((short)1, "pex");
4043
 
4044
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4045
 
4046
      static {
4047
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4048
          byName.put(field.getFieldName(), field);
4049
        }
4050
      }
4051
 
4052
      /**
4053
       * Find the _Fields constant that matches fieldId, or null if its not found.
4054
       */
4055
      public static _Fields findByThriftId(int fieldId) {
4056
        switch(fieldId) {
4057
          case 0: // SUCCESS
4058
            return SUCCESS;
4059
          case 1: // PEX
4060
            return PEX;
4061
          default:
4062
            return null;
4063
        }
4064
      }
4065
 
4066
      /**
4067
       * Find the _Fields constant that matches fieldId, throwing an exception
4068
       * if it is not found.
4069
       */
4070
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4071
        _Fields fields = findByThriftId(fieldId);
4072
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4073
        return fields;
4074
      }
4075
 
4076
      /**
4077
       * Find the _Fields constant that matches name, or null if its not found.
4078
       */
4079
      public static _Fields findByName(String name) {
4080
        return byName.get(name);
4081
      }
4082
 
4083
      private final short _thriftId;
4084
      private final String _fieldName;
4085
 
4086
      _Fields(short thriftId, String fieldName) {
4087
        _thriftId = thriftId;
4088
        _fieldName = fieldName;
4089
      }
4090
 
4091
      public short getThriftFieldId() {
4092
        return _thriftId;
4093
      }
4094
 
4095
      public String getFieldName() {
4096
        return _fieldName;
4097
      }
4098
    }
4099
 
4100
    // isset id assignments
4101
 
4102
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4103
    static {
4104
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4105
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4106
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class)));
4107
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4108
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4109
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4110
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCoupon_result.class, metaDataMap);
4111
    }
4112
 
4113
    public getCoupon_result() {
4114
    }
4115
 
4116
    public getCoupon_result(
4117
      Coupon success,
4118
      PromotionException pex)
4119
    {
4120
      this();
4121
      this.success = success;
4122
      this.pex = pex;
4123
    }
4124
 
4125
    /**
4126
     * Performs a deep copy on <i>other</i>.
4127
     */
4128
    public getCoupon_result(getCoupon_result other) {
4129
      if (other.isSetSuccess()) {
4130
        this.success = new Coupon(other.success);
4131
      }
4132
      if (other.isSetPex()) {
4133
        this.pex = new PromotionException(other.pex);
4134
      }
4135
    }
4136
 
4137
    public getCoupon_result deepCopy() {
4138
      return new getCoupon_result(this);
4139
    }
4140
 
4141
    @Override
4142
    public void clear() {
4143
      this.success = null;
4144
      this.pex = null;
4145
    }
4146
 
4147
    public Coupon getSuccess() {
4148
      return this.success;
4149
    }
4150
 
4151
    public void setSuccess(Coupon success) {
4152
      this.success = success;
4153
    }
4154
 
4155
    public void unsetSuccess() {
4156
      this.success = null;
4157
    }
4158
 
4159
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
4160
    public boolean isSetSuccess() {
4161
      return this.success != null;
4162
    }
4163
 
4164
    public void setSuccessIsSet(boolean value) {
4165
      if (!value) {
4166
        this.success = null;
4167
      }
4168
    }
4169
 
4170
    public PromotionException getPex() {
4171
      return this.pex;
4172
    }
4173
 
4174
    public void setPex(PromotionException pex) {
4175
      this.pex = pex;
4176
    }
4177
 
4178
    public void unsetPex() {
4179
      this.pex = null;
4180
    }
4181
 
4182
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
4183
    public boolean isSetPex() {
4184
      return this.pex != null;
4185
    }
4186
 
4187
    public void setPexIsSet(boolean value) {
4188
      if (!value) {
4189
        this.pex = null;
4190
      }
4191
    }
4192
 
4193
    public void setFieldValue(_Fields field, Object value) {
4194
      switch (field) {
4195
      case SUCCESS:
4196
        if (value == null) {
4197
          unsetSuccess();
4198
        } else {
4199
          setSuccess((Coupon)value);
4200
        }
4201
        break;
4202
 
4203
      case PEX:
4204
        if (value == null) {
4205
          unsetPex();
4206
        } else {
4207
          setPex((PromotionException)value);
4208
        }
4209
        break;
4210
 
4211
      }
4212
    }
4213
 
4214
    public Object getFieldValue(_Fields field) {
4215
      switch (field) {
4216
      case SUCCESS:
4217
        return getSuccess();
4218
 
4219
      case PEX:
4220
        return getPex();
4221
 
4222
      }
4223
      throw new IllegalStateException();
4224
    }
4225
 
4226
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4227
    public boolean isSet(_Fields field) {
4228
      if (field == null) {
4229
        throw new IllegalArgumentException();
4230
      }
4231
 
4232
      switch (field) {
4233
      case SUCCESS:
4234
        return isSetSuccess();
4235
      case PEX:
4236
        return isSetPex();
4237
      }
4238
      throw new IllegalStateException();
4239
    }
4240
 
4241
    @Override
4242
    public boolean equals(Object that) {
4243
      if (that == null)
4244
        return false;
4245
      if (that instanceof getCoupon_result)
4246
        return this.equals((getCoupon_result)that);
4247
      return false;
4248
    }
4249
 
4250
    public boolean equals(getCoupon_result that) {
4251
      if (that == null)
4252
        return false;
4253
 
4254
      boolean this_present_success = true && this.isSetSuccess();
4255
      boolean that_present_success = true && that.isSetSuccess();
4256
      if (this_present_success || that_present_success) {
4257
        if (!(this_present_success && that_present_success))
4258
          return false;
4259
        if (!this.success.equals(that.success))
4260
          return false;
4261
      }
4262
 
4263
      boolean this_present_pex = true && this.isSetPex();
4264
      boolean that_present_pex = true && that.isSetPex();
4265
      if (this_present_pex || that_present_pex) {
4266
        if (!(this_present_pex && that_present_pex))
4267
          return false;
4268
        if (!this.pex.equals(that.pex))
4269
          return false;
4270
      }
4271
 
4272
      return true;
4273
    }
4274
 
4275
    @Override
4276
    public int hashCode() {
4277
      return 0;
4278
    }
4279
 
4280
    public int compareTo(getCoupon_result other) {
4281
      if (!getClass().equals(other.getClass())) {
4282
        return getClass().getName().compareTo(other.getClass().getName());
4283
      }
4284
 
4285
      int lastComparison = 0;
4286
      getCoupon_result typedOther = (getCoupon_result)other;
4287
 
4288
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
4289
      if (lastComparison != 0) {
4290
        return lastComparison;
4291
      }
4292
      if (isSetSuccess()) {
4293
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4294
        if (lastComparison != 0) {
4295
          return lastComparison;
4296
        }
4297
      }
4298
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
4299
      if (lastComparison != 0) {
4300
        return lastComparison;
4301
      }
4302
      if (isSetPex()) {
4303
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
4304
        if (lastComparison != 0) {
4305
          return lastComparison;
4306
        }
4307
      }
4308
      return 0;
4309
    }
4310
 
4311
    public _Fields fieldForId(int fieldId) {
4312
      return _Fields.findByThriftId(fieldId);
4313
    }
4314
 
4315
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4316
      org.apache.thrift.protocol.TField field;
4317
      iprot.readStructBegin();
4318
      while (true)
4319
      {
4320
        field = iprot.readFieldBegin();
4321
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4322
          break;
4323
        }
4324
        switch (field.id) {
4325
          case 0: // SUCCESS
4326
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4327
              this.success = new Coupon();
4328
              this.success.read(iprot);
4329
            } else { 
4330
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4331
            }
4332
            break;
4333
          case 1: // PEX
4334
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4335
              this.pex = new PromotionException();
4336
              this.pex.read(iprot);
4337
            } else { 
4338
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4339
            }
4340
            break;
4341
          default:
4342
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4343
        }
4344
        iprot.readFieldEnd();
4345
      }
4346
      iprot.readStructEnd();
4347
      validate();
4348
    }
4349
 
4350
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4351
      oprot.writeStructBegin(STRUCT_DESC);
4352
 
4353
      if (this.isSetSuccess()) {
4354
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4355
        this.success.write(oprot);
4356
        oprot.writeFieldEnd();
4357
      } else if (this.isSetPex()) {
4358
        oprot.writeFieldBegin(PEX_FIELD_DESC);
4359
        this.pex.write(oprot);
4360
        oprot.writeFieldEnd();
4361
      }
4362
      oprot.writeFieldStop();
4363
      oprot.writeStructEnd();
4364
    }
4365
 
4366
    @Override
4367
    public String toString() {
4368
      StringBuilder sb = new StringBuilder("getCoupon_result(");
4369
      boolean first = true;
4370
 
4371
      sb.append("success:");
4372
      if (this.success == null) {
4373
        sb.append("null");
4374
      } else {
4375
        sb.append(this.success);
4376
      }
4377
      first = false;
4378
      if (!first) sb.append(", ");
4379
      sb.append("pex:");
4380
      if (this.pex == null) {
4381
        sb.append("null");
4382
      } else {
4383
        sb.append(this.pex);
4384
      }
4385
      first = false;
4386
      sb.append(")");
4387
      return sb.toString();
4388
    }
4389
 
4390
    public void validate() throws org.apache.thrift.TException {
4391
      // check for required fields
4392
    }
4393
 
4394
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4395
      try {
4396
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4397
      } catch (org.apache.thrift.TException te) {
4398
        throw new java.io.IOException(te);
4399
      }
4400
    }
4401
 
4402
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4403
      try {
4404
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4405
      } catch (org.apache.thrift.TException te) {
4406
        throw new java.io.IOException(te);
4407
      }
4408
    }
4409
 
4410
  }
4411
 
4412
  public static class isGiftVoucher_args implements org.apache.thrift.TBase<isGiftVoucher_args, isGiftVoucher_args._Fields>, java.io.Serializable, Cloneable   {
4413
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isGiftVoucher_args");
4414
 
4415
    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);
4416
 
4417
    private String couponCode; // required
4418
 
4419
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4420
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4421
      COUPON_CODE((short)1, "couponCode");
4422
 
4423
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4424
 
4425
      static {
4426
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4427
          byName.put(field.getFieldName(), field);
4428
        }
4429
      }
4430
 
4431
      /**
4432
       * Find the _Fields constant that matches fieldId, or null if its not found.
4433
       */
4434
      public static _Fields findByThriftId(int fieldId) {
4435
        switch(fieldId) {
4436
          case 1: // COUPON_CODE
4437
            return COUPON_CODE;
4438
          default:
4439
            return null;
4440
        }
4441
      }
4442
 
4443
      /**
4444
       * Find the _Fields constant that matches fieldId, throwing an exception
4445
       * if it is not found.
4446
       */
4447
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4448
        _Fields fields = findByThriftId(fieldId);
4449
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4450
        return fields;
4451
      }
4452
 
4453
      /**
4454
       * Find the _Fields constant that matches name, or null if its not found.
4455
       */
4456
      public static _Fields findByName(String name) {
4457
        return byName.get(name);
4458
      }
4459
 
4460
      private final short _thriftId;
4461
      private final String _fieldName;
4462
 
4463
      _Fields(short thriftId, String fieldName) {
4464
        _thriftId = thriftId;
4465
        _fieldName = fieldName;
4466
      }
4467
 
4468
      public short getThriftFieldId() {
4469
        return _thriftId;
4470
      }
4471
 
4472
      public String getFieldName() {
4473
        return _fieldName;
4474
      }
4475
    }
4476
 
4477
    // isset id assignments
4478
 
4479
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4480
    static {
4481
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4482
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4483
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
4484
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4485
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isGiftVoucher_args.class, metaDataMap);
4486
    }
4487
 
4488
    public isGiftVoucher_args() {
4489
    }
4490
 
4491
    public isGiftVoucher_args(
4492
      String couponCode)
4493
    {
4494
      this();
4495
      this.couponCode = couponCode;
4496
    }
4497
 
4498
    /**
4499
     * Performs a deep copy on <i>other</i>.
4500
     */
4501
    public isGiftVoucher_args(isGiftVoucher_args other) {
4502
      if (other.isSetCouponCode()) {
4503
        this.couponCode = other.couponCode;
4504
      }
4505
    }
4506
 
4507
    public isGiftVoucher_args deepCopy() {
4508
      return new isGiftVoucher_args(this);
4509
    }
4510
 
4511
    @Override
4512
    public void clear() {
4513
      this.couponCode = null;
4514
    }
4515
 
4516
    public String getCouponCode() {
4517
      return this.couponCode;
4518
    }
4519
 
4520
    public void setCouponCode(String couponCode) {
4521
      this.couponCode = couponCode;
4522
    }
4523
 
4524
    public void unsetCouponCode() {
4525
      this.couponCode = null;
4526
    }
4527
 
4528
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
4529
    public boolean isSetCouponCode() {
4530
      return this.couponCode != null;
4531
    }
4532
 
4533
    public void setCouponCodeIsSet(boolean value) {
4534
      if (!value) {
4535
        this.couponCode = null;
4536
      }
4537
    }
4538
 
4539
    public void setFieldValue(_Fields field, Object value) {
4540
      switch (field) {
4541
      case COUPON_CODE:
4542
        if (value == null) {
4543
          unsetCouponCode();
4544
        } else {
4545
          setCouponCode((String)value);
4546
        }
4547
        break;
4548
 
4549
      }
4550
    }
4551
 
4552
    public Object getFieldValue(_Fields field) {
4553
      switch (field) {
4554
      case COUPON_CODE:
4555
        return getCouponCode();
4556
 
4557
      }
4558
      throw new IllegalStateException();
4559
    }
4560
 
4561
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4562
    public boolean isSet(_Fields field) {
4563
      if (field == null) {
4564
        throw new IllegalArgumentException();
4565
      }
4566
 
4567
      switch (field) {
4568
      case COUPON_CODE:
4569
        return isSetCouponCode();
4570
      }
4571
      throw new IllegalStateException();
4572
    }
4573
 
4574
    @Override
4575
    public boolean equals(Object that) {
4576
      if (that == null)
4577
        return false;
4578
      if (that instanceof isGiftVoucher_args)
4579
        return this.equals((isGiftVoucher_args)that);
4580
      return false;
4581
    }
4582
 
4583
    public boolean equals(isGiftVoucher_args that) {
4584
      if (that == null)
4585
        return false;
4586
 
4587
      boolean this_present_couponCode = true && this.isSetCouponCode();
4588
      boolean that_present_couponCode = true && that.isSetCouponCode();
4589
      if (this_present_couponCode || that_present_couponCode) {
4590
        if (!(this_present_couponCode && that_present_couponCode))
4591
          return false;
4592
        if (!this.couponCode.equals(that.couponCode))
4593
          return false;
4594
      }
4595
 
4596
      return true;
4597
    }
4598
 
4599
    @Override
4600
    public int hashCode() {
4601
      return 0;
4602
    }
4603
 
4604
    public int compareTo(isGiftVoucher_args other) {
4605
      if (!getClass().equals(other.getClass())) {
4606
        return getClass().getName().compareTo(other.getClass().getName());
4607
      }
4608
 
4609
      int lastComparison = 0;
4610
      isGiftVoucher_args typedOther = (isGiftVoucher_args)other;
4611
 
4612
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
4613
      if (lastComparison != 0) {
4614
        return lastComparison;
4615
      }
4616
      if (isSetCouponCode()) {
4617
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
4618
        if (lastComparison != 0) {
4619
          return lastComparison;
4620
        }
4621
      }
4622
      return 0;
4623
    }
4624
 
4625
    public _Fields fieldForId(int fieldId) {
4626
      return _Fields.findByThriftId(fieldId);
4627
    }
4628
 
4629
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4630
      org.apache.thrift.protocol.TField field;
4631
      iprot.readStructBegin();
4632
      while (true)
4633
      {
4634
        field = iprot.readFieldBegin();
4635
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4636
          break;
4637
        }
4638
        switch (field.id) {
4639
          case 1: // COUPON_CODE
4640
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
4641
              this.couponCode = iprot.readString();
4642
            } else { 
4643
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4644
            }
4645
            break;
4646
          default:
4647
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4648
        }
4649
        iprot.readFieldEnd();
4650
      }
4651
      iprot.readStructEnd();
4652
      validate();
4653
    }
4654
 
4655
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4656
      validate();
4657
 
4658
      oprot.writeStructBegin(STRUCT_DESC);
4659
      if (this.couponCode != null) {
4660
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
4661
        oprot.writeString(this.couponCode);
4662
        oprot.writeFieldEnd();
4663
      }
4664
      oprot.writeFieldStop();
4665
      oprot.writeStructEnd();
4666
    }
4667
 
4668
    @Override
4669
    public String toString() {
4670
      StringBuilder sb = new StringBuilder("isGiftVoucher_args(");
4671
      boolean first = true;
4672
 
4673
      sb.append("couponCode:");
4674
      if (this.couponCode == null) {
4675
        sb.append("null");
4676
      } else {
4677
        sb.append(this.couponCode);
4678
      }
4679
      first = false;
4680
      sb.append(")");
4681
      return sb.toString();
4682
    }
4683
 
4684
    public void validate() throws org.apache.thrift.TException {
4685
      // check for required fields
4686
    }
4687
 
4688
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4689
      try {
4690
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4691
      } catch (org.apache.thrift.TException te) {
4692
        throw new java.io.IOException(te);
4693
      }
4694
    }
4695
 
4696
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4697
      try {
4698
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4699
      } catch (org.apache.thrift.TException te) {
4700
        throw new java.io.IOException(te);
4701
      }
4702
    }
4703
 
4704
  }
4705
 
4706
  public static class isGiftVoucher_result implements org.apache.thrift.TBase<isGiftVoucher_result, isGiftVoucher_result._Fields>, java.io.Serializable, Cloneable   {
4707
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isGiftVoucher_result");
4708
 
4709
    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);
4710
    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);
4711
 
4712
    private boolean success; // required
4713
    private PromotionException pex; // required
4714
 
4715
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4716
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4717
      SUCCESS((short)0, "success"),
4718
      PEX((short)1, "pex");
4719
 
4720
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4721
 
4722
      static {
4723
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4724
          byName.put(field.getFieldName(), field);
4725
        }
4726
      }
4727
 
4728
      /**
4729
       * Find the _Fields constant that matches fieldId, or null if its not found.
4730
       */
4731
      public static _Fields findByThriftId(int fieldId) {
4732
        switch(fieldId) {
4733
          case 0: // SUCCESS
4734
            return SUCCESS;
4735
          case 1: // PEX
4736
            return PEX;
4737
          default:
4738
            return null;
4739
        }
4740
      }
4741
 
4742
      /**
4743
       * Find the _Fields constant that matches fieldId, throwing an exception
4744
       * if it is not found.
4745
       */
4746
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4747
        _Fields fields = findByThriftId(fieldId);
4748
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4749
        return fields;
4750
      }
4751
 
4752
      /**
4753
       * Find the _Fields constant that matches name, or null if its not found.
4754
       */
4755
      public static _Fields findByName(String name) {
4756
        return byName.get(name);
4757
      }
4758
 
4759
      private final short _thriftId;
4760
      private final String _fieldName;
4761
 
4762
      _Fields(short thriftId, String fieldName) {
4763
        _thriftId = thriftId;
4764
        _fieldName = fieldName;
4765
      }
4766
 
4767
      public short getThriftFieldId() {
4768
        return _thriftId;
4769
      }
4770
 
4771
      public String getFieldName() {
4772
        return _fieldName;
4773
      }
4774
    }
4775
 
4776
    // isset id assignments
4777
    private static final int __SUCCESS_ISSET_ID = 0;
4778
    private BitSet __isset_bit_vector = new BitSet(1);
4779
 
4780
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4781
    static {
4782
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4783
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4784
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
4785
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4786
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4787
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4788
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isGiftVoucher_result.class, metaDataMap);
4789
    }
4790
 
4791
    public isGiftVoucher_result() {
4792
    }
4793
 
4794
    public isGiftVoucher_result(
4795
      boolean success,
4796
      PromotionException pex)
4797
    {
4798
      this();
4799
      this.success = success;
4800
      setSuccessIsSet(true);
4801
      this.pex = pex;
4802
    }
4803
 
4804
    /**
4805
     * Performs a deep copy on <i>other</i>.
4806
     */
4807
    public isGiftVoucher_result(isGiftVoucher_result other) {
4808
      __isset_bit_vector.clear();
4809
      __isset_bit_vector.or(other.__isset_bit_vector);
4810
      this.success = other.success;
4811
      if (other.isSetPex()) {
4812
        this.pex = new PromotionException(other.pex);
4813
      }
4814
    }
4815
 
4816
    public isGiftVoucher_result deepCopy() {
4817
      return new isGiftVoucher_result(this);
4818
    }
4819
 
4820
    @Override
4821
    public void clear() {
4822
      setSuccessIsSet(false);
4823
      this.success = false;
4824
      this.pex = null;
4825
    }
4826
 
4827
    public boolean isSuccess() {
4828
      return this.success;
4829
    }
4830
 
4831
    public void setSuccess(boolean success) {
4832
      this.success = success;
4833
      setSuccessIsSet(true);
4834
    }
4835
 
4836
    public void unsetSuccess() {
4837
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
4838
    }
4839
 
4840
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
4841
    public boolean isSetSuccess() {
4842
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
4843
    }
4844
 
4845
    public void setSuccessIsSet(boolean value) {
4846
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
4847
    }
4848
 
4849
    public PromotionException getPex() {
4850
      return this.pex;
4851
    }
4852
 
4853
    public void setPex(PromotionException pex) {
4854
      this.pex = pex;
4855
    }
4856
 
4857
    public void unsetPex() {
4858
      this.pex = null;
4859
    }
4860
 
4861
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
4862
    public boolean isSetPex() {
4863
      return this.pex != null;
4864
    }
4865
 
4866
    public void setPexIsSet(boolean value) {
4867
      if (!value) {
4868
        this.pex = null;
4869
      }
4870
    }
4871
 
4872
    public void setFieldValue(_Fields field, Object value) {
4873
      switch (field) {
4874
      case SUCCESS:
4875
        if (value == null) {
4876
          unsetSuccess();
4877
        } else {
4878
          setSuccess((Boolean)value);
4879
        }
4880
        break;
4881
 
4882
      case PEX:
4883
        if (value == null) {
4884
          unsetPex();
4885
        } else {
4886
          setPex((PromotionException)value);
4887
        }
4888
        break;
4889
 
4890
      }
4891
    }
4892
 
4893
    public Object getFieldValue(_Fields field) {
4894
      switch (field) {
4895
      case SUCCESS:
4896
        return Boolean.valueOf(isSuccess());
4897
 
4898
      case PEX:
4899
        return getPex();
4900
 
4901
      }
4902
      throw new IllegalStateException();
4903
    }
4904
 
4905
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4906
    public boolean isSet(_Fields field) {
4907
      if (field == null) {
4908
        throw new IllegalArgumentException();
4909
      }
4910
 
4911
      switch (field) {
4912
      case SUCCESS:
4913
        return isSetSuccess();
4914
      case PEX:
4915
        return isSetPex();
4916
      }
4917
      throw new IllegalStateException();
4918
    }
4919
 
4920
    @Override
4921
    public boolean equals(Object that) {
4922
      if (that == null)
4923
        return false;
4924
      if (that instanceof isGiftVoucher_result)
4925
        return this.equals((isGiftVoucher_result)that);
4926
      return false;
4927
    }
4928
 
4929
    public boolean equals(isGiftVoucher_result that) {
4930
      if (that == null)
4931
        return false;
4932
 
4933
      boolean this_present_success = true;
4934
      boolean that_present_success = true;
4935
      if (this_present_success || that_present_success) {
4936
        if (!(this_present_success && that_present_success))
4937
          return false;
4938
        if (this.success != that.success)
4939
          return false;
4940
      }
4941
 
4942
      boolean this_present_pex = true && this.isSetPex();
4943
      boolean that_present_pex = true && that.isSetPex();
4944
      if (this_present_pex || that_present_pex) {
4945
        if (!(this_present_pex && that_present_pex))
4946
          return false;
4947
        if (!this.pex.equals(that.pex))
4948
          return false;
4949
      }
4950
 
4951
      return true;
4952
    }
4953
 
4954
    @Override
4955
    public int hashCode() {
4956
      return 0;
4957
    }
4958
 
4959
    public int compareTo(isGiftVoucher_result other) {
4960
      if (!getClass().equals(other.getClass())) {
4961
        return getClass().getName().compareTo(other.getClass().getName());
4962
      }
4963
 
4964
      int lastComparison = 0;
4965
      isGiftVoucher_result typedOther = (isGiftVoucher_result)other;
4966
 
4967
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
4968
      if (lastComparison != 0) {
4969
        return lastComparison;
4970
      }
4971
      if (isSetSuccess()) {
4972
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4973
        if (lastComparison != 0) {
4974
          return lastComparison;
4975
        }
4976
      }
4977
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
4978
      if (lastComparison != 0) {
4979
        return lastComparison;
4980
      }
4981
      if (isSetPex()) {
4982
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
4983
        if (lastComparison != 0) {
4984
          return lastComparison;
4985
        }
4986
      }
4987
      return 0;
4988
    }
4989
 
4990
    public _Fields fieldForId(int fieldId) {
4991
      return _Fields.findByThriftId(fieldId);
4992
    }
4993
 
4994
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4995
      org.apache.thrift.protocol.TField field;
4996
      iprot.readStructBegin();
4997
      while (true)
4998
      {
4999
        field = iprot.readFieldBegin();
5000
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
5001
          break;
5002
        }
5003
        switch (field.id) {
5004
          case 0: // SUCCESS
5005
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
5006
              this.success = iprot.readBool();
5007
              setSuccessIsSet(true);
5008
            } else { 
5009
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5010
            }
5011
            break;
5012
          case 1: // PEX
5013
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5014
              this.pex = new PromotionException();
5015
              this.pex.read(iprot);
5016
            } else { 
5017
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5018
            }
5019
            break;
5020
          default:
5021
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5022
        }
5023
        iprot.readFieldEnd();
5024
      }
5025
      iprot.readStructEnd();
5026
      validate();
5027
    }
5028
 
5029
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
5030
      oprot.writeStructBegin(STRUCT_DESC);
5031
 
5032
      if (this.isSetSuccess()) {
5033
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
5034
        oprot.writeBool(this.success);
5035
        oprot.writeFieldEnd();
5036
      } else if (this.isSetPex()) {
5037
        oprot.writeFieldBegin(PEX_FIELD_DESC);
5038
        this.pex.write(oprot);
5039
        oprot.writeFieldEnd();
5040
      }
5041
      oprot.writeFieldStop();
5042
      oprot.writeStructEnd();
5043
    }
5044
 
5045
    @Override
5046
    public String toString() {
5047
      StringBuilder sb = new StringBuilder("isGiftVoucher_result(");
5048
      boolean first = true;
5049
 
5050
      sb.append("success:");
5051
      sb.append(this.success);
5052
      first = false;
5053
      if (!first) sb.append(", ");
5054
      sb.append("pex:");
5055
      if (this.pex == null) {
5056
        sb.append("null");
5057
      } else {
5058
        sb.append(this.pex);
5059
      }
5060
      first = false;
5061
      sb.append(")");
5062
      return sb.toString();
5063
    }
5064
 
5065
    public void validate() throws org.apache.thrift.TException {
5066
      // check for required fields
5067
    }
5068
 
5069
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5070
      try {
5071
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5072
      } catch (org.apache.thrift.TException te) {
5073
        throw new java.io.IOException(te);
5074
      }
5075
    }
5076
 
5077
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5078
      try {
5079
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5080
      } catch (org.apache.thrift.TException te) {
5081
        throw new java.io.IOException(te);
5082
      }
5083
    }
5084
 
5085
  }
5086
 
6356 amit.gupta 5087
  public static class isCodApplicable_args implements org.apache.thrift.TBase<isCodApplicable_args, isCodApplicable_args._Fields>, java.io.Serializable, Cloneable   {
5088
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isCodApplicable_args");
5089
 
11819 amit.gupta 5090
    private static final org.apache.thrift.protocol.TField CART_FIELD_DESC = new org.apache.thrift.protocol.TField("cart", org.apache.thrift.protocol.TType.STRUCT, (short)1);
6356 amit.gupta 5091
 
11819 amit.gupta 5092
    private Cart cart; // required
6356 amit.gupta 5093
 
5094
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
5095
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11819 amit.gupta 5096
      CART((short)1, "cart");
6356 amit.gupta 5097
 
5098
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5099
 
5100
      static {
5101
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5102
          byName.put(field.getFieldName(), field);
5103
        }
5104
      }
5105
 
5106
      /**
5107
       * Find the _Fields constant that matches fieldId, or null if its not found.
5108
       */
5109
      public static _Fields findByThriftId(int fieldId) {
5110
        switch(fieldId) {
11819 amit.gupta 5111
          case 1: // CART
5112
            return CART;
6356 amit.gupta 5113
          default:
5114
            return null;
5115
        }
5116
      }
5117
 
5118
      /**
5119
       * Find the _Fields constant that matches fieldId, throwing an exception
5120
       * if it is not found.
5121
       */
5122
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5123
        _Fields fields = findByThriftId(fieldId);
5124
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5125
        return fields;
5126
      }
5127
 
5128
      /**
5129
       * Find the _Fields constant that matches name, or null if its not found.
5130
       */
5131
      public static _Fields findByName(String name) {
5132
        return byName.get(name);
5133
      }
5134
 
5135
      private final short _thriftId;
5136
      private final String _fieldName;
5137
 
5138
      _Fields(short thriftId, String fieldName) {
5139
        _thriftId = thriftId;
5140
        _fieldName = fieldName;
5141
      }
5142
 
5143
      public short getThriftFieldId() {
5144
        return _thriftId;
5145
      }
5146
 
5147
      public String getFieldName() {
5148
        return _fieldName;
5149
      }
5150
    }
5151
 
5152
    // isset id assignments
5153
 
5154
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
5155
    static {
5156
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11819 amit.gupta 5157
      tmpMap.put(_Fields.CART, new org.apache.thrift.meta_data.FieldMetaData("cart", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5158
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Cart.class)));
6356 amit.gupta 5159
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5160
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isCodApplicable_args.class, metaDataMap);
5161
    }
5162
 
5163
    public isCodApplicable_args() {
5164
    }
5165
 
5166
    public isCodApplicable_args(
11819 amit.gupta 5167
      Cart cart)
6356 amit.gupta 5168
    {
5169
      this();
11819 amit.gupta 5170
      this.cart = cart;
6356 amit.gupta 5171
    }
5172
 
5173
    /**
5174
     * Performs a deep copy on <i>other</i>.
5175
     */
5176
    public isCodApplicable_args(isCodApplicable_args other) {
11819 amit.gupta 5177
      if (other.isSetCart()) {
5178
        this.cart = new Cart(other.cart);
6356 amit.gupta 5179
      }
5180
    }
5181
 
5182
    public isCodApplicable_args deepCopy() {
5183
      return new isCodApplicable_args(this);
5184
    }
5185
 
5186
    @Override
5187
    public void clear() {
11819 amit.gupta 5188
      this.cart = null;
6356 amit.gupta 5189
    }
5190
 
11819 amit.gupta 5191
    public Cart getCart() {
5192
      return this.cart;
6356 amit.gupta 5193
    }
5194
 
11819 amit.gupta 5195
    public void setCart(Cart cart) {
5196
      this.cart = cart;
6356 amit.gupta 5197
    }
5198
 
11819 amit.gupta 5199
    public void unsetCart() {
5200
      this.cart = null;
6356 amit.gupta 5201
    }
5202
 
11819 amit.gupta 5203
    /** Returns true if field cart is set (has been assigned a value) and false otherwise */
5204
    public boolean isSetCart() {
5205
      return this.cart != null;
6356 amit.gupta 5206
    }
5207
 
11819 amit.gupta 5208
    public void setCartIsSet(boolean value) {
6356 amit.gupta 5209
      if (!value) {
11819 amit.gupta 5210
        this.cart = null;
6356 amit.gupta 5211
      }
5212
    }
5213
 
5214
    public void setFieldValue(_Fields field, Object value) {
5215
      switch (field) {
11819 amit.gupta 5216
      case CART:
6356 amit.gupta 5217
        if (value == null) {
11819 amit.gupta 5218
          unsetCart();
6356 amit.gupta 5219
        } else {
11819 amit.gupta 5220
          setCart((Cart)value);
6356 amit.gupta 5221
        }
5222
        break;
5223
 
5224
      }
5225
    }
5226
 
5227
    public Object getFieldValue(_Fields field) {
5228
      switch (field) {
11819 amit.gupta 5229
      case CART:
5230
        return getCart();
6356 amit.gupta 5231
 
5232
      }
5233
      throw new IllegalStateException();
5234
    }
5235
 
5236
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5237
    public boolean isSet(_Fields field) {
5238
      if (field == null) {
5239
        throw new IllegalArgumentException();
5240
      }
5241
 
5242
      switch (field) {
11819 amit.gupta 5243
      case CART:
5244
        return isSetCart();
6356 amit.gupta 5245
      }
5246
      throw new IllegalStateException();
5247
    }
5248
 
5249
    @Override
5250
    public boolean equals(Object that) {
5251
      if (that == null)
5252
        return false;
5253
      if (that instanceof isCodApplicable_args)
5254
        return this.equals((isCodApplicable_args)that);
5255
      return false;
5256
    }
5257
 
5258
    public boolean equals(isCodApplicable_args that) {
5259
      if (that == null)
5260
        return false;
5261
 
11819 amit.gupta 5262
      boolean this_present_cart = true && this.isSetCart();
5263
      boolean that_present_cart = true && that.isSetCart();
5264
      if (this_present_cart || that_present_cart) {
5265
        if (!(this_present_cart && that_present_cart))
6356 amit.gupta 5266
          return false;
11819 amit.gupta 5267
        if (!this.cart.equals(that.cart))
6356 amit.gupta 5268
          return false;
5269
      }
5270
 
5271
      return true;
5272
    }
5273
 
5274
    @Override
5275
    public int hashCode() {
5276
      return 0;
5277
    }
5278
 
5279
    public int compareTo(isCodApplicable_args other) {
5280
      if (!getClass().equals(other.getClass())) {
5281
        return getClass().getName().compareTo(other.getClass().getName());
5282
      }
5283
 
5284
      int lastComparison = 0;
5285
      isCodApplicable_args typedOther = (isCodApplicable_args)other;
5286
 
11819 amit.gupta 5287
      lastComparison = Boolean.valueOf(isSetCart()).compareTo(typedOther.isSetCart());
6356 amit.gupta 5288
      if (lastComparison != 0) {
5289
        return lastComparison;
5290
      }
11819 amit.gupta 5291
      if (isSetCart()) {
5292
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cart, typedOther.cart);
6356 amit.gupta 5293
        if (lastComparison != 0) {
5294
          return lastComparison;
5295
        }
5296
      }
5297
      return 0;
5298
    }
5299
 
5300
    public _Fields fieldForId(int fieldId) {
5301
      return _Fields.findByThriftId(fieldId);
5302
    }
5303
 
5304
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5305
      org.apache.thrift.protocol.TField field;
5306
      iprot.readStructBegin();
5307
      while (true)
5308
      {
5309
        field = iprot.readFieldBegin();
5310
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
5311
          break;
5312
        }
5313
        switch (field.id) {
11819 amit.gupta 5314
          case 1: // CART
5315
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5316
              this.cart = new Cart();
5317
              this.cart.read(iprot);
6356 amit.gupta 5318
            } else { 
5319
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5320
            }
5321
            break;
5322
          default:
5323
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5324
        }
5325
        iprot.readFieldEnd();
5326
      }
5327
      iprot.readStructEnd();
5328
      validate();
5329
    }
5330
 
5331
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
5332
      validate();
5333
 
5334
      oprot.writeStructBegin(STRUCT_DESC);
11819 amit.gupta 5335
      if (this.cart != null) {
5336
        oprot.writeFieldBegin(CART_FIELD_DESC);
5337
        this.cart.write(oprot);
6356 amit.gupta 5338
        oprot.writeFieldEnd();
5339
      }
5340
      oprot.writeFieldStop();
5341
      oprot.writeStructEnd();
5342
    }
5343
 
5344
    @Override
5345
    public String toString() {
5346
      StringBuilder sb = new StringBuilder("isCodApplicable_args(");
5347
      boolean first = true;
5348
 
11819 amit.gupta 5349
      sb.append("cart:");
5350
      if (this.cart == null) {
6356 amit.gupta 5351
        sb.append("null");
5352
      } else {
11819 amit.gupta 5353
        sb.append(this.cart);
6356 amit.gupta 5354
      }
5355
      first = false;
5356
      sb.append(")");
5357
      return sb.toString();
5358
    }
5359
 
5360
    public void validate() throws org.apache.thrift.TException {
5361
      // check for required fields
5362
    }
5363
 
5364
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5365
      try {
5366
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5367
      } catch (org.apache.thrift.TException te) {
5368
        throw new java.io.IOException(te);
5369
      }
5370
    }
5371
 
5372
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5373
      try {
5374
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5375
      } catch (org.apache.thrift.TException te) {
5376
        throw new java.io.IOException(te);
5377
      }
5378
    }
5379
 
5380
  }
5381
 
5382
  public static class isCodApplicable_result implements org.apache.thrift.TBase<isCodApplicable_result, isCodApplicable_result._Fields>, java.io.Serializable, Cloneable   {
5383
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isCodApplicable_result");
5384
 
5385
    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);
5386
    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);
5387
 
5388
    private boolean success; // required
5389
    private PromotionException pex; // required
5390
 
5391
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
5392
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
5393
      SUCCESS((short)0, "success"),
5394
      PEX((short)1, "pex");
5395
 
5396
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5397
 
5398
      static {
5399
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5400
          byName.put(field.getFieldName(), field);
5401
        }
5402
      }
5403
 
5404
      /**
5405
       * Find the _Fields constant that matches fieldId, or null if its not found.
5406
       */
5407
      public static _Fields findByThriftId(int fieldId) {
5408
        switch(fieldId) {
5409
          case 0: // SUCCESS
5410
            return SUCCESS;
5411
          case 1: // PEX
5412
            return PEX;
5413
          default:
5414
            return null;
5415
        }
5416
      }
5417
 
5418
      /**
5419
       * Find the _Fields constant that matches fieldId, throwing an exception
5420
       * if it is not found.
5421
       */
5422
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5423
        _Fields fields = findByThriftId(fieldId);
5424
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5425
        return fields;
5426
      }
5427
 
5428
      /**
5429
       * Find the _Fields constant that matches name, or null if its not found.
5430
       */
5431
      public static _Fields findByName(String name) {
5432
        return byName.get(name);
5433
      }
5434
 
5435
      private final short _thriftId;
5436
      private final String _fieldName;
5437
 
5438
      _Fields(short thriftId, String fieldName) {
5439
        _thriftId = thriftId;
5440
        _fieldName = fieldName;
5441
      }
5442
 
5443
      public short getThriftFieldId() {
5444
        return _thriftId;
5445
      }
5446
 
5447
      public String getFieldName() {
5448
        return _fieldName;
5449
      }
5450
    }
5451
 
5452
    // isset id assignments
5453
    private static final int __SUCCESS_ISSET_ID = 0;
5454
    private BitSet __isset_bit_vector = new BitSet(1);
5455
 
5456
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
5457
    static {
5458
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5459
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5460
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
5461
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5462
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
5463
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5464
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isCodApplicable_result.class, metaDataMap);
5465
    }
5466
 
5467
    public isCodApplicable_result() {
5468
    }
5469
 
5470
    public isCodApplicable_result(
5471
      boolean success,
5472
      PromotionException pex)
5473
    {
5474
      this();
5475
      this.success = success;
5476
      setSuccessIsSet(true);
5477
      this.pex = pex;
5478
    }
5479
 
5480
    /**
5481
     * Performs a deep copy on <i>other</i>.
5482
     */
5483
    public isCodApplicable_result(isCodApplicable_result other) {
5484
      __isset_bit_vector.clear();
5485
      __isset_bit_vector.or(other.__isset_bit_vector);
5486
      this.success = other.success;
5487
      if (other.isSetPex()) {
5488
        this.pex = new PromotionException(other.pex);
5489
      }
5490
    }
5491
 
5492
    public isCodApplicable_result deepCopy() {
5493
      return new isCodApplicable_result(this);
5494
    }
5495
 
5496
    @Override
5497
    public void clear() {
5498
      setSuccessIsSet(false);
5499
      this.success = false;
5500
      this.pex = null;
5501
    }
5502
 
5503
    public boolean isSuccess() {
5504
      return this.success;
5505
    }
5506
 
5507
    public void setSuccess(boolean success) {
5508
      this.success = success;
5509
      setSuccessIsSet(true);
5510
    }
5511
 
5512
    public void unsetSuccess() {
5513
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
5514
    }
5515
 
5516
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
5517
    public boolean isSetSuccess() {
5518
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
5519
    }
5520
 
5521
    public void setSuccessIsSet(boolean value) {
5522
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
5523
    }
5524
 
5525
    public PromotionException getPex() {
5526
      return this.pex;
5527
    }
5528
 
5529
    public void setPex(PromotionException pex) {
5530
      this.pex = pex;
5531
    }
5532
 
5533
    public void unsetPex() {
5534
      this.pex = null;
5535
    }
5536
 
5537
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
5538
    public boolean isSetPex() {
5539
      return this.pex != null;
5540
    }
5541
 
5542
    public void setPexIsSet(boolean value) {
5543
      if (!value) {
5544
        this.pex = null;
5545
      }
5546
    }
5547
 
5548
    public void setFieldValue(_Fields field, Object value) {
5549
      switch (field) {
5550
      case SUCCESS:
5551
        if (value == null) {
5552
          unsetSuccess();
5553
        } else {
5554
          setSuccess((Boolean)value);
5555
        }
5556
        break;
5557
 
5558
      case PEX:
5559
        if (value == null) {
5560
          unsetPex();
5561
        } else {
5562
          setPex((PromotionException)value);
5563
        }
5564
        break;
5565
 
5566
      }
5567
    }
5568
 
5569
    public Object getFieldValue(_Fields field) {
5570
      switch (field) {
5571
      case SUCCESS:
5572
        return Boolean.valueOf(isSuccess());
5573
 
5574
      case PEX:
5575
        return getPex();
5576
 
5577
      }
5578
      throw new IllegalStateException();
5579
    }
5580
 
5581
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5582
    public boolean isSet(_Fields field) {
5583
      if (field == null) {
5584
        throw new IllegalArgumentException();
5585
      }
5586
 
5587
      switch (field) {
5588
      case SUCCESS:
5589
        return isSetSuccess();
5590
      case PEX:
5591
        return isSetPex();
5592
      }
5593
      throw new IllegalStateException();
5594
    }
5595
 
5596
    @Override
5597
    public boolean equals(Object that) {
5598
      if (that == null)
5599
        return false;
5600
      if (that instanceof isCodApplicable_result)
5601
        return this.equals((isCodApplicable_result)that);
5602
      return false;
5603
    }
5604
 
5605
    public boolean equals(isCodApplicable_result that) {
5606
      if (that == null)
5607
        return false;
5608
 
5609
      boolean this_present_success = true;
5610
      boolean that_present_success = true;
5611
      if (this_present_success || that_present_success) {
5612
        if (!(this_present_success && that_present_success))
5613
          return false;
5614
        if (this.success != that.success)
5615
          return false;
5616
      }
5617
 
5618
      boolean this_present_pex = true && this.isSetPex();
5619
      boolean that_present_pex = true && that.isSetPex();
5620
      if (this_present_pex || that_present_pex) {
5621
        if (!(this_present_pex && that_present_pex))
5622
          return false;
5623
        if (!this.pex.equals(that.pex))
5624
          return false;
5625
      }
5626
 
5627
      return true;
5628
    }
5629
 
5630
    @Override
5631
    public int hashCode() {
5632
      return 0;
5633
    }
5634
 
5635
    public int compareTo(isCodApplicable_result other) {
5636
      if (!getClass().equals(other.getClass())) {
5637
        return getClass().getName().compareTo(other.getClass().getName());
5638
      }
5639
 
5640
      int lastComparison = 0;
5641
      isCodApplicable_result typedOther = (isCodApplicable_result)other;
5642
 
5643
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
5644
      if (lastComparison != 0) {
5645
        return lastComparison;
5646
      }
5647
      if (isSetSuccess()) {
5648
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
5649
        if (lastComparison != 0) {
5650
          return lastComparison;
5651
        }
5652
      }
5653
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
5654
      if (lastComparison != 0) {
5655
        return lastComparison;
5656
      }
5657
      if (isSetPex()) {
5658
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
5659
        if (lastComparison != 0) {
5660
          return lastComparison;
5661
        }
5662
      }
5663
      return 0;
5664
    }
5665
 
5666
    public _Fields fieldForId(int fieldId) {
5667
      return _Fields.findByThriftId(fieldId);
5668
    }
5669
 
5670
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5671
      org.apache.thrift.protocol.TField field;
5672
      iprot.readStructBegin();
5673
      while (true)
5674
      {
5675
        field = iprot.readFieldBegin();
5676
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
5677
          break;
5678
        }
5679
        switch (field.id) {
5680
          case 0: // SUCCESS
5681
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
5682
              this.success = iprot.readBool();
5683
              setSuccessIsSet(true);
5684
            } else { 
5685
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5686
            }
5687
            break;
5688
          case 1: // PEX
5689
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5690
              this.pex = new PromotionException();
5691
              this.pex.read(iprot);
5692
            } else { 
5693
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5694
            }
5695
            break;
5696
          default:
5697
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5698
        }
5699
        iprot.readFieldEnd();
5700
      }
5701
      iprot.readStructEnd();
5702
      validate();
5703
    }
5704
 
5705
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
5706
      oprot.writeStructBegin(STRUCT_DESC);
5707
 
5708
      if (this.isSetSuccess()) {
5709
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
5710
        oprot.writeBool(this.success);
5711
        oprot.writeFieldEnd();
5712
      } else if (this.isSetPex()) {
5713
        oprot.writeFieldBegin(PEX_FIELD_DESC);
5714
        this.pex.write(oprot);
5715
        oprot.writeFieldEnd();
5716
      }
5717
      oprot.writeFieldStop();
5718
      oprot.writeStructEnd();
5719
    }
5720
 
5721
    @Override
5722
    public String toString() {
5723
      StringBuilder sb = new StringBuilder("isCodApplicable_result(");
5724
      boolean first = true;
5725
 
5726
      sb.append("success:");
5727
      sb.append(this.success);
5728
      first = false;
5729
      if (!first) sb.append(", ");
5730
      sb.append("pex:");
5731
      if (this.pex == null) {
5732
        sb.append("null");
5733
      } else {
5734
        sb.append(this.pex);
5735
      }
5736
      first = false;
5737
      sb.append(")");
5738
      return sb.toString();
5739
    }
5740
 
5741
    public void validate() throws org.apache.thrift.TException {
5742
      // check for required fields
5743
    }
5744
 
5745
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5746
      try {
5747
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5748
      } catch (org.apache.thrift.TException te) {
5749
        throw new java.io.IOException(te);
5750
      }
5751
    }
5752
 
5753
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5754
      try {
5755
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5756
      } catch (org.apache.thrift.TException te) {
5757
        throw new java.io.IOException(te);
5758
      }
5759
    }
5760
 
5761
  }
5762
 
3430 rajveer 5763
  public static class getAllPromotions_args implements org.apache.thrift.TBase<getAllPromotions_args, getAllPromotions_args._Fields>, java.io.Serializable, Cloneable   {
5764
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_args");
1982 varun.gupt 5765
 
5766
 
5767
 
5768
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5769
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5770
;
5771
 
5772
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5773
 
5774
      static {
5775
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5776
          byName.put(field.getFieldName(), field);
5777
        }
5778
      }
5779
 
5780
      /**
5781
       * Find the _Fields constant that matches fieldId, or null if its not found.
5782
       */
5783
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5784
        switch(fieldId) {
5785
          default:
5786
            return null;
5787
        }
1982 varun.gupt 5788
      }
5789
 
5790
      /**
5791
       * Find the _Fields constant that matches fieldId, throwing an exception
5792
       * if it is not found.
5793
       */
5794
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5795
        _Fields fields = findByThriftId(fieldId);
5796
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5797
        return fields;
5798
      }
5799
 
5800
      /**
5801
       * Find the _Fields constant that matches name, or null if its not found.
5802
       */
5803
      public static _Fields findByName(String name) {
5804
        return byName.get(name);
5805
      }
5806
 
5807
      private final short _thriftId;
5808
      private final String _fieldName;
5809
 
5810
      _Fields(short thriftId, String fieldName) {
5811
        _thriftId = thriftId;
5812
        _fieldName = fieldName;
5813
      }
5814
 
5815
      public short getThriftFieldId() {
5816
        return _thriftId;
5817
      }
5818
 
5819
      public String getFieldName() {
5820
        return _fieldName;
5821
      }
5822
    }
3430 rajveer 5823
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5824
    static {
3430 rajveer 5825
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5826
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5827
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_args.class, metaDataMap);
1982 varun.gupt 5828
    }
5829
 
5830
    public getAllPromotions_args() {
5831
    }
5832
 
5833
    /**
5834
     * Performs a deep copy on <i>other</i>.
5835
     */
5836
    public getAllPromotions_args(getAllPromotions_args other) {
5837
    }
5838
 
5839
    public getAllPromotions_args deepCopy() {
5840
      return new getAllPromotions_args(this);
5841
    }
5842
 
3430 rajveer 5843
    @Override
5844
    public void clear() {
1982 varun.gupt 5845
    }
5846
 
5847
    public void setFieldValue(_Fields field, Object value) {
5848
      switch (field) {
5849
      }
5850
    }
5851
 
5852
    public Object getFieldValue(_Fields field) {
5853
      switch (field) {
5854
      }
5855
      throw new IllegalStateException();
5856
    }
5857
 
3430 rajveer 5858
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5859
    public boolean isSet(_Fields field) {
5860
      if (field == null) {
5861
        throw new IllegalArgumentException();
5862
      }
1982 varun.gupt 5863
 
5864
      switch (field) {
5865
      }
5866
      throw new IllegalStateException();
5867
    }
5868
 
5869
    @Override
5870
    public boolean equals(Object that) {
5871
      if (that == null)
5872
        return false;
5873
      if (that instanceof getAllPromotions_args)
5874
        return this.equals((getAllPromotions_args)that);
5875
      return false;
5876
    }
5877
 
5878
    public boolean equals(getAllPromotions_args that) {
5879
      if (that == null)
5880
        return false;
5881
 
5882
      return true;
5883
    }
5884
 
5885
    @Override
5886
    public int hashCode() {
5887
      return 0;
5888
    }
5889
 
5890
    public int compareTo(getAllPromotions_args other) {
5891
      if (!getClass().equals(other.getClass())) {
5892
        return getClass().getName().compareTo(other.getClass().getName());
5893
      }
5894
 
5895
      int lastComparison = 0;
5896
      getAllPromotions_args typedOther = (getAllPromotions_args)other;
5897
 
5898
      return 0;
5899
    }
5900
 
3430 rajveer 5901
    public _Fields fieldForId(int fieldId) {
5902
      return _Fields.findByThriftId(fieldId);
5903
    }
5904
 
5905
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5906
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5907
      iprot.readStructBegin();
5908
      while (true)
5909
      {
5910
        field = iprot.readFieldBegin();
3430 rajveer 5911
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5912
          break;
5913
        }
3430 rajveer 5914
        switch (field.id) {
5915
          default:
5916
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5917
        }
3430 rajveer 5918
        iprot.readFieldEnd();
1982 varun.gupt 5919
      }
5920
      iprot.readStructEnd();
5921
      validate();
5922
    }
5923
 
3430 rajveer 5924
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5925
      validate();
5926
 
5927
      oprot.writeStructBegin(STRUCT_DESC);
5928
      oprot.writeFieldStop();
5929
      oprot.writeStructEnd();
5930
    }
5931
 
5932
    @Override
5933
    public String toString() {
5934
      StringBuilder sb = new StringBuilder("getAllPromotions_args(");
5935
      boolean first = true;
5936
 
5937
      sb.append(")");
5938
      return sb.toString();
5939
    }
5940
 
3430 rajveer 5941
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5942
      // check for required fields
5943
    }
5944
 
3430 rajveer 5945
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5946
      try {
5947
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5948
      } catch (org.apache.thrift.TException te) {
5949
        throw new java.io.IOException(te);
5950
      }
5951
    }
5952
 
5953
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5954
      try {
5955
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5956
      } catch (org.apache.thrift.TException te) {
5957
        throw new java.io.IOException(te);
5958
      }
5959
    }
5960
 
1982 varun.gupt 5961
  }
5962
 
3430 rajveer 5963
  public static class getAllPromotions_result implements org.apache.thrift.TBase<getAllPromotions_result, getAllPromotions_result._Fields>, java.io.Serializable, Cloneable   {
5964
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_result");
1982 varun.gupt 5965
 
3430 rajveer 5966
    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);
5967
    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 5968
 
3430 rajveer 5969
    private List<Promotion> success; // required
5970
    private PromotionException pex; // required
1982 varun.gupt 5971
 
5972
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5973
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5974
      SUCCESS((short)0, "success"),
5975
      PEX((short)1, "pex");
5976
 
5977
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5978
 
5979
      static {
5980
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5981
          byName.put(field.getFieldName(), field);
5982
        }
5983
      }
5984
 
5985
      /**
5986
       * Find the _Fields constant that matches fieldId, or null if its not found.
5987
       */
5988
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5989
        switch(fieldId) {
5990
          case 0: // SUCCESS
5991
            return SUCCESS;
5992
          case 1: // PEX
5993
            return PEX;
5994
          default:
5995
            return null;
5996
        }
1982 varun.gupt 5997
      }
5998
 
5999
      /**
6000
       * Find the _Fields constant that matches fieldId, throwing an exception
6001
       * if it is not found.
6002
       */
6003
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6004
        _Fields fields = findByThriftId(fieldId);
6005
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6006
        return fields;
6007
      }
6008
 
6009
      /**
6010
       * Find the _Fields constant that matches name, or null if its not found.
6011
       */
6012
      public static _Fields findByName(String name) {
6013
        return byName.get(name);
6014
      }
6015
 
6016
      private final short _thriftId;
6017
      private final String _fieldName;
6018
 
6019
      _Fields(short thriftId, String fieldName) {
6020
        _thriftId = thriftId;
6021
        _fieldName = fieldName;
6022
      }
6023
 
6024
      public short getThriftFieldId() {
6025
        return _thriftId;
6026
      }
6027
 
6028
      public String getFieldName() {
6029
        return _fieldName;
6030
      }
6031
    }
6032
 
6033
    // isset id assignments
6034
 
3430 rajveer 6035
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6036
    static {
3430 rajveer 6037
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6038
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6039
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
6040
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class))));
6041
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6042
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
6043
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6044
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_result.class, metaDataMap);
1982 varun.gupt 6045
    }
6046
 
6047
    public getAllPromotions_result() {
6048
    }
6049
 
6050
    public getAllPromotions_result(
6051
      List<Promotion> success,
6052
      PromotionException pex)
6053
    {
6054
      this();
6055
      this.success = success;
6056
      this.pex = pex;
6057
    }
6058
 
6059
    /**
6060
     * Performs a deep copy on <i>other</i>.
6061
     */
6062
    public getAllPromotions_result(getAllPromotions_result other) {
6063
      if (other.isSetSuccess()) {
6064
        List<Promotion> __this__success = new ArrayList<Promotion>();
6065
        for (Promotion other_element : other.success) {
6066
          __this__success.add(new Promotion(other_element));
6067
        }
6068
        this.success = __this__success;
6069
      }
6070
      if (other.isSetPex()) {
6071
        this.pex = new PromotionException(other.pex);
6072
      }
6073
    }
6074
 
6075
    public getAllPromotions_result deepCopy() {
6076
      return new getAllPromotions_result(this);
6077
    }
6078
 
3430 rajveer 6079
    @Override
6080
    public void clear() {
6081
      this.success = null;
6082
      this.pex = null;
1982 varun.gupt 6083
    }
6084
 
6085
    public int getSuccessSize() {
6086
      return (this.success == null) ? 0 : this.success.size();
6087
    }
6088
 
6089
    public java.util.Iterator<Promotion> getSuccessIterator() {
6090
      return (this.success == null) ? null : this.success.iterator();
6091
    }
6092
 
6093
    public void addToSuccess(Promotion elem) {
6094
      if (this.success == null) {
6095
        this.success = new ArrayList<Promotion>();
6096
      }
6097
      this.success.add(elem);
6098
    }
6099
 
6100
    public List<Promotion> getSuccess() {
6101
      return this.success;
6102
    }
6103
 
3430 rajveer 6104
    public void setSuccess(List<Promotion> success) {
1982 varun.gupt 6105
      this.success = success;
6106
    }
6107
 
6108
    public void unsetSuccess() {
6109
      this.success = null;
6110
    }
6111
 
3430 rajveer 6112
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6113
    public boolean isSetSuccess() {
6114
      return this.success != null;
6115
    }
6116
 
6117
    public void setSuccessIsSet(boolean value) {
6118
      if (!value) {
6119
        this.success = null;
6120
      }
6121
    }
6122
 
6123
    public PromotionException getPex() {
6124
      return this.pex;
6125
    }
6126
 
3430 rajveer 6127
    public void setPex(PromotionException pex) {
1982 varun.gupt 6128
      this.pex = pex;
6129
    }
6130
 
6131
    public void unsetPex() {
6132
      this.pex = null;
6133
    }
6134
 
3430 rajveer 6135
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6136
    public boolean isSetPex() {
6137
      return this.pex != null;
6138
    }
6139
 
6140
    public void setPexIsSet(boolean value) {
6141
      if (!value) {
6142
        this.pex = null;
6143
      }
6144
    }
6145
 
6146
    public void setFieldValue(_Fields field, Object value) {
6147
      switch (field) {
6148
      case SUCCESS:
6149
        if (value == null) {
6150
          unsetSuccess();
6151
        } else {
6152
          setSuccess((List<Promotion>)value);
6153
        }
6154
        break;
6155
 
6156
      case PEX:
6157
        if (value == null) {
6158
          unsetPex();
6159
        } else {
6160
          setPex((PromotionException)value);
6161
        }
6162
        break;
6163
 
6164
      }
6165
    }
6166
 
6167
    public Object getFieldValue(_Fields field) {
6168
      switch (field) {
6169
      case SUCCESS:
6170
        return getSuccess();
6171
 
6172
      case PEX:
6173
        return getPex();
6174
 
6175
      }
6176
      throw new IllegalStateException();
6177
    }
6178
 
3430 rajveer 6179
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6180
    public boolean isSet(_Fields field) {
6181
      if (field == null) {
6182
        throw new IllegalArgumentException();
6183
      }
1982 varun.gupt 6184
 
6185
      switch (field) {
6186
      case SUCCESS:
6187
        return isSetSuccess();
6188
      case PEX:
6189
        return isSetPex();
6190
      }
6191
      throw new IllegalStateException();
6192
    }
6193
 
6194
    @Override
6195
    public boolean equals(Object that) {
6196
      if (that == null)
6197
        return false;
6198
      if (that instanceof getAllPromotions_result)
6199
        return this.equals((getAllPromotions_result)that);
6200
      return false;
6201
    }
6202
 
6203
    public boolean equals(getAllPromotions_result that) {
6204
      if (that == null)
6205
        return false;
6206
 
6207
      boolean this_present_success = true && this.isSetSuccess();
6208
      boolean that_present_success = true && that.isSetSuccess();
6209
      if (this_present_success || that_present_success) {
6210
        if (!(this_present_success && that_present_success))
6211
          return false;
6212
        if (!this.success.equals(that.success))
6213
          return false;
6214
      }
6215
 
6216
      boolean this_present_pex = true && this.isSetPex();
6217
      boolean that_present_pex = true && that.isSetPex();
6218
      if (this_present_pex || that_present_pex) {
6219
        if (!(this_present_pex && that_present_pex))
6220
          return false;
6221
        if (!this.pex.equals(that.pex))
6222
          return false;
6223
      }
6224
 
6225
      return true;
6226
    }
6227
 
6228
    @Override
6229
    public int hashCode() {
6230
      return 0;
6231
    }
6232
 
6233
    public int compareTo(getAllPromotions_result other) {
6234
      if (!getClass().equals(other.getClass())) {
6235
        return getClass().getName().compareTo(other.getClass().getName());
6236
      }
6237
 
6238
      int lastComparison = 0;
6239
      getAllPromotions_result typedOther = (getAllPromotions_result)other;
6240
 
3430 rajveer 6241
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 6242
      if (lastComparison != 0) {
6243
        return lastComparison;
6244
      }
3430 rajveer 6245
      if (isSetSuccess()) {
6246
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
6247
        if (lastComparison != 0) {
6248
          return lastComparison;
6249
        }
1982 varun.gupt 6250
      }
3430 rajveer 6251
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 6252
      if (lastComparison != 0) {
6253
        return lastComparison;
6254
      }
3430 rajveer 6255
      if (isSetPex()) {
6256
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
6257
        if (lastComparison != 0) {
6258
          return lastComparison;
6259
        }
1982 varun.gupt 6260
      }
6261
      return 0;
6262
    }
6263
 
3430 rajveer 6264
    public _Fields fieldForId(int fieldId) {
6265
      return _Fields.findByThriftId(fieldId);
6266
    }
6267
 
6268
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6269
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6270
      iprot.readStructBegin();
6271
      while (true)
6272
      {
6273
        field = iprot.readFieldBegin();
3430 rajveer 6274
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6275
          break;
6276
        }
3430 rajveer 6277
        switch (field.id) {
6278
          case 0: // SUCCESS
6279
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
6280
              {
11592 amit.gupta 6281
                org.apache.thrift.protocol.TList _list16 = iprot.readListBegin();
6282
                this.success = new ArrayList<Promotion>(_list16.size);
6283
                for (int _i17 = 0; _i17 < _list16.size; ++_i17)
1982 varun.gupt 6284
                {
11592 amit.gupta 6285
                  Promotion _elem18; // required
6286
                  _elem18 = new Promotion();
6287
                  _elem18.read(iprot);
6288
                  this.success.add(_elem18);
1982 varun.gupt 6289
                }
3430 rajveer 6290
                iprot.readListEnd();
1982 varun.gupt 6291
              }
3430 rajveer 6292
            } else { 
6293
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6294
            }
6295
            break;
6296
          case 1: // PEX
6297
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6298
              this.pex = new PromotionException();
6299
              this.pex.read(iprot);
6300
            } else { 
6301
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6302
            }
6303
            break;
6304
          default:
6305
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6306
        }
3430 rajveer 6307
        iprot.readFieldEnd();
1982 varun.gupt 6308
      }
6309
      iprot.readStructEnd();
6310
      validate();
6311
    }
6312
 
3430 rajveer 6313
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6314
      oprot.writeStructBegin(STRUCT_DESC);
6315
 
6316
      if (this.isSetSuccess()) {
6317
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
6318
        {
3430 rajveer 6319
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
11592 amit.gupta 6320
          for (Promotion _iter19 : this.success)
1982 varun.gupt 6321
          {
11592 amit.gupta 6322
            _iter19.write(oprot);
1982 varun.gupt 6323
          }
6324
          oprot.writeListEnd();
6325
        }
6326
        oprot.writeFieldEnd();
6327
      } else if (this.isSetPex()) {
6328
        oprot.writeFieldBegin(PEX_FIELD_DESC);
6329
        this.pex.write(oprot);
6330
        oprot.writeFieldEnd();
6331
      }
6332
      oprot.writeFieldStop();
6333
      oprot.writeStructEnd();
6334
    }
6335
 
6336
    @Override
6337
    public String toString() {
6338
      StringBuilder sb = new StringBuilder("getAllPromotions_result(");
6339
      boolean first = true;
6340
 
6341
      sb.append("success:");
6342
      if (this.success == null) {
6343
        sb.append("null");
6344
      } else {
6345
        sb.append(this.success);
6346
      }
6347
      first = false;
6348
      if (!first) sb.append(", ");
6349
      sb.append("pex:");
6350
      if (this.pex == null) {
6351
        sb.append("null");
6352
      } else {
6353
        sb.append(this.pex);
6354
      }
6355
      first = false;
6356
      sb.append(")");
6357
      return sb.toString();
6358
    }
6359
 
3430 rajveer 6360
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6361
      // check for required fields
6362
    }
6363
 
3430 rajveer 6364
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6365
      try {
6366
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6367
      } catch (org.apache.thrift.TException te) {
6368
        throw new java.io.IOException(te);
6369
      }
6370
    }
6371
 
6372
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6373
      try {
6374
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6375
      } catch (org.apache.thrift.TException te) {
6376
        throw new java.io.IOException(te);
6377
      }
6378
    }
6379
 
1982 varun.gupt 6380
  }
6381
 
3430 rajveer 6382
  public static class getPromotionById_args implements org.apache.thrift.TBase<getPromotionById_args, getPromotionById_args._Fields>, java.io.Serializable, Cloneable   {
6383
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_args");
1982 varun.gupt 6384
 
3430 rajveer 6385
    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 6386
 
3430 rajveer 6387
    private long promotionId; // required
1982 varun.gupt 6388
 
6389
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6390
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6391
      PROMOTION_ID((short)1, "promotionId");
6392
 
6393
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6394
 
6395
      static {
6396
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6397
          byName.put(field.getFieldName(), field);
6398
        }
6399
      }
6400
 
6401
      /**
6402
       * Find the _Fields constant that matches fieldId, or null if its not found.
6403
       */
6404
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6405
        switch(fieldId) {
6406
          case 1: // PROMOTION_ID
6407
            return PROMOTION_ID;
6408
          default:
6409
            return null;
6410
        }
1982 varun.gupt 6411
      }
6412
 
6413
      /**
6414
       * Find the _Fields constant that matches fieldId, throwing an exception
6415
       * if it is not found.
6416
       */
6417
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6418
        _Fields fields = findByThriftId(fieldId);
6419
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6420
        return fields;
6421
      }
6422
 
6423
      /**
6424
       * Find the _Fields constant that matches name, or null if its not found.
6425
       */
6426
      public static _Fields findByName(String name) {
6427
        return byName.get(name);
6428
      }
6429
 
6430
      private final short _thriftId;
6431
      private final String _fieldName;
6432
 
6433
      _Fields(short thriftId, String fieldName) {
6434
        _thriftId = thriftId;
6435
        _fieldName = fieldName;
6436
      }
6437
 
6438
      public short getThriftFieldId() {
6439
        return _thriftId;
6440
      }
6441
 
6442
      public String getFieldName() {
6443
        return _fieldName;
6444
      }
6445
    }
6446
 
6447
    // isset id assignments
6448
    private static final int __PROMOTIONID_ISSET_ID = 0;
6449
    private BitSet __isset_bit_vector = new BitSet(1);
6450
 
3430 rajveer 6451
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6452
    static {
3430 rajveer 6453
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6454
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6455
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6456
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6457
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_args.class, metaDataMap);
1982 varun.gupt 6458
    }
6459
 
6460
    public getPromotionById_args() {
6461
    }
6462
 
6463
    public getPromotionById_args(
6464
      long promotionId)
6465
    {
6466
      this();
6467
      this.promotionId = promotionId;
6468
      setPromotionIdIsSet(true);
6469
    }
6470
 
6471
    /**
6472
     * Performs a deep copy on <i>other</i>.
6473
     */
6474
    public getPromotionById_args(getPromotionById_args other) {
6475
      __isset_bit_vector.clear();
6476
      __isset_bit_vector.or(other.__isset_bit_vector);
6477
      this.promotionId = other.promotionId;
6478
    }
6479
 
6480
    public getPromotionById_args deepCopy() {
6481
      return new getPromotionById_args(this);
6482
    }
6483
 
3430 rajveer 6484
    @Override
6485
    public void clear() {
6486
      setPromotionIdIsSet(false);
6487
      this.promotionId = 0;
1982 varun.gupt 6488
    }
6489
 
6490
    public long getPromotionId() {
6491
      return this.promotionId;
6492
    }
6493
 
3430 rajveer 6494
    public void setPromotionId(long promotionId) {
1982 varun.gupt 6495
      this.promotionId = promotionId;
6496
      setPromotionIdIsSet(true);
6497
    }
6498
 
6499
    public void unsetPromotionId() {
6500
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
6501
    }
6502
 
3430 rajveer 6503
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6504
    public boolean isSetPromotionId() {
6505
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
6506
    }
6507
 
6508
    public void setPromotionIdIsSet(boolean value) {
6509
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
6510
    }
6511
 
6512
    public void setFieldValue(_Fields field, Object value) {
6513
      switch (field) {
6514
      case PROMOTION_ID:
6515
        if (value == null) {
6516
          unsetPromotionId();
6517
        } else {
6518
          setPromotionId((Long)value);
6519
        }
6520
        break;
6521
 
6522
      }
6523
    }
6524
 
6525
    public Object getFieldValue(_Fields field) {
6526
      switch (field) {
6527
      case PROMOTION_ID:
3430 rajveer 6528
        return Long.valueOf(getPromotionId());
1982 varun.gupt 6529
 
6530
      }
6531
      throw new IllegalStateException();
6532
    }
6533
 
3430 rajveer 6534
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6535
    public boolean isSet(_Fields field) {
6536
      if (field == null) {
6537
        throw new IllegalArgumentException();
6538
      }
1982 varun.gupt 6539
 
6540
      switch (field) {
6541
      case PROMOTION_ID:
6542
        return isSetPromotionId();
6543
      }
6544
      throw new IllegalStateException();
6545
    }
6546
 
6547
    @Override
6548
    public boolean equals(Object that) {
6549
      if (that == null)
6550
        return false;
6551
      if (that instanceof getPromotionById_args)
6552
        return this.equals((getPromotionById_args)that);
6553
      return false;
6554
    }
6555
 
6556
    public boolean equals(getPromotionById_args that) {
6557
      if (that == null)
6558
        return false;
6559
 
6560
      boolean this_present_promotionId = true;
6561
      boolean that_present_promotionId = true;
6562
      if (this_present_promotionId || that_present_promotionId) {
6563
        if (!(this_present_promotionId && that_present_promotionId))
6564
          return false;
6565
        if (this.promotionId != that.promotionId)
6566
          return false;
6567
      }
6568
 
6569
      return true;
6570
    }
6571
 
6572
    @Override
6573
    public int hashCode() {
6574
      return 0;
6575
    }
6576
 
6577
    public int compareTo(getPromotionById_args other) {
6578
      if (!getClass().equals(other.getClass())) {
6579
        return getClass().getName().compareTo(other.getClass().getName());
6580
      }
6581
 
6582
      int lastComparison = 0;
6583
      getPromotionById_args typedOther = (getPromotionById_args)other;
6584
 
3430 rajveer 6585
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 6586
      if (lastComparison != 0) {
6587
        return lastComparison;
6588
      }
3430 rajveer 6589
      if (isSetPromotionId()) {
6590
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
6591
        if (lastComparison != 0) {
6592
          return lastComparison;
6593
        }
1982 varun.gupt 6594
      }
6595
      return 0;
6596
    }
6597
 
3430 rajveer 6598
    public _Fields fieldForId(int fieldId) {
6599
      return _Fields.findByThriftId(fieldId);
6600
    }
6601
 
6602
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6603
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6604
      iprot.readStructBegin();
6605
      while (true)
6606
      {
6607
        field = iprot.readFieldBegin();
3430 rajveer 6608
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6609
          break;
6610
        }
3430 rajveer 6611
        switch (field.id) {
6612
          case 1: // PROMOTION_ID
6613
            if (field.type == org.apache.thrift.protocol.TType.I64) {
6614
              this.promotionId = iprot.readI64();
6615
              setPromotionIdIsSet(true);
6616
            } else { 
6617
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6618
            }
6619
            break;
6620
          default:
6621
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6622
        }
3430 rajveer 6623
        iprot.readFieldEnd();
1982 varun.gupt 6624
      }
6625
      iprot.readStructEnd();
6626
      validate();
6627
    }
6628
 
3430 rajveer 6629
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6630
      validate();
6631
 
6632
      oprot.writeStructBegin(STRUCT_DESC);
6633
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
6634
      oprot.writeI64(this.promotionId);
6635
      oprot.writeFieldEnd();
6636
      oprot.writeFieldStop();
6637
      oprot.writeStructEnd();
6638
    }
6639
 
6640
    @Override
6641
    public String toString() {
6642
      StringBuilder sb = new StringBuilder("getPromotionById_args(");
6643
      boolean first = true;
6644
 
6645
      sb.append("promotionId:");
6646
      sb.append(this.promotionId);
6647
      first = false;
6648
      sb.append(")");
6649
      return sb.toString();
6650
    }
6651
 
3430 rajveer 6652
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6653
      // check for required fields
6654
    }
6655
 
3430 rajveer 6656
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6657
      try {
6658
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6659
      } catch (org.apache.thrift.TException te) {
6660
        throw new java.io.IOException(te);
6661
      }
6662
    }
6663
 
6664
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6665
      try {
6666
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
6667
        __isset_bit_vector = new BitSet(1);
6668
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6669
      } catch (org.apache.thrift.TException te) {
6670
        throw new java.io.IOException(te);
6671
      }
6672
    }
6673
 
1982 varun.gupt 6674
  }
6675
 
3430 rajveer 6676
  public static class getPromotionById_result implements org.apache.thrift.TBase<getPromotionById_result, getPromotionById_result._Fields>, java.io.Serializable, Cloneable   {
6677
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_result");
1982 varun.gupt 6678
 
3430 rajveer 6679
    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);
6680
    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 6681
 
3430 rajveer 6682
    private Promotion success; // required
6683
    private PromotionException pex; // required
1982 varun.gupt 6684
 
6685
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6686
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6687
      SUCCESS((short)0, "success"),
6688
      PEX((short)1, "pex");
6689
 
6690
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6691
 
6692
      static {
6693
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6694
          byName.put(field.getFieldName(), field);
6695
        }
6696
      }
6697
 
6698
      /**
6699
       * Find the _Fields constant that matches fieldId, or null if its not found.
6700
       */
6701
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6702
        switch(fieldId) {
6703
          case 0: // SUCCESS
6704
            return SUCCESS;
6705
          case 1: // PEX
6706
            return PEX;
6707
          default:
6708
            return null;
6709
        }
1982 varun.gupt 6710
      }
6711
 
6712
      /**
6713
       * Find the _Fields constant that matches fieldId, throwing an exception
6714
       * if it is not found.
6715
       */
6716
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6717
        _Fields fields = findByThriftId(fieldId);
6718
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6719
        return fields;
6720
      }
6721
 
6722
      /**
6723
       * Find the _Fields constant that matches name, or null if its not found.
6724
       */
6725
      public static _Fields findByName(String name) {
6726
        return byName.get(name);
6727
      }
6728
 
6729
      private final short _thriftId;
6730
      private final String _fieldName;
6731
 
6732
      _Fields(short thriftId, String fieldName) {
6733
        _thriftId = thriftId;
6734
        _fieldName = fieldName;
6735
      }
6736
 
6737
      public short getThriftFieldId() {
6738
        return _thriftId;
6739
      }
6740
 
6741
      public String getFieldName() {
6742
        return _fieldName;
6743
      }
6744
    }
6745
 
6746
    // isset id assignments
6747
 
3430 rajveer 6748
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6749
    static {
3430 rajveer 6750
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6751
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6752
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class)));
6753
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6754
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
6755
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6756
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_result.class, metaDataMap);
1982 varun.gupt 6757
    }
6758
 
6759
    public getPromotionById_result() {
6760
    }
6761
 
6762
    public getPromotionById_result(
6763
      Promotion success,
6764
      PromotionException pex)
6765
    {
6766
      this();
6767
      this.success = success;
6768
      this.pex = pex;
6769
    }
6770
 
6771
    /**
6772
     * Performs a deep copy on <i>other</i>.
6773
     */
6774
    public getPromotionById_result(getPromotionById_result other) {
6775
      if (other.isSetSuccess()) {
6776
        this.success = new Promotion(other.success);
6777
      }
6778
      if (other.isSetPex()) {
6779
        this.pex = new PromotionException(other.pex);
6780
      }
6781
    }
6782
 
6783
    public getPromotionById_result deepCopy() {
6784
      return new getPromotionById_result(this);
6785
    }
6786
 
3430 rajveer 6787
    @Override
6788
    public void clear() {
6789
      this.success = null;
6790
      this.pex = null;
1982 varun.gupt 6791
    }
6792
 
6793
    public Promotion getSuccess() {
6794
      return this.success;
6795
    }
6796
 
3430 rajveer 6797
    public void setSuccess(Promotion success) {
1982 varun.gupt 6798
      this.success = success;
6799
    }
6800
 
6801
    public void unsetSuccess() {
6802
      this.success = null;
6803
    }
6804
 
3430 rajveer 6805
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6806
    public boolean isSetSuccess() {
6807
      return this.success != null;
6808
    }
6809
 
6810
    public void setSuccessIsSet(boolean value) {
6811
      if (!value) {
6812
        this.success = null;
6813
      }
6814
    }
6815
 
6816
    public PromotionException getPex() {
6817
      return this.pex;
6818
    }
6819
 
3430 rajveer 6820
    public void setPex(PromotionException pex) {
1982 varun.gupt 6821
      this.pex = pex;
6822
    }
6823
 
6824
    public void unsetPex() {
6825
      this.pex = null;
6826
    }
6827
 
3430 rajveer 6828
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6829
    public boolean isSetPex() {
6830
      return this.pex != null;
6831
    }
6832
 
6833
    public void setPexIsSet(boolean value) {
6834
      if (!value) {
6835
        this.pex = null;
6836
      }
6837
    }
6838
 
6839
    public void setFieldValue(_Fields field, Object value) {
6840
      switch (field) {
6841
      case SUCCESS:
6842
        if (value == null) {
6843
          unsetSuccess();
6844
        } else {
6845
          setSuccess((Promotion)value);
6846
        }
6847
        break;
6848
 
6849
      case PEX:
6850
        if (value == null) {
6851
          unsetPex();
6852
        } else {
6853
          setPex((PromotionException)value);
6854
        }
6855
        break;
6856
 
6857
      }
6858
    }
6859
 
6860
    public Object getFieldValue(_Fields field) {
6861
      switch (field) {
6862
      case SUCCESS:
6863
        return getSuccess();
6864
 
6865
      case PEX:
6866
        return getPex();
6867
 
6868
      }
6869
      throw new IllegalStateException();
6870
    }
6871
 
3430 rajveer 6872
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6873
    public boolean isSet(_Fields field) {
6874
      if (field == null) {
6875
        throw new IllegalArgumentException();
6876
      }
1982 varun.gupt 6877
 
6878
      switch (field) {
6879
      case SUCCESS:
6880
        return isSetSuccess();
6881
      case PEX:
6882
        return isSetPex();
6883
      }
6884
      throw new IllegalStateException();
6885
    }
6886
 
6887
    @Override
6888
    public boolean equals(Object that) {
6889
      if (that == null)
6890
        return false;
6891
      if (that instanceof getPromotionById_result)
6892
        return this.equals((getPromotionById_result)that);
6893
      return false;
6894
    }
6895
 
6896
    public boolean equals(getPromotionById_result that) {
6897
      if (that == null)
6898
        return false;
6899
 
6900
      boolean this_present_success = true && this.isSetSuccess();
6901
      boolean that_present_success = true && that.isSetSuccess();
6902
      if (this_present_success || that_present_success) {
6903
        if (!(this_present_success && that_present_success))
6904
          return false;
6905
        if (!this.success.equals(that.success))
6906
          return false;
6907
      }
6908
 
6909
      boolean this_present_pex = true && this.isSetPex();
6910
      boolean that_present_pex = true && that.isSetPex();
6911
      if (this_present_pex || that_present_pex) {
6912
        if (!(this_present_pex && that_present_pex))
6913
          return false;
6914
        if (!this.pex.equals(that.pex))
6915
          return false;
6916
      }
6917
 
6918
      return true;
6919
    }
6920
 
6921
    @Override
6922
    public int hashCode() {
6923
      return 0;
6924
    }
6925
 
6926
    public int compareTo(getPromotionById_result other) {
6927
      if (!getClass().equals(other.getClass())) {
6928
        return getClass().getName().compareTo(other.getClass().getName());
6929
      }
6930
 
6931
      int lastComparison = 0;
6932
      getPromotionById_result typedOther = (getPromotionById_result)other;
6933
 
3430 rajveer 6934
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 6935
      if (lastComparison != 0) {
6936
        return lastComparison;
6937
      }
3430 rajveer 6938
      if (isSetSuccess()) {
6939
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
6940
        if (lastComparison != 0) {
6941
          return lastComparison;
6942
        }
1982 varun.gupt 6943
      }
3430 rajveer 6944
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 6945
      if (lastComparison != 0) {
6946
        return lastComparison;
6947
      }
3430 rajveer 6948
      if (isSetPex()) {
6949
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
6950
        if (lastComparison != 0) {
6951
          return lastComparison;
6952
        }
1982 varun.gupt 6953
      }
6954
      return 0;
6955
    }
6956
 
3430 rajveer 6957
    public _Fields fieldForId(int fieldId) {
6958
      return _Fields.findByThriftId(fieldId);
6959
    }
6960
 
6961
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6962
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6963
      iprot.readStructBegin();
6964
      while (true)
6965
      {
6966
        field = iprot.readFieldBegin();
3430 rajveer 6967
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6968
          break;
6969
        }
3430 rajveer 6970
        switch (field.id) {
6971
          case 0: // SUCCESS
6972
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6973
              this.success = new Promotion();
6974
              this.success.read(iprot);
6975
            } else { 
6976
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6977
            }
6978
            break;
6979
          case 1: // PEX
6980
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6981
              this.pex = new PromotionException();
6982
              this.pex.read(iprot);
6983
            } else { 
6984
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6985
            }
6986
            break;
6987
          default:
6988
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6989
        }
3430 rajveer 6990
        iprot.readFieldEnd();
1982 varun.gupt 6991
      }
6992
      iprot.readStructEnd();
6993
      validate();
6994
    }
6995
 
3430 rajveer 6996
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6997
      oprot.writeStructBegin(STRUCT_DESC);
6998
 
6999
      if (this.isSetSuccess()) {
7000
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
7001
        this.success.write(oprot);
7002
        oprot.writeFieldEnd();
7003
      } else if (this.isSetPex()) {
7004
        oprot.writeFieldBegin(PEX_FIELD_DESC);
7005
        this.pex.write(oprot);
7006
        oprot.writeFieldEnd();
7007
      }
7008
      oprot.writeFieldStop();
7009
      oprot.writeStructEnd();
7010
    }
7011
 
7012
    @Override
7013
    public String toString() {
7014
      StringBuilder sb = new StringBuilder("getPromotionById_result(");
7015
      boolean first = true;
7016
 
7017
      sb.append("success:");
7018
      if (this.success == null) {
7019
        sb.append("null");
7020
      } else {
7021
        sb.append(this.success);
7022
      }
7023
      first = false;
7024
      if (!first) sb.append(", ");
7025
      sb.append("pex:");
7026
      if (this.pex == null) {
7027
        sb.append("null");
7028
      } else {
7029
        sb.append(this.pex);
7030
      }
7031
      first = false;
7032
      sb.append(")");
7033
      return sb.toString();
7034
    }
7035
 
3430 rajveer 7036
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7037
      // check for required fields
7038
    }
7039
 
3430 rajveer 7040
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7041
      try {
7042
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7043
      } catch (org.apache.thrift.TException te) {
7044
        throw new java.io.IOException(te);
7045
      }
7046
    }
7047
 
7048
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7049
      try {
7050
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7051
      } catch (org.apache.thrift.TException te) {
7052
        throw new java.io.IOException(te);
7053
      }
7054
    }
7055
 
1982 varun.gupt 7056
  }
7057
 
3430 rajveer 7058
  public static class generateCouponsForPromotion_args implements org.apache.thrift.TBase<generateCouponsForPromotion_args, generateCouponsForPromotion_args._Fields>, java.io.Serializable, Cloneable   {
7059
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_args");
1982 varun.gupt 7060
 
3430 rajveer 7061
    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);
7062
    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 7063
 
3430 rajveer 7064
    private long promotionId; // required
7065
    private String couponCode; // required
1982 varun.gupt 7066
 
7067
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7068
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 7069
      PROMOTION_ID((short)1, "promotionId"),
7070
      COUPON_CODE((short)2, "couponCode");
7071
 
7072
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7073
 
7074
      static {
7075
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7076
          byName.put(field.getFieldName(), field);
7077
        }
7078
      }
7079
 
7080
      /**
7081
       * Find the _Fields constant that matches fieldId, or null if its not found.
7082
       */
7083
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7084
        switch(fieldId) {
7085
          case 1: // PROMOTION_ID
7086
            return PROMOTION_ID;
7087
          case 2: // COUPON_CODE
7088
            return COUPON_CODE;
7089
          default:
7090
            return null;
7091
        }
1982 varun.gupt 7092
      }
7093
 
7094
      /**
7095
       * Find the _Fields constant that matches fieldId, throwing an exception
7096
       * if it is not found.
7097
       */
7098
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7099
        _Fields fields = findByThriftId(fieldId);
7100
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7101
        return fields;
7102
      }
7103
 
7104
      /**
7105
       * Find the _Fields constant that matches name, or null if its not found.
7106
       */
7107
      public static _Fields findByName(String name) {
7108
        return byName.get(name);
7109
      }
7110
 
7111
      private final short _thriftId;
7112
      private final String _fieldName;
7113
 
7114
      _Fields(short thriftId, String fieldName) {
7115
        _thriftId = thriftId;
7116
        _fieldName = fieldName;
7117
      }
7118
 
7119
      public short getThriftFieldId() {
7120
        return _thriftId;
7121
      }
7122
 
7123
      public String getFieldName() {
7124
        return _fieldName;
7125
      }
7126
    }
7127
 
7128
    // isset id assignments
7129
    private static final int __PROMOTIONID_ISSET_ID = 0;
7130
    private BitSet __isset_bit_vector = new BitSet(1);
7131
 
3430 rajveer 7132
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 7133
    static {
3430 rajveer 7134
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7135
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7136
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7137
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7138
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
7139
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7140
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_args.class, metaDataMap);
1982 varun.gupt 7141
    }
7142
 
7143
    public generateCouponsForPromotion_args() {
7144
    }
7145
 
7146
    public generateCouponsForPromotion_args(
7147
      long promotionId,
7148
      String couponCode)
7149
    {
7150
      this();
7151
      this.promotionId = promotionId;
7152
      setPromotionIdIsSet(true);
7153
      this.couponCode = couponCode;
7154
    }
7155
 
7156
    /**
7157
     * Performs a deep copy on <i>other</i>.
7158
     */
7159
    public generateCouponsForPromotion_args(generateCouponsForPromotion_args other) {
7160
      __isset_bit_vector.clear();
7161
      __isset_bit_vector.or(other.__isset_bit_vector);
7162
      this.promotionId = other.promotionId;
7163
      if (other.isSetCouponCode()) {
7164
        this.couponCode = other.couponCode;
7165
      }
7166
    }
7167
 
7168
    public generateCouponsForPromotion_args deepCopy() {
7169
      return new generateCouponsForPromotion_args(this);
7170
    }
7171
 
3430 rajveer 7172
    @Override
7173
    public void clear() {
7174
      setPromotionIdIsSet(false);
7175
      this.promotionId = 0;
7176
      this.couponCode = null;
1982 varun.gupt 7177
    }
7178
 
7179
    public long getPromotionId() {
7180
      return this.promotionId;
7181
    }
7182
 
3430 rajveer 7183
    public void setPromotionId(long promotionId) {
1982 varun.gupt 7184
      this.promotionId = promotionId;
7185
      setPromotionIdIsSet(true);
7186
    }
7187
 
7188
    public void unsetPromotionId() {
7189
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
7190
    }
7191
 
3430 rajveer 7192
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7193
    public boolean isSetPromotionId() {
7194
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
7195
    }
7196
 
7197
    public void setPromotionIdIsSet(boolean value) {
7198
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
7199
    }
7200
 
7201
    public String getCouponCode() {
7202
      return this.couponCode;
7203
    }
7204
 
3430 rajveer 7205
    public void setCouponCode(String couponCode) {
1982 varun.gupt 7206
      this.couponCode = couponCode;
7207
    }
7208
 
7209
    public void unsetCouponCode() {
7210
      this.couponCode = null;
7211
    }
7212
 
3430 rajveer 7213
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7214
    public boolean isSetCouponCode() {
7215
      return this.couponCode != null;
7216
    }
7217
 
7218
    public void setCouponCodeIsSet(boolean value) {
7219
      if (!value) {
7220
        this.couponCode = null;
7221
      }
7222
    }
7223
 
7224
    public void setFieldValue(_Fields field, Object value) {
7225
      switch (field) {
7226
      case PROMOTION_ID:
7227
        if (value == null) {
7228
          unsetPromotionId();
7229
        } else {
7230
          setPromotionId((Long)value);
7231
        }
7232
        break;
7233
 
7234
      case COUPON_CODE:
7235
        if (value == null) {
7236
          unsetCouponCode();
7237
        } else {
7238
          setCouponCode((String)value);
7239
        }
7240
        break;
7241
 
7242
      }
7243
    }
7244
 
7245
    public Object getFieldValue(_Fields field) {
7246
      switch (field) {
7247
      case PROMOTION_ID:
3430 rajveer 7248
        return Long.valueOf(getPromotionId());
1982 varun.gupt 7249
 
7250
      case COUPON_CODE:
7251
        return getCouponCode();
7252
 
7253
      }
7254
      throw new IllegalStateException();
7255
    }
7256
 
3430 rajveer 7257
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7258
    public boolean isSet(_Fields field) {
7259
      if (field == null) {
7260
        throw new IllegalArgumentException();
7261
      }
1982 varun.gupt 7262
 
7263
      switch (field) {
7264
      case PROMOTION_ID:
7265
        return isSetPromotionId();
7266
      case COUPON_CODE:
7267
        return isSetCouponCode();
7268
      }
7269
      throw new IllegalStateException();
7270
    }
7271
 
7272
    @Override
7273
    public boolean equals(Object that) {
7274
      if (that == null)
7275
        return false;
7276
      if (that instanceof generateCouponsForPromotion_args)
7277
        return this.equals((generateCouponsForPromotion_args)that);
7278
      return false;
7279
    }
7280
 
7281
    public boolean equals(generateCouponsForPromotion_args that) {
7282
      if (that == null)
7283
        return false;
7284
 
7285
      boolean this_present_promotionId = true;
7286
      boolean that_present_promotionId = true;
7287
      if (this_present_promotionId || that_present_promotionId) {
7288
        if (!(this_present_promotionId && that_present_promotionId))
7289
          return false;
7290
        if (this.promotionId != that.promotionId)
7291
          return false;
7292
      }
7293
 
7294
      boolean this_present_couponCode = true && this.isSetCouponCode();
7295
      boolean that_present_couponCode = true && that.isSetCouponCode();
7296
      if (this_present_couponCode || that_present_couponCode) {
7297
        if (!(this_present_couponCode && that_present_couponCode))
7298
          return false;
7299
        if (!this.couponCode.equals(that.couponCode))
7300
          return false;
7301
      }
7302
 
7303
      return true;
7304
    }
7305
 
7306
    @Override
7307
    public int hashCode() {
7308
      return 0;
7309
    }
7310
 
7311
    public int compareTo(generateCouponsForPromotion_args other) {
7312
      if (!getClass().equals(other.getClass())) {
7313
        return getClass().getName().compareTo(other.getClass().getName());
7314
      }
7315
 
7316
      int lastComparison = 0;
7317
      generateCouponsForPromotion_args typedOther = (generateCouponsForPromotion_args)other;
7318
 
3430 rajveer 7319
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 7320
      if (lastComparison != 0) {
7321
        return lastComparison;
7322
      }
3430 rajveer 7323
      if (isSetPromotionId()) {
7324
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
7325
        if (lastComparison != 0) {
7326
          return lastComparison;
7327
        }
1982 varun.gupt 7328
      }
3430 rajveer 7329
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 7330
      if (lastComparison != 0) {
7331
        return lastComparison;
7332
      }
3430 rajveer 7333
      if (isSetCouponCode()) {
7334
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
7335
        if (lastComparison != 0) {
7336
          return lastComparison;
7337
        }
1982 varun.gupt 7338
      }
7339
      return 0;
7340
    }
7341
 
3430 rajveer 7342
    public _Fields fieldForId(int fieldId) {
7343
      return _Fields.findByThriftId(fieldId);
7344
    }
7345
 
7346
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7347
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 7348
      iprot.readStructBegin();
7349
      while (true)
7350
      {
7351
        field = iprot.readFieldBegin();
3430 rajveer 7352
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 7353
          break;
7354
        }
3430 rajveer 7355
        switch (field.id) {
7356
          case 1: // PROMOTION_ID
7357
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7358
              this.promotionId = iprot.readI64();
7359
              setPromotionIdIsSet(true);
7360
            } else { 
7361
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7362
            }
7363
            break;
7364
          case 2: // COUPON_CODE
7365
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
7366
              this.couponCode = iprot.readString();
7367
            } else { 
7368
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7369
            }
7370
            break;
7371
          default:
7372
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 7373
        }
3430 rajveer 7374
        iprot.readFieldEnd();
1982 varun.gupt 7375
      }
7376
      iprot.readStructEnd();
7377
      validate();
7378
    }
7379
 
3430 rajveer 7380
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 7381
      validate();
7382
 
7383
      oprot.writeStructBegin(STRUCT_DESC);
7384
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
7385
      oprot.writeI64(this.promotionId);
7386
      oprot.writeFieldEnd();
7387
      if (this.couponCode != null) {
7388
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
7389
        oprot.writeString(this.couponCode);
7390
        oprot.writeFieldEnd();
7391
      }
7392
      oprot.writeFieldStop();
7393
      oprot.writeStructEnd();
7394
    }
7395
 
7396
    @Override
7397
    public String toString() {
7398
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_args(");
7399
      boolean first = true;
7400
 
7401
      sb.append("promotionId:");
7402
      sb.append(this.promotionId);
7403
      first = false;
7404
      if (!first) sb.append(", ");
7405
      sb.append("couponCode:");
7406
      if (this.couponCode == null) {
7407
        sb.append("null");
7408
      } else {
7409
        sb.append(this.couponCode);
7410
      }
7411
      first = false;
7412
      sb.append(")");
7413
      return sb.toString();
7414
    }
7415
 
3430 rajveer 7416
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7417
      // check for required fields
7418
    }
7419
 
3430 rajveer 7420
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7421
      try {
7422
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7423
      } catch (org.apache.thrift.TException te) {
7424
        throw new java.io.IOException(te);
7425
      }
7426
    }
7427
 
7428
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7429
      try {
7430
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
7431
        __isset_bit_vector = new BitSet(1);
7432
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7433
      } catch (org.apache.thrift.TException te) {
7434
        throw new java.io.IOException(te);
7435
      }
7436
    }
7437
 
1982 varun.gupt 7438
  }
7439
 
3430 rajveer 7440
  public static class generateCouponsForPromotion_result implements org.apache.thrift.TBase<generateCouponsForPromotion_result, generateCouponsForPromotion_result._Fields>, java.io.Serializable, Cloneable   {
7441
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_result");
1982 varun.gupt 7442
 
3430 rajveer 7443
    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 7444
 
3430 rajveer 7445
    private PromotionException pex; // required
1982 varun.gupt 7446
 
7447
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7448
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 7449
      PEX((short)1, "pex");
7450
 
7451
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7452
 
7453
      static {
7454
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7455
          byName.put(field.getFieldName(), field);
7456
        }
7457
      }
7458
 
7459
      /**
7460
       * Find the _Fields constant that matches fieldId, or null if its not found.
7461
       */
7462
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7463
        switch(fieldId) {
7464
          case 1: // PEX
7465
            return PEX;
7466
          default:
7467
            return null;
7468
        }
1982 varun.gupt 7469
      }
7470
 
7471
      /**
7472
       * Find the _Fields constant that matches fieldId, throwing an exception
7473
       * if it is not found.
7474
       */
7475
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7476
        _Fields fields = findByThriftId(fieldId);
7477
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7478
        return fields;
7479
      }
7480
 
7481
      /**
7482
       * Find the _Fields constant that matches name, or null if its not found.
7483
       */
7484
      public static _Fields findByName(String name) {
7485
        return byName.get(name);
7486
      }
7487
 
7488
      private final short _thriftId;
7489
      private final String _fieldName;
7490
 
7491
      _Fields(short thriftId, String fieldName) {
7492
        _thriftId = thriftId;
7493
        _fieldName = fieldName;
7494
      }
7495
 
7496
      public short getThriftFieldId() {
7497
        return _thriftId;
7498
      }
7499
 
7500
      public String getFieldName() {
7501
        return _fieldName;
7502
      }
7503
    }
7504
 
7505
    // isset id assignments
7506
 
3430 rajveer 7507
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 7508
    static {
3430 rajveer 7509
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7510
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7511
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
7512
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7513
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_result.class, metaDataMap);
1982 varun.gupt 7514
    }
7515
 
7516
    public generateCouponsForPromotion_result() {
7517
    }
7518
 
7519
    public generateCouponsForPromotion_result(
7520
      PromotionException pex)
7521
    {
7522
      this();
7523
      this.pex = pex;
7524
    }
7525
 
7526
    /**
7527
     * Performs a deep copy on <i>other</i>.
7528
     */
7529
    public generateCouponsForPromotion_result(generateCouponsForPromotion_result other) {
7530
      if (other.isSetPex()) {
7531
        this.pex = new PromotionException(other.pex);
7532
      }
7533
    }
7534
 
7535
    public generateCouponsForPromotion_result deepCopy() {
7536
      return new generateCouponsForPromotion_result(this);
7537
    }
7538
 
3430 rajveer 7539
    @Override
7540
    public void clear() {
7541
      this.pex = null;
1982 varun.gupt 7542
    }
7543
 
7544
    public PromotionException getPex() {
7545
      return this.pex;
7546
    }
7547
 
3430 rajveer 7548
    public void setPex(PromotionException pex) {
1982 varun.gupt 7549
      this.pex = pex;
7550
    }
7551
 
7552
    public void unsetPex() {
7553
      this.pex = null;
7554
    }
7555
 
3430 rajveer 7556
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7557
    public boolean isSetPex() {
7558
      return this.pex != null;
7559
    }
7560
 
7561
    public void setPexIsSet(boolean value) {
7562
      if (!value) {
7563
        this.pex = null;
7564
      }
7565
    }
7566
 
7567
    public void setFieldValue(_Fields field, Object value) {
7568
      switch (field) {
7569
      case PEX:
7570
        if (value == null) {
7571
          unsetPex();
7572
        } else {
7573
          setPex((PromotionException)value);
7574
        }
7575
        break;
7576
 
7577
      }
7578
    }
7579
 
7580
    public Object getFieldValue(_Fields field) {
7581
      switch (field) {
7582
      case PEX:
7583
        return getPex();
7584
 
7585
      }
7586
      throw new IllegalStateException();
7587
    }
7588
 
3430 rajveer 7589
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7590
    public boolean isSet(_Fields field) {
7591
      if (field == null) {
7592
        throw new IllegalArgumentException();
7593
      }
1982 varun.gupt 7594
 
7595
      switch (field) {
7596
      case PEX:
7597
        return isSetPex();
7598
      }
7599
      throw new IllegalStateException();
7600
    }
7601
 
7602
    @Override
7603
    public boolean equals(Object that) {
7604
      if (that == null)
7605
        return false;
7606
      if (that instanceof generateCouponsForPromotion_result)
7607
        return this.equals((generateCouponsForPromotion_result)that);
7608
      return false;
7609
    }
7610
 
7611
    public boolean equals(generateCouponsForPromotion_result that) {
7612
      if (that == null)
7613
        return false;
7614
 
7615
      boolean this_present_pex = true && this.isSetPex();
7616
      boolean that_present_pex = true && that.isSetPex();
7617
      if (this_present_pex || that_present_pex) {
7618
        if (!(this_present_pex && that_present_pex))
7619
          return false;
7620
        if (!this.pex.equals(that.pex))
7621
          return false;
7622
      }
7623
 
7624
      return true;
7625
    }
7626
 
7627
    @Override
7628
    public int hashCode() {
7629
      return 0;
7630
    }
7631
 
7632
    public int compareTo(generateCouponsForPromotion_result other) {
7633
      if (!getClass().equals(other.getClass())) {
7634
        return getClass().getName().compareTo(other.getClass().getName());
7635
      }
7636
 
7637
      int lastComparison = 0;
7638
      generateCouponsForPromotion_result typedOther = (generateCouponsForPromotion_result)other;
7639
 
3430 rajveer 7640
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 7641
      if (lastComparison != 0) {
7642
        return lastComparison;
7643
      }
3430 rajveer 7644
      if (isSetPex()) {
7645
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
7646
        if (lastComparison != 0) {
7647
          return lastComparison;
7648
        }
1982 varun.gupt 7649
      }
7650
      return 0;
7651
    }
7652
 
3430 rajveer 7653
    public _Fields fieldForId(int fieldId) {
7654
      return _Fields.findByThriftId(fieldId);
7655
    }
7656
 
7657
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7658
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 7659
      iprot.readStructBegin();
7660
      while (true)
7661
      {
7662
        field = iprot.readFieldBegin();
3430 rajveer 7663
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 7664
          break;
7665
        }
3430 rajveer 7666
        switch (field.id) {
7667
          case 1: // PEX
7668
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
7669
              this.pex = new PromotionException();
7670
              this.pex.read(iprot);
7671
            } else { 
7672
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7673
            }
7674
            break;
7675
          default:
7676
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 7677
        }
3430 rajveer 7678
        iprot.readFieldEnd();
1982 varun.gupt 7679
      }
7680
      iprot.readStructEnd();
7681
      validate();
7682
    }
7683
 
3430 rajveer 7684
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 7685
      oprot.writeStructBegin(STRUCT_DESC);
7686
 
7687
      if (this.isSetPex()) {
7688
        oprot.writeFieldBegin(PEX_FIELD_DESC);
7689
        this.pex.write(oprot);
7690
        oprot.writeFieldEnd();
7691
      }
7692
      oprot.writeFieldStop();
7693
      oprot.writeStructEnd();
7694
    }
7695
 
7696
    @Override
7697
    public String toString() {
7698
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_result(");
7699
      boolean first = true;
7700
 
7701
      sb.append("pex:");
7702
      if (this.pex == null) {
7703
        sb.append("null");
7704
      } else {
7705
        sb.append(this.pex);
7706
      }
7707
      first = false;
7708
      sb.append(")");
7709
      return sb.toString();
7710
    }
7711
 
3430 rajveer 7712
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7713
      // check for required fields
7714
    }
7715
 
3430 rajveer 7716
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7717
      try {
7718
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7719
      } catch (org.apache.thrift.TException te) {
7720
        throw new java.io.IOException(te);
7721
      }
7722
    }
7723
 
7724
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7725
      try {
7726
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7727
      } catch (org.apache.thrift.TException te) {
7728
        throw new java.io.IOException(te);
7729
      }
7730
    }
7731
 
1982 varun.gupt 7732
  }
7733
 
3430 rajveer 7734
  public static class applyCoupon_args implements org.apache.thrift.TBase<applyCoupon_args, applyCoupon_args._Fields>, java.io.Serializable, Cloneable   {
7735
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_args");
1982 varun.gupt 7736
 
3430 rajveer 7737
    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);
7738
    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 7739
 
3430 rajveer 7740
    private String couponCode; // required
7741
    private long cartId; // required
1982 varun.gupt 7742
 
7743
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7744
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 7745
      COUPON_CODE((short)1, "couponCode"),
7746
      CART_ID((short)2, "cartId");
7747
 
7748
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7749
 
7750
      static {
7751
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7752
          byName.put(field.getFieldName(), field);
7753
        }
7754
      }
7755
 
7756
      /**
7757
       * Find the _Fields constant that matches fieldId, or null if its not found.
7758
       */
7759
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7760
        switch(fieldId) {
7761
          case 1: // COUPON_CODE
7762
            return COUPON_CODE;
7763
          case 2: // CART_ID
7764
            return CART_ID;
7765
          default:
7766
            return null;
7767
        }
1982 varun.gupt 7768
      }
7769
 
7770
      /**
7771
       * Find the _Fields constant that matches fieldId, throwing an exception
7772
       * if it is not found.
7773
       */
7774
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7775
        _Fields fields = findByThriftId(fieldId);
7776
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7777
        return fields;
7778
      }
7779
 
7780
      /**
7781
       * Find the _Fields constant that matches name, or null if its not found.
7782
       */
7783
      public static _Fields findByName(String name) {
7784
        return byName.get(name);
7785
      }
7786
 
7787
      private final short _thriftId;
7788
      private final String _fieldName;
7789
 
7790
      _Fields(short thriftId, String fieldName) {
7791
        _thriftId = thriftId;
7792
        _fieldName = fieldName;
7793
      }
7794
 
7795
      public short getThriftFieldId() {
7796
        return _thriftId;
7797
      }
7798
 
7799
      public String getFieldName() {
7800
        return _fieldName;
7801
      }
7802
    }
7803
 
7804
    // isset id assignments
7805
    private static final int __CARTID_ISSET_ID = 0;
7806
    private BitSet __isset_bit_vector = new BitSet(1);
7807
 
3430 rajveer 7808
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 7809
    static {
3430 rajveer 7810
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7811
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7812
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
7813
      tmpMap.put(_Fields.CART_ID, new org.apache.thrift.meta_data.FieldMetaData("cartId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7814
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7815
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7816
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_args.class, metaDataMap);
1982 varun.gupt 7817
    }
7818
 
7819
    public applyCoupon_args() {
7820
    }
7821
 
7822
    public applyCoupon_args(
7823
      String couponCode,
7824
      long cartId)
7825
    {
7826
      this();
7827
      this.couponCode = couponCode;
7828
      this.cartId = cartId;
7829
      setCartIdIsSet(true);
7830
    }
7831
 
7832
    /**
7833
     * Performs a deep copy on <i>other</i>.
7834
     */
7835
    public applyCoupon_args(applyCoupon_args other) {
7836
      __isset_bit_vector.clear();
7837
      __isset_bit_vector.or(other.__isset_bit_vector);
7838
      if (other.isSetCouponCode()) {
7839
        this.couponCode = other.couponCode;
7840
      }
7841
      this.cartId = other.cartId;
7842
    }
7843
 
7844
    public applyCoupon_args deepCopy() {
7845
      return new applyCoupon_args(this);
7846
    }
7847
 
3430 rajveer 7848
    @Override
7849
    public void clear() {
7850
      this.couponCode = null;
7851
      setCartIdIsSet(false);
7852
      this.cartId = 0;
1982 varun.gupt 7853
    }
7854
 
7855
    public String getCouponCode() {
7856
      return this.couponCode;
7857
    }
7858
 
3430 rajveer 7859
    public void setCouponCode(String couponCode) {
1982 varun.gupt 7860
      this.couponCode = couponCode;
7861
    }
7862
 
7863
    public void unsetCouponCode() {
7864
      this.couponCode = null;
7865
    }
7866
 
3430 rajveer 7867
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7868
    public boolean isSetCouponCode() {
7869
      return this.couponCode != null;
7870
    }
7871
 
7872
    public void setCouponCodeIsSet(boolean value) {
7873
      if (!value) {
7874
        this.couponCode = null;
7875
      }
7876
    }
7877
 
7878
    public long getCartId() {
7879
      return this.cartId;
7880
    }
7881
 
3430 rajveer 7882
    public void setCartId(long cartId) {
1982 varun.gupt 7883
      this.cartId = cartId;
7884
      setCartIdIsSet(true);
7885
    }
7886
 
7887
    public void unsetCartId() {
7888
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
7889
    }
7890
 
3430 rajveer 7891
    /** Returns true if field cartId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7892
    public boolean isSetCartId() {
7893
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
7894
    }
7895
 
7896
    public void setCartIdIsSet(boolean value) {
7897
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
7898
    }
7899
 
7900
    public void setFieldValue(_Fields field, Object value) {
7901
      switch (field) {
7902
      case COUPON_CODE:
7903
        if (value == null) {
7904
          unsetCouponCode();
7905
        } else {
7906
          setCouponCode((String)value);
7907
        }
7908
        break;
7909
 
7910
      case CART_ID:
7911
        if (value == null) {
7912
          unsetCartId();
7913
        } else {
7914
          setCartId((Long)value);
7915
        }
7916
        break;
7917
 
7918
      }
7919
    }
7920
 
7921
    public Object getFieldValue(_Fields field) {
7922
      switch (field) {
7923
      case COUPON_CODE:
7924
        return getCouponCode();
7925
 
7926
      case CART_ID:
3430 rajveer 7927
        return Long.valueOf(getCartId());
1982 varun.gupt 7928
 
7929
      }
7930
      throw new IllegalStateException();
7931
    }
7932
 
3430 rajveer 7933
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7934
    public boolean isSet(_Fields field) {
7935
      if (field == null) {
7936
        throw new IllegalArgumentException();
7937
      }
1982 varun.gupt 7938
 
7939
      switch (field) {
7940
      case COUPON_CODE:
7941
        return isSetCouponCode();
7942
      case CART_ID:
7943
        return isSetCartId();
7944
      }
7945
      throw new IllegalStateException();
7946
    }
7947
 
7948
    @Override
7949
    public boolean equals(Object that) {
7950
      if (that == null)
7951
        return false;
7952
      if (that instanceof applyCoupon_args)
7953
        return this.equals((applyCoupon_args)that);
7954
      return false;
7955
    }
7956
 
7957
    public boolean equals(applyCoupon_args that) {
7958
      if (that == null)
7959
        return false;
7960
 
7961
      boolean this_present_couponCode = true && this.isSetCouponCode();
7962
      boolean that_present_couponCode = true && that.isSetCouponCode();
7963
      if (this_present_couponCode || that_present_couponCode) {
7964
        if (!(this_present_couponCode && that_present_couponCode))
7965
          return false;
7966
        if (!this.couponCode.equals(that.couponCode))
7967
          return false;
7968
      }
7969
 
7970
      boolean this_present_cartId = true;
7971
      boolean that_present_cartId = true;
7972
      if (this_present_cartId || that_present_cartId) {
7973
        if (!(this_present_cartId && that_present_cartId))
7974
          return false;
7975
        if (this.cartId != that.cartId)
7976
          return false;
7977
      }
7978
 
7979
      return true;
7980
    }
7981
 
7982
    @Override
7983
    public int hashCode() {
7984
      return 0;
7985
    }
7986
 
7987
    public int compareTo(applyCoupon_args other) {
7988
      if (!getClass().equals(other.getClass())) {
7989
        return getClass().getName().compareTo(other.getClass().getName());
7990
      }
7991
 
7992
      int lastComparison = 0;
7993
      applyCoupon_args typedOther = (applyCoupon_args)other;
7994
 
3430 rajveer 7995
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 7996
      if (lastComparison != 0) {
7997
        return lastComparison;
7998
      }
3430 rajveer 7999
      if (isSetCouponCode()) {
8000
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
8001
        if (lastComparison != 0) {
8002
          return lastComparison;
8003
        }
1982 varun.gupt 8004
      }
3430 rajveer 8005
      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(typedOther.isSetCartId());
1982 varun.gupt 8006
      if (lastComparison != 0) {
8007
        return lastComparison;
8008
      }
3430 rajveer 8009
      if (isSetCartId()) {
8010
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cartId, typedOther.cartId);
8011
        if (lastComparison != 0) {
8012
          return lastComparison;
8013
        }
1982 varun.gupt 8014
      }
8015
      return 0;
8016
    }
8017
 
3430 rajveer 8018
    public _Fields fieldForId(int fieldId) {
8019
      return _Fields.findByThriftId(fieldId);
8020
    }
8021
 
8022
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8023
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 8024
      iprot.readStructBegin();
8025
      while (true)
8026
      {
8027
        field = iprot.readFieldBegin();
3430 rajveer 8028
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 8029
          break;
8030
        }
3430 rajveer 8031
        switch (field.id) {
8032
          case 1: // COUPON_CODE
8033
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
8034
              this.couponCode = iprot.readString();
8035
            } else { 
8036
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8037
            }
8038
            break;
8039
          case 2: // CART_ID
8040
            if (field.type == org.apache.thrift.protocol.TType.I64) {
8041
              this.cartId = iprot.readI64();
8042
              setCartIdIsSet(true);
8043
            } else { 
8044
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8045
            }
8046
            break;
8047
          default:
8048
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 8049
        }
3430 rajveer 8050
        iprot.readFieldEnd();
1982 varun.gupt 8051
      }
8052
      iprot.readStructEnd();
8053
      validate();
8054
    }
8055
 
3430 rajveer 8056
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 8057
      validate();
8058
 
8059
      oprot.writeStructBegin(STRUCT_DESC);
8060
      if (this.couponCode != null) {
8061
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
8062
        oprot.writeString(this.couponCode);
8063
        oprot.writeFieldEnd();
8064
      }
8065
      oprot.writeFieldBegin(CART_ID_FIELD_DESC);
8066
      oprot.writeI64(this.cartId);
8067
      oprot.writeFieldEnd();
8068
      oprot.writeFieldStop();
8069
      oprot.writeStructEnd();
8070
    }
8071
 
8072
    @Override
8073
    public String toString() {
8074
      StringBuilder sb = new StringBuilder("applyCoupon_args(");
8075
      boolean first = true;
8076
 
8077
      sb.append("couponCode:");
8078
      if (this.couponCode == null) {
8079
        sb.append("null");
8080
      } else {
8081
        sb.append(this.couponCode);
8082
      }
8083
      first = false;
8084
      if (!first) sb.append(", ");
8085
      sb.append("cartId:");
8086
      sb.append(this.cartId);
8087
      first = false;
8088
      sb.append(")");
8089
      return sb.toString();
8090
    }
8091
 
3430 rajveer 8092
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 8093
      // check for required fields
8094
    }
8095
 
3430 rajveer 8096
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8097
      try {
8098
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8099
      } catch (org.apache.thrift.TException te) {
8100
        throw new java.io.IOException(te);
8101
      }
8102
    }
8103
 
8104
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8105
      try {
8106
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
8107
        __isset_bit_vector = new BitSet(1);
8108
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8109
      } catch (org.apache.thrift.TException te) {
8110
        throw new java.io.IOException(te);
8111
      }
8112
    }
8113
 
1982 varun.gupt 8114
  }
8115
 
3430 rajveer 8116
  public static class applyCoupon_result implements org.apache.thrift.TBase<applyCoupon_result, applyCoupon_result._Fields>, java.io.Serializable, Cloneable   {
8117
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_result");
1982 varun.gupt 8118
 
3430 rajveer 8119
    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);
8120
    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 8121
 
3430 rajveer 8122
    private Cart success; // required
8123
    private PromotionException pex; // required
1982 varun.gupt 8124
 
8125
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 8126
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 8127
      SUCCESS((short)0, "success"),
8128
      PEX((short)1, "pex");
8129
 
8130
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8131
 
8132
      static {
8133
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8134
          byName.put(field.getFieldName(), field);
8135
        }
8136
      }
8137
 
8138
      /**
8139
       * Find the _Fields constant that matches fieldId, or null if its not found.
8140
       */
8141
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 8142
        switch(fieldId) {
8143
          case 0: // SUCCESS
8144
            return SUCCESS;
8145
          case 1: // PEX
8146
            return PEX;
8147
          default:
8148
            return null;
8149
        }
1982 varun.gupt 8150
      }
8151
 
8152
      /**
8153
       * Find the _Fields constant that matches fieldId, throwing an exception
8154
       * if it is not found.
8155
       */
8156
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8157
        _Fields fields = findByThriftId(fieldId);
8158
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8159
        return fields;
8160
      }
8161
 
8162
      /**
8163
       * Find the _Fields constant that matches name, or null if its not found.
8164
       */
8165
      public static _Fields findByName(String name) {
8166
        return byName.get(name);
8167
      }
8168
 
8169
      private final short _thriftId;
8170
      private final String _fieldName;
8171
 
8172
      _Fields(short thriftId, String fieldName) {
8173
        _thriftId = thriftId;
8174
        _fieldName = fieldName;
8175
      }
8176
 
8177
      public short getThriftFieldId() {
8178
        return _thriftId;
8179
      }
8180
 
8181
      public String getFieldName() {
8182
        return _fieldName;
8183
      }
8184
    }
8185
 
8186
    // isset id assignments
8187
 
3430 rajveer 8188
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 8189
    static {
3430 rajveer 8190
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8191
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8192
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Cart.class)));
8193
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8194
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
8195
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8196
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_result.class, metaDataMap);
1982 varun.gupt 8197
    }
8198
 
8199
    public applyCoupon_result() {
8200
    }
8201
 
8202
    public applyCoupon_result(
8203
      Cart success,
8204
      PromotionException pex)
8205
    {
8206
      this();
8207
      this.success = success;
8208
      this.pex = pex;
8209
    }
8210
 
8211
    /**
8212
     * Performs a deep copy on <i>other</i>.
8213
     */
8214
    public applyCoupon_result(applyCoupon_result other) {
8215
      if (other.isSetSuccess()) {
8216
        this.success = new Cart(other.success);
8217
      }
8218
      if (other.isSetPex()) {
8219
        this.pex = new PromotionException(other.pex);
8220
      }
8221
    }
8222
 
8223
    public applyCoupon_result deepCopy() {
8224
      return new applyCoupon_result(this);
8225
    }
8226
 
3430 rajveer 8227
    @Override
8228
    public void clear() {
8229
      this.success = null;
8230
      this.pex = null;
1982 varun.gupt 8231
    }
8232
 
8233
    public Cart getSuccess() {
8234
      return this.success;
8235
    }
8236
 
3430 rajveer 8237
    public void setSuccess(Cart success) {
1982 varun.gupt 8238
      this.success = success;
8239
    }
8240
 
8241
    public void unsetSuccess() {
8242
      this.success = null;
8243
    }
8244
 
3430 rajveer 8245
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 8246
    public boolean isSetSuccess() {
8247
      return this.success != null;
8248
    }
8249
 
8250
    public void setSuccessIsSet(boolean value) {
8251
      if (!value) {
8252
        this.success = null;
8253
      }
8254
    }
8255
 
8256
    public PromotionException getPex() {
8257
      return this.pex;
8258
    }
8259
 
3430 rajveer 8260
    public void setPex(PromotionException pex) {
1982 varun.gupt 8261
      this.pex = pex;
8262
    }
8263
 
8264
    public void unsetPex() {
8265
      this.pex = null;
8266
    }
8267
 
3430 rajveer 8268
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 8269
    public boolean isSetPex() {
8270
      return this.pex != null;
8271
    }
8272
 
8273
    public void setPexIsSet(boolean value) {
8274
      if (!value) {
8275
        this.pex = null;
8276
      }
8277
    }
8278
 
8279
    public void setFieldValue(_Fields field, Object value) {
8280
      switch (field) {
8281
      case SUCCESS:
8282
        if (value == null) {
8283
          unsetSuccess();
8284
        } else {
8285
          setSuccess((Cart)value);
8286
        }
8287
        break;
8288
 
8289
      case PEX:
8290
        if (value == null) {
8291
          unsetPex();
8292
        } else {
8293
          setPex((PromotionException)value);
8294
        }
8295
        break;
8296
 
8297
      }
8298
    }
8299
 
8300
    public Object getFieldValue(_Fields field) {
8301
      switch (field) {
8302
      case SUCCESS:
8303
        return getSuccess();
8304
 
8305
      case PEX:
8306
        return getPex();
8307
 
8308
      }
8309
      throw new IllegalStateException();
8310
    }
8311
 
3430 rajveer 8312
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8313
    public boolean isSet(_Fields field) {
8314
      if (field == null) {
8315
        throw new IllegalArgumentException();
8316
      }
1982 varun.gupt 8317
 
8318
      switch (field) {
8319
      case SUCCESS:
8320
        return isSetSuccess();
8321
      case PEX:
8322
        return isSetPex();
8323
      }
8324
      throw new IllegalStateException();
8325
    }
8326
 
8327
    @Override
8328
    public boolean equals(Object that) {
8329
      if (that == null)
8330
        return false;
8331
      if (that instanceof applyCoupon_result)
8332
        return this.equals((applyCoupon_result)that);
8333
      return false;
8334
    }
8335
 
8336
    public boolean equals(applyCoupon_result that) {
8337
      if (that == null)
8338
        return false;
8339
 
8340
      boolean this_present_success = true && this.isSetSuccess();
8341
      boolean that_present_success = true && that.isSetSuccess();
8342
      if (this_present_success || that_present_success) {
8343
        if (!(this_present_success && that_present_success))
8344
          return false;
8345
        if (!this.success.equals(that.success))
8346
          return false;
8347
      }
8348
 
8349
      boolean this_present_pex = true && this.isSetPex();
8350
      boolean that_present_pex = true && that.isSetPex();
8351
      if (this_present_pex || that_present_pex) {
8352
        if (!(this_present_pex && that_present_pex))
8353
          return false;
8354
        if (!this.pex.equals(that.pex))
8355
          return false;
8356
      }
8357
 
8358
      return true;
8359
    }
8360
 
8361
    @Override
8362
    public int hashCode() {
8363
      return 0;
8364
    }
8365
 
8366
    public int compareTo(applyCoupon_result other) {
8367
      if (!getClass().equals(other.getClass())) {
8368
        return getClass().getName().compareTo(other.getClass().getName());
8369
      }
8370
 
8371
      int lastComparison = 0;
8372
      applyCoupon_result typedOther = (applyCoupon_result)other;
8373
 
3430 rajveer 8374
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 8375
      if (lastComparison != 0) {
8376
        return lastComparison;
8377
      }
3430 rajveer 8378
      if (isSetSuccess()) {
8379
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
8380
        if (lastComparison != 0) {
8381
          return lastComparison;
8382
        }
1982 varun.gupt 8383
      }
3430 rajveer 8384
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 8385
      if (lastComparison != 0) {
8386
        return lastComparison;
8387
      }
3430 rajveer 8388
      if (isSetPex()) {
8389
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
8390
        if (lastComparison != 0) {
8391
          return lastComparison;
8392
        }
1982 varun.gupt 8393
      }
8394
      return 0;
8395
    }
8396
 
3430 rajveer 8397
    public _Fields fieldForId(int fieldId) {
8398
      return _Fields.findByThriftId(fieldId);
8399
    }
8400
 
8401
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8402
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 8403
      iprot.readStructBegin();
8404
      while (true)
8405
      {
8406
        field = iprot.readFieldBegin();
3430 rajveer 8407
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 8408
          break;
8409
        }
3430 rajveer 8410
        switch (field.id) {
8411
          case 0: // SUCCESS
8412
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
8413
              this.success = new Cart();
8414
              this.success.read(iprot);
8415
            } else { 
8416
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8417
            }
8418
            break;
8419
          case 1: // PEX
8420
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
8421
              this.pex = new PromotionException();
8422
              this.pex.read(iprot);
8423
            } else { 
8424
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8425
            }
8426
            break;
8427
          default:
8428
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 8429
        }
3430 rajveer 8430
        iprot.readFieldEnd();
1982 varun.gupt 8431
      }
8432
      iprot.readStructEnd();
8433
      validate();
8434
    }
8435
 
3430 rajveer 8436
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 8437
      oprot.writeStructBegin(STRUCT_DESC);
8438
 
8439
      if (this.isSetSuccess()) {
8440
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
8441
        this.success.write(oprot);
8442
        oprot.writeFieldEnd();
8443
      } else if (this.isSetPex()) {
8444
        oprot.writeFieldBegin(PEX_FIELD_DESC);
8445
        this.pex.write(oprot);
8446
        oprot.writeFieldEnd();
8447
      }
8448
      oprot.writeFieldStop();
8449
      oprot.writeStructEnd();
8450
    }
8451
 
8452
    @Override
8453
    public String toString() {
8454
      StringBuilder sb = new StringBuilder("applyCoupon_result(");
8455
      boolean first = true;
8456
 
8457
      sb.append("success:");
8458
      if (this.success == null) {
8459
        sb.append("null");
8460
      } else {
8461
        sb.append(this.success);
8462
      }
8463
      first = false;
8464
      if (!first) sb.append(", ");
8465
      sb.append("pex:");
8466
      if (this.pex == null) {
8467
        sb.append("null");
8468
      } else {
8469
        sb.append(this.pex);
8470
      }
8471
      first = false;
8472
      sb.append(")");
8473
      return sb.toString();
8474
    }
8475
 
3430 rajveer 8476
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 8477
      // check for required fields
8478
    }
8479
 
3430 rajveer 8480
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8481
      try {
8482
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8483
      } catch (org.apache.thrift.TException te) {
8484
        throw new java.io.IOException(te);
8485
      }
8486
    }
8487
 
8488
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8489
      try {
8490
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8491
      } catch (org.apache.thrift.TException te) {
8492
        throw new java.io.IOException(te);
8493
      }
8494
    }
8495
 
1982 varun.gupt 8496
  }
8497
 
6736 amit.gupta 8498
  public static class getEmiDiscount_args implements org.apache.thrift.TBase<getEmiDiscount_args, getEmiDiscount_args._Fields>, java.io.Serializable, Cloneable   {
8499
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getEmiDiscount_args");
8500
 
8501
    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)1);
8502
 
8503
    private long cartId; // required
8504
 
8505
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8506
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
8507
      CART_ID((short)1, "cartId");
8508
 
8509
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8510
 
8511
      static {
8512
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8513
          byName.put(field.getFieldName(), field);
8514
        }
8515
      }
8516
 
8517
      /**
8518
       * Find the _Fields constant that matches fieldId, or null if its not found.
8519
       */
8520
      public static _Fields findByThriftId(int fieldId) {
8521
        switch(fieldId) {
8522
          case 1: // CART_ID
8523
            return CART_ID;
8524
          default:
8525
            return null;
8526
        }
8527
      }
8528
 
8529
      /**
8530
       * Find the _Fields constant that matches fieldId, throwing an exception
8531
       * if it is not found.
8532
       */
8533
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8534
        _Fields fields = findByThriftId(fieldId);
8535
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8536
        return fields;
8537
      }
8538
 
8539
      /**
8540
       * Find the _Fields constant that matches name, or null if its not found.
8541
       */
8542
      public static _Fields findByName(String name) {
8543
        return byName.get(name);
8544
      }
8545
 
8546
      private final short _thriftId;
8547
      private final String _fieldName;
8548
 
8549
      _Fields(short thriftId, String fieldName) {
8550
        _thriftId = thriftId;
8551
        _fieldName = fieldName;
8552
      }
8553
 
8554
      public short getThriftFieldId() {
8555
        return _thriftId;
8556
      }
8557
 
8558
      public String getFieldName() {
8559
        return _fieldName;
8560
      }
8561
    }
8562
 
8563
    // isset id assignments
8564
    private static final int __CARTID_ISSET_ID = 0;
8565
    private BitSet __isset_bit_vector = new BitSet(1);
8566
 
8567
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
8568
    static {
8569
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8570
      tmpMap.put(_Fields.CART_ID, new org.apache.thrift.meta_data.FieldMetaData("cartId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8571
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8572
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8573
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getEmiDiscount_args.class, metaDataMap);
8574
    }
8575
 
8576
    public getEmiDiscount_args() {
8577
    }
8578
 
8579
    public getEmiDiscount_args(
8580
      long cartId)
8581
    {
8582
      this();
8583
      this.cartId = cartId;
8584
      setCartIdIsSet(true);
8585
    }
8586
 
8587
    /**
8588
     * Performs a deep copy on <i>other</i>.
8589
     */
8590
    public getEmiDiscount_args(getEmiDiscount_args other) {
8591
      __isset_bit_vector.clear();
8592
      __isset_bit_vector.or(other.__isset_bit_vector);
8593
      this.cartId = other.cartId;
8594
    }
8595
 
8596
    public getEmiDiscount_args deepCopy() {
8597
      return new getEmiDiscount_args(this);
8598
    }
8599
 
8600
    @Override
8601
    public void clear() {
8602
      setCartIdIsSet(false);
8603
      this.cartId = 0;
8604
    }
8605
 
8606
    public long getCartId() {
8607
      return this.cartId;
8608
    }
8609
 
8610
    public void setCartId(long cartId) {
8611
      this.cartId = cartId;
8612
      setCartIdIsSet(true);
8613
    }
8614
 
8615
    public void unsetCartId() {
8616
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
8617
    }
8618
 
8619
    /** Returns true if field cartId is set (has been assigned a value) and false otherwise */
8620
    public boolean isSetCartId() {
8621
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
8622
    }
8623
 
8624
    public void setCartIdIsSet(boolean value) {
8625
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
8626
    }
8627
 
8628
    public void setFieldValue(_Fields field, Object value) {
8629
      switch (field) {
8630
      case CART_ID:
8631
        if (value == null) {
8632
          unsetCartId();
8633
        } else {
8634
          setCartId((Long)value);
8635
        }
8636
        break;
8637
 
8638
      }
8639
    }
8640
 
8641
    public Object getFieldValue(_Fields field) {
8642
      switch (field) {
8643
      case CART_ID:
8644
        return Long.valueOf(getCartId());
8645
 
8646
      }
8647
      throw new IllegalStateException();
8648
    }
8649
 
8650
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8651
    public boolean isSet(_Fields field) {
8652
      if (field == null) {
8653
        throw new IllegalArgumentException();
8654
      }
8655
 
8656
      switch (field) {
8657
      case CART_ID:
8658
        return isSetCartId();
8659
      }
8660
      throw new IllegalStateException();
8661
    }
8662
 
8663
    @Override
8664
    public boolean equals(Object that) {
8665
      if (that == null)
8666
        return false;
8667
      if (that instanceof getEmiDiscount_args)
8668
        return this.equals((getEmiDiscount_args)that);
8669
      return false;
8670
    }
8671
 
8672
    public boolean equals(getEmiDiscount_args that) {
8673
      if (that == null)
8674
        return false;
8675
 
8676
      boolean this_present_cartId = true;
8677
      boolean that_present_cartId = true;
8678
      if (this_present_cartId || that_present_cartId) {
8679
        if (!(this_present_cartId && that_present_cartId))
8680
          return false;
8681
        if (this.cartId != that.cartId)
8682
          return false;
8683
      }
8684
 
8685
      return true;
8686
    }
8687
 
8688
    @Override
8689
    public int hashCode() {
8690
      return 0;
8691
    }
8692
 
8693
    public int compareTo(getEmiDiscount_args other) {
8694
      if (!getClass().equals(other.getClass())) {
8695
        return getClass().getName().compareTo(other.getClass().getName());
8696
      }
8697
 
8698
      int lastComparison = 0;
8699
      getEmiDiscount_args typedOther = (getEmiDiscount_args)other;
8700
 
8701
      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(typedOther.isSetCartId());
8702
      if (lastComparison != 0) {
8703
        return lastComparison;
8704
      }
8705
      if (isSetCartId()) {
8706
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cartId, typedOther.cartId);
8707
        if (lastComparison != 0) {
8708
          return lastComparison;
8709
        }
8710
      }
8711
      return 0;
8712
    }
8713
 
8714
    public _Fields fieldForId(int fieldId) {
8715
      return _Fields.findByThriftId(fieldId);
8716
    }
8717
 
8718
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8719
      org.apache.thrift.protocol.TField field;
8720
      iprot.readStructBegin();
8721
      while (true)
8722
      {
8723
        field = iprot.readFieldBegin();
8724
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
8725
          break;
8726
        }
8727
        switch (field.id) {
8728
          case 1: // CART_ID
8729
            if (field.type == org.apache.thrift.protocol.TType.I64) {
8730
              this.cartId = iprot.readI64();
8731
              setCartIdIsSet(true);
8732
            } else { 
8733
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8734
            }
8735
            break;
8736
          default:
8737
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8738
        }
8739
        iprot.readFieldEnd();
8740
      }
8741
      iprot.readStructEnd();
8742
      validate();
8743
    }
8744
 
8745
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
8746
      validate();
8747
 
8748
      oprot.writeStructBegin(STRUCT_DESC);
8749
      oprot.writeFieldBegin(CART_ID_FIELD_DESC);
8750
      oprot.writeI64(this.cartId);
8751
      oprot.writeFieldEnd();
8752
      oprot.writeFieldStop();
8753
      oprot.writeStructEnd();
8754
    }
8755
 
8756
    @Override
8757
    public String toString() {
8758
      StringBuilder sb = new StringBuilder("getEmiDiscount_args(");
8759
      boolean first = true;
8760
 
8761
      sb.append("cartId:");
8762
      sb.append(this.cartId);
8763
      first = false;
8764
      sb.append(")");
8765
      return sb.toString();
8766
    }
8767
 
8768
    public void validate() throws org.apache.thrift.TException {
8769
      // check for required fields
8770
    }
8771
 
8772
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8773
      try {
8774
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8775
      } catch (org.apache.thrift.TException te) {
8776
        throw new java.io.IOException(te);
8777
      }
8778
    }
8779
 
8780
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8781
      try {
8782
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
8783
        __isset_bit_vector = new BitSet(1);
8784
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8785
      } catch (org.apache.thrift.TException te) {
8786
        throw new java.io.IOException(te);
8787
      }
8788
    }
8789
 
8790
  }
8791
 
8792
  public static class getEmiDiscount_result implements org.apache.thrift.TBase<getEmiDiscount_result, getEmiDiscount_result._Fields>, java.io.Serializable, Cloneable   {
8793
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getEmiDiscount_result");
8794
 
8795
    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);
8796
    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);
8797
 
8798
    private Map<Long,Double> success; // required
8799
    private PromotionException pex; // required
8800
 
8801
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8802
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
8803
      SUCCESS((short)0, "success"),
8804
      PEX((short)1, "pex");
8805
 
8806
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8807
 
8808
      static {
8809
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8810
          byName.put(field.getFieldName(), field);
8811
        }
8812
      }
8813
 
8814
      /**
8815
       * Find the _Fields constant that matches fieldId, or null if its not found.
8816
       */
8817
      public static _Fields findByThriftId(int fieldId) {
8818
        switch(fieldId) {
8819
          case 0: // SUCCESS
8820
            return SUCCESS;
8821
          case 1: // PEX
8822
            return PEX;
8823
          default:
8824
            return null;
8825
        }
8826
      }
8827
 
8828
      /**
8829
       * Find the _Fields constant that matches fieldId, throwing an exception
8830
       * if it is not found.
8831
       */
8832
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8833
        _Fields fields = findByThriftId(fieldId);
8834
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8835
        return fields;
8836
      }
8837
 
8838
      /**
8839
       * Find the _Fields constant that matches name, or null if its not found.
8840
       */
8841
      public static _Fields findByName(String name) {
8842
        return byName.get(name);
8843
      }
8844
 
8845
      private final short _thriftId;
8846
      private final String _fieldName;
8847
 
8848
      _Fields(short thriftId, String fieldName) {
8849
        _thriftId = thriftId;
8850
        _fieldName = fieldName;
8851
      }
8852
 
8853
      public short getThriftFieldId() {
8854
        return _thriftId;
8855
      }
8856
 
8857
      public String getFieldName() {
8858
        return _fieldName;
8859
      }
8860
    }
8861
 
8862
    // isset id assignments
8863
 
8864
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
8865
    static {
8866
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8867
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8868
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
8869
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), 
8870
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
8871
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8872
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
8873
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8874
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getEmiDiscount_result.class, metaDataMap);
8875
    }
8876
 
8877
    public getEmiDiscount_result() {
8878
    }
8879
 
8880
    public getEmiDiscount_result(
8881
      Map<Long,Double> success,
8882
      PromotionException pex)
8883
    {
8884
      this();
8885
      this.success = success;
8886
      this.pex = pex;
8887
    }
8888
 
8889
    /**
8890
     * Performs a deep copy on <i>other</i>.
8891
     */
8892
    public getEmiDiscount_result(getEmiDiscount_result other) {
8893
      if (other.isSetSuccess()) {
8894
        Map<Long,Double> __this__success = new HashMap<Long,Double>();
8895
        for (Map.Entry<Long, Double> other_element : other.success.entrySet()) {
8896
 
8897
          Long other_element_key = other_element.getKey();
8898
          Double other_element_value = other_element.getValue();
8899
 
8900
          Long __this__success_copy_key = other_element_key;
8901
 
8902
          Double __this__success_copy_value = other_element_value;
8903
 
8904
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
8905
        }
8906
        this.success = __this__success;
8907
      }
8908
      if (other.isSetPex()) {
8909
        this.pex = new PromotionException(other.pex);
8910
      }
8911
    }
8912
 
8913
    public getEmiDiscount_result deepCopy() {
8914
      return new getEmiDiscount_result(this);
8915
    }
8916
 
8917
    @Override
8918
    public void clear() {
8919
      this.success = null;
8920
      this.pex = null;
8921
    }
8922
 
8923
    public int getSuccessSize() {
8924
      return (this.success == null) ? 0 : this.success.size();
8925
    }
8926
 
8927
    public void putToSuccess(long key, double val) {
8928
      if (this.success == null) {
8929
        this.success = new HashMap<Long,Double>();
8930
      }
8931
      this.success.put(key, val);
8932
    }
8933
 
8934
    public Map<Long,Double> getSuccess() {
8935
      return this.success;
8936
    }
8937
 
8938
    public void setSuccess(Map<Long,Double> success) {
8939
      this.success = success;
8940
    }
8941
 
8942
    public void unsetSuccess() {
8943
      this.success = null;
8944
    }
8945
 
8946
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
8947
    public boolean isSetSuccess() {
8948
      return this.success != null;
8949
    }
8950
 
8951
    public void setSuccessIsSet(boolean value) {
8952
      if (!value) {
8953
        this.success = null;
8954
      }
8955
    }
8956
 
8957
    public PromotionException getPex() {
8958
      return this.pex;
8959
    }
8960
 
8961
    public void setPex(PromotionException pex) {
8962
      this.pex = pex;
8963
    }
8964
 
8965
    public void unsetPex() {
8966
      this.pex = null;
8967
    }
8968
 
8969
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
8970
    public boolean isSetPex() {
8971
      return this.pex != null;
8972
    }
8973
 
8974
    public void setPexIsSet(boolean value) {
8975
      if (!value) {
8976
        this.pex = null;
8977
      }
8978
    }
8979
 
8980
    public void setFieldValue(_Fields field, Object value) {
8981
      switch (field) {
8982
      case SUCCESS:
8983
        if (value == null) {
8984
          unsetSuccess();
8985
        } else {
8986
          setSuccess((Map<Long,Double>)value);
8987
        }
8988
        break;
8989
 
8990
      case PEX:
8991
        if (value == null) {
8992
          unsetPex();
8993
        } else {
8994
          setPex((PromotionException)value);
8995
        }
8996
        break;
8997
 
8998
      }
8999
    }
9000
 
9001
    public Object getFieldValue(_Fields field) {
9002
      switch (field) {
9003
      case SUCCESS:
9004
        return getSuccess();
9005
 
9006
      case PEX:
9007
        return getPex();
9008
 
9009
      }
9010
      throw new IllegalStateException();
9011
    }
9012
 
9013
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9014
    public boolean isSet(_Fields field) {
9015
      if (field == null) {
9016
        throw new IllegalArgumentException();
9017
      }
9018
 
9019
      switch (field) {
9020
      case SUCCESS:
9021
        return isSetSuccess();
9022
      case PEX:
9023
        return isSetPex();
9024
      }
9025
      throw new IllegalStateException();
9026
    }
9027
 
9028
    @Override
9029
    public boolean equals(Object that) {
9030
      if (that == null)
9031
        return false;
9032
      if (that instanceof getEmiDiscount_result)
9033
        return this.equals((getEmiDiscount_result)that);
9034
      return false;
9035
    }
9036
 
9037
    public boolean equals(getEmiDiscount_result that) {
9038
      if (that == null)
9039
        return false;
9040
 
9041
      boolean this_present_success = true && this.isSetSuccess();
9042
      boolean that_present_success = true && that.isSetSuccess();
9043
      if (this_present_success || that_present_success) {
9044
        if (!(this_present_success && that_present_success))
9045
          return false;
9046
        if (!this.success.equals(that.success))
9047
          return false;
9048
      }
9049
 
9050
      boolean this_present_pex = true && this.isSetPex();
9051
      boolean that_present_pex = true && that.isSetPex();
9052
      if (this_present_pex || that_present_pex) {
9053
        if (!(this_present_pex && that_present_pex))
9054
          return false;
9055
        if (!this.pex.equals(that.pex))
9056
          return false;
9057
      }
9058
 
9059
      return true;
9060
    }
9061
 
9062
    @Override
9063
    public int hashCode() {
9064
      return 0;
9065
    }
9066
 
9067
    public int compareTo(getEmiDiscount_result other) {
9068
      if (!getClass().equals(other.getClass())) {
9069
        return getClass().getName().compareTo(other.getClass().getName());
9070
      }
9071
 
9072
      int lastComparison = 0;
9073
      getEmiDiscount_result typedOther = (getEmiDiscount_result)other;
9074
 
9075
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
9076
      if (lastComparison != 0) {
9077
        return lastComparison;
9078
      }
9079
      if (isSetSuccess()) {
9080
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
9081
        if (lastComparison != 0) {
9082
          return lastComparison;
9083
        }
9084
      }
9085
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
9086
      if (lastComparison != 0) {
9087
        return lastComparison;
9088
      }
9089
      if (isSetPex()) {
9090
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
9091
        if (lastComparison != 0) {
9092
          return lastComparison;
9093
        }
9094
      }
9095
      return 0;
9096
    }
9097
 
9098
    public _Fields fieldForId(int fieldId) {
9099
      return _Fields.findByThriftId(fieldId);
9100
    }
9101
 
9102
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9103
      org.apache.thrift.protocol.TField field;
9104
      iprot.readStructBegin();
9105
      while (true)
9106
      {
9107
        field = iprot.readFieldBegin();
9108
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
9109
          break;
9110
        }
9111
        switch (field.id) {
9112
          case 0: // SUCCESS
9113
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
9114
              {
11592 amit.gupta 9115
                org.apache.thrift.protocol.TMap _map20 = iprot.readMapBegin();
9116
                this.success = new HashMap<Long,Double>(2*_map20.size);
9117
                for (int _i21 = 0; _i21 < _map20.size; ++_i21)
6736 amit.gupta 9118
                {
11592 amit.gupta 9119
                  long _key22; // required
9120
                  double _val23; // required
9121
                  _key22 = iprot.readI64();
9122
                  _val23 = iprot.readDouble();
9123
                  this.success.put(_key22, _val23);
6736 amit.gupta 9124
                }
9125
                iprot.readMapEnd();
9126
              }
9127
            } else { 
9128
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9129
            }
9130
            break;
9131
          case 1: // PEX
9132
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
9133
              this.pex = new PromotionException();
9134
              this.pex.read(iprot);
9135
            } else { 
9136
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9137
            }
9138
            break;
9139
          default:
9140
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9141
        }
9142
        iprot.readFieldEnd();
9143
      }
9144
      iprot.readStructEnd();
9145
      validate();
9146
    }
9147
 
9148
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
9149
      oprot.writeStructBegin(STRUCT_DESC);
9150
 
9151
      if (this.isSetSuccess()) {
9152
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
9153
        {
9154
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.DOUBLE, this.success.size()));
11592 amit.gupta 9155
          for (Map.Entry<Long, Double> _iter24 : this.success.entrySet())
6736 amit.gupta 9156
          {
11592 amit.gupta 9157
            oprot.writeI64(_iter24.getKey());
9158
            oprot.writeDouble(_iter24.getValue());
6736 amit.gupta 9159
          }
9160
          oprot.writeMapEnd();
9161
        }
9162
        oprot.writeFieldEnd();
9163
      } else if (this.isSetPex()) {
9164
        oprot.writeFieldBegin(PEX_FIELD_DESC);
9165
        this.pex.write(oprot);
9166
        oprot.writeFieldEnd();
9167
      }
9168
      oprot.writeFieldStop();
9169
      oprot.writeStructEnd();
9170
    }
9171
 
9172
    @Override
9173
    public String toString() {
9174
      StringBuilder sb = new StringBuilder("getEmiDiscount_result(");
9175
      boolean first = true;
9176
 
9177
      sb.append("success:");
9178
      if (this.success == null) {
9179
        sb.append("null");
9180
      } else {
9181
        sb.append(this.success);
9182
      }
9183
      first = false;
9184
      if (!first) sb.append(", ");
9185
      sb.append("pex:");
9186
      if (this.pex == null) {
9187
        sb.append("null");
9188
      } else {
9189
        sb.append(this.pex);
9190
      }
9191
      first = false;
9192
      sb.append(")");
9193
      return sb.toString();
9194
    }
9195
 
9196
    public void validate() throws org.apache.thrift.TException {
9197
      // check for required fields
9198
    }
9199
 
9200
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9201
      try {
9202
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9203
      } catch (org.apache.thrift.TException te) {
9204
        throw new java.io.IOException(te);
9205
      }
9206
    }
9207
 
9208
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9209
      try {
9210
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9211
      } catch (org.apache.thrift.TException te) {
9212
        throw new java.io.IOException(te);
9213
      }
9214
    }
9215
 
9216
  }
9217
 
6433 anupam.sin 9218
  public static class applyRechargeCoupon_args implements org.apache.thrift.TBase<applyRechargeCoupon_args, applyRechargeCoupon_args._Fields>, java.io.Serializable, Cloneable   {
9219
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyRechargeCoupon_args");
9220
 
9221
    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);
9222
    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);
9223
    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);
9224
 
9225
    private String couponCode; // required
9226
    private long totalAmount; // required
9227
    private long userId; // required
9228
 
9229
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9230
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
9231
      COUPON_CODE((short)1, "couponCode"),
9232
      TOTAL_AMOUNT((short)2, "totalAmount"),
9233
      USER_ID((short)3, "userId");
9234
 
9235
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9236
 
9237
      static {
9238
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9239
          byName.put(field.getFieldName(), field);
9240
        }
9241
      }
9242
 
9243
      /**
9244
       * Find the _Fields constant that matches fieldId, or null if its not found.
9245
       */
9246
      public static _Fields findByThriftId(int fieldId) {
9247
        switch(fieldId) {
9248
          case 1: // COUPON_CODE
9249
            return COUPON_CODE;
9250
          case 2: // TOTAL_AMOUNT
9251
            return TOTAL_AMOUNT;
9252
          case 3: // USER_ID
9253
            return USER_ID;
9254
          default:
9255
            return null;
9256
        }
9257
      }
9258
 
9259
      /**
9260
       * Find the _Fields constant that matches fieldId, throwing an exception
9261
       * if it is not found.
9262
       */
9263
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9264
        _Fields fields = findByThriftId(fieldId);
9265
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9266
        return fields;
9267
      }
9268
 
9269
      /**
9270
       * Find the _Fields constant that matches name, or null if its not found.
9271
       */
9272
      public static _Fields findByName(String name) {
9273
        return byName.get(name);
9274
      }
9275
 
9276
      private final short _thriftId;
9277
      private final String _fieldName;
9278
 
9279
      _Fields(short thriftId, String fieldName) {
9280
        _thriftId = thriftId;
9281
        _fieldName = fieldName;
9282
      }
9283
 
9284
      public short getThriftFieldId() {
9285
        return _thriftId;
9286
      }
9287
 
9288
      public String getFieldName() {
9289
        return _fieldName;
9290
      }
9291
    }
9292
 
9293
    // isset id assignments
9294
    private static final int __TOTALAMOUNT_ISSET_ID = 0;
9295
    private static final int __USERID_ISSET_ID = 1;
9296
    private BitSet __isset_bit_vector = new BitSet(2);
9297
 
9298
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
9299
    static {
9300
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9301
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9302
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
9303
      tmpMap.put(_Fields.TOTAL_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("totalAmount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9304
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9305
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9306
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9307
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9308
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyRechargeCoupon_args.class, metaDataMap);
9309
    }
9310
 
9311
    public applyRechargeCoupon_args() {
9312
    }
9313
 
9314
    public applyRechargeCoupon_args(
9315
      String couponCode,
9316
      long totalAmount,
9317
      long userId)
9318
    {
9319
      this();
9320
      this.couponCode = couponCode;
9321
      this.totalAmount = totalAmount;
9322
      setTotalAmountIsSet(true);
9323
      this.userId = userId;
9324
      setUserIdIsSet(true);
9325
    }
9326
 
9327
    /**
9328
     * Performs a deep copy on <i>other</i>.
9329
     */
9330
    public applyRechargeCoupon_args(applyRechargeCoupon_args other) {
9331
      __isset_bit_vector.clear();
9332
      __isset_bit_vector.or(other.__isset_bit_vector);
9333
      if (other.isSetCouponCode()) {
9334
        this.couponCode = other.couponCode;
9335
      }
9336
      this.totalAmount = other.totalAmount;
9337
      this.userId = other.userId;
9338
    }
9339
 
9340
    public applyRechargeCoupon_args deepCopy() {
9341
      return new applyRechargeCoupon_args(this);
9342
    }
9343
 
9344
    @Override
9345
    public void clear() {
9346
      this.couponCode = null;
9347
      setTotalAmountIsSet(false);
9348
      this.totalAmount = 0;
9349
      setUserIdIsSet(false);
9350
      this.userId = 0;
9351
    }
9352
 
9353
    public String getCouponCode() {
9354
      return this.couponCode;
9355
    }
9356
 
9357
    public void setCouponCode(String couponCode) {
9358
      this.couponCode = couponCode;
9359
    }
9360
 
9361
    public void unsetCouponCode() {
9362
      this.couponCode = null;
9363
    }
9364
 
9365
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
9366
    public boolean isSetCouponCode() {
9367
      return this.couponCode != null;
9368
    }
9369
 
9370
    public void setCouponCodeIsSet(boolean value) {
9371
      if (!value) {
9372
        this.couponCode = null;
9373
      }
9374
    }
9375
 
9376
    public long getTotalAmount() {
9377
      return this.totalAmount;
9378
    }
9379
 
9380
    public void setTotalAmount(long totalAmount) {
9381
      this.totalAmount = totalAmount;
9382
      setTotalAmountIsSet(true);
9383
    }
9384
 
9385
    public void unsetTotalAmount() {
9386
      __isset_bit_vector.clear(__TOTALAMOUNT_ISSET_ID);
9387
    }
9388
 
9389
    /** Returns true if field totalAmount is set (has been assigned a value) and false otherwise */
9390
    public boolean isSetTotalAmount() {
9391
      return __isset_bit_vector.get(__TOTALAMOUNT_ISSET_ID);
9392
    }
9393
 
9394
    public void setTotalAmountIsSet(boolean value) {
9395
      __isset_bit_vector.set(__TOTALAMOUNT_ISSET_ID, value);
9396
    }
9397
 
9398
    public long getUserId() {
9399
      return this.userId;
9400
    }
9401
 
9402
    public void setUserId(long userId) {
9403
      this.userId = userId;
9404
      setUserIdIsSet(true);
9405
    }
9406
 
9407
    public void unsetUserId() {
9408
      __isset_bit_vector.clear(__USERID_ISSET_ID);
9409
    }
9410
 
9411
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
9412
    public boolean isSetUserId() {
9413
      return __isset_bit_vector.get(__USERID_ISSET_ID);
9414
    }
9415
 
9416
    public void setUserIdIsSet(boolean value) {
9417
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
9418
    }
9419
 
9420
    public void setFieldValue(_Fields field, Object value) {
9421
      switch (field) {
9422
      case COUPON_CODE:
9423
        if (value == null) {
9424
          unsetCouponCode();
9425
        } else {
9426
          setCouponCode((String)value);
9427
        }
9428
        break;
9429
 
9430
      case TOTAL_AMOUNT:
9431
        if (value == null) {
9432
          unsetTotalAmount();
9433
        } else {
9434
          setTotalAmount((Long)value);
9435
        }
9436
        break;
9437
 
9438
      case USER_ID:
9439
        if (value == null) {
9440
          unsetUserId();
9441
        } else {
9442
          setUserId((Long)value);
9443
        }
9444
        break;
9445
 
9446
      }
9447
    }
9448
 
9449
    public Object getFieldValue(_Fields field) {
9450
      switch (field) {
9451
      case COUPON_CODE:
9452
        return getCouponCode();
9453
 
9454
      case TOTAL_AMOUNT:
9455
        return Long.valueOf(getTotalAmount());
9456
 
9457
      case USER_ID:
9458
        return Long.valueOf(getUserId());
9459
 
9460
      }
9461
      throw new IllegalStateException();
9462
    }
9463
 
9464
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9465
    public boolean isSet(_Fields field) {
9466
      if (field == null) {
9467
        throw new IllegalArgumentException();
9468
      }
9469
 
9470
      switch (field) {
9471
      case COUPON_CODE:
9472
        return isSetCouponCode();
9473
      case TOTAL_AMOUNT:
9474
        return isSetTotalAmount();
9475
      case USER_ID:
9476
        return isSetUserId();
9477
      }
9478
      throw new IllegalStateException();
9479
    }
9480
 
9481
    @Override
9482
    public boolean equals(Object that) {
9483
      if (that == null)
9484
        return false;
9485
      if (that instanceof applyRechargeCoupon_args)
9486
        return this.equals((applyRechargeCoupon_args)that);
9487
      return false;
9488
    }
9489
 
9490
    public boolean equals(applyRechargeCoupon_args that) {
9491
      if (that == null)
9492
        return false;
9493
 
9494
      boolean this_present_couponCode = true && this.isSetCouponCode();
9495
      boolean that_present_couponCode = true && that.isSetCouponCode();
9496
      if (this_present_couponCode || that_present_couponCode) {
9497
        if (!(this_present_couponCode && that_present_couponCode))
9498
          return false;
9499
        if (!this.couponCode.equals(that.couponCode))
9500
          return false;
9501
      }
9502
 
9503
      boolean this_present_totalAmount = true;
9504
      boolean that_present_totalAmount = true;
9505
      if (this_present_totalAmount || that_present_totalAmount) {
9506
        if (!(this_present_totalAmount && that_present_totalAmount))
9507
          return false;
9508
        if (this.totalAmount != that.totalAmount)
9509
          return false;
9510
      }
9511
 
9512
      boolean this_present_userId = true;
9513
      boolean that_present_userId = true;
9514
      if (this_present_userId || that_present_userId) {
9515
        if (!(this_present_userId && that_present_userId))
9516
          return false;
9517
        if (this.userId != that.userId)
9518
          return false;
9519
      }
9520
 
9521
      return true;
9522
    }
9523
 
9524
    @Override
9525
    public int hashCode() {
9526
      return 0;
9527
    }
9528
 
9529
    public int compareTo(applyRechargeCoupon_args other) {
9530
      if (!getClass().equals(other.getClass())) {
9531
        return getClass().getName().compareTo(other.getClass().getName());
9532
      }
9533
 
9534
      int lastComparison = 0;
9535
      applyRechargeCoupon_args typedOther = (applyRechargeCoupon_args)other;
9536
 
9537
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
9538
      if (lastComparison != 0) {
9539
        return lastComparison;
9540
      }
9541
      if (isSetCouponCode()) {
9542
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
9543
        if (lastComparison != 0) {
9544
          return lastComparison;
9545
        }
9546
      }
9547
      lastComparison = Boolean.valueOf(isSetTotalAmount()).compareTo(typedOther.isSetTotalAmount());
9548
      if (lastComparison != 0) {
9549
        return lastComparison;
9550
      }
9551
      if (isSetTotalAmount()) {
9552
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.totalAmount, typedOther.totalAmount);
9553
        if (lastComparison != 0) {
9554
          return lastComparison;
9555
        }
9556
      }
9557
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
9558
      if (lastComparison != 0) {
9559
        return lastComparison;
9560
      }
9561
      if (isSetUserId()) {
9562
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
9563
        if (lastComparison != 0) {
9564
          return lastComparison;
9565
        }
9566
      }
9567
      return 0;
9568
    }
9569
 
9570
    public _Fields fieldForId(int fieldId) {
9571
      return _Fields.findByThriftId(fieldId);
9572
    }
9573
 
9574
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9575
      org.apache.thrift.protocol.TField field;
9576
      iprot.readStructBegin();
9577
      while (true)
9578
      {
9579
        field = iprot.readFieldBegin();
9580
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
9581
          break;
9582
        }
9583
        switch (field.id) {
9584
          case 1: // COUPON_CODE
9585
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
9586
              this.couponCode = iprot.readString();
9587
            } else { 
9588
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9589
            }
9590
            break;
9591
          case 2: // TOTAL_AMOUNT
9592
            if (field.type == org.apache.thrift.protocol.TType.I64) {
9593
              this.totalAmount = iprot.readI64();
9594
              setTotalAmountIsSet(true);
9595
            } else { 
9596
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9597
            }
9598
            break;
9599
          case 3: // USER_ID
9600
            if (field.type == org.apache.thrift.protocol.TType.I64) {
9601
              this.userId = iprot.readI64();
9602
              setUserIdIsSet(true);
9603
            } else { 
9604
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9605
            }
9606
            break;
9607
          default:
9608
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9609
        }
9610
        iprot.readFieldEnd();
9611
      }
9612
      iprot.readStructEnd();
9613
      validate();
9614
    }
9615
 
9616
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
9617
      validate();
9618
 
9619
      oprot.writeStructBegin(STRUCT_DESC);
9620
      if (this.couponCode != null) {
9621
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
9622
        oprot.writeString(this.couponCode);
9623
        oprot.writeFieldEnd();
9624
      }
9625
      oprot.writeFieldBegin(TOTAL_AMOUNT_FIELD_DESC);
9626
      oprot.writeI64(this.totalAmount);
9627
      oprot.writeFieldEnd();
9628
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
9629
      oprot.writeI64(this.userId);
9630
      oprot.writeFieldEnd();
9631
      oprot.writeFieldStop();
9632
      oprot.writeStructEnd();
9633
    }
9634
 
9635
    @Override
9636
    public String toString() {
9637
      StringBuilder sb = new StringBuilder("applyRechargeCoupon_args(");
9638
      boolean first = true;
9639
 
9640
      sb.append("couponCode:");
9641
      if (this.couponCode == null) {
9642
        sb.append("null");
9643
      } else {
9644
        sb.append(this.couponCode);
9645
      }
9646
      first = false;
9647
      if (!first) sb.append(", ");
9648
      sb.append("totalAmount:");
9649
      sb.append(this.totalAmount);
9650
      first = false;
9651
      if (!first) sb.append(", ");
9652
      sb.append("userId:");
9653
      sb.append(this.userId);
9654
      first = false;
9655
      sb.append(")");
9656
      return sb.toString();
9657
    }
9658
 
9659
    public void validate() throws org.apache.thrift.TException {
9660
      // check for required fields
9661
    }
9662
 
9663
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9664
      try {
9665
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9666
      } catch (org.apache.thrift.TException te) {
9667
        throw new java.io.IOException(te);
9668
      }
9669
    }
9670
 
9671
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9672
      try {
9673
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
9674
        __isset_bit_vector = new BitSet(1);
9675
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9676
      } catch (org.apache.thrift.TException te) {
9677
        throw new java.io.IOException(te);
9678
      }
9679
    }
9680
 
9681
  }
9682
 
9683
  public static class applyRechargeCoupon_result implements org.apache.thrift.TBase<applyRechargeCoupon_result, applyRechargeCoupon_result._Fields>, java.io.Serializable, Cloneable   {
9684
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyRechargeCoupon_result");
9685
 
9686
    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);
9687
    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);
9688
 
9689
    private Map<Long,String> success; // required
9690
    private PromotionException pex; // required
9691
 
9692
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9693
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
9694
      SUCCESS((short)0, "success"),
9695
      PEX((short)1, "pex");
9696
 
9697
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9698
 
9699
      static {
9700
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9701
          byName.put(field.getFieldName(), field);
9702
        }
9703
      }
9704
 
9705
      /**
9706
       * Find the _Fields constant that matches fieldId, or null if its not found.
9707
       */
9708
      public static _Fields findByThriftId(int fieldId) {
9709
        switch(fieldId) {
9710
          case 0: // SUCCESS
9711
            return SUCCESS;
9712
          case 1: // PEX
9713
            return PEX;
9714
          default:
9715
            return null;
9716
        }
9717
      }
9718
 
9719
      /**
9720
       * Find the _Fields constant that matches fieldId, throwing an exception
9721
       * if it is not found.
9722
       */
9723
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9724
        _Fields fields = findByThriftId(fieldId);
9725
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9726
        return fields;
9727
      }
9728
 
9729
      /**
9730
       * Find the _Fields constant that matches name, or null if its not found.
9731
       */
9732
      public static _Fields findByName(String name) {
9733
        return byName.get(name);
9734
      }
9735
 
9736
      private final short _thriftId;
9737
      private final String _fieldName;
9738
 
9739
      _Fields(short thriftId, String fieldName) {
9740
        _thriftId = thriftId;
9741
        _fieldName = fieldName;
9742
      }
9743
 
9744
      public short getThriftFieldId() {
9745
        return _thriftId;
9746
      }
9747
 
9748
      public String getFieldName() {
9749
        return _fieldName;
9750
      }
9751
    }
9752
 
9753
    // isset id assignments
9754
 
9755
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
9756
    static {
9757
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9758
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9759
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
9760
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), 
9761
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
9762
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9763
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
9764
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9765
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyRechargeCoupon_result.class, metaDataMap);
9766
    }
9767
 
9768
    public applyRechargeCoupon_result() {
9769
    }
9770
 
9771
    public applyRechargeCoupon_result(
9772
      Map<Long,String> success,
9773
      PromotionException pex)
9774
    {
9775
      this();
9776
      this.success = success;
9777
      this.pex = pex;
9778
    }
9779
 
9780
    /**
9781
     * Performs a deep copy on <i>other</i>.
9782
     */
9783
    public applyRechargeCoupon_result(applyRechargeCoupon_result other) {
9784
      if (other.isSetSuccess()) {
9785
        Map<Long,String> __this__success = new HashMap<Long,String>();
9786
        for (Map.Entry<Long, String> other_element : other.success.entrySet()) {
9787
 
9788
          Long other_element_key = other_element.getKey();
9789
          String other_element_value = other_element.getValue();
9790
 
9791
          Long __this__success_copy_key = other_element_key;
9792
 
9793
          String __this__success_copy_value = other_element_value;
9794
 
9795
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
9796
        }
9797
        this.success = __this__success;
9798
      }
9799
      if (other.isSetPex()) {
9800
        this.pex = new PromotionException(other.pex);
9801
      }
9802
    }
9803
 
9804
    public applyRechargeCoupon_result deepCopy() {
9805
      return new applyRechargeCoupon_result(this);
9806
    }
9807
 
9808
    @Override
9809
    public void clear() {
9810
      this.success = null;
9811
      this.pex = null;
9812
    }
9813
 
9814
    public int getSuccessSize() {
9815
      return (this.success == null) ? 0 : this.success.size();
9816
    }
9817
 
9818
    public void putToSuccess(long key, String val) {
9819
      if (this.success == null) {
9820
        this.success = new HashMap<Long,String>();
9821
      }
9822
      this.success.put(key, val);
9823
    }
9824
 
9825
    public Map<Long,String> getSuccess() {
9826
      return this.success;
9827
    }
9828
 
9829
    public void setSuccess(Map<Long,String> success) {
9830
      this.success = success;
9831
    }
9832
 
9833
    public void unsetSuccess() {
9834
      this.success = null;
9835
    }
9836
 
9837
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
9838
    public boolean isSetSuccess() {
9839
      return this.success != null;
9840
    }
9841
 
9842
    public void setSuccessIsSet(boolean value) {
9843
      if (!value) {
9844
        this.success = null;
9845
      }
9846
    }
9847
 
9848
    public PromotionException getPex() {
9849
      return this.pex;
9850
    }
9851
 
9852
    public void setPex(PromotionException pex) {
9853
      this.pex = pex;
9854
    }
9855
 
9856
    public void unsetPex() {
9857
      this.pex = null;
9858
    }
9859
 
9860
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
9861
    public boolean isSetPex() {
9862
      return this.pex != null;
9863
    }
9864
 
9865
    public void setPexIsSet(boolean value) {
9866
      if (!value) {
9867
        this.pex = null;
9868
      }
9869
    }
9870
 
9871
    public void setFieldValue(_Fields field, Object value) {
9872
      switch (field) {
9873
      case SUCCESS:
9874
        if (value == null) {
9875
          unsetSuccess();
9876
        } else {
9877
          setSuccess((Map<Long,String>)value);
9878
        }
9879
        break;
9880
 
9881
      case PEX:
9882
        if (value == null) {
9883
          unsetPex();
9884
        } else {
9885
          setPex((PromotionException)value);
9886
        }
9887
        break;
9888
 
9889
      }
9890
    }
9891
 
9892
    public Object getFieldValue(_Fields field) {
9893
      switch (field) {
9894
      case SUCCESS:
9895
        return getSuccess();
9896
 
9897
      case PEX:
9898
        return getPex();
9899
 
9900
      }
9901
      throw new IllegalStateException();
9902
    }
9903
 
9904
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9905
    public boolean isSet(_Fields field) {
9906
      if (field == null) {
9907
        throw new IllegalArgumentException();
9908
      }
9909
 
9910
      switch (field) {
9911
      case SUCCESS:
9912
        return isSetSuccess();
9913
      case PEX:
9914
        return isSetPex();
9915
      }
9916
      throw new IllegalStateException();
9917
    }
9918
 
9919
    @Override
9920
    public boolean equals(Object that) {
9921
      if (that == null)
9922
        return false;
9923
      if (that instanceof applyRechargeCoupon_result)
9924
        return this.equals((applyRechargeCoupon_result)that);
9925
      return false;
9926
    }
9927
 
9928
    public boolean equals(applyRechargeCoupon_result that) {
9929
      if (that == null)
9930
        return false;
9931
 
9932
      boolean this_present_success = true && this.isSetSuccess();
9933
      boolean that_present_success = true && that.isSetSuccess();
9934
      if (this_present_success || that_present_success) {
9935
        if (!(this_present_success && that_present_success))
9936
          return false;
9937
        if (!this.success.equals(that.success))
9938
          return false;
9939
      }
9940
 
9941
      boolean this_present_pex = true && this.isSetPex();
9942
      boolean that_present_pex = true && that.isSetPex();
9943
      if (this_present_pex || that_present_pex) {
9944
        if (!(this_present_pex && that_present_pex))
9945
          return false;
9946
        if (!this.pex.equals(that.pex))
9947
          return false;
9948
      }
9949
 
9950
      return true;
9951
    }
9952
 
9953
    @Override
9954
    public int hashCode() {
9955
      return 0;
9956
    }
9957
 
9958
    public int compareTo(applyRechargeCoupon_result other) {
9959
      if (!getClass().equals(other.getClass())) {
9960
        return getClass().getName().compareTo(other.getClass().getName());
9961
      }
9962
 
9963
      int lastComparison = 0;
9964
      applyRechargeCoupon_result typedOther = (applyRechargeCoupon_result)other;
9965
 
9966
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
9967
      if (lastComparison != 0) {
9968
        return lastComparison;
9969
      }
9970
      if (isSetSuccess()) {
9971
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
9972
        if (lastComparison != 0) {
9973
          return lastComparison;
9974
        }
9975
      }
9976
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
9977
      if (lastComparison != 0) {
9978
        return lastComparison;
9979
      }
9980
      if (isSetPex()) {
9981
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
9982
        if (lastComparison != 0) {
9983
          return lastComparison;
9984
        }
9985
      }
9986
      return 0;
9987
    }
9988
 
9989
    public _Fields fieldForId(int fieldId) {
9990
      return _Fields.findByThriftId(fieldId);
9991
    }
9992
 
9993
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9994
      org.apache.thrift.protocol.TField field;
9995
      iprot.readStructBegin();
9996
      while (true)
9997
      {
9998
        field = iprot.readFieldBegin();
9999
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
10000
          break;
10001
        }
10002
        switch (field.id) {
10003
          case 0: // SUCCESS
10004
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
10005
              {
11592 amit.gupta 10006
                org.apache.thrift.protocol.TMap _map25 = iprot.readMapBegin();
10007
                this.success = new HashMap<Long,String>(2*_map25.size);
10008
                for (int _i26 = 0; _i26 < _map25.size; ++_i26)
6433 anupam.sin 10009
                {
11592 amit.gupta 10010
                  long _key27; // required
10011
                  String _val28; // required
10012
                  _key27 = iprot.readI64();
10013
                  _val28 = iprot.readString();
10014
                  this.success.put(_key27, _val28);
6433 anupam.sin 10015
                }
10016
                iprot.readMapEnd();
10017
              }
10018
            } else { 
10019
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10020
            }
10021
            break;
10022
          case 1: // PEX
10023
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
10024
              this.pex = new PromotionException();
10025
              this.pex.read(iprot);
10026
            } else { 
10027
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10028
            }
10029
            break;
10030
          default:
10031
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10032
        }
10033
        iprot.readFieldEnd();
10034
      }
10035
      iprot.readStructEnd();
10036
      validate();
10037
    }
10038
 
10039
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
10040
      oprot.writeStructBegin(STRUCT_DESC);
10041
 
10042
      if (this.isSetSuccess()) {
10043
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
10044
        {
10045
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.STRING, this.success.size()));
11592 amit.gupta 10046
          for (Map.Entry<Long, String> _iter29 : this.success.entrySet())
6433 anupam.sin 10047
          {
11592 amit.gupta 10048
            oprot.writeI64(_iter29.getKey());
10049
            oprot.writeString(_iter29.getValue());
6433 anupam.sin 10050
          }
10051
          oprot.writeMapEnd();
10052
        }
10053
        oprot.writeFieldEnd();
10054
      } else if (this.isSetPex()) {
10055
        oprot.writeFieldBegin(PEX_FIELD_DESC);
10056
        this.pex.write(oprot);
10057
        oprot.writeFieldEnd();
10058
      }
10059
      oprot.writeFieldStop();
10060
      oprot.writeStructEnd();
10061
    }
10062
 
10063
    @Override
10064
    public String toString() {
10065
      StringBuilder sb = new StringBuilder("applyRechargeCoupon_result(");
10066
      boolean first = true;
10067
 
10068
      sb.append("success:");
10069
      if (this.success == null) {
10070
        sb.append("null");
10071
      } else {
10072
        sb.append(this.success);
10073
      }
10074
      first = false;
10075
      if (!first) sb.append(", ");
10076
      sb.append("pex:");
10077
      if (this.pex == null) {
10078
        sb.append("null");
10079
      } else {
10080
        sb.append(this.pex);
10081
      }
10082
      first = false;
10083
      sb.append(")");
10084
      return sb.toString();
10085
    }
10086
 
10087
    public void validate() throws org.apache.thrift.TException {
10088
      // check for required fields
10089
    }
10090
 
10091
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10092
      try {
10093
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10094
      } catch (org.apache.thrift.TException te) {
10095
        throw new java.io.IOException(te);
10096
      }
10097
    }
10098
 
10099
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10100
      try {
10101
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10102
      } catch (org.apache.thrift.TException te) {
10103
        throw new java.io.IOException(te);
10104
      }
10105
    }
10106
 
10107
  }
10108
 
3430 rajveer 10109
  public static class trackCouponUsage_args implements org.apache.thrift.TBase<trackCouponUsage_args, trackCouponUsage_args._Fields>, java.io.Serializable, Cloneable   {
10110
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_args");
1982 varun.gupt 10111
 
3430 rajveer 10112
    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);
10113
    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);
10114
    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 10115
 
3430 rajveer 10116
    private String couponCode; // required
10117
    private long transactionId; // required
10118
    private long userId; // required
1982 varun.gupt 10119
 
10120
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 10121
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 10122
      COUPON_CODE((short)1, "couponCode"),
10123
      TRANSACTION_ID((short)2, "transactionId"),
10124
      USER_ID((short)3, "userId");
10125
 
10126
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10127
 
10128
      static {
10129
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10130
          byName.put(field.getFieldName(), field);
10131
        }
10132
      }
10133
 
10134
      /**
10135
       * Find the _Fields constant that matches fieldId, or null if its not found.
10136
       */
10137
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 10138
        switch(fieldId) {
10139
          case 1: // COUPON_CODE
10140
            return COUPON_CODE;
10141
          case 2: // TRANSACTION_ID
10142
            return TRANSACTION_ID;
10143
          case 3: // USER_ID
10144
            return USER_ID;
10145
          default:
10146
            return null;
10147
        }
1982 varun.gupt 10148
      }
10149
 
10150
      /**
10151
       * Find the _Fields constant that matches fieldId, throwing an exception
10152
       * if it is not found.
10153
       */
10154
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10155
        _Fields fields = findByThriftId(fieldId);
10156
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10157
        return fields;
10158
      }
10159
 
10160
      /**
10161
       * Find the _Fields constant that matches name, or null if its not found.
10162
       */
10163
      public static _Fields findByName(String name) {
10164
        return byName.get(name);
10165
      }
10166
 
10167
      private final short _thriftId;
10168
      private final String _fieldName;
10169
 
10170
      _Fields(short thriftId, String fieldName) {
10171
        _thriftId = thriftId;
10172
        _fieldName = fieldName;
10173
      }
10174
 
10175
      public short getThriftFieldId() {
10176
        return _thriftId;
10177
      }
10178
 
10179
      public String getFieldName() {
10180
        return _fieldName;
10181
      }
10182
    }
10183
 
10184
    // isset id assignments
10185
    private static final int __TRANSACTIONID_ISSET_ID = 0;
10186
    private static final int __USERID_ISSET_ID = 1;
10187
    private BitSet __isset_bit_vector = new BitSet(2);
10188
 
3430 rajveer 10189
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 10190
    static {
3430 rajveer 10191
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10192
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10193
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
10194
      tmpMap.put(_Fields.TRANSACTION_ID, new org.apache.thrift.meta_data.FieldMetaData("transactionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10195
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
10196
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10197
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
10198
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10199
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_args.class, metaDataMap);
1982 varun.gupt 10200
    }
10201
 
10202
    public trackCouponUsage_args() {
10203
    }
10204
 
10205
    public trackCouponUsage_args(
10206
      String couponCode,
10207
      long transactionId,
10208
      long userId)
10209
    {
10210
      this();
10211
      this.couponCode = couponCode;
10212
      this.transactionId = transactionId;
10213
      setTransactionIdIsSet(true);
10214
      this.userId = userId;
10215
      setUserIdIsSet(true);
10216
    }
10217
 
10218
    /**
10219
     * Performs a deep copy on <i>other</i>.
10220
     */
10221
    public trackCouponUsage_args(trackCouponUsage_args other) {
10222
      __isset_bit_vector.clear();
10223
      __isset_bit_vector.or(other.__isset_bit_vector);
10224
      if (other.isSetCouponCode()) {
10225
        this.couponCode = other.couponCode;
10226
      }
10227
      this.transactionId = other.transactionId;
10228
      this.userId = other.userId;
10229
    }
10230
 
10231
    public trackCouponUsage_args deepCopy() {
10232
      return new trackCouponUsage_args(this);
10233
    }
10234
 
3430 rajveer 10235
    @Override
10236
    public void clear() {
10237
      this.couponCode = null;
10238
      setTransactionIdIsSet(false);
10239
      this.transactionId = 0;
10240
      setUserIdIsSet(false);
10241
      this.userId = 0;
1982 varun.gupt 10242
    }
10243
 
10244
    public String getCouponCode() {
10245
      return this.couponCode;
10246
    }
10247
 
3430 rajveer 10248
    public void setCouponCode(String couponCode) {
1982 varun.gupt 10249
      this.couponCode = couponCode;
10250
    }
10251
 
10252
    public void unsetCouponCode() {
10253
      this.couponCode = null;
10254
    }
10255
 
3430 rajveer 10256
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 10257
    public boolean isSetCouponCode() {
10258
      return this.couponCode != null;
10259
    }
10260
 
10261
    public void setCouponCodeIsSet(boolean value) {
10262
      if (!value) {
10263
        this.couponCode = null;
10264
      }
10265
    }
10266
 
10267
    public long getTransactionId() {
10268
      return this.transactionId;
10269
    }
10270
 
3430 rajveer 10271
    public void setTransactionId(long transactionId) {
1982 varun.gupt 10272
      this.transactionId = transactionId;
10273
      setTransactionIdIsSet(true);
10274
    }
10275
 
10276
    public void unsetTransactionId() {
10277
      __isset_bit_vector.clear(__TRANSACTIONID_ISSET_ID);
10278
    }
10279
 
3430 rajveer 10280
    /** Returns true if field transactionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 10281
    public boolean isSetTransactionId() {
10282
      return __isset_bit_vector.get(__TRANSACTIONID_ISSET_ID);
10283
    }
10284
 
10285
    public void setTransactionIdIsSet(boolean value) {
10286
      __isset_bit_vector.set(__TRANSACTIONID_ISSET_ID, value);
10287
    }
10288
 
10289
    public long getUserId() {
10290
      return this.userId;
10291
    }
10292
 
3430 rajveer 10293
    public void setUserId(long userId) {
1982 varun.gupt 10294
      this.userId = userId;
10295
      setUserIdIsSet(true);
10296
    }
10297
 
10298
    public void unsetUserId() {
10299
      __isset_bit_vector.clear(__USERID_ISSET_ID);
10300
    }
10301
 
3430 rajveer 10302
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 10303
    public boolean isSetUserId() {
10304
      return __isset_bit_vector.get(__USERID_ISSET_ID);
10305
    }
10306
 
10307
    public void setUserIdIsSet(boolean value) {
10308
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
10309
    }
10310
 
10311
    public void setFieldValue(_Fields field, Object value) {
10312
      switch (field) {
10313
      case COUPON_CODE:
10314
        if (value == null) {
10315
          unsetCouponCode();
10316
        } else {
10317
          setCouponCode((String)value);
10318
        }
10319
        break;
10320
 
10321
      case TRANSACTION_ID:
10322
        if (value == null) {
10323
          unsetTransactionId();
10324
        } else {
10325
          setTransactionId((Long)value);
10326
        }
10327
        break;
10328
 
10329
      case USER_ID:
10330
        if (value == null) {
10331
          unsetUserId();
10332
        } else {
10333
          setUserId((Long)value);
10334
        }
10335
        break;
10336
 
10337
      }
10338
    }
10339
 
10340
    public Object getFieldValue(_Fields field) {
10341
      switch (field) {
10342
      case COUPON_CODE:
10343
        return getCouponCode();
10344
 
10345
      case TRANSACTION_ID:
3430 rajveer 10346
        return Long.valueOf(getTransactionId());
1982 varun.gupt 10347
 
10348
      case USER_ID:
3430 rajveer 10349
        return Long.valueOf(getUserId());
1982 varun.gupt 10350
 
10351
      }
10352
      throw new IllegalStateException();
10353
    }
10354
 
3430 rajveer 10355
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10356
    public boolean isSet(_Fields field) {
10357
      if (field == null) {
10358
        throw new IllegalArgumentException();
10359
      }
1982 varun.gupt 10360
 
10361
      switch (field) {
10362
      case COUPON_CODE:
10363
        return isSetCouponCode();
10364
      case TRANSACTION_ID:
10365
        return isSetTransactionId();
10366
      case USER_ID:
10367
        return isSetUserId();
10368
      }
10369
      throw new IllegalStateException();
10370
    }
10371
 
10372
    @Override
10373
    public boolean equals(Object that) {
10374
      if (that == null)
10375
        return false;
10376
      if (that instanceof trackCouponUsage_args)
10377
        return this.equals((trackCouponUsage_args)that);
10378
      return false;
10379
    }
10380
 
10381
    public boolean equals(trackCouponUsage_args that) {
10382
      if (that == null)
10383
        return false;
10384
 
10385
      boolean this_present_couponCode = true && this.isSetCouponCode();
10386
      boolean that_present_couponCode = true && that.isSetCouponCode();
10387
      if (this_present_couponCode || that_present_couponCode) {
10388
        if (!(this_present_couponCode && that_present_couponCode))
10389
          return false;
10390
        if (!this.couponCode.equals(that.couponCode))
10391
          return false;
10392
      }
10393
 
10394
      boolean this_present_transactionId = true;
10395
      boolean that_present_transactionId = true;
10396
      if (this_present_transactionId || that_present_transactionId) {
10397
        if (!(this_present_transactionId && that_present_transactionId))
10398
          return false;
10399
        if (this.transactionId != that.transactionId)
10400
          return false;
10401
      }
10402
 
10403
      boolean this_present_userId = true;
10404
      boolean that_present_userId = true;
10405
      if (this_present_userId || that_present_userId) {
10406
        if (!(this_present_userId && that_present_userId))
10407
          return false;
10408
        if (this.userId != that.userId)
10409
          return false;
10410
      }
10411
 
10412
      return true;
10413
    }
10414
 
10415
    @Override
10416
    public int hashCode() {
10417
      return 0;
10418
    }
10419
 
10420
    public int compareTo(trackCouponUsage_args other) {
10421
      if (!getClass().equals(other.getClass())) {
10422
        return getClass().getName().compareTo(other.getClass().getName());
10423
      }
10424
 
10425
      int lastComparison = 0;
10426
      trackCouponUsage_args typedOther = (trackCouponUsage_args)other;
10427
 
3430 rajveer 10428
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 10429
      if (lastComparison != 0) {
10430
        return lastComparison;
10431
      }
3430 rajveer 10432
      if (isSetCouponCode()) {
10433
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
10434
        if (lastComparison != 0) {
10435
          return lastComparison;
10436
        }
1982 varun.gupt 10437
      }
3430 rajveer 10438
      lastComparison = Boolean.valueOf(isSetTransactionId()).compareTo(typedOther.isSetTransactionId());
1982 varun.gupt 10439
      if (lastComparison != 0) {
10440
        return lastComparison;
10441
      }
3430 rajveer 10442
      if (isSetTransactionId()) {
10443
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transactionId, typedOther.transactionId);
10444
        if (lastComparison != 0) {
10445
          return lastComparison;
10446
        }
1982 varun.gupt 10447
      }
3430 rajveer 10448
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 10449
      if (lastComparison != 0) {
10450
        return lastComparison;
10451
      }
3430 rajveer 10452
      if (isSetUserId()) {
10453
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
10454
        if (lastComparison != 0) {
10455
          return lastComparison;
10456
        }
1982 varun.gupt 10457
      }
10458
      return 0;
10459
    }
10460
 
3430 rajveer 10461
    public _Fields fieldForId(int fieldId) {
10462
      return _Fields.findByThriftId(fieldId);
10463
    }
10464
 
10465
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10466
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 10467
      iprot.readStructBegin();
10468
      while (true)
10469
      {
10470
        field = iprot.readFieldBegin();
3430 rajveer 10471
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 10472
          break;
10473
        }
3430 rajveer 10474
        switch (field.id) {
10475
          case 1: // COUPON_CODE
10476
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
10477
              this.couponCode = iprot.readString();
10478
            } else { 
10479
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10480
            }
10481
            break;
10482
          case 2: // TRANSACTION_ID
10483
            if (field.type == org.apache.thrift.protocol.TType.I64) {
10484
              this.transactionId = iprot.readI64();
10485
              setTransactionIdIsSet(true);
10486
            } else { 
10487
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10488
            }
10489
            break;
10490
          case 3: // USER_ID
10491
            if (field.type == org.apache.thrift.protocol.TType.I64) {
10492
              this.userId = iprot.readI64();
10493
              setUserIdIsSet(true);
10494
            } else { 
10495
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10496
            }
10497
            break;
10498
          default:
10499
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 10500
        }
3430 rajveer 10501
        iprot.readFieldEnd();
1982 varun.gupt 10502
      }
10503
      iprot.readStructEnd();
10504
      validate();
10505
    }
10506
 
3430 rajveer 10507
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 10508
      validate();
10509
 
10510
      oprot.writeStructBegin(STRUCT_DESC);
10511
      if (this.couponCode != null) {
10512
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
10513
        oprot.writeString(this.couponCode);
10514
        oprot.writeFieldEnd();
10515
      }
10516
      oprot.writeFieldBegin(TRANSACTION_ID_FIELD_DESC);
10517
      oprot.writeI64(this.transactionId);
10518
      oprot.writeFieldEnd();
10519
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
10520
      oprot.writeI64(this.userId);
10521
      oprot.writeFieldEnd();
10522
      oprot.writeFieldStop();
10523
      oprot.writeStructEnd();
10524
    }
10525
 
10526
    @Override
10527
    public String toString() {
10528
      StringBuilder sb = new StringBuilder("trackCouponUsage_args(");
10529
      boolean first = true;
10530
 
10531
      sb.append("couponCode:");
10532
      if (this.couponCode == null) {
10533
        sb.append("null");
10534
      } else {
10535
        sb.append(this.couponCode);
10536
      }
10537
      first = false;
10538
      if (!first) sb.append(", ");
10539
      sb.append("transactionId:");
10540
      sb.append(this.transactionId);
10541
      first = false;
10542
      if (!first) sb.append(", ");
10543
      sb.append("userId:");
10544
      sb.append(this.userId);
10545
      first = false;
10546
      sb.append(")");
10547
      return sb.toString();
10548
    }
10549
 
3430 rajveer 10550
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 10551
      // check for required fields
10552
    }
10553
 
3430 rajveer 10554
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10555
      try {
10556
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10557
      } catch (org.apache.thrift.TException te) {
10558
        throw new java.io.IOException(te);
10559
      }
10560
    }
10561
 
10562
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10563
      try {
10564
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
10565
        __isset_bit_vector = new BitSet(1);
10566
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10567
      } catch (org.apache.thrift.TException te) {
10568
        throw new java.io.IOException(te);
10569
      }
10570
    }
10571
 
1982 varun.gupt 10572
  }
10573
 
3430 rajveer 10574
  public static class trackCouponUsage_result implements org.apache.thrift.TBase<trackCouponUsage_result, trackCouponUsage_result._Fields>, java.io.Serializable, Cloneable   {
10575
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_result");
1982 varun.gupt 10576
 
3430 rajveer 10577
    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 10578
 
3430 rajveer 10579
    private PromotionException pex; // required
1982 varun.gupt 10580
 
10581
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 10582
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 10583
      PEX((short)1, "pex");
10584
 
10585
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10586
 
10587
      static {
10588
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10589
          byName.put(field.getFieldName(), field);
10590
        }
10591
      }
10592
 
10593
      /**
10594
       * Find the _Fields constant that matches fieldId, or null if its not found.
10595
       */
10596
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 10597
        switch(fieldId) {
10598
          case 1: // PEX
10599
            return PEX;
10600
          default:
10601
            return null;
10602
        }
1982 varun.gupt 10603
      }
10604
 
10605
      /**
10606
       * Find the _Fields constant that matches fieldId, throwing an exception
10607
       * if it is not found.
10608
       */
10609
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10610
        _Fields fields = findByThriftId(fieldId);
10611
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10612
        return fields;
10613
      }
10614
 
10615
      /**
10616
       * Find the _Fields constant that matches name, or null if its not found.
10617
       */
10618
      public static _Fields findByName(String name) {
10619
        return byName.get(name);
10620
      }
10621
 
10622
      private final short _thriftId;
10623
      private final String _fieldName;
10624
 
10625
      _Fields(short thriftId, String fieldName) {
10626
        _thriftId = thriftId;
10627
        _fieldName = fieldName;
10628
      }
10629
 
10630
      public short getThriftFieldId() {
10631
        return _thriftId;
10632
      }
10633
 
10634
      public String getFieldName() {
10635
        return _fieldName;
10636
      }
10637
    }
10638
 
10639
    // isset id assignments
10640
 
3430 rajveer 10641
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 10642
    static {
3430 rajveer 10643
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10644
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10645
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
10646
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10647
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_result.class, metaDataMap);
1982 varun.gupt 10648
    }
10649
 
10650
    public trackCouponUsage_result() {
10651
    }
10652
 
10653
    public trackCouponUsage_result(
10654
      PromotionException pex)
10655
    {
10656
      this();
10657
      this.pex = pex;
10658
    }
10659
 
10660
    /**
10661
     * Performs a deep copy on <i>other</i>.
10662
     */
10663
    public trackCouponUsage_result(trackCouponUsage_result other) {
10664
      if (other.isSetPex()) {
10665
        this.pex = new PromotionException(other.pex);
10666
      }
10667
    }
10668
 
10669
    public trackCouponUsage_result deepCopy() {
10670
      return new trackCouponUsage_result(this);
10671
    }
10672
 
3430 rajveer 10673
    @Override
10674
    public void clear() {
10675
      this.pex = null;
1982 varun.gupt 10676
    }
10677
 
10678
    public PromotionException getPex() {
10679
      return this.pex;
10680
    }
10681
 
3430 rajveer 10682
    public void setPex(PromotionException pex) {
1982 varun.gupt 10683
      this.pex = pex;
10684
    }
10685
 
10686
    public void unsetPex() {
10687
      this.pex = null;
10688
    }
10689
 
3430 rajveer 10690
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 10691
    public boolean isSetPex() {
10692
      return this.pex != null;
10693
    }
10694
 
10695
    public void setPexIsSet(boolean value) {
10696
      if (!value) {
10697
        this.pex = null;
10698
      }
10699
    }
10700
 
10701
    public void setFieldValue(_Fields field, Object value) {
10702
      switch (field) {
10703
      case PEX:
10704
        if (value == null) {
10705
          unsetPex();
10706
        } else {
10707
          setPex((PromotionException)value);
10708
        }
10709
        break;
10710
 
10711
      }
10712
    }
10713
 
10714
    public Object getFieldValue(_Fields field) {
10715
      switch (field) {
10716
      case PEX:
10717
        return getPex();
10718
 
10719
      }
10720
      throw new IllegalStateException();
10721
    }
10722
 
3430 rajveer 10723
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10724
    public boolean isSet(_Fields field) {
10725
      if (field == null) {
10726
        throw new IllegalArgumentException();
10727
      }
1982 varun.gupt 10728
 
10729
      switch (field) {
10730
      case PEX:
10731
        return isSetPex();
10732
      }
10733
      throw new IllegalStateException();
10734
    }
10735
 
10736
    @Override
10737
    public boolean equals(Object that) {
10738
      if (that == null)
10739
        return false;
10740
      if (that instanceof trackCouponUsage_result)
10741
        return this.equals((trackCouponUsage_result)that);
10742
      return false;
10743
    }
10744
 
10745
    public boolean equals(trackCouponUsage_result that) {
10746
      if (that == null)
10747
        return false;
10748
 
10749
      boolean this_present_pex = true && this.isSetPex();
10750
      boolean that_present_pex = true && that.isSetPex();
10751
      if (this_present_pex || that_present_pex) {
10752
        if (!(this_present_pex && that_present_pex))
10753
          return false;
10754
        if (!this.pex.equals(that.pex))
10755
          return false;
10756
      }
10757
 
10758
      return true;
10759
    }
10760
 
10761
    @Override
10762
    public int hashCode() {
10763
      return 0;
10764
    }
10765
 
10766
    public int compareTo(trackCouponUsage_result other) {
10767
      if (!getClass().equals(other.getClass())) {
10768
        return getClass().getName().compareTo(other.getClass().getName());
10769
      }
10770
 
10771
      int lastComparison = 0;
10772
      trackCouponUsage_result typedOther = (trackCouponUsage_result)other;
10773
 
3430 rajveer 10774
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 10775
      if (lastComparison != 0) {
10776
        return lastComparison;
10777
      }
3430 rajveer 10778
      if (isSetPex()) {
10779
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
10780
        if (lastComparison != 0) {
10781
          return lastComparison;
10782
        }
1982 varun.gupt 10783
      }
10784
      return 0;
10785
    }
10786
 
3430 rajveer 10787
    public _Fields fieldForId(int fieldId) {
10788
      return _Fields.findByThriftId(fieldId);
10789
    }
10790
 
10791
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10792
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 10793
      iprot.readStructBegin();
10794
      while (true)
10795
      {
10796
        field = iprot.readFieldBegin();
3430 rajveer 10797
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 10798
          break;
10799
        }
3430 rajveer 10800
        switch (field.id) {
10801
          case 1: // PEX
10802
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
10803
              this.pex = new PromotionException();
10804
              this.pex.read(iprot);
10805
            } else { 
10806
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10807
            }
10808
            break;
10809
          default:
10810
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 10811
        }
3430 rajveer 10812
        iprot.readFieldEnd();
1982 varun.gupt 10813
      }
10814
      iprot.readStructEnd();
10815
      validate();
10816
    }
10817
 
3430 rajveer 10818
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 10819
      oprot.writeStructBegin(STRUCT_DESC);
10820
 
10821
      if (this.isSetPex()) {
10822
        oprot.writeFieldBegin(PEX_FIELD_DESC);
10823
        this.pex.write(oprot);
10824
        oprot.writeFieldEnd();
10825
      }
10826
      oprot.writeFieldStop();
10827
      oprot.writeStructEnd();
10828
    }
10829
 
10830
    @Override
10831
    public String toString() {
10832
      StringBuilder sb = new StringBuilder("trackCouponUsage_result(");
10833
      boolean first = true;
10834
 
10835
      sb.append("pex:");
10836
      if (this.pex == null) {
10837
        sb.append("null");
10838
      } else {
10839
        sb.append(this.pex);
10840
      }
10841
      first = false;
10842
      sb.append(")");
10843
      return sb.toString();
10844
    }
10845
 
3430 rajveer 10846
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 10847
      // check for required fields
10848
    }
10849
 
3430 rajveer 10850
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10851
      try {
10852
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10853
      } catch (org.apache.thrift.TException te) {
10854
        throw new java.io.IOException(te);
10855
      }
10856
    }
10857
 
10858
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10859
      try {
10860
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10861
      } catch (org.apache.thrift.TException te) {
10862
        throw new java.io.IOException(te);
10863
      }
10864
    }
10865
 
1982 varun.gupt 10866
  }
10867
 
3430 rajveer 10868
  public static class getCouponUsageCountByUser_args implements org.apache.thrift.TBase<getCouponUsageCountByUser_args, getCouponUsageCountByUser_args._Fields>, java.io.Serializable, Cloneable   {
10869
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_args");
1982 varun.gupt 10870
 
3430 rajveer 10871
    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);
10872
    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 10873
 
3430 rajveer 10874
    private String couponCode; // required
10875
    private long userId; // required
1982 varun.gupt 10876
 
10877
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 10878
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 10879
      COUPON_CODE((short)1, "couponCode"),
10880
      USER_ID((short)2, "userId");
10881
 
10882
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10883
 
10884
      static {
10885
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10886
          byName.put(field.getFieldName(), field);
10887
        }
10888
      }
10889
 
10890
      /**
10891
       * Find the _Fields constant that matches fieldId, or null if its not found.
10892
       */
10893
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 10894
        switch(fieldId) {
10895
          case 1: // COUPON_CODE
10896
            return COUPON_CODE;
10897
          case 2: // USER_ID
10898
            return USER_ID;
10899
          default:
10900
            return null;
10901
        }
1982 varun.gupt 10902
      }
10903
 
10904
      /**
10905
       * Find the _Fields constant that matches fieldId, throwing an exception
10906
       * if it is not found.
10907
       */
10908
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10909
        _Fields fields = findByThriftId(fieldId);
10910
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10911
        return fields;
10912
      }
10913
 
10914
      /**
10915
       * Find the _Fields constant that matches name, or null if its not found.
10916
       */
10917
      public static _Fields findByName(String name) {
10918
        return byName.get(name);
10919
      }
10920
 
10921
      private final short _thriftId;
10922
      private final String _fieldName;
10923
 
10924
      _Fields(short thriftId, String fieldName) {
10925
        _thriftId = thriftId;
10926
        _fieldName = fieldName;
10927
      }
10928
 
10929
      public short getThriftFieldId() {
10930
        return _thriftId;
10931
      }
10932
 
10933
      public String getFieldName() {
10934
        return _fieldName;
10935
      }
10936
    }
10937
 
10938
    // isset id assignments
10939
    private static final int __USERID_ISSET_ID = 0;
10940
    private BitSet __isset_bit_vector = new BitSet(1);
10941
 
3430 rajveer 10942
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 10943
    static {
3430 rajveer 10944
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10945
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10946
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
10947
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10948
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
10949
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10950
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_args.class, metaDataMap);
1982 varun.gupt 10951
    }
10952
 
10953
    public getCouponUsageCountByUser_args() {
10954
    }
10955
 
10956
    public getCouponUsageCountByUser_args(
10957
      String couponCode,
10958
      long userId)
10959
    {
10960
      this();
10961
      this.couponCode = couponCode;
10962
      this.userId = userId;
10963
      setUserIdIsSet(true);
10964
    }
10965
 
10966
    /**
10967
     * Performs a deep copy on <i>other</i>.
10968
     */
10969
    public getCouponUsageCountByUser_args(getCouponUsageCountByUser_args other) {
10970
      __isset_bit_vector.clear();
10971
      __isset_bit_vector.or(other.__isset_bit_vector);
10972
      if (other.isSetCouponCode()) {
10973
        this.couponCode = other.couponCode;
10974
      }
10975
      this.userId = other.userId;
10976
    }
10977
 
10978
    public getCouponUsageCountByUser_args deepCopy() {
10979
      return new getCouponUsageCountByUser_args(this);
10980
    }
10981
 
3430 rajveer 10982
    @Override
10983
    public void clear() {
10984
      this.couponCode = null;
10985
      setUserIdIsSet(false);
10986
      this.userId = 0;
1982 varun.gupt 10987
    }
10988
 
10989
    public String getCouponCode() {
10990
      return this.couponCode;
10991
    }
10992
 
3430 rajveer 10993
    public void setCouponCode(String couponCode) {
1982 varun.gupt 10994
      this.couponCode = couponCode;
10995
    }
10996
 
10997
    public void unsetCouponCode() {
10998
      this.couponCode = null;
10999
    }
11000
 
3430 rajveer 11001
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 11002
    public boolean isSetCouponCode() {
11003
      return this.couponCode != null;
11004
    }
11005
 
11006
    public void setCouponCodeIsSet(boolean value) {
11007
      if (!value) {
11008
        this.couponCode = null;
11009
      }
11010
    }
11011
 
11012
    public long getUserId() {
11013
      return this.userId;
11014
    }
11015
 
3430 rajveer 11016
    public void setUserId(long userId) {
1982 varun.gupt 11017
      this.userId = userId;
11018
      setUserIdIsSet(true);
11019
    }
11020
 
11021
    public void unsetUserId() {
11022
      __isset_bit_vector.clear(__USERID_ISSET_ID);
11023
    }
11024
 
3430 rajveer 11025
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 11026
    public boolean isSetUserId() {
11027
      return __isset_bit_vector.get(__USERID_ISSET_ID);
11028
    }
11029
 
11030
    public void setUserIdIsSet(boolean value) {
11031
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
11032
    }
11033
 
11034
    public void setFieldValue(_Fields field, Object value) {
11035
      switch (field) {
11036
      case COUPON_CODE:
11037
        if (value == null) {
11038
          unsetCouponCode();
11039
        } else {
11040
          setCouponCode((String)value);
11041
        }
11042
        break;
11043
 
11044
      case USER_ID:
11045
        if (value == null) {
11046
          unsetUserId();
11047
        } else {
11048
          setUserId((Long)value);
11049
        }
11050
        break;
11051
 
11052
      }
11053
    }
11054
 
11055
    public Object getFieldValue(_Fields field) {
11056
      switch (field) {
11057
      case COUPON_CODE:
11058
        return getCouponCode();
11059
 
11060
      case USER_ID:
3430 rajveer 11061
        return Long.valueOf(getUserId());
1982 varun.gupt 11062
 
11063
      }
11064
      throw new IllegalStateException();
11065
    }
11066
 
3430 rajveer 11067
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11068
    public boolean isSet(_Fields field) {
11069
      if (field == null) {
11070
        throw new IllegalArgumentException();
11071
      }
1982 varun.gupt 11072
 
11073
      switch (field) {
11074
      case COUPON_CODE:
11075
        return isSetCouponCode();
11076
      case USER_ID:
11077
        return isSetUserId();
11078
      }
11079
      throw new IllegalStateException();
11080
    }
11081
 
11082
    @Override
11083
    public boolean equals(Object that) {
11084
      if (that == null)
11085
        return false;
11086
      if (that instanceof getCouponUsageCountByUser_args)
11087
        return this.equals((getCouponUsageCountByUser_args)that);
11088
      return false;
11089
    }
11090
 
11091
    public boolean equals(getCouponUsageCountByUser_args that) {
11092
      if (that == null)
11093
        return false;
11094
 
11095
      boolean this_present_couponCode = true && this.isSetCouponCode();
11096
      boolean that_present_couponCode = true && that.isSetCouponCode();
11097
      if (this_present_couponCode || that_present_couponCode) {
11098
        if (!(this_present_couponCode && that_present_couponCode))
11099
          return false;
11100
        if (!this.couponCode.equals(that.couponCode))
11101
          return false;
11102
      }
11103
 
11104
      boolean this_present_userId = true;
11105
      boolean that_present_userId = true;
11106
      if (this_present_userId || that_present_userId) {
11107
        if (!(this_present_userId && that_present_userId))
11108
          return false;
11109
        if (this.userId != that.userId)
11110
          return false;
11111
      }
11112
 
11113
      return true;
11114
    }
11115
 
11116
    @Override
11117
    public int hashCode() {
11118
      return 0;
11119
    }
11120
 
11121
    public int compareTo(getCouponUsageCountByUser_args other) {
11122
      if (!getClass().equals(other.getClass())) {
11123
        return getClass().getName().compareTo(other.getClass().getName());
11124
      }
11125
 
11126
      int lastComparison = 0;
11127
      getCouponUsageCountByUser_args typedOther = (getCouponUsageCountByUser_args)other;
11128
 
3430 rajveer 11129
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 11130
      if (lastComparison != 0) {
11131
        return lastComparison;
11132
      }
3430 rajveer 11133
      if (isSetCouponCode()) {
11134
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
11135
        if (lastComparison != 0) {
11136
          return lastComparison;
11137
        }
1982 varun.gupt 11138
      }
3430 rajveer 11139
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 11140
      if (lastComparison != 0) {
11141
        return lastComparison;
11142
      }
3430 rajveer 11143
      if (isSetUserId()) {
11144
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
11145
        if (lastComparison != 0) {
11146
          return lastComparison;
11147
        }
1982 varun.gupt 11148
      }
11149
      return 0;
11150
    }
11151
 
3430 rajveer 11152
    public _Fields fieldForId(int fieldId) {
11153
      return _Fields.findByThriftId(fieldId);
11154
    }
11155
 
11156
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11157
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 11158
      iprot.readStructBegin();
11159
      while (true)
11160
      {
11161
        field = iprot.readFieldBegin();
3430 rajveer 11162
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 11163
          break;
11164
        }
3430 rajveer 11165
        switch (field.id) {
11166
          case 1: // COUPON_CODE
11167
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
11168
              this.couponCode = iprot.readString();
11169
            } else { 
11170
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11171
            }
11172
            break;
11173
          case 2: // USER_ID
11174
            if (field.type == org.apache.thrift.protocol.TType.I64) {
11175
              this.userId = iprot.readI64();
11176
              setUserIdIsSet(true);
11177
            } else { 
11178
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11179
            }
11180
            break;
11181
          default:
11182
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 11183
        }
3430 rajveer 11184
        iprot.readFieldEnd();
1982 varun.gupt 11185
      }
11186
      iprot.readStructEnd();
11187
      validate();
11188
    }
11189
 
3430 rajveer 11190
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 11191
      validate();
11192
 
11193
      oprot.writeStructBegin(STRUCT_DESC);
11194
      if (this.couponCode != null) {
11195
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
11196
        oprot.writeString(this.couponCode);
11197
        oprot.writeFieldEnd();
11198
      }
11199
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
11200
      oprot.writeI64(this.userId);
11201
      oprot.writeFieldEnd();
11202
      oprot.writeFieldStop();
11203
      oprot.writeStructEnd();
11204
    }
11205
 
11206
    @Override
11207
    public String toString() {
11208
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_args(");
11209
      boolean first = true;
11210
 
11211
      sb.append("couponCode:");
11212
      if (this.couponCode == null) {
11213
        sb.append("null");
11214
      } else {
11215
        sb.append(this.couponCode);
11216
      }
11217
      first = false;
11218
      if (!first) sb.append(", ");
11219
      sb.append("userId:");
11220
      sb.append(this.userId);
11221
      first = false;
11222
      sb.append(")");
11223
      return sb.toString();
11224
    }
11225
 
3430 rajveer 11226
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 11227
      // check for required fields
11228
    }
11229
 
3430 rajveer 11230
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11231
      try {
11232
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11233
      } catch (org.apache.thrift.TException te) {
11234
        throw new java.io.IOException(te);
11235
      }
11236
    }
11237
 
11238
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11239
      try {
11240
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
11241
        __isset_bit_vector = new BitSet(1);
11242
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11243
      } catch (org.apache.thrift.TException te) {
11244
        throw new java.io.IOException(te);
11245
      }
11246
    }
11247
 
1982 varun.gupt 11248
  }
11249
 
3430 rajveer 11250
  public static class getCouponUsageCountByUser_result implements org.apache.thrift.TBase<getCouponUsageCountByUser_result, getCouponUsageCountByUser_result._Fields>, java.io.Serializable, Cloneable   {
11251
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_result");
1982 varun.gupt 11252
 
3430 rajveer 11253
    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);
11254
    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 11255
 
3430 rajveer 11256
    private long success; // required
11257
    private PromotionException pex; // required
1982 varun.gupt 11258
 
11259
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 11260
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 11261
      SUCCESS((short)0, "success"),
11262
      PEX((short)1, "pex");
11263
 
11264
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11265
 
11266
      static {
11267
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11268
          byName.put(field.getFieldName(), field);
11269
        }
11270
      }
11271
 
11272
      /**
11273
       * Find the _Fields constant that matches fieldId, or null if its not found.
11274
       */
11275
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 11276
        switch(fieldId) {
11277
          case 0: // SUCCESS
11278
            return SUCCESS;
11279
          case 1: // PEX
11280
            return PEX;
11281
          default:
11282
            return null;
11283
        }
1982 varun.gupt 11284
      }
11285
 
11286
      /**
11287
       * Find the _Fields constant that matches fieldId, throwing an exception
11288
       * if it is not found.
11289
       */
11290
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11291
        _Fields fields = findByThriftId(fieldId);
11292
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11293
        return fields;
11294
      }
11295
 
11296
      /**
11297
       * Find the _Fields constant that matches name, or null if its not found.
11298
       */
11299
      public static _Fields findByName(String name) {
11300
        return byName.get(name);
11301
      }
11302
 
11303
      private final short _thriftId;
11304
      private final String _fieldName;
11305
 
11306
      _Fields(short thriftId, String fieldName) {
11307
        _thriftId = thriftId;
11308
        _fieldName = fieldName;
11309
      }
11310
 
11311
      public short getThriftFieldId() {
11312
        return _thriftId;
11313
      }
11314
 
11315
      public String getFieldName() {
11316
        return _fieldName;
11317
      }
11318
    }
11319
 
11320
    // isset id assignments
11321
    private static final int __SUCCESS_ISSET_ID = 0;
11322
    private BitSet __isset_bit_vector = new BitSet(1);
11323
 
3430 rajveer 11324
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 11325
    static {
3430 rajveer 11326
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11327
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11328
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
11329
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11330
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
11331
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11332
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_result.class, metaDataMap);
1982 varun.gupt 11333
    }
11334
 
11335
    public getCouponUsageCountByUser_result() {
11336
    }
11337
 
11338
    public getCouponUsageCountByUser_result(
11339
      long success,
11340
      PromotionException pex)
11341
    {
11342
      this();
11343
      this.success = success;
11344
      setSuccessIsSet(true);
11345
      this.pex = pex;
11346
    }
11347
 
11348
    /**
11349
     * Performs a deep copy on <i>other</i>.
11350
     */
11351
    public getCouponUsageCountByUser_result(getCouponUsageCountByUser_result other) {
11352
      __isset_bit_vector.clear();
11353
      __isset_bit_vector.or(other.__isset_bit_vector);
11354
      this.success = other.success;
11355
      if (other.isSetPex()) {
11356
        this.pex = new PromotionException(other.pex);
11357
      }
11358
    }
11359
 
11360
    public getCouponUsageCountByUser_result deepCopy() {
11361
      return new getCouponUsageCountByUser_result(this);
11362
    }
11363
 
3430 rajveer 11364
    @Override
11365
    public void clear() {
11366
      setSuccessIsSet(false);
11367
      this.success = 0;
11368
      this.pex = null;
1982 varun.gupt 11369
    }
11370
 
11371
    public long getSuccess() {
11372
      return this.success;
11373
    }
11374
 
3430 rajveer 11375
    public void setSuccess(long success) {
1982 varun.gupt 11376
      this.success = success;
11377
      setSuccessIsSet(true);
11378
    }
11379
 
11380
    public void unsetSuccess() {
11381
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
11382
    }
11383
 
3430 rajveer 11384
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 11385
    public boolean isSetSuccess() {
11386
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
11387
    }
11388
 
11389
    public void setSuccessIsSet(boolean value) {
11390
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
11391
    }
11392
 
11393
    public PromotionException getPex() {
11394
      return this.pex;
11395
    }
11396
 
3430 rajveer 11397
    public void setPex(PromotionException pex) {
1982 varun.gupt 11398
      this.pex = pex;
11399
    }
11400
 
11401
    public void unsetPex() {
11402
      this.pex = null;
11403
    }
11404
 
3430 rajveer 11405
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 11406
    public boolean isSetPex() {
11407
      return this.pex != null;
11408
    }
11409
 
11410
    public void setPexIsSet(boolean value) {
11411
      if (!value) {
11412
        this.pex = null;
11413
      }
11414
    }
11415
 
11416
    public void setFieldValue(_Fields field, Object value) {
11417
      switch (field) {
11418
      case SUCCESS:
11419
        if (value == null) {
11420
          unsetSuccess();
11421
        } else {
11422
          setSuccess((Long)value);
11423
        }
11424
        break;
11425
 
11426
      case PEX:
11427
        if (value == null) {
11428
          unsetPex();
11429
        } else {
11430
          setPex((PromotionException)value);
11431
        }
11432
        break;
11433
 
11434
      }
11435
    }
11436
 
11437
    public Object getFieldValue(_Fields field) {
11438
      switch (field) {
11439
      case SUCCESS:
3430 rajveer 11440
        return Long.valueOf(getSuccess());
1982 varun.gupt 11441
 
11442
      case PEX:
11443
        return getPex();
11444
 
11445
      }
11446
      throw new IllegalStateException();
11447
    }
11448
 
3430 rajveer 11449
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11450
    public boolean isSet(_Fields field) {
11451
      if (field == null) {
11452
        throw new IllegalArgumentException();
11453
      }
1982 varun.gupt 11454
 
11455
      switch (field) {
11456
      case SUCCESS:
11457
        return isSetSuccess();
11458
      case PEX:
11459
        return isSetPex();
11460
      }
11461
      throw new IllegalStateException();
11462
    }
11463
 
11464
    @Override
11465
    public boolean equals(Object that) {
11466
      if (that == null)
11467
        return false;
11468
      if (that instanceof getCouponUsageCountByUser_result)
11469
        return this.equals((getCouponUsageCountByUser_result)that);
11470
      return false;
11471
    }
11472
 
11473
    public boolean equals(getCouponUsageCountByUser_result that) {
11474
      if (that == null)
11475
        return false;
11476
 
11477
      boolean this_present_success = true;
11478
      boolean that_present_success = true;
11479
      if (this_present_success || that_present_success) {
11480
        if (!(this_present_success && that_present_success))
11481
          return false;
11482
        if (this.success != that.success)
11483
          return false;
11484
      }
11485
 
11486
      boolean this_present_pex = true && this.isSetPex();
11487
      boolean that_present_pex = true && that.isSetPex();
11488
      if (this_present_pex || that_present_pex) {
11489
        if (!(this_present_pex && that_present_pex))
11490
          return false;
11491
        if (!this.pex.equals(that.pex))
11492
          return false;
11493
      }
11494
 
11495
      return true;
11496
    }
11497
 
11498
    @Override
11499
    public int hashCode() {
11500
      return 0;
11501
    }
11502
 
11503
    public int compareTo(getCouponUsageCountByUser_result other) {
11504
      if (!getClass().equals(other.getClass())) {
11505
        return getClass().getName().compareTo(other.getClass().getName());
11506
      }
11507
 
11508
      int lastComparison = 0;
11509
      getCouponUsageCountByUser_result typedOther = (getCouponUsageCountByUser_result)other;
11510
 
3430 rajveer 11511
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 11512
      if (lastComparison != 0) {
11513
        return lastComparison;
11514
      }
3430 rajveer 11515
      if (isSetSuccess()) {
11516
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
11517
        if (lastComparison != 0) {
11518
          return lastComparison;
11519
        }
1982 varun.gupt 11520
      }
3430 rajveer 11521
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 11522
      if (lastComparison != 0) {
11523
        return lastComparison;
11524
      }
3430 rajveer 11525
      if (isSetPex()) {
11526
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
11527
        if (lastComparison != 0) {
11528
          return lastComparison;
11529
        }
1982 varun.gupt 11530
      }
11531
      return 0;
11532
    }
11533
 
3430 rajveer 11534
    public _Fields fieldForId(int fieldId) {
11535
      return _Fields.findByThriftId(fieldId);
11536
    }
11537
 
11538
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11539
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 11540
      iprot.readStructBegin();
11541
      while (true)
11542
      {
11543
        field = iprot.readFieldBegin();
3430 rajveer 11544
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 11545
          break;
11546
        }
3430 rajveer 11547
        switch (field.id) {
11548
          case 0: // SUCCESS
11549
            if (field.type == org.apache.thrift.protocol.TType.I64) {
11550
              this.success = iprot.readI64();
11551
              setSuccessIsSet(true);
11552
            } else { 
11553
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11554
            }
11555
            break;
11556
          case 1: // PEX
11557
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
11558
              this.pex = new PromotionException();
11559
              this.pex.read(iprot);
11560
            } else { 
11561
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11562
            }
11563
            break;
11564
          default:
11565
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 11566
        }
3430 rajveer 11567
        iprot.readFieldEnd();
1982 varun.gupt 11568
      }
11569
      iprot.readStructEnd();
11570
      validate();
11571
    }
11572
 
3430 rajveer 11573
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 11574
      oprot.writeStructBegin(STRUCT_DESC);
11575
 
11576
      if (this.isSetSuccess()) {
11577
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
11578
        oprot.writeI64(this.success);
11579
        oprot.writeFieldEnd();
11580
      } else if (this.isSetPex()) {
11581
        oprot.writeFieldBegin(PEX_FIELD_DESC);
11582
        this.pex.write(oprot);
11583
        oprot.writeFieldEnd();
11584
      }
11585
      oprot.writeFieldStop();
11586
      oprot.writeStructEnd();
11587
    }
11588
 
11589
    @Override
11590
    public String toString() {
11591
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_result(");
11592
      boolean first = true;
11593
 
11594
      sb.append("success:");
11595
      sb.append(this.success);
11596
      first = false;
11597
      if (!first) sb.append(", ");
11598
      sb.append("pex:");
11599
      if (this.pex == null) {
11600
        sb.append("null");
11601
      } else {
11602
        sb.append(this.pex);
11603
      }
11604
      first = false;
11605
      sb.append(")");
11606
      return sb.toString();
11607
    }
11608
 
3430 rajveer 11609
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 11610
      // check for required fields
11611
    }
11612
 
3430 rajveer 11613
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11614
      try {
11615
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11616
      } catch (org.apache.thrift.TException te) {
11617
        throw new java.io.IOException(te);
11618
      }
11619
    }
11620
 
11621
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11622
      try {
11623
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11624
      } catch (org.apache.thrift.TException te) {
11625
        throw new java.io.IOException(te);
11626
      }
11627
    }
11628
 
1982 varun.gupt 11629
  }
11630
 
6497 amit.gupta 11631
  public static class getActiveCodes_args implements org.apache.thrift.TBase<getActiveCodes_args, getActiveCodes_args._Fields>, java.io.Serializable, Cloneable   {
11632
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCodes_args");
11633
 
11634
    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);
11635
 
11636
    private long promotionId; // required
11637
 
11638
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11639
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11640
      PROMOTION_ID((short)1, "promotionId");
11641
 
11642
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11643
 
11644
      static {
11645
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11646
          byName.put(field.getFieldName(), field);
11647
        }
11648
      }
11649
 
11650
      /**
11651
       * Find the _Fields constant that matches fieldId, or null if its not found.
11652
       */
11653
      public static _Fields findByThriftId(int fieldId) {
11654
        switch(fieldId) {
11655
          case 1: // PROMOTION_ID
11656
            return PROMOTION_ID;
11657
          default:
11658
            return null;
11659
        }
11660
      }
11661
 
11662
      /**
11663
       * Find the _Fields constant that matches fieldId, throwing an exception
11664
       * if it is not found.
11665
       */
11666
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11667
        _Fields fields = findByThriftId(fieldId);
11668
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11669
        return fields;
11670
      }
11671
 
11672
      /**
11673
       * Find the _Fields constant that matches name, or null if its not found.
11674
       */
11675
      public static _Fields findByName(String name) {
11676
        return byName.get(name);
11677
      }
11678
 
11679
      private final short _thriftId;
11680
      private final String _fieldName;
11681
 
11682
      _Fields(short thriftId, String fieldName) {
11683
        _thriftId = thriftId;
11684
        _fieldName = fieldName;
11685
      }
11686
 
11687
      public short getThriftFieldId() {
11688
        return _thriftId;
11689
      }
11690
 
11691
      public String getFieldName() {
11692
        return _fieldName;
11693
      }
11694
    }
11695
 
11696
    // isset id assignments
11697
    private static final int __PROMOTIONID_ISSET_ID = 0;
11698
    private BitSet __isset_bit_vector = new BitSet(1);
11699
 
11700
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
11701
    static {
11702
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11703
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11704
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
11705
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11706
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCodes_args.class, metaDataMap);
11707
    }
11708
 
11709
    public getActiveCodes_args() {
11710
    }
11711
 
11712
    public getActiveCodes_args(
11713
      long promotionId)
11714
    {
11715
      this();
11716
      this.promotionId = promotionId;
11717
      setPromotionIdIsSet(true);
11718
    }
11719
 
11720
    /**
11721
     * Performs a deep copy on <i>other</i>.
11722
     */
11723
    public getActiveCodes_args(getActiveCodes_args other) {
11724
      __isset_bit_vector.clear();
11725
      __isset_bit_vector.or(other.__isset_bit_vector);
11726
      this.promotionId = other.promotionId;
11727
    }
11728
 
11729
    public getActiveCodes_args deepCopy() {
11730
      return new getActiveCodes_args(this);
11731
    }
11732
 
11733
    @Override
11734
    public void clear() {
11735
      setPromotionIdIsSet(false);
11736
      this.promotionId = 0;
11737
    }
11738
 
11739
    public long getPromotionId() {
11740
      return this.promotionId;
11741
    }
11742
 
11743
    public void setPromotionId(long promotionId) {
11744
      this.promotionId = promotionId;
11745
      setPromotionIdIsSet(true);
11746
    }
11747
 
11748
    public void unsetPromotionId() {
11749
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
11750
    }
11751
 
11752
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
11753
    public boolean isSetPromotionId() {
11754
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
11755
    }
11756
 
11757
    public void setPromotionIdIsSet(boolean value) {
11758
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
11759
    }
11760
 
11761
    public void setFieldValue(_Fields field, Object value) {
11762
      switch (field) {
11763
      case PROMOTION_ID:
11764
        if (value == null) {
11765
          unsetPromotionId();
11766
        } else {
11767
          setPromotionId((Long)value);
11768
        }
11769
        break;
11770
 
11771
      }
11772
    }
11773
 
11774
    public Object getFieldValue(_Fields field) {
11775
      switch (field) {
11776
      case PROMOTION_ID:
11777
        return Long.valueOf(getPromotionId());
11778
 
11779
      }
11780
      throw new IllegalStateException();
11781
    }
11782
 
11783
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11784
    public boolean isSet(_Fields field) {
11785
      if (field == null) {
11786
        throw new IllegalArgumentException();
11787
      }
11788
 
11789
      switch (field) {
11790
      case PROMOTION_ID:
11791
        return isSetPromotionId();
11792
      }
11793
      throw new IllegalStateException();
11794
    }
11795
 
11796
    @Override
11797
    public boolean equals(Object that) {
11798
      if (that == null)
11799
        return false;
11800
      if (that instanceof getActiveCodes_args)
11801
        return this.equals((getActiveCodes_args)that);
11802
      return false;
11803
    }
11804
 
11805
    public boolean equals(getActiveCodes_args that) {
11806
      if (that == null)
11807
        return false;
11808
 
11809
      boolean this_present_promotionId = true;
11810
      boolean that_present_promotionId = true;
11811
      if (this_present_promotionId || that_present_promotionId) {
11812
        if (!(this_present_promotionId && that_present_promotionId))
11813
          return false;
11814
        if (this.promotionId != that.promotionId)
11815
          return false;
11816
      }
11817
 
11818
      return true;
11819
    }
11820
 
11821
    @Override
11822
    public int hashCode() {
11823
      return 0;
11824
    }
11825
 
11826
    public int compareTo(getActiveCodes_args other) {
11827
      if (!getClass().equals(other.getClass())) {
11828
        return getClass().getName().compareTo(other.getClass().getName());
11829
      }
11830
 
11831
      int lastComparison = 0;
11832
      getActiveCodes_args typedOther = (getActiveCodes_args)other;
11833
 
11834
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
11835
      if (lastComparison != 0) {
11836
        return lastComparison;
11837
      }
11838
      if (isSetPromotionId()) {
11839
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
11840
        if (lastComparison != 0) {
11841
          return lastComparison;
11842
        }
11843
      }
11844
      return 0;
11845
    }
11846
 
11847
    public _Fields fieldForId(int fieldId) {
11848
      return _Fields.findByThriftId(fieldId);
11849
    }
11850
 
11851
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11852
      org.apache.thrift.protocol.TField field;
11853
      iprot.readStructBegin();
11854
      while (true)
11855
      {
11856
        field = iprot.readFieldBegin();
11857
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
11858
          break;
11859
        }
11860
        switch (field.id) {
11861
          case 1: // PROMOTION_ID
11862
            if (field.type == org.apache.thrift.protocol.TType.I64) {
11863
              this.promotionId = iprot.readI64();
11864
              setPromotionIdIsSet(true);
11865
            } else { 
11866
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11867
            }
11868
            break;
11869
          default:
11870
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11871
        }
11872
        iprot.readFieldEnd();
11873
      }
11874
      iprot.readStructEnd();
11875
      validate();
11876
    }
11877
 
11878
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
11879
      validate();
11880
 
11881
      oprot.writeStructBegin(STRUCT_DESC);
11882
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
11883
      oprot.writeI64(this.promotionId);
11884
      oprot.writeFieldEnd();
11885
      oprot.writeFieldStop();
11886
      oprot.writeStructEnd();
11887
    }
11888
 
11889
    @Override
11890
    public String toString() {
11891
      StringBuilder sb = new StringBuilder("getActiveCodes_args(");
11892
      boolean first = true;
11893
 
11894
      sb.append("promotionId:");
11895
      sb.append(this.promotionId);
11896
      first = false;
11897
      sb.append(")");
11898
      return sb.toString();
11899
    }
11900
 
11901
    public void validate() throws org.apache.thrift.TException {
11902
      // check for required fields
11903
    }
11904
 
11905
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11906
      try {
11907
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11908
      } catch (org.apache.thrift.TException te) {
11909
        throw new java.io.IOException(te);
11910
      }
11911
    }
11912
 
11913
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11914
      try {
11915
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
11916
        __isset_bit_vector = new BitSet(1);
11917
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11918
      } catch (org.apache.thrift.TException te) {
11919
        throw new java.io.IOException(te);
11920
      }
11921
    }
11922
 
11923
  }
11924
 
11925
  public static class getActiveCodes_result implements org.apache.thrift.TBase<getActiveCodes_result, getActiveCodes_result._Fields>, java.io.Serializable, Cloneable   {
11926
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCodes_result");
11927
 
11928
    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);
11929
    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);
11930
 
11931
    private List<Coupon> success; // required
11932
    private PromotionException pex; // required
11933
 
11934
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11935
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11936
      SUCCESS((short)0, "success"),
11937
      PEX((short)1, "pex");
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 0: // SUCCESS
11953
            return SUCCESS;
11954
          case 1: // PEX
11955
            return PEX;
11956
          default:
11957
            return null;
11958
        }
11959
      }
11960
 
11961
      /**
11962
       * Find the _Fields constant that matches fieldId, throwing an exception
11963
       * if it is not found.
11964
       */
11965
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11966
        _Fields fields = findByThriftId(fieldId);
11967
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11968
        return fields;
11969
      }
11970
 
11971
      /**
11972
       * Find the _Fields constant that matches name, or null if its not found.
11973
       */
11974
      public static _Fields findByName(String name) {
11975
        return byName.get(name);
11976
      }
11977
 
11978
      private final short _thriftId;
11979
      private final String _fieldName;
11980
 
11981
      _Fields(short thriftId, String fieldName) {
11982
        _thriftId = thriftId;
11983
        _fieldName = fieldName;
11984
      }
11985
 
11986
      public short getThriftFieldId() {
11987
        return _thriftId;
11988
      }
11989
 
11990
      public String getFieldName() {
11991
        return _fieldName;
11992
      }
11993
    }
11994
 
11995
    // isset id assignments
11996
 
11997
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
11998
    static {
11999
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12000
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12001
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
12002
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
12003
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12004
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
12005
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12006
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCodes_result.class, metaDataMap);
12007
    }
12008
 
12009
    public getActiveCodes_result() {
12010
    }
12011
 
12012
    public getActiveCodes_result(
12013
      List<Coupon> success,
12014
      PromotionException pex)
12015
    {
12016
      this();
12017
      this.success = success;
12018
      this.pex = pex;
12019
    }
12020
 
12021
    /**
12022
     * Performs a deep copy on <i>other</i>.
12023
     */
12024
    public getActiveCodes_result(getActiveCodes_result other) {
12025
      if (other.isSetSuccess()) {
12026
        List<Coupon> __this__success = new ArrayList<Coupon>();
12027
        for (Coupon other_element : other.success) {
12028
          __this__success.add(new Coupon(other_element));
12029
        }
12030
        this.success = __this__success;
12031
      }
12032
      if (other.isSetPex()) {
12033
        this.pex = new PromotionException(other.pex);
12034
      }
12035
    }
12036
 
12037
    public getActiveCodes_result deepCopy() {
12038
      return new getActiveCodes_result(this);
12039
    }
12040
 
12041
    @Override
12042
    public void clear() {
12043
      this.success = null;
12044
      this.pex = null;
12045
    }
12046
 
12047
    public int getSuccessSize() {
12048
      return (this.success == null) ? 0 : this.success.size();
12049
    }
12050
 
12051
    public java.util.Iterator<Coupon> getSuccessIterator() {
12052
      return (this.success == null) ? null : this.success.iterator();
12053
    }
12054
 
12055
    public void addToSuccess(Coupon elem) {
12056
      if (this.success == null) {
12057
        this.success = new ArrayList<Coupon>();
12058
      }
12059
      this.success.add(elem);
12060
    }
12061
 
12062
    public List<Coupon> getSuccess() {
12063
      return this.success;
12064
    }
12065
 
12066
    public void setSuccess(List<Coupon> success) {
12067
      this.success = success;
12068
    }
12069
 
12070
    public void unsetSuccess() {
12071
      this.success = null;
12072
    }
12073
 
12074
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
12075
    public boolean isSetSuccess() {
12076
      return this.success != null;
12077
    }
12078
 
12079
    public void setSuccessIsSet(boolean value) {
12080
      if (!value) {
12081
        this.success = null;
12082
      }
12083
    }
12084
 
12085
    public PromotionException getPex() {
12086
      return this.pex;
12087
    }
12088
 
12089
    public void setPex(PromotionException pex) {
12090
      this.pex = pex;
12091
    }
12092
 
12093
    public void unsetPex() {
12094
      this.pex = null;
12095
    }
12096
 
12097
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
12098
    public boolean isSetPex() {
12099
      return this.pex != null;
12100
    }
12101
 
12102
    public void setPexIsSet(boolean value) {
12103
      if (!value) {
12104
        this.pex = null;
12105
      }
12106
    }
12107
 
12108
    public void setFieldValue(_Fields field, Object value) {
12109
      switch (field) {
12110
      case SUCCESS:
12111
        if (value == null) {
12112
          unsetSuccess();
12113
        } else {
12114
          setSuccess((List<Coupon>)value);
12115
        }
12116
        break;
12117
 
12118
      case PEX:
12119
        if (value == null) {
12120
          unsetPex();
12121
        } else {
12122
          setPex((PromotionException)value);
12123
        }
12124
        break;
12125
 
12126
      }
12127
    }
12128
 
12129
    public Object getFieldValue(_Fields field) {
12130
      switch (field) {
12131
      case SUCCESS:
12132
        return getSuccess();
12133
 
12134
      case PEX:
12135
        return getPex();
12136
 
12137
      }
12138
      throw new IllegalStateException();
12139
    }
12140
 
12141
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12142
    public boolean isSet(_Fields field) {
12143
      if (field == null) {
12144
        throw new IllegalArgumentException();
12145
      }
12146
 
12147
      switch (field) {
12148
      case SUCCESS:
12149
        return isSetSuccess();
12150
      case PEX:
12151
        return isSetPex();
12152
      }
12153
      throw new IllegalStateException();
12154
    }
12155
 
12156
    @Override
12157
    public boolean equals(Object that) {
12158
      if (that == null)
12159
        return false;
12160
      if (that instanceof getActiveCodes_result)
12161
        return this.equals((getActiveCodes_result)that);
12162
      return false;
12163
    }
12164
 
12165
    public boolean equals(getActiveCodes_result that) {
12166
      if (that == null)
12167
        return false;
12168
 
12169
      boolean this_present_success = true && this.isSetSuccess();
12170
      boolean that_present_success = true && that.isSetSuccess();
12171
      if (this_present_success || that_present_success) {
12172
        if (!(this_present_success && that_present_success))
12173
          return false;
12174
        if (!this.success.equals(that.success))
12175
          return false;
12176
      }
12177
 
12178
      boolean this_present_pex = true && this.isSetPex();
12179
      boolean that_present_pex = true && that.isSetPex();
12180
      if (this_present_pex || that_present_pex) {
12181
        if (!(this_present_pex && that_present_pex))
12182
          return false;
12183
        if (!this.pex.equals(that.pex))
12184
          return false;
12185
      }
12186
 
12187
      return true;
12188
    }
12189
 
12190
    @Override
12191
    public int hashCode() {
12192
      return 0;
12193
    }
12194
 
12195
    public int compareTo(getActiveCodes_result other) {
12196
      if (!getClass().equals(other.getClass())) {
12197
        return getClass().getName().compareTo(other.getClass().getName());
12198
      }
12199
 
12200
      int lastComparison = 0;
12201
      getActiveCodes_result typedOther = (getActiveCodes_result)other;
12202
 
12203
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
12204
      if (lastComparison != 0) {
12205
        return lastComparison;
12206
      }
12207
      if (isSetSuccess()) {
12208
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
12209
        if (lastComparison != 0) {
12210
          return lastComparison;
12211
        }
12212
      }
12213
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
12214
      if (lastComparison != 0) {
12215
        return lastComparison;
12216
      }
12217
      if (isSetPex()) {
12218
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
12219
        if (lastComparison != 0) {
12220
          return lastComparison;
12221
        }
12222
      }
12223
      return 0;
12224
    }
12225
 
12226
    public _Fields fieldForId(int fieldId) {
12227
      return _Fields.findByThriftId(fieldId);
12228
    }
12229
 
12230
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12231
      org.apache.thrift.protocol.TField field;
12232
      iprot.readStructBegin();
12233
      while (true)
12234
      {
12235
        field = iprot.readFieldBegin();
12236
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12237
          break;
12238
        }
12239
        switch (field.id) {
12240
          case 0: // SUCCESS
12241
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
12242
              {
11592 amit.gupta 12243
                org.apache.thrift.protocol.TList _list30 = iprot.readListBegin();
12244
                this.success = new ArrayList<Coupon>(_list30.size);
12245
                for (int _i31 = 0; _i31 < _list30.size; ++_i31)
6497 amit.gupta 12246
                {
11592 amit.gupta 12247
                  Coupon _elem32; // required
12248
                  _elem32 = new Coupon();
12249
                  _elem32.read(iprot);
12250
                  this.success.add(_elem32);
6497 amit.gupta 12251
                }
12252
                iprot.readListEnd();
12253
              }
12254
            } else { 
12255
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12256
            }
12257
            break;
12258
          case 1: // PEX
12259
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
12260
              this.pex = new PromotionException();
12261
              this.pex.read(iprot);
12262
            } else { 
12263
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12264
            }
12265
            break;
12266
          default:
12267
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12268
        }
12269
        iprot.readFieldEnd();
12270
      }
12271
      iprot.readStructEnd();
12272
      validate();
12273
    }
12274
 
12275
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12276
      oprot.writeStructBegin(STRUCT_DESC);
12277
 
12278
      if (this.isSetSuccess()) {
12279
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
12280
        {
12281
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
11592 amit.gupta 12282
          for (Coupon _iter33 : this.success)
6497 amit.gupta 12283
          {
11592 amit.gupta 12284
            _iter33.write(oprot);
6497 amit.gupta 12285
          }
12286
          oprot.writeListEnd();
12287
        }
12288
        oprot.writeFieldEnd();
12289
      } else if (this.isSetPex()) {
12290
        oprot.writeFieldBegin(PEX_FIELD_DESC);
12291
        this.pex.write(oprot);
12292
        oprot.writeFieldEnd();
12293
      }
12294
      oprot.writeFieldStop();
12295
      oprot.writeStructEnd();
12296
    }
12297
 
12298
    @Override
12299
    public String toString() {
12300
      StringBuilder sb = new StringBuilder("getActiveCodes_result(");
12301
      boolean first = true;
12302
 
12303
      sb.append("success:");
12304
      if (this.success == null) {
12305
        sb.append("null");
12306
      } else {
12307
        sb.append(this.success);
12308
      }
12309
      first = false;
12310
      if (!first) sb.append(", ");
12311
      sb.append("pex:");
12312
      if (this.pex == null) {
12313
        sb.append("null");
12314
      } else {
12315
        sb.append(this.pex);
12316
      }
12317
      first = false;
12318
      sb.append(")");
12319
      return sb.toString();
12320
    }
12321
 
12322
    public void validate() throws org.apache.thrift.TException {
12323
      // check for required fields
12324
    }
12325
 
12326
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12327
      try {
12328
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12329
      } catch (org.apache.thrift.TException te) {
12330
        throw new java.io.IOException(te);
12331
      }
12332
    }
12333
 
12334
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12335
      try {
12336
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12337
      } catch (org.apache.thrift.TException te) {
12338
        throw new java.io.IOException(te);
12339
      }
12340
    }
12341
 
12342
  }
12343
 
12344
  public static class deleteCoupon_args implements org.apache.thrift.TBase<deleteCoupon_args, deleteCoupon_args._Fields>, java.io.Serializable, Cloneable   {
12345
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteCoupon_args");
12346
 
12347
    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);
12348
 
12349
    private String couponCode; // required
12350
 
12351
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12352
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12353
      COUPON_CODE((short)1, "couponCode");
12354
 
12355
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12356
 
12357
      static {
12358
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12359
          byName.put(field.getFieldName(), field);
12360
        }
12361
      }
12362
 
12363
      /**
12364
       * Find the _Fields constant that matches fieldId, or null if its not found.
12365
       */
12366
      public static _Fields findByThriftId(int fieldId) {
12367
        switch(fieldId) {
12368
          case 1: // COUPON_CODE
12369
            return COUPON_CODE;
12370
          default:
12371
            return null;
12372
        }
12373
      }
12374
 
12375
      /**
12376
       * Find the _Fields constant that matches fieldId, throwing an exception
12377
       * if it is not found.
12378
       */
12379
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12380
        _Fields fields = findByThriftId(fieldId);
12381
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12382
        return fields;
12383
      }
12384
 
12385
      /**
12386
       * Find the _Fields constant that matches name, or null if its not found.
12387
       */
12388
      public static _Fields findByName(String name) {
12389
        return byName.get(name);
12390
      }
12391
 
12392
      private final short _thriftId;
12393
      private final String _fieldName;
12394
 
12395
      _Fields(short thriftId, String fieldName) {
12396
        _thriftId = thriftId;
12397
        _fieldName = fieldName;
12398
      }
12399
 
12400
      public short getThriftFieldId() {
12401
        return _thriftId;
12402
      }
12403
 
12404
      public String getFieldName() {
12405
        return _fieldName;
12406
      }
12407
    }
12408
 
12409
    // isset id assignments
12410
 
12411
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12412
    static {
12413
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12414
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12415
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
12416
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12417
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteCoupon_args.class, metaDataMap);
12418
    }
12419
 
12420
    public deleteCoupon_args() {
12421
    }
12422
 
12423
    public deleteCoupon_args(
12424
      String couponCode)
12425
    {
12426
      this();
12427
      this.couponCode = couponCode;
12428
    }
12429
 
12430
    /**
12431
     * Performs a deep copy on <i>other</i>.
12432
     */
12433
    public deleteCoupon_args(deleteCoupon_args other) {
12434
      if (other.isSetCouponCode()) {
12435
        this.couponCode = other.couponCode;
12436
      }
12437
    }
12438
 
12439
    public deleteCoupon_args deepCopy() {
12440
      return new deleteCoupon_args(this);
12441
    }
12442
 
12443
    @Override
12444
    public void clear() {
12445
      this.couponCode = null;
12446
    }
12447
 
12448
    public String getCouponCode() {
12449
      return this.couponCode;
12450
    }
12451
 
12452
    public void setCouponCode(String couponCode) {
12453
      this.couponCode = couponCode;
12454
    }
12455
 
12456
    public void unsetCouponCode() {
12457
      this.couponCode = null;
12458
    }
12459
 
12460
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
12461
    public boolean isSetCouponCode() {
12462
      return this.couponCode != null;
12463
    }
12464
 
12465
    public void setCouponCodeIsSet(boolean value) {
12466
      if (!value) {
12467
        this.couponCode = null;
12468
      }
12469
    }
12470
 
12471
    public void setFieldValue(_Fields field, Object value) {
12472
      switch (field) {
12473
      case COUPON_CODE:
12474
        if (value == null) {
12475
          unsetCouponCode();
12476
        } else {
12477
          setCouponCode((String)value);
12478
        }
12479
        break;
12480
 
12481
      }
12482
    }
12483
 
12484
    public Object getFieldValue(_Fields field) {
12485
      switch (field) {
12486
      case COUPON_CODE:
12487
        return getCouponCode();
12488
 
12489
      }
12490
      throw new IllegalStateException();
12491
    }
12492
 
12493
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12494
    public boolean isSet(_Fields field) {
12495
      if (field == null) {
12496
        throw new IllegalArgumentException();
12497
      }
12498
 
12499
      switch (field) {
12500
      case COUPON_CODE:
12501
        return isSetCouponCode();
12502
      }
12503
      throw new IllegalStateException();
12504
    }
12505
 
12506
    @Override
12507
    public boolean equals(Object that) {
12508
      if (that == null)
12509
        return false;
12510
      if (that instanceof deleteCoupon_args)
12511
        return this.equals((deleteCoupon_args)that);
12512
      return false;
12513
    }
12514
 
12515
    public boolean equals(deleteCoupon_args that) {
12516
      if (that == null)
12517
        return false;
12518
 
12519
      boolean this_present_couponCode = true && this.isSetCouponCode();
12520
      boolean that_present_couponCode = true && that.isSetCouponCode();
12521
      if (this_present_couponCode || that_present_couponCode) {
12522
        if (!(this_present_couponCode && that_present_couponCode))
12523
          return false;
12524
        if (!this.couponCode.equals(that.couponCode))
12525
          return false;
12526
      }
12527
 
12528
      return true;
12529
    }
12530
 
12531
    @Override
12532
    public int hashCode() {
12533
      return 0;
12534
    }
12535
 
12536
    public int compareTo(deleteCoupon_args other) {
12537
      if (!getClass().equals(other.getClass())) {
12538
        return getClass().getName().compareTo(other.getClass().getName());
12539
      }
12540
 
12541
      int lastComparison = 0;
12542
      deleteCoupon_args typedOther = (deleteCoupon_args)other;
12543
 
12544
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
12545
      if (lastComparison != 0) {
12546
        return lastComparison;
12547
      }
12548
      if (isSetCouponCode()) {
12549
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
12550
        if (lastComparison != 0) {
12551
          return lastComparison;
12552
        }
12553
      }
12554
      return 0;
12555
    }
12556
 
12557
    public _Fields fieldForId(int fieldId) {
12558
      return _Fields.findByThriftId(fieldId);
12559
    }
12560
 
12561
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12562
      org.apache.thrift.protocol.TField field;
12563
      iprot.readStructBegin();
12564
      while (true)
12565
      {
12566
        field = iprot.readFieldBegin();
12567
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12568
          break;
12569
        }
12570
        switch (field.id) {
12571
          case 1: // COUPON_CODE
12572
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
12573
              this.couponCode = iprot.readString();
12574
            } else { 
12575
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12576
            }
12577
            break;
12578
          default:
12579
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12580
        }
12581
        iprot.readFieldEnd();
12582
      }
12583
      iprot.readStructEnd();
12584
      validate();
12585
    }
12586
 
12587
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12588
      validate();
12589
 
12590
      oprot.writeStructBegin(STRUCT_DESC);
12591
      if (this.couponCode != null) {
12592
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
12593
        oprot.writeString(this.couponCode);
12594
        oprot.writeFieldEnd();
12595
      }
12596
      oprot.writeFieldStop();
12597
      oprot.writeStructEnd();
12598
    }
12599
 
12600
    @Override
12601
    public String toString() {
12602
      StringBuilder sb = new StringBuilder("deleteCoupon_args(");
12603
      boolean first = true;
12604
 
12605
      sb.append("couponCode:");
12606
      if (this.couponCode == null) {
12607
        sb.append("null");
12608
      } else {
12609
        sb.append(this.couponCode);
12610
      }
12611
      first = false;
12612
      sb.append(")");
12613
      return sb.toString();
12614
    }
12615
 
12616
    public void validate() throws org.apache.thrift.TException {
12617
      // check for required fields
12618
    }
12619
 
12620
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12621
      try {
12622
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12623
      } catch (org.apache.thrift.TException te) {
12624
        throw new java.io.IOException(te);
12625
      }
12626
    }
12627
 
12628
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12629
      try {
12630
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12631
      } catch (org.apache.thrift.TException te) {
12632
        throw new java.io.IOException(te);
12633
      }
12634
    }
12635
 
12636
  }
12637
 
12638
  public static class deleteCoupon_result implements org.apache.thrift.TBase<deleteCoupon_result, deleteCoupon_result._Fields>, java.io.Serializable, Cloneable   {
12639
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteCoupon_result");
12640
 
12641
    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);
12642
 
12643
    private PromotionException pex; // required
12644
 
12645
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12646
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12647
      PEX((short)1, "pex");
12648
 
12649
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12650
 
12651
      static {
12652
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12653
          byName.put(field.getFieldName(), field);
12654
        }
12655
      }
12656
 
12657
      /**
12658
       * Find the _Fields constant that matches fieldId, or null if its not found.
12659
       */
12660
      public static _Fields findByThriftId(int fieldId) {
12661
        switch(fieldId) {
12662
          case 1: // PEX
12663
            return PEX;
12664
          default:
12665
            return null;
12666
        }
12667
      }
12668
 
12669
      /**
12670
       * Find the _Fields constant that matches fieldId, throwing an exception
12671
       * if it is not found.
12672
       */
12673
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12674
        _Fields fields = findByThriftId(fieldId);
12675
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12676
        return fields;
12677
      }
12678
 
12679
      /**
12680
       * Find the _Fields constant that matches name, or null if its not found.
12681
       */
12682
      public static _Fields findByName(String name) {
12683
        return byName.get(name);
12684
      }
12685
 
12686
      private final short _thriftId;
12687
      private final String _fieldName;
12688
 
12689
      _Fields(short thriftId, String fieldName) {
12690
        _thriftId = thriftId;
12691
        _fieldName = fieldName;
12692
      }
12693
 
12694
      public short getThriftFieldId() {
12695
        return _thriftId;
12696
      }
12697
 
12698
      public String getFieldName() {
12699
        return _fieldName;
12700
      }
12701
    }
12702
 
12703
    // isset id assignments
12704
 
12705
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12706
    static {
12707
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12708
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12709
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
12710
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12711
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteCoupon_result.class, metaDataMap);
12712
    }
12713
 
12714
    public deleteCoupon_result() {
12715
    }
12716
 
12717
    public deleteCoupon_result(
12718
      PromotionException pex)
12719
    {
12720
      this();
12721
      this.pex = pex;
12722
    }
12723
 
12724
    /**
12725
     * Performs a deep copy on <i>other</i>.
12726
     */
12727
    public deleteCoupon_result(deleteCoupon_result other) {
12728
      if (other.isSetPex()) {
12729
        this.pex = new PromotionException(other.pex);
12730
      }
12731
    }
12732
 
12733
    public deleteCoupon_result deepCopy() {
12734
      return new deleteCoupon_result(this);
12735
    }
12736
 
12737
    @Override
12738
    public void clear() {
12739
      this.pex = null;
12740
    }
12741
 
12742
    public PromotionException getPex() {
12743
      return this.pex;
12744
    }
12745
 
12746
    public void setPex(PromotionException pex) {
12747
      this.pex = pex;
12748
    }
12749
 
12750
    public void unsetPex() {
12751
      this.pex = null;
12752
    }
12753
 
12754
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
12755
    public boolean isSetPex() {
12756
      return this.pex != null;
12757
    }
12758
 
12759
    public void setPexIsSet(boolean value) {
12760
      if (!value) {
12761
        this.pex = null;
12762
      }
12763
    }
12764
 
12765
    public void setFieldValue(_Fields field, Object value) {
12766
      switch (field) {
12767
      case PEX:
12768
        if (value == null) {
12769
          unsetPex();
12770
        } else {
12771
          setPex((PromotionException)value);
12772
        }
12773
        break;
12774
 
12775
      }
12776
    }
12777
 
12778
    public Object getFieldValue(_Fields field) {
12779
      switch (field) {
12780
      case PEX:
12781
        return getPex();
12782
 
12783
      }
12784
      throw new IllegalStateException();
12785
    }
12786
 
12787
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12788
    public boolean isSet(_Fields field) {
12789
      if (field == null) {
12790
        throw new IllegalArgumentException();
12791
      }
12792
 
12793
      switch (field) {
12794
      case PEX:
12795
        return isSetPex();
12796
      }
12797
      throw new IllegalStateException();
12798
    }
12799
 
12800
    @Override
12801
    public boolean equals(Object that) {
12802
      if (that == null)
12803
        return false;
12804
      if (that instanceof deleteCoupon_result)
12805
        return this.equals((deleteCoupon_result)that);
12806
      return false;
12807
    }
12808
 
12809
    public boolean equals(deleteCoupon_result that) {
12810
      if (that == null)
12811
        return false;
12812
 
12813
      boolean this_present_pex = true && this.isSetPex();
12814
      boolean that_present_pex = true && that.isSetPex();
12815
      if (this_present_pex || that_present_pex) {
12816
        if (!(this_present_pex && that_present_pex))
12817
          return false;
12818
        if (!this.pex.equals(that.pex))
12819
          return false;
12820
      }
12821
 
12822
      return true;
12823
    }
12824
 
12825
    @Override
12826
    public int hashCode() {
12827
      return 0;
12828
    }
12829
 
12830
    public int compareTo(deleteCoupon_result other) {
12831
      if (!getClass().equals(other.getClass())) {
12832
        return getClass().getName().compareTo(other.getClass().getName());
12833
      }
12834
 
12835
      int lastComparison = 0;
12836
      deleteCoupon_result typedOther = (deleteCoupon_result)other;
12837
 
12838
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
12839
      if (lastComparison != 0) {
12840
        return lastComparison;
12841
      }
12842
      if (isSetPex()) {
12843
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
12844
        if (lastComparison != 0) {
12845
          return lastComparison;
12846
        }
12847
      }
12848
      return 0;
12849
    }
12850
 
12851
    public _Fields fieldForId(int fieldId) {
12852
      return _Fields.findByThriftId(fieldId);
12853
    }
12854
 
12855
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12856
      org.apache.thrift.protocol.TField field;
12857
      iprot.readStructBegin();
12858
      while (true)
12859
      {
12860
        field = iprot.readFieldBegin();
12861
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12862
          break;
12863
        }
12864
        switch (field.id) {
12865
          case 1: // PEX
12866
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
12867
              this.pex = new PromotionException();
12868
              this.pex.read(iprot);
12869
            } else { 
12870
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12871
            }
12872
            break;
12873
          default:
12874
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12875
        }
12876
        iprot.readFieldEnd();
12877
      }
12878
      iprot.readStructEnd();
12879
      validate();
12880
    }
12881
 
12882
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12883
      oprot.writeStructBegin(STRUCT_DESC);
12884
 
12885
      if (this.isSetPex()) {
12886
        oprot.writeFieldBegin(PEX_FIELD_DESC);
12887
        this.pex.write(oprot);
12888
        oprot.writeFieldEnd();
12889
      }
12890
      oprot.writeFieldStop();
12891
      oprot.writeStructEnd();
12892
    }
12893
 
12894
    @Override
12895
    public String toString() {
12896
      StringBuilder sb = new StringBuilder("deleteCoupon_result(");
12897
      boolean first = true;
12898
 
12899
      sb.append("pex:");
12900
      if (this.pex == null) {
12901
        sb.append("null");
12902
      } else {
12903
        sb.append(this.pex);
12904
      }
12905
      first = false;
12906
      sb.append(")");
12907
      return sb.toString();
12908
    }
12909
 
12910
    public void validate() throws org.apache.thrift.TException {
12911
      // check for required fields
12912
    }
12913
 
12914
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12915
      try {
12916
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12917
      } catch (org.apache.thrift.TException te) {
12918
        throw new java.io.IOException(te);
12919
      }
12920
    }
12921
 
12922
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12923
      try {
12924
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12925
      } catch (org.apache.thrift.TException te) {
12926
        throw new java.io.IOException(te);
12927
      }
12928
    }
12929
 
12930
  }
12931
 
7092 amit.gupta 12932
  public static class getAllCouponsByPromotionId_args implements org.apache.thrift.TBase<getAllCouponsByPromotionId_args, getAllCouponsByPromotionId_args._Fields>, java.io.Serializable, Cloneable   {
12933
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllCouponsByPromotionId_args");
12934
 
12935
    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);
12936
 
12937
    private long promotionId; // required
12938
 
12939
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12940
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12941
      PROMOTION_ID((short)1, "promotionId");
12942
 
12943
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12944
 
12945
      static {
12946
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12947
          byName.put(field.getFieldName(), field);
12948
        }
12949
      }
12950
 
12951
      /**
12952
       * Find the _Fields constant that matches fieldId, or null if its not found.
12953
       */
12954
      public static _Fields findByThriftId(int fieldId) {
12955
        switch(fieldId) {
12956
          case 1: // PROMOTION_ID
12957
            return PROMOTION_ID;
12958
          default:
12959
            return null;
12960
        }
12961
      }
12962
 
12963
      /**
12964
       * Find the _Fields constant that matches fieldId, throwing an exception
12965
       * if it is not found.
12966
       */
12967
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12968
        _Fields fields = findByThriftId(fieldId);
12969
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12970
        return fields;
12971
      }
12972
 
12973
      /**
12974
       * Find the _Fields constant that matches name, or null if its not found.
12975
       */
12976
      public static _Fields findByName(String name) {
12977
        return byName.get(name);
12978
      }
12979
 
12980
      private final short _thriftId;
12981
      private final String _fieldName;
12982
 
12983
      _Fields(short thriftId, String fieldName) {
12984
        _thriftId = thriftId;
12985
        _fieldName = fieldName;
12986
      }
12987
 
12988
      public short getThriftFieldId() {
12989
        return _thriftId;
12990
      }
12991
 
12992
      public String getFieldName() {
12993
        return _fieldName;
12994
      }
12995
    }
12996
 
12997
    // isset id assignments
12998
    private static final int __PROMOTIONID_ISSET_ID = 0;
12999
    private BitSet __isset_bit_vector = new BitSet(1);
13000
 
13001
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
13002
    static {
13003
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13004
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13005
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
13006
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13007
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllCouponsByPromotionId_args.class, metaDataMap);
13008
    }
13009
 
13010
    public getAllCouponsByPromotionId_args() {
13011
    }
13012
 
13013
    public getAllCouponsByPromotionId_args(
13014
      long promotionId)
13015
    {
13016
      this();
13017
      this.promotionId = promotionId;
13018
      setPromotionIdIsSet(true);
13019
    }
13020
 
13021
    /**
13022
     * Performs a deep copy on <i>other</i>.
13023
     */
13024
    public getAllCouponsByPromotionId_args(getAllCouponsByPromotionId_args other) {
13025
      __isset_bit_vector.clear();
13026
      __isset_bit_vector.or(other.__isset_bit_vector);
13027
      this.promotionId = other.promotionId;
13028
    }
13029
 
13030
    public getAllCouponsByPromotionId_args deepCopy() {
13031
      return new getAllCouponsByPromotionId_args(this);
13032
    }
13033
 
13034
    @Override
13035
    public void clear() {
13036
      setPromotionIdIsSet(false);
13037
      this.promotionId = 0;
13038
    }
13039
 
13040
    public long getPromotionId() {
13041
      return this.promotionId;
13042
    }
13043
 
13044
    public void setPromotionId(long promotionId) {
13045
      this.promotionId = promotionId;
13046
      setPromotionIdIsSet(true);
13047
    }
13048
 
13049
    public void unsetPromotionId() {
13050
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
13051
    }
13052
 
13053
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
13054
    public boolean isSetPromotionId() {
13055
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
13056
    }
13057
 
13058
    public void setPromotionIdIsSet(boolean value) {
13059
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
13060
    }
13061
 
13062
    public void setFieldValue(_Fields field, Object value) {
13063
      switch (field) {
13064
      case PROMOTION_ID:
13065
        if (value == null) {
13066
          unsetPromotionId();
13067
        } else {
13068
          setPromotionId((Long)value);
13069
        }
13070
        break;
13071
 
13072
      }
13073
    }
13074
 
13075
    public Object getFieldValue(_Fields field) {
13076
      switch (field) {
13077
      case PROMOTION_ID:
13078
        return Long.valueOf(getPromotionId());
13079
 
13080
      }
13081
      throw new IllegalStateException();
13082
    }
13083
 
13084
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13085
    public boolean isSet(_Fields field) {
13086
      if (field == null) {
13087
        throw new IllegalArgumentException();
13088
      }
13089
 
13090
      switch (field) {
13091
      case PROMOTION_ID:
13092
        return isSetPromotionId();
13093
      }
13094
      throw new IllegalStateException();
13095
    }
13096
 
13097
    @Override
13098
    public boolean equals(Object that) {
13099
      if (that == null)
13100
        return false;
13101
      if (that instanceof getAllCouponsByPromotionId_args)
13102
        return this.equals((getAllCouponsByPromotionId_args)that);
13103
      return false;
13104
    }
13105
 
13106
    public boolean equals(getAllCouponsByPromotionId_args that) {
13107
      if (that == null)
13108
        return false;
13109
 
13110
      boolean this_present_promotionId = true;
13111
      boolean that_present_promotionId = true;
13112
      if (this_present_promotionId || that_present_promotionId) {
13113
        if (!(this_present_promotionId && that_present_promotionId))
13114
          return false;
13115
        if (this.promotionId != that.promotionId)
13116
          return false;
13117
      }
13118
 
13119
      return true;
13120
    }
13121
 
13122
    @Override
13123
    public int hashCode() {
13124
      return 0;
13125
    }
13126
 
13127
    public int compareTo(getAllCouponsByPromotionId_args other) {
13128
      if (!getClass().equals(other.getClass())) {
13129
        return getClass().getName().compareTo(other.getClass().getName());
13130
      }
13131
 
13132
      int lastComparison = 0;
13133
      getAllCouponsByPromotionId_args typedOther = (getAllCouponsByPromotionId_args)other;
13134
 
13135
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
13136
      if (lastComparison != 0) {
13137
        return lastComparison;
13138
      }
13139
      if (isSetPromotionId()) {
13140
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
13141
        if (lastComparison != 0) {
13142
          return lastComparison;
13143
        }
13144
      }
13145
      return 0;
13146
    }
13147
 
13148
    public _Fields fieldForId(int fieldId) {
13149
      return _Fields.findByThriftId(fieldId);
13150
    }
13151
 
13152
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13153
      org.apache.thrift.protocol.TField field;
13154
      iprot.readStructBegin();
13155
      while (true)
13156
      {
13157
        field = iprot.readFieldBegin();
13158
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
13159
          break;
13160
        }
13161
        switch (field.id) {
13162
          case 1: // PROMOTION_ID
13163
            if (field.type == org.apache.thrift.protocol.TType.I64) {
13164
              this.promotionId = iprot.readI64();
13165
              setPromotionIdIsSet(true);
13166
            } else { 
13167
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13168
            }
13169
            break;
13170
          default:
13171
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13172
        }
13173
        iprot.readFieldEnd();
13174
      }
13175
      iprot.readStructEnd();
13176
      validate();
13177
    }
13178
 
13179
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
13180
      validate();
13181
 
13182
      oprot.writeStructBegin(STRUCT_DESC);
13183
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
13184
      oprot.writeI64(this.promotionId);
13185
      oprot.writeFieldEnd();
13186
      oprot.writeFieldStop();
13187
      oprot.writeStructEnd();
13188
    }
13189
 
13190
    @Override
13191
    public String toString() {
13192
      StringBuilder sb = new StringBuilder("getAllCouponsByPromotionId_args(");
13193
      boolean first = true;
13194
 
13195
      sb.append("promotionId:");
13196
      sb.append(this.promotionId);
13197
      first = false;
13198
      sb.append(")");
13199
      return sb.toString();
13200
    }
13201
 
13202
    public void validate() throws org.apache.thrift.TException {
13203
      // check for required fields
13204
    }
13205
 
13206
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13207
      try {
13208
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13209
      } catch (org.apache.thrift.TException te) {
13210
        throw new java.io.IOException(te);
13211
      }
13212
    }
13213
 
13214
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13215
      try {
13216
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
13217
        __isset_bit_vector = new BitSet(1);
13218
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13219
      } catch (org.apache.thrift.TException te) {
13220
        throw new java.io.IOException(te);
13221
      }
13222
    }
13223
 
13224
  }
13225
 
13226
  public static class getAllCouponsByPromotionId_result implements org.apache.thrift.TBase<getAllCouponsByPromotionId_result, getAllCouponsByPromotionId_result._Fields>, java.io.Serializable, Cloneable   {
13227
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllCouponsByPromotionId_result");
13228
 
13229
    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);
13230
    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);
13231
 
13232
    private List<Coupon> success; // required
13233
    private PromotionException pex; // required
13234
 
13235
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
13236
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
13237
      SUCCESS((short)0, "success"),
13238
      PEX((short)1, "pex");
13239
 
13240
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13241
 
13242
      static {
13243
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13244
          byName.put(field.getFieldName(), field);
13245
        }
13246
      }
13247
 
13248
      /**
13249
       * Find the _Fields constant that matches fieldId, or null if its not found.
13250
       */
13251
      public static _Fields findByThriftId(int fieldId) {
13252
        switch(fieldId) {
13253
          case 0: // SUCCESS
13254
            return SUCCESS;
13255
          case 1: // PEX
13256
            return PEX;
13257
          default:
13258
            return null;
13259
        }
13260
      }
13261
 
13262
      /**
13263
       * Find the _Fields constant that matches fieldId, throwing an exception
13264
       * if it is not found.
13265
       */
13266
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13267
        _Fields fields = findByThriftId(fieldId);
13268
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13269
        return fields;
13270
      }
13271
 
13272
      /**
13273
       * Find the _Fields constant that matches name, or null if its not found.
13274
       */
13275
      public static _Fields findByName(String name) {
13276
        return byName.get(name);
13277
      }
13278
 
13279
      private final short _thriftId;
13280
      private final String _fieldName;
13281
 
13282
      _Fields(short thriftId, String fieldName) {
13283
        _thriftId = thriftId;
13284
        _fieldName = fieldName;
13285
      }
13286
 
13287
      public short getThriftFieldId() {
13288
        return _thriftId;
13289
      }
13290
 
13291
      public String getFieldName() {
13292
        return _fieldName;
13293
      }
13294
    }
13295
 
13296
    // isset id assignments
13297
 
13298
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
13299
    static {
13300
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13301
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13302
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
13303
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
13304
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13305
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
13306
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13307
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllCouponsByPromotionId_result.class, metaDataMap);
13308
    }
13309
 
13310
    public getAllCouponsByPromotionId_result() {
13311
    }
13312
 
13313
    public getAllCouponsByPromotionId_result(
13314
      List<Coupon> success,
13315
      PromotionException pex)
13316
    {
13317
      this();
13318
      this.success = success;
13319
      this.pex = pex;
13320
    }
13321
 
13322
    /**
13323
     * Performs a deep copy on <i>other</i>.
13324
     */
13325
    public getAllCouponsByPromotionId_result(getAllCouponsByPromotionId_result other) {
13326
      if (other.isSetSuccess()) {
13327
        List<Coupon> __this__success = new ArrayList<Coupon>();
13328
        for (Coupon other_element : other.success) {
13329
          __this__success.add(new Coupon(other_element));
13330
        }
13331
        this.success = __this__success;
13332
      }
13333
      if (other.isSetPex()) {
13334
        this.pex = new PromotionException(other.pex);
13335
      }
13336
    }
13337
 
13338
    public getAllCouponsByPromotionId_result deepCopy() {
13339
      return new getAllCouponsByPromotionId_result(this);
13340
    }
13341
 
13342
    @Override
13343
    public void clear() {
13344
      this.success = null;
13345
      this.pex = null;
13346
    }
13347
 
13348
    public int getSuccessSize() {
13349
      return (this.success == null) ? 0 : this.success.size();
13350
    }
13351
 
13352
    public java.util.Iterator<Coupon> getSuccessIterator() {
13353
      return (this.success == null) ? null : this.success.iterator();
13354
    }
13355
 
13356
    public void addToSuccess(Coupon elem) {
13357
      if (this.success == null) {
13358
        this.success = new ArrayList<Coupon>();
13359
      }
13360
      this.success.add(elem);
13361
    }
13362
 
13363
    public List<Coupon> getSuccess() {
13364
      return this.success;
13365
    }
13366
 
13367
    public void setSuccess(List<Coupon> success) {
13368
      this.success = success;
13369
    }
13370
 
13371
    public void unsetSuccess() {
13372
      this.success = null;
13373
    }
13374
 
13375
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
13376
    public boolean isSetSuccess() {
13377
      return this.success != null;
13378
    }
13379
 
13380
    public void setSuccessIsSet(boolean value) {
13381
      if (!value) {
13382
        this.success = null;
13383
      }
13384
    }
13385
 
13386
    public PromotionException getPex() {
13387
      return this.pex;
13388
    }
13389
 
13390
    public void setPex(PromotionException pex) {
13391
      this.pex = pex;
13392
    }
13393
 
13394
    public void unsetPex() {
13395
      this.pex = null;
13396
    }
13397
 
13398
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
13399
    public boolean isSetPex() {
13400
      return this.pex != null;
13401
    }
13402
 
13403
    public void setPexIsSet(boolean value) {
13404
      if (!value) {
13405
        this.pex = null;
13406
      }
13407
    }
13408
 
13409
    public void setFieldValue(_Fields field, Object value) {
13410
      switch (field) {
13411
      case SUCCESS:
13412
        if (value == null) {
13413
          unsetSuccess();
13414
        } else {
13415
          setSuccess((List<Coupon>)value);
13416
        }
13417
        break;
13418
 
13419
      case PEX:
13420
        if (value == null) {
13421
          unsetPex();
13422
        } else {
13423
          setPex((PromotionException)value);
13424
        }
13425
        break;
13426
 
13427
      }
13428
    }
13429
 
13430
    public Object getFieldValue(_Fields field) {
13431
      switch (field) {
13432
      case SUCCESS:
13433
        return getSuccess();
13434
 
13435
      case PEX:
13436
        return getPex();
13437
 
13438
      }
13439
      throw new IllegalStateException();
13440
    }
13441
 
13442
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13443
    public boolean isSet(_Fields field) {
13444
      if (field == null) {
13445
        throw new IllegalArgumentException();
13446
      }
13447
 
13448
      switch (field) {
13449
      case SUCCESS:
13450
        return isSetSuccess();
13451
      case PEX:
13452
        return isSetPex();
13453
      }
13454
      throw new IllegalStateException();
13455
    }
13456
 
13457
    @Override
13458
    public boolean equals(Object that) {
13459
      if (that == null)
13460
        return false;
13461
      if (that instanceof getAllCouponsByPromotionId_result)
13462
        return this.equals((getAllCouponsByPromotionId_result)that);
13463
      return false;
13464
    }
13465
 
13466
    public boolean equals(getAllCouponsByPromotionId_result that) {
13467
      if (that == null)
13468
        return false;
13469
 
13470
      boolean this_present_success = true && this.isSetSuccess();
13471
      boolean that_present_success = true && that.isSetSuccess();
13472
      if (this_present_success || that_present_success) {
13473
        if (!(this_present_success && that_present_success))
13474
          return false;
13475
        if (!this.success.equals(that.success))
13476
          return false;
13477
      }
13478
 
13479
      boolean this_present_pex = true && this.isSetPex();
13480
      boolean that_present_pex = true && that.isSetPex();
13481
      if (this_present_pex || that_present_pex) {
13482
        if (!(this_present_pex && that_present_pex))
13483
          return false;
13484
        if (!this.pex.equals(that.pex))
13485
          return false;
13486
      }
13487
 
13488
      return true;
13489
    }
13490
 
13491
    @Override
13492
    public int hashCode() {
13493
      return 0;
13494
    }
13495
 
13496
    public int compareTo(getAllCouponsByPromotionId_result other) {
13497
      if (!getClass().equals(other.getClass())) {
13498
        return getClass().getName().compareTo(other.getClass().getName());
13499
      }
13500
 
13501
      int lastComparison = 0;
13502
      getAllCouponsByPromotionId_result typedOther = (getAllCouponsByPromotionId_result)other;
13503
 
13504
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
13505
      if (lastComparison != 0) {
13506
        return lastComparison;
13507
      }
13508
      if (isSetSuccess()) {
13509
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
13510
        if (lastComparison != 0) {
13511
          return lastComparison;
13512
        }
13513
      }
13514
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
13515
      if (lastComparison != 0) {
13516
        return lastComparison;
13517
      }
13518
      if (isSetPex()) {
13519
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
13520
        if (lastComparison != 0) {
13521
          return lastComparison;
13522
        }
13523
      }
13524
      return 0;
13525
    }
13526
 
13527
    public _Fields fieldForId(int fieldId) {
13528
      return _Fields.findByThriftId(fieldId);
13529
    }
13530
 
13531
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13532
      org.apache.thrift.protocol.TField field;
13533
      iprot.readStructBegin();
13534
      while (true)
13535
      {
13536
        field = iprot.readFieldBegin();
13537
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
13538
          break;
13539
        }
13540
        switch (field.id) {
13541
          case 0: // SUCCESS
13542
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
13543
              {
11592 amit.gupta 13544
                org.apache.thrift.protocol.TList _list34 = iprot.readListBegin();
13545
                this.success = new ArrayList<Coupon>(_list34.size);
13546
                for (int _i35 = 0; _i35 < _list34.size; ++_i35)
7092 amit.gupta 13547
                {
11592 amit.gupta 13548
                  Coupon _elem36; // required
13549
                  _elem36 = new Coupon();
13550
                  _elem36.read(iprot);
13551
                  this.success.add(_elem36);
7092 amit.gupta 13552
                }
13553
                iprot.readListEnd();
13554
              }
13555
            } else { 
13556
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13557
            }
13558
            break;
13559
          case 1: // PEX
13560
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
13561
              this.pex = new PromotionException();
13562
              this.pex.read(iprot);
13563
            } else { 
13564
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13565
            }
13566
            break;
13567
          default:
13568
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13569
        }
13570
        iprot.readFieldEnd();
13571
      }
13572
      iprot.readStructEnd();
13573
      validate();
13574
    }
13575
 
13576
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
13577
      oprot.writeStructBegin(STRUCT_DESC);
13578
 
13579
      if (this.isSetSuccess()) {
13580
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
13581
        {
13582
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
11592 amit.gupta 13583
          for (Coupon _iter37 : this.success)
7092 amit.gupta 13584
          {
11592 amit.gupta 13585
            _iter37.write(oprot);
7092 amit.gupta 13586
          }
13587
          oprot.writeListEnd();
13588
        }
13589
        oprot.writeFieldEnd();
13590
      } else if (this.isSetPex()) {
13591
        oprot.writeFieldBegin(PEX_FIELD_DESC);
13592
        this.pex.write(oprot);
13593
        oprot.writeFieldEnd();
13594
      }
13595
      oprot.writeFieldStop();
13596
      oprot.writeStructEnd();
13597
    }
13598
 
13599
    @Override
13600
    public String toString() {
13601
      StringBuilder sb = new StringBuilder("getAllCouponsByPromotionId_result(");
13602
      boolean first = true;
13603
 
13604
      sb.append("success:");
13605
      if (this.success == null) {
13606
        sb.append("null");
13607
      } else {
13608
        sb.append(this.success);
13609
      }
13610
      first = false;
13611
      if (!first) sb.append(", ");
13612
      sb.append("pex:");
13613
      if (this.pex == null) {
13614
        sb.append("null");
13615
      } else {
13616
        sb.append(this.pex);
13617
      }
13618
      first = false;
13619
      sb.append(")");
13620
      return sb.toString();
13621
    }
13622
 
13623
    public void validate() throws org.apache.thrift.TException {
13624
      // check for required fields
13625
    }
13626
 
13627
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13628
      try {
13629
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13630
      } catch (org.apache.thrift.TException te) {
13631
        throw new java.io.IOException(te);
13632
      }
13633
    }
13634
 
13635
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13636
      try {
13637
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13638
      } catch (org.apache.thrift.TException te) {
13639
        throw new java.io.IOException(te);
13640
      }
13641
    }
13642
 
13643
  }
13644
 
3430 rajveer 13645
  public static class getActiveCoupons_args implements org.apache.thrift.TBase<getActiveCoupons_args, getActiveCoupons_args._Fields>, java.io.Serializable, Cloneable   {
13646
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_args");
3385 varun.gupt 13647
 
13648
 
13649
 
13650
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 13651
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 13652
;
13653
 
13654
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13655
 
13656
      static {
13657
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13658
          byName.put(field.getFieldName(), field);
13659
        }
13660
      }
13661
 
13662
      /**
13663
       * Find the _Fields constant that matches fieldId, or null if its not found.
13664
       */
13665
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 13666
        switch(fieldId) {
13667
          default:
13668
            return null;
13669
        }
3385 varun.gupt 13670
      }
13671
 
13672
      /**
13673
       * Find the _Fields constant that matches fieldId, throwing an exception
13674
       * if it is not found.
13675
       */
13676
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13677
        _Fields fields = findByThriftId(fieldId);
13678
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13679
        return fields;
13680
      }
13681
 
13682
      /**
13683
       * Find the _Fields constant that matches name, or null if its not found.
13684
       */
13685
      public static _Fields findByName(String name) {
13686
        return byName.get(name);
13687
      }
13688
 
13689
      private final short _thriftId;
13690
      private final String _fieldName;
13691
 
13692
      _Fields(short thriftId, String fieldName) {
13693
        _thriftId = thriftId;
13694
        _fieldName = fieldName;
13695
      }
13696
 
13697
      public short getThriftFieldId() {
13698
        return _thriftId;
13699
      }
13700
 
13701
      public String getFieldName() {
13702
        return _fieldName;
13703
      }
13704
    }
3430 rajveer 13705
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 13706
    static {
3430 rajveer 13707
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13708
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13709
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_args.class, metaDataMap);
3385 varun.gupt 13710
    }
13711
 
13712
    public getActiveCoupons_args() {
13713
    }
13714
 
13715
    /**
13716
     * Performs a deep copy on <i>other</i>.
13717
     */
13718
    public getActiveCoupons_args(getActiveCoupons_args other) {
13719
    }
13720
 
13721
    public getActiveCoupons_args deepCopy() {
13722
      return new getActiveCoupons_args(this);
13723
    }
13724
 
3430 rajveer 13725
    @Override
13726
    public void clear() {
3385 varun.gupt 13727
    }
13728
 
13729
    public void setFieldValue(_Fields field, Object value) {
13730
      switch (field) {
13731
      }
13732
    }
13733
 
13734
    public Object getFieldValue(_Fields field) {
13735
      switch (field) {
13736
      }
13737
      throw new IllegalStateException();
13738
    }
13739
 
3430 rajveer 13740
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13741
    public boolean isSet(_Fields field) {
13742
      if (field == null) {
13743
        throw new IllegalArgumentException();
13744
      }
3385 varun.gupt 13745
 
13746
      switch (field) {
13747
      }
13748
      throw new IllegalStateException();
13749
    }
13750
 
13751
    @Override
13752
    public boolean equals(Object that) {
13753
      if (that == null)
13754
        return false;
13755
      if (that instanceof getActiveCoupons_args)
13756
        return this.equals((getActiveCoupons_args)that);
13757
      return false;
13758
    }
13759
 
13760
    public boolean equals(getActiveCoupons_args that) {
13761
      if (that == null)
13762
        return false;
13763
 
13764
      return true;
13765
    }
13766
 
13767
    @Override
13768
    public int hashCode() {
13769
      return 0;
13770
    }
13771
 
13772
    public int compareTo(getActiveCoupons_args other) {
13773
      if (!getClass().equals(other.getClass())) {
13774
        return getClass().getName().compareTo(other.getClass().getName());
13775
      }
13776
 
13777
      int lastComparison = 0;
13778
      getActiveCoupons_args typedOther = (getActiveCoupons_args)other;
13779
 
13780
      return 0;
13781
    }
13782
 
3430 rajveer 13783
    public _Fields fieldForId(int fieldId) {
13784
      return _Fields.findByThriftId(fieldId);
13785
    }
13786
 
13787
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13788
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 13789
      iprot.readStructBegin();
13790
      while (true)
13791
      {
13792
        field = iprot.readFieldBegin();
3430 rajveer 13793
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 13794
          break;
13795
        }
3430 rajveer 13796
        switch (field.id) {
13797
          default:
13798
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 13799
        }
3430 rajveer 13800
        iprot.readFieldEnd();
3385 varun.gupt 13801
      }
13802
      iprot.readStructEnd();
13803
      validate();
13804
    }
13805
 
3430 rajveer 13806
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 13807
      validate();
13808
 
13809
      oprot.writeStructBegin(STRUCT_DESC);
13810
      oprot.writeFieldStop();
13811
      oprot.writeStructEnd();
13812
    }
13813
 
13814
    @Override
13815
    public String toString() {
13816
      StringBuilder sb = new StringBuilder("getActiveCoupons_args(");
13817
      boolean first = true;
13818
 
13819
      sb.append(")");
13820
      return sb.toString();
13821
    }
13822
 
3430 rajveer 13823
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 13824
      // check for required fields
13825
    }
13826
 
3430 rajveer 13827
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13828
      try {
13829
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13830
      } catch (org.apache.thrift.TException te) {
13831
        throw new java.io.IOException(te);
13832
      }
13833
    }
13834
 
13835
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13836
      try {
13837
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13838
      } catch (org.apache.thrift.TException te) {
13839
        throw new java.io.IOException(te);
13840
      }
13841
    }
13842
 
3385 varun.gupt 13843
  }
13844
 
3430 rajveer 13845
  public static class getActiveCoupons_result implements org.apache.thrift.TBase<getActiveCoupons_result, getActiveCoupons_result._Fields>, java.io.Serializable, Cloneable   {
13846
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_result");
3385 varun.gupt 13847
 
3430 rajveer 13848
    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);
13849
    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 13850
 
3430 rajveer 13851
    private List<Coupon> success; // required
13852
    private PromotionException pex; // required
3385 varun.gupt 13853
 
13854
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 13855
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 13856
      SUCCESS((short)0, "success"),
13857
      PEX((short)1, "pex");
13858
 
13859
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13860
 
13861
      static {
13862
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13863
          byName.put(field.getFieldName(), field);
13864
        }
13865
      }
13866
 
13867
      /**
13868
       * Find the _Fields constant that matches fieldId, or null if its not found.
13869
       */
13870
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 13871
        switch(fieldId) {
13872
          case 0: // SUCCESS
13873
            return SUCCESS;
13874
          case 1: // PEX
13875
            return PEX;
13876
          default:
13877
            return null;
13878
        }
3385 varun.gupt 13879
      }
13880
 
13881
      /**
13882
       * Find the _Fields constant that matches fieldId, throwing an exception
13883
       * if it is not found.
13884
       */
13885
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13886
        _Fields fields = findByThriftId(fieldId);
13887
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13888
        return fields;
13889
      }
13890
 
13891
      /**
13892
       * Find the _Fields constant that matches name, or null if its not found.
13893
       */
13894
      public static _Fields findByName(String name) {
13895
        return byName.get(name);
13896
      }
13897
 
13898
      private final short _thriftId;
13899
      private final String _fieldName;
13900
 
13901
      _Fields(short thriftId, String fieldName) {
13902
        _thriftId = thriftId;
13903
        _fieldName = fieldName;
13904
      }
13905
 
13906
      public short getThriftFieldId() {
13907
        return _thriftId;
13908
      }
13909
 
13910
      public String getFieldName() {
13911
        return _fieldName;
13912
      }
13913
    }
13914
 
13915
    // isset id assignments
13916
 
3430 rajveer 13917
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 13918
    static {
3430 rajveer 13919
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13920
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13921
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
13922
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
13923
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13924
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
13925
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13926
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_result.class, metaDataMap);
3385 varun.gupt 13927
    }
13928
 
13929
    public getActiveCoupons_result() {
13930
    }
13931
 
13932
    public getActiveCoupons_result(
13933
      List<Coupon> success,
13934
      PromotionException pex)
13935
    {
13936
      this();
13937
      this.success = success;
13938
      this.pex = pex;
13939
    }
13940
 
13941
    /**
13942
     * Performs a deep copy on <i>other</i>.
13943
     */
13944
    public getActiveCoupons_result(getActiveCoupons_result other) {
13945
      if (other.isSetSuccess()) {
13946
        List<Coupon> __this__success = new ArrayList<Coupon>();
13947
        for (Coupon other_element : other.success) {
13948
          __this__success.add(new Coupon(other_element));
13949
        }
13950
        this.success = __this__success;
13951
      }
13952
      if (other.isSetPex()) {
13953
        this.pex = new PromotionException(other.pex);
13954
      }
13955
    }
13956
 
13957
    public getActiveCoupons_result deepCopy() {
13958
      return new getActiveCoupons_result(this);
13959
    }
13960
 
3430 rajveer 13961
    @Override
13962
    public void clear() {
13963
      this.success = null;
13964
      this.pex = null;
3385 varun.gupt 13965
    }
13966
 
13967
    public int getSuccessSize() {
13968
      return (this.success == null) ? 0 : this.success.size();
13969
    }
13970
 
13971
    public java.util.Iterator<Coupon> getSuccessIterator() {
13972
      return (this.success == null) ? null : this.success.iterator();
13973
    }
13974
 
13975
    public void addToSuccess(Coupon elem) {
13976
      if (this.success == null) {
13977
        this.success = new ArrayList<Coupon>();
13978
      }
13979
      this.success.add(elem);
13980
    }
13981
 
13982
    public List<Coupon> getSuccess() {
13983
      return this.success;
13984
    }
13985
 
3430 rajveer 13986
    public void setSuccess(List<Coupon> success) {
3385 varun.gupt 13987
      this.success = success;
13988
    }
13989
 
13990
    public void unsetSuccess() {
13991
      this.success = null;
13992
    }
13993
 
3430 rajveer 13994
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 13995
    public boolean isSetSuccess() {
13996
      return this.success != null;
13997
    }
13998
 
13999
    public void setSuccessIsSet(boolean value) {
14000
      if (!value) {
14001
        this.success = null;
14002
      }
14003
    }
14004
 
14005
    public PromotionException getPex() {
14006
      return this.pex;
14007
    }
14008
 
3430 rajveer 14009
    public void setPex(PromotionException pex) {
3385 varun.gupt 14010
      this.pex = pex;
14011
    }
14012
 
14013
    public void unsetPex() {
14014
      this.pex = null;
14015
    }
14016
 
3430 rajveer 14017
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 14018
    public boolean isSetPex() {
14019
      return this.pex != null;
14020
    }
14021
 
14022
    public void setPexIsSet(boolean value) {
14023
      if (!value) {
14024
        this.pex = null;
14025
      }
14026
    }
14027
 
14028
    public void setFieldValue(_Fields field, Object value) {
14029
      switch (field) {
14030
      case SUCCESS:
14031
        if (value == null) {
14032
          unsetSuccess();
14033
        } else {
14034
          setSuccess((List<Coupon>)value);
14035
        }
14036
        break;
14037
 
14038
      case PEX:
14039
        if (value == null) {
14040
          unsetPex();
14041
        } else {
14042
          setPex((PromotionException)value);
14043
        }
14044
        break;
14045
 
14046
      }
14047
    }
14048
 
14049
    public Object getFieldValue(_Fields field) {
14050
      switch (field) {
14051
      case SUCCESS:
14052
        return getSuccess();
14053
 
14054
      case PEX:
14055
        return getPex();
14056
 
14057
      }
14058
      throw new IllegalStateException();
14059
    }
14060
 
3430 rajveer 14061
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14062
    public boolean isSet(_Fields field) {
14063
      if (field == null) {
14064
        throw new IllegalArgumentException();
14065
      }
3385 varun.gupt 14066
 
14067
      switch (field) {
14068
      case SUCCESS:
14069
        return isSetSuccess();
14070
      case PEX:
14071
        return isSetPex();
14072
      }
14073
      throw new IllegalStateException();
14074
    }
14075
 
14076
    @Override
14077
    public boolean equals(Object that) {
14078
      if (that == null)
14079
        return false;
14080
      if (that instanceof getActiveCoupons_result)
14081
        return this.equals((getActiveCoupons_result)that);
14082
      return false;
14083
    }
14084
 
14085
    public boolean equals(getActiveCoupons_result that) {
14086
      if (that == null)
14087
        return false;
14088
 
14089
      boolean this_present_success = true && this.isSetSuccess();
14090
      boolean that_present_success = true && that.isSetSuccess();
14091
      if (this_present_success || that_present_success) {
14092
        if (!(this_present_success && that_present_success))
14093
          return false;
14094
        if (!this.success.equals(that.success))
14095
          return false;
14096
      }
14097
 
14098
      boolean this_present_pex = true && this.isSetPex();
14099
      boolean that_present_pex = true && that.isSetPex();
14100
      if (this_present_pex || that_present_pex) {
14101
        if (!(this_present_pex && that_present_pex))
14102
          return false;
14103
        if (!this.pex.equals(that.pex))
14104
          return false;
14105
      }
14106
 
14107
      return true;
14108
    }
14109
 
14110
    @Override
14111
    public int hashCode() {
14112
      return 0;
14113
    }
14114
 
14115
    public int compareTo(getActiveCoupons_result other) {
14116
      if (!getClass().equals(other.getClass())) {
14117
        return getClass().getName().compareTo(other.getClass().getName());
14118
      }
14119
 
14120
      int lastComparison = 0;
14121
      getActiveCoupons_result typedOther = (getActiveCoupons_result)other;
14122
 
3430 rajveer 14123
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 14124
      if (lastComparison != 0) {
14125
        return lastComparison;
14126
      }
3430 rajveer 14127
      if (isSetSuccess()) {
14128
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
14129
        if (lastComparison != 0) {
14130
          return lastComparison;
14131
        }
3385 varun.gupt 14132
      }
3430 rajveer 14133
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 14134
      if (lastComparison != 0) {
14135
        return lastComparison;
14136
      }
3430 rajveer 14137
      if (isSetPex()) {
14138
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
14139
        if (lastComparison != 0) {
14140
          return lastComparison;
14141
        }
3385 varun.gupt 14142
      }
14143
      return 0;
14144
    }
14145
 
3430 rajveer 14146
    public _Fields fieldForId(int fieldId) {
14147
      return _Fields.findByThriftId(fieldId);
14148
    }
14149
 
14150
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14151
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 14152
      iprot.readStructBegin();
14153
      while (true)
14154
      {
14155
        field = iprot.readFieldBegin();
3430 rajveer 14156
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 14157
          break;
14158
        }
3430 rajveer 14159
        switch (field.id) {
14160
          case 0: // SUCCESS
14161
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
14162
              {
11592 amit.gupta 14163
                org.apache.thrift.protocol.TList _list38 = iprot.readListBegin();
14164
                this.success = new ArrayList<Coupon>(_list38.size);
14165
                for (int _i39 = 0; _i39 < _list38.size; ++_i39)
3385 varun.gupt 14166
                {
11592 amit.gupta 14167
                  Coupon _elem40; // required
14168
                  _elem40 = new Coupon();
14169
                  _elem40.read(iprot);
14170
                  this.success.add(_elem40);
3385 varun.gupt 14171
                }
3430 rajveer 14172
                iprot.readListEnd();
3385 varun.gupt 14173
              }
3430 rajveer 14174
            } else { 
14175
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14176
            }
14177
            break;
14178
          case 1: // PEX
14179
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
14180
              this.pex = new PromotionException();
14181
              this.pex.read(iprot);
14182
            } else { 
14183
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14184
            }
14185
            break;
14186
          default:
14187
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 14188
        }
3430 rajveer 14189
        iprot.readFieldEnd();
3385 varun.gupt 14190
      }
14191
      iprot.readStructEnd();
14192
      validate();
14193
    }
14194
 
3430 rajveer 14195
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 14196
      oprot.writeStructBegin(STRUCT_DESC);
14197
 
14198
      if (this.isSetSuccess()) {
14199
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
14200
        {
3430 rajveer 14201
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
11592 amit.gupta 14202
          for (Coupon _iter41 : this.success)
3385 varun.gupt 14203
          {
11592 amit.gupta 14204
            _iter41.write(oprot);
3385 varun.gupt 14205
          }
14206
          oprot.writeListEnd();
14207
        }
14208
        oprot.writeFieldEnd();
14209
      } else if (this.isSetPex()) {
14210
        oprot.writeFieldBegin(PEX_FIELD_DESC);
14211
        this.pex.write(oprot);
14212
        oprot.writeFieldEnd();
14213
      }
14214
      oprot.writeFieldStop();
14215
      oprot.writeStructEnd();
14216
    }
14217
 
14218
    @Override
14219
    public String toString() {
14220
      StringBuilder sb = new StringBuilder("getActiveCoupons_result(");
14221
      boolean first = true;
14222
 
14223
      sb.append("success:");
14224
      if (this.success == null) {
14225
        sb.append("null");
14226
      } else {
14227
        sb.append(this.success);
14228
      }
14229
      first = false;
14230
      if (!first) sb.append(", ");
14231
      sb.append("pex:");
14232
      if (this.pex == null) {
14233
        sb.append("null");
14234
      } else {
14235
        sb.append(this.pex);
14236
      }
14237
      first = false;
14238
      sb.append(")");
14239
      return sb.toString();
14240
    }
14241
 
3430 rajveer 14242
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 14243
      // check for required fields
14244
    }
14245
 
3430 rajveer 14246
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14247
      try {
14248
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14249
      } catch (org.apache.thrift.TException te) {
14250
        throw new java.io.IOException(te);
14251
      }
14252
    }
14253
 
14254
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14255
      try {
14256
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14257
      } catch (org.apache.thrift.TException te) {
14258
        throw new java.io.IOException(te);
14259
      }
14260
    }
14261
 
3385 varun.gupt 14262
  }
14263
 
6250 amit.gupta 14264
  public static class createCoupon_args implements org.apache.thrift.TBase<createCoupon_args, createCoupon_args._Fields>, java.io.Serializable, Cloneable   {
14265
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_args");
14266
 
14267
    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);
8707 manish.sha 14268
    private static final org.apache.thrift.protocol.TField COUPON_CATEGORY_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCategory", org.apache.thrift.protocol.TType.I64, (short)2);
14269
    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)3);
14270
    private static final org.apache.thrift.protocol.TField ARGUMENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("arguments", org.apache.thrift.protocol.TType.STRING, (short)4);
14271
    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);
14272
    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)6);
6250 amit.gupta 14273
 
14274
    private long promotionId; // required
8707 manish.sha 14275
    private long couponCategory; // required
6730 anupam.sin 14276
    private String couponCode; // required
6679 anupam.sin 14277
    private String arguments; // required
6356 amit.gupta 14278
    private boolean isCod; // required
6561 amit.gupta 14279
    private String prefix; // required
6250 amit.gupta 14280
 
14281
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14282
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
14283
      PROMOTION_ID((short)1, "promotionId"),
8707 manish.sha 14284
      COUPON_CATEGORY((short)2, "couponCategory"),
14285
      COUPON_CODE((short)3, "couponCode"),
14286
      ARGUMENTS((short)4, "arguments"),
14287
      IS_COD((short)5, "isCod"),
14288
      PREFIX((short)6, "prefix");
6250 amit.gupta 14289
 
14290
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14291
 
14292
      static {
14293
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14294
          byName.put(field.getFieldName(), field);
14295
        }
14296
      }
14297
 
14298
      /**
14299
       * Find the _Fields constant that matches fieldId, or null if its not found.
14300
       */
14301
      public static _Fields findByThriftId(int fieldId) {
14302
        switch(fieldId) {
14303
          case 1: // PROMOTION_ID
14304
            return PROMOTION_ID;
8707 manish.sha 14305
          case 2: // COUPON_CATEGORY
14306
            return COUPON_CATEGORY;
14307
          case 3: // COUPON_CODE
6730 anupam.sin 14308
            return COUPON_CODE;
8707 manish.sha 14309
          case 4: // ARGUMENTS
6679 anupam.sin 14310
            return ARGUMENTS;
8707 manish.sha 14311
          case 5: // IS_COD
6356 amit.gupta 14312
            return IS_COD;
8707 manish.sha 14313
          case 6: // PREFIX
6561 amit.gupta 14314
            return PREFIX;
6250 amit.gupta 14315
          default:
14316
            return null;
14317
        }
14318
      }
14319
 
14320
      /**
14321
       * Find the _Fields constant that matches fieldId, throwing an exception
14322
       * if it is not found.
14323
       */
14324
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14325
        _Fields fields = findByThriftId(fieldId);
14326
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14327
        return fields;
14328
      }
14329
 
14330
      /**
14331
       * Find the _Fields constant that matches name, or null if its not found.
14332
       */
14333
      public static _Fields findByName(String name) {
14334
        return byName.get(name);
14335
      }
14336
 
14337
      private final short _thriftId;
14338
      private final String _fieldName;
14339
 
14340
      _Fields(short thriftId, String fieldName) {
14341
        _thriftId = thriftId;
14342
        _fieldName = fieldName;
14343
      }
14344
 
14345
      public short getThriftFieldId() {
14346
        return _thriftId;
14347
      }
14348
 
14349
      public String getFieldName() {
14350
        return _fieldName;
14351
      }
14352
    }
14353
 
14354
    // isset id assignments
14355
    private static final int __PROMOTIONID_ISSET_ID = 0;
8707 manish.sha 14356
    private static final int __COUPONCATEGORY_ISSET_ID = 1;
14357
    private static final int __ISCOD_ISSET_ID = 2;
14358
    private BitSet __isset_bit_vector = new BitSet(3);
6250 amit.gupta 14359
 
14360
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
14361
    static {
14362
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
14363
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14364
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8707 manish.sha 14365
      tmpMap.put(_Fields.COUPON_CATEGORY, new org.apache.thrift.meta_data.FieldMetaData("couponCategory", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14366
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6730 anupam.sin 14367
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14368
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6679 anupam.sin 14369
      tmpMap.put(_Fields.ARGUMENTS, new org.apache.thrift.meta_data.FieldMetaData("arguments", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6250 amit.gupta 14370
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6356 amit.gupta 14371
      tmpMap.put(_Fields.IS_COD, new org.apache.thrift.meta_data.FieldMetaData("isCod", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14372
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
6561 amit.gupta 14373
      tmpMap.put(_Fields.PREFIX, new org.apache.thrift.meta_data.FieldMetaData("prefix", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14374
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6250 amit.gupta 14375
      metaDataMap = Collections.unmodifiableMap(tmpMap);
14376
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_args.class, metaDataMap);
14377
    }
14378
 
14379
    public createCoupon_args() {
14380
    }
14381
 
14382
    public createCoupon_args(
14383
      long promotionId,
8707 manish.sha 14384
      long couponCategory,
6730 anupam.sin 14385
      String couponCode,
6679 anupam.sin 14386
      String arguments,
6356 amit.gupta 14387
      boolean isCod,
6561 amit.gupta 14388
      String prefix)
6250 amit.gupta 14389
    {
14390
      this();
14391
      this.promotionId = promotionId;
14392
      setPromotionIdIsSet(true);
8707 manish.sha 14393
      this.couponCategory = couponCategory;
14394
      setCouponCategoryIsSet(true);
6730 anupam.sin 14395
      this.couponCode = couponCode;
6679 anupam.sin 14396
      this.arguments = arguments;
6356 amit.gupta 14397
      this.isCod = isCod;
14398
      setIsCodIsSet(true);
6561 amit.gupta 14399
      this.prefix = prefix;
6250 amit.gupta 14400
    }
14401
 
14402
    /**
14403
     * Performs a deep copy on <i>other</i>.
14404
     */
14405
    public createCoupon_args(createCoupon_args other) {
14406
      __isset_bit_vector.clear();
14407
      __isset_bit_vector.or(other.__isset_bit_vector);
14408
      this.promotionId = other.promotionId;
8707 manish.sha 14409
      this.couponCategory = other.couponCategory;
6730 anupam.sin 14410
      if (other.isSetCouponCode()) {
14411
        this.couponCode = other.couponCode;
14412
      }
6679 anupam.sin 14413
      if (other.isSetArguments()) {
14414
        this.arguments = other.arguments;
6250 amit.gupta 14415
      }
6356 amit.gupta 14416
      this.isCod = other.isCod;
6561 amit.gupta 14417
      if (other.isSetPrefix()) {
14418
        this.prefix = other.prefix;
14419
      }
6250 amit.gupta 14420
    }
14421
 
14422
    public createCoupon_args deepCopy() {
14423
      return new createCoupon_args(this);
14424
    }
14425
 
14426
    @Override
14427
    public void clear() {
14428
      setPromotionIdIsSet(false);
14429
      this.promotionId = 0;
8707 manish.sha 14430
      setCouponCategoryIsSet(false);
14431
      this.couponCategory = 0;
6730 anupam.sin 14432
      this.couponCode = null;
6679 anupam.sin 14433
      this.arguments = null;
6356 amit.gupta 14434
      setIsCodIsSet(false);
14435
      this.isCod = false;
6561 amit.gupta 14436
      this.prefix = null;
6250 amit.gupta 14437
    }
14438
 
14439
    public long getPromotionId() {
14440
      return this.promotionId;
14441
    }
14442
 
14443
    public void setPromotionId(long promotionId) {
14444
      this.promotionId = promotionId;
14445
      setPromotionIdIsSet(true);
14446
    }
14447
 
14448
    public void unsetPromotionId() {
14449
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
14450
    }
14451
 
14452
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
14453
    public boolean isSetPromotionId() {
14454
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
14455
    }
14456
 
14457
    public void setPromotionIdIsSet(boolean value) {
14458
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
14459
    }
14460
 
8707 manish.sha 14461
    public long getCouponCategory() {
14462
      return this.couponCategory;
14463
    }
14464
 
14465
    public void setCouponCategory(long couponCategory) {
14466
      this.couponCategory = couponCategory;
14467
      setCouponCategoryIsSet(true);
14468
    }
14469
 
14470
    public void unsetCouponCategory() {
14471
      __isset_bit_vector.clear(__COUPONCATEGORY_ISSET_ID);
14472
    }
14473
 
14474
    /** Returns true if field couponCategory is set (has been assigned a value) and false otherwise */
14475
    public boolean isSetCouponCategory() {
14476
      return __isset_bit_vector.get(__COUPONCATEGORY_ISSET_ID);
14477
    }
14478
 
14479
    public void setCouponCategoryIsSet(boolean value) {
14480
      __isset_bit_vector.set(__COUPONCATEGORY_ISSET_ID, value);
14481
    }
14482
 
6730 anupam.sin 14483
    public String getCouponCode() {
14484
      return this.couponCode;
14485
    }
14486
 
14487
    public void setCouponCode(String couponCode) {
14488
      this.couponCode = couponCode;
14489
    }
14490
 
14491
    public void unsetCouponCode() {
14492
      this.couponCode = null;
14493
    }
14494
 
14495
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
14496
    public boolean isSetCouponCode() {
14497
      return this.couponCode != null;
14498
    }
14499
 
14500
    public void setCouponCodeIsSet(boolean value) {
14501
      if (!value) {
14502
        this.couponCode = null;
14503
      }
14504
    }
14505
 
6679 anupam.sin 14506
    public String getArguments() {
14507
      return this.arguments;
6250 amit.gupta 14508
    }
14509
 
6679 anupam.sin 14510
    public void setArguments(String arguments) {
14511
      this.arguments = arguments;
6250 amit.gupta 14512
    }
14513
 
6679 anupam.sin 14514
    public void unsetArguments() {
14515
      this.arguments = null;
6250 amit.gupta 14516
    }
14517
 
6679 anupam.sin 14518
    /** Returns true if field arguments is set (has been assigned a value) and false otherwise */
14519
    public boolean isSetArguments() {
14520
      return this.arguments != null;
6250 amit.gupta 14521
    }
14522
 
6679 anupam.sin 14523
    public void setArgumentsIsSet(boolean value) {
6250 amit.gupta 14524
      if (!value) {
6679 anupam.sin 14525
        this.arguments = null;
6250 amit.gupta 14526
      }
14527
    }
14528
 
6356 amit.gupta 14529
    public boolean isIsCod() {
14530
      return this.isCod;
14531
    }
14532
 
14533
    public void setIsCod(boolean isCod) {
14534
      this.isCod = isCod;
14535
      setIsCodIsSet(true);
14536
    }
14537
 
14538
    public void unsetIsCod() {
14539
      __isset_bit_vector.clear(__ISCOD_ISSET_ID);
14540
    }
14541
 
14542
    /** Returns true if field isCod is set (has been assigned a value) and false otherwise */
14543
    public boolean isSetIsCod() {
14544
      return __isset_bit_vector.get(__ISCOD_ISSET_ID);
14545
    }
14546
 
14547
    public void setIsCodIsSet(boolean value) {
14548
      __isset_bit_vector.set(__ISCOD_ISSET_ID, value);
14549
    }
14550
 
6561 amit.gupta 14551
    public String getPrefix() {
14552
      return this.prefix;
14553
    }
14554
 
14555
    public void setPrefix(String prefix) {
14556
      this.prefix = prefix;
14557
    }
14558
 
14559
    public void unsetPrefix() {
14560
      this.prefix = null;
14561
    }
14562
 
14563
    /** Returns true if field prefix is set (has been assigned a value) and false otherwise */
14564
    public boolean isSetPrefix() {
14565
      return this.prefix != null;
14566
    }
14567
 
14568
    public void setPrefixIsSet(boolean value) {
14569
      if (!value) {
14570
        this.prefix = null;
14571
      }
14572
    }
14573
 
6250 amit.gupta 14574
    public void setFieldValue(_Fields field, Object value) {
14575
      switch (field) {
14576
      case PROMOTION_ID:
14577
        if (value == null) {
14578
          unsetPromotionId();
14579
        } else {
14580
          setPromotionId((Long)value);
14581
        }
14582
        break;
14583
 
8707 manish.sha 14584
      case COUPON_CATEGORY:
14585
        if (value == null) {
14586
          unsetCouponCategory();
14587
        } else {
14588
          setCouponCategory((Long)value);
14589
        }
14590
        break;
14591
 
6730 anupam.sin 14592
      case COUPON_CODE:
14593
        if (value == null) {
14594
          unsetCouponCode();
14595
        } else {
14596
          setCouponCode((String)value);
14597
        }
14598
        break;
14599
 
6679 anupam.sin 14600
      case ARGUMENTS:
6250 amit.gupta 14601
        if (value == null) {
6679 anupam.sin 14602
          unsetArguments();
6250 amit.gupta 14603
        } else {
6679 anupam.sin 14604
          setArguments((String)value);
6250 amit.gupta 14605
        }
14606
        break;
14607
 
6356 amit.gupta 14608
      case IS_COD:
14609
        if (value == null) {
14610
          unsetIsCod();
14611
        } else {
14612
          setIsCod((Boolean)value);
14613
        }
14614
        break;
14615
 
6561 amit.gupta 14616
      case PREFIX:
14617
        if (value == null) {
14618
          unsetPrefix();
14619
        } else {
14620
          setPrefix((String)value);
14621
        }
14622
        break;
14623
 
6250 amit.gupta 14624
      }
14625
    }
14626
 
14627
    public Object getFieldValue(_Fields field) {
14628
      switch (field) {
14629
      case PROMOTION_ID:
14630
        return Long.valueOf(getPromotionId());
14631
 
8707 manish.sha 14632
      case COUPON_CATEGORY:
14633
        return Long.valueOf(getCouponCategory());
14634
 
6730 anupam.sin 14635
      case COUPON_CODE:
14636
        return getCouponCode();
14637
 
6679 anupam.sin 14638
      case ARGUMENTS:
14639
        return getArguments();
6250 amit.gupta 14640
 
6356 amit.gupta 14641
      case IS_COD:
14642
        return Boolean.valueOf(isIsCod());
14643
 
6561 amit.gupta 14644
      case PREFIX:
14645
        return getPrefix();
14646
 
6250 amit.gupta 14647
      }
14648
      throw new IllegalStateException();
14649
    }
14650
 
14651
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14652
    public boolean isSet(_Fields field) {
14653
      if (field == null) {
14654
        throw new IllegalArgumentException();
14655
      }
14656
 
14657
      switch (field) {
14658
      case PROMOTION_ID:
14659
        return isSetPromotionId();
8707 manish.sha 14660
      case COUPON_CATEGORY:
14661
        return isSetCouponCategory();
6730 anupam.sin 14662
      case COUPON_CODE:
14663
        return isSetCouponCode();
6679 anupam.sin 14664
      case ARGUMENTS:
14665
        return isSetArguments();
6356 amit.gupta 14666
      case IS_COD:
14667
        return isSetIsCod();
6561 amit.gupta 14668
      case PREFIX:
14669
        return isSetPrefix();
6250 amit.gupta 14670
      }
14671
      throw new IllegalStateException();
14672
    }
14673
 
14674
    @Override
14675
    public boolean equals(Object that) {
14676
      if (that == null)
14677
        return false;
14678
      if (that instanceof createCoupon_args)
14679
        return this.equals((createCoupon_args)that);
14680
      return false;
14681
    }
14682
 
14683
    public boolean equals(createCoupon_args that) {
14684
      if (that == null)
14685
        return false;
14686
 
14687
      boolean this_present_promotionId = true;
14688
      boolean that_present_promotionId = true;
14689
      if (this_present_promotionId || that_present_promotionId) {
14690
        if (!(this_present_promotionId && that_present_promotionId))
14691
          return false;
14692
        if (this.promotionId != that.promotionId)
14693
          return false;
14694
      }
14695
 
8707 manish.sha 14696
      boolean this_present_couponCategory = true;
14697
      boolean that_present_couponCategory = true;
14698
      if (this_present_couponCategory || that_present_couponCategory) {
14699
        if (!(this_present_couponCategory && that_present_couponCategory))
14700
          return false;
14701
        if (this.couponCategory != that.couponCategory)
14702
          return false;
14703
      }
14704
 
6730 anupam.sin 14705
      boolean this_present_couponCode = true && this.isSetCouponCode();
14706
      boolean that_present_couponCode = true && that.isSetCouponCode();
14707
      if (this_present_couponCode || that_present_couponCode) {
14708
        if (!(this_present_couponCode && that_present_couponCode))
14709
          return false;
14710
        if (!this.couponCode.equals(that.couponCode))
14711
          return false;
14712
      }
14713
 
6679 anupam.sin 14714
      boolean this_present_arguments = true && this.isSetArguments();
14715
      boolean that_present_arguments = true && that.isSetArguments();
14716
      if (this_present_arguments || that_present_arguments) {
14717
        if (!(this_present_arguments && that_present_arguments))
6250 amit.gupta 14718
          return false;
6679 anupam.sin 14719
        if (!this.arguments.equals(that.arguments))
6250 amit.gupta 14720
          return false;
14721
      }
14722
 
6356 amit.gupta 14723
      boolean this_present_isCod = true;
14724
      boolean that_present_isCod = true;
14725
      if (this_present_isCod || that_present_isCod) {
14726
        if (!(this_present_isCod && that_present_isCod))
14727
          return false;
14728
        if (this.isCod != that.isCod)
14729
          return false;
14730
      }
14731
 
6561 amit.gupta 14732
      boolean this_present_prefix = true && this.isSetPrefix();
14733
      boolean that_present_prefix = true && that.isSetPrefix();
14734
      if (this_present_prefix || that_present_prefix) {
14735
        if (!(this_present_prefix && that_present_prefix))
14736
          return false;
14737
        if (!this.prefix.equals(that.prefix))
14738
          return false;
14739
      }
14740
 
6250 amit.gupta 14741
      return true;
14742
    }
14743
 
14744
    @Override
14745
    public int hashCode() {
14746
      return 0;
14747
    }
14748
 
14749
    public int compareTo(createCoupon_args other) {
14750
      if (!getClass().equals(other.getClass())) {
14751
        return getClass().getName().compareTo(other.getClass().getName());
14752
      }
14753
 
14754
      int lastComparison = 0;
14755
      createCoupon_args typedOther = (createCoupon_args)other;
14756
 
14757
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
14758
      if (lastComparison != 0) {
14759
        return lastComparison;
14760
      }
14761
      if (isSetPromotionId()) {
14762
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
14763
        if (lastComparison != 0) {
14764
          return lastComparison;
14765
        }
14766
      }
8707 manish.sha 14767
      lastComparison = Boolean.valueOf(isSetCouponCategory()).compareTo(typedOther.isSetCouponCategory());
14768
      if (lastComparison != 0) {
14769
        return lastComparison;
14770
      }
14771
      if (isSetCouponCategory()) {
14772
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCategory, typedOther.couponCategory);
14773
        if (lastComparison != 0) {
14774
          return lastComparison;
14775
        }
14776
      }
6730 anupam.sin 14777
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
14778
      if (lastComparison != 0) {
14779
        return lastComparison;
14780
      }
14781
      if (isSetCouponCode()) {
14782
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
14783
        if (lastComparison != 0) {
14784
          return lastComparison;
14785
        }
14786
      }
6679 anupam.sin 14787
      lastComparison = Boolean.valueOf(isSetArguments()).compareTo(typedOther.isSetArguments());
6250 amit.gupta 14788
      if (lastComparison != 0) {
14789
        return lastComparison;
14790
      }
6679 anupam.sin 14791
      if (isSetArguments()) {
14792
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.arguments, typedOther.arguments);
6250 amit.gupta 14793
        if (lastComparison != 0) {
14794
          return lastComparison;
14795
        }
14796
      }
6356 amit.gupta 14797
      lastComparison = Boolean.valueOf(isSetIsCod()).compareTo(typedOther.isSetIsCod());
14798
      if (lastComparison != 0) {
14799
        return lastComparison;
14800
      }
14801
      if (isSetIsCod()) {
14802
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isCod, typedOther.isCod);
14803
        if (lastComparison != 0) {
14804
          return lastComparison;
14805
        }
14806
      }
6561 amit.gupta 14807
      lastComparison = Boolean.valueOf(isSetPrefix()).compareTo(typedOther.isSetPrefix());
14808
      if (lastComparison != 0) {
14809
        return lastComparison;
14810
      }
14811
      if (isSetPrefix()) {
14812
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.prefix, typedOther.prefix);
14813
        if (lastComparison != 0) {
14814
          return lastComparison;
14815
        }
14816
      }
6250 amit.gupta 14817
      return 0;
14818
    }
14819
 
14820
    public _Fields fieldForId(int fieldId) {
14821
      return _Fields.findByThriftId(fieldId);
14822
    }
14823
 
14824
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14825
      org.apache.thrift.protocol.TField field;
14826
      iprot.readStructBegin();
14827
      while (true)
14828
      {
14829
        field = iprot.readFieldBegin();
14830
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
14831
          break;
14832
        }
14833
        switch (field.id) {
14834
          case 1: // PROMOTION_ID
14835
            if (field.type == org.apache.thrift.protocol.TType.I64) {
14836
              this.promotionId = iprot.readI64();
14837
              setPromotionIdIsSet(true);
14838
            } else { 
14839
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14840
            }
14841
            break;
8707 manish.sha 14842
          case 2: // COUPON_CATEGORY
14843
            if (field.type == org.apache.thrift.protocol.TType.I64) {
14844
              this.couponCategory = iprot.readI64();
14845
              setCouponCategoryIsSet(true);
14846
            } else { 
14847
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14848
            }
14849
            break;
14850
          case 3: // COUPON_CODE
6250 amit.gupta 14851
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
6730 anupam.sin 14852
              this.couponCode = iprot.readString();
14853
            } else { 
14854
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14855
            }
14856
            break;
8707 manish.sha 14857
          case 4: // ARGUMENTS
6730 anupam.sin 14858
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
6679 anupam.sin 14859
              this.arguments = iprot.readString();
6250 amit.gupta 14860
            } else { 
14861
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14862
            }
14863
            break;
8707 manish.sha 14864
          case 5: // IS_COD
6356 amit.gupta 14865
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
14866
              this.isCod = iprot.readBool();
14867
              setIsCodIsSet(true);
14868
            } else { 
14869
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14870
            }
14871
            break;
8707 manish.sha 14872
          case 6: // PREFIX
6561 amit.gupta 14873
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
14874
              this.prefix = iprot.readString();
14875
            } else { 
14876
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14877
            }
14878
            break;
6250 amit.gupta 14879
          default:
14880
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14881
        }
14882
        iprot.readFieldEnd();
14883
      }
14884
      iprot.readStructEnd();
14885
      validate();
14886
    }
14887
 
14888
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
14889
      validate();
14890
 
14891
      oprot.writeStructBegin(STRUCT_DESC);
14892
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
14893
      oprot.writeI64(this.promotionId);
14894
      oprot.writeFieldEnd();
8707 manish.sha 14895
      oprot.writeFieldBegin(COUPON_CATEGORY_FIELD_DESC);
14896
      oprot.writeI64(this.couponCategory);
14897
      oprot.writeFieldEnd();
6730 anupam.sin 14898
      if (this.couponCode != null) {
14899
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
14900
        oprot.writeString(this.couponCode);
14901
        oprot.writeFieldEnd();
14902
      }
6679 anupam.sin 14903
      if (this.arguments != null) {
14904
        oprot.writeFieldBegin(ARGUMENTS_FIELD_DESC);
14905
        oprot.writeString(this.arguments);
6250 amit.gupta 14906
        oprot.writeFieldEnd();
14907
      }
6356 amit.gupta 14908
      oprot.writeFieldBegin(IS_COD_FIELD_DESC);
14909
      oprot.writeBool(this.isCod);
14910
      oprot.writeFieldEnd();
6561 amit.gupta 14911
      if (this.prefix != null) {
14912
        oprot.writeFieldBegin(PREFIX_FIELD_DESC);
14913
        oprot.writeString(this.prefix);
14914
        oprot.writeFieldEnd();
14915
      }
6250 amit.gupta 14916
      oprot.writeFieldStop();
14917
      oprot.writeStructEnd();
14918
    }
14919
 
14920
    @Override
14921
    public String toString() {
14922
      StringBuilder sb = new StringBuilder("createCoupon_args(");
14923
      boolean first = true;
14924
 
14925
      sb.append("promotionId:");
14926
      sb.append(this.promotionId);
14927
      first = false;
14928
      if (!first) sb.append(", ");
8707 manish.sha 14929
      sb.append("couponCategory:");
14930
      sb.append(this.couponCategory);
14931
      first = false;
14932
      if (!first) sb.append(", ");
6730 anupam.sin 14933
      sb.append("couponCode:");
14934
      if (this.couponCode == null) {
14935
        sb.append("null");
14936
      } else {
14937
        sb.append(this.couponCode);
14938
      }
14939
      first = false;
14940
      if (!first) sb.append(", ");
6679 anupam.sin 14941
      sb.append("arguments:");
14942
      if (this.arguments == null) {
6250 amit.gupta 14943
        sb.append("null");
14944
      } else {
6679 anupam.sin 14945
        sb.append(this.arguments);
6250 amit.gupta 14946
      }
14947
      first = false;
14948
      if (!first) sb.append(", ");
6356 amit.gupta 14949
      sb.append("isCod:");
14950
      sb.append(this.isCod);
14951
      first = false;
14952
      if (!first) sb.append(", ");
6561 amit.gupta 14953
      sb.append("prefix:");
14954
      if (this.prefix == null) {
14955
        sb.append("null");
14956
      } else {
14957
        sb.append(this.prefix);
14958
      }
14959
      first = false;
6250 amit.gupta 14960
      sb.append(")");
14961
      return sb.toString();
14962
    }
14963
 
14964
    public void validate() throws org.apache.thrift.TException {
14965
      // check for required fields
14966
    }
14967
 
14968
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14969
      try {
14970
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14971
      } catch (org.apache.thrift.TException te) {
14972
        throw new java.io.IOException(te);
14973
      }
14974
    }
14975
 
14976
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14977
      try {
14978
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14979
      } catch (org.apache.thrift.TException te) {
14980
        throw new java.io.IOException(te);
14981
      }
14982
    }
14983
 
14984
  }
14985
 
14986
  public static class createCoupon_result implements org.apache.thrift.TBase<createCoupon_result, createCoupon_result._Fields>, java.io.Serializable, Cloneable   {
14987
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_result");
14988
 
14989
    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);
14990
    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);
14991
 
14992
    private String success; // required
14993
    private PromotionException pex; // required
14994
 
14995
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14996
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
14997
      SUCCESS((short)0, "success"),
14998
      PEX((short)1, "pex");
14999
 
15000
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15001
 
15002
      static {
15003
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15004
          byName.put(field.getFieldName(), field);
15005
        }
15006
      }
15007
 
15008
      /**
15009
       * Find the _Fields constant that matches fieldId, or null if its not found.
15010
       */
15011
      public static _Fields findByThriftId(int fieldId) {
15012
        switch(fieldId) {
15013
          case 0: // SUCCESS
15014
            return SUCCESS;
15015
          case 1: // PEX
15016
            return PEX;
15017
          default:
15018
            return null;
15019
        }
15020
      }
15021
 
15022
      /**
15023
       * Find the _Fields constant that matches fieldId, throwing an exception
15024
       * if it is not found.
15025
       */
15026
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15027
        _Fields fields = findByThriftId(fieldId);
15028
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15029
        return fields;
15030
      }
15031
 
15032
      /**
15033
       * Find the _Fields constant that matches name, or null if its not found.
15034
       */
15035
      public static _Fields findByName(String name) {
15036
        return byName.get(name);
15037
      }
15038
 
15039
      private final short _thriftId;
15040
      private final String _fieldName;
15041
 
15042
      _Fields(short thriftId, String fieldName) {
15043
        _thriftId = thriftId;
15044
        _fieldName = fieldName;
15045
      }
15046
 
15047
      public short getThriftFieldId() {
15048
        return _thriftId;
15049
      }
15050
 
15051
      public String getFieldName() {
15052
        return _fieldName;
15053
      }
15054
    }
15055
 
15056
    // isset id assignments
15057
 
15058
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
15059
    static {
15060
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15061
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15062
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
15063
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15064
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
15065
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15066
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_result.class, metaDataMap);
15067
    }
15068
 
15069
    public createCoupon_result() {
15070
    }
15071
 
15072
    public createCoupon_result(
15073
      String success,
15074
      PromotionException pex)
15075
    {
15076
      this();
15077
      this.success = success;
15078
      this.pex = pex;
15079
    }
15080
 
15081
    /**
15082
     * Performs a deep copy on <i>other</i>.
15083
     */
15084
    public createCoupon_result(createCoupon_result other) {
15085
      if (other.isSetSuccess()) {
15086
        this.success = other.success;
15087
      }
15088
      if (other.isSetPex()) {
15089
        this.pex = new PromotionException(other.pex);
15090
      }
15091
    }
15092
 
15093
    public createCoupon_result deepCopy() {
15094
      return new createCoupon_result(this);
15095
    }
15096
 
15097
    @Override
15098
    public void clear() {
15099
      this.success = null;
15100
      this.pex = null;
15101
    }
15102
 
15103
    public String getSuccess() {
15104
      return this.success;
15105
    }
15106
 
15107
    public void setSuccess(String success) {
15108
      this.success = success;
15109
    }
15110
 
15111
    public void unsetSuccess() {
15112
      this.success = null;
15113
    }
15114
 
15115
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
15116
    public boolean isSetSuccess() {
15117
      return this.success != null;
15118
    }
15119
 
15120
    public void setSuccessIsSet(boolean value) {
15121
      if (!value) {
15122
        this.success = null;
15123
      }
15124
    }
15125
 
15126
    public PromotionException getPex() {
15127
      return this.pex;
15128
    }
15129
 
15130
    public void setPex(PromotionException pex) {
15131
      this.pex = pex;
15132
    }
15133
 
15134
    public void unsetPex() {
15135
      this.pex = null;
15136
    }
15137
 
15138
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
15139
    public boolean isSetPex() {
15140
      return this.pex != null;
15141
    }
15142
 
15143
    public void setPexIsSet(boolean value) {
15144
      if (!value) {
15145
        this.pex = null;
15146
      }
15147
    }
15148
 
15149
    public void setFieldValue(_Fields field, Object value) {
15150
      switch (field) {
15151
      case SUCCESS:
15152
        if (value == null) {
15153
          unsetSuccess();
15154
        } else {
15155
          setSuccess((String)value);
15156
        }
15157
        break;
15158
 
15159
      case PEX:
15160
        if (value == null) {
15161
          unsetPex();
15162
        } else {
15163
          setPex((PromotionException)value);
15164
        }
15165
        break;
15166
 
15167
      }
15168
    }
15169
 
15170
    public Object getFieldValue(_Fields field) {
15171
      switch (field) {
15172
      case SUCCESS:
15173
        return getSuccess();
15174
 
15175
      case PEX:
15176
        return getPex();
15177
 
15178
      }
15179
      throw new IllegalStateException();
15180
    }
15181
 
15182
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15183
    public boolean isSet(_Fields field) {
15184
      if (field == null) {
15185
        throw new IllegalArgumentException();
15186
      }
15187
 
15188
      switch (field) {
15189
      case SUCCESS:
15190
        return isSetSuccess();
15191
      case PEX:
15192
        return isSetPex();
15193
      }
15194
      throw new IllegalStateException();
15195
    }
15196
 
15197
    @Override
15198
    public boolean equals(Object that) {
15199
      if (that == null)
15200
        return false;
15201
      if (that instanceof createCoupon_result)
15202
        return this.equals((createCoupon_result)that);
15203
      return false;
15204
    }
15205
 
15206
    public boolean equals(createCoupon_result that) {
15207
      if (that == null)
15208
        return false;
15209
 
15210
      boolean this_present_success = true && this.isSetSuccess();
15211
      boolean that_present_success = true && that.isSetSuccess();
15212
      if (this_present_success || that_present_success) {
15213
        if (!(this_present_success && that_present_success))
15214
          return false;
15215
        if (!this.success.equals(that.success))
15216
          return false;
15217
      }
15218
 
15219
      boolean this_present_pex = true && this.isSetPex();
15220
      boolean that_present_pex = true && that.isSetPex();
15221
      if (this_present_pex || that_present_pex) {
15222
        if (!(this_present_pex && that_present_pex))
15223
          return false;
15224
        if (!this.pex.equals(that.pex))
15225
          return false;
15226
      }
15227
 
15228
      return true;
15229
    }
15230
 
15231
    @Override
15232
    public int hashCode() {
15233
      return 0;
15234
    }
15235
 
15236
    public int compareTo(createCoupon_result other) {
15237
      if (!getClass().equals(other.getClass())) {
15238
        return getClass().getName().compareTo(other.getClass().getName());
15239
      }
15240
 
15241
      int lastComparison = 0;
15242
      createCoupon_result typedOther = (createCoupon_result)other;
15243
 
15244
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
15245
      if (lastComparison != 0) {
15246
        return lastComparison;
15247
      }
15248
      if (isSetSuccess()) {
15249
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
15250
        if (lastComparison != 0) {
15251
          return lastComparison;
15252
        }
15253
      }
15254
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
15255
      if (lastComparison != 0) {
15256
        return lastComparison;
15257
      }
15258
      if (isSetPex()) {
15259
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
15260
        if (lastComparison != 0) {
15261
          return lastComparison;
15262
        }
15263
      }
15264
      return 0;
15265
    }
15266
 
15267
    public _Fields fieldForId(int fieldId) {
15268
      return _Fields.findByThriftId(fieldId);
15269
    }
15270
 
15271
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15272
      org.apache.thrift.protocol.TField field;
15273
      iprot.readStructBegin();
15274
      while (true)
15275
      {
15276
        field = iprot.readFieldBegin();
15277
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
15278
          break;
15279
        }
15280
        switch (field.id) {
15281
          case 0: // SUCCESS
15282
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
15283
              this.success = iprot.readString();
15284
            } else { 
15285
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15286
            }
15287
            break;
15288
          case 1: // PEX
15289
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
15290
              this.pex = new PromotionException();
15291
              this.pex.read(iprot);
15292
            } else { 
15293
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15294
            }
15295
            break;
15296
          default:
15297
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15298
        }
15299
        iprot.readFieldEnd();
15300
      }
15301
      iprot.readStructEnd();
15302
      validate();
15303
    }
15304
 
15305
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
15306
      oprot.writeStructBegin(STRUCT_DESC);
15307
 
15308
      if (this.isSetSuccess()) {
15309
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
15310
        oprot.writeString(this.success);
15311
        oprot.writeFieldEnd();
15312
      } else if (this.isSetPex()) {
15313
        oprot.writeFieldBegin(PEX_FIELD_DESC);
15314
        this.pex.write(oprot);
15315
        oprot.writeFieldEnd();
15316
      }
15317
      oprot.writeFieldStop();
15318
      oprot.writeStructEnd();
15319
    }
15320
 
15321
    @Override
15322
    public String toString() {
15323
      StringBuilder sb = new StringBuilder("createCoupon_result(");
15324
      boolean first = true;
15325
 
15326
      sb.append("success:");
15327
      if (this.success == null) {
15328
        sb.append("null");
15329
      } else {
15330
        sb.append(this.success);
15331
      }
15332
      first = false;
15333
      if (!first) sb.append(", ");
15334
      sb.append("pex:");
15335
      if (this.pex == null) {
15336
        sb.append("null");
15337
      } else {
15338
        sb.append(this.pex);
15339
      }
15340
      first = false;
15341
      sb.append(")");
15342
      return sb.toString();
15343
    }
15344
 
15345
    public void validate() throws org.apache.thrift.TException {
15346
      // check for required fields
15347
    }
15348
 
15349
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15350
      try {
15351
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15352
      } catch (org.apache.thrift.TException te) {
15353
        throw new java.io.IOException(te);
15354
      }
15355
    }
15356
 
15357
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15358
      try {
15359
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15360
      } catch (org.apache.thrift.TException te) {
15361
        throw new java.io.IOException(te);
15362
      }
15363
    }
15364
 
15365
  }
15366
 
3430 rajveer 15367
  public static class getSuccessfulPaymentCountForCoupon_args implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_args, getSuccessfulPaymentCountForCoupon_args._Fields>, java.io.Serializable, Cloneable   {
15368
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_args");
3385 varun.gupt 15369
 
3430 rajveer 15370
    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 15371
 
3430 rajveer 15372
    private String couponCode; // required
3385 varun.gupt 15373
 
15374
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 15375
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 15376
      COUPON_CODE((short)1, "couponCode");
15377
 
15378
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15379
 
15380
      static {
15381
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15382
          byName.put(field.getFieldName(), field);
15383
        }
15384
      }
15385
 
15386
      /**
15387
       * Find the _Fields constant that matches fieldId, or null if its not found.
15388
       */
15389
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 15390
        switch(fieldId) {
15391
          case 1: // COUPON_CODE
15392
            return COUPON_CODE;
15393
          default:
15394
            return null;
15395
        }
3385 varun.gupt 15396
      }
15397
 
15398
      /**
15399
       * Find the _Fields constant that matches fieldId, throwing an exception
15400
       * if it is not found.
15401
       */
15402
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15403
        _Fields fields = findByThriftId(fieldId);
15404
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15405
        return fields;
15406
      }
15407
 
15408
      /**
15409
       * Find the _Fields constant that matches name, or null if its not found.
15410
       */
15411
      public static _Fields findByName(String name) {
15412
        return byName.get(name);
15413
      }
15414
 
15415
      private final short _thriftId;
15416
      private final String _fieldName;
15417
 
15418
      _Fields(short thriftId, String fieldName) {
15419
        _thriftId = thriftId;
15420
        _fieldName = fieldName;
15421
      }
15422
 
15423
      public short getThriftFieldId() {
15424
        return _thriftId;
15425
      }
15426
 
15427
      public String getFieldName() {
15428
        return _fieldName;
15429
      }
15430
    }
15431
 
15432
    // isset id assignments
15433
 
3430 rajveer 15434
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 15435
    static {
3430 rajveer 15436
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15437
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15438
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
15439
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15440
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_args.class, metaDataMap);
3385 varun.gupt 15441
    }
15442
 
15443
    public getSuccessfulPaymentCountForCoupon_args() {
15444
    }
15445
 
15446
    public getSuccessfulPaymentCountForCoupon_args(
15447
      String couponCode)
15448
    {
15449
      this();
15450
      this.couponCode = couponCode;
15451
    }
15452
 
15453
    /**
15454
     * Performs a deep copy on <i>other</i>.
15455
     */
15456
    public getSuccessfulPaymentCountForCoupon_args(getSuccessfulPaymentCountForCoupon_args other) {
15457
      if (other.isSetCouponCode()) {
15458
        this.couponCode = other.couponCode;
15459
      }
15460
    }
15461
 
15462
    public getSuccessfulPaymentCountForCoupon_args deepCopy() {
15463
      return new getSuccessfulPaymentCountForCoupon_args(this);
15464
    }
15465
 
3430 rajveer 15466
    @Override
15467
    public void clear() {
15468
      this.couponCode = null;
3385 varun.gupt 15469
    }
15470
 
15471
    public String getCouponCode() {
15472
      return this.couponCode;
15473
    }
15474
 
3430 rajveer 15475
    public void setCouponCode(String couponCode) {
3385 varun.gupt 15476
      this.couponCode = couponCode;
15477
    }
15478
 
15479
    public void unsetCouponCode() {
15480
      this.couponCode = null;
15481
    }
15482
 
3430 rajveer 15483
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3385 varun.gupt 15484
    public boolean isSetCouponCode() {
15485
      return this.couponCode != null;
15486
    }
15487
 
15488
    public void setCouponCodeIsSet(boolean value) {
15489
      if (!value) {
15490
        this.couponCode = null;
15491
      }
15492
    }
15493
 
15494
    public void setFieldValue(_Fields field, Object value) {
15495
      switch (field) {
15496
      case COUPON_CODE:
15497
        if (value == null) {
15498
          unsetCouponCode();
15499
        } else {
15500
          setCouponCode((String)value);
15501
        }
15502
        break;
15503
 
15504
      }
15505
    }
15506
 
15507
    public Object getFieldValue(_Fields field) {
15508
      switch (field) {
15509
      case COUPON_CODE:
15510
        return getCouponCode();
15511
 
15512
      }
15513
      throw new IllegalStateException();
15514
    }
15515
 
3430 rajveer 15516
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15517
    public boolean isSet(_Fields field) {
15518
      if (field == null) {
15519
        throw new IllegalArgumentException();
15520
      }
3385 varun.gupt 15521
 
15522
      switch (field) {
15523
      case COUPON_CODE:
15524
        return isSetCouponCode();
15525
      }
15526
      throw new IllegalStateException();
15527
    }
15528
 
15529
    @Override
15530
    public boolean equals(Object that) {
15531
      if (that == null)
15532
        return false;
15533
      if (that instanceof getSuccessfulPaymentCountForCoupon_args)
15534
        return this.equals((getSuccessfulPaymentCountForCoupon_args)that);
15535
      return false;
15536
    }
15537
 
15538
    public boolean equals(getSuccessfulPaymentCountForCoupon_args that) {
15539
      if (that == null)
15540
        return false;
15541
 
15542
      boolean this_present_couponCode = true && this.isSetCouponCode();
15543
      boolean that_present_couponCode = true && that.isSetCouponCode();
15544
      if (this_present_couponCode || that_present_couponCode) {
15545
        if (!(this_present_couponCode && that_present_couponCode))
15546
          return false;
15547
        if (!this.couponCode.equals(that.couponCode))
15548
          return false;
15549
      }
15550
 
15551
      return true;
15552
    }
15553
 
15554
    @Override
15555
    public int hashCode() {
15556
      return 0;
15557
    }
15558
 
15559
    public int compareTo(getSuccessfulPaymentCountForCoupon_args other) {
15560
      if (!getClass().equals(other.getClass())) {
15561
        return getClass().getName().compareTo(other.getClass().getName());
15562
      }
15563
 
15564
      int lastComparison = 0;
15565
      getSuccessfulPaymentCountForCoupon_args typedOther = (getSuccessfulPaymentCountForCoupon_args)other;
15566
 
3430 rajveer 15567
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3385 varun.gupt 15568
      if (lastComparison != 0) {
15569
        return lastComparison;
15570
      }
3430 rajveer 15571
      if (isSetCouponCode()) {
15572
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
15573
        if (lastComparison != 0) {
15574
          return lastComparison;
15575
        }
3385 varun.gupt 15576
      }
15577
      return 0;
15578
    }
15579
 
3430 rajveer 15580
    public _Fields fieldForId(int fieldId) {
15581
      return _Fields.findByThriftId(fieldId);
15582
    }
15583
 
15584
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15585
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 15586
      iprot.readStructBegin();
15587
      while (true)
15588
      {
15589
        field = iprot.readFieldBegin();
3430 rajveer 15590
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 15591
          break;
15592
        }
3430 rajveer 15593
        switch (field.id) {
15594
          case 1: // COUPON_CODE
15595
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
15596
              this.couponCode = iprot.readString();
15597
            } else { 
15598
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15599
            }
15600
            break;
15601
          default:
15602
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 15603
        }
3430 rajveer 15604
        iprot.readFieldEnd();
3385 varun.gupt 15605
      }
15606
      iprot.readStructEnd();
15607
      validate();
15608
    }
15609
 
3430 rajveer 15610
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 15611
      validate();
15612
 
15613
      oprot.writeStructBegin(STRUCT_DESC);
15614
      if (this.couponCode != null) {
15615
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
15616
        oprot.writeString(this.couponCode);
15617
        oprot.writeFieldEnd();
15618
      }
15619
      oprot.writeFieldStop();
15620
      oprot.writeStructEnd();
15621
    }
15622
 
15623
    @Override
15624
    public String toString() {
15625
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_args(");
15626
      boolean first = true;
15627
 
15628
      sb.append("couponCode:");
15629
      if (this.couponCode == null) {
15630
        sb.append("null");
15631
      } else {
15632
        sb.append(this.couponCode);
15633
      }
15634
      first = false;
15635
      sb.append(")");
15636
      return sb.toString();
15637
    }
15638
 
3430 rajveer 15639
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 15640
      // check for required fields
15641
    }
15642
 
3430 rajveer 15643
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15644
      try {
15645
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15646
      } catch (org.apache.thrift.TException te) {
15647
        throw new java.io.IOException(te);
15648
      }
15649
    }
15650
 
15651
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15652
      try {
15653
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15654
      } catch (org.apache.thrift.TException te) {
15655
        throw new java.io.IOException(te);
15656
      }
15657
    }
15658
 
3385 varun.gupt 15659
  }
15660
 
3430 rajveer 15661
  public static class getSuccessfulPaymentCountForCoupon_result implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_result, getSuccessfulPaymentCountForCoupon_result._Fields>, java.io.Serializable, Cloneable   {
15662
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_result");
3385 varun.gupt 15663
 
3430 rajveer 15664
    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);
15665
    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 15666
 
3430 rajveer 15667
    private long success; // required
15668
    private PromotionException pex; // required
3385 varun.gupt 15669
 
15670
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 15671
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 15672
      SUCCESS((short)0, "success"),
15673
      PEX((short)1, "pex");
15674
 
15675
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15676
 
15677
      static {
15678
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15679
          byName.put(field.getFieldName(), field);
15680
        }
15681
      }
15682
 
15683
      /**
15684
       * Find the _Fields constant that matches fieldId, or null if its not found.
15685
       */
15686
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 15687
        switch(fieldId) {
15688
          case 0: // SUCCESS
15689
            return SUCCESS;
15690
          case 1: // PEX
15691
            return PEX;
15692
          default:
15693
            return null;
15694
        }
3385 varun.gupt 15695
      }
15696
 
15697
      /**
15698
       * Find the _Fields constant that matches fieldId, throwing an exception
15699
       * if it is not found.
15700
       */
15701
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15702
        _Fields fields = findByThriftId(fieldId);
15703
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15704
        return fields;
15705
      }
15706
 
15707
      /**
15708
       * Find the _Fields constant that matches name, or null if its not found.
15709
       */
15710
      public static _Fields findByName(String name) {
15711
        return byName.get(name);
15712
      }
15713
 
15714
      private final short _thriftId;
15715
      private final String _fieldName;
15716
 
15717
      _Fields(short thriftId, String fieldName) {
15718
        _thriftId = thriftId;
15719
        _fieldName = fieldName;
15720
      }
15721
 
15722
      public short getThriftFieldId() {
15723
        return _thriftId;
15724
      }
15725
 
15726
      public String getFieldName() {
15727
        return _fieldName;
15728
      }
15729
    }
15730
 
15731
    // isset id assignments
15732
    private static final int __SUCCESS_ISSET_ID = 0;
15733
    private BitSet __isset_bit_vector = new BitSet(1);
15734
 
3430 rajveer 15735
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 15736
    static {
3430 rajveer 15737
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15738
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15739
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
15740
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15741
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
15742
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15743
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_result.class, metaDataMap);
3385 varun.gupt 15744
    }
15745
 
15746
    public getSuccessfulPaymentCountForCoupon_result() {
15747
    }
15748
 
15749
    public getSuccessfulPaymentCountForCoupon_result(
15750
      long success,
15751
      PromotionException pex)
15752
    {
15753
      this();
15754
      this.success = success;
15755
      setSuccessIsSet(true);
15756
      this.pex = pex;
15757
    }
15758
 
15759
    /**
15760
     * Performs a deep copy on <i>other</i>.
15761
     */
15762
    public getSuccessfulPaymentCountForCoupon_result(getSuccessfulPaymentCountForCoupon_result other) {
15763
      __isset_bit_vector.clear();
15764
      __isset_bit_vector.or(other.__isset_bit_vector);
15765
      this.success = other.success;
15766
      if (other.isSetPex()) {
15767
        this.pex = new PromotionException(other.pex);
15768
      }
15769
    }
15770
 
15771
    public getSuccessfulPaymentCountForCoupon_result deepCopy() {
15772
      return new getSuccessfulPaymentCountForCoupon_result(this);
15773
    }
15774
 
3430 rajveer 15775
    @Override
15776
    public void clear() {
15777
      setSuccessIsSet(false);
15778
      this.success = 0;
15779
      this.pex = null;
3385 varun.gupt 15780
    }
15781
 
15782
    public long getSuccess() {
15783
      return this.success;
15784
    }
15785
 
3430 rajveer 15786
    public void setSuccess(long success) {
3385 varun.gupt 15787
      this.success = success;
15788
      setSuccessIsSet(true);
15789
    }
15790
 
15791
    public void unsetSuccess() {
15792
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
15793
    }
15794
 
3430 rajveer 15795
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 15796
    public boolean isSetSuccess() {
15797
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
15798
    }
15799
 
15800
    public void setSuccessIsSet(boolean value) {
15801
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
15802
    }
15803
 
15804
    public PromotionException getPex() {
15805
      return this.pex;
15806
    }
15807
 
3430 rajveer 15808
    public void setPex(PromotionException pex) {
3385 varun.gupt 15809
      this.pex = pex;
15810
    }
15811
 
15812
    public void unsetPex() {
15813
      this.pex = null;
15814
    }
15815
 
3430 rajveer 15816
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 15817
    public boolean isSetPex() {
15818
      return this.pex != null;
15819
    }
15820
 
15821
    public void setPexIsSet(boolean value) {
15822
      if (!value) {
15823
        this.pex = null;
15824
      }
15825
    }
15826
 
15827
    public void setFieldValue(_Fields field, Object value) {
15828
      switch (field) {
15829
      case SUCCESS:
15830
        if (value == null) {
15831
          unsetSuccess();
15832
        } else {
15833
          setSuccess((Long)value);
15834
        }
15835
        break;
15836
 
15837
      case PEX:
15838
        if (value == null) {
15839
          unsetPex();
15840
        } else {
15841
          setPex((PromotionException)value);
15842
        }
15843
        break;
15844
 
15845
      }
15846
    }
15847
 
15848
    public Object getFieldValue(_Fields field) {
15849
      switch (field) {
15850
      case SUCCESS:
3430 rajveer 15851
        return Long.valueOf(getSuccess());
3385 varun.gupt 15852
 
15853
      case PEX:
15854
        return getPex();
15855
 
15856
      }
15857
      throw new IllegalStateException();
15858
    }
15859
 
3430 rajveer 15860
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15861
    public boolean isSet(_Fields field) {
15862
      if (field == null) {
15863
        throw new IllegalArgumentException();
15864
      }
3385 varun.gupt 15865
 
15866
      switch (field) {
15867
      case SUCCESS:
15868
        return isSetSuccess();
15869
      case PEX:
15870
        return isSetPex();
15871
      }
15872
      throw new IllegalStateException();
15873
    }
15874
 
15875
    @Override
15876
    public boolean equals(Object that) {
15877
      if (that == null)
15878
        return false;
15879
      if (that instanceof getSuccessfulPaymentCountForCoupon_result)
15880
        return this.equals((getSuccessfulPaymentCountForCoupon_result)that);
15881
      return false;
15882
    }
15883
 
15884
    public boolean equals(getSuccessfulPaymentCountForCoupon_result that) {
15885
      if (that == null)
15886
        return false;
15887
 
15888
      boolean this_present_success = true;
15889
      boolean that_present_success = true;
15890
      if (this_present_success || that_present_success) {
15891
        if (!(this_present_success && that_present_success))
15892
          return false;
15893
        if (this.success != that.success)
15894
          return false;
15895
      }
15896
 
15897
      boolean this_present_pex = true && this.isSetPex();
15898
      boolean that_present_pex = true && that.isSetPex();
15899
      if (this_present_pex || that_present_pex) {
15900
        if (!(this_present_pex && that_present_pex))
15901
          return false;
15902
        if (!this.pex.equals(that.pex))
15903
          return false;
15904
      }
15905
 
15906
      return true;
15907
    }
15908
 
15909
    @Override
15910
    public int hashCode() {
15911
      return 0;
15912
    }
15913
 
15914
    public int compareTo(getSuccessfulPaymentCountForCoupon_result other) {
15915
      if (!getClass().equals(other.getClass())) {
15916
        return getClass().getName().compareTo(other.getClass().getName());
15917
      }
15918
 
15919
      int lastComparison = 0;
15920
      getSuccessfulPaymentCountForCoupon_result typedOther = (getSuccessfulPaymentCountForCoupon_result)other;
15921
 
3430 rajveer 15922
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 15923
      if (lastComparison != 0) {
15924
        return lastComparison;
15925
      }
3430 rajveer 15926
      if (isSetSuccess()) {
15927
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
15928
        if (lastComparison != 0) {
15929
          return lastComparison;
15930
        }
3385 varun.gupt 15931
      }
3430 rajveer 15932
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 15933
      if (lastComparison != 0) {
15934
        return lastComparison;
15935
      }
3430 rajveer 15936
      if (isSetPex()) {
15937
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
15938
        if (lastComparison != 0) {
15939
          return lastComparison;
15940
        }
3385 varun.gupt 15941
      }
15942
      return 0;
15943
    }
15944
 
3430 rajveer 15945
    public _Fields fieldForId(int fieldId) {
15946
      return _Fields.findByThriftId(fieldId);
15947
    }
15948
 
15949
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15950
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 15951
      iprot.readStructBegin();
15952
      while (true)
15953
      {
15954
        field = iprot.readFieldBegin();
3430 rajveer 15955
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 15956
          break;
15957
        }
3430 rajveer 15958
        switch (field.id) {
15959
          case 0: // SUCCESS
15960
            if (field.type == org.apache.thrift.protocol.TType.I64) {
15961
              this.success = iprot.readI64();
15962
              setSuccessIsSet(true);
15963
            } else { 
15964
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15965
            }
15966
            break;
15967
          case 1: // PEX
15968
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
15969
              this.pex = new PromotionException();
15970
              this.pex.read(iprot);
15971
            } else { 
15972
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15973
            }
15974
            break;
15975
          default:
15976
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 15977
        }
3430 rajveer 15978
        iprot.readFieldEnd();
3385 varun.gupt 15979
      }
15980
      iprot.readStructEnd();
15981
      validate();
15982
    }
15983
 
3430 rajveer 15984
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 15985
      oprot.writeStructBegin(STRUCT_DESC);
15986
 
15987
      if (this.isSetSuccess()) {
15988
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
15989
        oprot.writeI64(this.success);
15990
        oprot.writeFieldEnd();
15991
      } else if (this.isSetPex()) {
15992
        oprot.writeFieldBegin(PEX_FIELD_DESC);
15993
        this.pex.write(oprot);
15994
        oprot.writeFieldEnd();
15995
      }
15996
      oprot.writeFieldStop();
15997
      oprot.writeStructEnd();
15998
    }
15999
 
16000
    @Override
16001
    public String toString() {
16002
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_result(");
16003
      boolean first = true;
16004
 
16005
      sb.append("success:");
16006
      sb.append(this.success);
16007
      first = false;
16008
      if (!first) sb.append(", ");
16009
      sb.append("pex:");
16010
      if (this.pex == null) {
16011
        sb.append("null");
16012
      } else {
16013
        sb.append(this.pex);
16014
      }
16015
      first = false;
16016
      sb.append(")");
16017
      return sb.toString();
16018
    }
16019
 
3430 rajveer 16020
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 16021
      // check for required fields
16022
    }
16023
 
3430 rajveer 16024
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16025
      try {
16026
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16027
      } catch (org.apache.thrift.TException te) {
16028
        throw new java.io.IOException(te);
16029
      }
16030
    }
16031
 
16032
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16033
      try {
16034
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16035
      } catch (org.apache.thrift.TException te) {
16036
        throw new java.io.IOException(te);
16037
      }
16038
    }
16039
 
3385 varun.gupt 16040
  }
16041
 
3430 rajveer 16042
  public static class getRuleDocString_args implements org.apache.thrift.TBase<getRuleDocString_args, getRuleDocString_args._Fields>, java.io.Serializable, Cloneable   {
16043
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_args");
3385 varun.gupt 16044
 
3430 rajveer 16045
    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 16046
 
3430 rajveer 16047
    private String ruleName; // required
3385 varun.gupt 16048
 
16049
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 16050
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 16051
      RULE_NAME((short)1, "ruleName");
16052
 
16053
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16054
 
16055
      static {
16056
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16057
          byName.put(field.getFieldName(), field);
16058
        }
16059
      }
16060
 
16061
      /**
16062
       * Find the _Fields constant that matches fieldId, or null if its not found.
16063
       */
16064
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 16065
        switch(fieldId) {
16066
          case 1: // RULE_NAME
16067
            return RULE_NAME;
16068
          default:
16069
            return null;
16070
        }
3385 varun.gupt 16071
      }
16072
 
16073
      /**
16074
       * Find the _Fields constant that matches fieldId, throwing an exception
16075
       * if it is not found.
16076
       */
16077
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16078
        _Fields fields = findByThriftId(fieldId);
16079
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16080
        return fields;
16081
      }
16082
 
16083
      /**
16084
       * Find the _Fields constant that matches name, or null if its not found.
16085
       */
16086
      public static _Fields findByName(String name) {
16087
        return byName.get(name);
16088
      }
16089
 
16090
      private final short _thriftId;
16091
      private final String _fieldName;
16092
 
16093
      _Fields(short thriftId, String fieldName) {
16094
        _thriftId = thriftId;
16095
        _fieldName = fieldName;
16096
      }
16097
 
16098
      public short getThriftFieldId() {
16099
        return _thriftId;
16100
      }
16101
 
16102
      public String getFieldName() {
16103
        return _fieldName;
16104
      }
16105
    }
16106
 
16107
    // isset id assignments
16108
 
3430 rajveer 16109
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 16110
    static {
3430 rajveer 16111
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16112
      tmpMap.put(_Fields.RULE_NAME, new org.apache.thrift.meta_data.FieldMetaData("ruleName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16113
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
16114
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16115
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_args.class, metaDataMap);
3385 varun.gupt 16116
    }
16117
 
16118
    public getRuleDocString_args() {
16119
    }
16120
 
16121
    public getRuleDocString_args(
16122
      String ruleName)
16123
    {
16124
      this();
16125
      this.ruleName = ruleName;
16126
    }
16127
 
16128
    /**
16129
     * Performs a deep copy on <i>other</i>.
16130
     */
16131
    public getRuleDocString_args(getRuleDocString_args other) {
16132
      if (other.isSetRuleName()) {
16133
        this.ruleName = other.ruleName;
16134
      }
16135
    }
16136
 
16137
    public getRuleDocString_args deepCopy() {
16138
      return new getRuleDocString_args(this);
16139
    }
16140
 
3430 rajveer 16141
    @Override
16142
    public void clear() {
16143
      this.ruleName = null;
3385 varun.gupt 16144
    }
16145
 
16146
    public String getRuleName() {
16147
      return this.ruleName;
16148
    }
16149
 
3430 rajveer 16150
    public void setRuleName(String ruleName) {
3385 varun.gupt 16151
      this.ruleName = ruleName;
16152
    }
16153
 
16154
    public void unsetRuleName() {
16155
      this.ruleName = null;
16156
    }
16157
 
3430 rajveer 16158
    /** Returns true if field ruleName is set (has been assigned a value) and false otherwise */
3385 varun.gupt 16159
    public boolean isSetRuleName() {
16160
      return this.ruleName != null;
16161
    }
16162
 
16163
    public void setRuleNameIsSet(boolean value) {
16164
      if (!value) {
16165
        this.ruleName = null;
16166
      }
16167
    }
16168
 
16169
    public void setFieldValue(_Fields field, Object value) {
16170
      switch (field) {
16171
      case RULE_NAME:
16172
        if (value == null) {
16173
          unsetRuleName();
16174
        } else {
16175
          setRuleName((String)value);
16176
        }
16177
        break;
16178
 
16179
      }
16180
    }
16181
 
16182
    public Object getFieldValue(_Fields field) {
16183
      switch (field) {
16184
      case RULE_NAME:
16185
        return getRuleName();
16186
 
16187
      }
16188
      throw new IllegalStateException();
16189
    }
16190
 
3430 rajveer 16191
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16192
    public boolean isSet(_Fields field) {
16193
      if (field == null) {
16194
        throw new IllegalArgumentException();
16195
      }
3385 varun.gupt 16196
 
16197
      switch (field) {
16198
      case RULE_NAME:
16199
        return isSetRuleName();
16200
      }
16201
      throw new IllegalStateException();
16202
    }
16203
 
16204
    @Override
16205
    public boolean equals(Object that) {
16206
      if (that == null)
16207
        return false;
16208
      if (that instanceof getRuleDocString_args)
16209
        return this.equals((getRuleDocString_args)that);
16210
      return false;
16211
    }
16212
 
16213
    public boolean equals(getRuleDocString_args that) {
16214
      if (that == null)
16215
        return false;
16216
 
16217
      boolean this_present_ruleName = true && this.isSetRuleName();
16218
      boolean that_present_ruleName = true && that.isSetRuleName();
16219
      if (this_present_ruleName || that_present_ruleName) {
16220
        if (!(this_present_ruleName && that_present_ruleName))
16221
          return false;
16222
        if (!this.ruleName.equals(that.ruleName))
16223
          return false;
16224
      }
16225
 
16226
      return true;
16227
    }
16228
 
16229
    @Override
16230
    public int hashCode() {
16231
      return 0;
16232
    }
16233
 
16234
    public int compareTo(getRuleDocString_args other) {
16235
      if (!getClass().equals(other.getClass())) {
16236
        return getClass().getName().compareTo(other.getClass().getName());
16237
      }
16238
 
16239
      int lastComparison = 0;
16240
      getRuleDocString_args typedOther = (getRuleDocString_args)other;
16241
 
3430 rajveer 16242
      lastComparison = Boolean.valueOf(isSetRuleName()).compareTo(typedOther.isSetRuleName());
3385 varun.gupt 16243
      if (lastComparison != 0) {
16244
        return lastComparison;
16245
      }
3430 rajveer 16246
      if (isSetRuleName()) {
16247
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleName, typedOther.ruleName);
16248
        if (lastComparison != 0) {
16249
          return lastComparison;
16250
        }
3385 varun.gupt 16251
      }
16252
      return 0;
16253
    }
16254
 
3430 rajveer 16255
    public _Fields fieldForId(int fieldId) {
16256
      return _Fields.findByThriftId(fieldId);
16257
    }
16258
 
16259
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16260
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 16261
      iprot.readStructBegin();
16262
      while (true)
16263
      {
16264
        field = iprot.readFieldBegin();
3430 rajveer 16265
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 16266
          break;
16267
        }
3430 rajveer 16268
        switch (field.id) {
16269
          case 1: // RULE_NAME
16270
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
16271
              this.ruleName = iprot.readString();
16272
            } else { 
16273
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16274
            }
16275
            break;
16276
          default:
16277
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 16278
        }
3430 rajveer 16279
        iprot.readFieldEnd();
3385 varun.gupt 16280
      }
16281
      iprot.readStructEnd();
16282
      validate();
16283
    }
16284
 
3430 rajveer 16285
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 16286
      validate();
16287
 
16288
      oprot.writeStructBegin(STRUCT_DESC);
16289
      if (this.ruleName != null) {
16290
        oprot.writeFieldBegin(RULE_NAME_FIELD_DESC);
16291
        oprot.writeString(this.ruleName);
16292
        oprot.writeFieldEnd();
16293
      }
16294
      oprot.writeFieldStop();
16295
      oprot.writeStructEnd();
16296
    }
16297
 
16298
    @Override
16299
    public String toString() {
16300
      StringBuilder sb = new StringBuilder("getRuleDocString_args(");
16301
      boolean first = true;
16302
 
16303
      sb.append("ruleName:");
16304
      if (this.ruleName == null) {
16305
        sb.append("null");
16306
      } else {
16307
        sb.append(this.ruleName);
16308
      }
16309
      first = false;
16310
      sb.append(")");
16311
      return sb.toString();
16312
    }
16313
 
3430 rajveer 16314
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 16315
      // check for required fields
16316
    }
16317
 
3430 rajveer 16318
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16319
      try {
16320
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16321
      } catch (org.apache.thrift.TException te) {
16322
        throw new java.io.IOException(te);
16323
      }
16324
    }
16325
 
16326
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16327
      try {
16328
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16329
      } catch (org.apache.thrift.TException te) {
16330
        throw new java.io.IOException(te);
16331
      }
16332
    }
16333
 
3385 varun.gupt 16334
  }
16335
 
3430 rajveer 16336
  public static class getRuleDocString_result implements org.apache.thrift.TBase<getRuleDocString_result, getRuleDocString_result._Fields>, java.io.Serializable, Cloneable   {
16337
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_result");
3385 varun.gupt 16338
 
3430 rajveer 16339
    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 16340
 
3430 rajveer 16341
    private String success; // required
3385 varun.gupt 16342
 
16343
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 16344
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 16345
      SUCCESS((short)0, "success");
16346
 
16347
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16348
 
16349
      static {
16350
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16351
          byName.put(field.getFieldName(), field);
16352
        }
16353
      }
16354
 
16355
      /**
16356
       * Find the _Fields constant that matches fieldId, or null if its not found.
16357
       */
16358
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 16359
        switch(fieldId) {
16360
          case 0: // SUCCESS
16361
            return SUCCESS;
16362
          default:
16363
            return null;
16364
        }
3385 varun.gupt 16365
      }
16366
 
16367
      /**
16368
       * Find the _Fields constant that matches fieldId, throwing an exception
16369
       * if it is not found.
16370
       */
16371
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16372
        _Fields fields = findByThriftId(fieldId);
16373
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16374
        return fields;
16375
      }
16376
 
16377
      /**
16378
       * Find the _Fields constant that matches name, or null if its not found.
16379
       */
16380
      public static _Fields findByName(String name) {
16381
        return byName.get(name);
16382
      }
16383
 
16384
      private final short _thriftId;
16385
      private final String _fieldName;
16386
 
16387
      _Fields(short thriftId, String fieldName) {
16388
        _thriftId = thriftId;
16389
        _fieldName = fieldName;
16390
      }
16391
 
16392
      public short getThriftFieldId() {
16393
        return _thriftId;
16394
      }
16395
 
16396
      public String getFieldName() {
16397
        return _fieldName;
16398
      }
16399
    }
16400
 
16401
    // isset id assignments
16402
 
3430 rajveer 16403
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 16404
    static {
3430 rajveer 16405
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16406
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16407
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
16408
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16409
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_result.class, metaDataMap);
3385 varun.gupt 16410
    }
16411
 
16412
    public getRuleDocString_result() {
16413
    }
16414
 
16415
    public getRuleDocString_result(
16416
      String success)
16417
    {
16418
      this();
16419
      this.success = success;
16420
    }
16421
 
16422
    /**
16423
     * Performs a deep copy on <i>other</i>.
16424
     */
16425
    public getRuleDocString_result(getRuleDocString_result other) {
16426
      if (other.isSetSuccess()) {
16427
        this.success = other.success;
16428
      }
16429
    }
16430
 
16431
    public getRuleDocString_result deepCopy() {
16432
      return new getRuleDocString_result(this);
16433
    }
16434
 
3430 rajveer 16435
    @Override
16436
    public void clear() {
16437
      this.success = null;
3385 varun.gupt 16438
    }
16439
 
16440
    public String getSuccess() {
16441
      return this.success;
16442
    }
16443
 
3430 rajveer 16444
    public void setSuccess(String success) {
3385 varun.gupt 16445
      this.success = success;
16446
    }
16447
 
16448
    public void unsetSuccess() {
16449
      this.success = null;
16450
    }
16451
 
3430 rajveer 16452
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 16453
    public boolean isSetSuccess() {
16454
      return this.success != null;
16455
    }
16456
 
16457
    public void setSuccessIsSet(boolean value) {
16458
      if (!value) {
16459
        this.success = null;
16460
      }
16461
    }
16462
 
16463
    public void setFieldValue(_Fields field, Object value) {
16464
      switch (field) {
16465
      case SUCCESS:
16466
        if (value == null) {
16467
          unsetSuccess();
16468
        } else {
16469
          setSuccess((String)value);
16470
        }
16471
        break;
16472
 
16473
      }
16474
    }
16475
 
16476
    public Object getFieldValue(_Fields field) {
16477
      switch (field) {
16478
      case SUCCESS:
16479
        return getSuccess();
16480
 
16481
      }
16482
      throw new IllegalStateException();
16483
    }
16484
 
3430 rajveer 16485
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16486
    public boolean isSet(_Fields field) {
16487
      if (field == null) {
16488
        throw new IllegalArgumentException();
16489
      }
3385 varun.gupt 16490
 
16491
      switch (field) {
16492
      case SUCCESS:
16493
        return isSetSuccess();
16494
      }
16495
      throw new IllegalStateException();
16496
    }
16497
 
16498
    @Override
16499
    public boolean equals(Object that) {
16500
      if (that == null)
16501
        return false;
16502
      if (that instanceof getRuleDocString_result)
16503
        return this.equals((getRuleDocString_result)that);
16504
      return false;
16505
    }
16506
 
16507
    public boolean equals(getRuleDocString_result that) {
16508
      if (that == null)
16509
        return false;
16510
 
16511
      boolean this_present_success = true && this.isSetSuccess();
16512
      boolean that_present_success = true && that.isSetSuccess();
16513
      if (this_present_success || that_present_success) {
16514
        if (!(this_present_success && that_present_success))
16515
          return false;
16516
        if (!this.success.equals(that.success))
16517
          return false;
16518
      }
16519
 
16520
      return true;
16521
    }
16522
 
16523
    @Override
16524
    public int hashCode() {
16525
      return 0;
16526
    }
16527
 
16528
    public int compareTo(getRuleDocString_result other) {
16529
      if (!getClass().equals(other.getClass())) {
16530
        return getClass().getName().compareTo(other.getClass().getName());
16531
      }
16532
 
16533
      int lastComparison = 0;
16534
      getRuleDocString_result typedOther = (getRuleDocString_result)other;
16535
 
3430 rajveer 16536
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 16537
      if (lastComparison != 0) {
16538
        return lastComparison;
16539
      }
3430 rajveer 16540
      if (isSetSuccess()) {
16541
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
16542
        if (lastComparison != 0) {
16543
          return lastComparison;
16544
        }
3385 varun.gupt 16545
      }
16546
      return 0;
16547
    }
16548
 
3430 rajveer 16549
    public _Fields fieldForId(int fieldId) {
16550
      return _Fields.findByThriftId(fieldId);
16551
    }
16552
 
16553
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16554
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 16555
      iprot.readStructBegin();
16556
      while (true)
16557
      {
16558
        field = iprot.readFieldBegin();
3430 rajveer 16559
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 16560
          break;
16561
        }
3430 rajveer 16562
        switch (field.id) {
16563
          case 0: // SUCCESS
16564
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
16565
              this.success = iprot.readString();
16566
            } else { 
16567
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16568
            }
16569
            break;
16570
          default:
16571
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 16572
        }
3430 rajveer 16573
        iprot.readFieldEnd();
3385 varun.gupt 16574
      }
16575
      iprot.readStructEnd();
16576
      validate();
16577
    }
16578
 
3430 rajveer 16579
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 16580
      oprot.writeStructBegin(STRUCT_DESC);
16581
 
16582
      if (this.isSetSuccess()) {
16583
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
16584
        oprot.writeString(this.success);
16585
        oprot.writeFieldEnd();
16586
      }
16587
      oprot.writeFieldStop();
16588
      oprot.writeStructEnd();
16589
    }
16590
 
16591
    @Override
16592
    public String toString() {
16593
      StringBuilder sb = new StringBuilder("getRuleDocString_result(");
16594
      boolean first = true;
16595
 
16596
      sb.append("success:");
16597
      if (this.success == null) {
16598
        sb.append("null");
16599
      } else {
16600
        sb.append(this.success);
16601
      }
16602
      first = false;
16603
      sb.append(")");
16604
      return sb.toString();
16605
    }
16606
 
3430 rajveer 16607
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 16608
      // check for required fields
16609
    }
16610
 
3430 rajveer 16611
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16612
      try {
16613
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16614
      } catch (org.apache.thrift.TException te) {
16615
        throw new java.io.IOException(te);
16616
      }
16617
    }
16618
 
16619
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16620
      try {
16621
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16622
      } catch (org.apache.thrift.TException te) {
16623
        throw new java.io.IOException(te);
16624
      }
16625
    }
16626
 
3385 varun.gupt 16627
  }
16628
 
4189 varun.gupt 16629
  public static class getItemDiscountMap_args implements org.apache.thrift.TBase<getItemDiscountMap_args, getItemDiscountMap_args._Fields>, java.io.Serializable, Cloneable   {
16630
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_args");
16631
 
16632
    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);
16633
 
16634
    private List<Long> itemIds; // required
16635
 
16636
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
16637
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
16638
      ITEM_IDS((short)1, "itemIds");
16639
 
16640
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16641
 
16642
      static {
16643
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16644
          byName.put(field.getFieldName(), field);
16645
        }
16646
      }
16647
 
16648
      /**
16649
       * Find the _Fields constant that matches fieldId, or null if its not found.
16650
       */
16651
      public static _Fields findByThriftId(int fieldId) {
16652
        switch(fieldId) {
16653
          case 1: // ITEM_IDS
16654
            return ITEM_IDS;
16655
          default:
16656
            return null;
16657
        }
16658
      }
16659
 
16660
      /**
16661
       * Find the _Fields constant that matches fieldId, throwing an exception
16662
       * if it is not found.
16663
       */
16664
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16665
        _Fields fields = findByThriftId(fieldId);
16666
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16667
        return fields;
16668
      }
16669
 
16670
      /**
16671
       * Find the _Fields constant that matches name, or null if its not found.
16672
       */
16673
      public static _Fields findByName(String name) {
16674
        return byName.get(name);
16675
      }
16676
 
16677
      private final short _thriftId;
16678
      private final String _fieldName;
16679
 
16680
      _Fields(short thriftId, String fieldName) {
16681
        _thriftId = thriftId;
16682
        _fieldName = fieldName;
16683
      }
16684
 
16685
      public short getThriftFieldId() {
16686
        return _thriftId;
16687
      }
16688
 
16689
      public String getFieldName() {
16690
        return _fieldName;
16691
      }
16692
    }
16693
 
16694
    // isset id assignments
16695
 
16696
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
16697
    static {
16698
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16699
      tmpMap.put(_Fields.ITEM_IDS, new org.apache.thrift.meta_data.FieldMetaData("itemIds", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16700
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
16701
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
16702
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16703
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_args.class, metaDataMap);
16704
    }
16705
 
16706
    public getItemDiscountMap_args() {
16707
    }
16708
 
16709
    public getItemDiscountMap_args(
16710
      List<Long> itemIds)
16711
    {
16712
      this();
16713
      this.itemIds = itemIds;
16714
    }
16715
 
16716
    /**
16717
     * Performs a deep copy on <i>other</i>.
16718
     */
16719
    public getItemDiscountMap_args(getItemDiscountMap_args other) {
16720
      if (other.isSetItemIds()) {
16721
        List<Long> __this__itemIds = new ArrayList<Long>();
16722
        for (Long other_element : other.itemIds) {
16723
          __this__itemIds.add(other_element);
16724
        }
16725
        this.itemIds = __this__itemIds;
16726
      }
16727
    }
16728
 
16729
    public getItemDiscountMap_args deepCopy() {
16730
      return new getItemDiscountMap_args(this);
16731
    }
16732
 
16733
    @Override
16734
    public void clear() {
16735
      this.itemIds = null;
16736
    }
16737
 
16738
    public int getItemIdsSize() {
16739
      return (this.itemIds == null) ? 0 : this.itemIds.size();
16740
    }
16741
 
16742
    public java.util.Iterator<Long> getItemIdsIterator() {
16743
      return (this.itemIds == null) ? null : this.itemIds.iterator();
16744
    }
16745
 
16746
    public void addToItemIds(long elem) {
16747
      if (this.itemIds == null) {
16748
        this.itemIds = new ArrayList<Long>();
16749
      }
16750
      this.itemIds.add(elem);
16751
    }
16752
 
16753
    public List<Long> getItemIds() {
16754
      return this.itemIds;
16755
    }
16756
 
16757
    public void setItemIds(List<Long> itemIds) {
16758
      this.itemIds = itemIds;
16759
    }
16760
 
16761
    public void unsetItemIds() {
16762
      this.itemIds = null;
16763
    }
16764
 
16765
    /** Returns true if field itemIds is set (has been assigned a value) and false otherwise */
16766
    public boolean isSetItemIds() {
16767
      return this.itemIds != null;
16768
    }
16769
 
16770
    public void setItemIdsIsSet(boolean value) {
16771
      if (!value) {
16772
        this.itemIds = null;
16773
      }
16774
    }
16775
 
16776
    public void setFieldValue(_Fields field, Object value) {
16777
      switch (field) {
16778
      case ITEM_IDS:
16779
        if (value == null) {
16780
          unsetItemIds();
16781
        } else {
16782
          setItemIds((List<Long>)value);
16783
        }
16784
        break;
16785
 
16786
      }
16787
    }
16788
 
16789
    public Object getFieldValue(_Fields field) {
16790
      switch (field) {
16791
      case ITEM_IDS:
16792
        return getItemIds();
16793
 
16794
      }
16795
      throw new IllegalStateException();
16796
    }
16797
 
16798
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16799
    public boolean isSet(_Fields field) {
16800
      if (field == null) {
16801
        throw new IllegalArgumentException();
16802
      }
16803
 
16804
      switch (field) {
16805
      case ITEM_IDS:
16806
        return isSetItemIds();
16807
      }
16808
      throw new IllegalStateException();
16809
    }
16810
 
16811
    @Override
16812
    public boolean equals(Object that) {
16813
      if (that == null)
16814
        return false;
16815
      if (that instanceof getItemDiscountMap_args)
16816
        return this.equals((getItemDiscountMap_args)that);
16817
      return false;
16818
    }
16819
 
16820
    public boolean equals(getItemDiscountMap_args that) {
16821
      if (that == null)
16822
        return false;
16823
 
16824
      boolean this_present_itemIds = true && this.isSetItemIds();
16825
      boolean that_present_itemIds = true && that.isSetItemIds();
16826
      if (this_present_itemIds || that_present_itemIds) {
16827
        if (!(this_present_itemIds && that_present_itemIds))
16828
          return false;
16829
        if (!this.itemIds.equals(that.itemIds))
16830
          return false;
16831
      }
16832
 
16833
      return true;
16834
    }
16835
 
16836
    @Override
16837
    public int hashCode() {
16838
      return 0;
16839
    }
16840
 
16841
    public int compareTo(getItemDiscountMap_args other) {
16842
      if (!getClass().equals(other.getClass())) {
16843
        return getClass().getName().compareTo(other.getClass().getName());
16844
      }
16845
 
16846
      int lastComparison = 0;
16847
      getItemDiscountMap_args typedOther = (getItemDiscountMap_args)other;
16848
 
16849
      lastComparison = Boolean.valueOf(isSetItemIds()).compareTo(typedOther.isSetItemIds());
16850
      if (lastComparison != 0) {
16851
        return lastComparison;
16852
      }
16853
      if (isSetItemIds()) {
16854
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemIds, typedOther.itemIds);
16855
        if (lastComparison != 0) {
16856
          return lastComparison;
16857
        }
16858
      }
16859
      return 0;
16860
    }
16861
 
16862
    public _Fields fieldForId(int fieldId) {
16863
      return _Fields.findByThriftId(fieldId);
16864
    }
16865
 
16866
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16867
      org.apache.thrift.protocol.TField field;
16868
      iprot.readStructBegin();
16869
      while (true)
16870
      {
16871
        field = iprot.readFieldBegin();
16872
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
16873
          break;
16874
        }
16875
        switch (field.id) {
16876
          case 1: // ITEM_IDS
16877
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
16878
              {
11592 amit.gupta 16879
                org.apache.thrift.protocol.TList _list42 = iprot.readListBegin();
16880
                this.itemIds = new ArrayList<Long>(_list42.size);
16881
                for (int _i43 = 0; _i43 < _list42.size; ++_i43)
4189 varun.gupt 16882
                {
11592 amit.gupta 16883
                  long _elem44; // required
16884
                  _elem44 = iprot.readI64();
16885
                  this.itemIds.add(_elem44);
4189 varun.gupt 16886
                }
16887
                iprot.readListEnd();
16888
              }
16889
            } else { 
16890
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16891
            }
16892
            break;
16893
          default:
16894
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16895
        }
16896
        iprot.readFieldEnd();
16897
      }
16898
      iprot.readStructEnd();
16899
      validate();
16900
    }
16901
 
16902
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
16903
      validate();
16904
 
16905
      oprot.writeStructBegin(STRUCT_DESC);
16906
      if (this.itemIds != null) {
16907
        oprot.writeFieldBegin(ITEM_IDS_FIELD_DESC);
16908
        {
16909
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.itemIds.size()));
11592 amit.gupta 16910
          for (long _iter45 : this.itemIds)
4189 varun.gupt 16911
          {
11592 amit.gupta 16912
            oprot.writeI64(_iter45);
4189 varun.gupt 16913
          }
16914
          oprot.writeListEnd();
16915
        }
16916
        oprot.writeFieldEnd();
16917
      }
16918
      oprot.writeFieldStop();
16919
      oprot.writeStructEnd();
16920
    }
16921
 
16922
    @Override
16923
    public String toString() {
16924
      StringBuilder sb = new StringBuilder("getItemDiscountMap_args(");
16925
      boolean first = true;
16926
 
16927
      sb.append("itemIds:");
16928
      if (this.itemIds == null) {
16929
        sb.append("null");
16930
      } else {
16931
        sb.append(this.itemIds);
16932
      }
16933
      first = false;
16934
      sb.append(")");
16935
      return sb.toString();
16936
    }
16937
 
16938
    public void validate() throws org.apache.thrift.TException {
16939
      // check for required fields
16940
    }
16941
 
16942
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16943
      try {
16944
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16945
      } catch (org.apache.thrift.TException te) {
16946
        throw new java.io.IOException(te);
16947
      }
16948
    }
16949
 
16950
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16951
      try {
16952
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16953
      } catch (org.apache.thrift.TException te) {
16954
        throw new java.io.IOException(te);
16955
      }
16956
    }
16957
 
16958
  }
16959
 
16960
  public static class getItemDiscountMap_result implements org.apache.thrift.TBase<getItemDiscountMap_result, getItemDiscountMap_result._Fields>, java.io.Serializable, Cloneable   {
16961
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_result");
16962
 
16963
    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);
16964
    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);
16965
 
16966
    private List<ItemCouponDiscount> success; // required
16967
    private PromotionException pex; // required
16968
 
16969
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
16970
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
16971
      SUCCESS((short)0, "success"),
16972
      PEX((short)1, "pex");
16973
 
16974
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16975
 
16976
      static {
16977
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16978
          byName.put(field.getFieldName(), field);
16979
        }
16980
      }
16981
 
16982
      /**
16983
       * Find the _Fields constant that matches fieldId, or null if its not found.
16984
       */
16985
      public static _Fields findByThriftId(int fieldId) {
16986
        switch(fieldId) {
16987
          case 0: // SUCCESS
16988
            return SUCCESS;
16989
          case 1: // PEX
16990
            return PEX;
16991
          default:
16992
            return null;
16993
        }
16994
      }
16995
 
16996
      /**
16997
       * Find the _Fields constant that matches fieldId, throwing an exception
16998
       * if it is not found.
16999
       */
17000
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17001
        _Fields fields = findByThriftId(fieldId);
17002
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17003
        return fields;
17004
      }
17005
 
17006
      /**
17007
       * Find the _Fields constant that matches name, or null if its not found.
17008
       */
17009
      public static _Fields findByName(String name) {
17010
        return byName.get(name);
17011
      }
17012
 
17013
      private final short _thriftId;
17014
      private final String _fieldName;
17015
 
17016
      _Fields(short thriftId, String fieldName) {
17017
        _thriftId = thriftId;
17018
        _fieldName = fieldName;
17019
      }
17020
 
17021
      public short getThriftFieldId() {
17022
        return _thriftId;
17023
      }
17024
 
17025
      public String getFieldName() {
17026
        return _fieldName;
17027
      }
17028
    }
17029
 
17030
    // isset id assignments
17031
 
17032
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
17033
    static {
17034
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
17035
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17036
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
17037
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ItemCouponDiscount.class))));
17038
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17039
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
17040
      metaDataMap = Collections.unmodifiableMap(tmpMap);
17041
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_result.class, metaDataMap);
17042
    }
17043
 
17044
    public getItemDiscountMap_result() {
17045
    }
17046
 
17047
    public getItemDiscountMap_result(
17048
      List<ItemCouponDiscount> success,
17049
      PromotionException pex)
17050
    {
17051
      this();
17052
      this.success = success;
17053
      this.pex = pex;
17054
    }
17055
 
17056
    /**
17057
     * Performs a deep copy on <i>other</i>.
17058
     */
17059
    public getItemDiscountMap_result(getItemDiscountMap_result other) {
17060
      if (other.isSetSuccess()) {
17061
        List<ItemCouponDiscount> __this__success = new ArrayList<ItemCouponDiscount>();
17062
        for (ItemCouponDiscount other_element : other.success) {
17063
          __this__success.add(new ItemCouponDiscount(other_element));
17064
        }
17065
        this.success = __this__success;
17066
      }
17067
      if (other.isSetPex()) {
17068
        this.pex = new PromotionException(other.pex);
17069
      }
17070
    }
17071
 
17072
    public getItemDiscountMap_result deepCopy() {
17073
      return new getItemDiscountMap_result(this);
17074
    }
17075
 
17076
    @Override
17077
    public void clear() {
17078
      this.success = null;
17079
      this.pex = null;
17080
    }
17081
 
17082
    public int getSuccessSize() {
17083
      return (this.success == null) ? 0 : this.success.size();
17084
    }
17085
 
17086
    public java.util.Iterator<ItemCouponDiscount> getSuccessIterator() {
17087
      return (this.success == null) ? null : this.success.iterator();
17088
    }
17089
 
17090
    public void addToSuccess(ItemCouponDiscount elem) {
17091
      if (this.success == null) {
17092
        this.success = new ArrayList<ItemCouponDiscount>();
17093
      }
17094
      this.success.add(elem);
17095
    }
17096
 
17097
    public List<ItemCouponDiscount> getSuccess() {
17098
      return this.success;
17099
    }
17100
 
17101
    public void setSuccess(List<ItemCouponDiscount> success) {
17102
      this.success = success;
17103
    }
17104
 
17105
    public void unsetSuccess() {
17106
      this.success = null;
17107
    }
17108
 
17109
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
17110
    public boolean isSetSuccess() {
17111
      return this.success != null;
17112
    }
17113
 
17114
    public void setSuccessIsSet(boolean value) {
17115
      if (!value) {
17116
        this.success = null;
17117
      }
17118
    }
17119
 
17120
    public PromotionException getPex() {
17121
      return this.pex;
17122
    }
17123
 
17124
    public void setPex(PromotionException pex) {
17125
      this.pex = pex;
17126
    }
17127
 
17128
    public void unsetPex() {
17129
      this.pex = null;
17130
    }
17131
 
17132
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
17133
    public boolean isSetPex() {
17134
      return this.pex != null;
17135
    }
17136
 
17137
    public void setPexIsSet(boolean value) {
17138
      if (!value) {
17139
        this.pex = null;
17140
      }
17141
    }
17142
 
17143
    public void setFieldValue(_Fields field, Object value) {
17144
      switch (field) {
17145
      case SUCCESS:
17146
        if (value == null) {
17147
          unsetSuccess();
17148
        } else {
17149
          setSuccess((List<ItemCouponDiscount>)value);
17150
        }
17151
        break;
17152
 
17153
      case PEX:
17154
        if (value == null) {
17155
          unsetPex();
17156
        } else {
17157
          setPex((PromotionException)value);
17158
        }
17159
        break;
17160
 
17161
      }
17162
    }
17163
 
17164
    public Object getFieldValue(_Fields field) {
17165
      switch (field) {
17166
      case SUCCESS:
17167
        return getSuccess();
17168
 
17169
      case PEX:
17170
        return getPex();
17171
 
17172
      }
17173
      throw new IllegalStateException();
17174
    }
17175
 
17176
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
17177
    public boolean isSet(_Fields field) {
17178
      if (field == null) {
17179
        throw new IllegalArgumentException();
17180
      }
17181
 
17182
      switch (field) {
17183
      case SUCCESS:
17184
        return isSetSuccess();
17185
      case PEX:
17186
        return isSetPex();
17187
      }
17188
      throw new IllegalStateException();
17189
    }
17190
 
17191
    @Override
17192
    public boolean equals(Object that) {
17193
      if (that == null)
17194
        return false;
17195
      if (that instanceof getItemDiscountMap_result)
17196
        return this.equals((getItemDiscountMap_result)that);
17197
      return false;
17198
    }
17199
 
17200
    public boolean equals(getItemDiscountMap_result that) {
17201
      if (that == null)
17202
        return false;
17203
 
17204
      boolean this_present_success = true && this.isSetSuccess();
17205
      boolean that_present_success = true && that.isSetSuccess();
17206
      if (this_present_success || that_present_success) {
17207
        if (!(this_present_success && that_present_success))
17208
          return false;
17209
        if (!this.success.equals(that.success))
17210
          return false;
17211
      }
17212
 
17213
      boolean this_present_pex = true && this.isSetPex();
17214
      boolean that_present_pex = true && that.isSetPex();
17215
      if (this_present_pex || that_present_pex) {
17216
        if (!(this_present_pex && that_present_pex))
17217
          return false;
17218
        if (!this.pex.equals(that.pex))
17219
          return false;
17220
      }
17221
 
17222
      return true;
17223
    }
17224
 
17225
    @Override
17226
    public int hashCode() {
17227
      return 0;
17228
    }
17229
 
17230
    public int compareTo(getItemDiscountMap_result other) {
17231
      if (!getClass().equals(other.getClass())) {
17232
        return getClass().getName().compareTo(other.getClass().getName());
17233
      }
17234
 
17235
      int lastComparison = 0;
17236
      getItemDiscountMap_result typedOther = (getItemDiscountMap_result)other;
17237
 
17238
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
17239
      if (lastComparison != 0) {
17240
        return lastComparison;
17241
      }
17242
      if (isSetSuccess()) {
17243
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
17244
        if (lastComparison != 0) {
17245
          return lastComparison;
17246
        }
17247
      }
17248
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
17249
      if (lastComparison != 0) {
17250
        return lastComparison;
17251
      }
17252
      if (isSetPex()) {
17253
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
17254
        if (lastComparison != 0) {
17255
          return lastComparison;
17256
        }
17257
      }
17258
      return 0;
17259
    }
17260
 
17261
    public _Fields fieldForId(int fieldId) {
17262
      return _Fields.findByThriftId(fieldId);
17263
    }
17264
 
17265
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17266
      org.apache.thrift.protocol.TField field;
17267
      iprot.readStructBegin();
17268
      while (true)
17269
      {
17270
        field = iprot.readFieldBegin();
17271
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17272
          break;
17273
        }
17274
        switch (field.id) {
17275
          case 0: // SUCCESS
17276
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
17277
              {
11592 amit.gupta 17278
                org.apache.thrift.protocol.TList _list46 = iprot.readListBegin();
17279
                this.success = new ArrayList<ItemCouponDiscount>(_list46.size);
17280
                for (int _i47 = 0; _i47 < _list46.size; ++_i47)
4189 varun.gupt 17281
                {
11592 amit.gupta 17282
                  ItemCouponDiscount _elem48; // required
17283
                  _elem48 = new ItemCouponDiscount();
17284
                  _elem48.read(iprot);
17285
                  this.success.add(_elem48);
4189 varun.gupt 17286
                }
17287
                iprot.readListEnd();
17288
              }
17289
            } else { 
17290
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17291
            }
17292
            break;
17293
          case 1: // PEX
17294
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
17295
              this.pex = new PromotionException();
17296
              this.pex.read(iprot);
17297
            } else { 
17298
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17299
            }
17300
            break;
17301
          default:
17302
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17303
        }
17304
        iprot.readFieldEnd();
17305
      }
17306
      iprot.readStructEnd();
17307
      validate();
17308
    }
17309
 
17310
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17311
      oprot.writeStructBegin(STRUCT_DESC);
17312
 
17313
      if (this.isSetSuccess()) {
17314
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
17315
        {
17316
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
11592 amit.gupta 17317
          for (ItemCouponDiscount _iter49 : this.success)
4189 varun.gupt 17318
          {
11592 amit.gupta 17319
            _iter49.write(oprot);
4189 varun.gupt 17320
          }
17321
          oprot.writeListEnd();
17322
        }
17323
        oprot.writeFieldEnd();
17324
      } else if (this.isSetPex()) {
17325
        oprot.writeFieldBegin(PEX_FIELD_DESC);
17326
        this.pex.write(oprot);
17327
        oprot.writeFieldEnd();
17328
      }
17329
      oprot.writeFieldStop();
17330
      oprot.writeStructEnd();
17331
    }
17332
 
17333
    @Override
17334
    public String toString() {
17335
      StringBuilder sb = new StringBuilder("getItemDiscountMap_result(");
17336
      boolean first = true;
17337
 
17338
      sb.append("success:");
17339
      if (this.success == null) {
17340
        sb.append("null");
17341
      } else {
17342
        sb.append(this.success);
17343
      }
17344
      first = false;
17345
      if (!first) sb.append(", ");
17346
      sb.append("pex:");
17347
      if (this.pex == null) {
17348
        sb.append("null");
17349
      } else {
17350
        sb.append(this.pex);
17351
      }
17352
      first = false;
17353
      sb.append(")");
17354
      return sb.toString();
17355
    }
17356
 
17357
    public void validate() throws org.apache.thrift.TException {
17358
      // check for required fields
17359
    }
17360
 
17361
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17362
      try {
17363
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17364
      } catch (org.apache.thrift.TException te) {
17365
        throw new java.io.IOException(te);
17366
      }
17367
    }
17368
 
17369
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
17370
      try {
17371
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
17372
      } catch (org.apache.thrift.TException te) {
17373
        throw new java.io.IOException(te);
17374
      }
17375
    }
17376
 
17377
  }
17378
 
4494 varun.gupt 17379
  public static class getDiscountsForEntity_args implements org.apache.thrift.TBase<getDiscountsForEntity_args, getDiscountsForEntity_args._Fields>, java.io.Serializable, Cloneable   {
17380
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_args");
17381
 
17382
    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);
17383
 
17384
    private long entityId; // required
17385
 
17386
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
17387
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
17388
      ENTITY_ID((short)1, "entityId");
17389
 
17390
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
17391
 
17392
      static {
17393
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
17394
          byName.put(field.getFieldName(), field);
17395
        }
17396
      }
17397
 
17398
      /**
17399
       * Find the _Fields constant that matches fieldId, or null if its not found.
17400
       */
17401
      public static _Fields findByThriftId(int fieldId) {
17402
        switch(fieldId) {
17403
          case 1: // ENTITY_ID
17404
            return ENTITY_ID;
17405
          default:
17406
            return null;
17407
        }
17408
      }
17409
 
17410
      /**
17411
       * Find the _Fields constant that matches fieldId, throwing an exception
17412
       * if it is not found.
17413
       */
17414
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17415
        _Fields fields = findByThriftId(fieldId);
17416
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17417
        return fields;
17418
      }
17419
 
17420
      /**
17421
       * Find the _Fields constant that matches name, or null if its not found.
17422
       */
17423
      public static _Fields findByName(String name) {
17424
        return byName.get(name);
17425
      }
17426
 
17427
      private final short _thriftId;
17428
      private final String _fieldName;
17429
 
17430
      _Fields(short thriftId, String fieldName) {
17431
        _thriftId = thriftId;
17432
        _fieldName = fieldName;
17433
      }
17434
 
17435
      public short getThriftFieldId() {
17436
        return _thriftId;
17437
      }
17438
 
17439
      public String getFieldName() {
17440
        return _fieldName;
17441
      }
17442
    }
17443
 
17444
    // isset id assignments
17445
    private static final int __ENTITYID_ISSET_ID = 0;
17446
    private BitSet __isset_bit_vector = new BitSet(1);
17447
 
17448
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
17449
    static {
17450
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
17451
      tmpMap.put(_Fields.ENTITY_ID, new org.apache.thrift.meta_data.FieldMetaData("entityId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17452
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
17453
      metaDataMap = Collections.unmodifiableMap(tmpMap);
17454
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_args.class, metaDataMap);
17455
    }
17456
 
17457
    public getDiscountsForEntity_args() {
17458
    }
17459
 
17460
    public getDiscountsForEntity_args(
17461
      long entityId)
17462
    {
17463
      this();
17464
      this.entityId = entityId;
17465
      setEntityIdIsSet(true);
17466
    }
17467
 
17468
    /**
17469
     * Performs a deep copy on <i>other</i>.
17470
     */
17471
    public getDiscountsForEntity_args(getDiscountsForEntity_args other) {
17472
      __isset_bit_vector.clear();
17473
      __isset_bit_vector.or(other.__isset_bit_vector);
17474
      this.entityId = other.entityId;
17475
    }
17476
 
17477
    public getDiscountsForEntity_args deepCopy() {
17478
      return new getDiscountsForEntity_args(this);
17479
    }
17480
 
17481
    @Override
17482
    public void clear() {
17483
      setEntityIdIsSet(false);
17484
      this.entityId = 0;
17485
    }
17486
 
17487
    public long getEntityId() {
17488
      return this.entityId;
17489
    }
17490
 
17491
    public void setEntityId(long entityId) {
17492
      this.entityId = entityId;
17493
      setEntityIdIsSet(true);
17494
    }
17495
 
17496
    public void unsetEntityId() {
17497
      __isset_bit_vector.clear(__ENTITYID_ISSET_ID);
17498
    }
17499
 
17500
    /** Returns true if field entityId is set (has been assigned a value) and false otherwise */
17501
    public boolean isSetEntityId() {
17502
      return __isset_bit_vector.get(__ENTITYID_ISSET_ID);
17503
    }
17504
 
17505
    public void setEntityIdIsSet(boolean value) {
17506
      __isset_bit_vector.set(__ENTITYID_ISSET_ID, value);
17507
    }
17508
 
17509
    public void setFieldValue(_Fields field, Object value) {
17510
      switch (field) {
17511
      case ENTITY_ID:
17512
        if (value == null) {
17513
          unsetEntityId();
17514
        } else {
17515
          setEntityId((Long)value);
17516
        }
17517
        break;
17518
 
17519
      }
17520
    }
17521
 
17522
    public Object getFieldValue(_Fields field) {
17523
      switch (field) {
17524
      case ENTITY_ID:
17525
        return Long.valueOf(getEntityId());
17526
 
17527
      }
17528
      throw new IllegalStateException();
17529
    }
17530
 
17531
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
17532
    public boolean isSet(_Fields field) {
17533
      if (field == null) {
17534
        throw new IllegalArgumentException();
17535
      }
17536
 
17537
      switch (field) {
17538
      case ENTITY_ID:
17539
        return isSetEntityId();
17540
      }
17541
      throw new IllegalStateException();
17542
    }
17543
 
17544
    @Override
17545
    public boolean equals(Object that) {
17546
      if (that == null)
17547
        return false;
17548
      if (that instanceof getDiscountsForEntity_args)
17549
        return this.equals((getDiscountsForEntity_args)that);
17550
      return false;
17551
    }
17552
 
17553
    public boolean equals(getDiscountsForEntity_args that) {
17554
      if (that == null)
17555
        return false;
17556
 
17557
      boolean this_present_entityId = true;
17558
      boolean that_present_entityId = true;
17559
      if (this_present_entityId || that_present_entityId) {
17560
        if (!(this_present_entityId && that_present_entityId))
17561
          return false;
17562
        if (this.entityId != that.entityId)
17563
          return false;
17564
      }
17565
 
17566
      return true;
17567
    }
17568
 
17569
    @Override
17570
    public int hashCode() {
17571
      return 0;
17572
    }
17573
 
17574
    public int compareTo(getDiscountsForEntity_args other) {
17575
      if (!getClass().equals(other.getClass())) {
17576
        return getClass().getName().compareTo(other.getClass().getName());
17577
      }
17578
 
17579
      int lastComparison = 0;
17580
      getDiscountsForEntity_args typedOther = (getDiscountsForEntity_args)other;
17581
 
17582
      lastComparison = Boolean.valueOf(isSetEntityId()).compareTo(typedOther.isSetEntityId());
17583
      if (lastComparison != 0) {
17584
        return lastComparison;
17585
      }
17586
      if (isSetEntityId()) {
17587
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityId, typedOther.entityId);
17588
        if (lastComparison != 0) {
17589
          return lastComparison;
17590
        }
17591
      }
17592
      return 0;
17593
    }
17594
 
17595
    public _Fields fieldForId(int fieldId) {
17596
      return _Fields.findByThriftId(fieldId);
17597
    }
17598
 
17599
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17600
      org.apache.thrift.protocol.TField field;
17601
      iprot.readStructBegin();
17602
      while (true)
17603
      {
17604
        field = iprot.readFieldBegin();
17605
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17606
          break;
17607
        }
17608
        switch (field.id) {
17609
          case 1: // ENTITY_ID
17610
            if (field.type == org.apache.thrift.protocol.TType.I64) {
17611
              this.entityId = iprot.readI64();
17612
              setEntityIdIsSet(true);
17613
            } else { 
17614
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17615
            }
17616
            break;
17617
          default:
17618
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17619
        }
17620
        iprot.readFieldEnd();
17621
      }
17622
      iprot.readStructEnd();
17623
      validate();
17624
    }
17625
 
17626
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17627
      validate();
17628
 
17629
      oprot.writeStructBegin(STRUCT_DESC);
17630
      oprot.writeFieldBegin(ENTITY_ID_FIELD_DESC);
17631
      oprot.writeI64(this.entityId);
17632
      oprot.writeFieldEnd();
17633
      oprot.writeFieldStop();
17634
      oprot.writeStructEnd();
17635
    }
17636
 
17637
    @Override
17638
    public String toString() {
17639
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_args(");
17640
      boolean first = true;
17641
 
17642
      sb.append("entityId:");
17643
      sb.append(this.entityId);
17644
      first = false;
17645
      sb.append(")");
17646
      return sb.toString();
17647
    }
17648
 
17649
    public void validate() throws org.apache.thrift.TException {
17650
      // check for required fields
17651
    }
17652
 
17653
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17654
      try {
17655
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17656
      } catch (org.apache.thrift.TException te) {
17657
        throw new java.io.IOException(te);
17658
      }
17659
    }
17660
 
17661
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
17662
      try {
17663
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
17664
        __isset_bit_vector = new BitSet(1);
17665
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
17666
      } catch (org.apache.thrift.TException te) {
17667
        throw new java.io.IOException(te);
17668
      }
17669
    }
17670
 
17671
  }
17672
 
17673
  public static class getDiscountsForEntity_result implements org.apache.thrift.TBase<getDiscountsForEntity_result, getDiscountsForEntity_result._Fields>, java.io.Serializable, Cloneable   {
17674
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_result");
17675
 
17676
    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);
17677
 
17678
    private Map<String,Double> success; // required
17679
 
17680
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
17681
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
17682
      SUCCESS((short)0, "success");
17683
 
17684
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
17685
 
17686
      static {
17687
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
17688
          byName.put(field.getFieldName(), field);
17689
        }
17690
      }
17691
 
17692
      /**
17693
       * Find the _Fields constant that matches fieldId, or null if its not found.
17694
       */
17695
      public static _Fields findByThriftId(int fieldId) {
17696
        switch(fieldId) {
17697
          case 0: // SUCCESS
17698
            return SUCCESS;
17699
          default:
17700
            return null;
17701
        }
17702
      }
17703
 
17704
      /**
17705
       * Find the _Fields constant that matches fieldId, throwing an exception
17706
       * if it is not found.
17707
       */
17708
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17709
        _Fields fields = findByThriftId(fieldId);
17710
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17711
        return fields;
17712
      }
17713
 
17714
      /**
17715
       * Find the _Fields constant that matches name, or null if its not found.
17716
       */
17717
      public static _Fields findByName(String name) {
17718
        return byName.get(name);
17719
      }
17720
 
17721
      private final short _thriftId;
17722
      private final String _fieldName;
17723
 
17724
      _Fields(short thriftId, String fieldName) {
17725
        _thriftId = thriftId;
17726
        _fieldName = fieldName;
17727
      }
17728
 
17729
      public short getThriftFieldId() {
17730
        return _thriftId;
17731
      }
17732
 
17733
      public String getFieldName() {
17734
        return _fieldName;
17735
      }
17736
    }
17737
 
17738
    // isset id assignments
17739
 
17740
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
17741
    static {
17742
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
17743
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17744
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
17745
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
17746
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
17747
      metaDataMap = Collections.unmodifiableMap(tmpMap);
17748
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_result.class, metaDataMap);
17749
    }
17750
 
17751
    public getDiscountsForEntity_result() {
17752
    }
17753
 
17754
    public getDiscountsForEntity_result(
17755
      Map<String,Double> success)
17756
    {
17757
      this();
17758
      this.success = success;
17759
    }
17760
 
17761
    /**
17762
     * Performs a deep copy on <i>other</i>.
17763
     */
17764
    public getDiscountsForEntity_result(getDiscountsForEntity_result other) {
17765
      if (other.isSetSuccess()) {
17766
        Map<String,Double> __this__success = new HashMap<String,Double>();
17767
        for (Map.Entry<String, Double> other_element : other.success.entrySet()) {
17768
 
17769
          String other_element_key = other_element.getKey();
17770
          Double other_element_value = other_element.getValue();
17771
 
17772
          String __this__success_copy_key = other_element_key;
17773
 
17774
          Double __this__success_copy_value = other_element_value;
17775
 
17776
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
17777
        }
17778
        this.success = __this__success;
17779
      }
17780
    }
17781
 
17782
    public getDiscountsForEntity_result deepCopy() {
17783
      return new getDiscountsForEntity_result(this);
17784
    }
17785
 
17786
    @Override
17787
    public void clear() {
17788
      this.success = null;
17789
    }
17790
 
17791
    public int getSuccessSize() {
17792
      return (this.success == null) ? 0 : this.success.size();
17793
    }
17794
 
17795
    public void putToSuccess(String key, double val) {
17796
      if (this.success == null) {
17797
        this.success = new HashMap<String,Double>();
17798
      }
17799
      this.success.put(key, val);
17800
    }
17801
 
17802
    public Map<String,Double> getSuccess() {
17803
      return this.success;
17804
    }
17805
 
17806
    public void setSuccess(Map<String,Double> success) {
17807
      this.success = success;
17808
    }
17809
 
17810
    public void unsetSuccess() {
17811
      this.success = null;
17812
    }
17813
 
17814
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
17815
    public boolean isSetSuccess() {
17816
      return this.success != null;
17817
    }
17818
 
17819
    public void setSuccessIsSet(boolean value) {
17820
      if (!value) {
17821
        this.success = null;
17822
      }
17823
    }
17824
 
17825
    public void setFieldValue(_Fields field, Object value) {
17826
      switch (field) {
17827
      case SUCCESS:
17828
        if (value == null) {
17829
          unsetSuccess();
17830
        } else {
17831
          setSuccess((Map<String,Double>)value);
17832
        }
17833
        break;
17834
 
17835
      }
17836
    }
17837
 
17838
    public Object getFieldValue(_Fields field) {
17839
      switch (field) {
17840
      case SUCCESS:
17841
        return getSuccess();
17842
 
17843
      }
17844
      throw new IllegalStateException();
17845
    }
17846
 
17847
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
17848
    public boolean isSet(_Fields field) {
17849
      if (field == null) {
17850
        throw new IllegalArgumentException();
17851
      }
17852
 
17853
      switch (field) {
17854
      case SUCCESS:
17855
        return isSetSuccess();
17856
      }
17857
      throw new IllegalStateException();
17858
    }
17859
 
17860
    @Override
17861
    public boolean equals(Object that) {
17862
      if (that == null)
17863
        return false;
17864
      if (that instanceof getDiscountsForEntity_result)
17865
        return this.equals((getDiscountsForEntity_result)that);
17866
      return false;
17867
    }
17868
 
17869
    public boolean equals(getDiscountsForEntity_result that) {
17870
      if (that == null)
17871
        return false;
17872
 
17873
      boolean this_present_success = true && this.isSetSuccess();
17874
      boolean that_present_success = true && that.isSetSuccess();
17875
      if (this_present_success || that_present_success) {
17876
        if (!(this_present_success && that_present_success))
17877
          return false;
17878
        if (!this.success.equals(that.success))
17879
          return false;
17880
      }
17881
 
17882
      return true;
17883
    }
17884
 
17885
    @Override
17886
    public int hashCode() {
17887
      return 0;
17888
    }
17889
 
17890
    public int compareTo(getDiscountsForEntity_result other) {
17891
      if (!getClass().equals(other.getClass())) {
17892
        return getClass().getName().compareTo(other.getClass().getName());
17893
      }
17894
 
17895
      int lastComparison = 0;
17896
      getDiscountsForEntity_result typedOther = (getDiscountsForEntity_result)other;
17897
 
17898
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
17899
      if (lastComparison != 0) {
17900
        return lastComparison;
17901
      }
17902
      if (isSetSuccess()) {
17903
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
17904
        if (lastComparison != 0) {
17905
          return lastComparison;
17906
        }
17907
      }
17908
      return 0;
17909
    }
17910
 
17911
    public _Fields fieldForId(int fieldId) {
17912
      return _Fields.findByThriftId(fieldId);
17913
    }
17914
 
17915
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17916
      org.apache.thrift.protocol.TField field;
17917
      iprot.readStructBegin();
17918
      while (true)
17919
      {
17920
        field = iprot.readFieldBegin();
17921
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17922
          break;
17923
        }
17924
        switch (field.id) {
17925
          case 0: // SUCCESS
17926
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
17927
              {
11592 amit.gupta 17928
                org.apache.thrift.protocol.TMap _map50 = iprot.readMapBegin();
17929
                this.success = new HashMap<String,Double>(2*_map50.size);
17930
                for (int _i51 = 0; _i51 < _map50.size; ++_i51)
4494 varun.gupt 17931
                {
11592 amit.gupta 17932
                  String _key52; // required
17933
                  double _val53; // required
17934
                  _key52 = iprot.readString();
17935
                  _val53 = iprot.readDouble();
17936
                  this.success.put(_key52, _val53);
4494 varun.gupt 17937
                }
17938
                iprot.readMapEnd();
17939
              }
17940
            } else { 
17941
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17942
            }
17943
            break;
17944
          default:
17945
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17946
        }
17947
        iprot.readFieldEnd();
17948
      }
17949
      iprot.readStructEnd();
17950
      validate();
17951
    }
17952
 
17953
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17954
      oprot.writeStructBegin(STRUCT_DESC);
17955
 
17956
      if (this.isSetSuccess()) {
17957
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
17958
        {
17959
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, this.success.size()));
11592 amit.gupta 17960
          for (Map.Entry<String, Double> _iter54 : this.success.entrySet())
4494 varun.gupt 17961
          {
11592 amit.gupta 17962
            oprot.writeString(_iter54.getKey());
17963
            oprot.writeDouble(_iter54.getValue());
4494 varun.gupt 17964
          }
17965
          oprot.writeMapEnd();
17966
        }
17967
        oprot.writeFieldEnd();
17968
      }
17969
      oprot.writeFieldStop();
17970
      oprot.writeStructEnd();
17971
    }
17972
 
17973
    @Override
17974
    public String toString() {
17975
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_result(");
17976
      boolean first = true;
17977
 
17978
      sb.append("success:");
17979
      if (this.success == null) {
17980
        sb.append("null");
17981
      } else {
17982
        sb.append(this.success);
17983
      }
17984
      first = false;
17985
      sb.append(")");
17986
      return sb.toString();
17987
    }
17988
 
17989
    public void validate() throws org.apache.thrift.TException {
17990
      // check for required fields
17991
    }
17992
 
17993
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17994
      try {
17995
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17996
      } catch (org.apache.thrift.TException te) {
17997
        throw new java.io.IOException(te);
17998
      }
17999
    }
18000
 
18001
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
18002
      try {
18003
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
18004
      } catch (org.apache.thrift.TException te) {
18005
        throw new java.io.IOException(te);
18006
      }
18007
    }
18008
 
18009
  }
18010
 
5469 rajveer 18011
  public static class addVoucher_args implements org.apache.thrift.TBase<addVoucher_args, addVoucher_args._Fields>, java.io.Serializable, Cloneable   {
18012
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_args");
18013
 
18014
    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);
18015
 
18016
    private Voucher voucher; // required
18017
 
18018
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
18019
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
18020
      VOUCHER((short)1, "voucher");
18021
 
18022
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
18023
 
18024
      static {
18025
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
18026
          byName.put(field.getFieldName(), field);
18027
        }
18028
      }
18029
 
18030
      /**
18031
       * Find the _Fields constant that matches fieldId, or null if its not found.
18032
       */
18033
      public static _Fields findByThriftId(int fieldId) {
18034
        switch(fieldId) {
18035
          case 1: // VOUCHER
18036
            return VOUCHER;
18037
          default:
18038
            return null;
18039
        }
18040
      }
18041
 
18042
      /**
18043
       * Find the _Fields constant that matches fieldId, throwing an exception
18044
       * if it is not found.
18045
       */
18046
      public static _Fields findByThriftIdOrThrow(int fieldId) {
18047
        _Fields fields = findByThriftId(fieldId);
18048
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
18049
        return fields;
18050
      }
18051
 
18052
      /**
18053
       * Find the _Fields constant that matches name, or null if its not found.
18054
       */
18055
      public static _Fields findByName(String name) {
18056
        return byName.get(name);
18057
      }
18058
 
18059
      private final short _thriftId;
18060
      private final String _fieldName;
18061
 
18062
      _Fields(short thriftId, String fieldName) {
18063
        _thriftId = thriftId;
18064
        _fieldName = fieldName;
18065
      }
18066
 
18067
      public short getThriftFieldId() {
18068
        return _thriftId;
18069
      }
18070
 
18071
      public String getFieldName() {
18072
        return _fieldName;
18073
      }
18074
    }
18075
 
18076
    // isset id assignments
18077
 
18078
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
18079
    static {
18080
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
18081
      tmpMap.put(_Fields.VOUCHER, new org.apache.thrift.meta_data.FieldMetaData("voucher", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18082
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
18083
      metaDataMap = Collections.unmodifiableMap(tmpMap);
18084
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_args.class, metaDataMap);
18085
    }
18086
 
18087
    public addVoucher_args() {
18088
    }
18089
 
18090
    public addVoucher_args(
18091
      Voucher voucher)
18092
    {
18093
      this();
18094
      this.voucher = voucher;
18095
    }
18096
 
18097
    /**
18098
     * Performs a deep copy on <i>other</i>.
18099
     */
18100
    public addVoucher_args(addVoucher_args other) {
18101
      if (other.isSetVoucher()) {
18102
        this.voucher = new Voucher(other.voucher);
18103
      }
18104
    }
18105
 
18106
    public addVoucher_args deepCopy() {
18107
      return new addVoucher_args(this);
18108
    }
18109
 
18110
    @Override
18111
    public void clear() {
18112
      this.voucher = null;
18113
    }
18114
 
18115
    public Voucher getVoucher() {
18116
      return this.voucher;
18117
    }
18118
 
18119
    public void setVoucher(Voucher voucher) {
18120
      this.voucher = voucher;
18121
    }
18122
 
18123
    public void unsetVoucher() {
18124
      this.voucher = null;
18125
    }
18126
 
18127
    /** Returns true if field voucher is set (has been assigned a value) and false otherwise */
18128
    public boolean isSetVoucher() {
18129
      return this.voucher != null;
18130
    }
18131
 
18132
    public void setVoucherIsSet(boolean value) {
18133
      if (!value) {
18134
        this.voucher = null;
18135
      }
18136
    }
18137
 
18138
    public void setFieldValue(_Fields field, Object value) {
18139
      switch (field) {
18140
      case VOUCHER:
18141
        if (value == null) {
18142
          unsetVoucher();
18143
        } else {
18144
          setVoucher((Voucher)value);
18145
        }
18146
        break;
18147
 
18148
      }
18149
    }
18150
 
18151
    public Object getFieldValue(_Fields field) {
18152
      switch (field) {
18153
      case VOUCHER:
18154
        return getVoucher();
18155
 
18156
      }
18157
      throw new IllegalStateException();
18158
    }
18159
 
18160
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
18161
    public boolean isSet(_Fields field) {
18162
      if (field == null) {
18163
        throw new IllegalArgumentException();
18164
      }
18165
 
18166
      switch (field) {
18167
      case VOUCHER:
18168
        return isSetVoucher();
18169
      }
18170
      throw new IllegalStateException();
18171
    }
18172
 
18173
    @Override
18174
    public boolean equals(Object that) {
18175
      if (that == null)
18176
        return false;
18177
      if (that instanceof addVoucher_args)
18178
        return this.equals((addVoucher_args)that);
18179
      return false;
18180
    }
18181
 
18182
    public boolean equals(addVoucher_args that) {
18183
      if (that == null)
18184
        return false;
18185
 
18186
      boolean this_present_voucher = true && this.isSetVoucher();
18187
      boolean that_present_voucher = true && that.isSetVoucher();
18188
      if (this_present_voucher || that_present_voucher) {
18189
        if (!(this_present_voucher && that_present_voucher))
18190
          return false;
18191
        if (!this.voucher.equals(that.voucher))
18192
          return false;
18193
      }
18194
 
18195
      return true;
18196
    }
18197
 
18198
    @Override
18199
    public int hashCode() {
18200
      return 0;
18201
    }
18202
 
18203
    public int compareTo(addVoucher_args other) {
18204
      if (!getClass().equals(other.getClass())) {
18205
        return getClass().getName().compareTo(other.getClass().getName());
18206
      }
18207
 
18208
      int lastComparison = 0;
18209
      addVoucher_args typedOther = (addVoucher_args)other;
18210
 
18211
      lastComparison = Boolean.valueOf(isSetVoucher()).compareTo(typedOther.isSetVoucher());
18212
      if (lastComparison != 0) {
18213
        return lastComparison;
18214
      }
18215
      if (isSetVoucher()) {
18216
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucher, typedOther.voucher);
18217
        if (lastComparison != 0) {
18218
          return lastComparison;
18219
        }
18220
      }
18221
      return 0;
18222
    }
18223
 
18224
    public _Fields fieldForId(int fieldId) {
18225
      return _Fields.findByThriftId(fieldId);
18226
    }
18227
 
18228
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
18229
      org.apache.thrift.protocol.TField field;
18230
      iprot.readStructBegin();
18231
      while (true)
18232
      {
18233
        field = iprot.readFieldBegin();
18234
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
18235
          break;
18236
        }
18237
        switch (field.id) {
18238
          case 1: // VOUCHER
18239
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
18240
              this.voucher = new Voucher();
18241
              this.voucher.read(iprot);
18242
            } else { 
18243
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18244
            }
18245
            break;
18246
          default:
18247
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18248
        }
18249
        iprot.readFieldEnd();
18250
      }
18251
      iprot.readStructEnd();
18252
      validate();
18253
    }
18254
 
18255
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
18256
      validate();
18257
 
18258
      oprot.writeStructBegin(STRUCT_DESC);
18259
      if (this.voucher != null) {
18260
        oprot.writeFieldBegin(VOUCHER_FIELD_DESC);
18261
        this.voucher.write(oprot);
18262
        oprot.writeFieldEnd();
18263
      }
18264
      oprot.writeFieldStop();
18265
      oprot.writeStructEnd();
18266
    }
18267
 
18268
    @Override
18269
    public String toString() {
18270
      StringBuilder sb = new StringBuilder("addVoucher_args(");
18271
      boolean first = true;
18272
 
18273
      sb.append("voucher:");
18274
      if (this.voucher == null) {
18275
        sb.append("null");
18276
      } else {
18277
        sb.append(this.voucher);
18278
      }
18279
      first = false;
18280
      sb.append(")");
18281
      return sb.toString();
18282
    }
18283
 
18284
    public void validate() throws org.apache.thrift.TException {
18285
      // check for required fields
18286
    }
18287
 
18288
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
18289
      try {
18290
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
18291
      } catch (org.apache.thrift.TException te) {
18292
        throw new java.io.IOException(te);
18293
      }
18294
    }
18295
 
18296
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
18297
      try {
18298
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
18299
      } catch (org.apache.thrift.TException te) {
18300
        throw new java.io.IOException(te);
18301
      }
18302
    }
18303
 
18304
  }
18305
 
18306
  public static class addVoucher_result implements org.apache.thrift.TBase<addVoucher_result, addVoucher_result._Fields>, java.io.Serializable, Cloneable   {
18307
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_result");
18308
 
18309
 
18310
 
18311
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
18312
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
18313
;
18314
 
18315
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
18316
 
18317
      static {
18318
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
18319
          byName.put(field.getFieldName(), field);
18320
        }
18321
      }
18322
 
18323
      /**
18324
       * Find the _Fields constant that matches fieldId, or null if its not found.
18325
       */
18326
      public static _Fields findByThriftId(int fieldId) {
18327
        switch(fieldId) {
18328
          default:
18329
            return null;
18330
        }
18331
      }
18332
 
18333
      /**
18334
       * Find the _Fields constant that matches fieldId, throwing an exception
18335
       * if it is not found.
18336
       */
18337
      public static _Fields findByThriftIdOrThrow(int fieldId) {
18338
        _Fields fields = findByThriftId(fieldId);
18339
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
18340
        return fields;
18341
      }
18342
 
18343
      /**
18344
       * Find the _Fields constant that matches name, or null if its not found.
18345
       */
18346
      public static _Fields findByName(String name) {
18347
        return byName.get(name);
18348
      }
18349
 
18350
      private final short _thriftId;
18351
      private final String _fieldName;
18352
 
18353
      _Fields(short thriftId, String fieldName) {
18354
        _thriftId = thriftId;
18355
        _fieldName = fieldName;
18356
      }
18357
 
18358
      public short getThriftFieldId() {
18359
        return _thriftId;
18360
      }
18361
 
18362
      public String getFieldName() {
18363
        return _fieldName;
18364
      }
18365
    }
18366
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
18367
    static {
18368
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
18369
      metaDataMap = Collections.unmodifiableMap(tmpMap);
18370
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_result.class, metaDataMap);
18371
    }
18372
 
18373
    public addVoucher_result() {
18374
    }
18375
 
18376
    /**
18377
     * Performs a deep copy on <i>other</i>.
18378
     */
18379
    public addVoucher_result(addVoucher_result other) {
18380
    }
18381
 
18382
    public addVoucher_result deepCopy() {
18383
      return new addVoucher_result(this);
18384
    }
18385
 
18386
    @Override
18387
    public void clear() {
18388
    }
18389
 
18390
    public void setFieldValue(_Fields field, Object value) {
18391
      switch (field) {
18392
      }
18393
    }
18394
 
18395
    public Object getFieldValue(_Fields field) {
18396
      switch (field) {
18397
      }
18398
      throw new IllegalStateException();
18399
    }
18400
 
18401
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
18402
    public boolean isSet(_Fields field) {
18403
      if (field == null) {
18404
        throw new IllegalArgumentException();
18405
      }
18406
 
18407
      switch (field) {
18408
      }
18409
      throw new IllegalStateException();
18410
    }
18411
 
18412
    @Override
18413
    public boolean equals(Object that) {
18414
      if (that == null)
18415
        return false;
18416
      if (that instanceof addVoucher_result)
18417
        return this.equals((addVoucher_result)that);
18418
      return false;
18419
    }
18420
 
18421
    public boolean equals(addVoucher_result that) {
18422
      if (that == null)
18423
        return false;
18424
 
18425
      return true;
18426
    }
18427
 
18428
    @Override
18429
    public int hashCode() {
18430
      return 0;
18431
    }
18432
 
18433
    public int compareTo(addVoucher_result other) {
18434
      if (!getClass().equals(other.getClass())) {
18435
        return getClass().getName().compareTo(other.getClass().getName());
18436
      }
18437
 
18438
      int lastComparison = 0;
18439
      addVoucher_result typedOther = (addVoucher_result)other;
18440
 
18441
      return 0;
18442
    }
18443
 
18444
    public _Fields fieldForId(int fieldId) {
18445
      return _Fields.findByThriftId(fieldId);
18446
    }
18447
 
18448
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
18449
      org.apache.thrift.protocol.TField field;
18450
      iprot.readStructBegin();
18451
      while (true)
18452
      {
18453
        field = iprot.readFieldBegin();
18454
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
18455
          break;
18456
        }
18457
        switch (field.id) {
18458
          default:
18459
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18460
        }
18461
        iprot.readFieldEnd();
18462
      }
18463
      iprot.readStructEnd();
18464
      validate();
18465
    }
18466
 
18467
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
18468
      oprot.writeStructBegin(STRUCT_DESC);
18469
 
18470
      oprot.writeFieldStop();
18471
      oprot.writeStructEnd();
18472
    }
18473
 
18474
    @Override
18475
    public String toString() {
18476
      StringBuilder sb = new StringBuilder("addVoucher_result(");
18477
      boolean first = true;
18478
 
18479
      sb.append(")");
18480
      return sb.toString();
18481
    }
18482
 
18483
    public void validate() throws org.apache.thrift.TException {
18484
      // check for required fields
18485
    }
18486
 
18487
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
18488
      try {
18489
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
18490
      } catch (org.apache.thrift.TException te) {
18491
        throw new java.io.IOException(te);
18492
      }
18493
    }
18494
 
18495
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
18496
      try {
18497
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
18498
      } catch (org.apache.thrift.TException te) {
18499
        throw new java.io.IOException(te);
18500
      }
18501
    }
18502
 
18503
  }
18504
 
18505
  public static class assignVoucher_args implements org.apache.thrift.TBase<assignVoucher_args, assignVoucher_args._Fields>, java.io.Serializable, Cloneable   {
18506
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_args");
18507
 
18508
    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);
18509
    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);
18510
    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);
18511
    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);
18512
 
18513
    private long userId; // required
18514
    private String userEmail; // required
18515
    private VoucherType voucherType; // required
18516
    private long amount; // required
18517
 
18518
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
18519
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
18520
      USER_ID((short)1, "userId"),
18521
      USER_EMAIL((short)2, "userEmail"),
18522
      /**
18523
       * 
18524
       * @see VoucherType
18525
       */
18526
      VOUCHER_TYPE((short)3, "voucherType"),
18527
      AMOUNT((short)4, "amount");
18528
 
18529
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
18530
 
18531
      static {
18532
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
18533
          byName.put(field.getFieldName(), field);
18534
        }
18535
      }
18536
 
18537
      /**
18538
       * Find the _Fields constant that matches fieldId, or null if its not found.
18539
       */
18540
      public static _Fields findByThriftId(int fieldId) {
18541
        switch(fieldId) {
18542
          case 1: // USER_ID
18543
            return USER_ID;
18544
          case 2: // USER_EMAIL
18545
            return USER_EMAIL;
18546
          case 3: // VOUCHER_TYPE
18547
            return VOUCHER_TYPE;
18548
          case 4: // AMOUNT
18549
            return AMOUNT;
18550
          default:
18551
            return null;
18552
        }
18553
      }
18554
 
18555
      /**
18556
       * Find the _Fields constant that matches fieldId, throwing an exception
18557
       * if it is not found.
18558
       */
18559
      public static _Fields findByThriftIdOrThrow(int fieldId) {
18560
        _Fields fields = findByThriftId(fieldId);
18561
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
18562
        return fields;
18563
      }
18564
 
18565
      /**
18566
       * Find the _Fields constant that matches name, or null if its not found.
18567
       */
18568
      public static _Fields findByName(String name) {
18569
        return byName.get(name);
18570
      }
18571
 
18572
      private final short _thriftId;
18573
      private final String _fieldName;
18574
 
18575
      _Fields(short thriftId, String fieldName) {
18576
        _thriftId = thriftId;
18577
        _fieldName = fieldName;
18578
      }
18579
 
18580
      public short getThriftFieldId() {
18581
        return _thriftId;
18582
      }
18583
 
18584
      public String getFieldName() {
18585
        return _fieldName;
18586
      }
18587
    }
18588
 
18589
    // isset id assignments
18590
    private static final int __USERID_ISSET_ID = 0;
18591
    private static final int __AMOUNT_ISSET_ID = 1;
18592
    private BitSet __isset_bit_vector = new BitSet(2);
18593
 
18594
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
18595
    static {
18596
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
18597
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18598
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
18599
      tmpMap.put(_Fields.USER_EMAIL, new org.apache.thrift.meta_data.FieldMetaData("userEmail", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18600
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
18601
      tmpMap.put(_Fields.VOUCHER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("voucherType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18602
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, VoucherType.class)));
18603
      tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18604
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
18605
      metaDataMap = Collections.unmodifiableMap(tmpMap);
18606
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_args.class, metaDataMap);
18607
    }
18608
 
18609
    public assignVoucher_args() {
18610
    }
18611
 
18612
    public assignVoucher_args(
18613
      long userId,
18614
      String userEmail,
18615
      VoucherType voucherType,
18616
      long amount)
18617
    {
18618
      this();
18619
      this.userId = userId;
18620
      setUserIdIsSet(true);
18621
      this.userEmail = userEmail;
18622
      this.voucherType = voucherType;
18623
      this.amount = amount;
18624
      setAmountIsSet(true);
18625
    }
18626
 
18627
    /**
18628
     * Performs a deep copy on <i>other</i>.
18629
     */
18630
    public assignVoucher_args(assignVoucher_args other) {
18631
      __isset_bit_vector.clear();
18632
      __isset_bit_vector.or(other.__isset_bit_vector);
18633
      this.userId = other.userId;
18634
      if (other.isSetUserEmail()) {
18635
        this.userEmail = other.userEmail;
18636
      }
18637
      if (other.isSetVoucherType()) {
18638
        this.voucherType = other.voucherType;
18639
      }
18640
      this.amount = other.amount;
18641
    }
18642
 
18643
    public assignVoucher_args deepCopy() {
18644
      return new assignVoucher_args(this);
18645
    }
18646
 
18647
    @Override
18648
    public void clear() {
18649
      setUserIdIsSet(false);
18650
      this.userId = 0;
18651
      this.userEmail = null;
18652
      this.voucherType = null;
18653
      setAmountIsSet(false);
18654
      this.amount = 0;
18655
    }
18656
 
18657
    public long getUserId() {
18658
      return this.userId;
18659
    }
18660
 
18661
    public void setUserId(long userId) {
18662
      this.userId = userId;
18663
      setUserIdIsSet(true);
18664
    }
18665
 
18666
    public void unsetUserId() {
18667
      __isset_bit_vector.clear(__USERID_ISSET_ID);
18668
    }
18669
 
18670
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
18671
    public boolean isSetUserId() {
18672
      return __isset_bit_vector.get(__USERID_ISSET_ID);
18673
    }
18674
 
18675
    public void setUserIdIsSet(boolean value) {
18676
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
18677
    }
18678
 
18679
    public String getUserEmail() {
18680
      return this.userEmail;
18681
    }
18682
 
18683
    public void setUserEmail(String userEmail) {
18684
      this.userEmail = userEmail;
18685
    }
18686
 
18687
    public void unsetUserEmail() {
18688
      this.userEmail = null;
18689
    }
18690
 
18691
    /** Returns true if field userEmail is set (has been assigned a value) and false otherwise */
18692
    public boolean isSetUserEmail() {
18693
      return this.userEmail != null;
18694
    }
18695
 
18696
    public void setUserEmailIsSet(boolean value) {
18697
      if (!value) {
18698
        this.userEmail = null;
18699
      }
18700
    }
18701
 
18702
    /**
18703
     * 
18704
     * @see VoucherType
18705
     */
18706
    public VoucherType getVoucherType() {
18707
      return this.voucherType;
18708
    }
18709
 
18710
    /**
18711
     * 
18712
     * @see VoucherType
18713
     */
18714
    public void setVoucherType(VoucherType voucherType) {
18715
      this.voucherType = voucherType;
18716
    }
18717
 
18718
    public void unsetVoucherType() {
18719
      this.voucherType = null;
18720
    }
18721
 
18722
    /** Returns true if field voucherType is set (has been assigned a value) and false otherwise */
18723
    public boolean isSetVoucherType() {
18724
      return this.voucherType != null;
18725
    }
18726
 
18727
    public void setVoucherTypeIsSet(boolean value) {
18728
      if (!value) {
18729
        this.voucherType = null;
18730
      }
18731
    }
18732
 
18733
    public long getAmount() {
18734
      return this.amount;
18735
    }
18736
 
18737
    public void setAmount(long amount) {
18738
      this.amount = amount;
18739
      setAmountIsSet(true);
18740
    }
18741
 
18742
    public void unsetAmount() {
18743
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
18744
    }
18745
 
18746
    /** Returns true if field amount is set (has been assigned a value) and false otherwise */
18747
    public boolean isSetAmount() {
18748
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
18749
    }
18750
 
18751
    public void setAmountIsSet(boolean value) {
18752
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
18753
    }
18754
 
18755
    public void setFieldValue(_Fields field, Object value) {
18756
      switch (field) {
18757
      case USER_ID:
18758
        if (value == null) {
18759
          unsetUserId();
18760
        } else {
18761
          setUserId((Long)value);
18762
        }
18763
        break;
18764
 
18765
      case USER_EMAIL:
18766
        if (value == null) {
18767
          unsetUserEmail();
18768
        } else {
18769
          setUserEmail((String)value);
18770
        }
18771
        break;
18772
 
18773
      case VOUCHER_TYPE:
18774
        if (value == null) {
18775
          unsetVoucherType();
18776
        } else {
18777
          setVoucherType((VoucherType)value);
18778
        }
18779
        break;
18780
 
18781
      case AMOUNT:
18782
        if (value == null) {
18783
          unsetAmount();
18784
        } else {
18785
          setAmount((Long)value);
18786
        }
18787
        break;
18788
 
18789
      }
18790
    }
18791
 
18792
    public Object getFieldValue(_Fields field) {
18793
      switch (field) {
18794
      case USER_ID:
18795
        return Long.valueOf(getUserId());
18796
 
18797
      case USER_EMAIL:
18798
        return getUserEmail();
18799
 
18800
      case VOUCHER_TYPE:
18801
        return getVoucherType();
18802
 
18803
      case AMOUNT:
18804
        return Long.valueOf(getAmount());
18805
 
18806
      }
18807
      throw new IllegalStateException();
18808
    }
18809
 
18810
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
18811
    public boolean isSet(_Fields field) {
18812
      if (field == null) {
18813
        throw new IllegalArgumentException();
18814
      }
18815
 
18816
      switch (field) {
18817
      case USER_ID:
18818
        return isSetUserId();
18819
      case USER_EMAIL:
18820
        return isSetUserEmail();
18821
      case VOUCHER_TYPE:
18822
        return isSetVoucherType();
18823
      case AMOUNT:
18824
        return isSetAmount();
18825
      }
18826
      throw new IllegalStateException();
18827
    }
18828
 
18829
    @Override
18830
    public boolean equals(Object that) {
18831
      if (that == null)
18832
        return false;
18833
      if (that instanceof assignVoucher_args)
18834
        return this.equals((assignVoucher_args)that);
18835
      return false;
18836
    }
18837
 
18838
    public boolean equals(assignVoucher_args that) {
18839
      if (that == null)
18840
        return false;
18841
 
18842
      boolean this_present_userId = true;
18843
      boolean that_present_userId = true;
18844
      if (this_present_userId || that_present_userId) {
18845
        if (!(this_present_userId && that_present_userId))
18846
          return false;
18847
        if (this.userId != that.userId)
18848
          return false;
18849
      }
18850
 
18851
      boolean this_present_userEmail = true && this.isSetUserEmail();
18852
      boolean that_present_userEmail = true && that.isSetUserEmail();
18853
      if (this_present_userEmail || that_present_userEmail) {
18854
        if (!(this_present_userEmail && that_present_userEmail))
18855
          return false;
18856
        if (!this.userEmail.equals(that.userEmail))
18857
          return false;
18858
      }
18859
 
18860
      boolean this_present_voucherType = true && this.isSetVoucherType();
18861
      boolean that_present_voucherType = true && that.isSetVoucherType();
18862
      if (this_present_voucherType || that_present_voucherType) {
18863
        if (!(this_present_voucherType && that_present_voucherType))
18864
          return false;
18865
        if (!this.voucherType.equals(that.voucherType))
18866
          return false;
18867
      }
18868
 
18869
      boolean this_present_amount = true;
18870
      boolean that_present_amount = true;
18871
      if (this_present_amount || that_present_amount) {
18872
        if (!(this_present_amount && that_present_amount))
18873
          return false;
18874
        if (this.amount != that.amount)
18875
          return false;
18876
      }
18877
 
18878
      return true;
18879
    }
18880
 
18881
    @Override
18882
    public int hashCode() {
18883
      return 0;
18884
    }
18885
 
18886
    public int compareTo(assignVoucher_args other) {
18887
      if (!getClass().equals(other.getClass())) {
18888
        return getClass().getName().compareTo(other.getClass().getName());
18889
      }
18890
 
18891
      int lastComparison = 0;
18892
      assignVoucher_args typedOther = (assignVoucher_args)other;
18893
 
18894
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
18895
      if (lastComparison != 0) {
18896
        return lastComparison;
18897
      }
18898
      if (isSetUserId()) {
18899
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
18900
        if (lastComparison != 0) {
18901
          return lastComparison;
18902
        }
18903
      }
18904
      lastComparison = Boolean.valueOf(isSetUserEmail()).compareTo(typedOther.isSetUserEmail());
18905
      if (lastComparison != 0) {
18906
        return lastComparison;
18907
      }
18908
      if (isSetUserEmail()) {
18909
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userEmail, typedOther.userEmail);
18910
        if (lastComparison != 0) {
18911
          return lastComparison;
18912
        }
18913
      }
18914
      lastComparison = Boolean.valueOf(isSetVoucherType()).compareTo(typedOther.isSetVoucherType());
18915
      if (lastComparison != 0) {
18916
        return lastComparison;
18917
      }
18918
      if (isSetVoucherType()) {
18919
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherType, typedOther.voucherType);
18920
        if (lastComparison != 0) {
18921
          return lastComparison;
18922
        }
18923
      }
18924
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
18925
      if (lastComparison != 0) {
18926
        return lastComparison;
18927
      }
18928
      if (isSetAmount()) {
18929
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
18930
        if (lastComparison != 0) {
18931
          return lastComparison;
18932
        }
18933
      }
18934
      return 0;
18935
    }
18936
 
18937
    public _Fields fieldForId(int fieldId) {
18938
      return _Fields.findByThriftId(fieldId);
18939
    }
18940
 
18941
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
18942
      org.apache.thrift.protocol.TField field;
18943
      iprot.readStructBegin();
18944
      while (true)
18945
      {
18946
        field = iprot.readFieldBegin();
18947
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
18948
          break;
18949
        }
18950
        switch (field.id) {
18951
          case 1: // USER_ID
18952
            if (field.type == org.apache.thrift.protocol.TType.I64) {
18953
              this.userId = iprot.readI64();
18954
              setUserIdIsSet(true);
18955
            } else { 
18956
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18957
            }
18958
            break;
18959
          case 2: // USER_EMAIL
18960
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
18961
              this.userEmail = iprot.readString();
18962
            } else { 
18963
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18964
            }
18965
            break;
18966
          case 3: // VOUCHER_TYPE
18967
            if (field.type == org.apache.thrift.protocol.TType.I32) {
18968
              this.voucherType = VoucherType.findByValue(iprot.readI32());
18969
            } else { 
18970
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18971
            }
18972
            break;
18973
          case 4: // AMOUNT
18974
            if (field.type == org.apache.thrift.protocol.TType.I64) {
18975
              this.amount = iprot.readI64();
18976
              setAmountIsSet(true);
18977
            } else { 
18978
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18979
            }
18980
            break;
18981
          default:
18982
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18983
        }
18984
        iprot.readFieldEnd();
18985
      }
18986
      iprot.readStructEnd();
18987
      validate();
18988
    }
18989
 
18990
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
18991
      validate();
18992
 
18993
      oprot.writeStructBegin(STRUCT_DESC);
18994
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
18995
      oprot.writeI64(this.userId);
18996
      oprot.writeFieldEnd();
18997
      if (this.userEmail != null) {
18998
        oprot.writeFieldBegin(USER_EMAIL_FIELD_DESC);
18999
        oprot.writeString(this.userEmail);
19000
        oprot.writeFieldEnd();
19001
      }
19002
      if (this.voucherType != null) {
19003
        oprot.writeFieldBegin(VOUCHER_TYPE_FIELD_DESC);
19004
        oprot.writeI32(this.voucherType.getValue());
19005
        oprot.writeFieldEnd();
19006
      }
19007
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
19008
      oprot.writeI64(this.amount);
19009
      oprot.writeFieldEnd();
19010
      oprot.writeFieldStop();
19011
      oprot.writeStructEnd();
19012
    }
19013
 
19014
    @Override
19015
    public String toString() {
19016
      StringBuilder sb = new StringBuilder("assignVoucher_args(");
19017
      boolean first = true;
19018
 
19019
      sb.append("userId:");
19020
      sb.append(this.userId);
19021
      first = false;
19022
      if (!first) sb.append(", ");
19023
      sb.append("userEmail:");
19024
      if (this.userEmail == null) {
19025
        sb.append("null");
19026
      } else {
19027
        sb.append(this.userEmail);
19028
      }
19029
      first = false;
19030
      if (!first) sb.append(", ");
19031
      sb.append("voucherType:");
19032
      if (this.voucherType == null) {
19033
        sb.append("null");
19034
      } else {
19035
        sb.append(this.voucherType);
19036
      }
19037
      first = false;
19038
      if (!first) sb.append(", ");
19039
      sb.append("amount:");
19040
      sb.append(this.amount);
19041
      first = false;
19042
      sb.append(")");
19043
      return sb.toString();
19044
    }
19045
 
19046
    public void validate() throws org.apache.thrift.TException {
19047
      // check for required fields
19048
    }
19049
 
19050
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
19051
      try {
19052
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
19053
      } catch (org.apache.thrift.TException te) {
19054
        throw new java.io.IOException(te);
19055
      }
19056
    }
19057
 
19058
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
19059
      try {
19060
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
19061
        __isset_bit_vector = new BitSet(1);
19062
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
19063
      } catch (org.apache.thrift.TException te) {
19064
        throw new java.io.IOException(te);
19065
      }
19066
    }
19067
 
19068
  }
19069
 
19070
  public static class assignVoucher_result implements org.apache.thrift.TBase<assignVoucher_result, assignVoucher_result._Fields>, java.io.Serializable, Cloneable   {
19071
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_result");
19072
 
19073
    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);
19074
 
19075
    private Voucher success; // required
19076
 
19077
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
19078
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
19079
      SUCCESS((short)0, "success");
19080
 
19081
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
19082
 
19083
      static {
19084
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
19085
          byName.put(field.getFieldName(), field);
19086
        }
19087
      }
19088
 
19089
      /**
19090
       * Find the _Fields constant that matches fieldId, or null if its not found.
19091
       */
19092
      public static _Fields findByThriftId(int fieldId) {
19093
        switch(fieldId) {
19094
          case 0: // SUCCESS
19095
            return SUCCESS;
19096
          default:
19097
            return null;
19098
        }
19099
      }
19100
 
19101
      /**
19102
       * Find the _Fields constant that matches fieldId, throwing an exception
19103
       * if it is not found.
19104
       */
19105
      public static _Fields findByThriftIdOrThrow(int fieldId) {
19106
        _Fields fields = findByThriftId(fieldId);
19107
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
19108
        return fields;
19109
      }
19110
 
19111
      /**
19112
       * Find the _Fields constant that matches name, or null if its not found.
19113
       */
19114
      public static _Fields findByName(String name) {
19115
        return byName.get(name);
19116
      }
19117
 
19118
      private final short _thriftId;
19119
      private final String _fieldName;
19120
 
19121
      _Fields(short thriftId, String fieldName) {
19122
        _thriftId = thriftId;
19123
        _fieldName = fieldName;
19124
      }
19125
 
19126
      public short getThriftFieldId() {
19127
        return _thriftId;
19128
      }
19129
 
19130
      public String getFieldName() {
19131
        return _fieldName;
19132
      }
19133
    }
19134
 
19135
    // isset id assignments
19136
 
19137
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
19138
    static {
19139
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
19140
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
19141
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
19142
      metaDataMap = Collections.unmodifiableMap(tmpMap);
19143
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_result.class, metaDataMap);
19144
    }
19145
 
19146
    public assignVoucher_result() {
19147
    }
19148
 
19149
    public assignVoucher_result(
19150
      Voucher success)
19151
    {
19152
      this();
19153
      this.success = success;
19154
    }
19155
 
19156
    /**
19157
     * Performs a deep copy on <i>other</i>.
19158
     */
19159
    public assignVoucher_result(assignVoucher_result other) {
19160
      if (other.isSetSuccess()) {
19161
        this.success = new Voucher(other.success);
19162
      }
19163
    }
19164
 
19165
    public assignVoucher_result deepCopy() {
19166
      return new assignVoucher_result(this);
19167
    }
19168
 
19169
    @Override
19170
    public void clear() {
19171
      this.success = null;
19172
    }
19173
 
19174
    public Voucher getSuccess() {
19175
      return this.success;
19176
    }
19177
 
19178
    public void setSuccess(Voucher success) {
19179
      this.success = success;
19180
    }
19181
 
19182
    public void unsetSuccess() {
19183
      this.success = null;
19184
    }
19185
 
19186
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
19187
    public boolean isSetSuccess() {
19188
      return this.success != null;
19189
    }
19190
 
19191
    public void setSuccessIsSet(boolean value) {
19192
      if (!value) {
19193
        this.success = null;
19194
      }
19195
    }
19196
 
19197
    public void setFieldValue(_Fields field, Object value) {
19198
      switch (field) {
19199
      case SUCCESS:
19200
        if (value == null) {
19201
          unsetSuccess();
19202
        } else {
19203
          setSuccess((Voucher)value);
19204
        }
19205
        break;
19206
 
19207
      }
19208
    }
19209
 
19210
    public Object getFieldValue(_Fields field) {
19211
      switch (field) {
19212
      case SUCCESS:
19213
        return getSuccess();
19214
 
19215
      }
19216
      throw new IllegalStateException();
19217
    }
19218
 
19219
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
19220
    public boolean isSet(_Fields field) {
19221
      if (field == null) {
19222
        throw new IllegalArgumentException();
19223
      }
19224
 
19225
      switch (field) {
19226
      case SUCCESS:
19227
        return isSetSuccess();
19228
      }
19229
      throw new IllegalStateException();
19230
    }
19231
 
19232
    @Override
19233
    public boolean equals(Object that) {
19234
      if (that == null)
19235
        return false;
19236
      if (that instanceof assignVoucher_result)
19237
        return this.equals((assignVoucher_result)that);
19238
      return false;
19239
    }
19240
 
19241
    public boolean equals(assignVoucher_result that) {
19242
      if (that == null)
19243
        return false;
19244
 
19245
      boolean this_present_success = true && this.isSetSuccess();
19246
      boolean that_present_success = true && that.isSetSuccess();
19247
      if (this_present_success || that_present_success) {
19248
        if (!(this_present_success && that_present_success))
19249
          return false;
19250
        if (!this.success.equals(that.success))
19251
          return false;
19252
      }
19253
 
19254
      return true;
19255
    }
19256
 
19257
    @Override
19258
    public int hashCode() {
19259
      return 0;
19260
    }
19261
 
19262
    public int compareTo(assignVoucher_result other) {
19263
      if (!getClass().equals(other.getClass())) {
19264
        return getClass().getName().compareTo(other.getClass().getName());
19265
      }
19266
 
19267
      int lastComparison = 0;
19268
      assignVoucher_result typedOther = (assignVoucher_result)other;
19269
 
19270
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
19271
      if (lastComparison != 0) {
19272
        return lastComparison;
19273
      }
19274
      if (isSetSuccess()) {
19275
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
19276
        if (lastComparison != 0) {
19277
          return lastComparison;
19278
        }
19279
      }
19280
      return 0;
19281
    }
19282
 
19283
    public _Fields fieldForId(int fieldId) {
19284
      return _Fields.findByThriftId(fieldId);
19285
    }
19286
 
19287
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
19288
      org.apache.thrift.protocol.TField field;
19289
      iprot.readStructBegin();
19290
      while (true)
19291
      {
19292
        field = iprot.readFieldBegin();
19293
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
19294
          break;
19295
        }
19296
        switch (field.id) {
19297
          case 0: // SUCCESS
19298
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
19299
              this.success = new Voucher();
19300
              this.success.read(iprot);
19301
            } else { 
19302
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19303
            }
19304
            break;
19305
          default:
19306
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19307
        }
19308
        iprot.readFieldEnd();
19309
      }
19310
      iprot.readStructEnd();
19311
      validate();
19312
    }
19313
 
19314
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
19315
      oprot.writeStructBegin(STRUCT_DESC);
19316
 
19317
      if (this.isSetSuccess()) {
19318
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
19319
        this.success.write(oprot);
19320
        oprot.writeFieldEnd();
19321
      }
19322
      oprot.writeFieldStop();
19323
      oprot.writeStructEnd();
19324
    }
19325
 
19326
    @Override
19327
    public String toString() {
19328
      StringBuilder sb = new StringBuilder("assignVoucher_result(");
19329
      boolean first = true;
19330
 
19331
      sb.append("success:");
19332
      if (this.success == null) {
19333
        sb.append("null");
19334
      } else {
19335
        sb.append(this.success);
19336
      }
19337
      first = false;
19338
      sb.append(")");
19339
      return sb.toString();
19340
    }
19341
 
19342
    public void validate() throws org.apache.thrift.TException {
19343
      // check for required fields
19344
    }
19345
 
19346
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
19347
      try {
19348
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
19349
      } catch (org.apache.thrift.TException te) {
19350
        throw new java.io.IOException(te);
19351
      }
19352
    }
19353
 
19354
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
19355
      try {
19356
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
19357
      } catch (org.apache.thrift.TException te) {
19358
        throw new java.io.IOException(te);
19359
      }
19360
    }
19361
 
19362
  }
19363
 
19364
  public static class markVoucherAsRedeemed_args implements org.apache.thrift.TBase<markVoucherAsRedeemed_args, markVoucherAsRedeemed_args._Fields>, java.io.Serializable, Cloneable   {
19365
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_args");
19366
 
19367
    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);
19368
    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);
19369
 
19370
    private String voucherCode; // required
19371
    private long redeemedOn; // required
19372
 
19373
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
19374
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
19375
      VOUCHER_CODE((short)1, "voucherCode"),
19376
      REDEEMED_ON((short)2, "redeemedOn");
19377
 
19378
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
19379
 
19380
      static {
19381
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
19382
          byName.put(field.getFieldName(), field);
19383
        }
19384
      }
19385
 
19386
      /**
19387
       * Find the _Fields constant that matches fieldId, or null if its not found.
19388
       */
19389
      public static _Fields findByThriftId(int fieldId) {
19390
        switch(fieldId) {
19391
          case 1: // VOUCHER_CODE
19392
            return VOUCHER_CODE;
19393
          case 2: // REDEEMED_ON
19394
            return REDEEMED_ON;
19395
          default:
19396
            return null;
19397
        }
19398
      }
19399
 
19400
      /**
19401
       * Find the _Fields constant that matches fieldId, throwing an exception
19402
       * if it is not found.
19403
       */
19404
      public static _Fields findByThriftIdOrThrow(int fieldId) {
19405
        _Fields fields = findByThriftId(fieldId);
19406
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
19407
        return fields;
19408
      }
19409
 
19410
      /**
19411
       * Find the _Fields constant that matches name, or null if its not found.
19412
       */
19413
      public static _Fields findByName(String name) {
19414
        return byName.get(name);
19415
      }
19416
 
19417
      private final short _thriftId;
19418
      private final String _fieldName;
19419
 
19420
      _Fields(short thriftId, String fieldName) {
19421
        _thriftId = thriftId;
19422
        _fieldName = fieldName;
19423
      }
19424
 
19425
      public short getThriftFieldId() {
19426
        return _thriftId;
19427
      }
19428
 
19429
      public String getFieldName() {
19430
        return _fieldName;
19431
      }
19432
    }
19433
 
19434
    // isset id assignments
19435
    private static final int __REDEEMEDON_ISSET_ID = 0;
19436
    private BitSet __isset_bit_vector = new BitSet(1);
19437
 
19438
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
19439
    static {
19440
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
19441
      tmpMap.put(_Fields.VOUCHER_CODE, new org.apache.thrift.meta_data.FieldMetaData("voucherCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
19442
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
19443
      tmpMap.put(_Fields.REDEEMED_ON, new org.apache.thrift.meta_data.FieldMetaData("redeemedOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
19444
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
19445
      metaDataMap = Collections.unmodifiableMap(tmpMap);
19446
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_args.class, metaDataMap);
19447
    }
19448
 
19449
    public markVoucherAsRedeemed_args() {
19450
    }
19451
 
19452
    public markVoucherAsRedeemed_args(
19453
      String voucherCode,
19454
      long redeemedOn)
19455
    {
19456
      this();
19457
      this.voucherCode = voucherCode;
19458
      this.redeemedOn = redeemedOn;
19459
      setRedeemedOnIsSet(true);
19460
    }
19461
 
19462
    /**
19463
     * Performs a deep copy on <i>other</i>.
19464
     */
19465
    public markVoucherAsRedeemed_args(markVoucherAsRedeemed_args other) {
19466
      __isset_bit_vector.clear();
19467
      __isset_bit_vector.or(other.__isset_bit_vector);
19468
      if (other.isSetVoucherCode()) {
19469
        this.voucherCode = other.voucherCode;
19470
      }
19471
      this.redeemedOn = other.redeemedOn;
19472
    }
19473
 
19474
    public markVoucherAsRedeemed_args deepCopy() {
19475
      return new markVoucherAsRedeemed_args(this);
19476
    }
19477
 
19478
    @Override
19479
    public void clear() {
19480
      this.voucherCode = null;
19481
      setRedeemedOnIsSet(false);
19482
      this.redeemedOn = 0;
19483
    }
19484
 
19485
    public String getVoucherCode() {
19486
      return this.voucherCode;
19487
    }
19488
 
19489
    public void setVoucherCode(String voucherCode) {
19490
      this.voucherCode = voucherCode;
19491
    }
19492
 
19493
    public void unsetVoucherCode() {
19494
      this.voucherCode = null;
19495
    }
19496
 
19497
    /** Returns true if field voucherCode is set (has been assigned a value) and false otherwise */
19498
    public boolean isSetVoucherCode() {
19499
      return this.voucherCode != null;
19500
    }
19501
 
19502
    public void setVoucherCodeIsSet(boolean value) {
19503
      if (!value) {
19504
        this.voucherCode = null;
19505
      }
19506
    }
19507
 
19508
    public long getRedeemedOn() {
19509
      return this.redeemedOn;
19510
    }
19511
 
19512
    public void setRedeemedOn(long redeemedOn) {
19513
      this.redeemedOn = redeemedOn;
19514
      setRedeemedOnIsSet(true);
19515
    }
19516
 
19517
    public void unsetRedeemedOn() {
19518
      __isset_bit_vector.clear(__REDEEMEDON_ISSET_ID);
19519
    }
19520
 
19521
    /** Returns true if field redeemedOn is set (has been assigned a value) and false otherwise */
19522
    public boolean isSetRedeemedOn() {
19523
      return __isset_bit_vector.get(__REDEEMEDON_ISSET_ID);
19524
    }
19525
 
19526
    public void setRedeemedOnIsSet(boolean value) {
19527
      __isset_bit_vector.set(__REDEEMEDON_ISSET_ID, value);
19528
    }
19529
 
19530
    public void setFieldValue(_Fields field, Object value) {
19531
      switch (field) {
19532
      case VOUCHER_CODE:
19533
        if (value == null) {
19534
          unsetVoucherCode();
19535
        } else {
19536
          setVoucherCode((String)value);
19537
        }
19538
        break;
19539
 
19540
      case REDEEMED_ON:
19541
        if (value == null) {
19542
          unsetRedeemedOn();
19543
        } else {
19544
          setRedeemedOn((Long)value);
19545
        }
19546
        break;
19547
 
19548
      }
19549
    }
19550
 
19551
    public Object getFieldValue(_Fields field) {
19552
      switch (field) {
19553
      case VOUCHER_CODE:
19554
        return getVoucherCode();
19555
 
19556
      case REDEEMED_ON:
19557
        return Long.valueOf(getRedeemedOn());
19558
 
19559
      }
19560
      throw new IllegalStateException();
19561
    }
19562
 
19563
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
19564
    public boolean isSet(_Fields field) {
19565
      if (field == null) {
19566
        throw new IllegalArgumentException();
19567
      }
19568
 
19569
      switch (field) {
19570
      case VOUCHER_CODE:
19571
        return isSetVoucherCode();
19572
      case REDEEMED_ON:
19573
        return isSetRedeemedOn();
19574
      }
19575
      throw new IllegalStateException();
19576
    }
19577
 
19578
    @Override
19579
    public boolean equals(Object that) {
19580
      if (that == null)
19581
        return false;
19582
      if (that instanceof markVoucherAsRedeemed_args)
19583
        return this.equals((markVoucherAsRedeemed_args)that);
19584
      return false;
19585
    }
19586
 
19587
    public boolean equals(markVoucherAsRedeemed_args that) {
19588
      if (that == null)
19589
        return false;
19590
 
19591
      boolean this_present_voucherCode = true && this.isSetVoucherCode();
19592
      boolean that_present_voucherCode = true && that.isSetVoucherCode();
19593
      if (this_present_voucherCode || that_present_voucherCode) {
19594
        if (!(this_present_voucherCode && that_present_voucherCode))
19595
          return false;
19596
        if (!this.voucherCode.equals(that.voucherCode))
19597
          return false;
19598
      }
19599
 
19600
      boolean this_present_redeemedOn = true;
19601
      boolean that_present_redeemedOn = true;
19602
      if (this_present_redeemedOn || that_present_redeemedOn) {
19603
        if (!(this_present_redeemedOn && that_present_redeemedOn))
19604
          return false;
19605
        if (this.redeemedOn != that.redeemedOn)
19606
          return false;
19607
      }
19608
 
19609
      return true;
19610
    }
19611
 
19612
    @Override
19613
    public int hashCode() {
19614
      return 0;
19615
    }
19616
 
19617
    public int compareTo(markVoucherAsRedeemed_args other) {
19618
      if (!getClass().equals(other.getClass())) {
19619
        return getClass().getName().compareTo(other.getClass().getName());
19620
      }
19621
 
19622
      int lastComparison = 0;
19623
      markVoucherAsRedeemed_args typedOther = (markVoucherAsRedeemed_args)other;
19624
 
19625
      lastComparison = Boolean.valueOf(isSetVoucherCode()).compareTo(typedOther.isSetVoucherCode());
19626
      if (lastComparison != 0) {
19627
        return lastComparison;
19628
      }
19629
      if (isSetVoucherCode()) {
19630
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherCode, typedOther.voucherCode);
19631
        if (lastComparison != 0) {
19632
          return lastComparison;
19633
        }
19634
      }
19635
      lastComparison = Boolean.valueOf(isSetRedeemedOn()).compareTo(typedOther.isSetRedeemedOn());
19636
      if (lastComparison != 0) {
19637
        return lastComparison;
19638
      }
19639
      if (isSetRedeemedOn()) {
19640
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.redeemedOn, typedOther.redeemedOn);
19641
        if (lastComparison != 0) {
19642
          return lastComparison;
19643
        }
19644
      }
19645
      return 0;
19646
    }
19647
 
19648
    public _Fields fieldForId(int fieldId) {
19649
      return _Fields.findByThriftId(fieldId);
19650
    }
19651
 
19652
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
19653
      org.apache.thrift.protocol.TField field;
19654
      iprot.readStructBegin();
19655
      while (true)
19656
      {
19657
        field = iprot.readFieldBegin();
19658
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
19659
          break;
19660
        }
19661
        switch (field.id) {
19662
          case 1: // VOUCHER_CODE
19663
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
19664
              this.voucherCode = iprot.readString();
19665
            } else { 
19666
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19667
            }
19668
            break;
19669
          case 2: // REDEEMED_ON
19670
            if (field.type == org.apache.thrift.protocol.TType.I64) {
19671
              this.redeemedOn = iprot.readI64();
19672
              setRedeemedOnIsSet(true);
19673
            } else { 
19674
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19675
            }
19676
            break;
19677
          default:
19678
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19679
        }
19680
        iprot.readFieldEnd();
19681
      }
19682
      iprot.readStructEnd();
19683
      validate();
19684
    }
19685
 
19686
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
19687
      validate();
19688
 
19689
      oprot.writeStructBegin(STRUCT_DESC);
19690
      if (this.voucherCode != null) {
19691
        oprot.writeFieldBegin(VOUCHER_CODE_FIELD_DESC);
19692
        oprot.writeString(this.voucherCode);
19693
        oprot.writeFieldEnd();
19694
      }
19695
      oprot.writeFieldBegin(REDEEMED_ON_FIELD_DESC);
19696
      oprot.writeI64(this.redeemedOn);
19697
      oprot.writeFieldEnd();
19698
      oprot.writeFieldStop();
19699
      oprot.writeStructEnd();
19700
    }
19701
 
19702
    @Override
19703
    public String toString() {
19704
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_args(");
19705
      boolean first = true;
19706
 
19707
      sb.append("voucherCode:");
19708
      if (this.voucherCode == null) {
19709
        sb.append("null");
19710
      } else {
19711
        sb.append(this.voucherCode);
19712
      }
19713
      first = false;
19714
      if (!first) sb.append(", ");
19715
      sb.append("redeemedOn:");
19716
      sb.append(this.redeemedOn);
19717
      first = false;
19718
      sb.append(")");
19719
      return sb.toString();
19720
    }
19721
 
19722
    public void validate() throws org.apache.thrift.TException {
19723
      // check for required fields
19724
    }
19725
 
19726
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
19727
      try {
19728
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
19729
      } catch (org.apache.thrift.TException te) {
19730
        throw new java.io.IOException(te);
19731
      }
19732
    }
19733
 
19734
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
19735
      try {
19736
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
19737
        __isset_bit_vector = new BitSet(1);
19738
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
19739
      } catch (org.apache.thrift.TException te) {
19740
        throw new java.io.IOException(te);
19741
      }
19742
    }
19743
 
19744
  }
19745
 
19746
  public static class markVoucherAsRedeemed_result implements org.apache.thrift.TBase<markVoucherAsRedeemed_result, markVoucherAsRedeemed_result._Fields>, java.io.Serializable, Cloneable   {
19747
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_result");
19748
 
19749
    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);
19750
 
19751
    private boolean success; // required
19752
 
19753
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
19754
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
19755
      SUCCESS((short)0, "success");
19756
 
19757
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
19758
 
19759
      static {
19760
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
19761
          byName.put(field.getFieldName(), field);
19762
        }
19763
      }
19764
 
19765
      /**
19766
       * Find the _Fields constant that matches fieldId, or null if its not found.
19767
       */
19768
      public static _Fields findByThriftId(int fieldId) {
19769
        switch(fieldId) {
19770
          case 0: // SUCCESS
19771
            return SUCCESS;
19772
          default:
19773
            return null;
19774
        }
19775
      }
19776
 
19777
      /**
19778
       * Find the _Fields constant that matches fieldId, throwing an exception
19779
       * if it is not found.
19780
       */
19781
      public static _Fields findByThriftIdOrThrow(int fieldId) {
19782
        _Fields fields = findByThriftId(fieldId);
19783
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
19784
        return fields;
19785
      }
19786
 
19787
      /**
19788
       * Find the _Fields constant that matches name, or null if its not found.
19789
       */
19790
      public static _Fields findByName(String name) {
19791
        return byName.get(name);
19792
      }
19793
 
19794
      private final short _thriftId;
19795
      private final String _fieldName;
19796
 
19797
      _Fields(short thriftId, String fieldName) {
19798
        _thriftId = thriftId;
19799
        _fieldName = fieldName;
19800
      }
19801
 
19802
      public short getThriftFieldId() {
19803
        return _thriftId;
19804
      }
19805
 
19806
      public String getFieldName() {
19807
        return _fieldName;
19808
      }
19809
    }
19810
 
19811
    // isset id assignments
19812
    private static final int __SUCCESS_ISSET_ID = 0;
19813
    private BitSet __isset_bit_vector = new BitSet(1);
19814
 
19815
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
19816
    static {
19817
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
19818
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
19819
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
19820
      metaDataMap = Collections.unmodifiableMap(tmpMap);
19821
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_result.class, metaDataMap);
19822
    }
19823
 
19824
    public markVoucherAsRedeemed_result() {
19825
    }
19826
 
19827
    public markVoucherAsRedeemed_result(
19828
      boolean success)
19829
    {
19830
      this();
19831
      this.success = success;
19832
      setSuccessIsSet(true);
19833
    }
19834
 
19835
    /**
19836
     * Performs a deep copy on <i>other</i>.
19837
     */
19838
    public markVoucherAsRedeemed_result(markVoucherAsRedeemed_result other) {
19839
      __isset_bit_vector.clear();
19840
      __isset_bit_vector.or(other.__isset_bit_vector);
19841
      this.success = other.success;
19842
    }
19843
 
19844
    public markVoucherAsRedeemed_result deepCopy() {
19845
      return new markVoucherAsRedeemed_result(this);
19846
    }
19847
 
19848
    @Override
19849
    public void clear() {
19850
      setSuccessIsSet(false);
19851
      this.success = false;
19852
    }
19853
 
19854
    public boolean isSuccess() {
19855
      return this.success;
19856
    }
19857
 
19858
    public void setSuccess(boolean success) {
19859
      this.success = success;
19860
      setSuccessIsSet(true);
19861
    }
19862
 
19863
    public void unsetSuccess() {
19864
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
19865
    }
19866
 
19867
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
19868
    public boolean isSetSuccess() {
19869
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
19870
    }
19871
 
19872
    public void setSuccessIsSet(boolean value) {
19873
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
19874
    }
19875
 
19876
    public void setFieldValue(_Fields field, Object value) {
19877
      switch (field) {
19878
      case SUCCESS:
19879
        if (value == null) {
19880
          unsetSuccess();
19881
        } else {
19882
          setSuccess((Boolean)value);
19883
        }
19884
        break;
19885
 
19886
      }
19887
    }
19888
 
19889
    public Object getFieldValue(_Fields field) {
19890
      switch (field) {
19891
      case SUCCESS:
19892
        return Boolean.valueOf(isSuccess());
19893
 
19894
      }
19895
      throw new IllegalStateException();
19896
    }
19897
 
19898
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
19899
    public boolean isSet(_Fields field) {
19900
      if (field == null) {
19901
        throw new IllegalArgumentException();
19902
      }
19903
 
19904
      switch (field) {
19905
      case SUCCESS:
19906
        return isSetSuccess();
19907
      }
19908
      throw new IllegalStateException();
19909
    }
19910
 
19911
    @Override
19912
    public boolean equals(Object that) {
19913
      if (that == null)
19914
        return false;
19915
      if (that instanceof markVoucherAsRedeemed_result)
19916
        return this.equals((markVoucherAsRedeemed_result)that);
19917
      return false;
19918
    }
19919
 
19920
    public boolean equals(markVoucherAsRedeemed_result that) {
19921
      if (that == null)
19922
        return false;
19923
 
19924
      boolean this_present_success = true;
19925
      boolean that_present_success = true;
19926
      if (this_present_success || that_present_success) {
19927
        if (!(this_present_success && that_present_success))
19928
          return false;
19929
        if (this.success != that.success)
19930
          return false;
19931
      }
19932
 
19933
      return true;
19934
    }
19935
 
19936
    @Override
19937
    public int hashCode() {
19938
      return 0;
19939
    }
19940
 
19941
    public int compareTo(markVoucherAsRedeemed_result other) {
19942
      if (!getClass().equals(other.getClass())) {
19943
        return getClass().getName().compareTo(other.getClass().getName());
19944
      }
19945
 
19946
      int lastComparison = 0;
19947
      markVoucherAsRedeemed_result typedOther = (markVoucherAsRedeemed_result)other;
19948
 
19949
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
19950
      if (lastComparison != 0) {
19951
        return lastComparison;
19952
      }
19953
      if (isSetSuccess()) {
19954
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
19955
        if (lastComparison != 0) {
19956
          return lastComparison;
19957
        }
19958
      }
19959
      return 0;
19960
    }
19961
 
19962
    public _Fields fieldForId(int fieldId) {
19963
      return _Fields.findByThriftId(fieldId);
19964
    }
19965
 
19966
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
19967
      org.apache.thrift.protocol.TField field;
19968
      iprot.readStructBegin();
19969
      while (true)
19970
      {
19971
        field = iprot.readFieldBegin();
19972
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
19973
          break;
19974
        }
19975
        switch (field.id) {
19976
          case 0: // SUCCESS
19977
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
19978
              this.success = iprot.readBool();
19979
              setSuccessIsSet(true);
19980
            } else { 
19981
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19982
            }
19983
            break;
19984
          default:
19985
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19986
        }
19987
        iprot.readFieldEnd();
19988
      }
19989
      iprot.readStructEnd();
19990
      validate();
19991
    }
19992
 
19993
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
19994
      oprot.writeStructBegin(STRUCT_DESC);
19995
 
19996
      if (this.isSetSuccess()) {
19997
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
19998
        oprot.writeBool(this.success);
19999
        oprot.writeFieldEnd();
20000
      }
20001
      oprot.writeFieldStop();
20002
      oprot.writeStructEnd();
20003
    }
20004
 
20005
    @Override
20006
    public String toString() {
20007
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_result(");
20008
      boolean first = true;
20009
 
20010
      sb.append("success:");
20011
      sb.append(this.success);
20012
      first = false;
20013
      sb.append(")");
20014
      return sb.toString();
20015
    }
20016
 
20017
    public void validate() throws org.apache.thrift.TException {
20018
      // check for required fields
20019
    }
20020
 
20021
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
20022
      try {
20023
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
20024
      } catch (org.apache.thrift.TException te) {
20025
        throw new java.io.IOException(te);
20026
      }
20027
    }
20028
 
20029
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
20030
      try {
20031
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
20032
      } catch (org.apache.thrift.TException te) {
20033
        throw new java.io.IOException(te);
20034
      }
20035
    }
20036
 
20037
  }
20038
 
1982 varun.gupt 20039
}