Subversion Repositories SmartDukaan

Rev

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
 
13521 amit.gupta 52
    public void trackCouponUsage(String couponCode, long transactionId, long userId, long amount, boolean isDigital) 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
 
13521 amit.gupta 129
    public void trackCouponUsage(String couponCode, long transactionId, long userId, long amount, boolean isDigital, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException;
3430 rajveer 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
 
13521 amit.gupta 465
    public void trackCouponUsage(String couponCode, long transactionId, long userId, long amount, boolean isDigital) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 466
    {
13521 amit.gupta 467
      send_trackCouponUsage(couponCode, transactionId, userId, amount, isDigital);
1982 varun.gupt 468
      recv_trackCouponUsage();
469
    }
470
 
13521 amit.gupta 471
    public void send_trackCouponUsage(String couponCode, long transactionId, long userId, long amount, boolean isDigital) 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);
13521 amit.gupta 477
      args.setAmount(amount);
478
      args.setIsDigital(isDigital);
3430 rajveer 479
      sendBase("trackCouponUsage", args);
1982 varun.gupt 480
    }
481
 
3430 rajveer 482
    public void recv_trackCouponUsage() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 483
    {
484
      trackCouponUsage_result result = new trackCouponUsage_result();
3430 rajveer 485
      receiveBase(result, "trackCouponUsage");
1982 varun.gupt 486
      if (result.pex != null) {
487
        throw result.pex;
488
      }
489
      return;
490
    }
491
 
3430 rajveer 492
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 493
    {
494
      send_getCouponUsageCountByUser(couponCode, userId);
495
      return recv_getCouponUsageCountByUser();
496
    }
497
 
3430 rajveer 498
    public void send_getCouponUsageCountByUser(String couponCode, long userId) throws org.apache.thrift.TException
1982 varun.gupt 499
    {
500
      getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
3430 rajveer 501
      args.setCouponCode(couponCode);
502
      args.setUserId(userId);
503
      sendBase("getCouponUsageCountByUser", args);
1982 varun.gupt 504
    }
505
 
3430 rajveer 506
    public long recv_getCouponUsageCountByUser() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 507
    {
508
      getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
3430 rajveer 509
      receiveBase(result, "getCouponUsageCountByUser");
1982 varun.gupt 510
      if (result.isSetSuccess()) {
511
        return result.success;
512
      }
513
      if (result.pex != null) {
514
        throw result.pex;
515
      }
3430 rajveer 516
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCouponUsageCountByUser failed: unknown result");
1982 varun.gupt 517
    }
518
 
6497 amit.gupta 519
    public List<Coupon> getActiveCodes(long promotionId) throws PromotionException, org.apache.thrift.TException
520
    {
521
      send_getActiveCodes(promotionId);
522
      return recv_getActiveCodes();
523
    }
524
 
525
    public void send_getActiveCodes(long promotionId) throws org.apache.thrift.TException
526
    {
527
      getActiveCodes_args args = new getActiveCodes_args();
528
      args.setPromotionId(promotionId);
529
      sendBase("getActiveCodes", args);
530
    }
531
 
532
    public List<Coupon> recv_getActiveCodes() throws PromotionException, org.apache.thrift.TException
533
    {
534
      getActiveCodes_result result = new getActiveCodes_result();
535
      receiveBase(result, "getActiveCodes");
536
      if (result.isSetSuccess()) {
537
        return result.success;
538
      }
539
      if (result.pex != null) {
540
        throw result.pex;
541
      }
542
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getActiveCodes failed: unknown result");
543
    }
544
 
545
    public void deleteCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
546
    {
547
      send_deleteCoupon(couponCode);
548
      recv_deleteCoupon();
549
    }
550
 
551
    public void send_deleteCoupon(String couponCode) throws org.apache.thrift.TException
552
    {
553
      deleteCoupon_args args = new deleteCoupon_args();
554
      args.setCouponCode(couponCode);
555
      sendBase("deleteCoupon", args);
556
    }
557
 
558
    public void recv_deleteCoupon() throws PromotionException, org.apache.thrift.TException
559
    {
560
      deleteCoupon_result result = new deleteCoupon_result();
561
      receiveBase(result, "deleteCoupon");
562
      if (result.pex != null) {
563
        throw result.pex;
564
      }
565
      return;
566
    }
567
 
7092 amit.gupta 568
    public List<Coupon> getAllCouponsByPromotionId(long promotionId) throws PromotionException, org.apache.thrift.TException
569
    {
570
      send_getAllCouponsByPromotionId(promotionId);
571
      return recv_getAllCouponsByPromotionId();
572
    }
573
 
574
    public void send_getAllCouponsByPromotionId(long promotionId) throws org.apache.thrift.TException
575
    {
576
      getAllCouponsByPromotionId_args args = new getAllCouponsByPromotionId_args();
577
      args.setPromotionId(promotionId);
578
      sendBase("getAllCouponsByPromotionId", args);
579
    }
580
 
581
    public List<Coupon> recv_getAllCouponsByPromotionId() throws PromotionException, org.apache.thrift.TException
582
    {
583
      getAllCouponsByPromotionId_result result = new getAllCouponsByPromotionId_result();
584
      receiveBase(result, "getAllCouponsByPromotionId");
585
      if (result.isSetSuccess()) {
586
        return result.success;
587
      }
588
      if (result.pex != null) {
589
        throw result.pex;
590
      }
591
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllCouponsByPromotionId failed: unknown result");
592
    }
593
 
3430 rajveer 594
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 595
    {
596
      send_getActiveCoupons();
597
      return recv_getActiveCoupons();
598
    }
599
 
3430 rajveer 600
    public void send_getActiveCoupons() throws org.apache.thrift.TException
3385 varun.gupt 601
    {
602
      getActiveCoupons_args args = new getActiveCoupons_args();
3430 rajveer 603
      sendBase("getActiveCoupons", args);
3385 varun.gupt 604
    }
605
 
3430 rajveer 606
    public List<Coupon> recv_getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 607
    {
608
      getActiveCoupons_result result = new getActiveCoupons_result();
3430 rajveer 609
      receiveBase(result, "getActiveCoupons");
3385 varun.gupt 610
      if (result.isSetSuccess()) {
611
        return result.success;
612
      }
613
      if (result.pex != null) {
614
        throw result.pex;
615
      }
3430 rajveer 616
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getActiveCoupons failed: unknown result");
3385 varun.gupt 617
    }
618
 
8707 manish.sha 619
    public String createCoupon(long promotionId, long couponCategory, String couponCode, String arguments, boolean isCod, String prefix) throws PromotionException, org.apache.thrift.TException
6250 amit.gupta 620
    {
8707 manish.sha 621
      send_createCoupon(promotionId, couponCategory, couponCode, arguments, isCod, prefix);
6250 amit.gupta 622
      return recv_createCoupon();
623
    }
624
 
8707 manish.sha 625
    public void send_createCoupon(long promotionId, long couponCategory, String couponCode, String arguments, boolean isCod, String prefix) throws org.apache.thrift.TException
6250 amit.gupta 626
    {
627
      createCoupon_args args = new createCoupon_args();
628
      args.setPromotionId(promotionId);
8707 manish.sha 629
      args.setCouponCategory(couponCategory);
6730 anupam.sin 630
      args.setCouponCode(couponCode);
6679 anupam.sin 631
      args.setArguments(arguments);
6356 amit.gupta 632
      args.setIsCod(isCod);
6561 amit.gupta 633
      args.setPrefix(prefix);
6250 amit.gupta 634
      sendBase("createCoupon", args);
635
    }
636
 
637
    public String recv_createCoupon() throws PromotionException, org.apache.thrift.TException
638
    {
639
      createCoupon_result result = new createCoupon_result();
640
      receiveBase(result, "createCoupon");
641
      if (result.isSetSuccess()) {
642
        return result.success;
643
      }
644
      if (result.pex != null) {
645
        throw result.pex;
646
      }
647
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createCoupon failed: unknown result");
648
    }
649
 
3430 rajveer 650
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 651
    {
652
      send_getSuccessfulPaymentCountForCoupon(couponCode);
653
      return recv_getSuccessfulPaymentCountForCoupon();
654
    }
655
 
3430 rajveer 656
    public void send_getSuccessfulPaymentCountForCoupon(String couponCode) throws org.apache.thrift.TException
3385 varun.gupt 657
    {
658
      getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
3430 rajveer 659
      args.setCouponCode(couponCode);
660
      sendBase("getSuccessfulPaymentCountForCoupon", args);
3385 varun.gupt 661
    }
662
 
3430 rajveer 663
    public long recv_getSuccessfulPaymentCountForCoupon() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 664
    {
665
      getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
3430 rajveer 666
      receiveBase(result, "getSuccessfulPaymentCountForCoupon");
3385 varun.gupt 667
      if (result.isSetSuccess()) {
668
        return result.success;
669
      }
670
      if (result.pex != null) {
671
        throw result.pex;
672
      }
3430 rajveer 673
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSuccessfulPaymentCountForCoupon failed: unknown result");
3385 varun.gupt 674
    }
675
 
3430 rajveer 676
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 677
    {
678
      send_getRuleDocString(ruleName);
679
      return recv_getRuleDocString();
680
    }
681
 
3430 rajveer 682
    public void send_getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 683
    {
684
      getRuleDocString_args args = new getRuleDocString_args();
3430 rajveer 685
      args.setRuleName(ruleName);
686
      sendBase("getRuleDocString", args);
3385 varun.gupt 687
    }
688
 
3430 rajveer 689
    public String recv_getRuleDocString() throws org.apache.thrift.TException
3385 varun.gupt 690
    {
691
      getRuleDocString_result result = new getRuleDocString_result();
3430 rajveer 692
      receiveBase(result, "getRuleDocString");
3385 varun.gupt 693
      if (result.isSetSuccess()) {
694
        return result.success;
695
      }
3430 rajveer 696
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRuleDocString failed: unknown result");
3385 varun.gupt 697
    }
698
 
4189 varun.gupt 699
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException
700
    {
701
      send_getItemDiscountMap(itemIds);
702
      return recv_getItemDiscountMap();
703
    }
704
 
705
    public void send_getItemDiscountMap(List<Long> itemIds) throws org.apache.thrift.TException
706
    {
707
      getItemDiscountMap_args args = new getItemDiscountMap_args();
708
      args.setItemIds(itemIds);
709
      sendBase("getItemDiscountMap", args);
710
    }
711
 
712
    public List<ItemCouponDiscount> recv_getItemDiscountMap() throws PromotionException, org.apache.thrift.TException
713
    {
714
      getItemDiscountMap_result result = new getItemDiscountMap_result();
715
      receiveBase(result, "getItemDiscountMap");
716
      if (result.isSetSuccess()) {
717
        return result.success;
718
      }
719
      if (result.pex != null) {
720
        throw result.pex;
721
      }
722
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemDiscountMap failed: unknown result");
723
    }
724
 
4494 varun.gupt 725
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
726
    {
727
      send_getDiscountsForEntity(entityId);
728
      return recv_getDiscountsForEntity();
729
    }
730
 
731
    public void send_getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
732
    {
733
      getDiscountsForEntity_args args = new getDiscountsForEntity_args();
734
      args.setEntityId(entityId);
735
      sendBase("getDiscountsForEntity", args);
736
    }
737
 
738
    public Map<String,Double> recv_getDiscountsForEntity() throws org.apache.thrift.TException
739
    {
740
      getDiscountsForEntity_result result = new getDiscountsForEntity_result();
741
      receiveBase(result, "getDiscountsForEntity");
742
      if (result.isSetSuccess()) {
743
        return result.success;
744
      }
745
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getDiscountsForEntity failed: unknown result");
746
    }
747
 
5469 rajveer 748
    public void addVoucher(Voucher voucher) throws org.apache.thrift.TException
749
    {
750
      send_addVoucher(voucher);
751
      recv_addVoucher();
752
    }
753
 
754
    public void send_addVoucher(Voucher voucher) throws org.apache.thrift.TException
755
    {
756
      addVoucher_args args = new addVoucher_args();
757
      args.setVoucher(voucher);
758
      sendBase("addVoucher", args);
759
    }
760
 
761
    public void recv_addVoucher() throws org.apache.thrift.TException
762
    {
763
      addVoucher_result result = new addVoucher_result();
764
      receiveBase(result, "addVoucher");
765
      return;
766
    }
767
 
768
    public Voucher assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException
769
    {
770
      send_assignVoucher(userId, userEmail, voucherType, amount);
771
      return recv_assignVoucher();
772
    }
773
 
774
    public void send_assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException
775
    {
776
      assignVoucher_args args = new assignVoucher_args();
777
      args.setUserId(userId);
778
      args.setUserEmail(userEmail);
779
      args.setVoucherType(voucherType);
780
      args.setAmount(amount);
781
      sendBase("assignVoucher", args);
782
    }
783
 
784
    public Voucher recv_assignVoucher() throws org.apache.thrift.TException
785
    {
786
      assignVoucher_result result = new assignVoucher_result();
787
      receiveBase(result, "assignVoucher");
788
      if (result.isSetSuccess()) {
789
        return result.success;
790
      }
791
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "assignVoucher failed: unknown result");
792
    }
793
 
794
    public boolean markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException
795
    {
796
      send_markVoucherAsRedeemed(voucherCode, redeemedOn);
797
      return recv_markVoucherAsRedeemed();
798
    }
799
 
800
    public void send_markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException
801
    {
802
      markVoucherAsRedeemed_args args = new markVoucherAsRedeemed_args();
803
      args.setVoucherCode(voucherCode);
804
      args.setRedeemedOn(redeemedOn);
805
      sendBase("markVoucherAsRedeemed", args);
806
    }
807
 
808
    public boolean recv_markVoucherAsRedeemed() throws org.apache.thrift.TException
809
    {
810
      markVoucherAsRedeemed_result result = new markVoucherAsRedeemed_result();
811
      receiveBase(result, "markVoucherAsRedeemed");
812
      if (result.isSetSuccess()) {
813
        return result.success;
814
      }
815
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "markVoucherAsRedeemed failed: unknown result");
816
    }
817
 
1982 varun.gupt 818
  }
3430 rajveer 819
  public static class AsyncClient extends in.shop2020.generic.GenericService.AsyncClient implements AsyncIface {
820
    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
821
      private org.apache.thrift.async.TAsyncClientManager clientManager;
822
      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
823
      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
824
        this.clientManager = clientManager;
825
        this.protocolFactory = protocolFactory;
826
      }
827
      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
828
        return new AsyncClient(protocolFactory, clientManager, transport);
829
      }
1982 varun.gupt 830
    }
831
 
3430 rajveer 832
    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
833
      super(protocolFactory, clientManager, transport);
834
    }
1982 varun.gupt 835
 
3430 rajveer 836
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn, org.apache.thrift.async.AsyncMethodCallback<createPromotion_call> resultHandler) throws org.apache.thrift.TException {
837
      checkReady();
838
      createPromotion_call method_call = new createPromotion_call(name, ruleExecutionSrc, startOn, endOn, resultHandler, this, ___protocolFactory, ___transport);
839
      this.___currentMethod = method_call;
840
      ___manager.call(method_call);
1982 varun.gupt 841
    }
842
 
3430 rajveer 843
    public static class createPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
844
      private String name;
845
      private String ruleExecutionSrc;
846
      private long startOn;
847
      private long endOn;
848
      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 {
849
        super(client, protocolFactory, transport, resultHandler, false);
850
        this.name = name;
851
        this.ruleExecutionSrc = ruleExecutionSrc;
852
        this.startOn = startOn;
853
        this.endOn = endOn;
1982 varun.gupt 854
      }
855
 
3430 rajveer 856
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
857
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
1982 varun.gupt 858
        createPromotion_args args = new createPromotion_args();
3430 rajveer 859
        args.setName(name);
860
        args.setRuleExecutionSrc(ruleExecutionSrc);
861
        args.setStartOn(startOn);
862
        args.setEndOn(endOn);
863
        args.write(prot);
864
        prot.writeMessageEnd();
1982 varun.gupt 865
      }
866
 
3430 rajveer 867
      public void getResult() throws PromotionException, org.apache.thrift.TException {
868
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
869
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 870
        }
3430 rajveer 871
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
872
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
873
        (new Client(prot)).recv_createPromotion();
1982 varun.gupt 874
      }
3430 rajveer 875
    }
1982 varun.gupt 876
 
7746 amit.gupta 877
    public void removeAllCouponsByPromotionId(long promotionId, org.apache.thrift.async.AsyncMethodCallback<removeAllCouponsByPromotionId_call> resultHandler) throws org.apache.thrift.TException {
878
      checkReady();
879
      removeAllCouponsByPromotionId_call method_call = new removeAllCouponsByPromotionId_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
880
      this.___currentMethod = method_call;
881
      ___manager.call(method_call);
882
    }
883
 
884
    public static class removeAllCouponsByPromotionId_call extends org.apache.thrift.async.TAsyncMethodCall {
885
      private long promotionId;
886
      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 {
887
        super(client, protocolFactory, transport, resultHandler, false);
888
        this.promotionId = promotionId;
889
      }
890
 
891
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
892
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("removeAllCouponsByPromotionId", org.apache.thrift.protocol.TMessageType.CALL, 0));
893
        removeAllCouponsByPromotionId_args args = new removeAllCouponsByPromotionId_args();
894
        args.setPromotionId(promotionId);
895
        args.write(prot);
896
        prot.writeMessageEnd();
897
      }
898
 
899
      public long getResult() throws PromotionException, org.apache.thrift.TException {
900
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
901
          throw new IllegalStateException("Method call not finished!");
902
        }
903
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
904
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
905
        return (new Client(prot)).recv_removeAllCouponsByPromotionId();
906
      }
907
    }
908
 
6301 amit.gupta 909
    public void getCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getCoupon_call> resultHandler) throws org.apache.thrift.TException {
910
      checkReady();
911
      getCoupon_call method_call = new getCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
912
      this.___currentMethod = method_call;
913
      ___manager.call(method_call);
914
    }
915
 
916
    public static class getCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
917
      private String couponCode;
918
      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 {
919
        super(client, protocolFactory, transport, resultHandler, false);
920
        this.couponCode = couponCode;
921
      }
922
 
923
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
924
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
925
        getCoupon_args args = new getCoupon_args();
926
        args.setCouponCode(couponCode);
927
        args.write(prot);
928
        prot.writeMessageEnd();
929
      }
930
 
931
      public Coupon getResult() throws PromotionException, org.apache.thrift.TException {
932
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
933
          throw new IllegalStateException("Method call not finished!");
934
        }
935
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
936
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
937
        return (new Client(prot)).recv_getCoupon();
938
      }
939
    }
940
 
941
    public void isGiftVoucher(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isGiftVoucher_call> resultHandler) throws org.apache.thrift.TException {
942
      checkReady();
943
      isGiftVoucher_call method_call = new isGiftVoucher_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
944
      this.___currentMethod = method_call;
945
      ___manager.call(method_call);
946
    }
947
 
948
    public static class isGiftVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
949
      private String couponCode;
950
      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 {
951
        super(client, protocolFactory, transport, resultHandler, false);
952
        this.couponCode = couponCode;
953
      }
954
 
955
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
956
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isGiftVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
957
        isGiftVoucher_args args = new isGiftVoucher_args();
958
        args.setCouponCode(couponCode);
959
        args.write(prot);
960
        prot.writeMessageEnd();
961
      }
962
 
963
      public boolean getResult() throws PromotionException, org.apache.thrift.TException {
964
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
965
          throw new IllegalStateException("Method call not finished!");
966
        }
967
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
968
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
969
        return (new Client(prot)).recv_isGiftVoucher();
970
      }
971
    }
972
 
11819 amit.gupta 973
    public void isCodApplicable(Cart cart, org.apache.thrift.async.AsyncMethodCallback<isCodApplicable_call> resultHandler) throws org.apache.thrift.TException {
6356 amit.gupta 974
      checkReady();
11819 amit.gupta 975
      isCodApplicable_call method_call = new isCodApplicable_call(cart, resultHandler, this, ___protocolFactory, ___transport);
6356 amit.gupta 976
      this.___currentMethod = method_call;
977
      ___manager.call(method_call);
978
    }
979
 
980
    public static class isCodApplicable_call extends org.apache.thrift.async.TAsyncMethodCall {
11819 amit.gupta 981
      private Cart cart;
982
      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 983
        super(client, protocolFactory, transport, resultHandler, false);
11819 amit.gupta 984
        this.cart = cart;
6356 amit.gupta 985
      }
986
 
987
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
988
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isCodApplicable", org.apache.thrift.protocol.TMessageType.CALL, 0));
989
        isCodApplicable_args args = new isCodApplicable_args();
11819 amit.gupta 990
        args.setCart(cart);
6356 amit.gupta 991
        args.write(prot);
992
        prot.writeMessageEnd();
993
      }
994
 
995
      public boolean getResult() throws PromotionException, org.apache.thrift.TException {
996
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
997
          throw new IllegalStateException("Method call not finished!");
998
        }
999
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1000
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1001
        return (new Client(prot)).recv_isCodApplicable();
1002
      }
1003
    }
1004
 
3430 rajveer 1005
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<getAllPromotions_call> resultHandler) throws org.apache.thrift.TException {
1006
      checkReady();
1007
      getAllPromotions_call method_call = new getAllPromotions_call(resultHandler, this, ___protocolFactory, ___transport);
1008
      this.___currentMethod = method_call;
1009
      ___manager.call(method_call);
1982 varun.gupt 1010
    }
1011
 
3430 rajveer 1012
    public static class getAllPromotions_call extends org.apache.thrift.async.TAsyncMethodCall {
1013
      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 {
1014
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 1015
      }
1016
 
3430 rajveer 1017
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1018
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllPromotions", org.apache.thrift.protocol.TMessageType.CALL, 0));
1019
        getAllPromotions_args args = new getAllPromotions_args();
1020
        args.write(prot);
1021
        prot.writeMessageEnd();
1022
      }
1982 varun.gupt 1023
 
3430 rajveer 1024
      public List<Promotion> getResult() throws PromotionException, org.apache.thrift.TException {
1025
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1026
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 1027
        }
3430 rajveer 1028
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1029
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1030
        return (new Client(prot)).recv_getAllPromotions();
1982 varun.gupt 1031
      }
3430 rajveer 1032
    }
1982 varun.gupt 1033
 
3430 rajveer 1034
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getPromotionById_call> resultHandler) throws org.apache.thrift.TException {
1035
      checkReady();
1036
      getPromotionById_call method_call = new getPromotionById_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
1037
      this.___currentMethod = method_call;
1038
      ___manager.call(method_call);
1982 varun.gupt 1039
    }
1040
 
3430 rajveer 1041
    public static class getPromotionById_call extends org.apache.thrift.async.TAsyncMethodCall {
1042
      private long promotionId;
1043
      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 {
1044
        super(client, protocolFactory, transport, resultHandler, false);
1045
        this.promotionId = promotionId;
1982 varun.gupt 1046
      }
1047
 
3430 rajveer 1048
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1049
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPromotionById", org.apache.thrift.protocol.TMessageType.CALL, 0));
1050
        getPromotionById_args args = new getPromotionById_args();
1051
        args.setPromotionId(promotionId);
1052
        args.write(prot);
1053
        prot.writeMessageEnd();
1054
      }
1982 varun.gupt 1055
 
3430 rajveer 1056
      public Promotion getResult() throws PromotionException, org.apache.thrift.TException {
1057
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1058
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 1059
        }
3430 rajveer 1060
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1061
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1062
        return (new Client(prot)).recv_getPromotionById();
1982 varun.gupt 1063
      }
3430 rajveer 1064
    }
1982 varun.gupt 1065
 
3430 rajveer 1066
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException {
1067
      checkReady();
1068
      generateCouponsForPromotion_call method_call = new generateCouponsForPromotion_call(promotionId, couponCode, resultHandler, this, ___protocolFactory, ___transport);
1069
      this.___currentMethod = method_call;
1070
      ___manager.call(method_call);
1982 varun.gupt 1071
    }
1072
 
3430 rajveer 1073
    public static class generateCouponsForPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
1074
      private long promotionId;
1075
      private String couponCode;
1076
      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 {
1077
        super(client, protocolFactory, transport, resultHandler, false);
1078
        this.promotionId = promotionId;
1079
        this.couponCode = couponCode;
1982 varun.gupt 1080
      }
1081
 
3430 rajveer 1082
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1083
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("generateCouponsForPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
1084
        generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
1085
        args.setPromotionId(promotionId);
1086
        args.setCouponCode(couponCode);
1087
        args.write(prot);
1088
        prot.writeMessageEnd();
3385 varun.gupt 1089
      }
1090
 
3430 rajveer 1091
      public void getResult() throws PromotionException, org.apache.thrift.TException {
1092
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1093
          throw new IllegalStateException("Method call not finished!");
3385 varun.gupt 1094
        }
3430 rajveer 1095
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1096
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1097
        (new Client(prot)).recv_generateCouponsForPromotion();
3385 varun.gupt 1098
      }
1099
    }
1100
 
3430 rajveer 1101
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<applyCoupon_call> resultHandler) throws org.apache.thrift.TException {
1102
      checkReady();
1103
      applyCoupon_call method_call = new applyCoupon_call(couponCode, cartId, resultHandler, this, ___protocolFactory, ___transport);
1104
      this.___currentMethod = method_call;
1105
      ___manager.call(method_call);
3385 varun.gupt 1106
    }
1107
 
3430 rajveer 1108
    public static class applyCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1109
      private String couponCode;
1110
      private long cartId;
1111
      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 {
1112
        super(client, protocolFactory, transport, resultHandler, false);
1113
        this.couponCode = couponCode;
1114
        this.cartId = cartId;
1982 varun.gupt 1115
      }
1116
 
3430 rajveer 1117
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1118
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("applyCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1119
        applyCoupon_args args = new applyCoupon_args();
1120
        args.setCouponCode(couponCode);
1121
        args.setCartId(cartId);
1122
        args.write(prot);
1123
        prot.writeMessageEnd();
1982 varun.gupt 1124
      }
1125
 
3430 rajveer 1126
      public Cart getResult() throws PromotionException, org.apache.thrift.TException {
1127
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1128
          throw new IllegalStateException("Method call not finished!");
1129
        }
1130
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1131
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1132
        return (new Client(prot)).recv_applyCoupon();
1982 varun.gupt 1133
      }
3430 rajveer 1134
    }
1982 varun.gupt 1135
 
6736 amit.gupta 1136
    public void getEmiDiscount(long cartId, org.apache.thrift.async.AsyncMethodCallback<getEmiDiscount_call> resultHandler) throws org.apache.thrift.TException {
1137
      checkReady();
1138
      getEmiDiscount_call method_call = new getEmiDiscount_call(cartId, resultHandler, this, ___protocolFactory, ___transport);
1139
      this.___currentMethod = method_call;
1140
      ___manager.call(method_call);
1141
    }
1142
 
1143
    public static class getEmiDiscount_call extends org.apache.thrift.async.TAsyncMethodCall {
1144
      private long cartId;
1145
      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 {
1146
        super(client, protocolFactory, transport, resultHandler, false);
1147
        this.cartId = cartId;
1148
      }
1149
 
1150
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1151
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getEmiDiscount", org.apache.thrift.protocol.TMessageType.CALL, 0));
1152
        getEmiDiscount_args args = new getEmiDiscount_args();
1153
        args.setCartId(cartId);
1154
        args.write(prot);
1155
        prot.writeMessageEnd();
1156
      }
1157
 
1158
      public Map<Long,Double> getResult() throws PromotionException, org.apache.thrift.TException {
1159
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1160
          throw new IllegalStateException("Method call not finished!");
1161
        }
1162
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1163
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1164
        return (new Client(prot)).recv_getEmiDiscount();
1165
      }
1166
    }
1167
 
6433 anupam.sin 1168
    public void applyRechargeCoupon(String couponCode, long totalAmount, long userId, org.apache.thrift.async.AsyncMethodCallback<applyRechargeCoupon_call> resultHandler) throws org.apache.thrift.TException {
1169
      checkReady();
1170
      applyRechargeCoupon_call method_call = new applyRechargeCoupon_call(couponCode, totalAmount, userId, resultHandler, this, ___protocolFactory, ___transport);
1171
      this.___currentMethod = method_call;
1172
      ___manager.call(method_call);
1173
    }
1174
 
1175
    public static class applyRechargeCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1176
      private String couponCode;
1177
      private long totalAmount;
1178
      private long userId;
1179
      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 {
1180
        super(client, protocolFactory, transport, resultHandler, false);
1181
        this.couponCode = couponCode;
1182
        this.totalAmount = totalAmount;
1183
        this.userId = userId;
1184
      }
1185
 
1186
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1187
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("applyRechargeCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1188
        applyRechargeCoupon_args args = new applyRechargeCoupon_args();
1189
        args.setCouponCode(couponCode);
1190
        args.setTotalAmount(totalAmount);
1191
        args.setUserId(userId);
1192
        args.write(prot);
1193
        prot.writeMessageEnd();
1194
      }
1195
 
1196
      public Map<Long,String> getResult() throws PromotionException, org.apache.thrift.TException {
1197
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1198
          throw new IllegalStateException("Method call not finished!");
1199
        }
1200
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1201
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1202
        return (new Client(prot)).recv_applyRechargeCoupon();
1203
      }
1204
    }
1205
 
13521 amit.gupta 1206
    public void trackCouponUsage(String couponCode, long transactionId, long userId, long amount, boolean isDigital, org.apache.thrift.async.AsyncMethodCallback<trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException {
3430 rajveer 1207
      checkReady();
13521 amit.gupta 1208
      trackCouponUsage_call method_call = new trackCouponUsage_call(couponCode, transactionId, userId, amount, isDigital, resultHandler, this, ___protocolFactory, ___transport);
3430 rajveer 1209
      this.___currentMethod = method_call;
1210
      ___manager.call(method_call);
1211
    }
1982 varun.gupt 1212
 
3430 rajveer 1213
    public static class trackCouponUsage_call extends org.apache.thrift.async.TAsyncMethodCall {
1214
      private String couponCode;
1215
      private long transactionId;
1216
      private long userId;
13521 amit.gupta 1217
      private long amount;
1218
      private boolean isDigital;
1219
      public trackCouponUsage_call(String couponCode, long transactionId, long userId, long amount, boolean isDigital, 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 {
3430 rajveer 1220
        super(client, protocolFactory, transport, resultHandler, false);
1221
        this.couponCode = couponCode;
1222
        this.transactionId = transactionId;
1223
        this.userId = userId;
13521 amit.gupta 1224
        this.amount = amount;
1225
        this.isDigital = isDigital;
1982 varun.gupt 1226
      }
1227
 
3430 rajveer 1228
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1229
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("trackCouponUsage", org.apache.thrift.protocol.TMessageType.CALL, 0));
1230
        trackCouponUsage_args args = new trackCouponUsage_args();
1231
        args.setCouponCode(couponCode);
1232
        args.setTransactionId(transactionId);
1233
        args.setUserId(userId);
13521 amit.gupta 1234
        args.setAmount(amount);
1235
        args.setIsDigital(isDigital);
3430 rajveer 1236
        args.write(prot);
1237
        prot.writeMessageEnd();
1982 varun.gupt 1238
      }
1239
 
3430 rajveer 1240
      public void getResult() throws PromotionException, org.apache.thrift.TException {
1241
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1242
          throw new IllegalStateException("Method call not finished!");
1243
        }
1244
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1245
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1246
        (new Client(prot)).recv_trackCouponUsage();
1982 varun.gupt 1247
      }
1248
    }
1249
 
3430 rajveer 1250
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException {
1251
      checkReady();
1252
      getCouponUsageCountByUser_call method_call = new getCouponUsageCountByUser_call(couponCode, userId, resultHandler, this, ___protocolFactory, ___transport);
1253
      this.___currentMethod = method_call;
1254
      ___manager.call(method_call);
1982 varun.gupt 1255
    }
1256
 
3430 rajveer 1257
    public static class getCouponUsageCountByUser_call extends org.apache.thrift.async.TAsyncMethodCall {
1258
      private String couponCode;
1259
      private long userId;
1260
      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 {
1261
        super(client, protocolFactory, transport, resultHandler, false);
1262
        this.couponCode = couponCode;
1263
        this.userId = userId;
1264
      }
1982 varun.gupt 1265
 
3430 rajveer 1266
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1267
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCouponUsageCountByUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
1268
        getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
1269
        args.setCouponCode(couponCode);
1270
        args.setUserId(userId);
1271
        args.write(prot);
1272
        prot.writeMessageEnd();
1273
      }
1982 varun.gupt 1274
 
3430 rajveer 1275
      public long getResult() throws PromotionException, org.apache.thrift.TException {
1276
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1277
          throw new IllegalStateException("Method call not finished!");
1278
        }
1279
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1280
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1281
        return (new Client(prot)).recv_getCouponUsageCountByUser();
1282
      }
1982 varun.gupt 1283
    }
1284
 
6497 amit.gupta 1285
    public void getActiveCodes(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getActiveCodes_call> resultHandler) throws org.apache.thrift.TException {
1286
      checkReady();
1287
      getActiveCodes_call method_call = new getActiveCodes_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
1288
      this.___currentMethod = method_call;
1289
      ___manager.call(method_call);
1290
    }
1291
 
1292
    public static class getActiveCodes_call extends org.apache.thrift.async.TAsyncMethodCall {
1293
      private long promotionId;
1294
      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 {
1295
        super(client, protocolFactory, transport, resultHandler, false);
1296
        this.promotionId = promotionId;
1297
      }
1298
 
1299
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1300
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getActiveCodes", org.apache.thrift.protocol.TMessageType.CALL, 0));
1301
        getActiveCodes_args args = new getActiveCodes_args();
1302
        args.setPromotionId(promotionId);
1303
        args.write(prot);
1304
        prot.writeMessageEnd();
1305
      }
1306
 
1307
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
1308
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1309
          throw new IllegalStateException("Method call not finished!");
1310
        }
1311
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1312
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1313
        return (new Client(prot)).recv_getActiveCodes();
1314
      }
1315
    }
1316
 
1317
    public void deleteCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<deleteCoupon_call> resultHandler) throws org.apache.thrift.TException {
1318
      checkReady();
1319
      deleteCoupon_call method_call = new deleteCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
1320
      this.___currentMethod = method_call;
1321
      ___manager.call(method_call);
1322
    }
1323
 
1324
    public static class deleteCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1325
      private String couponCode;
1326
      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 {
1327
        super(client, protocolFactory, transport, resultHandler, false);
1328
        this.couponCode = couponCode;
1329
      }
1330
 
1331
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1332
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1333
        deleteCoupon_args args = new deleteCoupon_args();
1334
        args.setCouponCode(couponCode);
1335
        args.write(prot);
1336
        prot.writeMessageEnd();
1337
      }
1338
 
1339
      public void getResult() throws PromotionException, org.apache.thrift.TException {
1340
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1341
          throw new IllegalStateException("Method call not finished!");
1342
        }
1343
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1344
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1345
        (new Client(prot)).recv_deleteCoupon();
1346
      }
1347
    }
1348
 
7092 amit.gupta 1349
    public void getAllCouponsByPromotionId(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getAllCouponsByPromotionId_call> resultHandler) throws org.apache.thrift.TException {
1350
      checkReady();
1351
      getAllCouponsByPromotionId_call method_call = new getAllCouponsByPromotionId_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
1352
      this.___currentMethod = method_call;
1353
      ___manager.call(method_call);
1354
    }
1355
 
1356
    public static class getAllCouponsByPromotionId_call extends org.apache.thrift.async.TAsyncMethodCall {
1357
      private long promotionId;
1358
      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 {
1359
        super(client, protocolFactory, transport, resultHandler, false);
1360
        this.promotionId = promotionId;
1361
      }
1362
 
1363
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1364
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllCouponsByPromotionId", org.apache.thrift.protocol.TMessageType.CALL, 0));
1365
        getAllCouponsByPromotionId_args args = new getAllCouponsByPromotionId_args();
1366
        args.setPromotionId(promotionId);
1367
        args.write(prot);
1368
        prot.writeMessageEnd();
1369
      }
1370
 
1371
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
1372
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1373
          throw new IllegalStateException("Method call not finished!");
1374
        }
1375
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1376
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1377
        return (new Client(prot)).recv_getAllCouponsByPromotionId();
1378
      }
1379
    }
1380
 
3430 rajveer 1381
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException {
1382
      checkReady();
1383
      getActiveCoupons_call method_call = new getActiveCoupons_call(resultHandler, this, ___protocolFactory, ___transport);
1384
      this.___currentMethod = method_call;
1385
      ___manager.call(method_call);
1982 varun.gupt 1386
    }
1387
 
3430 rajveer 1388
    public static class getActiveCoupons_call extends org.apache.thrift.async.TAsyncMethodCall {
1389
      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 {
1390
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 1391
      }
1392
 
3430 rajveer 1393
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1394
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getActiveCoupons", org.apache.thrift.protocol.TMessageType.CALL, 0));
1395
        getActiveCoupons_args args = new getActiveCoupons_args();
1396
        args.write(prot);
1397
        prot.writeMessageEnd();
1398
      }
1982 varun.gupt 1399
 
3430 rajveer 1400
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
1401
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1402
          throw new IllegalStateException("Method call not finished!");
1403
        }
1404
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1405
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1406
        return (new Client(prot)).recv_getActiveCoupons();
1982 varun.gupt 1407
      }
1408
    }
1409
 
8707 manish.sha 1410
    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 1411
      checkReady();
8707 manish.sha 1412
      createCoupon_call method_call = new createCoupon_call(promotionId, couponCategory, couponCode, arguments, isCod, prefix, resultHandler, this, ___protocolFactory, ___transport);
6250 amit.gupta 1413
      this.___currentMethod = method_call;
1414
      ___manager.call(method_call);
1415
    }
1416
 
1417
    public static class createCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1418
      private long promotionId;
8707 manish.sha 1419
      private long couponCategory;
6730 anupam.sin 1420
      private String couponCode;
6679 anupam.sin 1421
      private String arguments;
6356 amit.gupta 1422
      private boolean isCod;
6561 amit.gupta 1423
      private String prefix;
8707 manish.sha 1424
      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 1425
        super(client, protocolFactory, transport, resultHandler, false);
1426
        this.promotionId = promotionId;
8707 manish.sha 1427
        this.couponCategory = couponCategory;
6730 anupam.sin 1428
        this.couponCode = couponCode;
6679 anupam.sin 1429
        this.arguments = arguments;
6356 amit.gupta 1430
        this.isCod = isCod;
6561 amit.gupta 1431
        this.prefix = prefix;
6250 amit.gupta 1432
      }
1433
 
1434
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1435
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1436
        createCoupon_args args = new createCoupon_args();
1437
        args.setPromotionId(promotionId);
8707 manish.sha 1438
        args.setCouponCategory(couponCategory);
6730 anupam.sin 1439
        args.setCouponCode(couponCode);
6679 anupam.sin 1440
        args.setArguments(arguments);
6356 amit.gupta 1441
        args.setIsCod(isCod);
6561 amit.gupta 1442
        args.setPrefix(prefix);
6250 amit.gupta 1443
        args.write(prot);
1444
        prot.writeMessageEnd();
1445
      }
1446
 
1447
      public String getResult() throws PromotionException, org.apache.thrift.TException {
1448
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1449
          throw new IllegalStateException("Method call not finished!");
1450
        }
1451
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1452
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1453
        return (new Client(prot)).recv_createCoupon();
1454
      }
1455
    }
1456
 
3430 rajveer 1457
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException {
1458
      checkReady();
1459
      getSuccessfulPaymentCountForCoupon_call method_call = new getSuccessfulPaymentCountForCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
1460
      this.___currentMethod = method_call;
1461
      ___manager.call(method_call);
1982 varun.gupt 1462
    }
1463
 
3430 rajveer 1464
    public static class getSuccessfulPaymentCountForCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1465
      private String couponCode;
1466
      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 {
1467
        super(client, protocolFactory, transport, resultHandler, false);
1468
        this.couponCode = couponCode;
1982 varun.gupt 1469
      }
1470
 
3430 rajveer 1471
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1472
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSuccessfulPaymentCountForCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1473
        getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
1474
        args.setCouponCode(couponCode);
1475
        args.write(prot);
1476
        prot.writeMessageEnd();
1477
      }
1982 varun.gupt 1478
 
3430 rajveer 1479
      public long getResult() throws PromotionException, org.apache.thrift.TException {
1480
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1481
          throw new IllegalStateException("Method call not finished!");
1482
        }
1483
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1484
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1485
        return (new Client(prot)).recv_getSuccessfulPaymentCountForCoupon();
1486
      }
1982 varun.gupt 1487
    }
1488
 
3430 rajveer 1489
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<getRuleDocString_call> resultHandler) throws org.apache.thrift.TException {
1490
      checkReady();
1491
      getRuleDocString_call method_call = new getRuleDocString_call(ruleName, resultHandler, this, ___protocolFactory, ___transport);
1492
      this.___currentMethod = method_call;
1493
      ___manager.call(method_call);
1982 varun.gupt 1494
    }
1495
 
3430 rajveer 1496
    public static class getRuleDocString_call extends org.apache.thrift.async.TAsyncMethodCall {
1497
      private String ruleName;
1498
      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 {
1499
        super(client, protocolFactory, transport, resultHandler, false);
1500
        this.ruleName = ruleName;
1501
      }
1982 varun.gupt 1502
 
3430 rajveer 1503
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1504
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRuleDocString", org.apache.thrift.protocol.TMessageType.CALL, 0));
1505
        getRuleDocString_args args = new getRuleDocString_args();
1506
        args.setRuleName(ruleName);
1507
        args.write(prot);
1508
        prot.writeMessageEnd();
1982 varun.gupt 1509
      }
1510
 
3430 rajveer 1511
      public String getResult() throws org.apache.thrift.TException {
1512
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1513
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 1514
        }
3430 rajveer 1515
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1516
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1517
        return (new Client(prot)).recv_getRuleDocString();
1982 varun.gupt 1518
      }
1519
    }
1520
 
4189 varun.gupt 1521
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException {
1522
      checkReady();
1523
      getItemDiscountMap_call method_call = new getItemDiscountMap_call(itemIds, resultHandler, this, ___protocolFactory, ___transport);
1524
      this.___currentMethod = method_call;
1525
      ___manager.call(method_call);
1526
    }
1527
 
1528
    public static class getItemDiscountMap_call extends org.apache.thrift.async.TAsyncMethodCall {
1529
      private List<Long> itemIds;
1530
      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 {
1531
        super(client, protocolFactory, transport, resultHandler, false);
1532
        this.itemIds = itemIds;
1533
      }
1534
 
1535
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1536
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getItemDiscountMap", org.apache.thrift.protocol.TMessageType.CALL, 0));
1537
        getItemDiscountMap_args args = new getItemDiscountMap_args();
1538
        args.setItemIds(itemIds);
1539
        args.write(prot);
1540
        prot.writeMessageEnd();
1541
      }
1542
 
1543
      public List<ItemCouponDiscount> getResult() throws PromotionException, org.apache.thrift.TException {
1544
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1545
          throw new IllegalStateException("Method call not finished!");
1546
        }
1547
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1548
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1549
        return (new Client(prot)).recv_getItemDiscountMap();
1550
      }
1551
    }
1552
 
4494 varun.gupt 1553
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException {
1554
      checkReady();
1555
      getDiscountsForEntity_call method_call = new getDiscountsForEntity_call(entityId, resultHandler, this, ___protocolFactory, ___transport);
1556
      this.___currentMethod = method_call;
1557
      ___manager.call(method_call);
1558
    }
1559
 
1560
    public static class getDiscountsForEntity_call extends org.apache.thrift.async.TAsyncMethodCall {
1561
      private long entityId;
1562
      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 {
1563
        super(client, protocolFactory, transport, resultHandler, false);
1564
        this.entityId = entityId;
1565
      }
1566
 
1567
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1568
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getDiscountsForEntity", org.apache.thrift.protocol.TMessageType.CALL, 0));
1569
        getDiscountsForEntity_args args = new getDiscountsForEntity_args();
1570
        args.setEntityId(entityId);
1571
        args.write(prot);
1572
        prot.writeMessageEnd();
1573
      }
1574
 
1575
      public Map<String,Double> getResult() throws org.apache.thrift.TException {
1576
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1577
          throw new IllegalStateException("Method call not finished!");
1578
        }
1579
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1580
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1581
        return (new Client(prot)).recv_getDiscountsForEntity();
1582
      }
1583
    }
1584
 
5469 rajveer 1585
    public void addVoucher(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<addVoucher_call> resultHandler) throws org.apache.thrift.TException {
1586
      checkReady();
1587
      addVoucher_call method_call = new addVoucher_call(voucher, resultHandler, this, ___protocolFactory, ___transport);
1588
      this.___currentMethod = method_call;
1589
      ___manager.call(method_call);
1590
    }
1591
 
1592
    public static class addVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
1593
      private Voucher voucher;
1594
      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 {
1595
        super(client, protocolFactory, transport, resultHandler, false);
1596
        this.voucher = voucher;
1597
      }
1598
 
1599
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1600
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
1601
        addVoucher_args args = new addVoucher_args();
1602
        args.setVoucher(voucher);
1603
        args.write(prot);
1604
        prot.writeMessageEnd();
1605
      }
1606
 
1607
      public void getResult() throws org.apache.thrift.TException {
1608
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1609
          throw new IllegalStateException("Method call not finished!");
1610
        }
1611
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1612
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1613
        (new Client(prot)).recv_addVoucher();
1614
      }
1615
    }
1616
 
1617
    public void assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount, org.apache.thrift.async.AsyncMethodCallback<assignVoucher_call> resultHandler) throws org.apache.thrift.TException {
1618
      checkReady();
1619
      assignVoucher_call method_call = new assignVoucher_call(userId, userEmail, voucherType, amount, resultHandler, this, ___protocolFactory, ___transport);
1620
      this.___currentMethod = method_call;
1621
      ___manager.call(method_call);
1622
    }
1623
 
1624
    public static class assignVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
1625
      private long userId;
1626
      private String userEmail;
1627
      private VoucherType voucherType;
1628
      private long amount;
1629
      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 {
1630
        super(client, protocolFactory, transport, resultHandler, false);
1631
        this.userId = userId;
1632
        this.userEmail = userEmail;
1633
        this.voucherType = voucherType;
1634
        this.amount = amount;
1635
      }
1636
 
1637
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1638
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("assignVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
1639
        assignVoucher_args args = new assignVoucher_args();
1640
        args.setUserId(userId);
1641
        args.setUserEmail(userEmail);
1642
        args.setVoucherType(voucherType);
1643
        args.setAmount(amount);
1644
        args.write(prot);
1645
        prot.writeMessageEnd();
1646
      }
1647
 
1648
      public Voucher getResult() throws org.apache.thrift.TException {
1649
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1650
          throw new IllegalStateException("Method call not finished!");
1651
        }
1652
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1653
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1654
        return (new Client(prot)).recv_assignVoucher();
1655
      }
1656
    }
1657
 
1658
    public void markVoucherAsRedeemed(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<markVoucherAsRedeemed_call> resultHandler) throws org.apache.thrift.TException {
1659
      checkReady();
1660
      markVoucherAsRedeemed_call method_call = new markVoucherAsRedeemed_call(voucherCode, redeemedOn, resultHandler, this, ___protocolFactory, ___transport);
1661
      this.___currentMethod = method_call;
1662
      ___manager.call(method_call);
1663
    }
1664
 
1665
    public static class markVoucherAsRedeemed_call extends org.apache.thrift.async.TAsyncMethodCall {
1666
      private String voucherCode;
1667
      private long redeemedOn;
1668
      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 {
1669
        super(client, protocolFactory, transport, resultHandler, false);
1670
        this.voucherCode = voucherCode;
1671
        this.redeemedOn = redeemedOn;
1672
      }
1673
 
1674
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1675
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("markVoucherAsRedeemed", org.apache.thrift.protocol.TMessageType.CALL, 0));
1676
        markVoucherAsRedeemed_args args = new markVoucherAsRedeemed_args();
1677
        args.setVoucherCode(voucherCode);
1678
        args.setRedeemedOn(redeemedOn);
1679
        args.write(prot);
1680
        prot.writeMessageEnd();
1681
      }
1682
 
1683
      public boolean getResult() throws org.apache.thrift.TException {
1684
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1685
          throw new IllegalStateException("Method call not finished!");
1686
        }
1687
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1688
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1689
        return (new Client(prot)).recv_markVoucherAsRedeemed();
1690
      }
1691
    }
1692
 
3430 rajveer 1693
  }
1982 varun.gupt 1694
 
3430 rajveer 1695
  public static class Processor<I extends Iface> extends in.shop2020.generic.GenericService.Processor implements org.apache.thrift.TProcessor {
1696
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
1697
    public Processor(I iface) {
1698
      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
1982 varun.gupt 1699
    }
1700
 
3430 rajveer 1701
    protected Processor(I iface, Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
1702
      super(iface, getProcessMap(processMap));
1982 varun.gupt 1703
    }
1704
 
3430 rajveer 1705
    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) {
1706
      processMap.put("createPromotion", new createPromotion());
7746 amit.gupta 1707
      processMap.put("removeAllCouponsByPromotionId", new removeAllCouponsByPromotionId());
6301 amit.gupta 1708
      processMap.put("getCoupon", new getCoupon());
1709
      processMap.put("isGiftVoucher", new isGiftVoucher());
6356 amit.gupta 1710
      processMap.put("isCodApplicable", new isCodApplicable());
3430 rajveer 1711
      processMap.put("getAllPromotions", new getAllPromotions());
1712
      processMap.put("getPromotionById", new getPromotionById());
1713
      processMap.put("generateCouponsForPromotion", new generateCouponsForPromotion());
1714
      processMap.put("applyCoupon", new applyCoupon());
6736 amit.gupta 1715
      processMap.put("getEmiDiscount", new getEmiDiscount());
6433 anupam.sin 1716
      processMap.put("applyRechargeCoupon", new applyRechargeCoupon());
3430 rajveer 1717
      processMap.put("trackCouponUsage", new trackCouponUsage());
1718
      processMap.put("getCouponUsageCountByUser", new getCouponUsageCountByUser());
6497 amit.gupta 1719
      processMap.put("getActiveCodes", new getActiveCodes());
1720
      processMap.put("deleteCoupon", new deleteCoupon());
7092 amit.gupta 1721
      processMap.put("getAllCouponsByPromotionId", new getAllCouponsByPromotionId());
3430 rajveer 1722
      processMap.put("getActiveCoupons", new getActiveCoupons());
6250 amit.gupta 1723
      processMap.put("createCoupon", new createCoupon());
3430 rajveer 1724
      processMap.put("getSuccessfulPaymentCountForCoupon", new getSuccessfulPaymentCountForCoupon());
1725
      processMap.put("getRuleDocString", new getRuleDocString());
4189 varun.gupt 1726
      processMap.put("getItemDiscountMap", new getItemDiscountMap());
4494 varun.gupt 1727
      processMap.put("getDiscountsForEntity", new getDiscountsForEntity());
5469 rajveer 1728
      processMap.put("addVoucher", new addVoucher());
1729
      processMap.put("assignVoucher", new assignVoucher());
1730
      processMap.put("markVoucherAsRedeemed", new markVoucherAsRedeemed());
3430 rajveer 1731
      return processMap;
1982 varun.gupt 1732
    }
1733
 
3430 rajveer 1734
    private static class createPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createPromotion_args> {
1735
      public createPromotion() {
1736
        super("createPromotion");
1737
      }
1982 varun.gupt 1738
 
3430 rajveer 1739
      protected createPromotion_args getEmptyArgsInstance() {
1740
        return new createPromotion_args();
1741
      }
1982 varun.gupt 1742
 
3430 rajveer 1743
      protected createPromotion_result getResult(I iface, createPromotion_args args) throws org.apache.thrift.TException {
1744
        createPromotion_result result = new createPromotion_result();
1745
        try {
1746
          iface.createPromotion(args.name, args.ruleExecutionSrc, args.startOn, args.endOn);
1747
        } catch (PromotionException pex) {
1748
          result.pex = pex;
1982 varun.gupt 1749
        }
3430 rajveer 1750
        return result;
1982 varun.gupt 1751
      }
3430 rajveer 1752
    }
1982 varun.gupt 1753
 
7746 amit.gupta 1754
    private static class removeAllCouponsByPromotionId<I extends Iface> extends org.apache.thrift.ProcessFunction<I, removeAllCouponsByPromotionId_args> {
1755
      public removeAllCouponsByPromotionId() {
1756
        super("removeAllCouponsByPromotionId");
1757
      }
1758
 
1759
      protected removeAllCouponsByPromotionId_args getEmptyArgsInstance() {
1760
        return new removeAllCouponsByPromotionId_args();
1761
      }
1762
 
1763
      protected removeAllCouponsByPromotionId_result getResult(I iface, removeAllCouponsByPromotionId_args args) throws org.apache.thrift.TException {
1764
        removeAllCouponsByPromotionId_result result = new removeAllCouponsByPromotionId_result();
1765
        try {
1766
          result.success = iface.removeAllCouponsByPromotionId(args.promotionId);
1767
          result.setSuccessIsSet(true);
1768
        } catch (PromotionException pex) {
1769
          result.pex = pex;
1770
        }
1771
        return result;
1772
      }
1773
    }
1774
 
6301 amit.gupta 1775
    private static class getCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCoupon_args> {
1776
      public getCoupon() {
1777
        super("getCoupon");
1778
      }
1779
 
1780
      protected getCoupon_args getEmptyArgsInstance() {
1781
        return new getCoupon_args();
1782
      }
1783
 
1784
      protected getCoupon_result getResult(I iface, getCoupon_args args) throws org.apache.thrift.TException {
1785
        getCoupon_result result = new getCoupon_result();
1786
        try {
1787
          result.success = iface.getCoupon(args.couponCode);
1788
        } catch (PromotionException pex) {
1789
          result.pex = pex;
1790
        }
1791
        return result;
1792
      }
1793
    }
1794
 
1795
    private static class isGiftVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isGiftVoucher_args> {
1796
      public isGiftVoucher() {
1797
        super("isGiftVoucher");
1798
      }
1799
 
1800
      protected isGiftVoucher_args getEmptyArgsInstance() {
1801
        return new isGiftVoucher_args();
1802
      }
1803
 
1804
      protected isGiftVoucher_result getResult(I iface, isGiftVoucher_args args) throws org.apache.thrift.TException {
1805
        isGiftVoucher_result result = new isGiftVoucher_result();
1806
        try {
1807
          result.success = iface.isGiftVoucher(args.couponCode);
1808
          result.setSuccessIsSet(true);
1809
        } catch (PromotionException pex) {
1810
          result.pex = pex;
1811
        }
1812
        return result;
1813
      }
1814
    }
1815
 
6356 amit.gupta 1816
    private static class isCodApplicable<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isCodApplicable_args> {
1817
      public isCodApplicable() {
1818
        super("isCodApplicable");
1819
      }
1820
 
1821
      protected isCodApplicable_args getEmptyArgsInstance() {
1822
        return new isCodApplicable_args();
1823
      }
1824
 
1825
      protected isCodApplicable_result getResult(I iface, isCodApplicable_args args) throws org.apache.thrift.TException {
1826
        isCodApplicable_result result = new isCodApplicable_result();
1827
        try {
11819 amit.gupta 1828
          result.success = iface.isCodApplicable(args.cart);
6356 amit.gupta 1829
          result.setSuccessIsSet(true);
1830
        } catch (PromotionException pex) {
1831
          result.pex = pex;
1832
        }
1833
        return result;
1834
      }
1835
    }
1836
 
3430 rajveer 1837
    private static class getAllPromotions<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllPromotions_args> {
1838
      public getAllPromotions() {
1839
        super("getAllPromotions");
1982 varun.gupt 1840
      }
1841
 
3430 rajveer 1842
      protected getAllPromotions_args getEmptyArgsInstance() {
1843
        return new getAllPromotions_args();
1982 varun.gupt 1844
      }
1845
 
3430 rajveer 1846
      protected getAllPromotions_result getResult(I iface, getAllPromotions_args args) throws org.apache.thrift.TException {
1847
        getAllPromotions_result result = new getAllPromotions_result();
1848
        try {
1849
          result.success = iface.getAllPromotions();
1850
        } catch (PromotionException pex) {
1851
          result.pex = pex;
1852
        }
1853
        return result;
1982 varun.gupt 1854
      }
3430 rajveer 1855
    }
1982 varun.gupt 1856
 
3430 rajveer 1857
    private static class getPromotionById<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPromotionById_args> {
1858
      public getPromotionById() {
1859
        super("getPromotionById");
1982 varun.gupt 1860
      }
1861
 
3430 rajveer 1862
      protected getPromotionById_args getEmptyArgsInstance() {
1863
        return new getPromotionById_args();
1982 varun.gupt 1864
      }
1865
 
3430 rajveer 1866
      protected getPromotionById_result getResult(I iface, getPromotionById_args args) throws org.apache.thrift.TException {
1867
        getPromotionById_result result = new getPromotionById_result();
1868
        try {
1869
          result.success = iface.getPromotionById(args.promotionId);
1870
        } catch (PromotionException pex) {
1871
          result.pex = pex;
1872
        }
1873
        return result;
1982 varun.gupt 1874
      }
1875
    }
1876
 
3430 rajveer 1877
    private static class generateCouponsForPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, generateCouponsForPromotion_args> {
1878
      public generateCouponsForPromotion() {
1879
        super("generateCouponsForPromotion");
1880
      }
1982 varun.gupt 1881
 
3430 rajveer 1882
      protected generateCouponsForPromotion_args getEmptyArgsInstance() {
1883
        return new generateCouponsForPromotion_args();
1884
      }
1982 varun.gupt 1885
 
3430 rajveer 1886
      protected generateCouponsForPromotion_result getResult(I iface, generateCouponsForPromotion_args args) throws org.apache.thrift.TException {
1887
        generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
1888
        try {
1889
          iface.generateCouponsForPromotion(args.promotionId, args.couponCode);
1890
        } catch (PromotionException pex) {
1891
          result.pex = pex;
1892
        }
1893
        return result;
1894
      }
1982 varun.gupt 1895
    }
1896
 
3430 rajveer 1897
    private static class applyCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, applyCoupon_args> {
1898
      public applyCoupon() {
1899
        super("applyCoupon");
1900
      }
1982 varun.gupt 1901
 
3430 rajveer 1902
      protected applyCoupon_args getEmptyArgsInstance() {
1903
        return new applyCoupon_args();
1904
      }
1982 varun.gupt 1905
 
3430 rajveer 1906
      protected applyCoupon_result getResult(I iface, applyCoupon_args args) throws org.apache.thrift.TException {
1907
        applyCoupon_result result = new applyCoupon_result();
1908
        try {
1909
          result.success = iface.applyCoupon(args.couponCode, args.cartId);
1910
        } catch (PromotionException pex) {
1911
          result.pex = pex;
1912
        }
1913
        return result;
1982 varun.gupt 1914
      }
1915
    }
1916
 
6736 amit.gupta 1917
    private static class getEmiDiscount<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getEmiDiscount_args> {
1918
      public getEmiDiscount() {
1919
        super("getEmiDiscount");
1920
      }
1921
 
1922
      protected getEmiDiscount_args getEmptyArgsInstance() {
1923
        return new getEmiDiscount_args();
1924
      }
1925
 
1926
      protected getEmiDiscount_result getResult(I iface, getEmiDiscount_args args) throws org.apache.thrift.TException {
1927
        getEmiDiscount_result result = new getEmiDiscount_result();
1928
        try {
1929
          result.success = iface.getEmiDiscount(args.cartId);
1930
        } catch (PromotionException pex) {
1931
          result.pex = pex;
1932
        }
1933
        return result;
1934
      }
1935
    }
1936
 
6433 anupam.sin 1937
    private static class applyRechargeCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, applyRechargeCoupon_args> {
1938
      public applyRechargeCoupon() {
1939
        super("applyRechargeCoupon");
1940
      }
1941
 
1942
      protected applyRechargeCoupon_args getEmptyArgsInstance() {
1943
        return new applyRechargeCoupon_args();
1944
      }
1945
 
1946
      protected applyRechargeCoupon_result getResult(I iface, applyRechargeCoupon_args args) throws org.apache.thrift.TException {
1947
        applyRechargeCoupon_result result = new applyRechargeCoupon_result();
1948
        try {
1949
          result.success = iface.applyRechargeCoupon(args.couponCode, args.totalAmount, args.userId);
1950
        } catch (PromotionException pex) {
1951
          result.pex = pex;
1952
        }
1953
        return result;
1954
      }
1955
    }
1956
 
3430 rajveer 1957
    private static class trackCouponUsage<I extends Iface> extends org.apache.thrift.ProcessFunction<I, trackCouponUsage_args> {
1958
      public trackCouponUsage() {
1959
        super("trackCouponUsage");
1960
      }
1982 varun.gupt 1961
 
3430 rajveer 1962
      protected trackCouponUsage_args getEmptyArgsInstance() {
1963
        return new trackCouponUsage_args();
1982 varun.gupt 1964
      }
1965
 
3430 rajveer 1966
      protected trackCouponUsage_result getResult(I iface, trackCouponUsage_args args) throws org.apache.thrift.TException {
1967
        trackCouponUsage_result result = new trackCouponUsage_result();
1968
        try {
13521 amit.gupta 1969
          iface.trackCouponUsage(args.couponCode, args.transactionId, args.userId, args.amount, args.isDigital);
3430 rajveer 1970
        } catch (PromotionException pex) {
1971
          result.pex = pex;
1972
        }
1973
        return result;
1974
      }
1982 varun.gupt 1975
    }
1976
 
3430 rajveer 1977
    private static class getCouponUsageCountByUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCouponUsageCountByUser_args> {
1978
      public getCouponUsageCountByUser() {
1979
        super("getCouponUsageCountByUser");
1982 varun.gupt 1980
      }
1981
 
3430 rajveer 1982
      protected getCouponUsageCountByUser_args getEmptyArgsInstance() {
1983
        return new getCouponUsageCountByUser_args();
1984
      }
1982 varun.gupt 1985
 
3430 rajveer 1986
      protected getCouponUsageCountByUser_result getResult(I iface, getCouponUsageCountByUser_args args) throws org.apache.thrift.TException {
1987
        getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
1988
        try {
1989
          result.success = iface.getCouponUsageCountByUser(args.couponCode, args.userId);
1990
          result.setSuccessIsSet(true);
1991
        } catch (PromotionException pex) {
1992
          result.pex = pex;
1993
        }
1994
        return result;
1995
      }
1982 varun.gupt 1996
    }
1997
 
6497 amit.gupta 1998
    private static class getActiveCodes<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getActiveCodes_args> {
1999
      public getActiveCodes() {
2000
        super("getActiveCodes");
2001
      }
2002
 
2003
      protected getActiveCodes_args getEmptyArgsInstance() {
2004
        return new getActiveCodes_args();
2005
      }
2006
 
2007
      protected getActiveCodes_result getResult(I iface, getActiveCodes_args args) throws org.apache.thrift.TException {
2008
        getActiveCodes_result result = new getActiveCodes_result();
2009
        try {
2010
          result.success = iface.getActiveCodes(args.promotionId);
2011
        } catch (PromotionException pex) {
2012
          result.pex = pex;
2013
        }
2014
        return result;
2015
      }
2016
    }
2017
 
2018
    private static class deleteCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, deleteCoupon_args> {
2019
      public deleteCoupon() {
2020
        super("deleteCoupon");
2021
      }
2022
 
2023
      protected deleteCoupon_args getEmptyArgsInstance() {
2024
        return new deleteCoupon_args();
2025
      }
2026
 
2027
      protected deleteCoupon_result getResult(I iface, deleteCoupon_args args) throws org.apache.thrift.TException {
2028
        deleteCoupon_result result = new deleteCoupon_result();
2029
        try {
2030
          iface.deleteCoupon(args.couponCode);
2031
        } catch (PromotionException pex) {
2032
          result.pex = pex;
2033
        }
2034
        return result;
2035
      }
2036
    }
2037
 
7092 amit.gupta 2038
    private static class getAllCouponsByPromotionId<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllCouponsByPromotionId_args> {
2039
      public getAllCouponsByPromotionId() {
2040
        super("getAllCouponsByPromotionId");
2041
      }
2042
 
2043
      protected getAllCouponsByPromotionId_args getEmptyArgsInstance() {
2044
        return new getAllCouponsByPromotionId_args();
2045
      }
2046
 
2047
      protected getAllCouponsByPromotionId_result getResult(I iface, getAllCouponsByPromotionId_args args) throws org.apache.thrift.TException {
2048
        getAllCouponsByPromotionId_result result = new getAllCouponsByPromotionId_result();
2049
        try {
2050
          result.success = iface.getAllCouponsByPromotionId(args.promotionId);
2051
        } catch (PromotionException pex) {
2052
          result.pex = pex;
2053
        }
2054
        return result;
2055
      }
2056
    }
2057
 
3430 rajveer 2058
    private static class getActiveCoupons<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getActiveCoupons_args> {
2059
      public getActiveCoupons() {
2060
        super("getActiveCoupons");
2061
      }
1982 varun.gupt 2062
 
3430 rajveer 2063
      protected getActiveCoupons_args getEmptyArgsInstance() {
2064
        return new getActiveCoupons_args();
2065
      }
1982 varun.gupt 2066
 
3430 rajveer 2067
      protected getActiveCoupons_result getResult(I iface, getActiveCoupons_args args) throws org.apache.thrift.TException {
2068
        getActiveCoupons_result result = new getActiveCoupons_result();
2069
        try {
2070
          result.success = iface.getActiveCoupons();
2071
        } catch (PromotionException pex) {
2072
          result.pex = pex;
2073
        }
2074
        return result;
2075
      }
1982 varun.gupt 2076
    }
2077
 
6250 amit.gupta 2078
    private static class createCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createCoupon_args> {
2079
      public createCoupon() {
2080
        super("createCoupon");
2081
      }
2082
 
2083
      protected createCoupon_args getEmptyArgsInstance() {
2084
        return new createCoupon_args();
2085
      }
2086
 
2087
      protected createCoupon_result getResult(I iface, createCoupon_args args) throws org.apache.thrift.TException {
2088
        createCoupon_result result = new createCoupon_result();
2089
        try {
8707 manish.sha 2090
          result.success = iface.createCoupon(args.promotionId, args.couponCategory, args.couponCode, args.arguments, args.isCod, args.prefix);
6250 amit.gupta 2091
        } catch (PromotionException pex) {
2092
          result.pex = pex;
2093
        }
2094
        return result;
2095
      }
2096
    }
2097
 
3430 rajveer 2098
    private static class getSuccessfulPaymentCountForCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSuccessfulPaymentCountForCoupon_args> {
2099
      public getSuccessfulPaymentCountForCoupon() {
2100
        super("getSuccessfulPaymentCountForCoupon");
1982 varun.gupt 2101
      }
2102
 
3430 rajveer 2103
      protected getSuccessfulPaymentCountForCoupon_args getEmptyArgsInstance() {
2104
        return new getSuccessfulPaymentCountForCoupon_args();
2105
      }
1982 varun.gupt 2106
 
3430 rajveer 2107
      protected getSuccessfulPaymentCountForCoupon_result getResult(I iface, getSuccessfulPaymentCountForCoupon_args args) throws org.apache.thrift.TException {
2108
        getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
2109
        try {
2110
          result.success = iface.getSuccessfulPaymentCountForCoupon(args.couponCode);
2111
          result.setSuccessIsSet(true);
2112
        } catch (PromotionException pex) {
2113
          result.pex = pex;
1982 varun.gupt 2114
        }
3430 rajveer 2115
        return result;
1982 varun.gupt 2116
      }
2117
    }
2118
 
3430 rajveer 2119
    private static class getRuleDocString<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getRuleDocString_args> {
2120
      public getRuleDocString() {
2121
        super("getRuleDocString");
2122
      }
1982 varun.gupt 2123
 
3430 rajveer 2124
      protected getRuleDocString_args getEmptyArgsInstance() {
2125
        return new getRuleDocString_args();
2126
      }
1982 varun.gupt 2127
 
3430 rajveer 2128
      protected getRuleDocString_result getResult(I iface, getRuleDocString_args args) throws org.apache.thrift.TException {
2129
        getRuleDocString_result result = new getRuleDocString_result();
2130
        result.success = iface.getRuleDocString(args.ruleName);
2131
        return result;
2132
      }
1982 varun.gupt 2133
    }
2134
 
4189 varun.gupt 2135
    private static class getItemDiscountMap<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getItemDiscountMap_args> {
2136
      public getItemDiscountMap() {
2137
        super("getItemDiscountMap");
2138
      }
2139
 
2140
      protected getItemDiscountMap_args getEmptyArgsInstance() {
2141
        return new getItemDiscountMap_args();
2142
      }
2143
 
2144
      protected getItemDiscountMap_result getResult(I iface, getItemDiscountMap_args args) throws org.apache.thrift.TException {
2145
        getItemDiscountMap_result result = new getItemDiscountMap_result();
2146
        try {
2147
          result.success = iface.getItemDiscountMap(args.itemIds);
2148
        } catch (PromotionException pex) {
2149
          result.pex = pex;
2150
        }
2151
        return result;
2152
      }
2153
    }
2154
 
4494 varun.gupt 2155
    private static class getDiscountsForEntity<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getDiscountsForEntity_args> {
2156
      public getDiscountsForEntity() {
2157
        super("getDiscountsForEntity");
2158
      }
2159
 
2160
      protected getDiscountsForEntity_args getEmptyArgsInstance() {
2161
        return new getDiscountsForEntity_args();
2162
      }
2163
 
2164
      protected getDiscountsForEntity_result getResult(I iface, getDiscountsForEntity_args args) throws org.apache.thrift.TException {
2165
        getDiscountsForEntity_result result = new getDiscountsForEntity_result();
2166
        result.success = iface.getDiscountsForEntity(args.entityId);
2167
        return result;
2168
      }
2169
    }
2170
 
5469 rajveer 2171
    private static class addVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addVoucher_args> {
2172
      public addVoucher() {
2173
        super("addVoucher");
2174
      }
2175
 
2176
      protected addVoucher_args getEmptyArgsInstance() {
2177
        return new addVoucher_args();
2178
      }
2179
 
2180
      protected addVoucher_result getResult(I iface, addVoucher_args args) throws org.apache.thrift.TException {
2181
        addVoucher_result result = new addVoucher_result();
2182
        iface.addVoucher(args.voucher);
2183
        return result;
2184
      }
2185
    }
2186
 
2187
    private static class assignVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, assignVoucher_args> {
2188
      public assignVoucher() {
2189
        super("assignVoucher");
2190
      }
2191
 
2192
      protected assignVoucher_args getEmptyArgsInstance() {
2193
        return new assignVoucher_args();
2194
      }
2195
 
2196
      protected assignVoucher_result getResult(I iface, assignVoucher_args args) throws org.apache.thrift.TException {
2197
        assignVoucher_result result = new assignVoucher_result();
2198
        result.success = iface.assignVoucher(args.userId, args.userEmail, args.voucherType, args.amount);
2199
        return result;
2200
      }
2201
    }
2202
 
2203
    private static class markVoucherAsRedeemed<I extends Iface> extends org.apache.thrift.ProcessFunction<I, markVoucherAsRedeemed_args> {
2204
      public markVoucherAsRedeemed() {
2205
        super("markVoucherAsRedeemed");
2206
      }
2207
 
2208
      protected markVoucherAsRedeemed_args getEmptyArgsInstance() {
2209
        return new markVoucherAsRedeemed_args();
2210
      }
2211
 
2212
      protected markVoucherAsRedeemed_result getResult(I iface, markVoucherAsRedeemed_args args) throws org.apache.thrift.TException {
2213
        markVoucherAsRedeemed_result result = new markVoucherAsRedeemed_result();
2214
        result.success = iface.markVoucherAsRedeemed(args.voucherCode, args.redeemedOn);
2215
        result.setSuccessIsSet(true);
2216
        return result;
2217
      }
2218
    }
2219
 
1982 varun.gupt 2220
  }
2221
 
3430 rajveer 2222
  public static class createPromotion_args implements org.apache.thrift.TBase<createPromotion_args, createPromotion_args._Fields>, java.io.Serializable, Cloneable   {
2223
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_args");
1982 varun.gupt 2224
 
3430 rajveer 2225
    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);
2226
    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);
2227
    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);
2228
    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 2229
 
3430 rajveer 2230
    private String name; // required
2231
    private String ruleExecutionSrc; // required
2232
    private long startOn; // required
2233
    private long endOn; // required
1982 varun.gupt 2234
 
2235
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2236
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2237
      NAME((short)1, "name"),
2238
      RULE_EXECUTION_SRC((short)2, "ruleExecutionSrc"),
2239
      START_ON((short)3, "startOn"),
2240
      END_ON((short)4, "endOn");
2241
 
2242
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2243
 
2244
      static {
2245
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2246
          byName.put(field.getFieldName(), field);
2247
        }
2248
      }
2249
 
2250
      /**
2251
       * Find the _Fields constant that matches fieldId, or null if its not found.
2252
       */
2253
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2254
        switch(fieldId) {
2255
          case 1: // NAME
2256
            return NAME;
2257
          case 2: // RULE_EXECUTION_SRC
2258
            return RULE_EXECUTION_SRC;
2259
          case 3: // START_ON
2260
            return START_ON;
2261
          case 4: // END_ON
2262
            return END_ON;
2263
          default:
2264
            return null;
2265
        }
1982 varun.gupt 2266
      }
2267
 
2268
      /**
2269
       * Find the _Fields constant that matches fieldId, throwing an exception
2270
       * if it is not found.
2271
       */
2272
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2273
        _Fields fields = findByThriftId(fieldId);
2274
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2275
        return fields;
2276
      }
2277
 
2278
      /**
2279
       * Find the _Fields constant that matches name, or null if its not found.
2280
       */
2281
      public static _Fields findByName(String name) {
2282
        return byName.get(name);
2283
      }
2284
 
2285
      private final short _thriftId;
2286
      private final String _fieldName;
2287
 
2288
      _Fields(short thriftId, String fieldName) {
2289
        _thriftId = thriftId;
2290
        _fieldName = fieldName;
2291
      }
2292
 
2293
      public short getThriftFieldId() {
2294
        return _thriftId;
2295
      }
2296
 
2297
      public String getFieldName() {
2298
        return _fieldName;
2299
      }
2300
    }
2301
 
2302
    // isset id assignments
2303
    private static final int __STARTON_ISSET_ID = 0;
2304
    private static final int __ENDON_ISSET_ID = 1;
2305
    private BitSet __isset_bit_vector = new BitSet(2);
2306
 
3430 rajveer 2307
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2308
    static {
3430 rajveer 2309
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2310
      tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2311
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
2312
      tmpMap.put(_Fields.RULE_EXECUTION_SRC, new org.apache.thrift.meta_data.FieldMetaData("ruleExecutionSrc", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2313
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
2314
      tmpMap.put(_Fields.START_ON, new org.apache.thrift.meta_data.FieldMetaData("startOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2315
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
2316
      tmpMap.put(_Fields.END_ON, new org.apache.thrift.meta_data.FieldMetaData("endOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2317
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
2318
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2319
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_args.class, metaDataMap);
1982 varun.gupt 2320
    }
2321
 
2322
    public createPromotion_args() {
2323
    }
2324
 
2325
    public createPromotion_args(
2326
      String name,
2327
      String ruleExecutionSrc,
2328
      long startOn,
2329
      long endOn)
2330
    {
2331
      this();
2332
      this.name = name;
2333
      this.ruleExecutionSrc = ruleExecutionSrc;
2334
      this.startOn = startOn;
2335
      setStartOnIsSet(true);
2336
      this.endOn = endOn;
2337
      setEndOnIsSet(true);
2338
    }
2339
 
2340
    /**
2341
     * Performs a deep copy on <i>other</i>.
2342
     */
2343
    public createPromotion_args(createPromotion_args other) {
2344
      __isset_bit_vector.clear();
2345
      __isset_bit_vector.or(other.__isset_bit_vector);
2346
      if (other.isSetName()) {
2347
        this.name = other.name;
2348
      }
2349
      if (other.isSetRuleExecutionSrc()) {
2350
        this.ruleExecutionSrc = other.ruleExecutionSrc;
2351
      }
2352
      this.startOn = other.startOn;
2353
      this.endOn = other.endOn;
2354
    }
2355
 
2356
    public createPromotion_args deepCopy() {
2357
      return new createPromotion_args(this);
2358
    }
2359
 
3430 rajveer 2360
    @Override
2361
    public void clear() {
2362
      this.name = null;
2363
      this.ruleExecutionSrc = null;
2364
      setStartOnIsSet(false);
2365
      this.startOn = 0;
2366
      setEndOnIsSet(false);
2367
      this.endOn = 0;
1982 varun.gupt 2368
    }
2369
 
2370
    public String getName() {
2371
      return this.name;
2372
    }
2373
 
3430 rajveer 2374
    public void setName(String name) {
1982 varun.gupt 2375
      this.name = name;
2376
    }
2377
 
2378
    public void unsetName() {
2379
      this.name = null;
2380
    }
2381
 
3430 rajveer 2382
    /** Returns true if field name is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2383
    public boolean isSetName() {
2384
      return this.name != null;
2385
    }
2386
 
2387
    public void setNameIsSet(boolean value) {
2388
      if (!value) {
2389
        this.name = null;
2390
      }
2391
    }
2392
 
2393
    public String getRuleExecutionSrc() {
2394
      return this.ruleExecutionSrc;
2395
    }
2396
 
3430 rajveer 2397
    public void setRuleExecutionSrc(String ruleExecutionSrc) {
1982 varun.gupt 2398
      this.ruleExecutionSrc = ruleExecutionSrc;
2399
    }
2400
 
2401
    public void unsetRuleExecutionSrc() {
2402
      this.ruleExecutionSrc = null;
2403
    }
2404
 
3430 rajveer 2405
    /** Returns true if field ruleExecutionSrc is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2406
    public boolean isSetRuleExecutionSrc() {
2407
      return this.ruleExecutionSrc != null;
2408
    }
2409
 
2410
    public void setRuleExecutionSrcIsSet(boolean value) {
2411
      if (!value) {
2412
        this.ruleExecutionSrc = null;
2413
      }
2414
    }
2415
 
2416
    public long getStartOn() {
2417
      return this.startOn;
2418
    }
2419
 
3430 rajveer 2420
    public void setStartOn(long startOn) {
1982 varun.gupt 2421
      this.startOn = startOn;
2422
      setStartOnIsSet(true);
2423
    }
2424
 
2425
    public void unsetStartOn() {
2426
      __isset_bit_vector.clear(__STARTON_ISSET_ID);
2427
    }
2428
 
3430 rajveer 2429
    /** Returns true if field startOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2430
    public boolean isSetStartOn() {
2431
      return __isset_bit_vector.get(__STARTON_ISSET_ID);
2432
    }
2433
 
2434
    public void setStartOnIsSet(boolean value) {
2435
      __isset_bit_vector.set(__STARTON_ISSET_ID, value);
2436
    }
2437
 
2438
    public long getEndOn() {
2439
      return this.endOn;
2440
    }
2441
 
3430 rajveer 2442
    public void setEndOn(long endOn) {
1982 varun.gupt 2443
      this.endOn = endOn;
2444
      setEndOnIsSet(true);
2445
    }
2446
 
2447
    public void unsetEndOn() {
2448
      __isset_bit_vector.clear(__ENDON_ISSET_ID);
2449
    }
2450
 
3430 rajveer 2451
    /** Returns true if field endOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2452
    public boolean isSetEndOn() {
2453
      return __isset_bit_vector.get(__ENDON_ISSET_ID);
2454
    }
2455
 
2456
    public void setEndOnIsSet(boolean value) {
2457
      __isset_bit_vector.set(__ENDON_ISSET_ID, value);
2458
    }
2459
 
2460
    public void setFieldValue(_Fields field, Object value) {
2461
      switch (field) {
2462
      case NAME:
2463
        if (value == null) {
2464
          unsetName();
2465
        } else {
2466
          setName((String)value);
2467
        }
2468
        break;
2469
 
2470
      case RULE_EXECUTION_SRC:
2471
        if (value == null) {
2472
          unsetRuleExecutionSrc();
2473
        } else {
2474
          setRuleExecutionSrc((String)value);
2475
        }
2476
        break;
2477
 
2478
      case START_ON:
2479
        if (value == null) {
2480
          unsetStartOn();
2481
        } else {
2482
          setStartOn((Long)value);
2483
        }
2484
        break;
2485
 
2486
      case END_ON:
2487
        if (value == null) {
2488
          unsetEndOn();
2489
        } else {
2490
          setEndOn((Long)value);
2491
        }
2492
        break;
2493
 
2494
      }
2495
    }
2496
 
2497
    public Object getFieldValue(_Fields field) {
2498
      switch (field) {
2499
      case NAME:
2500
        return getName();
2501
 
2502
      case RULE_EXECUTION_SRC:
2503
        return getRuleExecutionSrc();
2504
 
2505
      case START_ON:
3430 rajveer 2506
        return Long.valueOf(getStartOn());
1982 varun.gupt 2507
 
2508
      case END_ON:
3430 rajveer 2509
        return Long.valueOf(getEndOn());
1982 varun.gupt 2510
 
2511
      }
2512
      throw new IllegalStateException();
2513
    }
2514
 
3430 rajveer 2515
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2516
    public boolean isSet(_Fields field) {
2517
      if (field == null) {
2518
        throw new IllegalArgumentException();
2519
      }
1982 varun.gupt 2520
 
2521
      switch (field) {
2522
      case NAME:
2523
        return isSetName();
2524
      case RULE_EXECUTION_SRC:
2525
        return isSetRuleExecutionSrc();
2526
      case START_ON:
2527
        return isSetStartOn();
2528
      case END_ON:
2529
        return isSetEndOn();
2530
      }
2531
      throw new IllegalStateException();
2532
    }
2533
 
2534
    @Override
2535
    public boolean equals(Object that) {
2536
      if (that == null)
2537
        return false;
2538
      if (that instanceof createPromotion_args)
2539
        return this.equals((createPromotion_args)that);
2540
      return false;
2541
    }
2542
 
2543
    public boolean equals(createPromotion_args that) {
2544
      if (that == null)
2545
        return false;
2546
 
2547
      boolean this_present_name = true && this.isSetName();
2548
      boolean that_present_name = true && that.isSetName();
2549
      if (this_present_name || that_present_name) {
2550
        if (!(this_present_name && that_present_name))
2551
          return false;
2552
        if (!this.name.equals(that.name))
2553
          return false;
2554
      }
2555
 
2556
      boolean this_present_ruleExecutionSrc = true && this.isSetRuleExecutionSrc();
2557
      boolean that_present_ruleExecutionSrc = true && that.isSetRuleExecutionSrc();
2558
      if (this_present_ruleExecutionSrc || that_present_ruleExecutionSrc) {
2559
        if (!(this_present_ruleExecutionSrc && that_present_ruleExecutionSrc))
2560
          return false;
2561
        if (!this.ruleExecutionSrc.equals(that.ruleExecutionSrc))
2562
          return false;
2563
      }
2564
 
2565
      boolean this_present_startOn = true;
2566
      boolean that_present_startOn = true;
2567
      if (this_present_startOn || that_present_startOn) {
2568
        if (!(this_present_startOn && that_present_startOn))
2569
          return false;
2570
        if (this.startOn != that.startOn)
2571
          return false;
2572
      }
2573
 
2574
      boolean this_present_endOn = true;
2575
      boolean that_present_endOn = true;
2576
      if (this_present_endOn || that_present_endOn) {
2577
        if (!(this_present_endOn && that_present_endOn))
2578
          return false;
2579
        if (this.endOn != that.endOn)
2580
          return false;
2581
      }
2582
 
2583
      return true;
2584
    }
2585
 
2586
    @Override
2587
    public int hashCode() {
2588
      return 0;
2589
    }
2590
 
2591
    public int compareTo(createPromotion_args other) {
2592
      if (!getClass().equals(other.getClass())) {
2593
        return getClass().getName().compareTo(other.getClass().getName());
2594
      }
2595
 
2596
      int lastComparison = 0;
2597
      createPromotion_args typedOther = (createPromotion_args)other;
2598
 
3430 rajveer 2599
      lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
1982 varun.gupt 2600
      if (lastComparison != 0) {
2601
        return lastComparison;
2602
      }
3430 rajveer 2603
      if (isSetName()) {
2604
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
2605
        if (lastComparison != 0) {
2606
          return lastComparison;
2607
        }
1982 varun.gupt 2608
      }
3430 rajveer 2609
      lastComparison = Boolean.valueOf(isSetRuleExecutionSrc()).compareTo(typedOther.isSetRuleExecutionSrc());
1982 varun.gupt 2610
      if (lastComparison != 0) {
2611
        return lastComparison;
2612
      }
3430 rajveer 2613
      if (isSetRuleExecutionSrc()) {
2614
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleExecutionSrc, typedOther.ruleExecutionSrc);
2615
        if (lastComparison != 0) {
2616
          return lastComparison;
2617
        }
1982 varun.gupt 2618
      }
3430 rajveer 2619
      lastComparison = Boolean.valueOf(isSetStartOn()).compareTo(typedOther.isSetStartOn());
1982 varun.gupt 2620
      if (lastComparison != 0) {
2621
        return lastComparison;
2622
      }
3430 rajveer 2623
      if (isSetStartOn()) {
2624
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startOn, typedOther.startOn);
2625
        if (lastComparison != 0) {
2626
          return lastComparison;
2627
        }
1982 varun.gupt 2628
      }
3430 rajveer 2629
      lastComparison = Boolean.valueOf(isSetEndOn()).compareTo(typedOther.isSetEndOn());
1982 varun.gupt 2630
      if (lastComparison != 0) {
2631
        return lastComparison;
2632
      }
3430 rajveer 2633
      if (isSetEndOn()) {
2634
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endOn, typedOther.endOn);
2635
        if (lastComparison != 0) {
2636
          return lastComparison;
2637
        }
1982 varun.gupt 2638
      }
2639
      return 0;
2640
    }
2641
 
3430 rajveer 2642
    public _Fields fieldForId(int fieldId) {
2643
      return _Fields.findByThriftId(fieldId);
2644
    }
2645
 
2646
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2647
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2648
      iprot.readStructBegin();
2649
      while (true)
2650
      {
2651
        field = iprot.readFieldBegin();
3430 rajveer 2652
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2653
          break;
2654
        }
3430 rajveer 2655
        switch (field.id) {
2656
          case 1: // NAME
2657
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
2658
              this.name = iprot.readString();
2659
            } else { 
2660
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2661
            }
2662
            break;
2663
          case 2: // RULE_EXECUTION_SRC
2664
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
2665
              this.ruleExecutionSrc = iprot.readString();
2666
            } else { 
2667
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2668
            }
2669
            break;
2670
          case 3: // START_ON
2671
            if (field.type == org.apache.thrift.protocol.TType.I64) {
2672
              this.startOn = iprot.readI64();
2673
              setStartOnIsSet(true);
2674
            } else { 
2675
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2676
            }
2677
            break;
2678
          case 4: // END_ON
2679
            if (field.type == org.apache.thrift.protocol.TType.I64) {
2680
              this.endOn = iprot.readI64();
2681
              setEndOnIsSet(true);
2682
            } else { 
2683
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2684
            }
2685
            break;
2686
          default:
2687
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2688
        }
3430 rajveer 2689
        iprot.readFieldEnd();
1982 varun.gupt 2690
      }
2691
      iprot.readStructEnd();
2692
      validate();
2693
    }
2694
 
3430 rajveer 2695
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2696
      validate();
2697
 
2698
      oprot.writeStructBegin(STRUCT_DESC);
2699
      if (this.name != null) {
2700
        oprot.writeFieldBegin(NAME_FIELD_DESC);
2701
        oprot.writeString(this.name);
2702
        oprot.writeFieldEnd();
2703
      }
2704
      if (this.ruleExecutionSrc != null) {
2705
        oprot.writeFieldBegin(RULE_EXECUTION_SRC_FIELD_DESC);
2706
        oprot.writeString(this.ruleExecutionSrc);
2707
        oprot.writeFieldEnd();
2708
      }
2709
      oprot.writeFieldBegin(START_ON_FIELD_DESC);
2710
      oprot.writeI64(this.startOn);
2711
      oprot.writeFieldEnd();
2712
      oprot.writeFieldBegin(END_ON_FIELD_DESC);
2713
      oprot.writeI64(this.endOn);
2714
      oprot.writeFieldEnd();
2715
      oprot.writeFieldStop();
2716
      oprot.writeStructEnd();
2717
    }
2718
 
2719
    @Override
2720
    public String toString() {
2721
      StringBuilder sb = new StringBuilder("createPromotion_args(");
2722
      boolean first = true;
2723
 
2724
      sb.append("name:");
2725
      if (this.name == null) {
2726
        sb.append("null");
2727
      } else {
2728
        sb.append(this.name);
2729
      }
2730
      first = false;
2731
      if (!first) sb.append(", ");
2732
      sb.append("ruleExecutionSrc:");
2733
      if (this.ruleExecutionSrc == null) {
2734
        sb.append("null");
2735
      } else {
2736
        sb.append(this.ruleExecutionSrc);
2737
      }
2738
      first = false;
2739
      if (!first) sb.append(", ");
2740
      sb.append("startOn:");
2741
      sb.append(this.startOn);
2742
      first = false;
2743
      if (!first) sb.append(", ");
2744
      sb.append("endOn:");
2745
      sb.append(this.endOn);
2746
      first = false;
2747
      sb.append(")");
2748
      return sb.toString();
2749
    }
2750
 
3430 rajveer 2751
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2752
      // check for required fields
2753
    }
2754
 
3430 rajveer 2755
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2756
      try {
2757
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2758
      } catch (org.apache.thrift.TException te) {
2759
        throw new java.io.IOException(te);
2760
      }
2761
    }
2762
 
2763
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2764
      try {
2765
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
2766
        __isset_bit_vector = new BitSet(1);
2767
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2768
      } catch (org.apache.thrift.TException te) {
2769
        throw new java.io.IOException(te);
2770
      }
2771
    }
2772
 
1982 varun.gupt 2773
  }
2774
 
3430 rajveer 2775
  public static class createPromotion_result implements org.apache.thrift.TBase<createPromotion_result, createPromotion_result._Fields>, java.io.Serializable, Cloneable   {
2776
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_result");
1982 varun.gupt 2777
 
3430 rajveer 2778
    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 2779
 
3430 rajveer 2780
    private PromotionException pex; // required
1982 varun.gupt 2781
 
2782
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2783
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2784
      PEX((short)1, "pex");
2785
 
2786
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2787
 
2788
      static {
2789
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2790
          byName.put(field.getFieldName(), field);
2791
        }
2792
      }
2793
 
2794
      /**
2795
       * Find the _Fields constant that matches fieldId, or null if its not found.
2796
       */
2797
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2798
        switch(fieldId) {
2799
          case 1: // PEX
2800
            return PEX;
2801
          default:
2802
            return null;
2803
        }
1982 varun.gupt 2804
      }
2805
 
2806
      /**
2807
       * Find the _Fields constant that matches fieldId, throwing an exception
2808
       * if it is not found.
2809
       */
2810
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2811
        _Fields fields = findByThriftId(fieldId);
2812
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2813
        return fields;
2814
      }
2815
 
2816
      /**
2817
       * Find the _Fields constant that matches name, or null if its not found.
2818
       */
2819
      public static _Fields findByName(String name) {
2820
        return byName.get(name);
2821
      }
2822
 
2823
      private final short _thriftId;
2824
      private final String _fieldName;
2825
 
2826
      _Fields(short thriftId, String fieldName) {
2827
        _thriftId = thriftId;
2828
        _fieldName = fieldName;
2829
      }
2830
 
2831
      public short getThriftFieldId() {
2832
        return _thriftId;
2833
      }
2834
 
2835
      public String getFieldName() {
2836
        return _fieldName;
2837
      }
2838
    }
2839
 
2840
    // isset id assignments
2841
 
3430 rajveer 2842
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2843
    static {
3430 rajveer 2844
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2845
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2846
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
2847
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2848
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_result.class, metaDataMap);
1982 varun.gupt 2849
    }
2850
 
2851
    public createPromotion_result() {
2852
    }
2853
 
2854
    public createPromotion_result(
2855
      PromotionException pex)
2856
    {
2857
      this();
2858
      this.pex = pex;
2859
    }
2860
 
2861
    /**
2862
     * Performs a deep copy on <i>other</i>.
2863
     */
2864
    public createPromotion_result(createPromotion_result other) {
2865
      if (other.isSetPex()) {
2866
        this.pex = new PromotionException(other.pex);
2867
      }
2868
    }
2869
 
2870
    public createPromotion_result deepCopy() {
2871
      return new createPromotion_result(this);
2872
    }
2873
 
3430 rajveer 2874
    @Override
2875
    public void clear() {
2876
      this.pex = null;
1982 varun.gupt 2877
    }
2878
 
2879
    public PromotionException getPex() {
2880
      return this.pex;
2881
    }
2882
 
3430 rajveer 2883
    public void setPex(PromotionException pex) {
1982 varun.gupt 2884
      this.pex = pex;
2885
    }
2886
 
2887
    public void unsetPex() {
2888
      this.pex = null;
2889
    }
2890
 
3430 rajveer 2891
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2892
    public boolean isSetPex() {
2893
      return this.pex != null;
2894
    }
2895
 
2896
    public void setPexIsSet(boolean value) {
2897
      if (!value) {
2898
        this.pex = null;
2899
      }
2900
    }
2901
 
2902
    public void setFieldValue(_Fields field, Object value) {
2903
      switch (field) {
2904
      case PEX:
2905
        if (value == null) {
2906
          unsetPex();
2907
        } else {
2908
          setPex((PromotionException)value);
2909
        }
2910
        break;
2911
 
2912
      }
2913
    }
2914
 
2915
    public Object getFieldValue(_Fields field) {
2916
      switch (field) {
2917
      case PEX:
2918
        return getPex();
2919
 
2920
      }
2921
      throw new IllegalStateException();
2922
    }
2923
 
3430 rajveer 2924
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2925
    public boolean isSet(_Fields field) {
2926
      if (field == null) {
2927
        throw new IllegalArgumentException();
2928
      }
1982 varun.gupt 2929
 
2930
      switch (field) {
2931
      case PEX:
2932
        return isSetPex();
2933
      }
2934
      throw new IllegalStateException();
2935
    }
2936
 
2937
    @Override
2938
    public boolean equals(Object that) {
2939
      if (that == null)
2940
        return false;
2941
      if (that instanceof createPromotion_result)
2942
        return this.equals((createPromotion_result)that);
2943
      return false;
2944
    }
2945
 
2946
    public boolean equals(createPromotion_result that) {
2947
      if (that == null)
2948
        return false;
2949
 
2950
      boolean this_present_pex = true && this.isSetPex();
2951
      boolean that_present_pex = true && that.isSetPex();
2952
      if (this_present_pex || that_present_pex) {
2953
        if (!(this_present_pex && that_present_pex))
2954
          return false;
2955
        if (!this.pex.equals(that.pex))
2956
          return false;
2957
      }
2958
 
2959
      return true;
2960
    }
2961
 
2962
    @Override
2963
    public int hashCode() {
2964
      return 0;
2965
    }
2966
 
2967
    public int compareTo(createPromotion_result other) {
2968
      if (!getClass().equals(other.getClass())) {
2969
        return getClass().getName().compareTo(other.getClass().getName());
2970
      }
2971
 
2972
      int lastComparison = 0;
2973
      createPromotion_result typedOther = (createPromotion_result)other;
2974
 
3430 rajveer 2975
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 2976
      if (lastComparison != 0) {
2977
        return lastComparison;
2978
      }
3430 rajveer 2979
      if (isSetPex()) {
2980
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
2981
        if (lastComparison != 0) {
2982
          return lastComparison;
2983
        }
1982 varun.gupt 2984
      }
2985
      return 0;
2986
    }
2987
 
3430 rajveer 2988
    public _Fields fieldForId(int fieldId) {
2989
      return _Fields.findByThriftId(fieldId);
2990
    }
2991
 
2992
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2993
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2994
      iprot.readStructBegin();
2995
      while (true)
2996
      {
2997
        field = iprot.readFieldBegin();
3430 rajveer 2998
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2999
          break;
3000
        }
3430 rajveer 3001
        switch (field.id) {
3002
          case 1: // PEX
3003
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3004
              this.pex = new PromotionException();
3005
              this.pex.read(iprot);
3006
            } else { 
3007
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3008
            }
3009
            break;
3010
          default:
3011
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 3012
        }
3430 rajveer 3013
        iprot.readFieldEnd();
1982 varun.gupt 3014
      }
3015
      iprot.readStructEnd();
3016
      validate();
3017
    }
3018
 
3430 rajveer 3019
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 3020
      oprot.writeStructBegin(STRUCT_DESC);
3021
 
3022
      if (this.isSetPex()) {
3023
        oprot.writeFieldBegin(PEX_FIELD_DESC);
3024
        this.pex.write(oprot);
3025
        oprot.writeFieldEnd();
3026
      }
3027
      oprot.writeFieldStop();
3028
      oprot.writeStructEnd();
3029
    }
3030
 
3031
    @Override
3032
    public String toString() {
3033
      StringBuilder sb = new StringBuilder("createPromotion_result(");
3034
      boolean first = true;
3035
 
3036
      sb.append("pex:");
3037
      if (this.pex == null) {
3038
        sb.append("null");
3039
      } else {
3040
        sb.append(this.pex);
3041
      }
3042
      first = false;
3043
      sb.append(")");
3044
      return sb.toString();
3045
    }
3046
 
3430 rajveer 3047
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 3048
      // check for required fields
3049
    }
3050
 
3430 rajveer 3051
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3052
      try {
3053
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3054
      } catch (org.apache.thrift.TException te) {
3055
        throw new java.io.IOException(te);
3056
      }
3057
    }
3058
 
3059
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3060
      try {
3061
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3062
      } catch (org.apache.thrift.TException te) {
3063
        throw new java.io.IOException(te);
3064
      }
3065
    }
3066
 
1982 varun.gupt 3067
  }
3068
 
7746 amit.gupta 3069
  public static class removeAllCouponsByPromotionId_args implements org.apache.thrift.TBase<removeAllCouponsByPromotionId_args, removeAllCouponsByPromotionId_args._Fields>, java.io.Serializable, Cloneable   {
3070
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("removeAllCouponsByPromotionId_args");
3071
 
3072
    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);
3073
 
3074
    private long promotionId; // required
3075
 
3076
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3077
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3078
      PROMOTION_ID((short)1, "promotionId");
3079
 
3080
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3081
 
3082
      static {
3083
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3084
          byName.put(field.getFieldName(), field);
3085
        }
3086
      }
3087
 
3088
      /**
3089
       * Find the _Fields constant that matches fieldId, or null if its not found.
3090
       */
3091
      public static _Fields findByThriftId(int fieldId) {
3092
        switch(fieldId) {
3093
          case 1: // PROMOTION_ID
3094
            return PROMOTION_ID;
3095
          default:
3096
            return null;
3097
        }
3098
      }
3099
 
3100
      /**
3101
       * Find the _Fields constant that matches fieldId, throwing an exception
3102
       * if it is not found.
3103
       */
3104
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3105
        _Fields fields = findByThriftId(fieldId);
3106
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3107
        return fields;
3108
      }
3109
 
3110
      /**
3111
       * Find the _Fields constant that matches name, or null if its not found.
3112
       */
3113
      public static _Fields findByName(String name) {
3114
        return byName.get(name);
3115
      }
3116
 
3117
      private final short _thriftId;
3118
      private final String _fieldName;
3119
 
3120
      _Fields(short thriftId, String fieldName) {
3121
        _thriftId = thriftId;
3122
        _fieldName = fieldName;
3123
      }
3124
 
3125
      public short getThriftFieldId() {
3126
        return _thriftId;
3127
      }
3128
 
3129
      public String getFieldName() {
3130
        return _fieldName;
3131
      }
3132
    }
3133
 
3134
    // isset id assignments
3135
    private static final int __PROMOTIONID_ISSET_ID = 0;
3136
    private BitSet __isset_bit_vector = new BitSet(1);
3137
 
3138
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3139
    static {
3140
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3141
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3142
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
3143
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3144
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(removeAllCouponsByPromotionId_args.class, metaDataMap);
3145
    }
3146
 
3147
    public removeAllCouponsByPromotionId_args() {
3148
    }
3149
 
3150
    public removeAllCouponsByPromotionId_args(
3151
      long promotionId)
3152
    {
3153
      this();
3154
      this.promotionId = promotionId;
3155
      setPromotionIdIsSet(true);
3156
    }
3157
 
3158
    /**
3159
     * Performs a deep copy on <i>other</i>.
3160
     */
3161
    public removeAllCouponsByPromotionId_args(removeAllCouponsByPromotionId_args other) {
3162
      __isset_bit_vector.clear();
3163
      __isset_bit_vector.or(other.__isset_bit_vector);
3164
      this.promotionId = other.promotionId;
3165
    }
3166
 
3167
    public removeAllCouponsByPromotionId_args deepCopy() {
3168
      return new removeAllCouponsByPromotionId_args(this);
3169
    }
3170
 
3171
    @Override
3172
    public void clear() {
3173
      setPromotionIdIsSet(false);
3174
      this.promotionId = 0;
3175
    }
3176
 
3177
    public long getPromotionId() {
3178
      return this.promotionId;
3179
    }
3180
 
3181
    public void setPromotionId(long promotionId) {
3182
      this.promotionId = promotionId;
3183
      setPromotionIdIsSet(true);
3184
    }
3185
 
3186
    public void unsetPromotionId() {
3187
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
3188
    }
3189
 
3190
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
3191
    public boolean isSetPromotionId() {
3192
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
3193
    }
3194
 
3195
    public void setPromotionIdIsSet(boolean value) {
3196
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
3197
    }
3198
 
3199
    public void setFieldValue(_Fields field, Object value) {
3200
      switch (field) {
3201
      case PROMOTION_ID:
3202
        if (value == null) {
3203
          unsetPromotionId();
3204
        } else {
3205
          setPromotionId((Long)value);
3206
        }
3207
        break;
3208
 
3209
      }
3210
    }
3211
 
3212
    public Object getFieldValue(_Fields field) {
3213
      switch (field) {
3214
      case PROMOTION_ID:
3215
        return Long.valueOf(getPromotionId());
3216
 
3217
      }
3218
      throw new IllegalStateException();
3219
    }
3220
 
3221
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3222
    public boolean isSet(_Fields field) {
3223
      if (field == null) {
3224
        throw new IllegalArgumentException();
3225
      }
3226
 
3227
      switch (field) {
3228
      case PROMOTION_ID:
3229
        return isSetPromotionId();
3230
      }
3231
      throw new IllegalStateException();
3232
    }
3233
 
3234
    @Override
3235
    public boolean equals(Object that) {
3236
      if (that == null)
3237
        return false;
3238
      if (that instanceof removeAllCouponsByPromotionId_args)
3239
        return this.equals((removeAllCouponsByPromotionId_args)that);
3240
      return false;
3241
    }
3242
 
3243
    public boolean equals(removeAllCouponsByPromotionId_args that) {
3244
      if (that == null)
3245
        return false;
3246
 
3247
      boolean this_present_promotionId = true;
3248
      boolean that_present_promotionId = true;
3249
      if (this_present_promotionId || that_present_promotionId) {
3250
        if (!(this_present_promotionId && that_present_promotionId))
3251
          return false;
3252
        if (this.promotionId != that.promotionId)
3253
          return false;
3254
      }
3255
 
3256
      return true;
3257
    }
3258
 
3259
    @Override
3260
    public int hashCode() {
3261
      return 0;
3262
    }
3263
 
3264
    public int compareTo(removeAllCouponsByPromotionId_args other) {
3265
      if (!getClass().equals(other.getClass())) {
3266
        return getClass().getName().compareTo(other.getClass().getName());
3267
      }
3268
 
3269
      int lastComparison = 0;
3270
      removeAllCouponsByPromotionId_args typedOther = (removeAllCouponsByPromotionId_args)other;
3271
 
3272
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
3273
      if (lastComparison != 0) {
3274
        return lastComparison;
3275
      }
3276
      if (isSetPromotionId()) {
3277
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
3278
        if (lastComparison != 0) {
3279
          return lastComparison;
3280
        }
3281
      }
3282
      return 0;
3283
    }
3284
 
3285
    public _Fields fieldForId(int fieldId) {
3286
      return _Fields.findByThriftId(fieldId);
3287
    }
3288
 
3289
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3290
      org.apache.thrift.protocol.TField field;
3291
      iprot.readStructBegin();
3292
      while (true)
3293
      {
3294
        field = iprot.readFieldBegin();
3295
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3296
          break;
3297
        }
3298
        switch (field.id) {
3299
          case 1: // PROMOTION_ID
3300
            if (field.type == org.apache.thrift.protocol.TType.I64) {
3301
              this.promotionId = iprot.readI64();
3302
              setPromotionIdIsSet(true);
3303
            } else { 
3304
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3305
            }
3306
            break;
3307
          default:
3308
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3309
        }
3310
        iprot.readFieldEnd();
3311
      }
3312
      iprot.readStructEnd();
3313
      validate();
3314
    }
3315
 
3316
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3317
      validate();
3318
 
3319
      oprot.writeStructBegin(STRUCT_DESC);
3320
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
3321
      oprot.writeI64(this.promotionId);
3322
      oprot.writeFieldEnd();
3323
      oprot.writeFieldStop();
3324
      oprot.writeStructEnd();
3325
    }
3326
 
3327
    @Override
3328
    public String toString() {
3329
      StringBuilder sb = new StringBuilder("removeAllCouponsByPromotionId_args(");
3330
      boolean first = true;
3331
 
3332
      sb.append("promotionId:");
3333
      sb.append(this.promotionId);
3334
      first = false;
3335
      sb.append(")");
3336
      return sb.toString();
3337
    }
3338
 
3339
    public void validate() throws org.apache.thrift.TException {
3340
      // check for required fields
3341
    }
3342
 
3343
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3344
      try {
3345
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3346
      } catch (org.apache.thrift.TException te) {
3347
        throw new java.io.IOException(te);
3348
      }
3349
    }
3350
 
3351
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3352
      try {
3353
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
3354
        __isset_bit_vector = new BitSet(1);
3355
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3356
      } catch (org.apache.thrift.TException te) {
3357
        throw new java.io.IOException(te);
3358
      }
3359
    }
3360
 
3361
  }
3362
 
3363
  public static class removeAllCouponsByPromotionId_result implements org.apache.thrift.TBase<removeAllCouponsByPromotionId_result, removeAllCouponsByPromotionId_result._Fields>, java.io.Serializable, Cloneable   {
3364
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("removeAllCouponsByPromotionId_result");
3365
 
3366
    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);
3367
    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);
3368
 
3369
    private long success; // required
3370
    private PromotionException pex; // required
3371
 
3372
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3373
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3374
      SUCCESS((short)0, "success"),
3375
      PEX((short)1, "pex");
3376
 
3377
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3378
 
3379
      static {
3380
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3381
          byName.put(field.getFieldName(), field);
3382
        }
3383
      }
3384
 
3385
      /**
3386
       * Find the _Fields constant that matches fieldId, or null if its not found.
3387
       */
3388
      public static _Fields findByThriftId(int fieldId) {
3389
        switch(fieldId) {
3390
          case 0: // SUCCESS
3391
            return SUCCESS;
3392
          case 1: // PEX
3393
            return PEX;
3394
          default:
3395
            return null;
3396
        }
3397
      }
3398
 
3399
      /**
3400
       * Find the _Fields constant that matches fieldId, throwing an exception
3401
       * if it is not found.
3402
       */
3403
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3404
        _Fields fields = findByThriftId(fieldId);
3405
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3406
        return fields;
3407
      }
3408
 
3409
      /**
3410
       * Find the _Fields constant that matches name, or null if its not found.
3411
       */
3412
      public static _Fields findByName(String name) {
3413
        return byName.get(name);
3414
      }
3415
 
3416
      private final short _thriftId;
3417
      private final String _fieldName;
3418
 
3419
      _Fields(short thriftId, String fieldName) {
3420
        _thriftId = thriftId;
3421
        _fieldName = fieldName;
3422
      }
3423
 
3424
      public short getThriftFieldId() {
3425
        return _thriftId;
3426
      }
3427
 
3428
      public String getFieldName() {
3429
        return _fieldName;
3430
      }
3431
    }
3432
 
3433
    // isset id assignments
3434
    private static final int __SUCCESS_ISSET_ID = 0;
3435
    private BitSet __isset_bit_vector = new BitSet(1);
3436
 
3437
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3438
    static {
3439
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3440
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3441
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
3442
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3443
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
3444
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3445
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(removeAllCouponsByPromotionId_result.class, metaDataMap);
3446
    }
3447
 
3448
    public removeAllCouponsByPromotionId_result() {
3449
    }
3450
 
3451
    public removeAllCouponsByPromotionId_result(
3452
      long success,
3453
      PromotionException pex)
3454
    {
3455
      this();
3456
      this.success = success;
3457
      setSuccessIsSet(true);
3458
      this.pex = pex;
3459
    }
3460
 
3461
    /**
3462
     * Performs a deep copy on <i>other</i>.
3463
     */
3464
    public removeAllCouponsByPromotionId_result(removeAllCouponsByPromotionId_result other) {
3465
      __isset_bit_vector.clear();
3466
      __isset_bit_vector.or(other.__isset_bit_vector);
3467
      this.success = other.success;
3468
      if (other.isSetPex()) {
3469
        this.pex = new PromotionException(other.pex);
3470
      }
3471
    }
3472
 
3473
    public removeAllCouponsByPromotionId_result deepCopy() {
3474
      return new removeAllCouponsByPromotionId_result(this);
3475
    }
3476
 
3477
    @Override
3478
    public void clear() {
3479
      setSuccessIsSet(false);
3480
      this.success = 0;
3481
      this.pex = null;
3482
    }
3483
 
3484
    public long getSuccess() {
3485
      return this.success;
3486
    }
3487
 
3488
    public void setSuccess(long success) {
3489
      this.success = success;
3490
      setSuccessIsSet(true);
3491
    }
3492
 
3493
    public void unsetSuccess() {
3494
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
3495
    }
3496
 
3497
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3498
    public boolean isSetSuccess() {
3499
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
3500
    }
3501
 
3502
    public void setSuccessIsSet(boolean value) {
3503
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
3504
    }
3505
 
3506
    public PromotionException getPex() {
3507
      return this.pex;
3508
    }
3509
 
3510
    public void setPex(PromotionException pex) {
3511
      this.pex = pex;
3512
    }
3513
 
3514
    public void unsetPex() {
3515
      this.pex = null;
3516
    }
3517
 
3518
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3519
    public boolean isSetPex() {
3520
      return this.pex != null;
3521
    }
3522
 
3523
    public void setPexIsSet(boolean value) {
3524
      if (!value) {
3525
        this.pex = null;
3526
      }
3527
    }
3528
 
3529
    public void setFieldValue(_Fields field, Object value) {
3530
      switch (field) {
3531
      case SUCCESS:
3532
        if (value == null) {
3533
          unsetSuccess();
3534
        } else {
3535
          setSuccess((Long)value);
3536
        }
3537
        break;
3538
 
3539
      case PEX:
3540
        if (value == null) {
3541
          unsetPex();
3542
        } else {
3543
          setPex((PromotionException)value);
3544
        }
3545
        break;
3546
 
3547
      }
3548
    }
3549
 
3550
    public Object getFieldValue(_Fields field) {
3551
      switch (field) {
3552
      case SUCCESS:
3553
        return Long.valueOf(getSuccess());
3554
 
3555
      case PEX:
3556
        return getPex();
3557
 
3558
      }
3559
      throw new IllegalStateException();
3560
    }
3561
 
3562
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3563
    public boolean isSet(_Fields field) {
3564
      if (field == null) {
3565
        throw new IllegalArgumentException();
3566
      }
3567
 
3568
      switch (field) {
3569
      case SUCCESS:
3570
        return isSetSuccess();
3571
      case PEX:
3572
        return isSetPex();
3573
      }
3574
      throw new IllegalStateException();
3575
    }
3576
 
3577
    @Override
3578
    public boolean equals(Object that) {
3579
      if (that == null)
3580
        return false;
3581
      if (that instanceof removeAllCouponsByPromotionId_result)
3582
        return this.equals((removeAllCouponsByPromotionId_result)that);
3583
      return false;
3584
    }
3585
 
3586
    public boolean equals(removeAllCouponsByPromotionId_result that) {
3587
      if (that == null)
3588
        return false;
3589
 
3590
      boolean this_present_success = true;
3591
      boolean that_present_success = true;
3592
      if (this_present_success || that_present_success) {
3593
        if (!(this_present_success && that_present_success))
3594
          return false;
3595
        if (this.success != that.success)
3596
          return false;
3597
      }
3598
 
3599
      boolean this_present_pex = true && this.isSetPex();
3600
      boolean that_present_pex = true && that.isSetPex();
3601
      if (this_present_pex || that_present_pex) {
3602
        if (!(this_present_pex && that_present_pex))
3603
          return false;
3604
        if (!this.pex.equals(that.pex))
3605
          return false;
3606
      }
3607
 
3608
      return true;
3609
    }
3610
 
3611
    @Override
3612
    public int hashCode() {
3613
      return 0;
3614
    }
3615
 
3616
    public int compareTo(removeAllCouponsByPromotionId_result other) {
3617
      if (!getClass().equals(other.getClass())) {
3618
        return getClass().getName().compareTo(other.getClass().getName());
3619
      }
3620
 
3621
      int lastComparison = 0;
3622
      removeAllCouponsByPromotionId_result typedOther = (removeAllCouponsByPromotionId_result)other;
3623
 
3624
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3625
      if (lastComparison != 0) {
3626
        return lastComparison;
3627
      }
3628
      if (isSetSuccess()) {
3629
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
3630
        if (lastComparison != 0) {
3631
          return lastComparison;
3632
        }
3633
      }
3634
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3635
      if (lastComparison != 0) {
3636
        return lastComparison;
3637
      }
3638
      if (isSetPex()) {
3639
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
3640
        if (lastComparison != 0) {
3641
          return lastComparison;
3642
        }
3643
      }
3644
      return 0;
3645
    }
3646
 
3647
    public _Fields fieldForId(int fieldId) {
3648
      return _Fields.findByThriftId(fieldId);
3649
    }
3650
 
3651
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3652
      org.apache.thrift.protocol.TField field;
3653
      iprot.readStructBegin();
3654
      while (true)
3655
      {
3656
        field = iprot.readFieldBegin();
3657
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3658
          break;
3659
        }
3660
        switch (field.id) {
3661
          case 0: // SUCCESS
3662
            if (field.type == org.apache.thrift.protocol.TType.I64) {
3663
              this.success = iprot.readI64();
3664
              setSuccessIsSet(true);
3665
            } else { 
3666
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3667
            }
3668
            break;
3669
          case 1: // PEX
3670
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3671
              this.pex = new PromotionException();
3672
              this.pex.read(iprot);
3673
            } else { 
3674
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3675
            }
3676
            break;
3677
          default:
3678
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3679
        }
3680
        iprot.readFieldEnd();
3681
      }
3682
      iprot.readStructEnd();
3683
      validate();
3684
    }
3685
 
3686
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3687
      oprot.writeStructBegin(STRUCT_DESC);
3688
 
3689
      if (this.isSetSuccess()) {
3690
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
3691
        oprot.writeI64(this.success);
3692
        oprot.writeFieldEnd();
3693
      } else if (this.isSetPex()) {
3694
        oprot.writeFieldBegin(PEX_FIELD_DESC);
3695
        this.pex.write(oprot);
3696
        oprot.writeFieldEnd();
3697
      }
3698
      oprot.writeFieldStop();
3699
      oprot.writeStructEnd();
3700
    }
3701
 
3702
    @Override
3703
    public String toString() {
3704
      StringBuilder sb = new StringBuilder("removeAllCouponsByPromotionId_result(");
3705
      boolean first = true;
3706
 
3707
      sb.append("success:");
3708
      sb.append(this.success);
3709
      first = false;
3710
      if (!first) sb.append(", ");
3711
      sb.append("pex:");
3712
      if (this.pex == null) {
3713
        sb.append("null");
3714
      } else {
3715
        sb.append(this.pex);
3716
      }
3717
      first = false;
3718
      sb.append(")");
3719
      return sb.toString();
3720
    }
3721
 
3722
    public void validate() throws org.apache.thrift.TException {
3723
      // check for required fields
3724
    }
3725
 
3726
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3727
      try {
3728
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3729
      } catch (org.apache.thrift.TException te) {
3730
        throw new java.io.IOException(te);
3731
      }
3732
    }
3733
 
3734
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3735
      try {
3736
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3737
      } catch (org.apache.thrift.TException te) {
3738
        throw new java.io.IOException(te);
3739
      }
3740
    }
3741
 
3742
  }
3743
 
6301 amit.gupta 3744
  public static class getCoupon_args implements org.apache.thrift.TBase<getCoupon_args, getCoupon_args._Fields>, java.io.Serializable, Cloneable   {
3745
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCoupon_args");
3746
 
3747
    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);
3748
 
3749
    private String couponCode; // required
3750
 
3751
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3752
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3753
      COUPON_CODE((short)1, "couponCode");
3754
 
3755
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3756
 
3757
      static {
3758
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3759
          byName.put(field.getFieldName(), field);
3760
        }
3761
      }
3762
 
3763
      /**
3764
       * Find the _Fields constant that matches fieldId, or null if its not found.
3765
       */
3766
      public static _Fields findByThriftId(int fieldId) {
3767
        switch(fieldId) {
3768
          case 1: // COUPON_CODE
3769
            return COUPON_CODE;
3770
          default:
3771
            return null;
3772
        }
3773
      }
3774
 
3775
      /**
3776
       * Find the _Fields constant that matches fieldId, throwing an exception
3777
       * if it is not found.
3778
       */
3779
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3780
        _Fields fields = findByThriftId(fieldId);
3781
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3782
        return fields;
3783
      }
3784
 
3785
      /**
3786
       * Find the _Fields constant that matches name, or null if its not found.
3787
       */
3788
      public static _Fields findByName(String name) {
3789
        return byName.get(name);
3790
      }
3791
 
3792
      private final short _thriftId;
3793
      private final String _fieldName;
3794
 
3795
      _Fields(short thriftId, String fieldName) {
3796
        _thriftId = thriftId;
3797
        _fieldName = fieldName;
3798
      }
3799
 
3800
      public short getThriftFieldId() {
3801
        return _thriftId;
3802
      }
3803
 
3804
      public String getFieldName() {
3805
        return _fieldName;
3806
      }
3807
    }
3808
 
3809
    // isset id assignments
3810
 
3811
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3812
    static {
3813
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3814
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3815
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
3816
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3817
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCoupon_args.class, metaDataMap);
3818
    }
3819
 
3820
    public getCoupon_args() {
3821
    }
3822
 
3823
    public getCoupon_args(
3824
      String couponCode)
3825
    {
3826
      this();
3827
      this.couponCode = couponCode;
3828
    }
3829
 
3830
    /**
3831
     * Performs a deep copy on <i>other</i>.
3832
     */
3833
    public getCoupon_args(getCoupon_args other) {
3834
      if (other.isSetCouponCode()) {
3835
        this.couponCode = other.couponCode;
3836
      }
3837
    }
3838
 
3839
    public getCoupon_args deepCopy() {
3840
      return new getCoupon_args(this);
3841
    }
3842
 
3843
    @Override
3844
    public void clear() {
3845
      this.couponCode = null;
3846
    }
3847
 
3848
    public String getCouponCode() {
3849
      return this.couponCode;
3850
    }
3851
 
3852
    public void setCouponCode(String couponCode) {
3853
      this.couponCode = couponCode;
3854
    }
3855
 
3856
    public void unsetCouponCode() {
3857
      this.couponCode = null;
3858
    }
3859
 
3860
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3861
    public boolean isSetCouponCode() {
3862
      return this.couponCode != null;
3863
    }
3864
 
3865
    public void setCouponCodeIsSet(boolean value) {
3866
      if (!value) {
3867
        this.couponCode = null;
3868
      }
3869
    }
3870
 
3871
    public void setFieldValue(_Fields field, Object value) {
3872
      switch (field) {
3873
      case COUPON_CODE:
3874
        if (value == null) {
3875
          unsetCouponCode();
3876
        } else {
3877
          setCouponCode((String)value);
3878
        }
3879
        break;
3880
 
3881
      }
3882
    }
3883
 
3884
    public Object getFieldValue(_Fields field) {
3885
      switch (field) {
3886
      case COUPON_CODE:
3887
        return getCouponCode();
3888
 
3889
      }
3890
      throw new IllegalStateException();
3891
    }
3892
 
3893
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3894
    public boolean isSet(_Fields field) {
3895
      if (field == null) {
3896
        throw new IllegalArgumentException();
3897
      }
3898
 
3899
      switch (field) {
3900
      case COUPON_CODE:
3901
        return isSetCouponCode();
3902
      }
3903
      throw new IllegalStateException();
3904
    }
3905
 
3906
    @Override
3907
    public boolean equals(Object that) {
3908
      if (that == null)
3909
        return false;
3910
      if (that instanceof getCoupon_args)
3911
        return this.equals((getCoupon_args)that);
3912
      return false;
3913
    }
3914
 
3915
    public boolean equals(getCoupon_args that) {
3916
      if (that == null)
3917
        return false;
3918
 
3919
      boolean this_present_couponCode = true && this.isSetCouponCode();
3920
      boolean that_present_couponCode = true && that.isSetCouponCode();
3921
      if (this_present_couponCode || that_present_couponCode) {
3922
        if (!(this_present_couponCode && that_present_couponCode))
3923
          return false;
3924
        if (!this.couponCode.equals(that.couponCode))
3925
          return false;
3926
      }
3927
 
3928
      return true;
3929
    }
3930
 
3931
    @Override
3932
    public int hashCode() {
3933
      return 0;
3934
    }
3935
 
3936
    public int compareTo(getCoupon_args other) {
3937
      if (!getClass().equals(other.getClass())) {
3938
        return getClass().getName().compareTo(other.getClass().getName());
3939
      }
3940
 
3941
      int lastComparison = 0;
3942
      getCoupon_args typedOther = (getCoupon_args)other;
3943
 
3944
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3945
      if (lastComparison != 0) {
3946
        return lastComparison;
3947
      }
3948
      if (isSetCouponCode()) {
3949
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
3950
        if (lastComparison != 0) {
3951
          return lastComparison;
3952
        }
3953
      }
3954
      return 0;
3955
    }
3956
 
3957
    public _Fields fieldForId(int fieldId) {
3958
      return _Fields.findByThriftId(fieldId);
3959
    }
3960
 
3961
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3962
      org.apache.thrift.protocol.TField field;
3963
      iprot.readStructBegin();
3964
      while (true)
3965
      {
3966
        field = iprot.readFieldBegin();
3967
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3968
          break;
3969
        }
3970
        switch (field.id) {
3971
          case 1: // COUPON_CODE
3972
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
3973
              this.couponCode = iprot.readString();
3974
            } else { 
3975
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3976
            }
3977
            break;
3978
          default:
3979
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3980
        }
3981
        iprot.readFieldEnd();
3982
      }
3983
      iprot.readStructEnd();
3984
      validate();
3985
    }
3986
 
3987
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3988
      validate();
3989
 
3990
      oprot.writeStructBegin(STRUCT_DESC);
3991
      if (this.couponCode != null) {
3992
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
3993
        oprot.writeString(this.couponCode);
3994
        oprot.writeFieldEnd();
3995
      }
3996
      oprot.writeFieldStop();
3997
      oprot.writeStructEnd();
3998
    }
3999
 
4000
    @Override
4001
    public String toString() {
4002
      StringBuilder sb = new StringBuilder("getCoupon_args(");
4003
      boolean first = true;
4004
 
4005
      sb.append("couponCode:");
4006
      if (this.couponCode == null) {
4007
        sb.append("null");
4008
      } else {
4009
        sb.append(this.couponCode);
4010
      }
4011
      first = false;
4012
      sb.append(")");
4013
      return sb.toString();
4014
    }
4015
 
4016
    public void validate() throws org.apache.thrift.TException {
4017
      // check for required fields
4018
    }
4019
 
4020
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4021
      try {
4022
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4023
      } catch (org.apache.thrift.TException te) {
4024
        throw new java.io.IOException(te);
4025
      }
4026
    }
4027
 
4028
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4029
      try {
4030
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4031
      } catch (org.apache.thrift.TException te) {
4032
        throw new java.io.IOException(te);
4033
      }
4034
    }
4035
 
4036
  }
4037
 
4038
  public static class getCoupon_result implements org.apache.thrift.TBase<getCoupon_result, getCoupon_result._Fields>, java.io.Serializable, Cloneable   {
4039
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCoupon_result");
4040
 
4041
    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);
4042
    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);
4043
 
4044
    private Coupon success; // required
4045
    private PromotionException pex; // required
4046
 
4047
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4048
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4049
      SUCCESS((short)0, "success"),
4050
      PEX((short)1, "pex");
4051
 
4052
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4053
 
4054
      static {
4055
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4056
          byName.put(field.getFieldName(), field);
4057
        }
4058
      }
4059
 
4060
      /**
4061
       * Find the _Fields constant that matches fieldId, or null if its not found.
4062
       */
4063
      public static _Fields findByThriftId(int fieldId) {
4064
        switch(fieldId) {
4065
          case 0: // SUCCESS
4066
            return SUCCESS;
4067
          case 1: // PEX
4068
            return PEX;
4069
          default:
4070
            return null;
4071
        }
4072
      }
4073
 
4074
      /**
4075
       * Find the _Fields constant that matches fieldId, throwing an exception
4076
       * if it is not found.
4077
       */
4078
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4079
        _Fields fields = findByThriftId(fieldId);
4080
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4081
        return fields;
4082
      }
4083
 
4084
      /**
4085
       * Find the _Fields constant that matches name, or null if its not found.
4086
       */
4087
      public static _Fields findByName(String name) {
4088
        return byName.get(name);
4089
      }
4090
 
4091
      private final short _thriftId;
4092
      private final String _fieldName;
4093
 
4094
      _Fields(short thriftId, String fieldName) {
4095
        _thriftId = thriftId;
4096
        _fieldName = fieldName;
4097
      }
4098
 
4099
      public short getThriftFieldId() {
4100
        return _thriftId;
4101
      }
4102
 
4103
      public String getFieldName() {
4104
        return _fieldName;
4105
      }
4106
    }
4107
 
4108
    // isset id assignments
4109
 
4110
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4111
    static {
4112
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4113
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4114
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class)));
4115
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4116
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4117
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4118
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCoupon_result.class, metaDataMap);
4119
    }
4120
 
4121
    public getCoupon_result() {
4122
    }
4123
 
4124
    public getCoupon_result(
4125
      Coupon success,
4126
      PromotionException pex)
4127
    {
4128
      this();
4129
      this.success = success;
4130
      this.pex = pex;
4131
    }
4132
 
4133
    /**
4134
     * Performs a deep copy on <i>other</i>.
4135
     */
4136
    public getCoupon_result(getCoupon_result other) {
4137
      if (other.isSetSuccess()) {
4138
        this.success = new Coupon(other.success);
4139
      }
4140
      if (other.isSetPex()) {
4141
        this.pex = new PromotionException(other.pex);
4142
      }
4143
    }
4144
 
4145
    public getCoupon_result deepCopy() {
4146
      return new getCoupon_result(this);
4147
    }
4148
 
4149
    @Override
4150
    public void clear() {
4151
      this.success = null;
4152
      this.pex = null;
4153
    }
4154
 
4155
    public Coupon getSuccess() {
4156
      return this.success;
4157
    }
4158
 
4159
    public void setSuccess(Coupon success) {
4160
      this.success = success;
4161
    }
4162
 
4163
    public void unsetSuccess() {
4164
      this.success = null;
4165
    }
4166
 
4167
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
4168
    public boolean isSetSuccess() {
4169
      return this.success != null;
4170
    }
4171
 
4172
    public void setSuccessIsSet(boolean value) {
4173
      if (!value) {
4174
        this.success = null;
4175
      }
4176
    }
4177
 
4178
    public PromotionException getPex() {
4179
      return this.pex;
4180
    }
4181
 
4182
    public void setPex(PromotionException pex) {
4183
      this.pex = pex;
4184
    }
4185
 
4186
    public void unsetPex() {
4187
      this.pex = null;
4188
    }
4189
 
4190
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
4191
    public boolean isSetPex() {
4192
      return this.pex != null;
4193
    }
4194
 
4195
    public void setPexIsSet(boolean value) {
4196
      if (!value) {
4197
        this.pex = null;
4198
      }
4199
    }
4200
 
4201
    public void setFieldValue(_Fields field, Object value) {
4202
      switch (field) {
4203
      case SUCCESS:
4204
        if (value == null) {
4205
          unsetSuccess();
4206
        } else {
4207
          setSuccess((Coupon)value);
4208
        }
4209
        break;
4210
 
4211
      case PEX:
4212
        if (value == null) {
4213
          unsetPex();
4214
        } else {
4215
          setPex((PromotionException)value);
4216
        }
4217
        break;
4218
 
4219
      }
4220
    }
4221
 
4222
    public Object getFieldValue(_Fields field) {
4223
      switch (field) {
4224
      case SUCCESS:
4225
        return getSuccess();
4226
 
4227
      case PEX:
4228
        return getPex();
4229
 
4230
      }
4231
      throw new IllegalStateException();
4232
    }
4233
 
4234
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4235
    public boolean isSet(_Fields field) {
4236
      if (field == null) {
4237
        throw new IllegalArgumentException();
4238
      }
4239
 
4240
      switch (field) {
4241
      case SUCCESS:
4242
        return isSetSuccess();
4243
      case PEX:
4244
        return isSetPex();
4245
      }
4246
      throw new IllegalStateException();
4247
    }
4248
 
4249
    @Override
4250
    public boolean equals(Object that) {
4251
      if (that == null)
4252
        return false;
4253
      if (that instanceof getCoupon_result)
4254
        return this.equals((getCoupon_result)that);
4255
      return false;
4256
    }
4257
 
4258
    public boolean equals(getCoupon_result that) {
4259
      if (that == null)
4260
        return false;
4261
 
4262
      boolean this_present_success = true && this.isSetSuccess();
4263
      boolean that_present_success = true && that.isSetSuccess();
4264
      if (this_present_success || that_present_success) {
4265
        if (!(this_present_success && that_present_success))
4266
          return false;
4267
        if (!this.success.equals(that.success))
4268
          return false;
4269
      }
4270
 
4271
      boolean this_present_pex = true && this.isSetPex();
4272
      boolean that_present_pex = true && that.isSetPex();
4273
      if (this_present_pex || that_present_pex) {
4274
        if (!(this_present_pex && that_present_pex))
4275
          return false;
4276
        if (!this.pex.equals(that.pex))
4277
          return false;
4278
      }
4279
 
4280
      return true;
4281
    }
4282
 
4283
    @Override
4284
    public int hashCode() {
4285
      return 0;
4286
    }
4287
 
4288
    public int compareTo(getCoupon_result other) {
4289
      if (!getClass().equals(other.getClass())) {
4290
        return getClass().getName().compareTo(other.getClass().getName());
4291
      }
4292
 
4293
      int lastComparison = 0;
4294
      getCoupon_result typedOther = (getCoupon_result)other;
4295
 
4296
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
4297
      if (lastComparison != 0) {
4298
        return lastComparison;
4299
      }
4300
      if (isSetSuccess()) {
4301
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4302
        if (lastComparison != 0) {
4303
          return lastComparison;
4304
        }
4305
      }
4306
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
4307
      if (lastComparison != 0) {
4308
        return lastComparison;
4309
      }
4310
      if (isSetPex()) {
4311
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
4312
        if (lastComparison != 0) {
4313
          return lastComparison;
4314
        }
4315
      }
4316
      return 0;
4317
    }
4318
 
4319
    public _Fields fieldForId(int fieldId) {
4320
      return _Fields.findByThriftId(fieldId);
4321
    }
4322
 
4323
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4324
      org.apache.thrift.protocol.TField field;
4325
      iprot.readStructBegin();
4326
      while (true)
4327
      {
4328
        field = iprot.readFieldBegin();
4329
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4330
          break;
4331
        }
4332
        switch (field.id) {
4333
          case 0: // SUCCESS
4334
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4335
              this.success = new Coupon();
4336
              this.success.read(iprot);
4337
            } else { 
4338
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4339
            }
4340
            break;
4341
          case 1: // PEX
4342
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4343
              this.pex = new PromotionException();
4344
              this.pex.read(iprot);
4345
            } else { 
4346
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4347
            }
4348
            break;
4349
          default:
4350
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4351
        }
4352
        iprot.readFieldEnd();
4353
      }
4354
      iprot.readStructEnd();
4355
      validate();
4356
    }
4357
 
4358
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4359
      oprot.writeStructBegin(STRUCT_DESC);
4360
 
4361
      if (this.isSetSuccess()) {
4362
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4363
        this.success.write(oprot);
4364
        oprot.writeFieldEnd();
4365
      } else if (this.isSetPex()) {
4366
        oprot.writeFieldBegin(PEX_FIELD_DESC);
4367
        this.pex.write(oprot);
4368
        oprot.writeFieldEnd();
4369
      }
4370
      oprot.writeFieldStop();
4371
      oprot.writeStructEnd();
4372
    }
4373
 
4374
    @Override
4375
    public String toString() {
4376
      StringBuilder sb = new StringBuilder("getCoupon_result(");
4377
      boolean first = true;
4378
 
4379
      sb.append("success:");
4380
      if (this.success == null) {
4381
        sb.append("null");
4382
      } else {
4383
        sb.append(this.success);
4384
      }
4385
      first = false;
4386
      if (!first) sb.append(", ");
4387
      sb.append("pex:");
4388
      if (this.pex == null) {
4389
        sb.append("null");
4390
      } else {
4391
        sb.append(this.pex);
4392
      }
4393
      first = false;
4394
      sb.append(")");
4395
      return sb.toString();
4396
    }
4397
 
4398
    public void validate() throws org.apache.thrift.TException {
4399
      // check for required fields
4400
    }
4401
 
4402
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4403
      try {
4404
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4405
      } catch (org.apache.thrift.TException te) {
4406
        throw new java.io.IOException(te);
4407
      }
4408
    }
4409
 
4410
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4411
      try {
4412
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4413
      } catch (org.apache.thrift.TException te) {
4414
        throw new java.io.IOException(te);
4415
      }
4416
    }
4417
 
4418
  }
4419
 
4420
  public static class isGiftVoucher_args implements org.apache.thrift.TBase<isGiftVoucher_args, isGiftVoucher_args._Fields>, java.io.Serializable, Cloneable   {
4421
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isGiftVoucher_args");
4422
 
4423
    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);
4424
 
4425
    private String couponCode; // required
4426
 
4427
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4428
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4429
      COUPON_CODE((short)1, "couponCode");
4430
 
4431
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4432
 
4433
      static {
4434
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4435
          byName.put(field.getFieldName(), field);
4436
        }
4437
      }
4438
 
4439
      /**
4440
       * Find the _Fields constant that matches fieldId, or null if its not found.
4441
       */
4442
      public static _Fields findByThriftId(int fieldId) {
4443
        switch(fieldId) {
4444
          case 1: // COUPON_CODE
4445
            return COUPON_CODE;
4446
          default:
4447
            return null;
4448
        }
4449
      }
4450
 
4451
      /**
4452
       * Find the _Fields constant that matches fieldId, throwing an exception
4453
       * if it is not found.
4454
       */
4455
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4456
        _Fields fields = findByThriftId(fieldId);
4457
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4458
        return fields;
4459
      }
4460
 
4461
      /**
4462
       * Find the _Fields constant that matches name, or null if its not found.
4463
       */
4464
      public static _Fields findByName(String name) {
4465
        return byName.get(name);
4466
      }
4467
 
4468
      private final short _thriftId;
4469
      private final String _fieldName;
4470
 
4471
      _Fields(short thriftId, String fieldName) {
4472
        _thriftId = thriftId;
4473
        _fieldName = fieldName;
4474
      }
4475
 
4476
      public short getThriftFieldId() {
4477
        return _thriftId;
4478
      }
4479
 
4480
      public String getFieldName() {
4481
        return _fieldName;
4482
      }
4483
    }
4484
 
4485
    // isset id assignments
4486
 
4487
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4488
    static {
4489
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4490
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4491
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
4492
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4493
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isGiftVoucher_args.class, metaDataMap);
4494
    }
4495
 
4496
    public isGiftVoucher_args() {
4497
    }
4498
 
4499
    public isGiftVoucher_args(
4500
      String couponCode)
4501
    {
4502
      this();
4503
      this.couponCode = couponCode;
4504
    }
4505
 
4506
    /**
4507
     * Performs a deep copy on <i>other</i>.
4508
     */
4509
    public isGiftVoucher_args(isGiftVoucher_args other) {
4510
      if (other.isSetCouponCode()) {
4511
        this.couponCode = other.couponCode;
4512
      }
4513
    }
4514
 
4515
    public isGiftVoucher_args deepCopy() {
4516
      return new isGiftVoucher_args(this);
4517
    }
4518
 
4519
    @Override
4520
    public void clear() {
4521
      this.couponCode = null;
4522
    }
4523
 
4524
    public String getCouponCode() {
4525
      return this.couponCode;
4526
    }
4527
 
4528
    public void setCouponCode(String couponCode) {
4529
      this.couponCode = couponCode;
4530
    }
4531
 
4532
    public void unsetCouponCode() {
4533
      this.couponCode = null;
4534
    }
4535
 
4536
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
4537
    public boolean isSetCouponCode() {
4538
      return this.couponCode != null;
4539
    }
4540
 
4541
    public void setCouponCodeIsSet(boolean value) {
4542
      if (!value) {
4543
        this.couponCode = null;
4544
      }
4545
    }
4546
 
4547
    public void setFieldValue(_Fields field, Object value) {
4548
      switch (field) {
4549
      case COUPON_CODE:
4550
        if (value == null) {
4551
          unsetCouponCode();
4552
        } else {
4553
          setCouponCode((String)value);
4554
        }
4555
        break;
4556
 
4557
      }
4558
    }
4559
 
4560
    public Object getFieldValue(_Fields field) {
4561
      switch (field) {
4562
      case COUPON_CODE:
4563
        return getCouponCode();
4564
 
4565
      }
4566
      throw new IllegalStateException();
4567
    }
4568
 
4569
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4570
    public boolean isSet(_Fields field) {
4571
      if (field == null) {
4572
        throw new IllegalArgumentException();
4573
      }
4574
 
4575
      switch (field) {
4576
      case COUPON_CODE:
4577
        return isSetCouponCode();
4578
      }
4579
      throw new IllegalStateException();
4580
    }
4581
 
4582
    @Override
4583
    public boolean equals(Object that) {
4584
      if (that == null)
4585
        return false;
4586
      if (that instanceof isGiftVoucher_args)
4587
        return this.equals((isGiftVoucher_args)that);
4588
      return false;
4589
    }
4590
 
4591
    public boolean equals(isGiftVoucher_args that) {
4592
      if (that == null)
4593
        return false;
4594
 
4595
      boolean this_present_couponCode = true && this.isSetCouponCode();
4596
      boolean that_present_couponCode = true && that.isSetCouponCode();
4597
      if (this_present_couponCode || that_present_couponCode) {
4598
        if (!(this_present_couponCode && that_present_couponCode))
4599
          return false;
4600
        if (!this.couponCode.equals(that.couponCode))
4601
          return false;
4602
      }
4603
 
4604
      return true;
4605
    }
4606
 
4607
    @Override
4608
    public int hashCode() {
4609
      return 0;
4610
    }
4611
 
4612
    public int compareTo(isGiftVoucher_args other) {
4613
      if (!getClass().equals(other.getClass())) {
4614
        return getClass().getName().compareTo(other.getClass().getName());
4615
      }
4616
 
4617
      int lastComparison = 0;
4618
      isGiftVoucher_args typedOther = (isGiftVoucher_args)other;
4619
 
4620
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
4621
      if (lastComparison != 0) {
4622
        return lastComparison;
4623
      }
4624
      if (isSetCouponCode()) {
4625
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
4626
        if (lastComparison != 0) {
4627
          return lastComparison;
4628
        }
4629
      }
4630
      return 0;
4631
    }
4632
 
4633
    public _Fields fieldForId(int fieldId) {
4634
      return _Fields.findByThriftId(fieldId);
4635
    }
4636
 
4637
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4638
      org.apache.thrift.protocol.TField field;
4639
      iprot.readStructBegin();
4640
      while (true)
4641
      {
4642
        field = iprot.readFieldBegin();
4643
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4644
          break;
4645
        }
4646
        switch (field.id) {
4647
          case 1: // COUPON_CODE
4648
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
4649
              this.couponCode = iprot.readString();
4650
            } else { 
4651
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4652
            }
4653
            break;
4654
          default:
4655
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4656
        }
4657
        iprot.readFieldEnd();
4658
      }
4659
      iprot.readStructEnd();
4660
      validate();
4661
    }
4662
 
4663
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4664
      validate();
4665
 
4666
      oprot.writeStructBegin(STRUCT_DESC);
4667
      if (this.couponCode != null) {
4668
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
4669
        oprot.writeString(this.couponCode);
4670
        oprot.writeFieldEnd();
4671
      }
4672
      oprot.writeFieldStop();
4673
      oprot.writeStructEnd();
4674
    }
4675
 
4676
    @Override
4677
    public String toString() {
4678
      StringBuilder sb = new StringBuilder("isGiftVoucher_args(");
4679
      boolean first = true;
4680
 
4681
      sb.append("couponCode:");
4682
      if (this.couponCode == null) {
4683
        sb.append("null");
4684
      } else {
4685
        sb.append(this.couponCode);
4686
      }
4687
      first = false;
4688
      sb.append(")");
4689
      return sb.toString();
4690
    }
4691
 
4692
    public void validate() throws org.apache.thrift.TException {
4693
      // check for required fields
4694
    }
4695
 
4696
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4697
      try {
4698
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4699
      } catch (org.apache.thrift.TException te) {
4700
        throw new java.io.IOException(te);
4701
      }
4702
    }
4703
 
4704
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4705
      try {
4706
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4707
      } catch (org.apache.thrift.TException te) {
4708
        throw new java.io.IOException(te);
4709
      }
4710
    }
4711
 
4712
  }
4713
 
4714
  public static class isGiftVoucher_result implements org.apache.thrift.TBase<isGiftVoucher_result, isGiftVoucher_result._Fields>, java.io.Serializable, Cloneable   {
4715
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isGiftVoucher_result");
4716
 
4717
    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);
4718
    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);
4719
 
4720
    private boolean success; // required
4721
    private PromotionException pex; // required
4722
 
4723
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4724
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4725
      SUCCESS((short)0, "success"),
4726
      PEX((short)1, "pex");
4727
 
4728
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4729
 
4730
      static {
4731
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4732
          byName.put(field.getFieldName(), field);
4733
        }
4734
      }
4735
 
4736
      /**
4737
       * Find the _Fields constant that matches fieldId, or null if its not found.
4738
       */
4739
      public static _Fields findByThriftId(int fieldId) {
4740
        switch(fieldId) {
4741
          case 0: // SUCCESS
4742
            return SUCCESS;
4743
          case 1: // PEX
4744
            return PEX;
4745
          default:
4746
            return null;
4747
        }
4748
      }
4749
 
4750
      /**
4751
       * Find the _Fields constant that matches fieldId, throwing an exception
4752
       * if it is not found.
4753
       */
4754
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4755
        _Fields fields = findByThriftId(fieldId);
4756
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4757
        return fields;
4758
      }
4759
 
4760
      /**
4761
       * Find the _Fields constant that matches name, or null if its not found.
4762
       */
4763
      public static _Fields findByName(String name) {
4764
        return byName.get(name);
4765
      }
4766
 
4767
      private final short _thriftId;
4768
      private final String _fieldName;
4769
 
4770
      _Fields(short thriftId, String fieldName) {
4771
        _thriftId = thriftId;
4772
        _fieldName = fieldName;
4773
      }
4774
 
4775
      public short getThriftFieldId() {
4776
        return _thriftId;
4777
      }
4778
 
4779
      public String getFieldName() {
4780
        return _fieldName;
4781
      }
4782
    }
4783
 
4784
    // isset id assignments
4785
    private static final int __SUCCESS_ISSET_ID = 0;
4786
    private BitSet __isset_bit_vector = new BitSet(1);
4787
 
4788
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4789
    static {
4790
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4791
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4792
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
4793
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4794
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4795
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4796
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isGiftVoucher_result.class, metaDataMap);
4797
    }
4798
 
4799
    public isGiftVoucher_result() {
4800
    }
4801
 
4802
    public isGiftVoucher_result(
4803
      boolean success,
4804
      PromotionException pex)
4805
    {
4806
      this();
4807
      this.success = success;
4808
      setSuccessIsSet(true);
4809
      this.pex = pex;
4810
    }
4811
 
4812
    /**
4813
     * Performs a deep copy on <i>other</i>.
4814
     */
4815
    public isGiftVoucher_result(isGiftVoucher_result other) {
4816
      __isset_bit_vector.clear();
4817
      __isset_bit_vector.or(other.__isset_bit_vector);
4818
      this.success = other.success;
4819
      if (other.isSetPex()) {
4820
        this.pex = new PromotionException(other.pex);
4821
      }
4822
    }
4823
 
4824
    public isGiftVoucher_result deepCopy() {
4825
      return new isGiftVoucher_result(this);
4826
    }
4827
 
4828
    @Override
4829
    public void clear() {
4830
      setSuccessIsSet(false);
4831
      this.success = false;
4832
      this.pex = null;
4833
    }
4834
 
4835
    public boolean isSuccess() {
4836
      return this.success;
4837
    }
4838
 
4839
    public void setSuccess(boolean success) {
4840
      this.success = success;
4841
      setSuccessIsSet(true);
4842
    }
4843
 
4844
    public void unsetSuccess() {
4845
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
4846
    }
4847
 
4848
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
4849
    public boolean isSetSuccess() {
4850
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
4851
    }
4852
 
4853
    public void setSuccessIsSet(boolean value) {
4854
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
4855
    }
4856
 
4857
    public PromotionException getPex() {
4858
      return this.pex;
4859
    }
4860
 
4861
    public void setPex(PromotionException pex) {
4862
      this.pex = pex;
4863
    }
4864
 
4865
    public void unsetPex() {
4866
      this.pex = null;
4867
    }
4868
 
4869
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
4870
    public boolean isSetPex() {
4871
      return this.pex != null;
4872
    }
4873
 
4874
    public void setPexIsSet(boolean value) {
4875
      if (!value) {
4876
        this.pex = null;
4877
      }
4878
    }
4879
 
4880
    public void setFieldValue(_Fields field, Object value) {
4881
      switch (field) {
4882
      case SUCCESS:
4883
        if (value == null) {
4884
          unsetSuccess();
4885
        } else {
4886
          setSuccess((Boolean)value);
4887
        }
4888
        break;
4889
 
4890
      case PEX:
4891
        if (value == null) {
4892
          unsetPex();
4893
        } else {
4894
          setPex((PromotionException)value);
4895
        }
4896
        break;
4897
 
4898
      }
4899
    }
4900
 
4901
    public Object getFieldValue(_Fields field) {
4902
      switch (field) {
4903
      case SUCCESS:
4904
        return Boolean.valueOf(isSuccess());
4905
 
4906
      case PEX:
4907
        return getPex();
4908
 
4909
      }
4910
      throw new IllegalStateException();
4911
    }
4912
 
4913
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4914
    public boolean isSet(_Fields field) {
4915
      if (field == null) {
4916
        throw new IllegalArgumentException();
4917
      }
4918
 
4919
      switch (field) {
4920
      case SUCCESS:
4921
        return isSetSuccess();
4922
      case PEX:
4923
        return isSetPex();
4924
      }
4925
      throw new IllegalStateException();
4926
    }
4927
 
4928
    @Override
4929
    public boolean equals(Object that) {
4930
      if (that == null)
4931
        return false;
4932
      if (that instanceof isGiftVoucher_result)
4933
        return this.equals((isGiftVoucher_result)that);
4934
      return false;
4935
    }
4936
 
4937
    public boolean equals(isGiftVoucher_result that) {
4938
      if (that == null)
4939
        return false;
4940
 
4941
      boolean this_present_success = true;
4942
      boolean that_present_success = true;
4943
      if (this_present_success || that_present_success) {
4944
        if (!(this_present_success && that_present_success))
4945
          return false;
4946
        if (this.success != that.success)
4947
          return false;
4948
      }
4949
 
4950
      boolean this_present_pex = true && this.isSetPex();
4951
      boolean that_present_pex = true && that.isSetPex();
4952
      if (this_present_pex || that_present_pex) {
4953
        if (!(this_present_pex && that_present_pex))
4954
          return false;
4955
        if (!this.pex.equals(that.pex))
4956
          return false;
4957
      }
4958
 
4959
      return true;
4960
    }
4961
 
4962
    @Override
4963
    public int hashCode() {
4964
      return 0;
4965
    }
4966
 
4967
    public int compareTo(isGiftVoucher_result other) {
4968
      if (!getClass().equals(other.getClass())) {
4969
        return getClass().getName().compareTo(other.getClass().getName());
4970
      }
4971
 
4972
      int lastComparison = 0;
4973
      isGiftVoucher_result typedOther = (isGiftVoucher_result)other;
4974
 
4975
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
4976
      if (lastComparison != 0) {
4977
        return lastComparison;
4978
      }
4979
      if (isSetSuccess()) {
4980
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4981
        if (lastComparison != 0) {
4982
          return lastComparison;
4983
        }
4984
      }
4985
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
4986
      if (lastComparison != 0) {
4987
        return lastComparison;
4988
      }
4989
      if (isSetPex()) {
4990
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
4991
        if (lastComparison != 0) {
4992
          return lastComparison;
4993
        }
4994
      }
4995
      return 0;
4996
    }
4997
 
4998
    public _Fields fieldForId(int fieldId) {
4999
      return _Fields.findByThriftId(fieldId);
5000
    }
5001
 
5002
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5003
      org.apache.thrift.protocol.TField field;
5004
      iprot.readStructBegin();
5005
      while (true)
5006
      {
5007
        field = iprot.readFieldBegin();
5008
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
5009
          break;
5010
        }
5011
        switch (field.id) {
5012
          case 0: // SUCCESS
5013
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
5014
              this.success = iprot.readBool();
5015
              setSuccessIsSet(true);
5016
            } else { 
5017
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5018
            }
5019
            break;
5020
          case 1: // PEX
5021
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5022
              this.pex = new PromotionException();
5023
              this.pex.read(iprot);
5024
            } else { 
5025
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5026
            }
5027
            break;
5028
          default:
5029
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5030
        }
5031
        iprot.readFieldEnd();
5032
      }
5033
      iprot.readStructEnd();
5034
      validate();
5035
    }
5036
 
5037
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
5038
      oprot.writeStructBegin(STRUCT_DESC);
5039
 
5040
      if (this.isSetSuccess()) {
5041
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
5042
        oprot.writeBool(this.success);
5043
        oprot.writeFieldEnd();
5044
      } else if (this.isSetPex()) {
5045
        oprot.writeFieldBegin(PEX_FIELD_DESC);
5046
        this.pex.write(oprot);
5047
        oprot.writeFieldEnd();
5048
      }
5049
      oprot.writeFieldStop();
5050
      oprot.writeStructEnd();
5051
    }
5052
 
5053
    @Override
5054
    public String toString() {
5055
      StringBuilder sb = new StringBuilder("isGiftVoucher_result(");
5056
      boolean first = true;
5057
 
5058
      sb.append("success:");
5059
      sb.append(this.success);
5060
      first = false;
5061
      if (!first) sb.append(", ");
5062
      sb.append("pex:");
5063
      if (this.pex == null) {
5064
        sb.append("null");
5065
      } else {
5066
        sb.append(this.pex);
5067
      }
5068
      first = false;
5069
      sb.append(")");
5070
      return sb.toString();
5071
    }
5072
 
5073
    public void validate() throws org.apache.thrift.TException {
5074
      // check for required fields
5075
    }
5076
 
5077
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5078
      try {
5079
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5080
      } catch (org.apache.thrift.TException te) {
5081
        throw new java.io.IOException(te);
5082
      }
5083
    }
5084
 
5085
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5086
      try {
5087
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5088
      } catch (org.apache.thrift.TException te) {
5089
        throw new java.io.IOException(te);
5090
      }
5091
    }
5092
 
5093
  }
5094
 
6356 amit.gupta 5095
  public static class isCodApplicable_args implements org.apache.thrift.TBase<isCodApplicable_args, isCodApplicable_args._Fields>, java.io.Serializable, Cloneable   {
5096
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isCodApplicable_args");
5097
 
11819 amit.gupta 5098
    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 5099
 
11819 amit.gupta 5100
    private Cart cart; // required
6356 amit.gupta 5101
 
5102
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
5103
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11819 amit.gupta 5104
      CART((short)1, "cart");
6356 amit.gupta 5105
 
5106
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5107
 
5108
      static {
5109
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5110
          byName.put(field.getFieldName(), field);
5111
        }
5112
      }
5113
 
5114
      /**
5115
       * Find the _Fields constant that matches fieldId, or null if its not found.
5116
       */
5117
      public static _Fields findByThriftId(int fieldId) {
5118
        switch(fieldId) {
11819 amit.gupta 5119
          case 1: // CART
5120
            return CART;
6356 amit.gupta 5121
          default:
5122
            return null;
5123
        }
5124
      }
5125
 
5126
      /**
5127
       * Find the _Fields constant that matches fieldId, throwing an exception
5128
       * if it is not found.
5129
       */
5130
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5131
        _Fields fields = findByThriftId(fieldId);
5132
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5133
        return fields;
5134
      }
5135
 
5136
      /**
5137
       * Find the _Fields constant that matches name, or null if its not found.
5138
       */
5139
      public static _Fields findByName(String name) {
5140
        return byName.get(name);
5141
      }
5142
 
5143
      private final short _thriftId;
5144
      private final String _fieldName;
5145
 
5146
      _Fields(short thriftId, String fieldName) {
5147
        _thriftId = thriftId;
5148
        _fieldName = fieldName;
5149
      }
5150
 
5151
      public short getThriftFieldId() {
5152
        return _thriftId;
5153
      }
5154
 
5155
      public String getFieldName() {
5156
        return _fieldName;
5157
      }
5158
    }
5159
 
5160
    // isset id assignments
5161
 
5162
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
5163
    static {
5164
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11819 amit.gupta 5165
      tmpMap.put(_Fields.CART, new org.apache.thrift.meta_data.FieldMetaData("cart", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5166
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Cart.class)));
6356 amit.gupta 5167
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5168
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isCodApplicable_args.class, metaDataMap);
5169
    }
5170
 
5171
    public isCodApplicable_args() {
5172
    }
5173
 
5174
    public isCodApplicable_args(
11819 amit.gupta 5175
      Cart cart)
6356 amit.gupta 5176
    {
5177
      this();
11819 amit.gupta 5178
      this.cart = cart;
6356 amit.gupta 5179
    }
5180
 
5181
    /**
5182
     * Performs a deep copy on <i>other</i>.
5183
     */
5184
    public isCodApplicable_args(isCodApplicable_args other) {
11819 amit.gupta 5185
      if (other.isSetCart()) {
5186
        this.cart = new Cart(other.cart);
6356 amit.gupta 5187
      }
5188
    }
5189
 
5190
    public isCodApplicable_args deepCopy() {
5191
      return new isCodApplicable_args(this);
5192
    }
5193
 
5194
    @Override
5195
    public void clear() {
11819 amit.gupta 5196
      this.cart = null;
6356 amit.gupta 5197
    }
5198
 
11819 amit.gupta 5199
    public Cart getCart() {
5200
      return this.cart;
6356 amit.gupta 5201
    }
5202
 
11819 amit.gupta 5203
    public void setCart(Cart cart) {
5204
      this.cart = cart;
6356 amit.gupta 5205
    }
5206
 
11819 amit.gupta 5207
    public void unsetCart() {
5208
      this.cart = null;
6356 amit.gupta 5209
    }
5210
 
11819 amit.gupta 5211
    /** Returns true if field cart is set (has been assigned a value) and false otherwise */
5212
    public boolean isSetCart() {
5213
      return this.cart != null;
6356 amit.gupta 5214
    }
5215
 
11819 amit.gupta 5216
    public void setCartIsSet(boolean value) {
6356 amit.gupta 5217
      if (!value) {
11819 amit.gupta 5218
        this.cart = null;
6356 amit.gupta 5219
      }
5220
    }
5221
 
5222
    public void setFieldValue(_Fields field, Object value) {
5223
      switch (field) {
11819 amit.gupta 5224
      case CART:
6356 amit.gupta 5225
        if (value == null) {
11819 amit.gupta 5226
          unsetCart();
6356 amit.gupta 5227
        } else {
11819 amit.gupta 5228
          setCart((Cart)value);
6356 amit.gupta 5229
        }
5230
        break;
5231
 
5232
      }
5233
    }
5234
 
5235
    public Object getFieldValue(_Fields field) {
5236
      switch (field) {
11819 amit.gupta 5237
      case CART:
5238
        return getCart();
6356 amit.gupta 5239
 
5240
      }
5241
      throw new IllegalStateException();
5242
    }
5243
 
5244
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5245
    public boolean isSet(_Fields field) {
5246
      if (field == null) {
5247
        throw new IllegalArgumentException();
5248
      }
5249
 
5250
      switch (field) {
11819 amit.gupta 5251
      case CART:
5252
        return isSetCart();
6356 amit.gupta 5253
      }
5254
      throw new IllegalStateException();
5255
    }
5256
 
5257
    @Override
5258
    public boolean equals(Object that) {
5259
      if (that == null)
5260
        return false;
5261
      if (that instanceof isCodApplicable_args)
5262
        return this.equals((isCodApplicable_args)that);
5263
      return false;
5264
    }
5265
 
5266
    public boolean equals(isCodApplicable_args that) {
5267
      if (that == null)
5268
        return false;
5269
 
11819 amit.gupta 5270
      boolean this_present_cart = true && this.isSetCart();
5271
      boolean that_present_cart = true && that.isSetCart();
5272
      if (this_present_cart || that_present_cart) {
5273
        if (!(this_present_cart && that_present_cart))
6356 amit.gupta 5274
          return false;
11819 amit.gupta 5275
        if (!this.cart.equals(that.cart))
6356 amit.gupta 5276
          return false;
5277
      }
5278
 
5279
      return true;
5280
    }
5281
 
5282
    @Override
5283
    public int hashCode() {
5284
      return 0;
5285
    }
5286
 
5287
    public int compareTo(isCodApplicable_args other) {
5288
      if (!getClass().equals(other.getClass())) {
5289
        return getClass().getName().compareTo(other.getClass().getName());
5290
      }
5291
 
5292
      int lastComparison = 0;
5293
      isCodApplicable_args typedOther = (isCodApplicable_args)other;
5294
 
11819 amit.gupta 5295
      lastComparison = Boolean.valueOf(isSetCart()).compareTo(typedOther.isSetCart());
6356 amit.gupta 5296
      if (lastComparison != 0) {
5297
        return lastComparison;
5298
      }
11819 amit.gupta 5299
      if (isSetCart()) {
5300
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cart, typedOther.cart);
6356 amit.gupta 5301
        if (lastComparison != 0) {
5302
          return lastComparison;
5303
        }
5304
      }
5305
      return 0;
5306
    }
5307
 
5308
    public _Fields fieldForId(int fieldId) {
5309
      return _Fields.findByThriftId(fieldId);
5310
    }
5311
 
5312
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5313
      org.apache.thrift.protocol.TField field;
5314
      iprot.readStructBegin();
5315
      while (true)
5316
      {
5317
        field = iprot.readFieldBegin();
5318
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
5319
          break;
5320
        }
5321
        switch (field.id) {
11819 amit.gupta 5322
          case 1: // CART
5323
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5324
              this.cart = new Cart();
5325
              this.cart.read(iprot);
6356 amit.gupta 5326
            } else { 
5327
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5328
            }
5329
            break;
5330
          default:
5331
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5332
        }
5333
        iprot.readFieldEnd();
5334
      }
5335
      iprot.readStructEnd();
5336
      validate();
5337
    }
5338
 
5339
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
5340
      validate();
5341
 
5342
      oprot.writeStructBegin(STRUCT_DESC);
11819 amit.gupta 5343
      if (this.cart != null) {
5344
        oprot.writeFieldBegin(CART_FIELD_DESC);
5345
        this.cart.write(oprot);
6356 amit.gupta 5346
        oprot.writeFieldEnd();
5347
      }
5348
      oprot.writeFieldStop();
5349
      oprot.writeStructEnd();
5350
    }
5351
 
5352
    @Override
5353
    public String toString() {
5354
      StringBuilder sb = new StringBuilder("isCodApplicable_args(");
5355
      boolean first = true;
5356
 
11819 amit.gupta 5357
      sb.append("cart:");
5358
      if (this.cart == null) {
6356 amit.gupta 5359
        sb.append("null");
5360
      } else {
11819 amit.gupta 5361
        sb.append(this.cart);
6356 amit.gupta 5362
      }
5363
      first = false;
5364
      sb.append(")");
5365
      return sb.toString();
5366
    }
5367
 
5368
    public void validate() throws org.apache.thrift.TException {
5369
      // check for required fields
5370
    }
5371
 
5372
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5373
      try {
5374
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5375
      } catch (org.apache.thrift.TException te) {
5376
        throw new java.io.IOException(te);
5377
      }
5378
    }
5379
 
5380
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5381
      try {
5382
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5383
      } catch (org.apache.thrift.TException te) {
5384
        throw new java.io.IOException(te);
5385
      }
5386
    }
5387
 
5388
  }
5389
 
5390
  public static class isCodApplicable_result implements org.apache.thrift.TBase<isCodApplicable_result, isCodApplicable_result._Fields>, java.io.Serializable, Cloneable   {
5391
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isCodApplicable_result");
5392
 
5393
    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);
5394
    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);
5395
 
5396
    private boolean success; // required
5397
    private PromotionException pex; // required
5398
 
5399
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
5400
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
5401
      SUCCESS((short)0, "success"),
5402
      PEX((short)1, "pex");
5403
 
5404
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5405
 
5406
      static {
5407
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5408
          byName.put(field.getFieldName(), field);
5409
        }
5410
      }
5411
 
5412
      /**
5413
       * Find the _Fields constant that matches fieldId, or null if its not found.
5414
       */
5415
      public static _Fields findByThriftId(int fieldId) {
5416
        switch(fieldId) {
5417
          case 0: // SUCCESS
5418
            return SUCCESS;
5419
          case 1: // PEX
5420
            return PEX;
5421
          default:
5422
            return null;
5423
        }
5424
      }
5425
 
5426
      /**
5427
       * Find the _Fields constant that matches fieldId, throwing an exception
5428
       * if it is not found.
5429
       */
5430
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5431
        _Fields fields = findByThriftId(fieldId);
5432
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5433
        return fields;
5434
      }
5435
 
5436
      /**
5437
       * Find the _Fields constant that matches name, or null if its not found.
5438
       */
5439
      public static _Fields findByName(String name) {
5440
        return byName.get(name);
5441
      }
5442
 
5443
      private final short _thriftId;
5444
      private final String _fieldName;
5445
 
5446
      _Fields(short thriftId, String fieldName) {
5447
        _thriftId = thriftId;
5448
        _fieldName = fieldName;
5449
      }
5450
 
5451
      public short getThriftFieldId() {
5452
        return _thriftId;
5453
      }
5454
 
5455
      public String getFieldName() {
5456
        return _fieldName;
5457
      }
5458
    }
5459
 
5460
    // isset id assignments
5461
    private static final int __SUCCESS_ISSET_ID = 0;
5462
    private BitSet __isset_bit_vector = new BitSet(1);
5463
 
5464
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
5465
    static {
5466
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5467
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5468
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
5469
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5470
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
5471
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5472
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isCodApplicable_result.class, metaDataMap);
5473
    }
5474
 
5475
    public isCodApplicable_result() {
5476
    }
5477
 
5478
    public isCodApplicable_result(
5479
      boolean success,
5480
      PromotionException pex)
5481
    {
5482
      this();
5483
      this.success = success;
5484
      setSuccessIsSet(true);
5485
      this.pex = pex;
5486
    }
5487
 
5488
    /**
5489
     * Performs a deep copy on <i>other</i>.
5490
     */
5491
    public isCodApplicable_result(isCodApplicable_result other) {
5492
      __isset_bit_vector.clear();
5493
      __isset_bit_vector.or(other.__isset_bit_vector);
5494
      this.success = other.success;
5495
      if (other.isSetPex()) {
5496
        this.pex = new PromotionException(other.pex);
5497
      }
5498
    }
5499
 
5500
    public isCodApplicable_result deepCopy() {
5501
      return new isCodApplicable_result(this);
5502
    }
5503
 
5504
    @Override
5505
    public void clear() {
5506
      setSuccessIsSet(false);
5507
      this.success = false;
5508
      this.pex = null;
5509
    }
5510
 
5511
    public boolean isSuccess() {
5512
      return this.success;
5513
    }
5514
 
5515
    public void setSuccess(boolean success) {
5516
      this.success = success;
5517
      setSuccessIsSet(true);
5518
    }
5519
 
5520
    public void unsetSuccess() {
5521
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
5522
    }
5523
 
5524
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
5525
    public boolean isSetSuccess() {
5526
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
5527
    }
5528
 
5529
    public void setSuccessIsSet(boolean value) {
5530
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
5531
    }
5532
 
5533
    public PromotionException getPex() {
5534
      return this.pex;
5535
    }
5536
 
5537
    public void setPex(PromotionException pex) {
5538
      this.pex = pex;
5539
    }
5540
 
5541
    public void unsetPex() {
5542
      this.pex = null;
5543
    }
5544
 
5545
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
5546
    public boolean isSetPex() {
5547
      return this.pex != null;
5548
    }
5549
 
5550
    public void setPexIsSet(boolean value) {
5551
      if (!value) {
5552
        this.pex = null;
5553
      }
5554
    }
5555
 
5556
    public void setFieldValue(_Fields field, Object value) {
5557
      switch (field) {
5558
      case SUCCESS:
5559
        if (value == null) {
5560
          unsetSuccess();
5561
        } else {
5562
          setSuccess((Boolean)value);
5563
        }
5564
        break;
5565
 
5566
      case PEX:
5567
        if (value == null) {
5568
          unsetPex();
5569
        } else {
5570
          setPex((PromotionException)value);
5571
        }
5572
        break;
5573
 
5574
      }
5575
    }
5576
 
5577
    public Object getFieldValue(_Fields field) {
5578
      switch (field) {
5579
      case SUCCESS:
5580
        return Boolean.valueOf(isSuccess());
5581
 
5582
      case PEX:
5583
        return getPex();
5584
 
5585
      }
5586
      throw new IllegalStateException();
5587
    }
5588
 
5589
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5590
    public boolean isSet(_Fields field) {
5591
      if (field == null) {
5592
        throw new IllegalArgumentException();
5593
      }
5594
 
5595
      switch (field) {
5596
      case SUCCESS:
5597
        return isSetSuccess();
5598
      case PEX:
5599
        return isSetPex();
5600
      }
5601
      throw new IllegalStateException();
5602
    }
5603
 
5604
    @Override
5605
    public boolean equals(Object that) {
5606
      if (that == null)
5607
        return false;
5608
      if (that instanceof isCodApplicable_result)
5609
        return this.equals((isCodApplicable_result)that);
5610
      return false;
5611
    }
5612
 
5613
    public boolean equals(isCodApplicable_result that) {
5614
      if (that == null)
5615
        return false;
5616
 
5617
      boolean this_present_success = true;
5618
      boolean that_present_success = true;
5619
      if (this_present_success || that_present_success) {
5620
        if (!(this_present_success && that_present_success))
5621
          return false;
5622
        if (this.success != that.success)
5623
          return false;
5624
      }
5625
 
5626
      boolean this_present_pex = true && this.isSetPex();
5627
      boolean that_present_pex = true && that.isSetPex();
5628
      if (this_present_pex || that_present_pex) {
5629
        if (!(this_present_pex && that_present_pex))
5630
          return false;
5631
        if (!this.pex.equals(that.pex))
5632
          return false;
5633
      }
5634
 
5635
      return true;
5636
    }
5637
 
5638
    @Override
5639
    public int hashCode() {
5640
      return 0;
5641
    }
5642
 
5643
    public int compareTo(isCodApplicable_result other) {
5644
      if (!getClass().equals(other.getClass())) {
5645
        return getClass().getName().compareTo(other.getClass().getName());
5646
      }
5647
 
5648
      int lastComparison = 0;
5649
      isCodApplicable_result typedOther = (isCodApplicable_result)other;
5650
 
5651
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
5652
      if (lastComparison != 0) {
5653
        return lastComparison;
5654
      }
5655
      if (isSetSuccess()) {
5656
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
5657
        if (lastComparison != 0) {
5658
          return lastComparison;
5659
        }
5660
      }
5661
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
5662
      if (lastComparison != 0) {
5663
        return lastComparison;
5664
      }
5665
      if (isSetPex()) {
5666
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
5667
        if (lastComparison != 0) {
5668
          return lastComparison;
5669
        }
5670
      }
5671
      return 0;
5672
    }
5673
 
5674
    public _Fields fieldForId(int fieldId) {
5675
      return _Fields.findByThriftId(fieldId);
5676
    }
5677
 
5678
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5679
      org.apache.thrift.protocol.TField field;
5680
      iprot.readStructBegin();
5681
      while (true)
5682
      {
5683
        field = iprot.readFieldBegin();
5684
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
5685
          break;
5686
        }
5687
        switch (field.id) {
5688
          case 0: // SUCCESS
5689
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
5690
              this.success = iprot.readBool();
5691
              setSuccessIsSet(true);
5692
            } else { 
5693
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5694
            }
5695
            break;
5696
          case 1: // PEX
5697
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5698
              this.pex = new PromotionException();
5699
              this.pex.read(iprot);
5700
            } else { 
5701
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5702
            }
5703
            break;
5704
          default:
5705
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5706
        }
5707
        iprot.readFieldEnd();
5708
      }
5709
      iprot.readStructEnd();
5710
      validate();
5711
    }
5712
 
5713
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
5714
      oprot.writeStructBegin(STRUCT_DESC);
5715
 
5716
      if (this.isSetSuccess()) {
5717
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
5718
        oprot.writeBool(this.success);
5719
        oprot.writeFieldEnd();
5720
      } else if (this.isSetPex()) {
5721
        oprot.writeFieldBegin(PEX_FIELD_DESC);
5722
        this.pex.write(oprot);
5723
        oprot.writeFieldEnd();
5724
      }
5725
      oprot.writeFieldStop();
5726
      oprot.writeStructEnd();
5727
    }
5728
 
5729
    @Override
5730
    public String toString() {
5731
      StringBuilder sb = new StringBuilder("isCodApplicable_result(");
5732
      boolean first = true;
5733
 
5734
      sb.append("success:");
5735
      sb.append(this.success);
5736
      first = false;
5737
      if (!first) sb.append(", ");
5738
      sb.append("pex:");
5739
      if (this.pex == null) {
5740
        sb.append("null");
5741
      } else {
5742
        sb.append(this.pex);
5743
      }
5744
      first = false;
5745
      sb.append(")");
5746
      return sb.toString();
5747
    }
5748
 
5749
    public void validate() throws org.apache.thrift.TException {
5750
      // check for required fields
5751
    }
5752
 
5753
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5754
      try {
5755
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5756
      } catch (org.apache.thrift.TException te) {
5757
        throw new java.io.IOException(te);
5758
      }
5759
    }
5760
 
5761
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5762
      try {
5763
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5764
      } catch (org.apache.thrift.TException te) {
5765
        throw new java.io.IOException(te);
5766
      }
5767
    }
5768
 
5769
  }
5770
 
3430 rajveer 5771
  public static class getAllPromotions_args implements org.apache.thrift.TBase<getAllPromotions_args, getAllPromotions_args._Fields>, java.io.Serializable, Cloneable   {
5772
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_args");
1982 varun.gupt 5773
 
5774
 
5775
 
5776
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5777
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5778
;
5779
 
5780
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5781
 
5782
      static {
5783
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5784
          byName.put(field.getFieldName(), field);
5785
        }
5786
      }
5787
 
5788
      /**
5789
       * Find the _Fields constant that matches fieldId, or null if its not found.
5790
       */
5791
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5792
        switch(fieldId) {
5793
          default:
5794
            return null;
5795
        }
1982 varun.gupt 5796
      }
5797
 
5798
      /**
5799
       * Find the _Fields constant that matches fieldId, throwing an exception
5800
       * if it is not found.
5801
       */
5802
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5803
        _Fields fields = findByThriftId(fieldId);
5804
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5805
        return fields;
5806
      }
5807
 
5808
      /**
5809
       * Find the _Fields constant that matches name, or null if its not found.
5810
       */
5811
      public static _Fields findByName(String name) {
5812
        return byName.get(name);
5813
      }
5814
 
5815
      private final short _thriftId;
5816
      private final String _fieldName;
5817
 
5818
      _Fields(short thriftId, String fieldName) {
5819
        _thriftId = thriftId;
5820
        _fieldName = fieldName;
5821
      }
5822
 
5823
      public short getThriftFieldId() {
5824
        return _thriftId;
5825
      }
5826
 
5827
      public String getFieldName() {
5828
        return _fieldName;
5829
      }
5830
    }
3430 rajveer 5831
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5832
    static {
3430 rajveer 5833
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5834
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5835
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_args.class, metaDataMap);
1982 varun.gupt 5836
    }
5837
 
5838
    public getAllPromotions_args() {
5839
    }
5840
 
5841
    /**
5842
     * Performs a deep copy on <i>other</i>.
5843
     */
5844
    public getAllPromotions_args(getAllPromotions_args other) {
5845
    }
5846
 
5847
    public getAllPromotions_args deepCopy() {
5848
      return new getAllPromotions_args(this);
5849
    }
5850
 
3430 rajveer 5851
    @Override
5852
    public void clear() {
1982 varun.gupt 5853
    }
5854
 
5855
    public void setFieldValue(_Fields field, Object value) {
5856
      switch (field) {
5857
      }
5858
    }
5859
 
5860
    public Object getFieldValue(_Fields field) {
5861
      switch (field) {
5862
      }
5863
      throw new IllegalStateException();
5864
    }
5865
 
3430 rajveer 5866
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5867
    public boolean isSet(_Fields field) {
5868
      if (field == null) {
5869
        throw new IllegalArgumentException();
5870
      }
1982 varun.gupt 5871
 
5872
      switch (field) {
5873
      }
5874
      throw new IllegalStateException();
5875
    }
5876
 
5877
    @Override
5878
    public boolean equals(Object that) {
5879
      if (that == null)
5880
        return false;
5881
      if (that instanceof getAllPromotions_args)
5882
        return this.equals((getAllPromotions_args)that);
5883
      return false;
5884
    }
5885
 
5886
    public boolean equals(getAllPromotions_args that) {
5887
      if (that == null)
5888
        return false;
5889
 
5890
      return true;
5891
    }
5892
 
5893
    @Override
5894
    public int hashCode() {
5895
      return 0;
5896
    }
5897
 
5898
    public int compareTo(getAllPromotions_args other) {
5899
      if (!getClass().equals(other.getClass())) {
5900
        return getClass().getName().compareTo(other.getClass().getName());
5901
      }
5902
 
5903
      int lastComparison = 0;
5904
      getAllPromotions_args typedOther = (getAllPromotions_args)other;
5905
 
5906
      return 0;
5907
    }
5908
 
3430 rajveer 5909
    public _Fields fieldForId(int fieldId) {
5910
      return _Fields.findByThriftId(fieldId);
5911
    }
5912
 
5913
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5914
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5915
      iprot.readStructBegin();
5916
      while (true)
5917
      {
5918
        field = iprot.readFieldBegin();
3430 rajveer 5919
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5920
          break;
5921
        }
3430 rajveer 5922
        switch (field.id) {
5923
          default:
5924
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5925
        }
3430 rajveer 5926
        iprot.readFieldEnd();
1982 varun.gupt 5927
      }
5928
      iprot.readStructEnd();
5929
      validate();
5930
    }
5931
 
3430 rajveer 5932
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5933
      validate();
5934
 
5935
      oprot.writeStructBegin(STRUCT_DESC);
5936
      oprot.writeFieldStop();
5937
      oprot.writeStructEnd();
5938
    }
5939
 
5940
    @Override
5941
    public String toString() {
5942
      StringBuilder sb = new StringBuilder("getAllPromotions_args(");
5943
      boolean first = true;
5944
 
5945
      sb.append(")");
5946
      return sb.toString();
5947
    }
5948
 
3430 rajveer 5949
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5950
      // check for required fields
5951
    }
5952
 
3430 rajveer 5953
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5954
      try {
5955
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5956
      } catch (org.apache.thrift.TException te) {
5957
        throw new java.io.IOException(te);
5958
      }
5959
    }
5960
 
5961
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5962
      try {
5963
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5964
      } catch (org.apache.thrift.TException te) {
5965
        throw new java.io.IOException(te);
5966
      }
5967
    }
5968
 
1982 varun.gupt 5969
  }
5970
 
3430 rajveer 5971
  public static class getAllPromotions_result implements org.apache.thrift.TBase<getAllPromotions_result, getAllPromotions_result._Fields>, java.io.Serializable, Cloneable   {
5972
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_result");
1982 varun.gupt 5973
 
3430 rajveer 5974
    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);
5975
    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 5976
 
3430 rajveer 5977
    private List<Promotion> success; // required
5978
    private PromotionException pex; // required
1982 varun.gupt 5979
 
5980
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5981
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5982
      SUCCESS((short)0, "success"),
5983
      PEX((short)1, "pex");
5984
 
5985
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5986
 
5987
      static {
5988
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5989
          byName.put(field.getFieldName(), field);
5990
        }
5991
      }
5992
 
5993
      /**
5994
       * Find the _Fields constant that matches fieldId, or null if its not found.
5995
       */
5996
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5997
        switch(fieldId) {
5998
          case 0: // SUCCESS
5999
            return SUCCESS;
6000
          case 1: // PEX
6001
            return PEX;
6002
          default:
6003
            return null;
6004
        }
1982 varun.gupt 6005
      }
6006
 
6007
      /**
6008
       * Find the _Fields constant that matches fieldId, throwing an exception
6009
       * if it is not found.
6010
       */
6011
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6012
        _Fields fields = findByThriftId(fieldId);
6013
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6014
        return fields;
6015
      }
6016
 
6017
      /**
6018
       * Find the _Fields constant that matches name, or null if its not found.
6019
       */
6020
      public static _Fields findByName(String name) {
6021
        return byName.get(name);
6022
      }
6023
 
6024
      private final short _thriftId;
6025
      private final String _fieldName;
6026
 
6027
      _Fields(short thriftId, String fieldName) {
6028
        _thriftId = thriftId;
6029
        _fieldName = fieldName;
6030
      }
6031
 
6032
      public short getThriftFieldId() {
6033
        return _thriftId;
6034
      }
6035
 
6036
      public String getFieldName() {
6037
        return _fieldName;
6038
      }
6039
    }
6040
 
6041
    // isset id assignments
6042
 
3430 rajveer 6043
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6044
    static {
3430 rajveer 6045
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6046
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6047
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
6048
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class))));
6049
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6050
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
6051
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6052
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_result.class, metaDataMap);
1982 varun.gupt 6053
    }
6054
 
6055
    public getAllPromotions_result() {
6056
    }
6057
 
6058
    public getAllPromotions_result(
6059
      List<Promotion> success,
6060
      PromotionException pex)
6061
    {
6062
      this();
6063
      this.success = success;
6064
      this.pex = pex;
6065
    }
6066
 
6067
    /**
6068
     * Performs a deep copy on <i>other</i>.
6069
     */
6070
    public getAllPromotions_result(getAllPromotions_result other) {
6071
      if (other.isSetSuccess()) {
6072
        List<Promotion> __this__success = new ArrayList<Promotion>();
6073
        for (Promotion other_element : other.success) {
6074
          __this__success.add(new Promotion(other_element));
6075
        }
6076
        this.success = __this__success;
6077
      }
6078
      if (other.isSetPex()) {
6079
        this.pex = new PromotionException(other.pex);
6080
      }
6081
    }
6082
 
6083
    public getAllPromotions_result deepCopy() {
6084
      return new getAllPromotions_result(this);
6085
    }
6086
 
3430 rajveer 6087
    @Override
6088
    public void clear() {
6089
      this.success = null;
6090
      this.pex = null;
1982 varun.gupt 6091
    }
6092
 
6093
    public int getSuccessSize() {
6094
      return (this.success == null) ? 0 : this.success.size();
6095
    }
6096
 
6097
    public java.util.Iterator<Promotion> getSuccessIterator() {
6098
      return (this.success == null) ? null : this.success.iterator();
6099
    }
6100
 
6101
    public void addToSuccess(Promotion elem) {
6102
      if (this.success == null) {
6103
        this.success = new ArrayList<Promotion>();
6104
      }
6105
      this.success.add(elem);
6106
    }
6107
 
6108
    public List<Promotion> getSuccess() {
6109
      return this.success;
6110
    }
6111
 
3430 rajveer 6112
    public void setSuccess(List<Promotion> success) {
1982 varun.gupt 6113
      this.success = success;
6114
    }
6115
 
6116
    public void unsetSuccess() {
6117
      this.success = null;
6118
    }
6119
 
3430 rajveer 6120
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6121
    public boolean isSetSuccess() {
6122
      return this.success != null;
6123
    }
6124
 
6125
    public void setSuccessIsSet(boolean value) {
6126
      if (!value) {
6127
        this.success = null;
6128
      }
6129
    }
6130
 
6131
    public PromotionException getPex() {
6132
      return this.pex;
6133
    }
6134
 
3430 rajveer 6135
    public void setPex(PromotionException pex) {
1982 varun.gupt 6136
      this.pex = pex;
6137
    }
6138
 
6139
    public void unsetPex() {
6140
      this.pex = null;
6141
    }
6142
 
3430 rajveer 6143
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6144
    public boolean isSetPex() {
6145
      return this.pex != null;
6146
    }
6147
 
6148
    public void setPexIsSet(boolean value) {
6149
      if (!value) {
6150
        this.pex = null;
6151
      }
6152
    }
6153
 
6154
    public void setFieldValue(_Fields field, Object value) {
6155
      switch (field) {
6156
      case SUCCESS:
6157
        if (value == null) {
6158
          unsetSuccess();
6159
        } else {
6160
          setSuccess((List<Promotion>)value);
6161
        }
6162
        break;
6163
 
6164
      case PEX:
6165
        if (value == null) {
6166
          unsetPex();
6167
        } else {
6168
          setPex((PromotionException)value);
6169
        }
6170
        break;
6171
 
6172
      }
6173
    }
6174
 
6175
    public Object getFieldValue(_Fields field) {
6176
      switch (field) {
6177
      case SUCCESS:
6178
        return getSuccess();
6179
 
6180
      case PEX:
6181
        return getPex();
6182
 
6183
      }
6184
      throw new IllegalStateException();
6185
    }
6186
 
3430 rajveer 6187
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6188
    public boolean isSet(_Fields field) {
6189
      if (field == null) {
6190
        throw new IllegalArgumentException();
6191
      }
1982 varun.gupt 6192
 
6193
      switch (field) {
6194
      case SUCCESS:
6195
        return isSetSuccess();
6196
      case PEX:
6197
        return isSetPex();
6198
      }
6199
      throw new IllegalStateException();
6200
    }
6201
 
6202
    @Override
6203
    public boolean equals(Object that) {
6204
      if (that == null)
6205
        return false;
6206
      if (that instanceof getAllPromotions_result)
6207
        return this.equals((getAllPromotions_result)that);
6208
      return false;
6209
    }
6210
 
6211
    public boolean equals(getAllPromotions_result that) {
6212
      if (that == null)
6213
        return false;
6214
 
6215
      boolean this_present_success = true && this.isSetSuccess();
6216
      boolean that_present_success = true && that.isSetSuccess();
6217
      if (this_present_success || that_present_success) {
6218
        if (!(this_present_success && that_present_success))
6219
          return false;
6220
        if (!this.success.equals(that.success))
6221
          return false;
6222
      }
6223
 
6224
      boolean this_present_pex = true && this.isSetPex();
6225
      boolean that_present_pex = true && that.isSetPex();
6226
      if (this_present_pex || that_present_pex) {
6227
        if (!(this_present_pex && that_present_pex))
6228
          return false;
6229
        if (!this.pex.equals(that.pex))
6230
          return false;
6231
      }
6232
 
6233
      return true;
6234
    }
6235
 
6236
    @Override
6237
    public int hashCode() {
6238
      return 0;
6239
    }
6240
 
6241
    public int compareTo(getAllPromotions_result other) {
6242
      if (!getClass().equals(other.getClass())) {
6243
        return getClass().getName().compareTo(other.getClass().getName());
6244
      }
6245
 
6246
      int lastComparison = 0;
6247
      getAllPromotions_result typedOther = (getAllPromotions_result)other;
6248
 
3430 rajveer 6249
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 6250
      if (lastComparison != 0) {
6251
        return lastComparison;
6252
      }
3430 rajveer 6253
      if (isSetSuccess()) {
6254
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
6255
        if (lastComparison != 0) {
6256
          return lastComparison;
6257
        }
1982 varun.gupt 6258
      }
3430 rajveer 6259
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 6260
      if (lastComparison != 0) {
6261
        return lastComparison;
6262
      }
3430 rajveer 6263
      if (isSetPex()) {
6264
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
6265
        if (lastComparison != 0) {
6266
          return lastComparison;
6267
        }
1982 varun.gupt 6268
      }
6269
      return 0;
6270
    }
6271
 
3430 rajveer 6272
    public _Fields fieldForId(int fieldId) {
6273
      return _Fields.findByThriftId(fieldId);
6274
    }
6275
 
6276
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6277
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6278
      iprot.readStructBegin();
6279
      while (true)
6280
      {
6281
        field = iprot.readFieldBegin();
3430 rajveer 6282
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6283
          break;
6284
        }
3430 rajveer 6285
        switch (field.id) {
6286
          case 0: // SUCCESS
6287
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
6288
              {
11592 amit.gupta 6289
                org.apache.thrift.protocol.TList _list16 = iprot.readListBegin();
6290
                this.success = new ArrayList<Promotion>(_list16.size);
6291
                for (int _i17 = 0; _i17 < _list16.size; ++_i17)
1982 varun.gupt 6292
                {
11592 amit.gupta 6293
                  Promotion _elem18; // required
6294
                  _elem18 = new Promotion();
6295
                  _elem18.read(iprot);
6296
                  this.success.add(_elem18);
1982 varun.gupt 6297
                }
3430 rajveer 6298
                iprot.readListEnd();
1982 varun.gupt 6299
              }
3430 rajveer 6300
            } else { 
6301
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6302
            }
6303
            break;
6304
          case 1: // PEX
6305
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6306
              this.pex = new PromotionException();
6307
              this.pex.read(iprot);
6308
            } else { 
6309
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6310
            }
6311
            break;
6312
          default:
6313
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6314
        }
3430 rajveer 6315
        iprot.readFieldEnd();
1982 varun.gupt 6316
      }
6317
      iprot.readStructEnd();
6318
      validate();
6319
    }
6320
 
3430 rajveer 6321
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6322
      oprot.writeStructBegin(STRUCT_DESC);
6323
 
6324
      if (this.isSetSuccess()) {
6325
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
6326
        {
3430 rajveer 6327
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
11592 amit.gupta 6328
          for (Promotion _iter19 : this.success)
1982 varun.gupt 6329
          {
11592 amit.gupta 6330
            _iter19.write(oprot);
1982 varun.gupt 6331
          }
6332
          oprot.writeListEnd();
6333
        }
6334
        oprot.writeFieldEnd();
6335
      } else if (this.isSetPex()) {
6336
        oprot.writeFieldBegin(PEX_FIELD_DESC);
6337
        this.pex.write(oprot);
6338
        oprot.writeFieldEnd();
6339
      }
6340
      oprot.writeFieldStop();
6341
      oprot.writeStructEnd();
6342
    }
6343
 
6344
    @Override
6345
    public String toString() {
6346
      StringBuilder sb = new StringBuilder("getAllPromotions_result(");
6347
      boolean first = true;
6348
 
6349
      sb.append("success:");
6350
      if (this.success == null) {
6351
        sb.append("null");
6352
      } else {
6353
        sb.append(this.success);
6354
      }
6355
      first = false;
6356
      if (!first) sb.append(", ");
6357
      sb.append("pex:");
6358
      if (this.pex == null) {
6359
        sb.append("null");
6360
      } else {
6361
        sb.append(this.pex);
6362
      }
6363
      first = false;
6364
      sb.append(")");
6365
      return sb.toString();
6366
    }
6367
 
3430 rajveer 6368
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6369
      // check for required fields
6370
    }
6371
 
3430 rajveer 6372
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6373
      try {
6374
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6375
      } catch (org.apache.thrift.TException te) {
6376
        throw new java.io.IOException(te);
6377
      }
6378
    }
6379
 
6380
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6381
      try {
6382
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6383
      } catch (org.apache.thrift.TException te) {
6384
        throw new java.io.IOException(te);
6385
      }
6386
    }
6387
 
1982 varun.gupt 6388
  }
6389
 
3430 rajveer 6390
  public static class getPromotionById_args implements org.apache.thrift.TBase<getPromotionById_args, getPromotionById_args._Fields>, java.io.Serializable, Cloneable   {
6391
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_args");
1982 varun.gupt 6392
 
3430 rajveer 6393
    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 6394
 
3430 rajveer 6395
    private long promotionId; // required
1982 varun.gupt 6396
 
6397
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6398
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6399
      PROMOTION_ID((short)1, "promotionId");
6400
 
6401
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6402
 
6403
      static {
6404
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6405
          byName.put(field.getFieldName(), field);
6406
        }
6407
      }
6408
 
6409
      /**
6410
       * Find the _Fields constant that matches fieldId, or null if its not found.
6411
       */
6412
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6413
        switch(fieldId) {
6414
          case 1: // PROMOTION_ID
6415
            return PROMOTION_ID;
6416
          default:
6417
            return null;
6418
        }
1982 varun.gupt 6419
      }
6420
 
6421
      /**
6422
       * Find the _Fields constant that matches fieldId, throwing an exception
6423
       * if it is not found.
6424
       */
6425
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6426
        _Fields fields = findByThriftId(fieldId);
6427
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6428
        return fields;
6429
      }
6430
 
6431
      /**
6432
       * Find the _Fields constant that matches name, or null if its not found.
6433
       */
6434
      public static _Fields findByName(String name) {
6435
        return byName.get(name);
6436
      }
6437
 
6438
      private final short _thriftId;
6439
      private final String _fieldName;
6440
 
6441
      _Fields(short thriftId, String fieldName) {
6442
        _thriftId = thriftId;
6443
        _fieldName = fieldName;
6444
      }
6445
 
6446
      public short getThriftFieldId() {
6447
        return _thriftId;
6448
      }
6449
 
6450
      public String getFieldName() {
6451
        return _fieldName;
6452
      }
6453
    }
6454
 
6455
    // isset id assignments
6456
    private static final int __PROMOTIONID_ISSET_ID = 0;
6457
    private BitSet __isset_bit_vector = new BitSet(1);
6458
 
3430 rajveer 6459
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6460
    static {
3430 rajveer 6461
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6462
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6463
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6464
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6465
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_args.class, metaDataMap);
1982 varun.gupt 6466
    }
6467
 
6468
    public getPromotionById_args() {
6469
    }
6470
 
6471
    public getPromotionById_args(
6472
      long promotionId)
6473
    {
6474
      this();
6475
      this.promotionId = promotionId;
6476
      setPromotionIdIsSet(true);
6477
    }
6478
 
6479
    /**
6480
     * Performs a deep copy on <i>other</i>.
6481
     */
6482
    public getPromotionById_args(getPromotionById_args other) {
6483
      __isset_bit_vector.clear();
6484
      __isset_bit_vector.or(other.__isset_bit_vector);
6485
      this.promotionId = other.promotionId;
6486
    }
6487
 
6488
    public getPromotionById_args deepCopy() {
6489
      return new getPromotionById_args(this);
6490
    }
6491
 
3430 rajveer 6492
    @Override
6493
    public void clear() {
6494
      setPromotionIdIsSet(false);
6495
      this.promotionId = 0;
1982 varun.gupt 6496
    }
6497
 
6498
    public long getPromotionId() {
6499
      return this.promotionId;
6500
    }
6501
 
3430 rajveer 6502
    public void setPromotionId(long promotionId) {
1982 varun.gupt 6503
      this.promotionId = promotionId;
6504
      setPromotionIdIsSet(true);
6505
    }
6506
 
6507
    public void unsetPromotionId() {
6508
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
6509
    }
6510
 
3430 rajveer 6511
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6512
    public boolean isSetPromotionId() {
6513
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
6514
    }
6515
 
6516
    public void setPromotionIdIsSet(boolean value) {
6517
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
6518
    }
6519
 
6520
    public void setFieldValue(_Fields field, Object value) {
6521
      switch (field) {
6522
      case PROMOTION_ID:
6523
        if (value == null) {
6524
          unsetPromotionId();
6525
        } else {
6526
          setPromotionId((Long)value);
6527
        }
6528
        break;
6529
 
6530
      }
6531
    }
6532
 
6533
    public Object getFieldValue(_Fields field) {
6534
      switch (field) {
6535
      case PROMOTION_ID:
3430 rajveer 6536
        return Long.valueOf(getPromotionId());
1982 varun.gupt 6537
 
6538
      }
6539
      throw new IllegalStateException();
6540
    }
6541
 
3430 rajveer 6542
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6543
    public boolean isSet(_Fields field) {
6544
      if (field == null) {
6545
        throw new IllegalArgumentException();
6546
      }
1982 varun.gupt 6547
 
6548
      switch (field) {
6549
      case PROMOTION_ID:
6550
        return isSetPromotionId();
6551
      }
6552
      throw new IllegalStateException();
6553
    }
6554
 
6555
    @Override
6556
    public boolean equals(Object that) {
6557
      if (that == null)
6558
        return false;
6559
      if (that instanceof getPromotionById_args)
6560
        return this.equals((getPromotionById_args)that);
6561
      return false;
6562
    }
6563
 
6564
    public boolean equals(getPromotionById_args that) {
6565
      if (that == null)
6566
        return false;
6567
 
6568
      boolean this_present_promotionId = true;
6569
      boolean that_present_promotionId = true;
6570
      if (this_present_promotionId || that_present_promotionId) {
6571
        if (!(this_present_promotionId && that_present_promotionId))
6572
          return false;
6573
        if (this.promotionId != that.promotionId)
6574
          return false;
6575
      }
6576
 
6577
      return true;
6578
    }
6579
 
6580
    @Override
6581
    public int hashCode() {
6582
      return 0;
6583
    }
6584
 
6585
    public int compareTo(getPromotionById_args other) {
6586
      if (!getClass().equals(other.getClass())) {
6587
        return getClass().getName().compareTo(other.getClass().getName());
6588
      }
6589
 
6590
      int lastComparison = 0;
6591
      getPromotionById_args typedOther = (getPromotionById_args)other;
6592
 
3430 rajveer 6593
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 6594
      if (lastComparison != 0) {
6595
        return lastComparison;
6596
      }
3430 rajveer 6597
      if (isSetPromotionId()) {
6598
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
6599
        if (lastComparison != 0) {
6600
          return lastComparison;
6601
        }
1982 varun.gupt 6602
      }
6603
      return 0;
6604
    }
6605
 
3430 rajveer 6606
    public _Fields fieldForId(int fieldId) {
6607
      return _Fields.findByThriftId(fieldId);
6608
    }
6609
 
6610
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6611
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6612
      iprot.readStructBegin();
6613
      while (true)
6614
      {
6615
        field = iprot.readFieldBegin();
3430 rajveer 6616
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6617
          break;
6618
        }
3430 rajveer 6619
        switch (field.id) {
6620
          case 1: // PROMOTION_ID
6621
            if (field.type == org.apache.thrift.protocol.TType.I64) {
6622
              this.promotionId = iprot.readI64();
6623
              setPromotionIdIsSet(true);
6624
            } else { 
6625
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6626
            }
6627
            break;
6628
          default:
6629
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6630
        }
3430 rajveer 6631
        iprot.readFieldEnd();
1982 varun.gupt 6632
      }
6633
      iprot.readStructEnd();
6634
      validate();
6635
    }
6636
 
3430 rajveer 6637
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6638
      validate();
6639
 
6640
      oprot.writeStructBegin(STRUCT_DESC);
6641
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
6642
      oprot.writeI64(this.promotionId);
6643
      oprot.writeFieldEnd();
6644
      oprot.writeFieldStop();
6645
      oprot.writeStructEnd();
6646
    }
6647
 
6648
    @Override
6649
    public String toString() {
6650
      StringBuilder sb = new StringBuilder("getPromotionById_args(");
6651
      boolean first = true;
6652
 
6653
      sb.append("promotionId:");
6654
      sb.append(this.promotionId);
6655
      first = false;
6656
      sb.append(")");
6657
      return sb.toString();
6658
    }
6659
 
3430 rajveer 6660
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6661
      // check for required fields
6662
    }
6663
 
3430 rajveer 6664
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6665
      try {
6666
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6667
      } catch (org.apache.thrift.TException te) {
6668
        throw new java.io.IOException(te);
6669
      }
6670
    }
6671
 
6672
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6673
      try {
6674
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
6675
        __isset_bit_vector = new BitSet(1);
6676
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6677
      } catch (org.apache.thrift.TException te) {
6678
        throw new java.io.IOException(te);
6679
      }
6680
    }
6681
 
1982 varun.gupt 6682
  }
6683
 
3430 rajveer 6684
  public static class getPromotionById_result implements org.apache.thrift.TBase<getPromotionById_result, getPromotionById_result._Fields>, java.io.Serializable, Cloneable   {
6685
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_result");
1982 varun.gupt 6686
 
3430 rajveer 6687
    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);
6688
    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 6689
 
3430 rajveer 6690
    private Promotion success; // required
6691
    private PromotionException pex; // required
1982 varun.gupt 6692
 
6693
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6694
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6695
      SUCCESS((short)0, "success"),
6696
      PEX((short)1, "pex");
6697
 
6698
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6699
 
6700
      static {
6701
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6702
          byName.put(field.getFieldName(), field);
6703
        }
6704
      }
6705
 
6706
      /**
6707
       * Find the _Fields constant that matches fieldId, or null if its not found.
6708
       */
6709
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6710
        switch(fieldId) {
6711
          case 0: // SUCCESS
6712
            return SUCCESS;
6713
          case 1: // PEX
6714
            return PEX;
6715
          default:
6716
            return null;
6717
        }
1982 varun.gupt 6718
      }
6719
 
6720
      /**
6721
       * Find the _Fields constant that matches fieldId, throwing an exception
6722
       * if it is not found.
6723
       */
6724
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6725
        _Fields fields = findByThriftId(fieldId);
6726
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6727
        return fields;
6728
      }
6729
 
6730
      /**
6731
       * Find the _Fields constant that matches name, or null if its not found.
6732
       */
6733
      public static _Fields findByName(String name) {
6734
        return byName.get(name);
6735
      }
6736
 
6737
      private final short _thriftId;
6738
      private final String _fieldName;
6739
 
6740
      _Fields(short thriftId, String fieldName) {
6741
        _thriftId = thriftId;
6742
        _fieldName = fieldName;
6743
      }
6744
 
6745
      public short getThriftFieldId() {
6746
        return _thriftId;
6747
      }
6748
 
6749
      public String getFieldName() {
6750
        return _fieldName;
6751
      }
6752
    }
6753
 
6754
    // isset id assignments
6755
 
3430 rajveer 6756
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6757
    static {
3430 rajveer 6758
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6759
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6760
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class)));
6761
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6762
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
6763
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6764
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_result.class, metaDataMap);
1982 varun.gupt 6765
    }
6766
 
6767
    public getPromotionById_result() {
6768
    }
6769
 
6770
    public getPromotionById_result(
6771
      Promotion success,
6772
      PromotionException pex)
6773
    {
6774
      this();
6775
      this.success = success;
6776
      this.pex = pex;
6777
    }
6778
 
6779
    /**
6780
     * Performs a deep copy on <i>other</i>.
6781
     */
6782
    public getPromotionById_result(getPromotionById_result other) {
6783
      if (other.isSetSuccess()) {
6784
        this.success = new Promotion(other.success);
6785
      }
6786
      if (other.isSetPex()) {
6787
        this.pex = new PromotionException(other.pex);
6788
      }
6789
    }
6790
 
6791
    public getPromotionById_result deepCopy() {
6792
      return new getPromotionById_result(this);
6793
    }
6794
 
3430 rajveer 6795
    @Override
6796
    public void clear() {
6797
      this.success = null;
6798
      this.pex = null;
1982 varun.gupt 6799
    }
6800
 
6801
    public Promotion getSuccess() {
6802
      return this.success;
6803
    }
6804
 
3430 rajveer 6805
    public void setSuccess(Promotion success) {
1982 varun.gupt 6806
      this.success = success;
6807
    }
6808
 
6809
    public void unsetSuccess() {
6810
      this.success = null;
6811
    }
6812
 
3430 rajveer 6813
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6814
    public boolean isSetSuccess() {
6815
      return this.success != null;
6816
    }
6817
 
6818
    public void setSuccessIsSet(boolean value) {
6819
      if (!value) {
6820
        this.success = null;
6821
      }
6822
    }
6823
 
6824
    public PromotionException getPex() {
6825
      return this.pex;
6826
    }
6827
 
3430 rajveer 6828
    public void setPex(PromotionException pex) {
1982 varun.gupt 6829
      this.pex = pex;
6830
    }
6831
 
6832
    public void unsetPex() {
6833
      this.pex = null;
6834
    }
6835
 
3430 rajveer 6836
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6837
    public boolean isSetPex() {
6838
      return this.pex != null;
6839
    }
6840
 
6841
    public void setPexIsSet(boolean value) {
6842
      if (!value) {
6843
        this.pex = null;
6844
      }
6845
    }
6846
 
6847
    public void setFieldValue(_Fields field, Object value) {
6848
      switch (field) {
6849
      case SUCCESS:
6850
        if (value == null) {
6851
          unsetSuccess();
6852
        } else {
6853
          setSuccess((Promotion)value);
6854
        }
6855
        break;
6856
 
6857
      case PEX:
6858
        if (value == null) {
6859
          unsetPex();
6860
        } else {
6861
          setPex((PromotionException)value);
6862
        }
6863
        break;
6864
 
6865
      }
6866
    }
6867
 
6868
    public Object getFieldValue(_Fields field) {
6869
      switch (field) {
6870
      case SUCCESS:
6871
        return getSuccess();
6872
 
6873
      case PEX:
6874
        return getPex();
6875
 
6876
      }
6877
      throw new IllegalStateException();
6878
    }
6879
 
3430 rajveer 6880
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6881
    public boolean isSet(_Fields field) {
6882
      if (field == null) {
6883
        throw new IllegalArgumentException();
6884
      }
1982 varun.gupt 6885
 
6886
      switch (field) {
6887
      case SUCCESS:
6888
        return isSetSuccess();
6889
      case PEX:
6890
        return isSetPex();
6891
      }
6892
      throw new IllegalStateException();
6893
    }
6894
 
6895
    @Override
6896
    public boolean equals(Object that) {
6897
      if (that == null)
6898
        return false;
6899
      if (that instanceof getPromotionById_result)
6900
        return this.equals((getPromotionById_result)that);
6901
      return false;
6902
    }
6903
 
6904
    public boolean equals(getPromotionById_result that) {
6905
      if (that == null)
6906
        return false;
6907
 
6908
      boolean this_present_success = true && this.isSetSuccess();
6909
      boolean that_present_success = true && that.isSetSuccess();
6910
      if (this_present_success || that_present_success) {
6911
        if (!(this_present_success && that_present_success))
6912
          return false;
6913
        if (!this.success.equals(that.success))
6914
          return false;
6915
      }
6916
 
6917
      boolean this_present_pex = true && this.isSetPex();
6918
      boolean that_present_pex = true && that.isSetPex();
6919
      if (this_present_pex || that_present_pex) {
6920
        if (!(this_present_pex && that_present_pex))
6921
          return false;
6922
        if (!this.pex.equals(that.pex))
6923
          return false;
6924
      }
6925
 
6926
      return true;
6927
    }
6928
 
6929
    @Override
6930
    public int hashCode() {
6931
      return 0;
6932
    }
6933
 
6934
    public int compareTo(getPromotionById_result other) {
6935
      if (!getClass().equals(other.getClass())) {
6936
        return getClass().getName().compareTo(other.getClass().getName());
6937
      }
6938
 
6939
      int lastComparison = 0;
6940
      getPromotionById_result typedOther = (getPromotionById_result)other;
6941
 
3430 rajveer 6942
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 6943
      if (lastComparison != 0) {
6944
        return lastComparison;
6945
      }
3430 rajveer 6946
      if (isSetSuccess()) {
6947
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
6948
        if (lastComparison != 0) {
6949
          return lastComparison;
6950
        }
1982 varun.gupt 6951
      }
3430 rajveer 6952
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 6953
      if (lastComparison != 0) {
6954
        return lastComparison;
6955
      }
3430 rajveer 6956
      if (isSetPex()) {
6957
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
6958
        if (lastComparison != 0) {
6959
          return lastComparison;
6960
        }
1982 varun.gupt 6961
      }
6962
      return 0;
6963
    }
6964
 
3430 rajveer 6965
    public _Fields fieldForId(int fieldId) {
6966
      return _Fields.findByThriftId(fieldId);
6967
    }
6968
 
6969
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6970
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6971
      iprot.readStructBegin();
6972
      while (true)
6973
      {
6974
        field = iprot.readFieldBegin();
3430 rajveer 6975
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6976
          break;
6977
        }
3430 rajveer 6978
        switch (field.id) {
6979
          case 0: // SUCCESS
6980
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6981
              this.success = new Promotion();
6982
              this.success.read(iprot);
6983
            } else { 
6984
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6985
            }
6986
            break;
6987
          case 1: // PEX
6988
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6989
              this.pex = new PromotionException();
6990
              this.pex.read(iprot);
6991
            } else { 
6992
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6993
            }
6994
            break;
6995
          default:
6996
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6997
        }
3430 rajveer 6998
        iprot.readFieldEnd();
1982 varun.gupt 6999
      }
7000
      iprot.readStructEnd();
7001
      validate();
7002
    }
7003
 
3430 rajveer 7004
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 7005
      oprot.writeStructBegin(STRUCT_DESC);
7006
 
7007
      if (this.isSetSuccess()) {
7008
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
7009
        this.success.write(oprot);
7010
        oprot.writeFieldEnd();
7011
      } else if (this.isSetPex()) {
7012
        oprot.writeFieldBegin(PEX_FIELD_DESC);
7013
        this.pex.write(oprot);
7014
        oprot.writeFieldEnd();
7015
      }
7016
      oprot.writeFieldStop();
7017
      oprot.writeStructEnd();
7018
    }
7019
 
7020
    @Override
7021
    public String toString() {
7022
      StringBuilder sb = new StringBuilder("getPromotionById_result(");
7023
      boolean first = true;
7024
 
7025
      sb.append("success:");
7026
      if (this.success == null) {
7027
        sb.append("null");
7028
      } else {
7029
        sb.append(this.success);
7030
      }
7031
      first = false;
7032
      if (!first) sb.append(", ");
7033
      sb.append("pex:");
7034
      if (this.pex == null) {
7035
        sb.append("null");
7036
      } else {
7037
        sb.append(this.pex);
7038
      }
7039
      first = false;
7040
      sb.append(")");
7041
      return sb.toString();
7042
    }
7043
 
3430 rajveer 7044
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7045
      // check for required fields
7046
    }
7047
 
3430 rajveer 7048
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7049
      try {
7050
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7051
      } catch (org.apache.thrift.TException te) {
7052
        throw new java.io.IOException(te);
7053
      }
7054
    }
7055
 
7056
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7057
      try {
7058
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7059
      } catch (org.apache.thrift.TException te) {
7060
        throw new java.io.IOException(te);
7061
      }
7062
    }
7063
 
1982 varun.gupt 7064
  }
7065
 
3430 rajveer 7066
  public static class generateCouponsForPromotion_args implements org.apache.thrift.TBase<generateCouponsForPromotion_args, generateCouponsForPromotion_args._Fields>, java.io.Serializable, Cloneable   {
7067
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_args");
1982 varun.gupt 7068
 
3430 rajveer 7069
    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);
7070
    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 7071
 
3430 rajveer 7072
    private long promotionId; // required
7073
    private String couponCode; // required
1982 varun.gupt 7074
 
7075
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7076
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 7077
      PROMOTION_ID((short)1, "promotionId"),
7078
      COUPON_CODE((short)2, "couponCode");
7079
 
7080
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7081
 
7082
      static {
7083
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7084
          byName.put(field.getFieldName(), field);
7085
        }
7086
      }
7087
 
7088
      /**
7089
       * Find the _Fields constant that matches fieldId, or null if its not found.
7090
       */
7091
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7092
        switch(fieldId) {
7093
          case 1: // PROMOTION_ID
7094
            return PROMOTION_ID;
7095
          case 2: // COUPON_CODE
7096
            return COUPON_CODE;
7097
          default:
7098
            return null;
7099
        }
1982 varun.gupt 7100
      }
7101
 
7102
      /**
7103
       * Find the _Fields constant that matches fieldId, throwing an exception
7104
       * if it is not found.
7105
       */
7106
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7107
        _Fields fields = findByThriftId(fieldId);
7108
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7109
        return fields;
7110
      }
7111
 
7112
      /**
7113
       * Find the _Fields constant that matches name, or null if its not found.
7114
       */
7115
      public static _Fields findByName(String name) {
7116
        return byName.get(name);
7117
      }
7118
 
7119
      private final short _thriftId;
7120
      private final String _fieldName;
7121
 
7122
      _Fields(short thriftId, String fieldName) {
7123
        _thriftId = thriftId;
7124
        _fieldName = fieldName;
7125
      }
7126
 
7127
      public short getThriftFieldId() {
7128
        return _thriftId;
7129
      }
7130
 
7131
      public String getFieldName() {
7132
        return _fieldName;
7133
      }
7134
    }
7135
 
7136
    // isset id assignments
7137
    private static final int __PROMOTIONID_ISSET_ID = 0;
7138
    private BitSet __isset_bit_vector = new BitSet(1);
7139
 
3430 rajveer 7140
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 7141
    static {
3430 rajveer 7142
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7143
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7144
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7145
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7146
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
7147
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7148
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_args.class, metaDataMap);
1982 varun.gupt 7149
    }
7150
 
7151
    public generateCouponsForPromotion_args() {
7152
    }
7153
 
7154
    public generateCouponsForPromotion_args(
7155
      long promotionId,
7156
      String couponCode)
7157
    {
7158
      this();
7159
      this.promotionId = promotionId;
7160
      setPromotionIdIsSet(true);
7161
      this.couponCode = couponCode;
7162
    }
7163
 
7164
    /**
7165
     * Performs a deep copy on <i>other</i>.
7166
     */
7167
    public generateCouponsForPromotion_args(generateCouponsForPromotion_args other) {
7168
      __isset_bit_vector.clear();
7169
      __isset_bit_vector.or(other.__isset_bit_vector);
7170
      this.promotionId = other.promotionId;
7171
      if (other.isSetCouponCode()) {
7172
        this.couponCode = other.couponCode;
7173
      }
7174
    }
7175
 
7176
    public generateCouponsForPromotion_args deepCopy() {
7177
      return new generateCouponsForPromotion_args(this);
7178
    }
7179
 
3430 rajveer 7180
    @Override
7181
    public void clear() {
7182
      setPromotionIdIsSet(false);
7183
      this.promotionId = 0;
7184
      this.couponCode = null;
1982 varun.gupt 7185
    }
7186
 
7187
    public long getPromotionId() {
7188
      return this.promotionId;
7189
    }
7190
 
3430 rajveer 7191
    public void setPromotionId(long promotionId) {
1982 varun.gupt 7192
      this.promotionId = promotionId;
7193
      setPromotionIdIsSet(true);
7194
    }
7195
 
7196
    public void unsetPromotionId() {
7197
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
7198
    }
7199
 
3430 rajveer 7200
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7201
    public boolean isSetPromotionId() {
7202
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
7203
    }
7204
 
7205
    public void setPromotionIdIsSet(boolean value) {
7206
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
7207
    }
7208
 
7209
    public String getCouponCode() {
7210
      return this.couponCode;
7211
    }
7212
 
3430 rajveer 7213
    public void setCouponCode(String couponCode) {
1982 varun.gupt 7214
      this.couponCode = couponCode;
7215
    }
7216
 
7217
    public void unsetCouponCode() {
7218
      this.couponCode = null;
7219
    }
7220
 
3430 rajveer 7221
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7222
    public boolean isSetCouponCode() {
7223
      return this.couponCode != null;
7224
    }
7225
 
7226
    public void setCouponCodeIsSet(boolean value) {
7227
      if (!value) {
7228
        this.couponCode = null;
7229
      }
7230
    }
7231
 
7232
    public void setFieldValue(_Fields field, Object value) {
7233
      switch (field) {
7234
      case PROMOTION_ID:
7235
        if (value == null) {
7236
          unsetPromotionId();
7237
        } else {
7238
          setPromotionId((Long)value);
7239
        }
7240
        break;
7241
 
7242
      case COUPON_CODE:
7243
        if (value == null) {
7244
          unsetCouponCode();
7245
        } else {
7246
          setCouponCode((String)value);
7247
        }
7248
        break;
7249
 
7250
      }
7251
    }
7252
 
7253
    public Object getFieldValue(_Fields field) {
7254
      switch (field) {
7255
      case PROMOTION_ID:
3430 rajveer 7256
        return Long.valueOf(getPromotionId());
1982 varun.gupt 7257
 
7258
      case COUPON_CODE:
7259
        return getCouponCode();
7260
 
7261
      }
7262
      throw new IllegalStateException();
7263
    }
7264
 
3430 rajveer 7265
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7266
    public boolean isSet(_Fields field) {
7267
      if (field == null) {
7268
        throw new IllegalArgumentException();
7269
      }
1982 varun.gupt 7270
 
7271
      switch (field) {
7272
      case PROMOTION_ID:
7273
        return isSetPromotionId();
7274
      case COUPON_CODE:
7275
        return isSetCouponCode();
7276
      }
7277
      throw new IllegalStateException();
7278
    }
7279
 
7280
    @Override
7281
    public boolean equals(Object that) {
7282
      if (that == null)
7283
        return false;
7284
      if (that instanceof generateCouponsForPromotion_args)
7285
        return this.equals((generateCouponsForPromotion_args)that);
7286
      return false;
7287
    }
7288
 
7289
    public boolean equals(generateCouponsForPromotion_args that) {
7290
      if (that == null)
7291
        return false;
7292
 
7293
      boolean this_present_promotionId = true;
7294
      boolean that_present_promotionId = true;
7295
      if (this_present_promotionId || that_present_promotionId) {
7296
        if (!(this_present_promotionId && that_present_promotionId))
7297
          return false;
7298
        if (this.promotionId != that.promotionId)
7299
          return false;
7300
      }
7301
 
7302
      boolean this_present_couponCode = true && this.isSetCouponCode();
7303
      boolean that_present_couponCode = true && that.isSetCouponCode();
7304
      if (this_present_couponCode || that_present_couponCode) {
7305
        if (!(this_present_couponCode && that_present_couponCode))
7306
          return false;
7307
        if (!this.couponCode.equals(that.couponCode))
7308
          return false;
7309
      }
7310
 
7311
      return true;
7312
    }
7313
 
7314
    @Override
7315
    public int hashCode() {
7316
      return 0;
7317
    }
7318
 
7319
    public int compareTo(generateCouponsForPromotion_args other) {
7320
      if (!getClass().equals(other.getClass())) {
7321
        return getClass().getName().compareTo(other.getClass().getName());
7322
      }
7323
 
7324
      int lastComparison = 0;
7325
      generateCouponsForPromotion_args typedOther = (generateCouponsForPromotion_args)other;
7326
 
3430 rajveer 7327
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 7328
      if (lastComparison != 0) {
7329
        return lastComparison;
7330
      }
3430 rajveer 7331
      if (isSetPromotionId()) {
7332
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
7333
        if (lastComparison != 0) {
7334
          return lastComparison;
7335
        }
1982 varun.gupt 7336
      }
3430 rajveer 7337
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 7338
      if (lastComparison != 0) {
7339
        return lastComparison;
7340
      }
3430 rajveer 7341
      if (isSetCouponCode()) {
7342
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
7343
        if (lastComparison != 0) {
7344
          return lastComparison;
7345
        }
1982 varun.gupt 7346
      }
7347
      return 0;
7348
    }
7349
 
3430 rajveer 7350
    public _Fields fieldForId(int fieldId) {
7351
      return _Fields.findByThriftId(fieldId);
7352
    }
7353
 
7354
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7355
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 7356
      iprot.readStructBegin();
7357
      while (true)
7358
      {
7359
        field = iprot.readFieldBegin();
3430 rajveer 7360
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 7361
          break;
7362
        }
3430 rajveer 7363
        switch (field.id) {
7364
          case 1: // PROMOTION_ID
7365
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7366
              this.promotionId = iprot.readI64();
7367
              setPromotionIdIsSet(true);
7368
            } else { 
7369
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7370
            }
7371
            break;
7372
          case 2: // COUPON_CODE
7373
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
7374
              this.couponCode = iprot.readString();
7375
            } else { 
7376
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7377
            }
7378
            break;
7379
          default:
7380
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 7381
        }
3430 rajveer 7382
        iprot.readFieldEnd();
1982 varun.gupt 7383
      }
7384
      iprot.readStructEnd();
7385
      validate();
7386
    }
7387
 
3430 rajveer 7388
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 7389
      validate();
7390
 
7391
      oprot.writeStructBegin(STRUCT_DESC);
7392
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
7393
      oprot.writeI64(this.promotionId);
7394
      oprot.writeFieldEnd();
7395
      if (this.couponCode != null) {
7396
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
7397
        oprot.writeString(this.couponCode);
7398
        oprot.writeFieldEnd();
7399
      }
7400
      oprot.writeFieldStop();
7401
      oprot.writeStructEnd();
7402
    }
7403
 
7404
    @Override
7405
    public String toString() {
7406
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_args(");
7407
      boolean first = true;
7408
 
7409
      sb.append("promotionId:");
7410
      sb.append(this.promotionId);
7411
      first = false;
7412
      if (!first) sb.append(", ");
7413
      sb.append("couponCode:");
7414
      if (this.couponCode == null) {
7415
        sb.append("null");
7416
      } else {
7417
        sb.append(this.couponCode);
7418
      }
7419
      first = false;
7420
      sb.append(")");
7421
      return sb.toString();
7422
    }
7423
 
3430 rajveer 7424
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7425
      // check for required fields
7426
    }
7427
 
3430 rajveer 7428
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7429
      try {
7430
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7431
      } catch (org.apache.thrift.TException te) {
7432
        throw new java.io.IOException(te);
7433
      }
7434
    }
7435
 
7436
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7437
      try {
7438
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
7439
        __isset_bit_vector = new BitSet(1);
7440
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7441
      } catch (org.apache.thrift.TException te) {
7442
        throw new java.io.IOException(te);
7443
      }
7444
    }
7445
 
1982 varun.gupt 7446
  }
7447
 
3430 rajveer 7448
  public static class generateCouponsForPromotion_result implements org.apache.thrift.TBase<generateCouponsForPromotion_result, generateCouponsForPromotion_result._Fields>, java.io.Serializable, Cloneable   {
7449
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_result");
1982 varun.gupt 7450
 
3430 rajveer 7451
    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 7452
 
3430 rajveer 7453
    private PromotionException pex; // required
1982 varun.gupt 7454
 
7455
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7456
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 7457
      PEX((short)1, "pex");
7458
 
7459
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7460
 
7461
      static {
7462
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7463
          byName.put(field.getFieldName(), field);
7464
        }
7465
      }
7466
 
7467
      /**
7468
       * Find the _Fields constant that matches fieldId, or null if its not found.
7469
       */
7470
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7471
        switch(fieldId) {
7472
          case 1: // PEX
7473
            return PEX;
7474
          default:
7475
            return null;
7476
        }
1982 varun.gupt 7477
      }
7478
 
7479
      /**
7480
       * Find the _Fields constant that matches fieldId, throwing an exception
7481
       * if it is not found.
7482
       */
7483
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7484
        _Fields fields = findByThriftId(fieldId);
7485
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7486
        return fields;
7487
      }
7488
 
7489
      /**
7490
       * Find the _Fields constant that matches name, or null if its not found.
7491
       */
7492
      public static _Fields findByName(String name) {
7493
        return byName.get(name);
7494
      }
7495
 
7496
      private final short _thriftId;
7497
      private final String _fieldName;
7498
 
7499
      _Fields(short thriftId, String fieldName) {
7500
        _thriftId = thriftId;
7501
        _fieldName = fieldName;
7502
      }
7503
 
7504
      public short getThriftFieldId() {
7505
        return _thriftId;
7506
      }
7507
 
7508
      public String getFieldName() {
7509
        return _fieldName;
7510
      }
7511
    }
7512
 
7513
    // isset id assignments
7514
 
3430 rajveer 7515
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 7516
    static {
3430 rajveer 7517
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7518
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7519
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
7520
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7521
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_result.class, metaDataMap);
1982 varun.gupt 7522
    }
7523
 
7524
    public generateCouponsForPromotion_result() {
7525
    }
7526
 
7527
    public generateCouponsForPromotion_result(
7528
      PromotionException pex)
7529
    {
7530
      this();
7531
      this.pex = pex;
7532
    }
7533
 
7534
    /**
7535
     * Performs a deep copy on <i>other</i>.
7536
     */
7537
    public generateCouponsForPromotion_result(generateCouponsForPromotion_result other) {
7538
      if (other.isSetPex()) {
7539
        this.pex = new PromotionException(other.pex);
7540
      }
7541
    }
7542
 
7543
    public generateCouponsForPromotion_result deepCopy() {
7544
      return new generateCouponsForPromotion_result(this);
7545
    }
7546
 
3430 rajveer 7547
    @Override
7548
    public void clear() {
7549
      this.pex = null;
1982 varun.gupt 7550
    }
7551
 
7552
    public PromotionException getPex() {
7553
      return this.pex;
7554
    }
7555
 
3430 rajveer 7556
    public void setPex(PromotionException pex) {
1982 varun.gupt 7557
      this.pex = pex;
7558
    }
7559
 
7560
    public void unsetPex() {
7561
      this.pex = null;
7562
    }
7563
 
3430 rajveer 7564
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7565
    public boolean isSetPex() {
7566
      return this.pex != null;
7567
    }
7568
 
7569
    public void setPexIsSet(boolean value) {
7570
      if (!value) {
7571
        this.pex = null;
7572
      }
7573
    }
7574
 
7575
    public void setFieldValue(_Fields field, Object value) {
7576
      switch (field) {
7577
      case PEX:
7578
        if (value == null) {
7579
          unsetPex();
7580
        } else {
7581
          setPex((PromotionException)value);
7582
        }
7583
        break;
7584
 
7585
      }
7586
    }
7587
 
7588
    public Object getFieldValue(_Fields field) {
7589
      switch (field) {
7590
      case PEX:
7591
        return getPex();
7592
 
7593
      }
7594
      throw new IllegalStateException();
7595
    }
7596
 
3430 rajveer 7597
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7598
    public boolean isSet(_Fields field) {
7599
      if (field == null) {
7600
        throw new IllegalArgumentException();
7601
      }
1982 varun.gupt 7602
 
7603
      switch (field) {
7604
      case PEX:
7605
        return isSetPex();
7606
      }
7607
      throw new IllegalStateException();
7608
    }
7609
 
7610
    @Override
7611
    public boolean equals(Object that) {
7612
      if (that == null)
7613
        return false;
7614
      if (that instanceof generateCouponsForPromotion_result)
7615
        return this.equals((generateCouponsForPromotion_result)that);
7616
      return false;
7617
    }
7618
 
7619
    public boolean equals(generateCouponsForPromotion_result that) {
7620
      if (that == null)
7621
        return false;
7622
 
7623
      boolean this_present_pex = true && this.isSetPex();
7624
      boolean that_present_pex = true && that.isSetPex();
7625
      if (this_present_pex || that_present_pex) {
7626
        if (!(this_present_pex && that_present_pex))
7627
          return false;
7628
        if (!this.pex.equals(that.pex))
7629
          return false;
7630
      }
7631
 
7632
      return true;
7633
    }
7634
 
7635
    @Override
7636
    public int hashCode() {
7637
      return 0;
7638
    }
7639
 
7640
    public int compareTo(generateCouponsForPromotion_result other) {
7641
      if (!getClass().equals(other.getClass())) {
7642
        return getClass().getName().compareTo(other.getClass().getName());
7643
      }
7644
 
7645
      int lastComparison = 0;
7646
      generateCouponsForPromotion_result typedOther = (generateCouponsForPromotion_result)other;
7647
 
3430 rajveer 7648
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 7649
      if (lastComparison != 0) {
7650
        return lastComparison;
7651
      }
3430 rajveer 7652
      if (isSetPex()) {
7653
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
7654
        if (lastComparison != 0) {
7655
          return lastComparison;
7656
        }
1982 varun.gupt 7657
      }
7658
      return 0;
7659
    }
7660
 
3430 rajveer 7661
    public _Fields fieldForId(int fieldId) {
7662
      return _Fields.findByThriftId(fieldId);
7663
    }
7664
 
7665
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7666
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 7667
      iprot.readStructBegin();
7668
      while (true)
7669
      {
7670
        field = iprot.readFieldBegin();
3430 rajveer 7671
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 7672
          break;
7673
        }
3430 rajveer 7674
        switch (field.id) {
7675
          case 1: // PEX
7676
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
7677
              this.pex = new PromotionException();
7678
              this.pex.read(iprot);
7679
            } else { 
7680
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7681
            }
7682
            break;
7683
          default:
7684
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 7685
        }
3430 rajveer 7686
        iprot.readFieldEnd();
1982 varun.gupt 7687
      }
7688
      iprot.readStructEnd();
7689
      validate();
7690
    }
7691
 
3430 rajveer 7692
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 7693
      oprot.writeStructBegin(STRUCT_DESC);
7694
 
7695
      if (this.isSetPex()) {
7696
        oprot.writeFieldBegin(PEX_FIELD_DESC);
7697
        this.pex.write(oprot);
7698
        oprot.writeFieldEnd();
7699
      }
7700
      oprot.writeFieldStop();
7701
      oprot.writeStructEnd();
7702
    }
7703
 
7704
    @Override
7705
    public String toString() {
7706
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_result(");
7707
      boolean first = true;
7708
 
7709
      sb.append("pex:");
7710
      if (this.pex == null) {
7711
        sb.append("null");
7712
      } else {
7713
        sb.append(this.pex);
7714
      }
7715
      first = false;
7716
      sb.append(")");
7717
      return sb.toString();
7718
    }
7719
 
3430 rajveer 7720
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7721
      // check for required fields
7722
    }
7723
 
3430 rajveer 7724
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7725
      try {
7726
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7727
      } catch (org.apache.thrift.TException te) {
7728
        throw new java.io.IOException(te);
7729
      }
7730
    }
7731
 
7732
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7733
      try {
7734
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7735
      } catch (org.apache.thrift.TException te) {
7736
        throw new java.io.IOException(te);
7737
      }
7738
    }
7739
 
1982 varun.gupt 7740
  }
7741
 
3430 rajveer 7742
  public static class applyCoupon_args implements org.apache.thrift.TBase<applyCoupon_args, applyCoupon_args._Fields>, java.io.Serializable, Cloneable   {
7743
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_args");
1982 varun.gupt 7744
 
3430 rajveer 7745
    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);
7746
    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 7747
 
3430 rajveer 7748
    private String couponCode; // required
7749
    private long cartId; // required
1982 varun.gupt 7750
 
7751
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7752
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 7753
      COUPON_CODE((short)1, "couponCode"),
7754
      CART_ID((short)2, "cartId");
7755
 
7756
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7757
 
7758
      static {
7759
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7760
          byName.put(field.getFieldName(), field);
7761
        }
7762
      }
7763
 
7764
      /**
7765
       * Find the _Fields constant that matches fieldId, or null if its not found.
7766
       */
7767
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7768
        switch(fieldId) {
7769
          case 1: // COUPON_CODE
7770
            return COUPON_CODE;
7771
          case 2: // CART_ID
7772
            return CART_ID;
7773
          default:
7774
            return null;
7775
        }
1982 varun.gupt 7776
      }
7777
 
7778
      /**
7779
       * Find the _Fields constant that matches fieldId, throwing an exception
7780
       * if it is not found.
7781
       */
7782
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7783
        _Fields fields = findByThriftId(fieldId);
7784
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7785
        return fields;
7786
      }
7787
 
7788
      /**
7789
       * Find the _Fields constant that matches name, or null if its not found.
7790
       */
7791
      public static _Fields findByName(String name) {
7792
        return byName.get(name);
7793
      }
7794
 
7795
      private final short _thriftId;
7796
      private final String _fieldName;
7797
 
7798
      _Fields(short thriftId, String fieldName) {
7799
        _thriftId = thriftId;
7800
        _fieldName = fieldName;
7801
      }
7802
 
7803
      public short getThriftFieldId() {
7804
        return _thriftId;
7805
      }
7806
 
7807
      public String getFieldName() {
7808
        return _fieldName;
7809
      }
7810
    }
7811
 
7812
    // isset id assignments
7813
    private static final int __CARTID_ISSET_ID = 0;
7814
    private BitSet __isset_bit_vector = new BitSet(1);
7815
 
3430 rajveer 7816
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 7817
    static {
3430 rajveer 7818
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7819
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7820
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
7821
      tmpMap.put(_Fields.CART_ID, new org.apache.thrift.meta_data.FieldMetaData("cartId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7822
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7823
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7824
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_args.class, metaDataMap);
1982 varun.gupt 7825
    }
7826
 
7827
    public applyCoupon_args() {
7828
    }
7829
 
7830
    public applyCoupon_args(
7831
      String couponCode,
7832
      long cartId)
7833
    {
7834
      this();
7835
      this.couponCode = couponCode;
7836
      this.cartId = cartId;
7837
      setCartIdIsSet(true);
7838
    }
7839
 
7840
    /**
7841
     * Performs a deep copy on <i>other</i>.
7842
     */
7843
    public applyCoupon_args(applyCoupon_args other) {
7844
      __isset_bit_vector.clear();
7845
      __isset_bit_vector.or(other.__isset_bit_vector);
7846
      if (other.isSetCouponCode()) {
7847
        this.couponCode = other.couponCode;
7848
      }
7849
      this.cartId = other.cartId;
7850
    }
7851
 
7852
    public applyCoupon_args deepCopy() {
7853
      return new applyCoupon_args(this);
7854
    }
7855
 
3430 rajveer 7856
    @Override
7857
    public void clear() {
7858
      this.couponCode = null;
7859
      setCartIdIsSet(false);
7860
      this.cartId = 0;
1982 varun.gupt 7861
    }
7862
 
7863
    public String getCouponCode() {
7864
      return this.couponCode;
7865
    }
7866
 
3430 rajveer 7867
    public void setCouponCode(String couponCode) {
1982 varun.gupt 7868
      this.couponCode = couponCode;
7869
    }
7870
 
7871
    public void unsetCouponCode() {
7872
      this.couponCode = null;
7873
    }
7874
 
3430 rajveer 7875
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7876
    public boolean isSetCouponCode() {
7877
      return this.couponCode != null;
7878
    }
7879
 
7880
    public void setCouponCodeIsSet(boolean value) {
7881
      if (!value) {
7882
        this.couponCode = null;
7883
      }
7884
    }
7885
 
7886
    public long getCartId() {
7887
      return this.cartId;
7888
    }
7889
 
3430 rajveer 7890
    public void setCartId(long cartId) {
1982 varun.gupt 7891
      this.cartId = cartId;
7892
      setCartIdIsSet(true);
7893
    }
7894
 
7895
    public void unsetCartId() {
7896
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
7897
    }
7898
 
3430 rajveer 7899
    /** Returns true if field cartId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7900
    public boolean isSetCartId() {
7901
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
7902
    }
7903
 
7904
    public void setCartIdIsSet(boolean value) {
7905
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
7906
    }
7907
 
7908
    public void setFieldValue(_Fields field, Object value) {
7909
      switch (field) {
7910
      case COUPON_CODE:
7911
        if (value == null) {
7912
          unsetCouponCode();
7913
        } else {
7914
          setCouponCode((String)value);
7915
        }
7916
        break;
7917
 
7918
      case CART_ID:
7919
        if (value == null) {
7920
          unsetCartId();
7921
        } else {
7922
          setCartId((Long)value);
7923
        }
7924
        break;
7925
 
7926
      }
7927
    }
7928
 
7929
    public Object getFieldValue(_Fields field) {
7930
      switch (field) {
7931
      case COUPON_CODE:
7932
        return getCouponCode();
7933
 
7934
      case CART_ID:
3430 rajveer 7935
        return Long.valueOf(getCartId());
1982 varun.gupt 7936
 
7937
      }
7938
      throw new IllegalStateException();
7939
    }
7940
 
3430 rajveer 7941
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7942
    public boolean isSet(_Fields field) {
7943
      if (field == null) {
7944
        throw new IllegalArgumentException();
7945
      }
1982 varun.gupt 7946
 
7947
      switch (field) {
7948
      case COUPON_CODE:
7949
        return isSetCouponCode();
7950
      case CART_ID:
7951
        return isSetCartId();
7952
      }
7953
      throw new IllegalStateException();
7954
    }
7955
 
7956
    @Override
7957
    public boolean equals(Object that) {
7958
      if (that == null)
7959
        return false;
7960
      if (that instanceof applyCoupon_args)
7961
        return this.equals((applyCoupon_args)that);
7962
      return false;
7963
    }
7964
 
7965
    public boolean equals(applyCoupon_args that) {
7966
      if (that == null)
7967
        return false;
7968
 
7969
      boolean this_present_couponCode = true && this.isSetCouponCode();
7970
      boolean that_present_couponCode = true && that.isSetCouponCode();
7971
      if (this_present_couponCode || that_present_couponCode) {
7972
        if (!(this_present_couponCode && that_present_couponCode))
7973
          return false;
7974
        if (!this.couponCode.equals(that.couponCode))
7975
          return false;
7976
      }
7977
 
7978
      boolean this_present_cartId = true;
7979
      boolean that_present_cartId = true;
7980
      if (this_present_cartId || that_present_cartId) {
7981
        if (!(this_present_cartId && that_present_cartId))
7982
          return false;
7983
        if (this.cartId != that.cartId)
7984
          return false;
7985
      }
7986
 
7987
      return true;
7988
    }
7989
 
7990
    @Override
7991
    public int hashCode() {
7992
      return 0;
7993
    }
7994
 
7995
    public int compareTo(applyCoupon_args other) {
7996
      if (!getClass().equals(other.getClass())) {
7997
        return getClass().getName().compareTo(other.getClass().getName());
7998
      }
7999
 
8000
      int lastComparison = 0;
8001
      applyCoupon_args typedOther = (applyCoupon_args)other;
8002
 
3430 rajveer 8003
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 8004
      if (lastComparison != 0) {
8005
        return lastComparison;
8006
      }
3430 rajveer 8007
      if (isSetCouponCode()) {
8008
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
8009
        if (lastComparison != 0) {
8010
          return lastComparison;
8011
        }
1982 varun.gupt 8012
      }
3430 rajveer 8013
      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(typedOther.isSetCartId());
1982 varun.gupt 8014
      if (lastComparison != 0) {
8015
        return lastComparison;
8016
      }
3430 rajveer 8017
      if (isSetCartId()) {
8018
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cartId, typedOther.cartId);
8019
        if (lastComparison != 0) {
8020
          return lastComparison;
8021
        }
1982 varun.gupt 8022
      }
8023
      return 0;
8024
    }
8025
 
3430 rajveer 8026
    public _Fields fieldForId(int fieldId) {
8027
      return _Fields.findByThriftId(fieldId);
8028
    }
8029
 
8030
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8031
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 8032
      iprot.readStructBegin();
8033
      while (true)
8034
      {
8035
        field = iprot.readFieldBegin();
3430 rajveer 8036
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 8037
          break;
8038
        }
3430 rajveer 8039
        switch (field.id) {
8040
          case 1: // COUPON_CODE
8041
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
8042
              this.couponCode = iprot.readString();
8043
            } else { 
8044
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8045
            }
8046
            break;
8047
          case 2: // CART_ID
8048
            if (field.type == org.apache.thrift.protocol.TType.I64) {
8049
              this.cartId = iprot.readI64();
8050
              setCartIdIsSet(true);
8051
            } else { 
8052
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8053
            }
8054
            break;
8055
          default:
8056
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 8057
        }
3430 rajveer 8058
        iprot.readFieldEnd();
1982 varun.gupt 8059
      }
8060
      iprot.readStructEnd();
8061
      validate();
8062
    }
8063
 
3430 rajveer 8064
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 8065
      validate();
8066
 
8067
      oprot.writeStructBegin(STRUCT_DESC);
8068
      if (this.couponCode != null) {
8069
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
8070
        oprot.writeString(this.couponCode);
8071
        oprot.writeFieldEnd();
8072
      }
8073
      oprot.writeFieldBegin(CART_ID_FIELD_DESC);
8074
      oprot.writeI64(this.cartId);
8075
      oprot.writeFieldEnd();
8076
      oprot.writeFieldStop();
8077
      oprot.writeStructEnd();
8078
    }
8079
 
8080
    @Override
8081
    public String toString() {
8082
      StringBuilder sb = new StringBuilder("applyCoupon_args(");
8083
      boolean first = true;
8084
 
8085
      sb.append("couponCode:");
8086
      if (this.couponCode == null) {
8087
        sb.append("null");
8088
      } else {
8089
        sb.append(this.couponCode);
8090
      }
8091
      first = false;
8092
      if (!first) sb.append(", ");
8093
      sb.append("cartId:");
8094
      sb.append(this.cartId);
8095
      first = false;
8096
      sb.append(")");
8097
      return sb.toString();
8098
    }
8099
 
3430 rajveer 8100
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 8101
      // check for required fields
8102
    }
8103
 
3430 rajveer 8104
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8105
      try {
8106
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8107
      } catch (org.apache.thrift.TException te) {
8108
        throw new java.io.IOException(te);
8109
      }
8110
    }
8111
 
8112
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8113
      try {
8114
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
8115
        __isset_bit_vector = new BitSet(1);
8116
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8117
      } catch (org.apache.thrift.TException te) {
8118
        throw new java.io.IOException(te);
8119
      }
8120
    }
8121
 
1982 varun.gupt 8122
  }
8123
 
3430 rajveer 8124
  public static class applyCoupon_result implements org.apache.thrift.TBase<applyCoupon_result, applyCoupon_result._Fields>, java.io.Serializable, Cloneable   {
8125
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_result");
1982 varun.gupt 8126
 
3430 rajveer 8127
    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);
8128
    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 8129
 
3430 rajveer 8130
    private Cart success; // required
8131
    private PromotionException pex; // required
1982 varun.gupt 8132
 
8133
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 8134
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 8135
      SUCCESS((short)0, "success"),
8136
      PEX((short)1, "pex");
8137
 
8138
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8139
 
8140
      static {
8141
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8142
          byName.put(field.getFieldName(), field);
8143
        }
8144
      }
8145
 
8146
      /**
8147
       * Find the _Fields constant that matches fieldId, or null if its not found.
8148
       */
8149
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 8150
        switch(fieldId) {
8151
          case 0: // SUCCESS
8152
            return SUCCESS;
8153
          case 1: // PEX
8154
            return PEX;
8155
          default:
8156
            return null;
8157
        }
1982 varun.gupt 8158
      }
8159
 
8160
      /**
8161
       * Find the _Fields constant that matches fieldId, throwing an exception
8162
       * if it is not found.
8163
       */
8164
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8165
        _Fields fields = findByThriftId(fieldId);
8166
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8167
        return fields;
8168
      }
8169
 
8170
      /**
8171
       * Find the _Fields constant that matches name, or null if its not found.
8172
       */
8173
      public static _Fields findByName(String name) {
8174
        return byName.get(name);
8175
      }
8176
 
8177
      private final short _thriftId;
8178
      private final String _fieldName;
8179
 
8180
      _Fields(short thriftId, String fieldName) {
8181
        _thriftId = thriftId;
8182
        _fieldName = fieldName;
8183
      }
8184
 
8185
      public short getThriftFieldId() {
8186
        return _thriftId;
8187
      }
8188
 
8189
      public String getFieldName() {
8190
        return _fieldName;
8191
      }
8192
    }
8193
 
8194
    // isset id assignments
8195
 
3430 rajveer 8196
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 8197
    static {
3430 rajveer 8198
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8199
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8200
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Cart.class)));
8201
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8202
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
8203
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8204
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_result.class, metaDataMap);
1982 varun.gupt 8205
    }
8206
 
8207
    public applyCoupon_result() {
8208
    }
8209
 
8210
    public applyCoupon_result(
8211
      Cart success,
8212
      PromotionException pex)
8213
    {
8214
      this();
8215
      this.success = success;
8216
      this.pex = pex;
8217
    }
8218
 
8219
    /**
8220
     * Performs a deep copy on <i>other</i>.
8221
     */
8222
    public applyCoupon_result(applyCoupon_result other) {
8223
      if (other.isSetSuccess()) {
8224
        this.success = new Cart(other.success);
8225
      }
8226
      if (other.isSetPex()) {
8227
        this.pex = new PromotionException(other.pex);
8228
      }
8229
    }
8230
 
8231
    public applyCoupon_result deepCopy() {
8232
      return new applyCoupon_result(this);
8233
    }
8234
 
3430 rajveer 8235
    @Override
8236
    public void clear() {
8237
      this.success = null;
8238
      this.pex = null;
1982 varun.gupt 8239
    }
8240
 
8241
    public Cart getSuccess() {
8242
      return this.success;
8243
    }
8244
 
3430 rajveer 8245
    public void setSuccess(Cart success) {
1982 varun.gupt 8246
      this.success = success;
8247
    }
8248
 
8249
    public void unsetSuccess() {
8250
      this.success = null;
8251
    }
8252
 
3430 rajveer 8253
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 8254
    public boolean isSetSuccess() {
8255
      return this.success != null;
8256
    }
8257
 
8258
    public void setSuccessIsSet(boolean value) {
8259
      if (!value) {
8260
        this.success = null;
8261
      }
8262
    }
8263
 
8264
    public PromotionException getPex() {
8265
      return this.pex;
8266
    }
8267
 
3430 rajveer 8268
    public void setPex(PromotionException pex) {
1982 varun.gupt 8269
      this.pex = pex;
8270
    }
8271
 
8272
    public void unsetPex() {
8273
      this.pex = null;
8274
    }
8275
 
3430 rajveer 8276
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 8277
    public boolean isSetPex() {
8278
      return this.pex != null;
8279
    }
8280
 
8281
    public void setPexIsSet(boolean value) {
8282
      if (!value) {
8283
        this.pex = null;
8284
      }
8285
    }
8286
 
8287
    public void setFieldValue(_Fields field, Object value) {
8288
      switch (field) {
8289
      case SUCCESS:
8290
        if (value == null) {
8291
          unsetSuccess();
8292
        } else {
8293
          setSuccess((Cart)value);
8294
        }
8295
        break;
8296
 
8297
      case PEX:
8298
        if (value == null) {
8299
          unsetPex();
8300
        } else {
8301
          setPex((PromotionException)value);
8302
        }
8303
        break;
8304
 
8305
      }
8306
    }
8307
 
8308
    public Object getFieldValue(_Fields field) {
8309
      switch (field) {
8310
      case SUCCESS:
8311
        return getSuccess();
8312
 
8313
      case PEX:
8314
        return getPex();
8315
 
8316
      }
8317
      throw new IllegalStateException();
8318
    }
8319
 
3430 rajveer 8320
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8321
    public boolean isSet(_Fields field) {
8322
      if (field == null) {
8323
        throw new IllegalArgumentException();
8324
      }
1982 varun.gupt 8325
 
8326
      switch (field) {
8327
      case SUCCESS:
8328
        return isSetSuccess();
8329
      case PEX:
8330
        return isSetPex();
8331
      }
8332
      throw new IllegalStateException();
8333
    }
8334
 
8335
    @Override
8336
    public boolean equals(Object that) {
8337
      if (that == null)
8338
        return false;
8339
      if (that instanceof applyCoupon_result)
8340
        return this.equals((applyCoupon_result)that);
8341
      return false;
8342
    }
8343
 
8344
    public boolean equals(applyCoupon_result that) {
8345
      if (that == null)
8346
        return false;
8347
 
8348
      boolean this_present_success = true && this.isSetSuccess();
8349
      boolean that_present_success = true && that.isSetSuccess();
8350
      if (this_present_success || that_present_success) {
8351
        if (!(this_present_success && that_present_success))
8352
          return false;
8353
        if (!this.success.equals(that.success))
8354
          return false;
8355
      }
8356
 
8357
      boolean this_present_pex = true && this.isSetPex();
8358
      boolean that_present_pex = true && that.isSetPex();
8359
      if (this_present_pex || that_present_pex) {
8360
        if (!(this_present_pex && that_present_pex))
8361
          return false;
8362
        if (!this.pex.equals(that.pex))
8363
          return false;
8364
      }
8365
 
8366
      return true;
8367
    }
8368
 
8369
    @Override
8370
    public int hashCode() {
8371
      return 0;
8372
    }
8373
 
8374
    public int compareTo(applyCoupon_result other) {
8375
      if (!getClass().equals(other.getClass())) {
8376
        return getClass().getName().compareTo(other.getClass().getName());
8377
      }
8378
 
8379
      int lastComparison = 0;
8380
      applyCoupon_result typedOther = (applyCoupon_result)other;
8381
 
3430 rajveer 8382
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 8383
      if (lastComparison != 0) {
8384
        return lastComparison;
8385
      }
3430 rajveer 8386
      if (isSetSuccess()) {
8387
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
8388
        if (lastComparison != 0) {
8389
          return lastComparison;
8390
        }
1982 varun.gupt 8391
      }
3430 rajveer 8392
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 8393
      if (lastComparison != 0) {
8394
        return lastComparison;
8395
      }
3430 rajveer 8396
      if (isSetPex()) {
8397
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
8398
        if (lastComparison != 0) {
8399
          return lastComparison;
8400
        }
1982 varun.gupt 8401
      }
8402
      return 0;
8403
    }
8404
 
3430 rajveer 8405
    public _Fields fieldForId(int fieldId) {
8406
      return _Fields.findByThriftId(fieldId);
8407
    }
8408
 
8409
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8410
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 8411
      iprot.readStructBegin();
8412
      while (true)
8413
      {
8414
        field = iprot.readFieldBegin();
3430 rajveer 8415
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 8416
          break;
8417
        }
3430 rajveer 8418
        switch (field.id) {
8419
          case 0: // SUCCESS
8420
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
8421
              this.success = new Cart();
8422
              this.success.read(iprot);
8423
            } else { 
8424
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8425
            }
8426
            break;
8427
          case 1: // PEX
8428
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
8429
              this.pex = new PromotionException();
8430
              this.pex.read(iprot);
8431
            } else { 
8432
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8433
            }
8434
            break;
8435
          default:
8436
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 8437
        }
3430 rajveer 8438
        iprot.readFieldEnd();
1982 varun.gupt 8439
      }
8440
      iprot.readStructEnd();
8441
      validate();
8442
    }
8443
 
3430 rajveer 8444
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 8445
      oprot.writeStructBegin(STRUCT_DESC);
8446
 
8447
      if (this.isSetSuccess()) {
8448
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
8449
        this.success.write(oprot);
8450
        oprot.writeFieldEnd();
8451
      } else if (this.isSetPex()) {
8452
        oprot.writeFieldBegin(PEX_FIELD_DESC);
8453
        this.pex.write(oprot);
8454
        oprot.writeFieldEnd();
8455
      }
8456
      oprot.writeFieldStop();
8457
      oprot.writeStructEnd();
8458
    }
8459
 
8460
    @Override
8461
    public String toString() {
8462
      StringBuilder sb = new StringBuilder("applyCoupon_result(");
8463
      boolean first = true;
8464
 
8465
      sb.append("success:");
8466
      if (this.success == null) {
8467
        sb.append("null");
8468
      } else {
8469
        sb.append(this.success);
8470
      }
8471
      first = false;
8472
      if (!first) sb.append(", ");
8473
      sb.append("pex:");
8474
      if (this.pex == null) {
8475
        sb.append("null");
8476
      } else {
8477
        sb.append(this.pex);
8478
      }
8479
      first = false;
8480
      sb.append(")");
8481
      return sb.toString();
8482
    }
8483
 
3430 rajveer 8484
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 8485
      // check for required fields
8486
    }
8487
 
3430 rajveer 8488
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8489
      try {
8490
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8491
      } catch (org.apache.thrift.TException te) {
8492
        throw new java.io.IOException(te);
8493
      }
8494
    }
8495
 
8496
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8497
      try {
8498
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8499
      } catch (org.apache.thrift.TException te) {
8500
        throw new java.io.IOException(te);
8501
      }
8502
    }
8503
 
1982 varun.gupt 8504
  }
8505
 
6736 amit.gupta 8506
  public static class getEmiDiscount_args implements org.apache.thrift.TBase<getEmiDiscount_args, getEmiDiscount_args._Fields>, java.io.Serializable, Cloneable   {
8507
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getEmiDiscount_args");
8508
 
8509
    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);
8510
 
8511
    private long cartId; // required
8512
 
8513
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8514
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
8515
      CART_ID((short)1, "cartId");
8516
 
8517
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8518
 
8519
      static {
8520
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8521
          byName.put(field.getFieldName(), field);
8522
        }
8523
      }
8524
 
8525
      /**
8526
       * Find the _Fields constant that matches fieldId, or null if its not found.
8527
       */
8528
      public static _Fields findByThriftId(int fieldId) {
8529
        switch(fieldId) {
8530
          case 1: // CART_ID
8531
            return CART_ID;
8532
          default:
8533
            return null;
8534
        }
8535
      }
8536
 
8537
      /**
8538
       * Find the _Fields constant that matches fieldId, throwing an exception
8539
       * if it is not found.
8540
       */
8541
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8542
        _Fields fields = findByThriftId(fieldId);
8543
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8544
        return fields;
8545
      }
8546
 
8547
      /**
8548
       * Find the _Fields constant that matches name, or null if its not found.
8549
       */
8550
      public static _Fields findByName(String name) {
8551
        return byName.get(name);
8552
      }
8553
 
8554
      private final short _thriftId;
8555
      private final String _fieldName;
8556
 
8557
      _Fields(short thriftId, String fieldName) {
8558
        _thriftId = thriftId;
8559
        _fieldName = fieldName;
8560
      }
8561
 
8562
      public short getThriftFieldId() {
8563
        return _thriftId;
8564
      }
8565
 
8566
      public String getFieldName() {
8567
        return _fieldName;
8568
      }
8569
    }
8570
 
8571
    // isset id assignments
8572
    private static final int __CARTID_ISSET_ID = 0;
8573
    private BitSet __isset_bit_vector = new BitSet(1);
8574
 
8575
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
8576
    static {
8577
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8578
      tmpMap.put(_Fields.CART_ID, new org.apache.thrift.meta_data.FieldMetaData("cartId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8579
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8580
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8581
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getEmiDiscount_args.class, metaDataMap);
8582
    }
8583
 
8584
    public getEmiDiscount_args() {
8585
    }
8586
 
8587
    public getEmiDiscount_args(
8588
      long cartId)
8589
    {
8590
      this();
8591
      this.cartId = cartId;
8592
      setCartIdIsSet(true);
8593
    }
8594
 
8595
    /**
8596
     * Performs a deep copy on <i>other</i>.
8597
     */
8598
    public getEmiDiscount_args(getEmiDiscount_args other) {
8599
      __isset_bit_vector.clear();
8600
      __isset_bit_vector.or(other.__isset_bit_vector);
8601
      this.cartId = other.cartId;
8602
    }
8603
 
8604
    public getEmiDiscount_args deepCopy() {
8605
      return new getEmiDiscount_args(this);
8606
    }
8607
 
8608
    @Override
8609
    public void clear() {
8610
      setCartIdIsSet(false);
8611
      this.cartId = 0;
8612
    }
8613
 
8614
    public long getCartId() {
8615
      return this.cartId;
8616
    }
8617
 
8618
    public void setCartId(long cartId) {
8619
      this.cartId = cartId;
8620
      setCartIdIsSet(true);
8621
    }
8622
 
8623
    public void unsetCartId() {
8624
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
8625
    }
8626
 
8627
    /** Returns true if field cartId is set (has been assigned a value) and false otherwise */
8628
    public boolean isSetCartId() {
8629
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
8630
    }
8631
 
8632
    public void setCartIdIsSet(boolean value) {
8633
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
8634
    }
8635
 
8636
    public void setFieldValue(_Fields field, Object value) {
8637
      switch (field) {
8638
      case CART_ID:
8639
        if (value == null) {
8640
          unsetCartId();
8641
        } else {
8642
          setCartId((Long)value);
8643
        }
8644
        break;
8645
 
8646
      }
8647
    }
8648
 
8649
    public Object getFieldValue(_Fields field) {
8650
      switch (field) {
8651
      case CART_ID:
8652
        return Long.valueOf(getCartId());
8653
 
8654
      }
8655
      throw new IllegalStateException();
8656
    }
8657
 
8658
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8659
    public boolean isSet(_Fields field) {
8660
      if (field == null) {
8661
        throw new IllegalArgumentException();
8662
      }
8663
 
8664
      switch (field) {
8665
      case CART_ID:
8666
        return isSetCartId();
8667
      }
8668
      throw new IllegalStateException();
8669
    }
8670
 
8671
    @Override
8672
    public boolean equals(Object that) {
8673
      if (that == null)
8674
        return false;
8675
      if (that instanceof getEmiDiscount_args)
8676
        return this.equals((getEmiDiscount_args)that);
8677
      return false;
8678
    }
8679
 
8680
    public boolean equals(getEmiDiscount_args that) {
8681
      if (that == null)
8682
        return false;
8683
 
8684
      boolean this_present_cartId = true;
8685
      boolean that_present_cartId = true;
8686
      if (this_present_cartId || that_present_cartId) {
8687
        if (!(this_present_cartId && that_present_cartId))
8688
          return false;
8689
        if (this.cartId != that.cartId)
8690
          return false;
8691
      }
8692
 
8693
      return true;
8694
    }
8695
 
8696
    @Override
8697
    public int hashCode() {
8698
      return 0;
8699
    }
8700
 
8701
    public int compareTo(getEmiDiscount_args other) {
8702
      if (!getClass().equals(other.getClass())) {
8703
        return getClass().getName().compareTo(other.getClass().getName());
8704
      }
8705
 
8706
      int lastComparison = 0;
8707
      getEmiDiscount_args typedOther = (getEmiDiscount_args)other;
8708
 
8709
      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(typedOther.isSetCartId());
8710
      if (lastComparison != 0) {
8711
        return lastComparison;
8712
      }
8713
      if (isSetCartId()) {
8714
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cartId, typedOther.cartId);
8715
        if (lastComparison != 0) {
8716
          return lastComparison;
8717
        }
8718
      }
8719
      return 0;
8720
    }
8721
 
8722
    public _Fields fieldForId(int fieldId) {
8723
      return _Fields.findByThriftId(fieldId);
8724
    }
8725
 
8726
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8727
      org.apache.thrift.protocol.TField field;
8728
      iprot.readStructBegin();
8729
      while (true)
8730
      {
8731
        field = iprot.readFieldBegin();
8732
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
8733
          break;
8734
        }
8735
        switch (field.id) {
8736
          case 1: // CART_ID
8737
            if (field.type == org.apache.thrift.protocol.TType.I64) {
8738
              this.cartId = iprot.readI64();
8739
              setCartIdIsSet(true);
8740
            } else { 
8741
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8742
            }
8743
            break;
8744
          default:
8745
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8746
        }
8747
        iprot.readFieldEnd();
8748
      }
8749
      iprot.readStructEnd();
8750
      validate();
8751
    }
8752
 
8753
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
8754
      validate();
8755
 
8756
      oprot.writeStructBegin(STRUCT_DESC);
8757
      oprot.writeFieldBegin(CART_ID_FIELD_DESC);
8758
      oprot.writeI64(this.cartId);
8759
      oprot.writeFieldEnd();
8760
      oprot.writeFieldStop();
8761
      oprot.writeStructEnd();
8762
    }
8763
 
8764
    @Override
8765
    public String toString() {
8766
      StringBuilder sb = new StringBuilder("getEmiDiscount_args(");
8767
      boolean first = true;
8768
 
8769
      sb.append("cartId:");
8770
      sb.append(this.cartId);
8771
      first = false;
8772
      sb.append(")");
8773
      return sb.toString();
8774
    }
8775
 
8776
    public void validate() throws org.apache.thrift.TException {
8777
      // check for required fields
8778
    }
8779
 
8780
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8781
      try {
8782
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8783
      } catch (org.apache.thrift.TException te) {
8784
        throw new java.io.IOException(te);
8785
      }
8786
    }
8787
 
8788
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8789
      try {
8790
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
8791
        __isset_bit_vector = new BitSet(1);
8792
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8793
      } catch (org.apache.thrift.TException te) {
8794
        throw new java.io.IOException(te);
8795
      }
8796
    }
8797
 
8798
  }
8799
 
8800
  public static class getEmiDiscount_result implements org.apache.thrift.TBase<getEmiDiscount_result, getEmiDiscount_result._Fields>, java.io.Serializable, Cloneable   {
8801
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getEmiDiscount_result");
8802
 
8803
    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);
8804
    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);
8805
 
8806
    private Map<Long,Double> success; // required
8807
    private PromotionException pex; // required
8808
 
8809
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8810
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
8811
      SUCCESS((short)0, "success"),
8812
      PEX((short)1, "pex");
8813
 
8814
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8815
 
8816
      static {
8817
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8818
          byName.put(field.getFieldName(), field);
8819
        }
8820
      }
8821
 
8822
      /**
8823
       * Find the _Fields constant that matches fieldId, or null if its not found.
8824
       */
8825
      public static _Fields findByThriftId(int fieldId) {
8826
        switch(fieldId) {
8827
          case 0: // SUCCESS
8828
            return SUCCESS;
8829
          case 1: // PEX
8830
            return PEX;
8831
          default:
8832
            return null;
8833
        }
8834
      }
8835
 
8836
      /**
8837
       * Find the _Fields constant that matches fieldId, throwing an exception
8838
       * if it is not found.
8839
       */
8840
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8841
        _Fields fields = findByThriftId(fieldId);
8842
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8843
        return fields;
8844
      }
8845
 
8846
      /**
8847
       * Find the _Fields constant that matches name, or null if its not found.
8848
       */
8849
      public static _Fields findByName(String name) {
8850
        return byName.get(name);
8851
      }
8852
 
8853
      private final short _thriftId;
8854
      private final String _fieldName;
8855
 
8856
      _Fields(short thriftId, String fieldName) {
8857
        _thriftId = thriftId;
8858
        _fieldName = fieldName;
8859
      }
8860
 
8861
      public short getThriftFieldId() {
8862
        return _thriftId;
8863
      }
8864
 
8865
      public String getFieldName() {
8866
        return _fieldName;
8867
      }
8868
    }
8869
 
8870
    // isset id assignments
8871
 
8872
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
8873
    static {
8874
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8875
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8876
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
8877
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), 
8878
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
8879
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8880
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
8881
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8882
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getEmiDiscount_result.class, metaDataMap);
8883
    }
8884
 
8885
    public getEmiDiscount_result() {
8886
    }
8887
 
8888
    public getEmiDiscount_result(
8889
      Map<Long,Double> success,
8890
      PromotionException pex)
8891
    {
8892
      this();
8893
      this.success = success;
8894
      this.pex = pex;
8895
    }
8896
 
8897
    /**
8898
     * Performs a deep copy on <i>other</i>.
8899
     */
8900
    public getEmiDiscount_result(getEmiDiscount_result other) {
8901
      if (other.isSetSuccess()) {
8902
        Map<Long,Double> __this__success = new HashMap<Long,Double>();
8903
        for (Map.Entry<Long, Double> other_element : other.success.entrySet()) {
8904
 
8905
          Long other_element_key = other_element.getKey();
8906
          Double other_element_value = other_element.getValue();
8907
 
8908
          Long __this__success_copy_key = other_element_key;
8909
 
8910
          Double __this__success_copy_value = other_element_value;
8911
 
8912
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
8913
        }
8914
        this.success = __this__success;
8915
      }
8916
      if (other.isSetPex()) {
8917
        this.pex = new PromotionException(other.pex);
8918
      }
8919
    }
8920
 
8921
    public getEmiDiscount_result deepCopy() {
8922
      return new getEmiDiscount_result(this);
8923
    }
8924
 
8925
    @Override
8926
    public void clear() {
8927
      this.success = null;
8928
      this.pex = null;
8929
    }
8930
 
8931
    public int getSuccessSize() {
8932
      return (this.success == null) ? 0 : this.success.size();
8933
    }
8934
 
8935
    public void putToSuccess(long key, double val) {
8936
      if (this.success == null) {
8937
        this.success = new HashMap<Long,Double>();
8938
      }
8939
      this.success.put(key, val);
8940
    }
8941
 
8942
    public Map<Long,Double> getSuccess() {
8943
      return this.success;
8944
    }
8945
 
8946
    public void setSuccess(Map<Long,Double> success) {
8947
      this.success = success;
8948
    }
8949
 
8950
    public void unsetSuccess() {
8951
      this.success = null;
8952
    }
8953
 
8954
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
8955
    public boolean isSetSuccess() {
8956
      return this.success != null;
8957
    }
8958
 
8959
    public void setSuccessIsSet(boolean value) {
8960
      if (!value) {
8961
        this.success = null;
8962
      }
8963
    }
8964
 
8965
    public PromotionException getPex() {
8966
      return this.pex;
8967
    }
8968
 
8969
    public void setPex(PromotionException pex) {
8970
      this.pex = pex;
8971
    }
8972
 
8973
    public void unsetPex() {
8974
      this.pex = null;
8975
    }
8976
 
8977
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
8978
    public boolean isSetPex() {
8979
      return this.pex != null;
8980
    }
8981
 
8982
    public void setPexIsSet(boolean value) {
8983
      if (!value) {
8984
        this.pex = null;
8985
      }
8986
    }
8987
 
8988
    public void setFieldValue(_Fields field, Object value) {
8989
      switch (field) {
8990
      case SUCCESS:
8991
        if (value == null) {
8992
          unsetSuccess();
8993
        } else {
8994
          setSuccess((Map<Long,Double>)value);
8995
        }
8996
        break;
8997
 
8998
      case PEX:
8999
        if (value == null) {
9000
          unsetPex();
9001
        } else {
9002
          setPex((PromotionException)value);
9003
        }
9004
        break;
9005
 
9006
      }
9007
    }
9008
 
9009
    public Object getFieldValue(_Fields field) {
9010
      switch (field) {
9011
      case SUCCESS:
9012
        return getSuccess();
9013
 
9014
      case PEX:
9015
        return getPex();
9016
 
9017
      }
9018
      throw new IllegalStateException();
9019
    }
9020
 
9021
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9022
    public boolean isSet(_Fields field) {
9023
      if (field == null) {
9024
        throw new IllegalArgumentException();
9025
      }
9026
 
9027
      switch (field) {
9028
      case SUCCESS:
9029
        return isSetSuccess();
9030
      case PEX:
9031
        return isSetPex();
9032
      }
9033
      throw new IllegalStateException();
9034
    }
9035
 
9036
    @Override
9037
    public boolean equals(Object that) {
9038
      if (that == null)
9039
        return false;
9040
      if (that instanceof getEmiDiscount_result)
9041
        return this.equals((getEmiDiscount_result)that);
9042
      return false;
9043
    }
9044
 
9045
    public boolean equals(getEmiDiscount_result that) {
9046
      if (that == null)
9047
        return false;
9048
 
9049
      boolean this_present_success = true && this.isSetSuccess();
9050
      boolean that_present_success = true && that.isSetSuccess();
9051
      if (this_present_success || that_present_success) {
9052
        if (!(this_present_success && that_present_success))
9053
          return false;
9054
        if (!this.success.equals(that.success))
9055
          return false;
9056
      }
9057
 
9058
      boolean this_present_pex = true && this.isSetPex();
9059
      boolean that_present_pex = true && that.isSetPex();
9060
      if (this_present_pex || that_present_pex) {
9061
        if (!(this_present_pex && that_present_pex))
9062
          return false;
9063
        if (!this.pex.equals(that.pex))
9064
          return false;
9065
      }
9066
 
9067
      return true;
9068
    }
9069
 
9070
    @Override
9071
    public int hashCode() {
9072
      return 0;
9073
    }
9074
 
9075
    public int compareTo(getEmiDiscount_result other) {
9076
      if (!getClass().equals(other.getClass())) {
9077
        return getClass().getName().compareTo(other.getClass().getName());
9078
      }
9079
 
9080
      int lastComparison = 0;
9081
      getEmiDiscount_result typedOther = (getEmiDiscount_result)other;
9082
 
9083
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
9084
      if (lastComparison != 0) {
9085
        return lastComparison;
9086
      }
9087
      if (isSetSuccess()) {
9088
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
9089
        if (lastComparison != 0) {
9090
          return lastComparison;
9091
        }
9092
      }
9093
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
9094
      if (lastComparison != 0) {
9095
        return lastComparison;
9096
      }
9097
      if (isSetPex()) {
9098
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
9099
        if (lastComparison != 0) {
9100
          return lastComparison;
9101
        }
9102
      }
9103
      return 0;
9104
    }
9105
 
9106
    public _Fields fieldForId(int fieldId) {
9107
      return _Fields.findByThriftId(fieldId);
9108
    }
9109
 
9110
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9111
      org.apache.thrift.protocol.TField field;
9112
      iprot.readStructBegin();
9113
      while (true)
9114
      {
9115
        field = iprot.readFieldBegin();
9116
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
9117
          break;
9118
        }
9119
        switch (field.id) {
9120
          case 0: // SUCCESS
9121
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
9122
              {
11592 amit.gupta 9123
                org.apache.thrift.protocol.TMap _map20 = iprot.readMapBegin();
9124
                this.success = new HashMap<Long,Double>(2*_map20.size);
9125
                for (int _i21 = 0; _i21 < _map20.size; ++_i21)
6736 amit.gupta 9126
                {
11592 amit.gupta 9127
                  long _key22; // required
9128
                  double _val23; // required
9129
                  _key22 = iprot.readI64();
9130
                  _val23 = iprot.readDouble();
9131
                  this.success.put(_key22, _val23);
6736 amit.gupta 9132
                }
9133
                iprot.readMapEnd();
9134
              }
9135
            } else { 
9136
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9137
            }
9138
            break;
9139
          case 1: // PEX
9140
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
9141
              this.pex = new PromotionException();
9142
              this.pex.read(iprot);
9143
            } else { 
9144
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9145
            }
9146
            break;
9147
          default:
9148
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9149
        }
9150
        iprot.readFieldEnd();
9151
      }
9152
      iprot.readStructEnd();
9153
      validate();
9154
    }
9155
 
9156
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
9157
      oprot.writeStructBegin(STRUCT_DESC);
9158
 
9159
      if (this.isSetSuccess()) {
9160
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
9161
        {
9162
          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 9163
          for (Map.Entry<Long, Double> _iter24 : this.success.entrySet())
6736 amit.gupta 9164
          {
11592 amit.gupta 9165
            oprot.writeI64(_iter24.getKey());
9166
            oprot.writeDouble(_iter24.getValue());
6736 amit.gupta 9167
          }
9168
          oprot.writeMapEnd();
9169
        }
9170
        oprot.writeFieldEnd();
9171
      } else if (this.isSetPex()) {
9172
        oprot.writeFieldBegin(PEX_FIELD_DESC);
9173
        this.pex.write(oprot);
9174
        oprot.writeFieldEnd();
9175
      }
9176
      oprot.writeFieldStop();
9177
      oprot.writeStructEnd();
9178
    }
9179
 
9180
    @Override
9181
    public String toString() {
9182
      StringBuilder sb = new StringBuilder("getEmiDiscount_result(");
9183
      boolean first = true;
9184
 
9185
      sb.append("success:");
9186
      if (this.success == null) {
9187
        sb.append("null");
9188
      } else {
9189
        sb.append(this.success);
9190
      }
9191
      first = false;
9192
      if (!first) sb.append(", ");
9193
      sb.append("pex:");
9194
      if (this.pex == null) {
9195
        sb.append("null");
9196
      } else {
9197
        sb.append(this.pex);
9198
      }
9199
      first = false;
9200
      sb.append(")");
9201
      return sb.toString();
9202
    }
9203
 
9204
    public void validate() throws org.apache.thrift.TException {
9205
      // check for required fields
9206
    }
9207
 
9208
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9209
      try {
9210
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9211
      } catch (org.apache.thrift.TException te) {
9212
        throw new java.io.IOException(te);
9213
      }
9214
    }
9215
 
9216
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9217
      try {
9218
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9219
      } catch (org.apache.thrift.TException te) {
9220
        throw new java.io.IOException(te);
9221
      }
9222
    }
9223
 
9224
  }
9225
 
6433 anupam.sin 9226
  public static class applyRechargeCoupon_args implements org.apache.thrift.TBase<applyRechargeCoupon_args, applyRechargeCoupon_args._Fields>, java.io.Serializable, Cloneable   {
9227
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyRechargeCoupon_args");
9228
 
9229
    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);
9230
    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);
9231
    private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.I64, (short)3);
9232
 
9233
    private String couponCode; // required
9234
    private long totalAmount; // required
9235
    private long userId; // required
9236
 
9237
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9238
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
9239
      COUPON_CODE((short)1, "couponCode"),
9240
      TOTAL_AMOUNT((short)2, "totalAmount"),
9241
      USER_ID((short)3, "userId");
9242
 
9243
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9244
 
9245
      static {
9246
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9247
          byName.put(field.getFieldName(), field);
9248
        }
9249
      }
9250
 
9251
      /**
9252
       * Find the _Fields constant that matches fieldId, or null if its not found.
9253
       */
9254
      public static _Fields findByThriftId(int fieldId) {
9255
        switch(fieldId) {
9256
          case 1: // COUPON_CODE
9257
            return COUPON_CODE;
9258
          case 2: // TOTAL_AMOUNT
9259
            return TOTAL_AMOUNT;
9260
          case 3: // USER_ID
9261
            return USER_ID;
9262
          default:
9263
            return null;
9264
        }
9265
      }
9266
 
9267
      /**
9268
       * Find the _Fields constant that matches fieldId, throwing an exception
9269
       * if it is not found.
9270
       */
9271
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9272
        _Fields fields = findByThriftId(fieldId);
9273
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9274
        return fields;
9275
      }
9276
 
9277
      /**
9278
       * Find the _Fields constant that matches name, or null if its not found.
9279
       */
9280
      public static _Fields findByName(String name) {
9281
        return byName.get(name);
9282
      }
9283
 
9284
      private final short _thriftId;
9285
      private final String _fieldName;
9286
 
9287
      _Fields(short thriftId, String fieldName) {
9288
        _thriftId = thriftId;
9289
        _fieldName = fieldName;
9290
      }
9291
 
9292
      public short getThriftFieldId() {
9293
        return _thriftId;
9294
      }
9295
 
9296
      public String getFieldName() {
9297
        return _fieldName;
9298
      }
9299
    }
9300
 
9301
    // isset id assignments
9302
    private static final int __TOTALAMOUNT_ISSET_ID = 0;
9303
    private static final int __USERID_ISSET_ID = 1;
9304
    private BitSet __isset_bit_vector = new BitSet(2);
9305
 
9306
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
9307
    static {
9308
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9309
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9310
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
9311
      tmpMap.put(_Fields.TOTAL_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("totalAmount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9312
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9313
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9314
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9315
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9316
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyRechargeCoupon_args.class, metaDataMap);
9317
    }
9318
 
9319
    public applyRechargeCoupon_args() {
9320
    }
9321
 
9322
    public applyRechargeCoupon_args(
9323
      String couponCode,
9324
      long totalAmount,
9325
      long userId)
9326
    {
9327
      this();
9328
      this.couponCode = couponCode;
9329
      this.totalAmount = totalAmount;
9330
      setTotalAmountIsSet(true);
9331
      this.userId = userId;
9332
      setUserIdIsSet(true);
9333
    }
9334
 
9335
    /**
9336
     * Performs a deep copy on <i>other</i>.
9337
     */
9338
    public applyRechargeCoupon_args(applyRechargeCoupon_args other) {
9339
      __isset_bit_vector.clear();
9340
      __isset_bit_vector.or(other.__isset_bit_vector);
9341
      if (other.isSetCouponCode()) {
9342
        this.couponCode = other.couponCode;
9343
      }
9344
      this.totalAmount = other.totalAmount;
9345
      this.userId = other.userId;
9346
    }
9347
 
9348
    public applyRechargeCoupon_args deepCopy() {
9349
      return new applyRechargeCoupon_args(this);
9350
    }
9351
 
9352
    @Override
9353
    public void clear() {
9354
      this.couponCode = null;
9355
      setTotalAmountIsSet(false);
9356
      this.totalAmount = 0;
9357
      setUserIdIsSet(false);
9358
      this.userId = 0;
9359
    }
9360
 
9361
    public String getCouponCode() {
9362
      return this.couponCode;
9363
    }
9364
 
9365
    public void setCouponCode(String couponCode) {
9366
      this.couponCode = couponCode;
9367
    }
9368
 
9369
    public void unsetCouponCode() {
9370
      this.couponCode = null;
9371
    }
9372
 
9373
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
9374
    public boolean isSetCouponCode() {
9375
      return this.couponCode != null;
9376
    }
9377
 
9378
    public void setCouponCodeIsSet(boolean value) {
9379
      if (!value) {
9380
        this.couponCode = null;
9381
      }
9382
    }
9383
 
9384
    public long getTotalAmount() {
9385
      return this.totalAmount;
9386
    }
9387
 
9388
    public void setTotalAmount(long totalAmount) {
9389
      this.totalAmount = totalAmount;
9390
      setTotalAmountIsSet(true);
9391
    }
9392
 
9393
    public void unsetTotalAmount() {
9394
      __isset_bit_vector.clear(__TOTALAMOUNT_ISSET_ID);
9395
    }
9396
 
9397
    /** Returns true if field totalAmount is set (has been assigned a value) and false otherwise */
9398
    public boolean isSetTotalAmount() {
9399
      return __isset_bit_vector.get(__TOTALAMOUNT_ISSET_ID);
9400
    }
9401
 
9402
    public void setTotalAmountIsSet(boolean value) {
9403
      __isset_bit_vector.set(__TOTALAMOUNT_ISSET_ID, value);
9404
    }
9405
 
9406
    public long getUserId() {
9407
      return this.userId;
9408
    }
9409
 
9410
    public void setUserId(long userId) {
9411
      this.userId = userId;
9412
      setUserIdIsSet(true);
9413
    }
9414
 
9415
    public void unsetUserId() {
9416
      __isset_bit_vector.clear(__USERID_ISSET_ID);
9417
    }
9418
 
9419
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
9420
    public boolean isSetUserId() {
9421
      return __isset_bit_vector.get(__USERID_ISSET_ID);
9422
    }
9423
 
9424
    public void setUserIdIsSet(boolean value) {
9425
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
9426
    }
9427
 
9428
    public void setFieldValue(_Fields field, Object value) {
9429
      switch (field) {
9430
      case COUPON_CODE:
9431
        if (value == null) {
9432
          unsetCouponCode();
9433
        } else {
9434
          setCouponCode((String)value);
9435
        }
9436
        break;
9437
 
9438
      case TOTAL_AMOUNT:
9439
        if (value == null) {
9440
          unsetTotalAmount();
9441
        } else {
9442
          setTotalAmount((Long)value);
9443
        }
9444
        break;
9445
 
9446
      case USER_ID:
9447
        if (value == null) {
9448
          unsetUserId();
9449
        } else {
9450
          setUserId((Long)value);
9451
        }
9452
        break;
9453
 
9454
      }
9455
    }
9456
 
9457
    public Object getFieldValue(_Fields field) {
9458
      switch (field) {
9459
      case COUPON_CODE:
9460
        return getCouponCode();
9461
 
9462
      case TOTAL_AMOUNT:
9463
        return Long.valueOf(getTotalAmount());
9464
 
9465
      case USER_ID:
9466
        return Long.valueOf(getUserId());
9467
 
9468
      }
9469
      throw new IllegalStateException();
9470
    }
9471
 
9472
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9473
    public boolean isSet(_Fields field) {
9474
      if (field == null) {
9475
        throw new IllegalArgumentException();
9476
      }
9477
 
9478
      switch (field) {
9479
      case COUPON_CODE:
9480
        return isSetCouponCode();
9481
      case TOTAL_AMOUNT:
9482
        return isSetTotalAmount();
9483
      case USER_ID:
9484
        return isSetUserId();
9485
      }
9486
      throw new IllegalStateException();
9487
    }
9488
 
9489
    @Override
9490
    public boolean equals(Object that) {
9491
      if (that == null)
9492
        return false;
9493
      if (that instanceof applyRechargeCoupon_args)
9494
        return this.equals((applyRechargeCoupon_args)that);
9495
      return false;
9496
    }
9497
 
9498
    public boolean equals(applyRechargeCoupon_args that) {
9499
      if (that == null)
9500
        return false;
9501
 
9502
      boolean this_present_couponCode = true && this.isSetCouponCode();
9503
      boolean that_present_couponCode = true && that.isSetCouponCode();
9504
      if (this_present_couponCode || that_present_couponCode) {
9505
        if (!(this_present_couponCode && that_present_couponCode))
9506
          return false;
9507
        if (!this.couponCode.equals(that.couponCode))
9508
          return false;
9509
      }
9510
 
9511
      boolean this_present_totalAmount = true;
9512
      boolean that_present_totalAmount = true;
9513
      if (this_present_totalAmount || that_present_totalAmount) {
9514
        if (!(this_present_totalAmount && that_present_totalAmount))
9515
          return false;
9516
        if (this.totalAmount != that.totalAmount)
9517
          return false;
9518
      }
9519
 
9520
      boolean this_present_userId = true;
9521
      boolean that_present_userId = true;
9522
      if (this_present_userId || that_present_userId) {
9523
        if (!(this_present_userId && that_present_userId))
9524
          return false;
9525
        if (this.userId != that.userId)
9526
          return false;
9527
      }
9528
 
9529
      return true;
9530
    }
9531
 
9532
    @Override
9533
    public int hashCode() {
9534
      return 0;
9535
    }
9536
 
9537
    public int compareTo(applyRechargeCoupon_args other) {
9538
      if (!getClass().equals(other.getClass())) {
9539
        return getClass().getName().compareTo(other.getClass().getName());
9540
      }
9541
 
9542
      int lastComparison = 0;
9543
      applyRechargeCoupon_args typedOther = (applyRechargeCoupon_args)other;
9544
 
9545
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
9546
      if (lastComparison != 0) {
9547
        return lastComparison;
9548
      }
9549
      if (isSetCouponCode()) {
9550
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
9551
        if (lastComparison != 0) {
9552
          return lastComparison;
9553
        }
9554
      }
9555
      lastComparison = Boolean.valueOf(isSetTotalAmount()).compareTo(typedOther.isSetTotalAmount());
9556
      if (lastComparison != 0) {
9557
        return lastComparison;
9558
      }
9559
      if (isSetTotalAmount()) {
9560
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.totalAmount, typedOther.totalAmount);
9561
        if (lastComparison != 0) {
9562
          return lastComparison;
9563
        }
9564
      }
9565
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
9566
      if (lastComparison != 0) {
9567
        return lastComparison;
9568
      }
9569
      if (isSetUserId()) {
9570
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
9571
        if (lastComparison != 0) {
9572
          return lastComparison;
9573
        }
9574
      }
9575
      return 0;
9576
    }
9577
 
9578
    public _Fields fieldForId(int fieldId) {
9579
      return _Fields.findByThriftId(fieldId);
9580
    }
9581
 
9582
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9583
      org.apache.thrift.protocol.TField field;
9584
      iprot.readStructBegin();
9585
      while (true)
9586
      {
9587
        field = iprot.readFieldBegin();
9588
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
9589
          break;
9590
        }
9591
        switch (field.id) {
9592
          case 1: // COUPON_CODE
9593
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
9594
              this.couponCode = iprot.readString();
9595
            } else { 
9596
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9597
            }
9598
            break;
9599
          case 2: // TOTAL_AMOUNT
9600
            if (field.type == org.apache.thrift.protocol.TType.I64) {
9601
              this.totalAmount = iprot.readI64();
9602
              setTotalAmountIsSet(true);
9603
            } else { 
9604
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9605
            }
9606
            break;
9607
          case 3: // USER_ID
9608
            if (field.type == org.apache.thrift.protocol.TType.I64) {
9609
              this.userId = iprot.readI64();
9610
              setUserIdIsSet(true);
9611
            } else { 
9612
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9613
            }
9614
            break;
9615
          default:
9616
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9617
        }
9618
        iprot.readFieldEnd();
9619
      }
9620
      iprot.readStructEnd();
9621
      validate();
9622
    }
9623
 
9624
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
9625
      validate();
9626
 
9627
      oprot.writeStructBegin(STRUCT_DESC);
9628
      if (this.couponCode != null) {
9629
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
9630
        oprot.writeString(this.couponCode);
9631
        oprot.writeFieldEnd();
9632
      }
9633
      oprot.writeFieldBegin(TOTAL_AMOUNT_FIELD_DESC);
9634
      oprot.writeI64(this.totalAmount);
9635
      oprot.writeFieldEnd();
9636
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
9637
      oprot.writeI64(this.userId);
9638
      oprot.writeFieldEnd();
9639
      oprot.writeFieldStop();
9640
      oprot.writeStructEnd();
9641
    }
9642
 
9643
    @Override
9644
    public String toString() {
9645
      StringBuilder sb = new StringBuilder("applyRechargeCoupon_args(");
9646
      boolean first = true;
9647
 
9648
      sb.append("couponCode:");
9649
      if (this.couponCode == null) {
9650
        sb.append("null");
9651
      } else {
9652
        sb.append(this.couponCode);
9653
      }
9654
      first = false;
9655
      if (!first) sb.append(", ");
9656
      sb.append("totalAmount:");
9657
      sb.append(this.totalAmount);
9658
      first = false;
9659
      if (!first) sb.append(", ");
9660
      sb.append("userId:");
9661
      sb.append(this.userId);
9662
      first = false;
9663
      sb.append(")");
9664
      return sb.toString();
9665
    }
9666
 
9667
    public void validate() throws org.apache.thrift.TException {
9668
      // check for required fields
9669
    }
9670
 
9671
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9672
      try {
9673
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9674
      } catch (org.apache.thrift.TException te) {
9675
        throw new java.io.IOException(te);
9676
      }
9677
    }
9678
 
9679
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9680
      try {
9681
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
9682
        __isset_bit_vector = new BitSet(1);
9683
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9684
      } catch (org.apache.thrift.TException te) {
9685
        throw new java.io.IOException(te);
9686
      }
9687
    }
9688
 
9689
  }
9690
 
9691
  public static class applyRechargeCoupon_result implements org.apache.thrift.TBase<applyRechargeCoupon_result, applyRechargeCoupon_result._Fields>, java.io.Serializable, Cloneable   {
9692
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyRechargeCoupon_result");
9693
 
9694
    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);
9695
    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);
9696
 
9697
    private Map<Long,String> success; // required
9698
    private PromotionException pex; // required
9699
 
9700
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9701
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
9702
      SUCCESS((short)0, "success"),
9703
      PEX((short)1, "pex");
9704
 
9705
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9706
 
9707
      static {
9708
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9709
          byName.put(field.getFieldName(), field);
9710
        }
9711
      }
9712
 
9713
      /**
9714
       * Find the _Fields constant that matches fieldId, or null if its not found.
9715
       */
9716
      public static _Fields findByThriftId(int fieldId) {
9717
        switch(fieldId) {
9718
          case 0: // SUCCESS
9719
            return SUCCESS;
9720
          case 1: // PEX
9721
            return PEX;
9722
          default:
9723
            return null;
9724
        }
9725
      }
9726
 
9727
      /**
9728
       * Find the _Fields constant that matches fieldId, throwing an exception
9729
       * if it is not found.
9730
       */
9731
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9732
        _Fields fields = findByThriftId(fieldId);
9733
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9734
        return fields;
9735
      }
9736
 
9737
      /**
9738
       * Find the _Fields constant that matches name, or null if its not found.
9739
       */
9740
      public static _Fields findByName(String name) {
9741
        return byName.get(name);
9742
      }
9743
 
9744
      private final short _thriftId;
9745
      private final String _fieldName;
9746
 
9747
      _Fields(short thriftId, String fieldName) {
9748
        _thriftId = thriftId;
9749
        _fieldName = fieldName;
9750
      }
9751
 
9752
      public short getThriftFieldId() {
9753
        return _thriftId;
9754
      }
9755
 
9756
      public String getFieldName() {
9757
        return _fieldName;
9758
      }
9759
    }
9760
 
9761
    // isset id assignments
9762
 
9763
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
9764
    static {
9765
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9766
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9767
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
9768
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), 
9769
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
9770
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9771
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
9772
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9773
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyRechargeCoupon_result.class, metaDataMap);
9774
    }
9775
 
9776
    public applyRechargeCoupon_result() {
9777
    }
9778
 
9779
    public applyRechargeCoupon_result(
9780
      Map<Long,String> success,
9781
      PromotionException pex)
9782
    {
9783
      this();
9784
      this.success = success;
9785
      this.pex = pex;
9786
    }
9787
 
9788
    /**
9789
     * Performs a deep copy on <i>other</i>.
9790
     */
9791
    public applyRechargeCoupon_result(applyRechargeCoupon_result other) {
9792
      if (other.isSetSuccess()) {
9793
        Map<Long,String> __this__success = new HashMap<Long,String>();
9794
        for (Map.Entry<Long, String> other_element : other.success.entrySet()) {
9795
 
9796
          Long other_element_key = other_element.getKey();
9797
          String other_element_value = other_element.getValue();
9798
 
9799
          Long __this__success_copy_key = other_element_key;
9800
 
9801
          String __this__success_copy_value = other_element_value;
9802
 
9803
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
9804
        }
9805
        this.success = __this__success;
9806
      }
9807
      if (other.isSetPex()) {
9808
        this.pex = new PromotionException(other.pex);
9809
      }
9810
    }
9811
 
9812
    public applyRechargeCoupon_result deepCopy() {
9813
      return new applyRechargeCoupon_result(this);
9814
    }
9815
 
9816
    @Override
9817
    public void clear() {
9818
      this.success = null;
9819
      this.pex = null;
9820
    }
9821
 
9822
    public int getSuccessSize() {
9823
      return (this.success == null) ? 0 : this.success.size();
9824
    }
9825
 
9826
    public void putToSuccess(long key, String val) {
9827
      if (this.success == null) {
9828
        this.success = new HashMap<Long,String>();
9829
      }
9830
      this.success.put(key, val);
9831
    }
9832
 
9833
    public Map<Long,String> getSuccess() {
9834
      return this.success;
9835
    }
9836
 
9837
    public void setSuccess(Map<Long,String> success) {
9838
      this.success = success;
9839
    }
9840
 
9841
    public void unsetSuccess() {
9842
      this.success = null;
9843
    }
9844
 
9845
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
9846
    public boolean isSetSuccess() {
9847
      return this.success != null;
9848
    }
9849
 
9850
    public void setSuccessIsSet(boolean value) {
9851
      if (!value) {
9852
        this.success = null;
9853
      }
9854
    }
9855
 
9856
    public PromotionException getPex() {
9857
      return this.pex;
9858
    }
9859
 
9860
    public void setPex(PromotionException pex) {
9861
      this.pex = pex;
9862
    }
9863
 
9864
    public void unsetPex() {
9865
      this.pex = null;
9866
    }
9867
 
9868
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
9869
    public boolean isSetPex() {
9870
      return this.pex != null;
9871
    }
9872
 
9873
    public void setPexIsSet(boolean value) {
9874
      if (!value) {
9875
        this.pex = null;
9876
      }
9877
    }
9878
 
9879
    public void setFieldValue(_Fields field, Object value) {
9880
      switch (field) {
9881
      case SUCCESS:
9882
        if (value == null) {
9883
          unsetSuccess();
9884
        } else {
9885
          setSuccess((Map<Long,String>)value);
9886
        }
9887
        break;
9888
 
9889
      case PEX:
9890
        if (value == null) {
9891
          unsetPex();
9892
        } else {
9893
          setPex((PromotionException)value);
9894
        }
9895
        break;
9896
 
9897
      }
9898
    }
9899
 
9900
    public Object getFieldValue(_Fields field) {
9901
      switch (field) {
9902
      case SUCCESS:
9903
        return getSuccess();
9904
 
9905
      case PEX:
9906
        return getPex();
9907
 
9908
      }
9909
      throw new IllegalStateException();
9910
    }
9911
 
9912
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9913
    public boolean isSet(_Fields field) {
9914
      if (field == null) {
9915
        throw new IllegalArgumentException();
9916
      }
9917
 
9918
      switch (field) {
9919
      case SUCCESS:
9920
        return isSetSuccess();
9921
      case PEX:
9922
        return isSetPex();
9923
      }
9924
      throw new IllegalStateException();
9925
    }
9926
 
9927
    @Override
9928
    public boolean equals(Object that) {
9929
      if (that == null)
9930
        return false;
9931
      if (that instanceof applyRechargeCoupon_result)
9932
        return this.equals((applyRechargeCoupon_result)that);
9933
      return false;
9934
    }
9935
 
9936
    public boolean equals(applyRechargeCoupon_result that) {
9937
      if (that == null)
9938
        return false;
9939
 
9940
      boolean this_present_success = true && this.isSetSuccess();
9941
      boolean that_present_success = true && that.isSetSuccess();
9942
      if (this_present_success || that_present_success) {
9943
        if (!(this_present_success && that_present_success))
9944
          return false;
9945
        if (!this.success.equals(that.success))
9946
          return false;
9947
      }
9948
 
9949
      boolean this_present_pex = true && this.isSetPex();
9950
      boolean that_present_pex = true && that.isSetPex();
9951
      if (this_present_pex || that_present_pex) {
9952
        if (!(this_present_pex && that_present_pex))
9953
          return false;
9954
        if (!this.pex.equals(that.pex))
9955
          return false;
9956
      }
9957
 
9958
      return true;
9959
    }
9960
 
9961
    @Override
9962
    public int hashCode() {
9963
      return 0;
9964
    }
9965
 
9966
    public int compareTo(applyRechargeCoupon_result other) {
9967
      if (!getClass().equals(other.getClass())) {
9968
        return getClass().getName().compareTo(other.getClass().getName());
9969
      }
9970
 
9971
      int lastComparison = 0;
9972
      applyRechargeCoupon_result typedOther = (applyRechargeCoupon_result)other;
9973
 
9974
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
9975
      if (lastComparison != 0) {
9976
        return lastComparison;
9977
      }
9978
      if (isSetSuccess()) {
9979
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
9980
        if (lastComparison != 0) {
9981
          return lastComparison;
9982
        }
9983
      }
9984
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
9985
      if (lastComparison != 0) {
9986
        return lastComparison;
9987
      }
9988
      if (isSetPex()) {
9989
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
9990
        if (lastComparison != 0) {
9991
          return lastComparison;
9992
        }
9993
      }
9994
      return 0;
9995
    }
9996
 
9997
    public _Fields fieldForId(int fieldId) {
9998
      return _Fields.findByThriftId(fieldId);
9999
    }
10000
 
10001
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10002
      org.apache.thrift.protocol.TField field;
10003
      iprot.readStructBegin();
10004
      while (true)
10005
      {
10006
        field = iprot.readFieldBegin();
10007
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
10008
          break;
10009
        }
10010
        switch (field.id) {
10011
          case 0: // SUCCESS
10012
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
10013
              {
11592 amit.gupta 10014
                org.apache.thrift.protocol.TMap _map25 = iprot.readMapBegin();
10015
                this.success = new HashMap<Long,String>(2*_map25.size);
10016
                for (int _i26 = 0; _i26 < _map25.size; ++_i26)
6433 anupam.sin 10017
                {
11592 amit.gupta 10018
                  long _key27; // required
10019
                  String _val28; // required
10020
                  _key27 = iprot.readI64();
10021
                  _val28 = iprot.readString();
10022
                  this.success.put(_key27, _val28);
6433 anupam.sin 10023
                }
10024
                iprot.readMapEnd();
10025
              }
10026
            } else { 
10027
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10028
            }
10029
            break;
10030
          case 1: // PEX
10031
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
10032
              this.pex = new PromotionException();
10033
              this.pex.read(iprot);
10034
            } else { 
10035
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10036
            }
10037
            break;
10038
          default:
10039
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10040
        }
10041
        iprot.readFieldEnd();
10042
      }
10043
      iprot.readStructEnd();
10044
      validate();
10045
    }
10046
 
10047
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
10048
      oprot.writeStructBegin(STRUCT_DESC);
10049
 
10050
      if (this.isSetSuccess()) {
10051
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
10052
        {
10053
          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 10054
          for (Map.Entry<Long, String> _iter29 : this.success.entrySet())
6433 anupam.sin 10055
          {
11592 amit.gupta 10056
            oprot.writeI64(_iter29.getKey());
10057
            oprot.writeString(_iter29.getValue());
6433 anupam.sin 10058
          }
10059
          oprot.writeMapEnd();
10060
        }
10061
        oprot.writeFieldEnd();
10062
      } else if (this.isSetPex()) {
10063
        oprot.writeFieldBegin(PEX_FIELD_DESC);
10064
        this.pex.write(oprot);
10065
        oprot.writeFieldEnd();
10066
      }
10067
      oprot.writeFieldStop();
10068
      oprot.writeStructEnd();
10069
    }
10070
 
10071
    @Override
10072
    public String toString() {
10073
      StringBuilder sb = new StringBuilder("applyRechargeCoupon_result(");
10074
      boolean first = true;
10075
 
10076
      sb.append("success:");
10077
      if (this.success == null) {
10078
        sb.append("null");
10079
      } else {
10080
        sb.append(this.success);
10081
      }
10082
      first = false;
10083
      if (!first) sb.append(", ");
10084
      sb.append("pex:");
10085
      if (this.pex == null) {
10086
        sb.append("null");
10087
      } else {
10088
        sb.append(this.pex);
10089
      }
10090
      first = false;
10091
      sb.append(")");
10092
      return sb.toString();
10093
    }
10094
 
10095
    public void validate() throws org.apache.thrift.TException {
10096
      // check for required fields
10097
    }
10098
 
10099
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10100
      try {
10101
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10102
      } catch (org.apache.thrift.TException te) {
10103
        throw new java.io.IOException(te);
10104
      }
10105
    }
10106
 
10107
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10108
      try {
10109
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10110
      } catch (org.apache.thrift.TException te) {
10111
        throw new java.io.IOException(te);
10112
      }
10113
    }
10114
 
10115
  }
10116
 
3430 rajveer 10117
  public static class trackCouponUsage_args implements org.apache.thrift.TBase<trackCouponUsage_args, trackCouponUsage_args._Fields>, java.io.Serializable, Cloneable   {
10118
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_args");
1982 varun.gupt 10119
 
3430 rajveer 10120
    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);
10121
    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);
10122
    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);
13521 amit.gupta 10123
    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);
10124
    private static final org.apache.thrift.protocol.TField IS_DIGITAL_FIELD_DESC = new org.apache.thrift.protocol.TField("isDigital", org.apache.thrift.protocol.TType.BOOL, (short)5);
1982 varun.gupt 10125
 
3430 rajveer 10126
    private String couponCode; // required
10127
    private long transactionId; // required
10128
    private long userId; // required
13521 amit.gupta 10129
    private long amount; // required
10130
    private boolean isDigital; // required
1982 varun.gupt 10131
 
10132
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 10133
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 10134
      COUPON_CODE((short)1, "couponCode"),
10135
      TRANSACTION_ID((short)2, "transactionId"),
13521 amit.gupta 10136
      USER_ID((short)3, "userId"),
10137
      AMOUNT((short)4, "amount"),
10138
      IS_DIGITAL((short)5, "isDigital");
1982 varun.gupt 10139
 
10140
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10141
 
10142
      static {
10143
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10144
          byName.put(field.getFieldName(), field);
10145
        }
10146
      }
10147
 
10148
      /**
10149
       * Find the _Fields constant that matches fieldId, or null if its not found.
10150
       */
10151
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 10152
        switch(fieldId) {
10153
          case 1: // COUPON_CODE
10154
            return COUPON_CODE;
10155
          case 2: // TRANSACTION_ID
10156
            return TRANSACTION_ID;
10157
          case 3: // USER_ID
10158
            return USER_ID;
13521 amit.gupta 10159
          case 4: // AMOUNT
10160
            return AMOUNT;
10161
          case 5: // IS_DIGITAL
10162
            return IS_DIGITAL;
3430 rajveer 10163
          default:
10164
            return null;
10165
        }
1982 varun.gupt 10166
      }
10167
 
10168
      /**
10169
       * Find the _Fields constant that matches fieldId, throwing an exception
10170
       * if it is not found.
10171
       */
10172
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10173
        _Fields fields = findByThriftId(fieldId);
10174
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10175
        return fields;
10176
      }
10177
 
10178
      /**
10179
       * Find the _Fields constant that matches name, or null if its not found.
10180
       */
10181
      public static _Fields findByName(String name) {
10182
        return byName.get(name);
10183
      }
10184
 
10185
      private final short _thriftId;
10186
      private final String _fieldName;
10187
 
10188
      _Fields(short thriftId, String fieldName) {
10189
        _thriftId = thriftId;
10190
        _fieldName = fieldName;
10191
      }
10192
 
10193
      public short getThriftFieldId() {
10194
        return _thriftId;
10195
      }
10196
 
10197
      public String getFieldName() {
10198
        return _fieldName;
10199
      }
10200
    }
10201
 
10202
    // isset id assignments
10203
    private static final int __TRANSACTIONID_ISSET_ID = 0;
10204
    private static final int __USERID_ISSET_ID = 1;
13521 amit.gupta 10205
    private static final int __AMOUNT_ISSET_ID = 2;
10206
    private static final int __ISDIGITAL_ISSET_ID = 3;
10207
    private BitSet __isset_bit_vector = new BitSet(4);
1982 varun.gupt 10208
 
3430 rajveer 10209
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 10210
    static {
3430 rajveer 10211
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10212
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10213
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
10214
      tmpMap.put(_Fields.TRANSACTION_ID, new org.apache.thrift.meta_data.FieldMetaData("transactionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10215
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
10216
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10217
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
13521 amit.gupta 10218
      tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10219
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
10220
      tmpMap.put(_Fields.IS_DIGITAL, new org.apache.thrift.meta_data.FieldMetaData("isDigital", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10221
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
3430 rajveer 10222
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10223
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_args.class, metaDataMap);
1982 varun.gupt 10224
    }
10225
 
10226
    public trackCouponUsage_args() {
10227
    }
10228
 
10229
    public trackCouponUsage_args(
10230
      String couponCode,
10231
      long transactionId,
13521 amit.gupta 10232
      long userId,
10233
      long amount,
10234
      boolean isDigital)
1982 varun.gupt 10235
    {
10236
      this();
10237
      this.couponCode = couponCode;
10238
      this.transactionId = transactionId;
10239
      setTransactionIdIsSet(true);
10240
      this.userId = userId;
10241
      setUserIdIsSet(true);
13521 amit.gupta 10242
      this.amount = amount;
10243
      setAmountIsSet(true);
10244
      this.isDigital = isDigital;
10245
      setIsDigitalIsSet(true);
1982 varun.gupt 10246
    }
10247
 
10248
    /**
10249
     * Performs a deep copy on <i>other</i>.
10250
     */
10251
    public trackCouponUsage_args(trackCouponUsage_args other) {
10252
      __isset_bit_vector.clear();
10253
      __isset_bit_vector.or(other.__isset_bit_vector);
10254
      if (other.isSetCouponCode()) {
10255
        this.couponCode = other.couponCode;
10256
      }
10257
      this.transactionId = other.transactionId;
10258
      this.userId = other.userId;
13521 amit.gupta 10259
      this.amount = other.amount;
10260
      this.isDigital = other.isDigital;
1982 varun.gupt 10261
    }
10262
 
10263
    public trackCouponUsage_args deepCopy() {
10264
      return new trackCouponUsage_args(this);
10265
    }
10266
 
3430 rajveer 10267
    @Override
10268
    public void clear() {
10269
      this.couponCode = null;
10270
      setTransactionIdIsSet(false);
10271
      this.transactionId = 0;
10272
      setUserIdIsSet(false);
10273
      this.userId = 0;
13521 amit.gupta 10274
      setAmountIsSet(false);
10275
      this.amount = 0;
10276
      setIsDigitalIsSet(false);
10277
      this.isDigital = false;
1982 varun.gupt 10278
    }
10279
 
10280
    public String getCouponCode() {
10281
      return this.couponCode;
10282
    }
10283
 
3430 rajveer 10284
    public void setCouponCode(String couponCode) {
1982 varun.gupt 10285
      this.couponCode = couponCode;
10286
    }
10287
 
10288
    public void unsetCouponCode() {
10289
      this.couponCode = null;
10290
    }
10291
 
3430 rajveer 10292
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 10293
    public boolean isSetCouponCode() {
10294
      return this.couponCode != null;
10295
    }
10296
 
10297
    public void setCouponCodeIsSet(boolean value) {
10298
      if (!value) {
10299
        this.couponCode = null;
10300
      }
10301
    }
10302
 
10303
    public long getTransactionId() {
10304
      return this.transactionId;
10305
    }
10306
 
3430 rajveer 10307
    public void setTransactionId(long transactionId) {
1982 varun.gupt 10308
      this.transactionId = transactionId;
10309
      setTransactionIdIsSet(true);
10310
    }
10311
 
10312
    public void unsetTransactionId() {
10313
      __isset_bit_vector.clear(__TRANSACTIONID_ISSET_ID);
10314
    }
10315
 
3430 rajveer 10316
    /** Returns true if field transactionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 10317
    public boolean isSetTransactionId() {
10318
      return __isset_bit_vector.get(__TRANSACTIONID_ISSET_ID);
10319
    }
10320
 
10321
    public void setTransactionIdIsSet(boolean value) {
10322
      __isset_bit_vector.set(__TRANSACTIONID_ISSET_ID, value);
10323
    }
10324
 
10325
    public long getUserId() {
10326
      return this.userId;
10327
    }
10328
 
3430 rajveer 10329
    public void setUserId(long userId) {
1982 varun.gupt 10330
      this.userId = userId;
10331
      setUserIdIsSet(true);
10332
    }
10333
 
10334
    public void unsetUserId() {
10335
      __isset_bit_vector.clear(__USERID_ISSET_ID);
10336
    }
10337
 
3430 rajveer 10338
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 10339
    public boolean isSetUserId() {
10340
      return __isset_bit_vector.get(__USERID_ISSET_ID);
10341
    }
10342
 
10343
    public void setUserIdIsSet(boolean value) {
10344
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
10345
    }
10346
 
13521 amit.gupta 10347
    public long getAmount() {
10348
      return this.amount;
10349
    }
10350
 
10351
    public void setAmount(long amount) {
10352
      this.amount = amount;
10353
      setAmountIsSet(true);
10354
    }
10355
 
10356
    public void unsetAmount() {
10357
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
10358
    }
10359
 
10360
    /** Returns true if field amount is set (has been assigned a value) and false otherwise */
10361
    public boolean isSetAmount() {
10362
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
10363
    }
10364
 
10365
    public void setAmountIsSet(boolean value) {
10366
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
10367
    }
10368
 
10369
    public boolean isIsDigital() {
10370
      return this.isDigital;
10371
    }
10372
 
10373
    public void setIsDigital(boolean isDigital) {
10374
      this.isDigital = isDigital;
10375
      setIsDigitalIsSet(true);
10376
    }
10377
 
10378
    public void unsetIsDigital() {
10379
      __isset_bit_vector.clear(__ISDIGITAL_ISSET_ID);
10380
    }
10381
 
10382
    /** Returns true if field isDigital is set (has been assigned a value) and false otherwise */
10383
    public boolean isSetIsDigital() {
10384
      return __isset_bit_vector.get(__ISDIGITAL_ISSET_ID);
10385
    }
10386
 
10387
    public void setIsDigitalIsSet(boolean value) {
10388
      __isset_bit_vector.set(__ISDIGITAL_ISSET_ID, value);
10389
    }
10390
 
1982 varun.gupt 10391
    public void setFieldValue(_Fields field, Object value) {
10392
      switch (field) {
10393
      case COUPON_CODE:
10394
        if (value == null) {
10395
          unsetCouponCode();
10396
        } else {
10397
          setCouponCode((String)value);
10398
        }
10399
        break;
10400
 
10401
      case TRANSACTION_ID:
10402
        if (value == null) {
10403
          unsetTransactionId();
10404
        } else {
10405
          setTransactionId((Long)value);
10406
        }
10407
        break;
10408
 
10409
      case USER_ID:
10410
        if (value == null) {
10411
          unsetUserId();
10412
        } else {
10413
          setUserId((Long)value);
10414
        }
10415
        break;
10416
 
13521 amit.gupta 10417
      case AMOUNT:
10418
        if (value == null) {
10419
          unsetAmount();
10420
        } else {
10421
          setAmount((Long)value);
10422
        }
10423
        break;
10424
 
10425
      case IS_DIGITAL:
10426
        if (value == null) {
10427
          unsetIsDigital();
10428
        } else {
10429
          setIsDigital((Boolean)value);
10430
        }
10431
        break;
10432
 
1982 varun.gupt 10433
      }
10434
    }
10435
 
10436
    public Object getFieldValue(_Fields field) {
10437
      switch (field) {
10438
      case COUPON_CODE:
10439
        return getCouponCode();
10440
 
10441
      case TRANSACTION_ID:
3430 rajveer 10442
        return Long.valueOf(getTransactionId());
1982 varun.gupt 10443
 
10444
      case USER_ID:
3430 rajveer 10445
        return Long.valueOf(getUserId());
1982 varun.gupt 10446
 
13521 amit.gupta 10447
      case AMOUNT:
10448
        return Long.valueOf(getAmount());
10449
 
10450
      case IS_DIGITAL:
10451
        return Boolean.valueOf(isIsDigital());
10452
 
1982 varun.gupt 10453
      }
10454
      throw new IllegalStateException();
10455
    }
10456
 
3430 rajveer 10457
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10458
    public boolean isSet(_Fields field) {
10459
      if (field == null) {
10460
        throw new IllegalArgumentException();
10461
      }
1982 varun.gupt 10462
 
10463
      switch (field) {
10464
      case COUPON_CODE:
10465
        return isSetCouponCode();
10466
      case TRANSACTION_ID:
10467
        return isSetTransactionId();
10468
      case USER_ID:
10469
        return isSetUserId();
13521 amit.gupta 10470
      case AMOUNT:
10471
        return isSetAmount();
10472
      case IS_DIGITAL:
10473
        return isSetIsDigital();
1982 varun.gupt 10474
      }
10475
      throw new IllegalStateException();
10476
    }
10477
 
10478
    @Override
10479
    public boolean equals(Object that) {
10480
      if (that == null)
10481
        return false;
10482
      if (that instanceof trackCouponUsage_args)
10483
        return this.equals((trackCouponUsage_args)that);
10484
      return false;
10485
    }
10486
 
10487
    public boolean equals(trackCouponUsage_args that) {
10488
      if (that == null)
10489
        return false;
10490
 
10491
      boolean this_present_couponCode = true && this.isSetCouponCode();
10492
      boolean that_present_couponCode = true && that.isSetCouponCode();
10493
      if (this_present_couponCode || that_present_couponCode) {
10494
        if (!(this_present_couponCode && that_present_couponCode))
10495
          return false;
10496
        if (!this.couponCode.equals(that.couponCode))
10497
          return false;
10498
      }
10499
 
10500
      boolean this_present_transactionId = true;
10501
      boolean that_present_transactionId = true;
10502
      if (this_present_transactionId || that_present_transactionId) {
10503
        if (!(this_present_transactionId && that_present_transactionId))
10504
          return false;
10505
        if (this.transactionId != that.transactionId)
10506
          return false;
10507
      }
10508
 
10509
      boolean this_present_userId = true;
10510
      boolean that_present_userId = true;
10511
      if (this_present_userId || that_present_userId) {
10512
        if (!(this_present_userId && that_present_userId))
10513
          return false;
10514
        if (this.userId != that.userId)
10515
          return false;
10516
      }
10517
 
13521 amit.gupta 10518
      boolean this_present_amount = true;
10519
      boolean that_present_amount = true;
10520
      if (this_present_amount || that_present_amount) {
10521
        if (!(this_present_amount && that_present_amount))
10522
          return false;
10523
        if (this.amount != that.amount)
10524
          return false;
10525
      }
10526
 
10527
      boolean this_present_isDigital = true;
10528
      boolean that_present_isDigital = true;
10529
      if (this_present_isDigital || that_present_isDigital) {
10530
        if (!(this_present_isDigital && that_present_isDigital))
10531
          return false;
10532
        if (this.isDigital != that.isDigital)
10533
          return false;
10534
      }
10535
 
1982 varun.gupt 10536
      return true;
10537
    }
10538
 
10539
    @Override
10540
    public int hashCode() {
10541
      return 0;
10542
    }
10543
 
10544
    public int compareTo(trackCouponUsage_args other) {
10545
      if (!getClass().equals(other.getClass())) {
10546
        return getClass().getName().compareTo(other.getClass().getName());
10547
      }
10548
 
10549
      int lastComparison = 0;
10550
      trackCouponUsage_args typedOther = (trackCouponUsage_args)other;
10551
 
3430 rajveer 10552
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 10553
      if (lastComparison != 0) {
10554
        return lastComparison;
10555
      }
3430 rajveer 10556
      if (isSetCouponCode()) {
10557
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
10558
        if (lastComparison != 0) {
10559
          return lastComparison;
10560
        }
1982 varun.gupt 10561
      }
3430 rajveer 10562
      lastComparison = Boolean.valueOf(isSetTransactionId()).compareTo(typedOther.isSetTransactionId());
1982 varun.gupt 10563
      if (lastComparison != 0) {
10564
        return lastComparison;
10565
      }
3430 rajveer 10566
      if (isSetTransactionId()) {
10567
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transactionId, typedOther.transactionId);
10568
        if (lastComparison != 0) {
10569
          return lastComparison;
10570
        }
1982 varun.gupt 10571
      }
3430 rajveer 10572
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 10573
      if (lastComparison != 0) {
10574
        return lastComparison;
10575
      }
3430 rajveer 10576
      if (isSetUserId()) {
10577
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
10578
        if (lastComparison != 0) {
10579
          return lastComparison;
10580
        }
1982 varun.gupt 10581
      }
13521 amit.gupta 10582
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
10583
      if (lastComparison != 0) {
10584
        return lastComparison;
10585
      }
10586
      if (isSetAmount()) {
10587
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
10588
        if (lastComparison != 0) {
10589
          return lastComparison;
10590
        }
10591
      }
10592
      lastComparison = Boolean.valueOf(isSetIsDigital()).compareTo(typedOther.isSetIsDigital());
10593
      if (lastComparison != 0) {
10594
        return lastComparison;
10595
      }
10596
      if (isSetIsDigital()) {
10597
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isDigital, typedOther.isDigital);
10598
        if (lastComparison != 0) {
10599
          return lastComparison;
10600
        }
10601
      }
1982 varun.gupt 10602
      return 0;
10603
    }
10604
 
3430 rajveer 10605
    public _Fields fieldForId(int fieldId) {
10606
      return _Fields.findByThriftId(fieldId);
10607
    }
10608
 
10609
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10610
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 10611
      iprot.readStructBegin();
10612
      while (true)
10613
      {
10614
        field = iprot.readFieldBegin();
3430 rajveer 10615
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 10616
          break;
10617
        }
3430 rajveer 10618
        switch (field.id) {
10619
          case 1: // COUPON_CODE
10620
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
10621
              this.couponCode = iprot.readString();
10622
            } else { 
10623
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10624
            }
10625
            break;
10626
          case 2: // TRANSACTION_ID
10627
            if (field.type == org.apache.thrift.protocol.TType.I64) {
10628
              this.transactionId = iprot.readI64();
10629
              setTransactionIdIsSet(true);
10630
            } else { 
10631
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10632
            }
10633
            break;
10634
          case 3: // USER_ID
10635
            if (field.type == org.apache.thrift.protocol.TType.I64) {
10636
              this.userId = iprot.readI64();
10637
              setUserIdIsSet(true);
10638
            } else { 
10639
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10640
            }
10641
            break;
13521 amit.gupta 10642
          case 4: // AMOUNT
10643
            if (field.type == org.apache.thrift.protocol.TType.I64) {
10644
              this.amount = iprot.readI64();
10645
              setAmountIsSet(true);
10646
            } else { 
10647
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10648
            }
10649
            break;
10650
          case 5: // IS_DIGITAL
10651
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
10652
              this.isDigital = iprot.readBool();
10653
              setIsDigitalIsSet(true);
10654
            } else { 
10655
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10656
            }
10657
            break;
3430 rajveer 10658
          default:
10659
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 10660
        }
3430 rajveer 10661
        iprot.readFieldEnd();
1982 varun.gupt 10662
      }
10663
      iprot.readStructEnd();
10664
      validate();
10665
    }
10666
 
3430 rajveer 10667
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 10668
      validate();
10669
 
10670
      oprot.writeStructBegin(STRUCT_DESC);
10671
      if (this.couponCode != null) {
10672
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
10673
        oprot.writeString(this.couponCode);
10674
        oprot.writeFieldEnd();
10675
      }
10676
      oprot.writeFieldBegin(TRANSACTION_ID_FIELD_DESC);
10677
      oprot.writeI64(this.transactionId);
10678
      oprot.writeFieldEnd();
10679
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
10680
      oprot.writeI64(this.userId);
10681
      oprot.writeFieldEnd();
13521 amit.gupta 10682
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
10683
      oprot.writeI64(this.amount);
10684
      oprot.writeFieldEnd();
10685
      oprot.writeFieldBegin(IS_DIGITAL_FIELD_DESC);
10686
      oprot.writeBool(this.isDigital);
10687
      oprot.writeFieldEnd();
1982 varun.gupt 10688
      oprot.writeFieldStop();
10689
      oprot.writeStructEnd();
10690
    }
10691
 
10692
    @Override
10693
    public String toString() {
10694
      StringBuilder sb = new StringBuilder("trackCouponUsage_args(");
10695
      boolean first = true;
10696
 
10697
      sb.append("couponCode:");
10698
      if (this.couponCode == null) {
10699
        sb.append("null");
10700
      } else {
10701
        sb.append(this.couponCode);
10702
      }
10703
      first = false;
10704
      if (!first) sb.append(", ");
10705
      sb.append("transactionId:");
10706
      sb.append(this.transactionId);
10707
      first = false;
10708
      if (!first) sb.append(", ");
10709
      sb.append("userId:");
10710
      sb.append(this.userId);
10711
      first = false;
13521 amit.gupta 10712
      if (!first) sb.append(", ");
10713
      sb.append("amount:");
10714
      sb.append(this.amount);
10715
      first = false;
10716
      if (!first) sb.append(", ");
10717
      sb.append("isDigital:");
10718
      sb.append(this.isDigital);
10719
      first = false;
1982 varun.gupt 10720
      sb.append(")");
10721
      return sb.toString();
10722
    }
10723
 
3430 rajveer 10724
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 10725
      // check for required fields
10726
    }
10727
 
3430 rajveer 10728
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10729
      try {
10730
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10731
      } catch (org.apache.thrift.TException te) {
10732
        throw new java.io.IOException(te);
10733
      }
10734
    }
10735
 
10736
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10737
      try {
10738
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
10739
        __isset_bit_vector = new BitSet(1);
10740
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10741
      } catch (org.apache.thrift.TException te) {
10742
        throw new java.io.IOException(te);
10743
      }
10744
    }
10745
 
1982 varun.gupt 10746
  }
10747
 
3430 rajveer 10748
  public static class trackCouponUsage_result implements org.apache.thrift.TBase<trackCouponUsage_result, trackCouponUsage_result._Fields>, java.io.Serializable, Cloneable   {
10749
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_result");
1982 varun.gupt 10750
 
3430 rajveer 10751
    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 10752
 
3430 rajveer 10753
    private PromotionException pex; // required
1982 varun.gupt 10754
 
10755
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 10756
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 10757
      PEX((short)1, "pex");
10758
 
10759
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10760
 
10761
      static {
10762
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10763
          byName.put(field.getFieldName(), field);
10764
        }
10765
      }
10766
 
10767
      /**
10768
       * Find the _Fields constant that matches fieldId, or null if its not found.
10769
       */
10770
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 10771
        switch(fieldId) {
10772
          case 1: // PEX
10773
            return PEX;
10774
          default:
10775
            return null;
10776
        }
1982 varun.gupt 10777
      }
10778
 
10779
      /**
10780
       * Find the _Fields constant that matches fieldId, throwing an exception
10781
       * if it is not found.
10782
       */
10783
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10784
        _Fields fields = findByThriftId(fieldId);
10785
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10786
        return fields;
10787
      }
10788
 
10789
      /**
10790
       * Find the _Fields constant that matches name, or null if its not found.
10791
       */
10792
      public static _Fields findByName(String name) {
10793
        return byName.get(name);
10794
      }
10795
 
10796
      private final short _thriftId;
10797
      private final String _fieldName;
10798
 
10799
      _Fields(short thriftId, String fieldName) {
10800
        _thriftId = thriftId;
10801
        _fieldName = fieldName;
10802
      }
10803
 
10804
      public short getThriftFieldId() {
10805
        return _thriftId;
10806
      }
10807
 
10808
      public String getFieldName() {
10809
        return _fieldName;
10810
      }
10811
    }
10812
 
10813
    // isset id assignments
10814
 
3430 rajveer 10815
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 10816
    static {
3430 rajveer 10817
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10818
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10819
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
10820
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10821
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_result.class, metaDataMap);
1982 varun.gupt 10822
    }
10823
 
10824
    public trackCouponUsage_result() {
10825
    }
10826
 
10827
    public trackCouponUsage_result(
10828
      PromotionException pex)
10829
    {
10830
      this();
10831
      this.pex = pex;
10832
    }
10833
 
10834
    /**
10835
     * Performs a deep copy on <i>other</i>.
10836
     */
10837
    public trackCouponUsage_result(trackCouponUsage_result other) {
10838
      if (other.isSetPex()) {
10839
        this.pex = new PromotionException(other.pex);
10840
      }
10841
    }
10842
 
10843
    public trackCouponUsage_result deepCopy() {
10844
      return new trackCouponUsage_result(this);
10845
    }
10846
 
3430 rajveer 10847
    @Override
10848
    public void clear() {
10849
      this.pex = null;
1982 varun.gupt 10850
    }
10851
 
10852
    public PromotionException getPex() {
10853
      return this.pex;
10854
    }
10855
 
3430 rajveer 10856
    public void setPex(PromotionException pex) {
1982 varun.gupt 10857
      this.pex = pex;
10858
    }
10859
 
10860
    public void unsetPex() {
10861
      this.pex = null;
10862
    }
10863
 
3430 rajveer 10864
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 10865
    public boolean isSetPex() {
10866
      return this.pex != null;
10867
    }
10868
 
10869
    public void setPexIsSet(boolean value) {
10870
      if (!value) {
10871
        this.pex = null;
10872
      }
10873
    }
10874
 
10875
    public void setFieldValue(_Fields field, Object value) {
10876
      switch (field) {
10877
      case PEX:
10878
        if (value == null) {
10879
          unsetPex();
10880
        } else {
10881
          setPex((PromotionException)value);
10882
        }
10883
        break;
10884
 
10885
      }
10886
    }
10887
 
10888
    public Object getFieldValue(_Fields field) {
10889
      switch (field) {
10890
      case PEX:
10891
        return getPex();
10892
 
10893
      }
10894
      throw new IllegalStateException();
10895
    }
10896
 
3430 rajveer 10897
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10898
    public boolean isSet(_Fields field) {
10899
      if (field == null) {
10900
        throw new IllegalArgumentException();
10901
      }
1982 varun.gupt 10902
 
10903
      switch (field) {
10904
      case PEX:
10905
        return isSetPex();
10906
      }
10907
      throw new IllegalStateException();
10908
    }
10909
 
10910
    @Override
10911
    public boolean equals(Object that) {
10912
      if (that == null)
10913
        return false;
10914
      if (that instanceof trackCouponUsage_result)
10915
        return this.equals((trackCouponUsage_result)that);
10916
      return false;
10917
    }
10918
 
10919
    public boolean equals(trackCouponUsage_result that) {
10920
      if (that == null)
10921
        return false;
10922
 
10923
      boolean this_present_pex = true && this.isSetPex();
10924
      boolean that_present_pex = true && that.isSetPex();
10925
      if (this_present_pex || that_present_pex) {
10926
        if (!(this_present_pex && that_present_pex))
10927
          return false;
10928
        if (!this.pex.equals(that.pex))
10929
          return false;
10930
      }
10931
 
10932
      return true;
10933
    }
10934
 
10935
    @Override
10936
    public int hashCode() {
10937
      return 0;
10938
    }
10939
 
10940
    public int compareTo(trackCouponUsage_result other) {
10941
      if (!getClass().equals(other.getClass())) {
10942
        return getClass().getName().compareTo(other.getClass().getName());
10943
      }
10944
 
10945
      int lastComparison = 0;
10946
      trackCouponUsage_result typedOther = (trackCouponUsage_result)other;
10947
 
3430 rajveer 10948
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 10949
      if (lastComparison != 0) {
10950
        return lastComparison;
10951
      }
3430 rajveer 10952
      if (isSetPex()) {
10953
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
10954
        if (lastComparison != 0) {
10955
          return lastComparison;
10956
        }
1982 varun.gupt 10957
      }
10958
      return 0;
10959
    }
10960
 
3430 rajveer 10961
    public _Fields fieldForId(int fieldId) {
10962
      return _Fields.findByThriftId(fieldId);
10963
    }
10964
 
10965
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10966
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 10967
      iprot.readStructBegin();
10968
      while (true)
10969
      {
10970
        field = iprot.readFieldBegin();
3430 rajveer 10971
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 10972
          break;
10973
        }
3430 rajveer 10974
        switch (field.id) {
10975
          case 1: // PEX
10976
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
10977
              this.pex = new PromotionException();
10978
              this.pex.read(iprot);
10979
            } else { 
10980
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10981
            }
10982
            break;
10983
          default:
10984
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 10985
        }
3430 rajveer 10986
        iprot.readFieldEnd();
1982 varun.gupt 10987
      }
10988
      iprot.readStructEnd();
10989
      validate();
10990
    }
10991
 
3430 rajveer 10992
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 10993
      oprot.writeStructBegin(STRUCT_DESC);
10994
 
10995
      if (this.isSetPex()) {
10996
        oprot.writeFieldBegin(PEX_FIELD_DESC);
10997
        this.pex.write(oprot);
10998
        oprot.writeFieldEnd();
10999
      }
11000
      oprot.writeFieldStop();
11001
      oprot.writeStructEnd();
11002
    }
11003
 
11004
    @Override
11005
    public String toString() {
11006
      StringBuilder sb = new StringBuilder("trackCouponUsage_result(");
11007
      boolean first = true;
11008
 
11009
      sb.append("pex:");
11010
      if (this.pex == null) {
11011
        sb.append("null");
11012
      } else {
11013
        sb.append(this.pex);
11014
      }
11015
      first = false;
11016
      sb.append(")");
11017
      return sb.toString();
11018
    }
11019
 
3430 rajveer 11020
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 11021
      // check for required fields
11022
    }
11023
 
3430 rajveer 11024
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11025
      try {
11026
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11027
      } catch (org.apache.thrift.TException te) {
11028
        throw new java.io.IOException(te);
11029
      }
11030
    }
11031
 
11032
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11033
      try {
11034
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11035
      } catch (org.apache.thrift.TException te) {
11036
        throw new java.io.IOException(te);
11037
      }
11038
    }
11039
 
1982 varun.gupt 11040
  }
11041
 
3430 rajveer 11042
  public static class getCouponUsageCountByUser_args implements org.apache.thrift.TBase<getCouponUsageCountByUser_args, getCouponUsageCountByUser_args._Fields>, java.io.Serializable, Cloneable   {
11043
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_args");
1982 varun.gupt 11044
 
3430 rajveer 11045
    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);
11046
    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 11047
 
3430 rajveer 11048
    private String couponCode; // required
11049
    private long userId; // required
1982 varun.gupt 11050
 
11051
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 11052
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 11053
      COUPON_CODE((short)1, "couponCode"),
11054
      USER_ID((short)2, "userId");
11055
 
11056
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11057
 
11058
      static {
11059
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11060
          byName.put(field.getFieldName(), field);
11061
        }
11062
      }
11063
 
11064
      /**
11065
       * Find the _Fields constant that matches fieldId, or null if its not found.
11066
       */
11067
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 11068
        switch(fieldId) {
11069
          case 1: // COUPON_CODE
11070
            return COUPON_CODE;
11071
          case 2: // USER_ID
11072
            return USER_ID;
11073
          default:
11074
            return null;
11075
        }
1982 varun.gupt 11076
      }
11077
 
11078
      /**
11079
       * Find the _Fields constant that matches fieldId, throwing an exception
11080
       * if it is not found.
11081
       */
11082
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11083
        _Fields fields = findByThriftId(fieldId);
11084
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11085
        return fields;
11086
      }
11087
 
11088
      /**
11089
       * Find the _Fields constant that matches name, or null if its not found.
11090
       */
11091
      public static _Fields findByName(String name) {
11092
        return byName.get(name);
11093
      }
11094
 
11095
      private final short _thriftId;
11096
      private final String _fieldName;
11097
 
11098
      _Fields(short thriftId, String fieldName) {
11099
        _thriftId = thriftId;
11100
        _fieldName = fieldName;
11101
      }
11102
 
11103
      public short getThriftFieldId() {
11104
        return _thriftId;
11105
      }
11106
 
11107
      public String getFieldName() {
11108
        return _fieldName;
11109
      }
11110
    }
11111
 
11112
    // isset id assignments
11113
    private static final int __USERID_ISSET_ID = 0;
11114
    private BitSet __isset_bit_vector = new BitSet(1);
11115
 
3430 rajveer 11116
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 11117
    static {
3430 rajveer 11118
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11119
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11120
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
11121
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11122
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
11123
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11124
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_args.class, metaDataMap);
1982 varun.gupt 11125
    }
11126
 
11127
    public getCouponUsageCountByUser_args() {
11128
    }
11129
 
11130
    public getCouponUsageCountByUser_args(
11131
      String couponCode,
11132
      long userId)
11133
    {
11134
      this();
11135
      this.couponCode = couponCode;
11136
      this.userId = userId;
11137
      setUserIdIsSet(true);
11138
    }
11139
 
11140
    /**
11141
     * Performs a deep copy on <i>other</i>.
11142
     */
11143
    public getCouponUsageCountByUser_args(getCouponUsageCountByUser_args other) {
11144
      __isset_bit_vector.clear();
11145
      __isset_bit_vector.or(other.__isset_bit_vector);
11146
      if (other.isSetCouponCode()) {
11147
        this.couponCode = other.couponCode;
11148
      }
11149
      this.userId = other.userId;
11150
    }
11151
 
11152
    public getCouponUsageCountByUser_args deepCopy() {
11153
      return new getCouponUsageCountByUser_args(this);
11154
    }
11155
 
3430 rajveer 11156
    @Override
11157
    public void clear() {
11158
      this.couponCode = null;
11159
      setUserIdIsSet(false);
11160
      this.userId = 0;
1982 varun.gupt 11161
    }
11162
 
11163
    public String getCouponCode() {
11164
      return this.couponCode;
11165
    }
11166
 
3430 rajveer 11167
    public void setCouponCode(String couponCode) {
1982 varun.gupt 11168
      this.couponCode = couponCode;
11169
    }
11170
 
11171
    public void unsetCouponCode() {
11172
      this.couponCode = null;
11173
    }
11174
 
3430 rajveer 11175
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 11176
    public boolean isSetCouponCode() {
11177
      return this.couponCode != null;
11178
    }
11179
 
11180
    public void setCouponCodeIsSet(boolean value) {
11181
      if (!value) {
11182
        this.couponCode = null;
11183
      }
11184
    }
11185
 
11186
    public long getUserId() {
11187
      return this.userId;
11188
    }
11189
 
3430 rajveer 11190
    public void setUserId(long userId) {
1982 varun.gupt 11191
      this.userId = userId;
11192
      setUserIdIsSet(true);
11193
    }
11194
 
11195
    public void unsetUserId() {
11196
      __isset_bit_vector.clear(__USERID_ISSET_ID);
11197
    }
11198
 
3430 rajveer 11199
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 11200
    public boolean isSetUserId() {
11201
      return __isset_bit_vector.get(__USERID_ISSET_ID);
11202
    }
11203
 
11204
    public void setUserIdIsSet(boolean value) {
11205
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
11206
    }
11207
 
11208
    public void setFieldValue(_Fields field, Object value) {
11209
      switch (field) {
11210
      case COUPON_CODE:
11211
        if (value == null) {
11212
          unsetCouponCode();
11213
        } else {
11214
          setCouponCode((String)value);
11215
        }
11216
        break;
11217
 
11218
      case USER_ID:
11219
        if (value == null) {
11220
          unsetUserId();
11221
        } else {
11222
          setUserId((Long)value);
11223
        }
11224
        break;
11225
 
11226
      }
11227
    }
11228
 
11229
    public Object getFieldValue(_Fields field) {
11230
      switch (field) {
11231
      case COUPON_CODE:
11232
        return getCouponCode();
11233
 
11234
      case USER_ID:
3430 rajveer 11235
        return Long.valueOf(getUserId());
1982 varun.gupt 11236
 
11237
      }
11238
      throw new IllegalStateException();
11239
    }
11240
 
3430 rajveer 11241
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11242
    public boolean isSet(_Fields field) {
11243
      if (field == null) {
11244
        throw new IllegalArgumentException();
11245
      }
1982 varun.gupt 11246
 
11247
      switch (field) {
11248
      case COUPON_CODE:
11249
        return isSetCouponCode();
11250
      case USER_ID:
11251
        return isSetUserId();
11252
      }
11253
      throw new IllegalStateException();
11254
    }
11255
 
11256
    @Override
11257
    public boolean equals(Object that) {
11258
      if (that == null)
11259
        return false;
11260
      if (that instanceof getCouponUsageCountByUser_args)
11261
        return this.equals((getCouponUsageCountByUser_args)that);
11262
      return false;
11263
    }
11264
 
11265
    public boolean equals(getCouponUsageCountByUser_args that) {
11266
      if (that == null)
11267
        return false;
11268
 
11269
      boolean this_present_couponCode = true && this.isSetCouponCode();
11270
      boolean that_present_couponCode = true && that.isSetCouponCode();
11271
      if (this_present_couponCode || that_present_couponCode) {
11272
        if (!(this_present_couponCode && that_present_couponCode))
11273
          return false;
11274
        if (!this.couponCode.equals(that.couponCode))
11275
          return false;
11276
      }
11277
 
11278
      boolean this_present_userId = true;
11279
      boolean that_present_userId = true;
11280
      if (this_present_userId || that_present_userId) {
11281
        if (!(this_present_userId && that_present_userId))
11282
          return false;
11283
        if (this.userId != that.userId)
11284
          return false;
11285
      }
11286
 
11287
      return true;
11288
    }
11289
 
11290
    @Override
11291
    public int hashCode() {
11292
      return 0;
11293
    }
11294
 
11295
    public int compareTo(getCouponUsageCountByUser_args other) {
11296
      if (!getClass().equals(other.getClass())) {
11297
        return getClass().getName().compareTo(other.getClass().getName());
11298
      }
11299
 
11300
      int lastComparison = 0;
11301
      getCouponUsageCountByUser_args typedOther = (getCouponUsageCountByUser_args)other;
11302
 
3430 rajveer 11303
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 11304
      if (lastComparison != 0) {
11305
        return lastComparison;
11306
      }
3430 rajveer 11307
      if (isSetCouponCode()) {
11308
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
11309
        if (lastComparison != 0) {
11310
          return lastComparison;
11311
        }
1982 varun.gupt 11312
      }
3430 rajveer 11313
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 11314
      if (lastComparison != 0) {
11315
        return lastComparison;
11316
      }
3430 rajveer 11317
      if (isSetUserId()) {
11318
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
11319
        if (lastComparison != 0) {
11320
          return lastComparison;
11321
        }
1982 varun.gupt 11322
      }
11323
      return 0;
11324
    }
11325
 
3430 rajveer 11326
    public _Fields fieldForId(int fieldId) {
11327
      return _Fields.findByThriftId(fieldId);
11328
    }
11329
 
11330
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11331
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 11332
      iprot.readStructBegin();
11333
      while (true)
11334
      {
11335
        field = iprot.readFieldBegin();
3430 rajveer 11336
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 11337
          break;
11338
        }
3430 rajveer 11339
        switch (field.id) {
11340
          case 1: // COUPON_CODE
11341
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
11342
              this.couponCode = iprot.readString();
11343
            } else { 
11344
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11345
            }
11346
            break;
11347
          case 2: // USER_ID
11348
            if (field.type == org.apache.thrift.protocol.TType.I64) {
11349
              this.userId = iprot.readI64();
11350
              setUserIdIsSet(true);
11351
            } else { 
11352
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11353
            }
11354
            break;
11355
          default:
11356
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 11357
        }
3430 rajveer 11358
        iprot.readFieldEnd();
1982 varun.gupt 11359
      }
11360
      iprot.readStructEnd();
11361
      validate();
11362
    }
11363
 
3430 rajveer 11364
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 11365
      validate();
11366
 
11367
      oprot.writeStructBegin(STRUCT_DESC);
11368
      if (this.couponCode != null) {
11369
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
11370
        oprot.writeString(this.couponCode);
11371
        oprot.writeFieldEnd();
11372
      }
11373
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
11374
      oprot.writeI64(this.userId);
11375
      oprot.writeFieldEnd();
11376
      oprot.writeFieldStop();
11377
      oprot.writeStructEnd();
11378
    }
11379
 
11380
    @Override
11381
    public String toString() {
11382
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_args(");
11383
      boolean first = true;
11384
 
11385
      sb.append("couponCode:");
11386
      if (this.couponCode == null) {
11387
        sb.append("null");
11388
      } else {
11389
        sb.append(this.couponCode);
11390
      }
11391
      first = false;
11392
      if (!first) sb.append(", ");
11393
      sb.append("userId:");
11394
      sb.append(this.userId);
11395
      first = false;
11396
      sb.append(")");
11397
      return sb.toString();
11398
    }
11399
 
3430 rajveer 11400
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 11401
      // check for required fields
11402
    }
11403
 
3430 rajveer 11404
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11405
      try {
11406
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11407
      } catch (org.apache.thrift.TException te) {
11408
        throw new java.io.IOException(te);
11409
      }
11410
    }
11411
 
11412
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11413
      try {
11414
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
11415
        __isset_bit_vector = new BitSet(1);
11416
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11417
      } catch (org.apache.thrift.TException te) {
11418
        throw new java.io.IOException(te);
11419
      }
11420
    }
11421
 
1982 varun.gupt 11422
  }
11423
 
3430 rajveer 11424
  public static class getCouponUsageCountByUser_result implements org.apache.thrift.TBase<getCouponUsageCountByUser_result, getCouponUsageCountByUser_result._Fields>, java.io.Serializable, Cloneable   {
11425
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_result");
1982 varun.gupt 11426
 
3430 rajveer 11427
    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);
11428
    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 11429
 
3430 rajveer 11430
    private long success; // required
11431
    private PromotionException pex; // required
1982 varun.gupt 11432
 
11433
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 11434
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 11435
      SUCCESS((short)0, "success"),
11436
      PEX((short)1, "pex");
11437
 
11438
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11439
 
11440
      static {
11441
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11442
          byName.put(field.getFieldName(), field);
11443
        }
11444
      }
11445
 
11446
      /**
11447
       * Find the _Fields constant that matches fieldId, or null if its not found.
11448
       */
11449
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 11450
        switch(fieldId) {
11451
          case 0: // SUCCESS
11452
            return SUCCESS;
11453
          case 1: // PEX
11454
            return PEX;
11455
          default:
11456
            return null;
11457
        }
1982 varun.gupt 11458
      }
11459
 
11460
      /**
11461
       * Find the _Fields constant that matches fieldId, throwing an exception
11462
       * if it is not found.
11463
       */
11464
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11465
        _Fields fields = findByThriftId(fieldId);
11466
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11467
        return fields;
11468
      }
11469
 
11470
      /**
11471
       * Find the _Fields constant that matches name, or null if its not found.
11472
       */
11473
      public static _Fields findByName(String name) {
11474
        return byName.get(name);
11475
      }
11476
 
11477
      private final short _thriftId;
11478
      private final String _fieldName;
11479
 
11480
      _Fields(short thriftId, String fieldName) {
11481
        _thriftId = thriftId;
11482
        _fieldName = fieldName;
11483
      }
11484
 
11485
      public short getThriftFieldId() {
11486
        return _thriftId;
11487
      }
11488
 
11489
      public String getFieldName() {
11490
        return _fieldName;
11491
      }
11492
    }
11493
 
11494
    // isset id assignments
11495
    private static final int __SUCCESS_ISSET_ID = 0;
11496
    private BitSet __isset_bit_vector = new BitSet(1);
11497
 
3430 rajveer 11498
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 11499
    static {
3430 rajveer 11500
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11501
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11502
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
11503
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11504
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
11505
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11506
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_result.class, metaDataMap);
1982 varun.gupt 11507
    }
11508
 
11509
    public getCouponUsageCountByUser_result() {
11510
    }
11511
 
11512
    public getCouponUsageCountByUser_result(
11513
      long success,
11514
      PromotionException pex)
11515
    {
11516
      this();
11517
      this.success = success;
11518
      setSuccessIsSet(true);
11519
      this.pex = pex;
11520
    }
11521
 
11522
    /**
11523
     * Performs a deep copy on <i>other</i>.
11524
     */
11525
    public getCouponUsageCountByUser_result(getCouponUsageCountByUser_result other) {
11526
      __isset_bit_vector.clear();
11527
      __isset_bit_vector.or(other.__isset_bit_vector);
11528
      this.success = other.success;
11529
      if (other.isSetPex()) {
11530
        this.pex = new PromotionException(other.pex);
11531
      }
11532
    }
11533
 
11534
    public getCouponUsageCountByUser_result deepCopy() {
11535
      return new getCouponUsageCountByUser_result(this);
11536
    }
11537
 
3430 rajveer 11538
    @Override
11539
    public void clear() {
11540
      setSuccessIsSet(false);
11541
      this.success = 0;
11542
      this.pex = null;
1982 varun.gupt 11543
    }
11544
 
11545
    public long getSuccess() {
11546
      return this.success;
11547
    }
11548
 
3430 rajveer 11549
    public void setSuccess(long success) {
1982 varun.gupt 11550
      this.success = success;
11551
      setSuccessIsSet(true);
11552
    }
11553
 
11554
    public void unsetSuccess() {
11555
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
11556
    }
11557
 
3430 rajveer 11558
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 11559
    public boolean isSetSuccess() {
11560
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
11561
    }
11562
 
11563
    public void setSuccessIsSet(boolean value) {
11564
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
11565
    }
11566
 
11567
    public PromotionException getPex() {
11568
      return this.pex;
11569
    }
11570
 
3430 rajveer 11571
    public void setPex(PromotionException pex) {
1982 varun.gupt 11572
      this.pex = pex;
11573
    }
11574
 
11575
    public void unsetPex() {
11576
      this.pex = null;
11577
    }
11578
 
3430 rajveer 11579
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 11580
    public boolean isSetPex() {
11581
      return this.pex != null;
11582
    }
11583
 
11584
    public void setPexIsSet(boolean value) {
11585
      if (!value) {
11586
        this.pex = null;
11587
      }
11588
    }
11589
 
11590
    public void setFieldValue(_Fields field, Object value) {
11591
      switch (field) {
11592
      case SUCCESS:
11593
        if (value == null) {
11594
          unsetSuccess();
11595
        } else {
11596
          setSuccess((Long)value);
11597
        }
11598
        break;
11599
 
11600
      case PEX:
11601
        if (value == null) {
11602
          unsetPex();
11603
        } else {
11604
          setPex((PromotionException)value);
11605
        }
11606
        break;
11607
 
11608
      }
11609
    }
11610
 
11611
    public Object getFieldValue(_Fields field) {
11612
      switch (field) {
11613
      case SUCCESS:
3430 rajveer 11614
        return Long.valueOf(getSuccess());
1982 varun.gupt 11615
 
11616
      case PEX:
11617
        return getPex();
11618
 
11619
      }
11620
      throw new IllegalStateException();
11621
    }
11622
 
3430 rajveer 11623
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11624
    public boolean isSet(_Fields field) {
11625
      if (field == null) {
11626
        throw new IllegalArgumentException();
11627
      }
1982 varun.gupt 11628
 
11629
      switch (field) {
11630
      case SUCCESS:
11631
        return isSetSuccess();
11632
      case PEX:
11633
        return isSetPex();
11634
      }
11635
      throw new IllegalStateException();
11636
    }
11637
 
11638
    @Override
11639
    public boolean equals(Object that) {
11640
      if (that == null)
11641
        return false;
11642
      if (that instanceof getCouponUsageCountByUser_result)
11643
        return this.equals((getCouponUsageCountByUser_result)that);
11644
      return false;
11645
    }
11646
 
11647
    public boolean equals(getCouponUsageCountByUser_result that) {
11648
      if (that == null)
11649
        return false;
11650
 
11651
      boolean this_present_success = true;
11652
      boolean that_present_success = true;
11653
      if (this_present_success || that_present_success) {
11654
        if (!(this_present_success && that_present_success))
11655
          return false;
11656
        if (this.success != that.success)
11657
          return false;
11658
      }
11659
 
11660
      boolean this_present_pex = true && this.isSetPex();
11661
      boolean that_present_pex = true && that.isSetPex();
11662
      if (this_present_pex || that_present_pex) {
11663
        if (!(this_present_pex && that_present_pex))
11664
          return false;
11665
        if (!this.pex.equals(that.pex))
11666
          return false;
11667
      }
11668
 
11669
      return true;
11670
    }
11671
 
11672
    @Override
11673
    public int hashCode() {
11674
      return 0;
11675
    }
11676
 
11677
    public int compareTo(getCouponUsageCountByUser_result other) {
11678
      if (!getClass().equals(other.getClass())) {
11679
        return getClass().getName().compareTo(other.getClass().getName());
11680
      }
11681
 
11682
      int lastComparison = 0;
11683
      getCouponUsageCountByUser_result typedOther = (getCouponUsageCountByUser_result)other;
11684
 
3430 rajveer 11685
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 11686
      if (lastComparison != 0) {
11687
        return lastComparison;
11688
      }
3430 rajveer 11689
      if (isSetSuccess()) {
11690
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
11691
        if (lastComparison != 0) {
11692
          return lastComparison;
11693
        }
1982 varun.gupt 11694
      }
3430 rajveer 11695
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 11696
      if (lastComparison != 0) {
11697
        return lastComparison;
11698
      }
3430 rajveer 11699
      if (isSetPex()) {
11700
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
11701
        if (lastComparison != 0) {
11702
          return lastComparison;
11703
        }
1982 varun.gupt 11704
      }
11705
      return 0;
11706
    }
11707
 
3430 rajveer 11708
    public _Fields fieldForId(int fieldId) {
11709
      return _Fields.findByThriftId(fieldId);
11710
    }
11711
 
11712
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11713
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 11714
      iprot.readStructBegin();
11715
      while (true)
11716
      {
11717
        field = iprot.readFieldBegin();
3430 rajveer 11718
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 11719
          break;
11720
        }
3430 rajveer 11721
        switch (field.id) {
11722
          case 0: // SUCCESS
11723
            if (field.type == org.apache.thrift.protocol.TType.I64) {
11724
              this.success = iprot.readI64();
11725
              setSuccessIsSet(true);
11726
            } else { 
11727
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11728
            }
11729
            break;
11730
          case 1: // PEX
11731
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
11732
              this.pex = new PromotionException();
11733
              this.pex.read(iprot);
11734
            } else { 
11735
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11736
            }
11737
            break;
11738
          default:
11739
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 11740
        }
3430 rajveer 11741
        iprot.readFieldEnd();
1982 varun.gupt 11742
      }
11743
      iprot.readStructEnd();
11744
      validate();
11745
    }
11746
 
3430 rajveer 11747
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 11748
      oprot.writeStructBegin(STRUCT_DESC);
11749
 
11750
      if (this.isSetSuccess()) {
11751
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
11752
        oprot.writeI64(this.success);
11753
        oprot.writeFieldEnd();
11754
      } else if (this.isSetPex()) {
11755
        oprot.writeFieldBegin(PEX_FIELD_DESC);
11756
        this.pex.write(oprot);
11757
        oprot.writeFieldEnd();
11758
      }
11759
      oprot.writeFieldStop();
11760
      oprot.writeStructEnd();
11761
    }
11762
 
11763
    @Override
11764
    public String toString() {
11765
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_result(");
11766
      boolean first = true;
11767
 
11768
      sb.append("success:");
11769
      sb.append(this.success);
11770
      first = false;
11771
      if (!first) sb.append(", ");
11772
      sb.append("pex:");
11773
      if (this.pex == null) {
11774
        sb.append("null");
11775
      } else {
11776
        sb.append(this.pex);
11777
      }
11778
      first = false;
11779
      sb.append(")");
11780
      return sb.toString();
11781
    }
11782
 
3430 rajveer 11783
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 11784
      // check for required fields
11785
    }
11786
 
3430 rajveer 11787
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11788
      try {
11789
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11790
      } catch (org.apache.thrift.TException te) {
11791
        throw new java.io.IOException(te);
11792
      }
11793
    }
11794
 
11795
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11796
      try {
11797
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11798
      } catch (org.apache.thrift.TException te) {
11799
        throw new java.io.IOException(te);
11800
      }
11801
    }
11802
 
1982 varun.gupt 11803
  }
11804
 
6497 amit.gupta 11805
  public static class getActiveCodes_args implements org.apache.thrift.TBase<getActiveCodes_args, getActiveCodes_args._Fields>, java.io.Serializable, Cloneable   {
11806
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCodes_args");
11807
 
11808
    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);
11809
 
11810
    private long promotionId; // required
11811
 
11812
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11813
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11814
      PROMOTION_ID((short)1, "promotionId");
11815
 
11816
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11817
 
11818
      static {
11819
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11820
          byName.put(field.getFieldName(), field);
11821
        }
11822
      }
11823
 
11824
      /**
11825
       * Find the _Fields constant that matches fieldId, or null if its not found.
11826
       */
11827
      public static _Fields findByThriftId(int fieldId) {
11828
        switch(fieldId) {
11829
          case 1: // PROMOTION_ID
11830
            return PROMOTION_ID;
11831
          default:
11832
            return null;
11833
        }
11834
      }
11835
 
11836
      /**
11837
       * Find the _Fields constant that matches fieldId, throwing an exception
11838
       * if it is not found.
11839
       */
11840
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11841
        _Fields fields = findByThriftId(fieldId);
11842
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11843
        return fields;
11844
      }
11845
 
11846
      /**
11847
       * Find the _Fields constant that matches name, or null if its not found.
11848
       */
11849
      public static _Fields findByName(String name) {
11850
        return byName.get(name);
11851
      }
11852
 
11853
      private final short _thriftId;
11854
      private final String _fieldName;
11855
 
11856
      _Fields(short thriftId, String fieldName) {
11857
        _thriftId = thriftId;
11858
        _fieldName = fieldName;
11859
      }
11860
 
11861
      public short getThriftFieldId() {
11862
        return _thriftId;
11863
      }
11864
 
11865
      public String getFieldName() {
11866
        return _fieldName;
11867
      }
11868
    }
11869
 
11870
    // isset id assignments
11871
    private static final int __PROMOTIONID_ISSET_ID = 0;
11872
    private BitSet __isset_bit_vector = new BitSet(1);
11873
 
11874
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
11875
    static {
11876
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11877
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11878
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
11879
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11880
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCodes_args.class, metaDataMap);
11881
    }
11882
 
11883
    public getActiveCodes_args() {
11884
    }
11885
 
11886
    public getActiveCodes_args(
11887
      long promotionId)
11888
    {
11889
      this();
11890
      this.promotionId = promotionId;
11891
      setPromotionIdIsSet(true);
11892
    }
11893
 
11894
    /**
11895
     * Performs a deep copy on <i>other</i>.
11896
     */
11897
    public getActiveCodes_args(getActiveCodes_args other) {
11898
      __isset_bit_vector.clear();
11899
      __isset_bit_vector.or(other.__isset_bit_vector);
11900
      this.promotionId = other.promotionId;
11901
    }
11902
 
11903
    public getActiveCodes_args deepCopy() {
11904
      return new getActiveCodes_args(this);
11905
    }
11906
 
11907
    @Override
11908
    public void clear() {
11909
      setPromotionIdIsSet(false);
11910
      this.promotionId = 0;
11911
    }
11912
 
11913
    public long getPromotionId() {
11914
      return this.promotionId;
11915
    }
11916
 
11917
    public void setPromotionId(long promotionId) {
11918
      this.promotionId = promotionId;
11919
      setPromotionIdIsSet(true);
11920
    }
11921
 
11922
    public void unsetPromotionId() {
11923
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
11924
    }
11925
 
11926
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
11927
    public boolean isSetPromotionId() {
11928
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
11929
    }
11930
 
11931
    public void setPromotionIdIsSet(boolean value) {
11932
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
11933
    }
11934
 
11935
    public void setFieldValue(_Fields field, Object value) {
11936
      switch (field) {
11937
      case PROMOTION_ID:
11938
        if (value == null) {
11939
          unsetPromotionId();
11940
        } else {
11941
          setPromotionId((Long)value);
11942
        }
11943
        break;
11944
 
11945
      }
11946
    }
11947
 
11948
    public Object getFieldValue(_Fields field) {
11949
      switch (field) {
11950
      case PROMOTION_ID:
11951
        return Long.valueOf(getPromotionId());
11952
 
11953
      }
11954
      throw new IllegalStateException();
11955
    }
11956
 
11957
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11958
    public boolean isSet(_Fields field) {
11959
      if (field == null) {
11960
        throw new IllegalArgumentException();
11961
      }
11962
 
11963
      switch (field) {
11964
      case PROMOTION_ID:
11965
        return isSetPromotionId();
11966
      }
11967
      throw new IllegalStateException();
11968
    }
11969
 
11970
    @Override
11971
    public boolean equals(Object that) {
11972
      if (that == null)
11973
        return false;
11974
      if (that instanceof getActiveCodes_args)
11975
        return this.equals((getActiveCodes_args)that);
11976
      return false;
11977
    }
11978
 
11979
    public boolean equals(getActiveCodes_args that) {
11980
      if (that == null)
11981
        return false;
11982
 
11983
      boolean this_present_promotionId = true;
11984
      boolean that_present_promotionId = true;
11985
      if (this_present_promotionId || that_present_promotionId) {
11986
        if (!(this_present_promotionId && that_present_promotionId))
11987
          return false;
11988
        if (this.promotionId != that.promotionId)
11989
          return false;
11990
      }
11991
 
11992
      return true;
11993
    }
11994
 
11995
    @Override
11996
    public int hashCode() {
11997
      return 0;
11998
    }
11999
 
12000
    public int compareTo(getActiveCodes_args other) {
12001
      if (!getClass().equals(other.getClass())) {
12002
        return getClass().getName().compareTo(other.getClass().getName());
12003
      }
12004
 
12005
      int lastComparison = 0;
12006
      getActiveCodes_args typedOther = (getActiveCodes_args)other;
12007
 
12008
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
12009
      if (lastComparison != 0) {
12010
        return lastComparison;
12011
      }
12012
      if (isSetPromotionId()) {
12013
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
12014
        if (lastComparison != 0) {
12015
          return lastComparison;
12016
        }
12017
      }
12018
      return 0;
12019
    }
12020
 
12021
    public _Fields fieldForId(int fieldId) {
12022
      return _Fields.findByThriftId(fieldId);
12023
    }
12024
 
12025
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12026
      org.apache.thrift.protocol.TField field;
12027
      iprot.readStructBegin();
12028
      while (true)
12029
      {
12030
        field = iprot.readFieldBegin();
12031
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12032
          break;
12033
        }
12034
        switch (field.id) {
12035
          case 1: // PROMOTION_ID
12036
            if (field.type == org.apache.thrift.protocol.TType.I64) {
12037
              this.promotionId = iprot.readI64();
12038
              setPromotionIdIsSet(true);
12039
            } else { 
12040
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12041
            }
12042
            break;
12043
          default:
12044
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12045
        }
12046
        iprot.readFieldEnd();
12047
      }
12048
      iprot.readStructEnd();
12049
      validate();
12050
    }
12051
 
12052
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12053
      validate();
12054
 
12055
      oprot.writeStructBegin(STRUCT_DESC);
12056
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
12057
      oprot.writeI64(this.promotionId);
12058
      oprot.writeFieldEnd();
12059
      oprot.writeFieldStop();
12060
      oprot.writeStructEnd();
12061
    }
12062
 
12063
    @Override
12064
    public String toString() {
12065
      StringBuilder sb = new StringBuilder("getActiveCodes_args(");
12066
      boolean first = true;
12067
 
12068
      sb.append("promotionId:");
12069
      sb.append(this.promotionId);
12070
      first = false;
12071
      sb.append(")");
12072
      return sb.toString();
12073
    }
12074
 
12075
    public void validate() throws org.apache.thrift.TException {
12076
      // check for required fields
12077
    }
12078
 
12079
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12080
      try {
12081
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12082
      } catch (org.apache.thrift.TException te) {
12083
        throw new java.io.IOException(te);
12084
      }
12085
    }
12086
 
12087
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12088
      try {
12089
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
12090
        __isset_bit_vector = new BitSet(1);
12091
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12092
      } catch (org.apache.thrift.TException te) {
12093
        throw new java.io.IOException(te);
12094
      }
12095
    }
12096
 
12097
  }
12098
 
12099
  public static class getActiveCodes_result implements org.apache.thrift.TBase<getActiveCodes_result, getActiveCodes_result._Fields>, java.io.Serializable, Cloneable   {
12100
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCodes_result");
12101
 
12102
    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);
12103
    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);
12104
 
12105
    private List<Coupon> success; // required
12106
    private PromotionException pex; // required
12107
 
12108
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12109
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12110
      SUCCESS((short)0, "success"),
12111
      PEX((short)1, "pex");
12112
 
12113
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12114
 
12115
      static {
12116
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12117
          byName.put(field.getFieldName(), field);
12118
        }
12119
      }
12120
 
12121
      /**
12122
       * Find the _Fields constant that matches fieldId, or null if its not found.
12123
       */
12124
      public static _Fields findByThriftId(int fieldId) {
12125
        switch(fieldId) {
12126
          case 0: // SUCCESS
12127
            return SUCCESS;
12128
          case 1: // PEX
12129
            return PEX;
12130
          default:
12131
            return null;
12132
        }
12133
      }
12134
 
12135
      /**
12136
       * Find the _Fields constant that matches fieldId, throwing an exception
12137
       * if it is not found.
12138
       */
12139
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12140
        _Fields fields = findByThriftId(fieldId);
12141
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12142
        return fields;
12143
      }
12144
 
12145
      /**
12146
       * Find the _Fields constant that matches name, or null if its not found.
12147
       */
12148
      public static _Fields findByName(String name) {
12149
        return byName.get(name);
12150
      }
12151
 
12152
      private final short _thriftId;
12153
      private final String _fieldName;
12154
 
12155
      _Fields(short thriftId, String fieldName) {
12156
        _thriftId = thriftId;
12157
        _fieldName = fieldName;
12158
      }
12159
 
12160
      public short getThriftFieldId() {
12161
        return _thriftId;
12162
      }
12163
 
12164
      public String getFieldName() {
12165
        return _fieldName;
12166
      }
12167
    }
12168
 
12169
    // isset id assignments
12170
 
12171
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12172
    static {
12173
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12174
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12175
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
12176
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
12177
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12178
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
12179
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12180
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCodes_result.class, metaDataMap);
12181
    }
12182
 
12183
    public getActiveCodes_result() {
12184
    }
12185
 
12186
    public getActiveCodes_result(
12187
      List<Coupon> success,
12188
      PromotionException pex)
12189
    {
12190
      this();
12191
      this.success = success;
12192
      this.pex = pex;
12193
    }
12194
 
12195
    /**
12196
     * Performs a deep copy on <i>other</i>.
12197
     */
12198
    public getActiveCodes_result(getActiveCodes_result other) {
12199
      if (other.isSetSuccess()) {
12200
        List<Coupon> __this__success = new ArrayList<Coupon>();
12201
        for (Coupon other_element : other.success) {
12202
          __this__success.add(new Coupon(other_element));
12203
        }
12204
        this.success = __this__success;
12205
      }
12206
      if (other.isSetPex()) {
12207
        this.pex = new PromotionException(other.pex);
12208
      }
12209
    }
12210
 
12211
    public getActiveCodes_result deepCopy() {
12212
      return new getActiveCodes_result(this);
12213
    }
12214
 
12215
    @Override
12216
    public void clear() {
12217
      this.success = null;
12218
      this.pex = null;
12219
    }
12220
 
12221
    public int getSuccessSize() {
12222
      return (this.success == null) ? 0 : this.success.size();
12223
    }
12224
 
12225
    public java.util.Iterator<Coupon> getSuccessIterator() {
12226
      return (this.success == null) ? null : this.success.iterator();
12227
    }
12228
 
12229
    public void addToSuccess(Coupon elem) {
12230
      if (this.success == null) {
12231
        this.success = new ArrayList<Coupon>();
12232
      }
12233
      this.success.add(elem);
12234
    }
12235
 
12236
    public List<Coupon> getSuccess() {
12237
      return this.success;
12238
    }
12239
 
12240
    public void setSuccess(List<Coupon> success) {
12241
      this.success = success;
12242
    }
12243
 
12244
    public void unsetSuccess() {
12245
      this.success = null;
12246
    }
12247
 
12248
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
12249
    public boolean isSetSuccess() {
12250
      return this.success != null;
12251
    }
12252
 
12253
    public void setSuccessIsSet(boolean value) {
12254
      if (!value) {
12255
        this.success = null;
12256
      }
12257
    }
12258
 
12259
    public PromotionException getPex() {
12260
      return this.pex;
12261
    }
12262
 
12263
    public void setPex(PromotionException pex) {
12264
      this.pex = pex;
12265
    }
12266
 
12267
    public void unsetPex() {
12268
      this.pex = null;
12269
    }
12270
 
12271
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
12272
    public boolean isSetPex() {
12273
      return this.pex != null;
12274
    }
12275
 
12276
    public void setPexIsSet(boolean value) {
12277
      if (!value) {
12278
        this.pex = null;
12279
      }
12280
    }
12281
 
12282
    public void setFieldValue(_Fields field, Object value) {
12283
      switch (field) {
12284
      case SUCCESS:
12285
        if (value == null) {
12286
          unsetSuccess();
12287
        } else {
12288
          setSuccess((List<Coupon>)value);
12289
        }
12290
        break;
12291
 
12292
      case PEX:
12293
        if (value == null) {
12294
          unsetPex();
12295
        } else {
12296
          setPex((PromotionException)value);
12297
        }
12298
        break;
12299
 
12300
      }
12301
    }
12302
 
12303
    public Object getFieldValue(_Fields field) {
12304
      switch (field) {
12305
      case SUCCESS:
12306
        return getSuccess();
12307
 
12308
      case PEX:
12309
        return getPex();
12310
 
12311
      }
12312
      throw new IllegalStateException();
12313
    }
12314
 
12315
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12316
    public boolean isSet(_Fields field) {
12317
      if (field == null) {
12318
        throw new IllegalArgumentException();
12319
      }
12320
 
12321
      switch (field) {
12322
      case SUCCESS:
12323
        return isSetSuccess();
12324
      case PEX:
12325
        return isSetPex();
12326
      }
12327
      throw new IllegalStateException();
12328
    }
12329
 
12330
    @Override
12331
    public boolean equals(Object that) {
12332
      if (that == null)
12333
        return false;
12334
      if (that instanceof getActiveCodes_result)
12335
        return this.equals((getActiveCodes_result)that);
12336
      return false;
12337
    }
12338
 
12339
    public boolean equals(getActiveCodes_result that) {
12340
      if (that == null)
12341
        return false;
12342
 
12343
      boolean this_present_success = true && this.isSetSuccess();
12344
      boolean that_present_success = true && that.isSetSuccess();
12345
      if (this_present_success || that_present_success) {
12346
        if (!(this_present_success && that_present_success))
12347
          return false;
12348
        if (!this.success.equals(that.success))
12349
          return false;
12350
      }
12351
 
12352
      boolean this_present_pex = true && this.isSetPex();
12353
      boolean that_present_pex = true && that.isSetPex();
12354
      if (this_present_pex || that_present_pex) {
12355
        if (!(this_present_pex && that_present_pex))
12356
          return false;
12357
        if (!this.pex.equals(that.pex))
12358
          return false;
12359
      }
12360
 
12361
      return true;
12362
    }
12363
 
12364
    @Override
12365
    public int hashCode() {
12366
      return 0;
12367
    }
12368
 
12369
    public int compareTo(getActiveCodes_result other) {
12370
      if (!getClass().equals(other.getClass())) {
12371
        return getClass().getName().compareTo(other.getClass().getName());
12372
      }
12373
 
12374
      int lastComparison = 0;
12375
      getActiveCodes_result typedOther = (getActiveCodes_result)other;
12376
 
12377
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
12378
      if (lastComparison != 0) {
12379
        return lastComparison;
12380
      }
12381
      if (isSetSuccess()) {
12382
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
12383
        if (lastComparison != 0) {
12384
          return lastComparison;
12385
        }
12386
      }
12387
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
12388
      if (lastComparison != 0) {
12389
        return lastComparison;
12390
      }
12391
      if (isSetPex()) {
12392
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
12393
        if (lastComparison != 0) {
12394
          return lastComparison;
12395
        }
12396
      }
12397
      return 0;
12398
    }
12399
 
12400
    public _Fields fieldForId(int fieldId) {
12401
      return _Fields.findByThriftId(fieldId);
12402
    }
12403
 
12404
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12405
      org.apache.thrift.protocol.TField field;
12406
      iprot.readStructBegin();
12407
      while (true)
12408
      {
12409
        field = iprot.readFieldBegin();
12410
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12411
          break;
12412
        }
12413
        switch (field.id) {
12414
          case 0: // SUCCESS
12415
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
12416
              {
11592 amit.gupta 12417
                org.apache.thrift.protocol.TList _list30 = iprot.readListBegin();
12418
                this.success = new ArrayList<Coupon>(_list30.size);
12419
                for (int _i31 = 0; _i31 < _list30.size; ++_i31)
6497 amit.gupta 12420
                {
11592 amit.gupta 12421
                  Coupon _elem32; // required
12422
                  _elem32 = new Coupon();
12423
                  _elem32.read(iprot);
12424
                  this.success.add(_elem32);
6497 amit.gupta 12425
                }
12426
                iprot.readListEnd();
12427
              }
12428
            } else { 
12429
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12430
            }
12431
            break;
12432
          case 1: // PEX
12433
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
12434
              this.pex = new PromotionException();
12435
              this.pex.read(iprot);
12436
            } else { 
12437
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12438
            }
12439
            break;
12440
          default:
12441
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12442
        }
12443
        iprot.readFieldEnd();
12444
      }
12445
      iprot.readStructEnd();
12446
      validate();
12447
    }
12448
 
12449
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12450
      oprot.writeStructBegin(STRUCT_DESC);
12451
 
12452
      if (this.isSetSuccess()) {
12453
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
12454
        {
12455
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
11592 amit.gupta 12456
          for (Coupon _iter33 : this.success)
6497 amit.gupta 12457
          {
11592 amit.gupta 12458
            _iter33.write(oprot);
6497 amit.gupta 12459
          }
12460
          oprot.writeListEnd();
12461
        }
12462
        oprot.writeFieldEnd();
12463
      } else if (this.isSetPex()) {
12464
        oprot.writeFieldBegin(PEX_FIELD_DESC);
12465
        this.pex.write(oprot);
12466
        oprot.writeFieldEnd();
12467
      }
12468
      oprot.writeFieldStop();
12469
      oprot.writeStructEnd();
12470
    }
12471
 
12472
    @Override
12473
    public String toString() {
12474
      StringBuilder sb = new StringBuilder("getActiveCodes_result(");
12475
      boolean first = true;
12476
 
12477
      sb.append("success:");
12478
      if (this.success == null) {
12479
        sb.append("null");
12480
      } else {
12481
        sb.append(this.success);
12482
      }
12483
      first = false;
12484
      if (!first) sb.append(", ");
12485
      sb.append("pex:");
12486
      if (this.pex == null) {
12487
        sb.append("null");
12488
      } else {
12489
        sb.append(this.pex);
12490
      }
12491
      first = false;
12492
      sb.append(")");
12493
      return sb.toString();
12494
    }
12495
 
12496
    public void validate() throws org.apache.thrift.TException {
12497
      // check for required fields
12498
    }
12499
 
12500
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12501
      try {
12502
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12503
      } catch (org.apache.thrift.TException te) {
12504
        throw new java.io.IOException(te);
12505
      }
12506
    }
12507
 
12508
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12509
      try {
12510
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12511
      } catch (org.apache.thrift.TException te) {
12512
        throw new java.io.IOException(te);
12513
      }
12514
    }
12515
 
12516
  }
12517
 
12518
  public static class deleteCoupon_args implements org.apache.thrift.TBase<deleteCoupon_args, deleteCoupon_args._Fields>, java.io.Serializable, Cloneable   {
12519
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteCoupon_args");
12520
 
12521
    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);
12522
 
12523
    private String couponCode; // required
12524
 
12525
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12526
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12527
      COUPON_CODE((short)1, "couponCode");
12528
 
12529
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12530
 
12531
      static {
12532
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12533
          byName.put(field.getFieldName(), field);
12534
        }
12535
      }
12536
 
12537
      /**
12538
       * Find the _Fields constant that matches fieldId, or null if its not found.
12539
       */
12540
      public static _Fields findByThriftId(int fieldId) {
12541
        switch(fieldId) {
12542
          case 1: // COUPON_CODE
12543
            return COUPON_CODE;
12544
          default:
12545
            return null;
12546
        }
12547
      }
12548
 
12549
      /**
12550
       * Find the _Fields constant that matches fieldId, throwing an exception
12551
       * if it is not found.
12552
       */
12553
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12554
        _Fields fields = findByThriftId(fieldId);
12555
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12556
        return fields;
12557
      }
12558
 
12559
      /**
12560
       * Find the _Fields constant that matches name, or null if its not found.
12561
       */
12562
      public static _Fields findByName(String name) {
12563
        return byName.get(name);
12564
      }
12565
 
12566
      private final short _thriftId;
12567
      private final String _fieldName;
12568
 
12569
      _Fields(short thriftId, String fieldName) {
12570
        _thriftId = thriftId;
12571
        _fieldName = fieldName;
12572
      }
12573
 
12574
      public short getThriftFieldId() {
12575
        return _thriftId;
12576
      }
12577
 
12578
      public String getFieldName() {
12579
        return _fieldName;
12580
      }
12581
    }
12582
 
12583
    // isset id assignments
12584
 
12585
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12586
    static {
12587
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12588
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12589
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
12590
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12591
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteCoupon_args.class, metaDataMap);
12592
    }
12593
 
12594
    public deleteCoupon_args() {
12595
    }
12596
 
12597
    public deleteCoupon_args(
12598
      String couponCode)
12599
    {
12600
      this();
12601
      this.couponCode = couponCode;
12602
    }
12603
 
12604
    /**
12605
     * Performs a deep copy on <i>other</i>.
12606
     */
12607
    public deleteCoupon_args(deleteCoupon_args other) {
12608
      if (other.isSetCouponCode()) {
12609
        this.couponCode = other.couponCode;
12610
      }
12611
    }
12612
 
12613
    public deleteCoupon_args deepCopy() {
12614
      return new deleteCoupon_args(this);
12615
    }
12616
 
12617
    @Override
12618
    public void clear() {
12619
      this.couponCode = null;
12620
    }
12621
 
12622
    public String getCouponCode() {
12623
      return this.couponCode;
12624
    }
12625
 
12626
    public void setCouponCode(String couponCode) {
12627
      this.couponCode = couponCode;
12628
    }
12629
 
12630
    public void unsetCouponCode() {
12631
      this.couponCode = null;
12632
    }
12633
 
12634
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
12635
    public boolean isSetCouponCode() {
12636
      return this.couponCode != null;
12637
    }
12638
 
12639
    public void setCouponCodeIsSet(boolean value) {
12640
      if (!value) {
12641
        this.couponCode = null;
12642
      }
12643
    }
12644
 
12645
    public void setFieldValue(_Fields field, Object value) {
12646
      switch (field) {
12647
      case COUPON_CODE:
12648
        if (value == null) {
12649
          unsetCouponCode();
12650
        } else {
12651
          setCouponCode((String)value);
12652
        }
12653
        break;
12654
 
12655
      }
12656
    }
12657
 
12658
    public Object getFieldValue(_Fields field) {
12659
      switch (field) {
12660
      case COUPON_CODE:
12661
        return getCouponCode();
12662
 
12663
      }
12664
      throw new IllegalStateException();
12665
    }
12666
 
12667
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12668
    public boolean isSet(_Fields field) {
12669
      if (field == null) {
12670
        throw new IllegalArgumentException();
12671
      }
12672
 
12673
      switch (field) {
12674
      case COUPON_CODE:
12675
        return isSetCouponCode();
12676
      }
12677
      throw new IllegalStateException();
12678
    }
12679
 
12680
    @Override
12681
    public boolean equals(Object that) {
12682
      if (that == null)
12683
        return false;
12684
      if (that instanceof deleteCoupon_args)
12685
        return this.equals((deleteCoupon_args)that);
12686
      return false;
12687
    }
12688
 
12689
    public boolean equals(deleteCoupon_args that) {
12690
      if (that == null)
12691
        return false;
12692
 
12693
      boolean this_present_couponCode = true && this.isSetCouponCode();
12694
      boolean that_present_couponCode = true && that.isSetCouponCode();
12695
      if (this_present_couponCode || that_present_couponCode) {
12696
        if (!(this_present_couponCode && that_present_couponCode))
12697
          return false;
12698
        if (!this.couponCode.equals(that.couponCode))
12699
          return false;
12700
      }
12701
 
12702
      return true;
12703
    }
12704
 
12705
    @Override
12706
    public int hashCode() {
12707
      return 0;
12708
    }
12709
 
12710
    public int compareTo(deleteCoupon_args other) {
12711
      if (!getClass().equals(other.getClass())) {
12712
        return getClass().getName().compareTo(other.getClass().getName());
12713
      }
12714
 
12715
      int lastComparison = 0;
12716
      deleteCoupon_args typedOther = (deleteCoupon_args)other;
12717
 
12718
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
12719
      if (lastComparison != 0) {
12720
        return lastComparison;
12721
      }
12722
      if (isSetCouponCode()) {
12723
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
12724
        if (lastComparison != 0) {
12725
          return lastComparison;
12726
        }
12727
      }
12728
      return 0;
12729
    }
12730
 
12731
    public _Fields fieldForId(int fieldId) {
12732
      return _Fields.findByThriftId(fieldId);
12733
    }
12734
 
12735
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12736
      org.apache.thrift.protocol.TField field;
12737
      iprot.readStructBegin();
12738
      while (true)
12739
      {
12740
        field = iprot.readFieldBegin();
12741
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12742
          break;
12743
        }
12744
        switch (field.id) {
12745
          case 1: // COUPON_CODE
12746
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
12747
              this.couponCode = iprot.readString();
12748
            } else { 
12749
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12750
            }
12751
            break;
12752
          default:
12753
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12754
        }
12755
        iprot.readFieldEnd();
12756
      }
12757
      iprot.readStructEnd();
12758
      validate();
12759
    }
12760
 
12761
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12762
      validate();
12763
 
12764
      oprot.writeStructBegin(STRUCT_DESC);
12765
      if (this.couponCode != null) {
12766
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
12767
        oprot.writeString(this.couponCode);
12768
        oprot.writeFieldEnd();
12769
      }
12770
      oprot.writeFieldStop();
12771
      oprot.writeStructEnd();
12772
    }
12773
 
12774
    @Override
12775
    public String toString() {
12776
      StringBuilder sb = new StringBuilder("deleteCoupon_args(");
12777
      boolean first = true;
12778
 
12779
      sb.append("couponCode:");
12780
      if (this.couponCode == null) {
12781
        sb.append("null");
12782
      } else {
12783
        sb.append(this.couponCode);
12784
      }
12785
      first = false;
12786
      sb.append(")");
12787
      return sb.toString();
12788
    }
12789
 
12790
    public void validate() throws org.apache.thrift.TException {
12791
      // check for required fields
12792
    }
12793
 
12794
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12795
      try {
12796
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12797
      } catch (org.apache.thrift.TException te) {
12798
        throw new java.io.IOException(te);
12799
      }
12800
    }
12801
 
12802
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12803
      try {
12804
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12805
      } catch (org.apache.thrift.TException te) {
12806
        throw new java.io.IOException(te);
12807
      }
12808
    }
12809
 
12810
  }
12811
 
12812
  public static class deleteCoupon_result implements org.apache.thrift.TBase<deleteCoupon_result, deleteCoupon_result._Fields>, java.io.Serializable, Cloneable   {
12813
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteCoupon_result");
12814
 
12815
    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);
12816
 
12817
    private PromotionException pex; // required
12818
 
12819
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12820
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12821
      PEX((short)1, "pex");
12822
 
12823
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12824
 
12825
      static {
12826
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12827
          byName.put(field.getFieldName(), field);
12828
        }
12829
      }
12830
 
12831
      /**
12832
       * Find the _Fields constant that matches fieldId, or null if its not found.
12833
       */
12834
      public static _Fields findByThriftId(int fieldId) {
12835
        switch(fieldId) {
12836
          case 1: // PEX
12837
            return PEX;
12838
          default:
12839
            return null;
12840
        }
12841
      }
12842
 
12843
      /**
12844
       * Find the _Fields constant that matches fieldId, throwing an exception
12845
       * if it is not found.
12846
       */
12847
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12848
        _Fields fields = findByThriftId(fieldId);
12849
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12850
        return fields;
12851
      }
12852
 
12853
      /**
12854
       * Find the _Fields constant that matches name, or null if its not found.
12855
       */
12856
      public static _Fields findByName(String name) {
12857
        return byName.get(name);
12858
      }
12859
 
12860
      private final short _thriftId;
12861
      private final String _fieldName;
12862
 
12863
      _Fields(short thriftId, String fieldName) {
12864
        _thriftId = thriftId;
12865
        _fieldName = fieldName;
12866
      }
12867
 
12868
      public short getThriftFieldId() {
12869
        return _thriftId;
12870
      }
12871
 
12872
      public String getFieldName() {
12873
        return _fieldName;
12874
      }
12875
    }
12876
 
12877
    // isset id assignments
12878
 
12879
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12880
    static {
12881
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12882
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12883
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
12884
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12885
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteCoupon_result.class, metaDataMap);
12886
    }
12887
 
12888
    public deleteCoupon_result() {
12889
    }
12890
 
12891
    public deleteCoupon_result(
12892
      PromotionException pex)
12893
    {
12894
      this();
12895
      this.pex = pex;
12896
    }
12897
 
12898
    /**
12899
     * Performs a deep copy on <i>other</i>.
12900
     */
12901
    public deleteCoupon_result(deleteCoupon_result other) {
12902
      if (other.isSetPex()) {
12903
        this.pex = new PromotionException(other.pex);
12904
      }
12905
    }
12906
 
12907
    public deleteCoupon_result deepCopy() {
12908
      return new deleteCoupon_result(this);
12909
    }
12910
 
12911
    @Override
12912
    public void clear() {
12913
      this.pex = null;
12914
    }
12915
 
12916
    public PromotionException getPex() {
12917
      return this.pex;
12918
    }
12919
 
12920
    public void setPex(PromotionException pex) {
12921
      this.pex = pex;
12922
    }
12923
 
12924
    public void unsetPex() {
12925
      this.pex = null;
12926
    }
12927
 
12928
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
12929
    public boolean isSetPex() {
12930
      return this.pex != null;
12931
    }
12932
 
12933
    public void setPexIsSet(boolean value) {
12934
      if (!value) {
12935
        this.pex = null;
12936
      }
12937
    }
12938
 
12939
    public void setFieldValue(_Fields field, Object value) {
12940
      switch (field) {
12941
      case PEX:
12942
        if (value == null) {
12943
          unsetPex();
12944
        } else {
12945
          setPex((PromotionException)value);
12946
        }
12947
        break;
12948
 
12949
      }
12950
    }
12951
 
12952
    public Object getFieldValue(_Fields field) {
12953
      switch (field) {
12954
      case PEX:
12955
        return getPex();
12956
 
12957
      }
12958
      throw new IllegalStateException();
12959
    }
12960
 
12961
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12962
    public boolean isSet(_Fields field) {
12963
      if (field == null) {
12964
        throw new IllegalArgumentException();
12965
      }
12966
 
12967
      switch (field) {
12968
      case PEX:
12969
        return isSetPex();
12970
      }
12971
      throw new IllegalStateException();
12972
    }
12973
 
12974
    @Override
12975
    public boolean equals(Object that) {
12976
      if (that == null)
12977
        return false;
12978
      if (that instanceof deleteCoupon_result)
12979
        return this.equals((deleteCoupon_result)that);
12980
      return false;
12981
    }
12982
 
12983
    public boolean equals(deleteCoupon_result that) {
12984
      if (that == null)
12985
        return false;
12986
 
12987
      boolean this_present_pex = true && this.isSetPex();
12988
      boolean that_present_pex = true && that.isSetPex();
12989
      if (this_present_pex || that_present_pex) {
12990
        if (!(this_present_pex && that_present_pex))
12991
          return false;
12992
        if (!this.pex.equals(that.pex))
12993
          return false;
12994
      }
12995
 
12996
      return true;
12997
    }
12998
 
12999
    @Override
13000
    public int hashCode() {
13001
      return 0;
13002
    }
13003
 
13004
    public int compareTo(deleteCoupon_result other) {
13005
      if (!getClass().equals(other.getClass())) {
13006
        return getClass().getName().compareTo(other.getClass().getName());
13007
      }
13008
 
13009
      int lastComparison = 0;
13010
      deleteCoupon_result typedOther = (deleteCoupon_result)other;
13011
 
13012
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
13013
      if (lastComparison != 0) {
13014
        return lastComparison;
13015
      }
13016
      if (isSetPex()) {
13017
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
13018
        if (lastComparison != 0) {
13019
          return lastComparison;
13020
        }
13021
      }
13022
      return 0;
13023
    }
13024
 
13025
    public _Fields fieldForId(int fieldId) {
13026
      return _Fields.findByThriftId(fieldId);
13027
    }
13028
 
13029
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13030
      org.apache.thrift.protocol.TField field;
13031
      iprot.readStructBegin();
13032
      while (true)
13033
      {
13034
        field = iprot.readFieldBegin();
13035
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
13036
          break;
13037
        }
13038
        switch (field.id) {
13039
          case 1: // PEX
13040
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
13041
              this.pex = new PromotionException();
13042
              this.pex.read(iprot);
13043
            } else { 
13044
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13045
            }
13046
            break;
13047
          default:
13048
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13049
        }
13050
        iprot.readFieldEnd();
13051
      }
13052
      iprot.readStructEnd();
13053
      validate();
13054
    }
13055
 
13056
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
13057
      oprot.writeStructBegin(STRUCT_DESC);
13058
 
13059
      if (this.isSetPex()) {
13060
        oprot.writeFieldBegin(PEX_FIELD_DESC);
13061
        this.pex.write(oprot);
13062
        oprot.writeFieldEnd();
13063
      }
13064
      oprot.writeFieldStop();
13065
      oprot.writeStructEnd();
13066
    }
13067
 
13068
    @Override
13069
    public String toString() {
13070
      StringBuilder sb = new StringBuilder("deleteCoupon_result(");
13071
      boolean first = true;
13072
 
13073
      sb.append("pex:");
13074
      if (this.pex == null) {
13075
        sb.append("null");
13076
      } else {
13077
        sb.append(this.pex);
13078
      }
13079
      first = false;
13080
      sb.append(")");
13081
      return sb.toString();
13082
    }
13083
 
13084
    public void validate() throws org.apache.thrift.TException {
13085
      // check for required fields
13086
    }
13087
 
13088
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13089
      try {
13090
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13091
      } catch (org.apache.thrift.TException te) {
13092
        throw new java.io.IOException(te);
13093
      }
13094
    }
13095
 
13096
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13097
      try {
13098
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13099
      } catch (org.apache.thrift.TException te) {
13100
        throw new java.io.IOException(te);
13101
      }
13102
    }
13103
 
13104
  }
13105
 
7092 amit.gupta 13106
  public static class getAllCouponsByPromotionId_args implements org.apache.thrift.TBase<getAllCouponsByPromotionId_args, getAllCouponsByPromotionId_args._Fields>, java.io.Serializable, Cloneable   {
13107
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllCouponsByPromotionId_args");
13108
 
13109
    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);
13110
 
13111
    private long promotionId; // required
13112
 
13113
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
13114
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
13115
      PROMOTION_ID((short)1, "promotionId");
13116
 
13117
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13118
 
13119
      static {
13120
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13121
          byName.put(field.getFieldName(), field);
13122
        }
13123
      }
13124
 
13125
      /**
13126
       * Find the _Fields constant that matches fieldId, or null if its not found.
13127
       */
13128
      public static _Fields findByThriftId(int fieldId) {
13129
        switch(fieldId) {
13130
          case 1: // PROMOTION_ID
13131
            return PROMOTION_ID;
13132
          default:
13133
            return null;
13134
        }
13135
      }
13136
 
13137
      /**
13138
       * Find the _Fields constant that matches fieldId, throwing an exception
13139
       * if it is not found.
13140
       */
13141
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13142
        _Fields fields = findByThriftId(fieldId);
13143
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13144
        return fields;
13145
      }
13146
 
13147
      /**
13148
       * Find the _Fields constant that matches name, or null if its not found.
13149
       */
13150
      public static _Fields findByName(String name) {
13151
        return byName.get(name);
13152
      }
13153
 
13154
      private final short _thriftId;
13155
      private final String _fieldName;
13156
 
13157
      _Fields(short thriftId, String fieldName) {
13158
        _thriftId = thriftId;
13159
        _fieldName = fieldName;
13160
      }
13161
 
13162
      public short getThriftFieldId() {
13163
        return _thriftId;
13164
      }
13165
 
13166
      public String getFieldName() {
13167
        return _fieldName;
13168
      }
13169
    }
13170
 
13171
    // isset id assignments
13172
    private static final int __PROMOTIONID_ISSET_ID = 0;
13173
    private BitSet __isset_bit_vector = new BitSet(1);
13174
 
13175
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
13176
    static {
13177
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13178
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13179
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
13180
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13181
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllCouponsByPromotionId_args.class, metaDataMap);
13182
    }
13183
 
13184
    public getAllCouponsByPromotionId_args() {
13185
    }
13186
 
13187
    public getAllCouponsByPromotionId_args(
13188
      long promotionId)
13189
    {
13190
      this();
13191
      this.promotionId = promotionId;
13192
      setPromotionIdIsSet(true);
13193
    }
13194
 
13195
    /**
13196
     * Performs a deep copy on <i>other</i>.
13197
     */
13198
    public getAllCouponsByPromotionId_args(getAllCouponsByPromotionId_args other) {
13199
      __isset_bit_vector.clear();
13200
      __isset_bit_vector.or(other.__isset_bit_vector);
13201
      this.promotionId = other.promotionId;
13202
    }
13203
 
13204
    public getAllCouponsByPromotionId_args deepCopy() {
13205
      return new getAllCouponsByPromotionId_args(this);
13206
    }
13207
 
13208
    @Override
13209
    public void clear() {
13210
      setPromotionIdIsSet(false);
13211
      this.promotionId = 0;
13212
    }
13213
 
13214
    public long getPromotionId() {
13215
      return this.promotionId;
13216
    }
13217
 
13218
    public void setPromotionId(long promotionId) {
13219
      this.promotionId = promotionId;
13220
      setPromotionIdIsSet(true);
13221
    }
13222
 
13223
    public void unsetPromotionId() {
13224
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
13225
    }
13226
 
13227
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
13228
    public boolean isSetPromotionId() {
13229
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
13230
    }
13231
 
13232
    public void setPromotionIdIsSet(boolean value) {
13233
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
13234
    }
13235
 
13236
    public void setFieldValue(_Fields field, Object value) {
13237
      switch (field) {
13238
      case PROMOTION_ID:
13239
        if (value == null) {
13240
          unsetPromotionId();
13241
        } else {
13242
          setPromotionId((Long)value);
13243
        }
13244
        break;
13245
 
13246
      }
13247
    }
13248
 
13249
    public Object getFieldValue(_Fields field) {
13250
      switch (field) {
13251
      case PROMOTION_ID:
13252
        return Long.valueOf(getPromotionId());
13253
 
13254
      }
13255
      throw new IllegalStateException();
13256
    }
13257
 
13258
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13259
    public boolean isSet(_Fields field) {
13260
      if (field == null) {
13261
        throw new IllegalArgumentException();
13262
      }
13263
 
13264
      switch (field) {
13265
      case PROMOTION_ID:
13266
        return isSetPromotionId();
13267
      }
13268
      throw new IllegalStateException();
13269
    }
13270
 
13271
    @Override
13272
    public boolean equals(Object that) {
13273
      if (that == null)
13274
        return false;
13275
      if (that instanceof getAllCouponsByPromotionId_args)
13276
        return this.equals((getAllCouponsByPromotionId_args)that);
13277
      return false;
13278
    }
13279
 
13280
    public boolean equals(getAllCouponsByPromotionId_args that) {
13281
      if (that == null)
13282
        return false;
13283
 
13284
      boolean this_present_promotionId = true;
13285
      boolean that_present_promotionId = true;
13286
      if (this_present_promotionId || that_present_promotionId) {
13287
        if (!(this_present_promotionId && that_present_promotionId))
13288
          return false;
13289
        if (this.promotionId != that.promotionId)
13290
          return false;
13291
      }
13292
 
13293
      return true;
13294
    }
13295
 
13296
    @Override
13297
    public int hashCode() {
13298
      return 0;
13299
    }
13300
 
13301
    public int compareTo(getAllCouponsByPromotionId_args other) {
13302
      if (!getClass().equals(other.getClass())) {
13303
        return getClass().getName().compareTo(other.getClass().getName());
13304
      }
13305
 
13306
      int lastComparison = 0;
13307
      getAllCouponsByPromotionId_args typedOther = (getAllCouponsByPromotionId_args)other;
13308
 
13309
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
13310
      if (lastComparison != 0) {
13311
        return lastComparison;
13312
      }
13313
      if (isSetPromotionId()) {
13314
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
13315
        if (lastComparison != 0) {
13316
          return lastComparison;
13317
        }
13318
      }
13319
      return 0;
13320
    }
13321
 
13322
    public _Fields fieldForId(int fieldId) {
13323
      return _Fields.findByThriftId(fieldId);
13324
    }
13325
 
13326
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13327
      org.apache.thrift.protocol.TField field;
13328
      iprot.readStructBegin();
13329
      while (true)
13330
      {
13331
        field = iprot.readFieldBegin();
13332
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
13333
          break;
13334
        }
13335
        switch (field.id) {
13336
          case 1: // PROMOTION_ID
13337
            if (field.type == org.apache.thrift.protocol.TType.I64) {
13338
              this.promotionId = iprot.readI64();
13339
              setPromotionIdIsSet(true);
13340
            } else { 
13341
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13342
            }
13343
            break;
13344
          default:
13345
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13346
        }
13347
        iprot.readFieldEnd();
13348
      }
13349
      iprot.readStructEnd();
13350
      validate();
13351
    }
13352
 
13353
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
13354
      validate();
13355
 
13356
      oprot.writeStructBegin(STRUCT_DESC);
13357
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
13358
      oprot.writeI64(this.promotionId);
13359
      oprot.writeFieldEnd();
13360
      oprot.writeFieldStop();
13361
      oprot.writeStructEnd();
13362
    }
13363
 
13364
    @Override
13365
    public String toString() {
13366
      StringBuilder sb = new StringBuilder("getAllCouponsByPromotionId_args(");
13367
      boolean first = true;
13368
 
13369
      sb.append("promotionId:");
13370
      sb.append(this.promotionId);
13371
      first = false;
13372
      sb.append(")");
13373
      return sb.toString();
13374
    }
13375
 
13376
    public void validate() throws org.apache.thrift.TException {
13377
      // check for required fields
13378
    }
13379
 
13380
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13381
      try {
13382
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13383
      } catch (org.apache.thrift.TException te) {
13384
        throw new java.io.IOException(te);
13385
      }
13386
    }
13387
 
13388
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13389
      try {
13390
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
13391
        __isset_bit_vector = new BitSet(1);
13392
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13393
      } catch (org.apache.thrift.TException te) {
13394
        throw new java.io.IOException(te);
13395
      }
13396
    }
13397
 
13398
  }
13399
 
13400
  public static class getAllCouponsByPromotionId_result implements org.apache.thrift.TBase<getAllCouponsByPromotionId_result, getAllCouponsByPromotionId_result._Fields>, java.io.Serializable, Cloneable   {
13401
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllCouponsByPromotionId_result");
13402
 
13403
    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);
13404
    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);
13405
 
13406
    private List<Coupon> success; // required
13407
    private PromotionException pex; // required
13408
 
13409
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
13410
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
13411
      SUCCESS((short)0, "success"),
13412
      PEX((short)1, "pex");
13413
 
13414
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13415
 
13416
      static {
13417
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13418
          byName.put(field.getFieldName(), field);
13419
        }
13420
      }
13421
 
13422
      /**
13423
       * Find the _Fields constant that matches fieldId, or null if its not found.
13424
       */
13425
      public static _Fields findByThriftId(int fieldId) {
13426
        switch(fieldId) {
13427
          case 0: // SUCCESS
13428
            return SUCCESS;
13429
          case 1: // PEX
13430
            return PEX;
13431
          default:
13432
            return null;
13433
        }
13434
      }
13435
 
13436
      /**
13437
       * Find the _Fields constant that matches fieldId, throwing an exception
13438
       * if it is not found.
13439
       */
13440
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13441
        _Fields fields = findByThriftId(fieldId);
13442
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13443
        return fields;
13444
      }
13445
 
13446
      /**
13447
       * Find the _Fields constant that matches name, or null if its not found.
13448
       */
13449
      public static _Fields findByName(String name) {
13450
        return byName.get(name);
13451
      }
13452
 
13453
      private final short _thriftId;
13454
      private final String _fieldName;
13455
 
13456
      _Fields(short thriftId, String fieldName) {
13457
        _thriftId = thriftId;
13458
        _fieldName = fieldName;
13459
      }
13460
 
13461
      public short getThriftFieldId() {
13462
        return _thriftId;
13463
      }
13464
 
13465
      public String getFieldName() {
13466
        return _fieldName;
13467
      }
13468
    }
13469
 
13470
    // isset id assignments
13471
 
13472
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
13473
    static {
13474
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13475
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13476
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
13477
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
13478
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13479
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
13480
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13481
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllCouponsByPromotionId_result.class, metaDataMap);
13482
    }
13483
 
13484
    public getAllCouponsByPromotionId_result() {
13485
    }
13486
 
13487
    public getAllCouponsByPromotionId_result(
13488
      List<Coupon> success,
13489
      PromotionException pex)
13490
    {
13491
      this();
13492
      this.success = success;
13493
      this.pex = pex;
13494
    }
13495
 
13496
    /**
13497
     * Performs a deep copy on <i>other</i>.
13498
     */
13499
    public getAllCouponsByPromotionId_result(getAllCouponsByPromotionId_result other) {
13500
      if (other.isSetSuccess()) {
13501
        List<Coupon> __this__success = new ArrayList<Coupon>();
13502
        for (Coupon other_element : other.success) {
13503
          __this__success.add(new Coupon(other_element));
13504
        }
13505
        this.success = __this__success;
13506
      }
13507
      if (other.isSetPex()) {
13508
        this.pex = new PromotionException(other.pex);
13509
      }
13510
    }
13511
 
13512
    public getAllCouponsByPromotionId_result deepCopy() {
13513
      return new getAllCouponsByPromotionId_result(this);
13514
    }
13515
 
13516
    @Override
13517
    public void clear() {
13518
      this.success = null;
13519
      this.pex = null;
13520
    }
13521
 
13522
    public int getSuccessSize() {
13523
      return (this.success == null) ? 0 : this.success.size();
13524
    }
13525
 
13526
    public java.util.Iterator<Coupon> getSuccessIterator() {
13527
      return (this.success == null) ? null : this.success.iterator();
13528
    }
13529
 
13530
    public void addToSuccess(Coupon elem) {
13531
      if (this.success == null) {
13532
        this.success = new ArrayList<Coupon>();
13533
      }
13534
      this.success.add(elem);
13535
    }
13536
 
13537
    public List<Coupon> getSuccess() {
13538
      return this.success;
13539
    }
13540
 
13541
    public void setSuccess(List<Coupon> success) {
13542
      this.success = success;
13543
    }
13544
 
13545
    public void unsetSuccess() {
13546
      this.success = null;
13547
    }
13548
 
13549
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
13550
    public boolean isSetSuccess() {
13551
      return this.success != null;
13552
    }
13553
 
13554
    public void setSuccessIsSet(boolean value) {
13555
      if (!value) {
13556
        this.success = null;
13557
      }
13558
    }
13559
 
13560
    public PromotionException getPex() {
13561
      return this.pex;
13562
    }
13563
 
13564
    public void setPex(PromotionException pex) {
13565
      this.pex = pex;
13566
    }
13567
 
13568
    public void unsetPex() {
13569
      this.pex = null;
13570
    }
13571
 
13572
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
13573
    public boolean isSetPex() {
13574
      return this.pex != null;
13575
    }
13576
 
13577
    public void setPexIsSet(boolean value) {
13578
      if (!value) {
13579
        this.pex = null;
13580
      }
13581
    }
13582
 
13583
    public void setFieldValue(_Fields field, Object value) {
13584
      switch (field) {
13585
      case SUCCESS:
13586
        if (value == null) {
13587
          unsetSuccess();
13588
        } else {
13589
          setSuccess((List<Coupon>)value);
13590
        }
13591
        break;
13592
 
13593
      case PEX:
13594
        if (value == null) {
13595
          unsetPex();
13596
        } else {
13597
          setPex((PromotionException)value);
13598
        }
13599
        break;
13600
 
13601
      }
13602
    }
13603
 
13604
    public Object getFieldValue(_Fields field) {
13605
      switch (field) {
13606
      case SUCCESS:
13607
        return getSuccess();
13608
 
13609
      case PEX:
13610
        return getPex();
13611
 
13612
      }
13613
      throw new IllegalStateException();
13614
    }
13615
 
13616
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13617
    public boolean isSet(_Fields field) {
13618
      if (field == null) {
13619
        throw new IllegalArgumentException();
13620
      }
13621
 
13622
      switch (field) {
13623
      case SUCCESS:
13624
        return isSetSuccess();
13625
      case PEX:
13626
        return isSetPex();
13627
      }
13628
      throw new IllegalStateException();
13629
    }
13630
 
13631
    @Override
13632
    public boolean equals(Object that) {
13633
      if (that == null)
13634
        return false;
13635
      if (that instanceof getAllCouponsByPromotionId_result)
13636
        return this.equals((getAllCouponsByPromotionId_result)that);
13637
      return false;
13638
    }
13639
 
13640
    public boolean equals(getAllCouponsByPromotionId_result that) {
13641
      if (that == null)
13642
        return false;
13643
 
13644
      boolean this_present_success = true && this.isSetSuccess();
13645
      boolean that_present_success = true && that.isSetSuccess();
13646
      if (this_present_success || that_present_success) {
13647
        if (!(this_present_success && that_present_success))
13648
          return false;
13649
        if (!this.success.equals(that.success))
13650
          return false;
13651
      }
13652
 
13653
      boolean this_present_pex = true && this.isSetPex();
13654
      boolean that_present_pex = true && that.isSetPex();
13655
      if (this_present_pex || that_present_pex) {
13656
        if (!(this_present_pex && that_present_pex))
13657
          return false;
13658
        if (!this.pex.equals(that.pex))
13659
          return false;
13660
      }
13661
 
13662
      return true;
13663
    }
13664
 
13665
    @Override
13666
    public int hashCode() {
13667
      return 0;
13668
    }
13669
 
13670
    public int compareTo(getAllCouponsByPromotionId_result other) {
13671
      if (!getClass().equals(other.getClass())) {
13672
        return getClass().getName().compareTo(other.getClass().getName());
13673
      }
13674
 
13675
      int lastComparison = 0;
13676
      getAllCouponsByPromotionId_result typedOther = (getAllCouponsByPromotionId_result)other;
13677
 
13678
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
13679
      if (lastComparison != 0) {
13680
        return lastComparison;
13681
      }
13682
      if (isSetSuccess()) {
13683
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
13684
        if (lastComparison != 0) {
13685
          return lastComparison;
13686
        }
13687
      }
13688
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
13689
      if (lastComparison != 0) {
13690
        return lastComparison;
13691
      }
13692
      if (isSetPex()) {
13693
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
13694
        if (lastComparison != 0) {
13695
          return lastComparison;
13696
        }
13697
      }
13698
      return 0;
13699
    }
13700
 
13701
    public _Fields fieldForId(int fieldId) {
13702
      return _Fields.findByThriftId(fieldId);
13703
    }
13704
 
13705
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13706
      org.apache.thrift.protocol.TField field;
13707
      iprot.readStructBegin();
13708
      while (true)
13709
      {
13710
        field = iprot.readFieldBegin();
13711
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
13712
          break;
13713
        }
13714
        switch (field.id) {
13715
          case 0: // SUCCESS
13716
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
13717
              {
11592 amit.gupta 13718
                org.apache.thrift.protocol.TList _list34 = iprot.readListBegin();
13719
                this.success = new ArrayList<Coupon>(_list34.size);
13720
                for (int _i35 = 0; _i35 < _list34.size; ++_i35)
7092 amit.gupta 13721
                {
11592 amit.gupta 13722
                  Coupon _elem36; // required
13723
                  _elem36 = new Coupon();
13724
                  _elem36.read(iprot);
13725
                  this.success.add(_elem36);
7092 amit.gupta 13726
                }
13727
                iprot.readListEnd();
13728
              }
13729
            } else { 
13730
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13731
            }
13732
            break;
13733
          case 1: // PEX
13734
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
13735
              this.pex = new PromotionException();
13736
              this.pex.read(iprot);
13737
            } else { 
13738
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13739
            }
13740
            break;
13741
          default:
13742
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13743
        }
13744
        iprot.readFieldEnd();
13745
      }
13746
      iprot.readStructEnd();
13747
      validate();
13748
    }
13749
 
13750
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
13751
      oprot.writeStructBegin(STRUCT_DESC);
13752
 
13753
      if (this.isSetSuccess()) {
13754
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
13755
        {
13756
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
11592 amit.gupta 13757
          for (Coupon _iter37 : this.success)
7092 amit.gupta 13758
          {
11592 amit.gupta 13759
            _iter37.write(oprot);
7092 amit.gupta 13760
          }
13761
          oprot.writeListEnd();
13762
        }
13763
        oprot.writeFieldEnd();
13764
      } else if (this.isSetPex()) {
13765
        oprot.writeFieldBegin(PEX_FIELD_DESC);
13766
        this.pex.write(oprot);
13767
        oprot.writeFieldEnd();
13768
      }
13769
      oprot.writeFieldStop();
13770
      oprot.writeStructEnd();
13771
    }
13772
 
13773
    @Override
13774
    public String toString() {
13775
      StringBuilder sb = new StringBuilder("getAllCouponsByPromotionId_result(");
13776
      boolean first = true;
13777
 
13778
      sb.append("success:");
13779
      if (this.success == null) {
13780
        sb.append("null");
13781
      } else {
13782
        sb.append(this.success);
13783
      }
13784
      first = false;
13785
      if (!first) sb.append(", ");
13786
      sb.append("pex:");
13787
      if (this.pex == null) {
13788
        sb.append("null");
13789
      } else {
13790
        sb.append(this.pex);
13791
      }
13792
      first = false;
13793
      sb.append(")");
13794
      return sb.toString();
13795
    }
13796
 
13797
    public void validate() throws org.apache.thrift.TException {
13798
      // check for required fields
13799
    }
13800
 
13801
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13802
      try {
13803
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13804
      } catch (org.apache.thrift.TException te) {
13805
        throw new java.io.IOException(te);
13806
      }
13807
    }
13808
 
13809
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13810
      try {
13811
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13812
      } catch (org.apache.thrift.TException te) {
13813
        throw new java.io.IOException(te);
13814
      }
13815
    }
13816
 
13817
  }
13818
 
3430 rajveer 13819
  public static class getActiveCoupons_args implements org.apache.thrift.TBase<getActiveCoupons_args, getActiveCoupons_args._Fields>, java.io.Serializable, Cloneable   {
13820
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_args");
3385 varun.gupt 13821
 
13822
 
13823
 
13824
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 13825
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 13826
;
13827
 
13828
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13829
 
13830
      static {
13831
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13832
          byName.put(field.getFieldName(), field);
13833
        }
13834
      }
13835
 
13836
      /**
13837
       * Find the _Fields constant that matches fieldId, or null if its not found.
13838
       */
13839
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 13840
        switch(fieldId) {
13841
          default:
13842
            return null;
13843
        }
3385 varun.gupt 13844
      }
13845
 
13846
      /**
13847
       * Find the _Fields constant that matches fieldId, throwing an exception
13848
       * if it is not found.
13849
       */
13850
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13851
        _Fields fields = findByThriftId(fieldId);
13852
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13853
        return fields;
13854
      }
13855
 
13856
      /**
13857
       * Find the _Fields constant that matches name, or null if its not found.
13858
       */
13859
      public static _Fields findByName(String name) {
13860
        return byName.get(name);
13861
      }
13862
 
13863
      private final short _thriftId;
13864
      private final String _fieldName;
13865
 
13866
      _Fields(short thriftId, String fieldName) {
13867
        _thriftId = thriftId;
13868
        _fieldName = fieldName;
13869
      }
13870
 
13871
      public short getThriftFieldId() {
13872
        return _thriftId;
13873
      }
13874
 
13875
      public String getFieldName() {
13876
        return _fieldName;
13877
      }
13878
    }
3430 rajveer 13879
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 13880
    static {
3430 rajveer 13881
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13882
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13883
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_args.class, metaDataMap);
3385 varun.gupt 13884
    }
13885
 
13886
    public getActiveCoupons_args() {
13887
    }
13888
 
13889
    /**
13890
     * Performs a deep copy on <i>other</i>.
13891
     */
13892
    public getActiveCoupons_args(getActiveCoupons_args other) {
13893
    }
13894
 
13895
    public getActiveCoupons_args deepCopy() {
13896
      return new getActiveCoupons_args(this);
13897
    }
13898
 
3430 rajveer 13899
    @Override
13900
    public void clear() {
3385 varun.gupt 13901
    }
13902
 
13903
    public void setFieldValue(_Fields field, Object value) {
13904
      switch (field) {
13905
      }
13906
    }
13907
 
13908
    public Object getFieldValue(_Fields field) {
13909
      switch (field) {
13910
      }
13911
      throw new IllegalStateException();
13912
    }
13913
 
3430 rajveer 13914
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13915
    public boolean isSet(_Fields field) {
13916
      if (field == null) {
13917
        throw new IllegalArgumentException();
13918
      }
3385 varun.gupt 13919
 
13920
      switch (field) {
13921
      }
13922
      throw new IllegalStateException();
13923
    }
13924
 
13925
    @Override
13926
    public boolean equals(Object that) {
13927
      if (that == null)
13928
        return false;
13929
      if (that instanceof getActiveCoupons_args)
13930
        return this.equals((getActiveCoupons_args)that);
13931
      return false;
13932
    }
13933
 
13934
    public boolean equals(getActiveCoupons_args that) {
13935
      if (that == null)
13936
        return false;
13937
 
13938
      return true;
13939
    }
13940
 
13941
    @Override
13942
    public int hashCode() {
13943
      return 0;
13944
    }
13945
 
13946
    public int compareTo(getActiveCoupons_args other) {
13947
      if (!getClass().equals(other.getClass())) {
13948
        return getClass().getName().compareTo(other.getClass().getName());
13949
      }
13950
 
13951
      int lastComparison = 0;
13952
      getActiveCoupons_args typedOther = (getActiveCoupons_args)other;
13953
 
13954
      return 0;
13955
    }
13956
 
3430 rajveer 13957
    public _Fields fieldForId(int fieldId) {
13958
      return _Fields.findByThriftId(fieldId);
13959
    }
13960
 
13961
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13962
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 13963
      iprot.readStructBegin();
13964
      while (true)
13965
      {
13966
        field = iprot.readFieldBegin();
3430 rajveer 13967
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 13968
          break;
13969
        }
3430 rajveer 13970
        switch (field.id) {
13971
          default:
13972
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 13973
        }
3430 rajveer 13974
        iprot.readFieldEnd();
3385 varun.gupt 13975
      }
13976
      iprot.readStructEnd();
13977
      validate();
13978
    }
13979
 
3430 rajveer 13980
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 13981
      validate();
13982
 
13983
      oprot.writeStructBegin(STRUCT_DESC);
13984
      oprot.writeFieldStop();
13985
      oprot.writeStructEnd();
13986
    }
13987
 
13988
    @Override
13989
    public String toString() {
13990
      StringBuilder sb = new StringBuilder("getActiveCoupons_args(");
13991
      boolean first = true;
13992
 
13993
      sb.append(")");
13994
      return sb.toString();
13995
    }
13996
 
3430 rajveer 13997
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 13998
      // check for required fields
13999
    }
14000
 
3430 rajveer 14001
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14002
      try {
14003
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14004
      } catch (org.apache.thrift.TException te) {
14005
        throw new java.io.IOException(te);
14006
      }
14007
    }
14008
 
14009
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14010
      try {
14011
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14012
      } catch (org.apache.thrift.TException te) {
14013
        throw new java.io.IOException(te);
14014
      }
14015
    }
14016
 
3385 varun.gupt 14017
  }
14018
 
3430 rajveer 14019
  public static class getActiveCoupons_result implements org.apache.thrift.TBase<getActiveCoupons_result, getActiveCoupons_result._Fields>, java.io.Serializable, Cloneable   {
14020
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_result");
3385 varun.gupt 14021
 
3430 rajveer 14022
    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);
14023
    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 14024
 
3430 rajveer 14025
    private List<Coupon> success; // required
14026
    private PromotionException pex; // required
3385 varun.gupt 14027
 
14028
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 14029
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 14030
      SUCCESS((short)0, "success"),
14031
      PEX((short)1, "pex");
14032
 
14033
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14034
 
14035
      static {
14036
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14037
          byName.put(field.getFieldName(), field);
14038
        }
14039
      }
14040
 
14041
      /**
14042
       * Find the _Fields constant that matches fieldId, or null if its not found.
14043
       */
14044
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 14045
        switch(fieldId) {
14046
          case 0: // SUCCESS
14047
            return SUCCESS;
14048
          case 1: // PEX
14049
            return PEX;
14050
          default:
14051
            return null;
14052
        }
3385 varun.gupt 14053
      }
14054
 
14055
      /**
14056
       * Find the _Fields constant that matches fieldId, throwing an exception
14057
       * if it is not found.
14058
       */
14059
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14060
        _Fields fields = findByThriftId(fieldId);
14061
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14062
        return fields;
14063
      }
14064
 
14065
      /**
14066
       * Find the _Fields constant that matches name, or null if its not found.
14067
       */
14068
      public static _Fields findByName(String name) {
14069
        return byName.get(name);
14070
      }
14071
 
14072
      private final short _thriftId;
14073
      private final String _fieldName;
14074
 
14075
      _Fields(short thriftId, String fieldName) {
14076
        _thriftId = thriftId;
14077
        _fieldName = fieldName;
14078
      }
14079
 
14080
      public short getThriftFieldId() {
14081
        return _thriftId;
14082
      }
14083
 
14084
      public String getFieldName() {
14085
        return _fieldName;
14086
      }
14087
    }
14088
 
14089
    // isset id assignments
14090
 
3430 rajveer 14091
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 14092
    static {
3430 rajveer 14093
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
14094
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14095
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
14096
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
14097
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14098
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
14099
      metaDataMap = Collections.unmodifiableMap(tmpMap);
14100
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_result.class, metaDataMap);
3385 varun.gupt 14101
    }
14102
 
14103
    public getActiveCoupons_result() {
14104
    }
14105
 
14106
    public getActiveCoupons_result(
14107
      List<Coupon> success,
14108
      PromotionException pex)
14109
    {
14110
      this();
14111
      this.success = success;
14112
      this.pex = pex;
14113
    }
14114
 
14115
    /**
14116
     * Performs a deep copy on <i>other</i>.
14117
     */
14118
    public getActiveCoupons_result(getActiveCoupons_result other) {
14119
      if (other.isSetSuccess()) {
14120
        List<Coupon> __this__success = new ArrayList<Coupon>();
14121
        for (Coupon other_element : other.success) {
14122
          __this__success.add(new Coupon(other_element));
14123
        }
14124
        this.success = __this__success;
14125
      }
14126
      if (other.isSetPex()) {
14127
        this.pex = new PromotionException(other.pex);
14128
      }
14129
    }
14130
 
14131
    public getActiveCoupons_result deepCopy() {
14132
      return new getActiveCoupons_result(this);
14133
    }
14134
 
3430 rajveer 14135
    @Override
14136
    public void clear() {
14137
      this.success = null;
14138
      this.pex = null;
3385 varun.gupt 14139
    }
14140
 
14141
    public int getSuccessSize() {
14142
      return (this.success == null) ? 0 : this.success.size();
14143
    }
14144
 
14145
    public java.util.Iterator<Coupon> getSuccessIterator() {
14146
      return (this.success == null) ? null : this.success.iterator();
14147
    }
14148
 
14149
    public void addToSuccess(Coupon elem) {
14150
      if (this.success == null) {
14151
        this.success = new ArrayList<Coupon>();
14152
      }
14153
      this.success.add(elem);
14154
    }
14155
 
14156
    public List<Coupon> getSuccess() {
14157
      return this.success;
14158
    }
14159
 
3430 rajveer 14160
    public void setSuccess(List<Coupon> success) {
3385 varun.gupt 14161
      this.success = success;
14162
    }
14163
 
14164
    public void unsetSuccess() {
14165
      this.success = null;
14166
    }
14167
 
3430 rajveer 14168
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 14169
    public boolean isSetSuccess() {
14170
      return this.success != null;
14171
    }
14172
 
14173
    public void setSuccessIsSet(boolean value) {
14174
      if (!value) {
14175
        this.success = null;
14176
      }
14177
    }
14178
 
14179
    public PromotionException getPex() {
14180
      return this.pex;
14181
    }
14182
 
3430 rajveer 14183
    public void setPex(PromotionException pex) {
3385 varun.gupt 14184
      this.pex = pex;
14185
    }
14186
 
14187
    public void unsetPex() {
14188
      this.pex = null;
14189
    }
14190
 
3430 rajveer 14191
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 14192
    public boolean isSetPex() {
14193
      return this.pex != null;
14194
    }
14195
 
14196
    public void setPexIsSet(boolean value) {
14197
      if (!value) {
14198
        this.pex = null;
14199
      }
14200
    }
14201
 
14202
    public void setFieldValue(_Fields field, Object value) {
14203
      switch (field) {
14204
      case SUCCESS:
14205
        if (value == null) {
14206
          unsetSuccess();
14207
        } else {
14208
          setSuccess((List<Coupon>)value);
14209
        }
14210
        break;
14211
 
14212
      case PEX:
14213
        if (value == null) {
14214
          unsetPex();
14215
        } else {
14216
          setPex((PromotionException)value);
14217
        }
14218
        break;
14219
 
14220
      }
14221
    }
14222
 
14223
    public Object getFieldValue(_Fields field) {
14224
      switch (field) {
14225
      case SUCCESS:
14226
        return getSuccess();
14227
 
14228
      case PEX:
14229
        return getPex();
14230
 
14231
      }
14232
      throw new IllegalStateException();
14233
    }
14234
 
3430 rajveer 14235
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14236
    public boolean isSet(_Fields field) {
14237
      if (field == null) {
14238
        throw new IllegalArgumentException();
14239
      }
3385 varun.gupt 14240
 
14241
      switch (field) {
14242
      case SUCCESS:
14243
        return isSetSuccess();
14244
      case PEX:
14245
        return isSetPex();
14246
      }
14247
      throw new IllegalStateException();
14248
    }
14249
 
14250
    @Override
14251
    public boolean equals(Object that) {
14252
      if (that == null)
14253
        return false;
14254
      if (that instanceof getActiveCoupons_result)
14255
        return this.equals((getActiveCoupons_result)that);
14256
      return false;
14257
    }
14258
 
14259
    public boolean equals(getActiveCoupons_result that) {
14260
      if (that == null)
14261
        return false;
14262
 
14263
      boolean this_present_success = true && this.isSetSuccess();
14264
      boolean that_present_success = true && that.isSetSuccess();
14265
      if (this_present_success || that_present_success) {
14266
        if (!(this_present_success && that_present_success))
14267
          return false;
14268
        if (!this.success.equals(that.success))
14269
          return false;
14270
      }
14271
 
14272
      boolean this_present_pex = true && this.isSetPex();
14273
      boolean that_present_pex = true && that.isSetPex();
14274
      if (this_present_pex || that_present_pex) {
14275
        if (!(this_present_pex && that_present_pex))
14276
          return false;
14277
        if (!this.pex.equals(that.pex))
14278
          return false;
14279
      }
14280
 
14281
      return true;
14282
    }
14283
 
14284
    @Override
14285
    public int hashCode() {
14286
      return 0;
14287
    }
14288
 
14289
    public int compareTo(getActiveCoupons_result other) {
14290
      if (!getClass().equals(other.getClass())) {
14291
        return getClass().getName().compareTo(other.getClass().getName());
14292
      }
14293
 
14294
      int lastComparison = 0;
14295
      getActiveCoupons_result typedOther = (getActiveCoupons_result)other;
14296
 
3430 rajveer 14297
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 14298
      if (lastComparison != 0) {
14299
        return lastComparison;
14300
      }
3430 rajveer 14301
      if (isSetSuccess()) {
14302
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
14303
        if (lastComparison != 0) {
14304
          return lastComparison;
14305
        }
3385 varun.gupt 14306
      }
3430 rajveer 14307
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 14308
      if (lastComparison != 0) {
14309
        return lastComparison;
14310
      }
3430 rajveer 14311
      if (isSetPex()) {
14312
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
14313
        if (lastComparison != 0) {
14314
          return lastComparison;
14315
        }
3385 varun.gupt 14316
      }
14317
      return 0;
14318
    }
14319
 
3430 rajveer 14320
    public _Fields fieldForId(int fieldId) {
14321
      return _Fields.findByThriftId(fieldId);
14322
    }
14323
 
14324
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14325
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 14326
      iprot.readStructBegin();
14327
      while (true)
14328
      {
14329
        field = iprot.readFieldBegin();
3430 rajveer 14330
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 14331
          break;
14332
        }
3430 rajveer 14333
        switch (field.id) {
14334
          case 0: // SUCCESS
14335
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
14336
              {
11592 amit.gupta 14337
                org.apache.thrift.protocol.TList _list38 = iprot.readListBegin();
14338
                this.success = new ArrayList<Coupon>(_list38.size);
14339
                for (int _i39 = 0; _i39 < _list38.size; ++_i39)
3385 varun.gupt 14340
                {
11592 amit.gupta 14341
                  Coupon _elem40; // required
14342
                  _elem40 = new Coupon();
14343
                  _elem40.read(iprot);
14344
                  this.success.add(_elem40);
3385 varun.gupt 14345
                }
3430 rajveer 14346
                iprot.readListEnd();
3385 varun.gupt 14347
              }
3430 rajveer 14348
            } else { 
14349
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14350
            }
14351
            break;
14352
          case 1: // PEX
14353
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
14354
              this.pex = new PromotionException();
14355
              this.pex.read(iprot);
14356
            } else { 
14357
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14358
            }
14359
            break;
14360
          default:
14361
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 14362
        }
3430 rajveer 14363
        iprot.readFieldEnd();
3385 varun.gupt 14364
      }
14365
      iprot.readStructEnd();
14366
      validate();
14367
    }
14368
 
3430 rajveer 14369
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 14370
      oprot.writeStructBegin(STRUCT_DESC);
14371
 
14372
      if (this.isSetSuccess()) {
14373
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
14374
        {
3430 rajveer 14375
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
11592 amit.gupta 14376
          for (Coupon _iter41 : this.success)
3385 varun.gupt 14377
          {
11592 amit.gupta 14378
            _iter41.write(oprot);
3385 varun.gupt 14379
          }
14380
          oprot.writeListEnd();
14381
        }
14382
        oprot.writeFieldEnd();
14383
      } else if (this.isSetPex()) {
14384
        oprot.writeFieldBegin(PEX_FIELD_DESC);
14385
        this.pex.write(oprot);
14386
        oprot.writeFieldEnd();
14387
      }
14388
      oprot.writeFieldStop();
14389
      oprot.writeStructEnd();
14390
    }
14391
 
14392
    @Override
14393
    public String toString() {
14394
      StringBuilder sb = new StringBuilder("getActiveCoupons_result(");
14395
      boolean first = true;
14396
 
14397
      sb.append("success:");
14398
      if (this.success == null) {
14399
        sb.append("null");
14400
      } else {
14401
        sb.append(this.success);
14402
      }
14403
      first = false;
14404
      if (!first) sb.append(", ");
14405
      sb.append("pex:");
14406
      if (this.pex == null) {
14407
        sb.append("null");
14408
      } else {
14409
        sb.append(this.pex);
14410
      }
14411
      first = false;
14412
      sb.append(")");
14413
      return sb.toString();
14414
    }
14415
 
3430 rajveer 14416
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 14417
      // check for required fields
14418
    }
14419
 
3430 rajveer 14420
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14421
      try {
14422
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14423
      } catch (org.apache.thrift.TException te) {
14424
        throw new java.io.IOException(te);
14425
      }
14426
    }
14427
 
14428
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14429
      try {
14430
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14431
      } catch (org.apache.thrift.TException te) {
14432
        throw new java.io.IOException(te);
14433
      }
14434
    }
14435
 
3385 varun.gupt 14436
  }
14437
 
6250 amit.gupta 14438
  public static class createCoupon_args implements org.apache.thrift.TBase<createCoupon_args, createCoupon_args._Fields>, java.io.Serializable, Cloneable   {
14439
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_args");
14440
 
14441
    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 14442
    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);
14443
    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);
14444
    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);
14445
    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);
14446
    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 14447
 
14448
    private long promotionId; // required
8707 manish.sha 14449
    private long couponCategory; // required
6730 anupam.sin 14450
    private String couponCode; // required
6679 anupam.sin 14451
    private String arguments; // required
6356 amit.gupta 14452
    private boolean isCod; // required
6561 amit.gupta 14453
    private String prefix; // required
6250 amit.gupta 14454
 
14455
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14456
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
14457
      PROMOTION_ID((short)1, "promotionId"),
8707 manish.sha 14458
      COUPON_CATEGORY((short)2, "couponCategory"),
14459
      COUPON_CODE((short)3, "couponCode"),
14460
      ARGUMENTS((short)4, "arguments"),
14461
      IS_COD((short)5, "isCod"),
14462
      PREFIX((short)6, "prefix");
6250 amit.gupta 14463
 
14464
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14465
 
14466
      static {
14467
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14468
          byName.put(field.getFieldName(), field);
14469
        }
14470
      }
14471
 
14472
      /**
14473
       * Find the _Fields constant that matches fieldId, or null if its not found.
14474
       */
14475
      public static _Fields findByThriftId(int fieldId) {
14476
        switch(fieldId) {
14477
          case 1: // PROMOTION_ID
14478
            return PROMOTION_ID;
8707 manish.sha 14479
          case 2: // COUPON_CATEGORY
14480
            return COUPON_CATEGORY;
14481
          case 3: // COUPON_CODE
6730 anupam.sin 14482
            return COUPON_CODE;
8707 manish.sha 14483
          case 4: // ARGUMENTS
6679 anupam.sin 14484
            return ARGUMENTS;
8707 manish.sha 14485
          case 5: // IS_COD
6356 amit.gupta 14486
            return IS_COD;
8707 manish.sha 14487
          case 6: // PREFIX
6561 amit.gupta 14488
            return PREFIX;
6250 amit.gupta 14489
          default:
14490
            return null;
14491
        }
14492
      }
14493
 
14494
      /**
14495
       * Find the _Fields constant that matches fieldId, throwing an exception
14496
       * if it is not found.
14497
       */
14498
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14499
        _Fields fields = findByThriftId(fieldId);
14500
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14501
        return fields;
14502
      }
14503
 
14504
      /**
14505
       * Find the _Fields constant that matches name, or null if its not found.
14506
       */
14507
      public static _Fields findByName(String name) {
14508
        return byName.get(name);
14509
      }
14510
 
14511
      private final short _thriftId;
14512
      private final String _fieldName;
14513
 
14514
      _Fields(short thriftId, String fieldName) {
14515
        _thriftId = thriftId;
14516
        _fieldName = fieldName;
14517
      }
14518
 
14519
      public short getThriftFieldId() {
14520
        return _thriftId;
14521
      }
14522
 
14523
      public String getFieldName() {
14524
        return _fieldName;
14525
      }
14526
    }
14527
 
14528
    // isset id assignments
14529
    private static final int __PROMOTIONID_ISSET_ID = 0;
8707 manish.sha 14530
    private static final int __COUPONCATEGORY_ISSET_ID = 1;
14531
    private static final int __ISCOD_ISSET_ID = 2;
14532
    private BitSet __isset_bit_vector = new BitSet(3);
6250 amit.gupta 14533
 
14534
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
14535
    static {
14536
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
14537
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14538
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8707 manish.sha 14539
      tmpMap.put(_Fields.COUPON_CATEGORY, new org.apache.thrift.meta_data.FieldMetaData("couponCategory", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14540
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6730 anupam.sin 14541
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14542
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6679 anupam.sin 14543
      tmpMap.put(_Fields.ARGUMENTS, new org.apache.thrift.meta_data.FieldMetaData("arguments", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6250 amit.gupta 14544
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6356 amit.gupta 14545
      tmpMap.put(_Fields.IS_COD, new org.apache.thrift.meta_data.FieldMetaData("isCod", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14546
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
6561 amit.gupta 14547
      tmpMap.put(_Fields.PREFIX, new org.apache.thrift.meta_data.FieldMetaData("prefix", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14548
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6250 amit.gupta 14549
      metaDataMap = Collections.unmodifiableMap(tmpMap);
14550
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_args.class, metaDataMap);
14551
    }
14552
 
14553
    public createCoupon_args() {
14554
    }
14555
 
14556
    public createCoupon_args(
14557
      long promotionId,
8707 manish.sha 14558
      long couponCategory,
6730 anupam.sin 14559
      String couponCode,
6679 anupam.sin 14560
      String arguments,
6356 amit.gupta 14561
      boolean isCod,
6561 amit.gupta 14562
      String prefix)
6250 amit.gupta 14563
    {
14564
      this();
14565
      this.promotionId = promotionId;
14566
      setPromotionIdIsSet(true);
8707 manish.sha 14567
      this.couponCategory = couponCategory;
14568
      setCouponCategoryIsSet(true);
6730 anupam.sin 14569
      this.couponCode = couponCode;
6679 anupam.sin 14570
      this.arguments = arguments;
6356 amit.gupta 14571
      this.isCod = isCod;
14572
      setIsCodIsSet(true);
6561 amit.gupta 14573
      this.prefix = prefix;
6250 amit.gupta 14574
    }
14575
 
14576
    /**
14577
     * Performs a deep copy on <i>other</i>.
14578
     */
14579
    public createCoupon_args(createCoupon_args other) {
14580
      __isset_bit_vector.clear();
14581
      __isset_bit_vector.or(other.__isset_bit_vector);
14582
      this.promotionId = other.promotionId;
8707 manish.sha 14583
      this.couponCategory = other.couponCategory;
6730 anupam.sin 14584
      if (other.isSetCouponCode()) {
14585
        this.couponCode = other.couponCode;
14586
      }
6679 anupam.sin 14587
      if (other.isSetArguments()) {
14588
        this.arguments = other.arguments;
6250 amit.gupta 14589
      }
6356 amit.gupta 14590
      this.isCod = other.isCod;
6561 amit.gupta 14591
      if (other.isSetPrefix()) {
14592
        this.prefix = other.prefix;
14593
      }
6250 amit.gupta 14594
    }
14595
 
14596
    public createCoupon_args deepCopy() {
14597
      return new createCoupon_args(this);
14598
    }
14599
 
14600
    @Override
14601
    public void clear() {
14602
      setPromotionIdIsSet(false);
14603
      this.promotionId = 0;
8707 manish.sha 14604
      setCouponCategoryIsSet(false);
14605
      this.couponCategory = 0;
6730 anupam.sin 14606
      this.couponCode = null;
6679 anupam.sin 14607
      this.arguments = null;
6356 amit.gupta 14608
      setIsCodIsSet(false);
14609
      this.isCod = false;
6561 amit.gupta 14610
      this.prefix = null;
6250 amit.gupta 14611
    }
14612
 
14613
    public long getPromotionId() {
14614
      return this.promotionId;
14615
    }
14616
 
14617
    public void setPromotionId(long promotionId) {
14618
      this.promotionId = promotionId;
14619
      setPromotionIdIsSet(true);
14620
    }
14621
 
14622
    public void unsetPromotionId() {
14623
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
14624
    }
14625
 
14626
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
14627
    public boolean isSetPromotionId() {
14628
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
14629
    }
14630
 
14631
    public void setPromotionIdIsSet(boolean value) {
14632
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
14633
    }
14634
 
8707 manish.sha 14635
    public long getCouponCategory() {
14636
      return this.couponCategory;
14637
    }
14638
 
14639
    public void setCouponCategory(long couponCategory) {
14640
      this.couponCategory = couponCategory;
14641
      setCouponCategoryIsSet(true);
14642
    }
14643
 
14644
    public void unsetCouponCategory() {
14645
      __isset_bit_vector.clear(__COUPONCATEGORY_ISSET_ID);
14646
    }
14647
 
14648
    /** Returns true if field couponCategory is set (has been assigned a value) and false otherwise */
14649
    public boolean isSetCouponCategory() {
14650
      return __isset_bit_vector.get(__COUPONCATEGORY_ISSET_ID);
14651
    }
14652
 
14653
    public void setCouponCategoryIsSet(boolean value) {
14654
      __isset_bit_vector.set(__COUPONCATEGORY_ISSET_ID, value);
14655
    }
14656
 
6730 anupam.sin 14657
    public String getCouponCode() {
14658
      return this.couponCode;
14659
    }
14660
 
14661
    public void setCouponCode(String couponCode) {
14662
      this.couponCode = couponCode;
14663
    }
14664
 
14665
    public void unsetCouponCode() {
14666
      this.couponCode = null;
14667
    }
14668
 
14669
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
14670
    public boolean isSetCouponCode() {
14671
      return this.couponCode != null;
14672
    }
14673
 
14674
    public void setCouponCodeIsSet(boolean value) {
14675
      if (!value) {
14676
        this.couponCode = null;
14677
      }
14678
    }
14679
 
6679 anupam.sin 14680
    public String getArguments() {
14681
      return this.arguments;
6250 amit.gupta 14682
    }
14683
 
6679 anupam.sin 14684
    public void setArguments(String arguments) {
14685
      this.arguments = arguments;
6250 amit.gupta 14686
    }
14687
 
6679 anupam.sin 14688
    public void unsetArguments() {
14689
      this.arguments = null;
6250 amit.gupta 14690
    }
14691
 
6679 anupam.sin 14692
    /** Returns true if field arguments is set (has been assigned a value) and false otherwise */
14693
    public boolean isSetArguments() {
14694
      return this.arguments != null;
6250 amit.gupta 14695
    }
14696
 
6679 anupam.sin 14697
    public void setArgumentsIsSet(boolean value) {
6250 amit.gupta 14698
      if (!value) {
6679 anupam.sin 14699
        this.arguments = null;
6250 amit.gupta 14700
      }
14701
    }
14702
 
6356 amit.gupta 14703
    public boolean isIsCod() {
14704
      return this.isCod;
14705
    }
14706
 
14707
    public void setIsCod(boolean isCod) {
14708
      this.isCod = isCod;
14709
      setIsCodIsSet(true);
14710
    }
14711
 
14712
    public void unsetIsCod() {
14713
      __isset_bit_vector.clear(__ISCOD_ISSET_ID);
14714
    }
14715
 
14716
    /** Returns true if field isCod is set (has been assigned a value) and false otherwise */
14717
    public boolean isSetIsCod() {
14718
      return __isset_bit_vector.get(__ISCOD_ISSET_ID);
14719
    }
14720
 
14721
    public void setIsCodIsSet(boolean value) {
14722
      __isset_bit_vector.set(__ISCOD_ISSET_ID, value);
14723
    }
14724
 
6561 amit.gupta 14725
    public String getPrefix() {
14726
      return this.prefix;
14727
    }
14728
 
14729
    public void setPrefix(String prefix) {
14730
      this.prefix = prefix;
14731
    }
14732
 
14733
    public void unsetPrefix() {
14734
      this.prefix = null;
14735
    }
14736
 
14737
    /** Returns true if field prefix is set (has been assigned a value) and false otherwise */
14738
    public boolean isSetPrefix() {
14739
      return this.prefix != null;
14740
    }
14741
 
14742
    public void setPrefixIsSet(boolean value) {
14743
      if (!value) {
14744
        this.prefix = null;
14745
      }
14746
    }
14747
 
6250 amit.gupta 14748
    public void setFieldValue(_Fields field, Object value) {
14749
      switch (field) {
14750
      case PROMOTION_ID:
14751
        if (value == null) {
14752
          unsetPromotionId();
14753
        } else {
14754
          setPromotionId((Long)value);
14755
        }
14756
        break;
14757
 
8707 manish.sha 14758
      case COUPON_CATEGORY:
14759
        if (value == null) {
14760
          unsetCouponCategory();
14761
        } else {
14762
          setCouponCategory((Long)value);
14763
        }
14764
        break;
14765
 
6730 anupam.sin 14766
      case COUPON_CODE:
14767
        if (value == null) {
14768
          unsetCouponCode();
14769
        } else {
14770
          setCouponCode((String)value);
14771
        }
14772
        break;
14773
 
6679 anupam.sin 14774
      case ARGUMENTS:
6250 amit.gupta 14775
        if (value == null) {
6679 anupam.sin 14776
          unsetArguments();
6250 amit.gupta 14777
        } else {
6679 anupam.sin 14778
          setArguments((String)value);
6250 amit.gupta 14779
        }
14780
        break;
14781
 
6356 amit.gupta 14782
      case IS_COD:
14783
        if (value == null) {
14784
          unsetIsCod();
14785
        } else {
14786
          setIsCod((Boolean)value);
14787
        }
14788
        break;
14789
 
6561 amit.gupta 14790
      case PREFIX:
14791
        if (value == null) {
14792
          unsetPrefix();
14793
        } else {
14794
          setPrefix((String)value);
14795
        }
14796
        break;
14797
 
6250 amit.gupta 14798
      }
14799
    }
14800
 
14801
    public Object getFieldValue(_Fields field) {
14802
      switch (field) {
14803
      case PROMOTION_ID:
14804
        return Long.valueOf(getPromotionId());
14805
 
8707 manish.sha 14806
      case COUPON_CATEGORY:
14807
        return Long.valueOf(getCouponCategory());
14808
 
6730 anupam.sin 14809
      case COUPON_CODE:
14810
        return getCouponCode();
14811
 
6679 anupam.sin 14812
      case ARGUMENTS:
14813
        return getArguments();
6250 amit.gupta 14814
 
6356 amit.gupta 14815
      case IS_COD:
14816
        return Boolean.valueOf(isIsCod());
14817
 
6561 amit.gupta 14818
      case PREFIX:
14819
        return getPrefix();
14820
 
6250 amit.gupta 14821
      }
14822
      throw new IllegalStateException();
14823
    }
14824
 
14825
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14826
    public boolean isSet(_Fields field) {
14827
      if (field == null) {
14828
        throw new IllegalArgumentException();
14829
      }
14830
 
14831
      switch (field) {
14832
      case PROMOTION_ID:
14833
        return isSetPromotionId();
8707 manish.sha 14834
      case COUPON_CATEGORY:
14835
        return isSetCouponCategory();
6730 anupam.sin 14836
      case COUPON_CODE:
14837
        return isSetCouponCode();
6679 anupam.sin 14838
      case ARGUMENTS:
14839
        return isSetArguments();
6356 amit.gupta 14840
      case IS_COD:
14841
        return isSetIsCod();
6561 amit.gupta 14842
      case PREFIX:
14843
        return isSetPrefix();
6250 amit.gupta 14844
      }
14845
      throw new IllegalStateException();
14846
    }
14847
 
14848
    @Override
14849
    public boolean equals(Object that) {
14850
      if (that == null)
14851
        return false;
14852
      if (that instanceof createCoupon_args)
14853
        return this.equals((createCoupon_args)that);
14854
      return false;
14855
    }
14856
 
14857
    public boolean equals(createCoupon_args that) {
14858
      if (that == null)
14859
        return false;
14860
 
14861
      boolean this_present_promotionId = true;
14862
      boolean that_present_promotionId = true;
14863
      if (this_present_promotionId || that_present_promotionId) {
14864
        if (!(this_present_promotionId && that_present_promotionId))
14865
          return false;
14866
        if (this.promotionId != that.promotionId)
14867
          return false;
14868
      }
14869
 
8707 manish.sha 14870
      boolean this_present_couponCategory = true;
14871
      boolean that_present_couponCategory = true;
14872
      if (this_present_couponCategory || that_present_couponCategory) {
14873
        if (!(this_present_couponCategory && that_present_couponCategory))
14874
          return false;
14875
        if (this.couponCategory != that.couponCategory)
14876
          return false;
14877
      }
14878
 
6730 anupam.sin 14879
      boolean this_present_couponCode = true && this.isSetCouponCode();
14880
      boolean that_present_couponCode = true && that.isSetCouponCode();
14881
      if (this_present_couponCode || that_present_couponCode) {
14882
        if (!(this_present_couponCode && that_present_couponCode))
14883
          return false;
14884
        if (!this.couponCode.equals(that.couponCode))
14885
          return false;
14886
      }
14887
 
6679 anupam.sin 14888
      boolean this_present_arguments = true && this.isSetArguments();
14889
      boolean that_present_arguments = true && that.isSetArguments();
14890
      if (this_present_arguments || that_present_arguments) {
14891
        if (!(this_present_arguments && that_present_arguments))
6250 amit.gupta 14892
          return false;
6679 anupam.sin 14893
        if (!this.arguments.equals(that.arguments))
6250 amit.gupta 14894
          return false;
14895
      }
14896
 
6356 amit.gupta 14897
      boolean this_present_isCod = true;
14898
      boolean that_present_isCod = true;
14899
      if (this_present_isCod || that_present_isCod) {
14900
        if (!(this_present_isCod && that_present_isCod))
14901
          return false;
14902
        if (this.isCod != that.isCod)
14903
          return false;
14904
      }
14905
 
6561 amit.gupta 14906
      boolean this_present_prefix = true && this.isSetPrefix();
14907
      boolean that_present_prefix = true && that.isSetPrefix();
14908
      if (this_present_prefix || that_present_prefix) {
14909
        if (!(this_present_prefix && that_present_prefix))
14910
          return false;
14911
        if (!this.prefix.equals(that.prefix))
14912
          return false;
14913
      }
14914
 
6250 amit.gupta 14915
      return true;
14916
    }
14917
 
14918
    @Override
14919
    public int hashCode() {
14920
      return 0;
14921
    }
14922
 
14923
    public int compareTo(createCoupon_args other) {
14924
      if (!getClass().equals(other.getClass())) {
14925
        return getClass().getName().compareTo(other.getClass().getName());
14926
      }
14927
 
14928
      int lastComparison = 0;
14929
      createCoupon_args typedOther = (createCoupon_args)other;
14930
 
14931
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
14932
      if (lastComparison != 0) {
14933
        return lastComparison;
14934
      }
14935
      if (isSetPromotionId()) {
14936
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
14937
        if (lastComparison != 0) {
14938
          return lastComparison;
14939
        }
14940
      }
8707 manish.sha 14941
      lastComparison = Boolean.valueOf(isSetCouponCategory()).compareTo(typedOther.isSetCouponCategory());
14942
      if (lastComparison != 0) {
14943
        return lastComparison;
14944
      }
14945
      if (isSetCouponCategory()) {
14946
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCategory, typedOther.couponCategory);
14947
        if (lastComparison != 0) {
14948
          return lastComparison;
14949
        }
14950
      }
6730 anupam.sin 14951
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
14952
      if (lastComparison != 0) {
14953
        return lastComparison;
14954
      }
14955
      if (isSetCouponCode()) {
14956
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
14957
        if (lastComparison != 0) {
14958
          return lastComparison;
14959
        }
14960
      }
6679 anupam.sin 14961
      lastComparison = Boolean.valueOf(isSetArguments()).compareTo(typedOther.isSetArguments());
6250 amit.gupta 14962
      if (lastComparison != 0) {
14963
        return lastComparison;
14964
      }
6679 anupam.sin 14965
      if (isSetArguments()) {
14966
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.arguments, typedOther.arguments);
6250 amit.gupta 14967
        if (lastComparison != 0) {
14968
          return lastComparison;
14969
        }
14970
      }
6356 amit.gupta 14971
      lastComparison = Boolean.valueOf(isSetIsCod()).compareTo(typedOther.isSetIsCod());
14972
      if (lastComparison != 0) {
14973
        return lastComparison;
14974
      }
14975
      if (isSetIsCod()) {
14976
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isCod, typedOther.isCod);
14977
        if (lastComparison != 0) {
14978
          return lastComparison;
14979
        }
14980
      }
6561 amit.gupta 14981
      lastComparison = Boolean.valueOf(isSetPrefix()).compareTo(typedOther.isSetPrefix());
14982
      if (lastComparison != 0) {
14983
        return lastComparison;
14984
      }
14985
      if (isSetPrefix()) {
14986
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.prefix, typedOther.prefix);
14987
        if (lastComparison != 0) {
14988
          return lastComparison;
14989
        }
14990
      }
6250 amit.gupta 14991
      return 0;
14992
    }
14993
 
14994
    public _Fields fieldForId(int fieldId) {
14995
      return _Fields.findByThriftId(fieldId);
14996
    }
14997
 
14998
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14999
      org.apache.thrift.protocol.TField field;
15000
      iprot.readStructBegin();
15001
      while (true)
15002
      {
15003
        field = iprot.readFieldBegin();
15004
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
15005
          break;
15006
        }
15007
        switch (field.id) {
15008
          case 1: // PROMOTION_ID
15009
            if (field.type == org.apache.thrift.protocol.TType.I64) {
15010
              this.promotionId = iprot.readI64();
15011
              setPromotionIdIsSet(true);
15012
            } else { 
15013
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15014
            }
15015
            break;
8707 manish.sha 15016
          case 2: // COUPON_CATEGORY
15017
            if (field.type == org.apache.thrift.protocol.TType.I64) {
15018
              this.couponCategory = iprot.readI64();
15019
              setCouponCategoryIsSet(true);
15020
            } else { 
15021
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15022
            }
15023
            break;
15024
          case 3: // COUPON_CODE
6250 amit.gupta 15025
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
6730 anupam.sin 15026
              this.couponCode = iprot.readString();
15027
            } else { 
15028
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15029
            }
15030
            break;
8707 manish.sha 15031
          case 4: // ARGUMENTS
6730 anupam.sin 15032
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
6679 anupam.sin 15033
              this.arguments = iprot.readString();
6250 amit.gupta 15034
            } else { 
15035
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15036
            }
15037
            break;
8707 manish.sha 15038
          case 5: // IS_COD
6356 amit.gupta 15039
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
15040
              this.isCod = iprot.readBool();
15041
              setIsCodIsSet(true);
15042
            } else { 
15043
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15044
            }
15045
            break;
8707 manish.sha 15046
          case 6: // PREFIX
6561 amit.gupta 15047
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
15048
              this.prefix = iprot.readString();
15049
            } else { 
15050
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15051
            }
15052
            break;
6250 amit.gupta 15053
          default:
15054
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15055
        }
15056
        iprot.readFieldEnd();
15057
      }
15058
      iprot.readStructEnd();
15059
      validate();
15060
    }
15061
 
15062
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
15063
      validate();
15064
 
15065
      oprot.writeStructBegin(STRUCT_DESC);
15066
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
15067
      oprot.writeI64(this.promotionId);
15068
      oprot.writeFieldEnd();
8707 manish.sha 15069
      oprot.writeFieldBegin(COUPON_CATEGORY_FIELD_DESC);
15070
      oprot.writeI64(this.couponCategory);
15071
      oprot.writeFieldEnd();
6730 anupam.sin 15072
      if (this.couponCode != null) {
15073
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
15074
        oprot.writeString(this.couponCode);
15075
        oprot.writeFieldEnd();
15076
      }
6679 anupam.sin 15077
      if (this.arguments != null) {
15078
        oprot.writeFieldBegin(ARGUMENTS_FIELD_DESC);
15079
        oprot.writeString(this.arguments);
6250 amit.gupta 15080
        oprot.writeFieldEnd();
15081
      }
6356 amit.gupta 15082
      oprot.writeFieldBegin(IS_COD_FIELD_DESC);
15083
      oprot.writeBool(this.isCod);
15084
      oprot.writeFieldEnd();
6561 amit.gupta 15085
      if (this.prefix != null) {
15086
        oprot.writeFieldBegin(PREFIX_FIELD_DESC);
15087
        oprot.writeString(this.prefix);
15088
        oprot.writeFieldEnd();
15089
      }
6250 amit.gupta 15090
      oprot.writeFieldStop();
15091
      oprot.writeStructEnd();
15092
    }
15093
 
15094
    @Override
15095
    public String toString() {
15096
      StringBuilder sb = new StringBuilder("createCoupon_args(");
15097
      boolean first = true;
15098
 
15099
      sb.append("promotionId:");
15100
      sb.append(this.promotionId);
15101
      first = false;
15102
      if (!first) sb.append(", ");
8707 manish.sha 15103
      sb.append("couponCategory:");
15104
      sb.append(this.couponCategory);
15105
      first = false;
15106
      if (!first) sb.append(", ");
6730 anupam.sin 15107
      sb.append("couponCode:");
15108
      if (this.couponCode == null) {
15109
        sb.append("null");
15110
      } else {
15111
        sb.append(this.couponCode);
15112
      }
15113
      first = false;
15114
      if (!first) sb.append(", ");
6679 anupam.sin 15115
      sb.append("arguments:");
15116
      if (this.arguments == null) {
6250 amit.gupta 15117
        sb.append("null");
15118
      } else {
6679 anupam.sin 15119
        sb.append(this.arguments);
6250 amit.gupta 15120
      }
15121
      first = false;
15122
      if (!first) sb.append(", ");
6356 amit.gupta 15123
      sb.append("isCod:");
15124
      sb.append(this.isCod);
15125
      first = false;
15126
      if (!first) sb.append(", ");
6561 amit.gupta 15127
      sb.append("prefix:");
15128
      if (this.prefix == null) {
15129
        sb.append("null");
15130
      } else {
15131
        sb.append(this.prefix);
15132
      }
15133
      first = false;
6250 amit.gupta 15134
      sb.append(")");
15135
      return sb.toString();
15136
    }
15137
 
15138
    public void validate() throws org.apache.thrift.TException {
15139
      // check for required fields
15140
    }
15141
 
15142
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15143
      try {
15144
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15145
      } catch (org.apache.thrift.TException te) {
15146
        throw new java.io.IOException(te);
15147
      }
15148
    }
15149
 
15150
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15151
      try {
22359 ashik.ali 15152
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
15153
        __isset_bit_vector = new BitSet(1);
6250 amit.gupta 15154
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15155
      } catch (org.apache.thrift.TException te) {
15156
        throw new java.io.IOException(te);
15157
      }
15158
    }
15159
 
15160
  }
15161
 
15162
  public static class createCoupon_result implements org.apache.thrift.TBase<createCoupon_result, createCoupon_result._Fields>, java.io.Serializable, Cloneable   {
15163
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_result");
15164
 
15165
    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);
15166
    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);
15167
 
15168
    private String success; // required
15169
    private PromotionException pex; // required
15170
 
15171
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
15172
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
15173
      SUCCESS((short)0, "success"),
15174
      PEX((short)1, "pex");
15175
 
15176
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15177
 
15178
      static {
15179
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15180
          byName.put(field.getFieldName(), field);
15181
        }
15182
      }
15183
 
15184
      /**
15185
       * Find the _Fields constant that matches fieldId, or null if its not found.
15186
       */
15187
      public static _Fields findByThriftId(int fieldId) {
15188
        switch(fieldId) {
15189
          case 0: // SUCCESS
15190
            return SUCCESS;
15191
          case 1: // PEX
15192
            return PEX;
15193
          default:
15194
            return null;
15195
        }
15196
      }
15197
 
15198
      /**
15199
       * Find the _Fields constant that matches fieldId, throwing an exception
15200
       * if it is not found.
15201
       */
15202
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15203
        _Fields fields = findByThriftId(fieldId);
15204
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15205
        return fields;
15206
      }
15207
 
15208
      /**
15209
       * Find the _Fields constant that matches name, or null if its not found.
15210
       */
15211
      public static _Fields findByName(String name) {
15212
        return byName.get(name);
15213
      }
15214
 
15215
      private final short _thriftId;
15216
      private final String _fieldName;
15217
 
15218
      _Fields(short thriftId, String fieldName) {
15219
        _thriftId = thriftId;
15220
        _fieldName = fieldName;
15221
      }
15222
 
15223
      public short getThriftFieldId() {
15224
        return _thriftId;
15225
      }
15226
 
15227
      public String getFieldName() {
15228
        return _fieldName;
15229
      }
15230
    }
15231
 
15232
    // isset id assignments
15233
 
15234
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
15235
    static {
15236
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15237
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15238
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
15239
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15240
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
15241
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15242
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_result.class, metaDataMap);
15243
    }
15244
 
15245
    public createCoupon_result() {
15246
    }
15247
 
15248
    public createCoupon_result(
15249
      String success,
15250
      PromotionException pex)
15251
    {
15252
      this();
15253
      this.success = success;
15254
      this.pex = pex;
15255
    }
15256
 
15257
    /**
15258
     * Performs a deep copy on <i>other</i>.
15259
     */
15260
    public createCoupon_result(createCoupon_result other) {
15261
      if (other.isSetSuccess()) {
15262
        this.success = other.success;
15263
      }
15264
      if (other.isSetPex()) {
15265
        this.pex = new PromotionException(other.pex);
15266
      }
15267
    }
15268
 
15269
    public createCoupon_result deepCopy() {
15270
      return new createCoupon_result(this);
15271
    }
15272
 
15273
    @Override
15274
    public void clear() {
15275
      this.success = null;
15276
      this.pex = null;
15277
    }
15278
 
15279
    public String getSuccess() {
15280
      return this.success;
15281
    }
15282
 
15283
    public void setSuccess(String success) {
15284
      this.success = success;
15285
    }
15286
 
15287
    public void unsetSuccess() {
15288
      this.success = null;
15289
    }
15290
 
15291
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
15292
    public boolean isSetSuccess() {
15293
      return this.success != null;
15294
    }
15295
 
15296
    public void setSuccessIsSet(boolean value) {
15297
      if (!value) {
15298
        this.success = null;
15299
      }
15300
    }
15301
 
15302
    public PromotionException getPex() {
15303
      return this.pex;
15304
    }
15305
 
15306
    public void setPex(PromotionException pex) {
15307
      this.pex = pex;
15308
    }
15309
 
15310
    public void unsetPex() {
15311
      this.pex = null;
15312
    }
15313
 
15314
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
15315
    public boolean isSetPex() {
15316
      return this.pex != null;
15317
    }
15318
 
15319
    public void setPexIsSet(boolean value) {
15320
      if (!value) {
15321
        this.pex = null;
15322
      }
15323
    }
15324
 
15325
    public void setFieldValue(_Fields field, Object value) {
15326
      switch (field) {
15327
      case SUCCESS:
15328
        if (value == null) {
15329
          unsetSuccess();
15330
        } else {
15331
          setSuccess((String)value);
15332
        }
15333
        break;
15334
 
15335
      case PEX:
15336
        if (value == null) {
15337
          unsetPex();
15338
        } else {
15339
          setPex((PromotionException)value);
15340
        }
15341
        break;
15342
 
15343
      }
15344
    }
15345
 
15346
    public Object getFieldValue(_Fields field) {
15347
      switch (field) {
15348
      case SUCCESS:
15349
        return getSuccess();
15350
 
15351
      case PEX:
15352
        return getPex();
15353
 
15354
      }
15355
      throw new IllegalStateException();
15356
    }
15357
 
15358
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15359
    public boolean isSet(_Fields field) {
15360
      if (field == null) {
15361
        throw new IllegalArgumentException();
15362
      }
15363
 
15364
      switch (field) {
15365
      case SUCCESS:
15366
        return isSetSuccess();
15367
      case PEX:
15368
        return isSetPex();
15369
      }
15370
      throw new IllegalStateException();
15371
    }
15372
 
15373
    @Override
15374
    public boolean equals(Object that) {
15375
      if (that == null)
15376
        return false;
15377
      if (that instanceof createCoupon_result)
15378
        return this.equals((createCoupon_result)that);
15379
      return false;
15380
    }
15381
 
15382
    public boolean equals(createCoupon_result that) {
15383
      if (that == null)
15384
        return false;
15385
 
15386
      boolean this_present_success = true && this.isSetSuccess();
15387
      boolean that_present_success = true && that.isSetSuccess();
15388
      if (this_present_success || that_present_success) {
15389
        if (!(this_present_success && that_present_success))
15390
          return false;
15391
        if (!this.success.equals(that.success))
15392
          return false;
15393
      }
15394
 
15395
      boolean this_present_pex = true && this.isSetPex();
15396
      boolean that_present_pex = true && that.isSetPex();
15397
      if (this_present_pex || that_present_pex) {
15398
        if (!(this_present_pex && that_present_pex))
15399
          return false;
15400
        if (!this.pex.equals(that.pex))
15401
          return false;
15402
      }
15403
 
15404
      return true;
15405
    }
15406
 
15407
    @Override
15408
    public int hashCode() {
15409
      return 0;
15410
    }
15411
 
15412
    public int compareTo(createCoupon_result other) {
15413
      if (!getClass().equals(other.getClass())) {
15414
        return getClass().getName().compareTo(other.getClass().getName());
15415
      }
15416
 
15417
      int lastComparison = 0;
15418
      createCoupon_result typedOther = (createCoupon_result)other;
15419
 
15420
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
15421
      if (lastComparison != 0) {
15422
        return lastComparison;
15423
      }
15424
      if (isSetSuccess()) {
15425
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
15426
        if (lastComparison != 0) {
15427
          return lastComparison;
15428
        }
15429
      }
15430
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
15431
      if (lastComparison != 0) {
15432
        return lastComparison;
15433
      }
15434
      if (isSetPex()) {
15435
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
15436
        if (lastComparison != 0) {
15437
          return lastComparison;
15438
        }
15439
      }
15440
      return 0;
15441
    }
15442
 
15443
    public _Fields fieldForId(int fieldId) {
15444
      return _Fields.findByThriftId(fieldId);
15445
    }
15446
 
15447
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15448
      org.apache.thrift.protocol.TField field;
15449
      iprot.readStructBegin();
15450
      while (true)
15451
      {
15452
        field = iprot.readFieldBegin();
15453
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
15454
          break;
15455
        }
15456
        switch (field.id) {
15457
          case 0: // SUCCESS
15458
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
15459
              this.success = iprot.readString();
15460
            } else { 
15461
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15462
            }
15463
            break;
15464
          case 1: // PEX
15465
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
15466
              this.pex = new PromotionException();
15467
              this.pex.read(iprot);
15468
            } else { 
15469
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15470
            }
15471
            break;
15472
          default:
15473
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15474
        }
15475
        iprot.readFieldEnd();
15476
      }
15477
      iprot.readStructEnd();
15478
      validate();
15479
    }
15480
 
15481
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
15482
      oprot.writeStructBegin(STRUCT_DESC);
15483
 
15484
      if (this.isSetSuccess()) {
15485
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
15486
        oprot.writeString(this.success);
15487
        oprot.writeFieldEnd();
15488
      } else if (this.isSetPex()) {
15489
        oprot.writeFieldBegin(PEX_FIELD_DESC);
15490
        this.pex.write(oprot);
15491
        oprot.writeFieldEnd();
15492
      }
15493
      oprot.writeFieldStop();
15494
      oprot.writeStructEnd();
15495
    }
15496
 
15497
    @Override
15498
    public String toString() {
15499
      StringBuilder sb = new StringBuilder("createCoupon_result(");
15500
      boolean first = true;
15501
 
15502
      sb.append("success:");
15503
      if (this.success == null) {
15504
        sb.append("null");
15505
      } else {
15506
        sb.append(this.success);
15507
      }
15508
      first = false;
15509
      if (!first) sb.append(", ");
15510
      sb.append("pex:");
15511
      if (this.pex == null) {
15512
        sb.append("null");
15513
      } else {
15514
        sb.append(this.pex);
15515
      }
15516
      first = false;
15517
      sb.append(")");
15518
      return sb.toString();
15519
    }
15520
 
15521
    public void validate() throws org.apache.thrift.TException {
15522
      // check for required fields
15523
    }
15524
 
15525
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15526
      try {
15527
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15528
      } catch (org.apache.thrift.TException te) {
15529
        throw new java.io.IOException(te);
15530
      }
15531
    }
15532
 
15533
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15534
      try {
15535
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15536
      } catch (org.apache.thrift.TException te) {
15537
        throw new java.io.IOException(te);
15538
      }
15539
    }
15540
 
15541
  }
15542
 
3430 rajveer 15543
  public static class getSuccessfulPaymentCountForCoupon_args implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_args, getSuccessfulPaymentCountForCoupon_args._Fields>, java.io.Serializable, Cloneable   {
15544
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_args");
3385 varun.gupt 15545
 
3430 rajveer 15546
    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 15547
 
3430 rajveer 15548
    private String couponCode; // required
3385 varun.gupt 15549
 
15550
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 15551
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 15552
      COUPON_CODE((short)1, "couponCode");
15553
 
15554
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15555
 
15556
      static {
15557
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15558
          byName.put(field.getFieldName(), field);
15559
        }
15560
      }
15561
 
15562
      /**
15563
       * Find the _Fields constant that matches fieldId, or null if its not found.
15564
       */
15565
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 15566
        switch(fieldId) {
15567
          case 1: // COUPON_CODE
15568
            return COUPON_CODE;
15569
          default:
15570
            return null;
15571
        }
3385 varun.gupt 15572
      }
15573
 
15574
      /**
15575
       * Find the _Fields constant that matches fieldId, throwing an exception
15576
       * if it is not found.
15577
       */
15578
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15579
        _Fields fields = findByThriftId(fieldId);
15580
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15581
        return fields;
15582
      }
15583
 
15584
      /**
15585
       * Find the _Fields constant that matches name, or null if its not found.
15586
       */
15587
      public static _Fields findByName(String name) {
15588
        return byName.get(name);
15589
      }
15590
 
15591
      private final short _thriftId;
15592
      private final String _fieldName;
15593
 
15594
      _Fields(short thriftId, String fieldName) {
15595
        _thriftId = thriftId;
15596
        _fieldName = fieldName;
15597
      }
15598
 
15599
      public short getThriftFieldId() {
15600
        return _thriftId;
15601
      }
15602
 
15603
      public String getFieldName() {
15604
        return _fieldName;
15605
      }
15606
    }
15607
 
15608
    // isset id assignments
15609
 
3430 rajveer 15610
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 15611
    static {
3430 rajveer 15612
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15613
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15614
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
15615
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15616
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_args.class, metaDataMap);
3385 varun.gupt 15617
    }
15618
 
15619
    public getSuccessfulPaymentCountForCoupon_args() {
15620
    }
15621
 
15622
    public getSuccessfulPaymentCountForCoupon_args(
15623
      String couponCode)
15624
    {
15625
      this();
15626
      this.couponCode = couponCode;
15627
    }
15628
 
15629
    /**
15630
     * Performs a deep copy on <i>other</i>.
15631
     */
15632
    public getSuccessfulPaymentCountForCoupon_args(getSuccessfulPaymentCountForCoupon_args other) {
15633
      if (other.isSetCouponCode()) {
15634
        this.couponCode = other.couponCode;
15635
      }
15636
    }
15637
 
15638
    public getSuccessfulPaymentCountForCoupon_args deepCopy() {
15639
      return new getSuccessfulPaymentCountForCoupon_args(this);
15640
    }
15641
 
3430 rajveer 15642
    @Override
15643
    public void clear() {
15644
      this.couponCode = null;
3385 varun.gupt 15645
    }
15646
 
15647
    public String getCouponCode() {
15648
      return this.couponCode;
15649
    }
15650
 
3430 rajveer 15651
    public void setCouponCode(String couponCode) {
3385 varun.gupt 15652
      this.couponCode = couponCode;
15653
    }
15654
 
15655
    public void unsetCouponCode() {
15656
      this.couponCode = null;
15657
    }
15658
 
3430 rajveer 15659
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3385 varun.gupt 15660
    public boolean isSetCouponCode() {
15661
      return this.couponCode != null;
15662
    }
15663
 
15664
    public void setCouponCodeIsSet(boolean value) {
15665
      if (!value) {
15666
        this.couponCode = null;
15667
      }
15668
    }
15669
 
15670
    public void setFieldValue(_Fields field, Object value) {
15671
      switch (field) {
15672
      case COUPON_CODE:
15673
        if (value == null) {
15674
          unsetCouponCode();
15675
        } else {
15676
          setCouponCode((String)value);
15677
        }
15678
        break;
15679
 
15680
      }
15681
    }
15682
 
15683
    public Object getFieldValue(_Fields field) {
15684
      switch (field) {
15685
      case COUPON_CODE:
15686
        return getCouponCode();
15687
 
15688
      }
15689
      throw new IllegalStateException();
15690
    }
15691
 
3430 rajveer 15692
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15693
    public boolean isSet(_Fields field) {
15694
      if (field == null) {
15695
        throw new IllegalArgumentException();
15696
      }
3385 varun.gupt 15697
 
15698
      switch (field) {
15699
      case COUPON_CODE:
15700
        return isSetCouponCode();
15701
      }
15702
      throw new IllegalStateException();
15703
    }
15704
 
15705
    @Override
15706
    public boolean equals(Object that) {
15707
      if (that == null)
15708
        return false;
15709
      if (that instanceof getSuccessfulPaymentCountForCoupon_args)
15710
        return this.equals((getSuccessfulPaymentCountForCoupon_args)that);
15711
      return false;
15712
    }
15713
 
15714
    public boolean equals(getSuccessfulPaymentCountForCoupon_args that) {
15715
      if (that == null)
15716
        return false;
15717
 
15718
      boolean this_present_couponCode = true && this.isSetCouponCode();
15719
      boolean that_present_couponCode = true && that.isSetCouponCode();
15720
      if (this_present_couponCode || that_present_couponCode) {
15721
        if (!(this_present_couponCode && that_present_couponCode))
15722
          return false;
15723
        if (!this.couponCode.equals(that.couponCode))
15724
          return false;
15725
      }
15726
 
15727
      return true;
15728
    }
15729
 
15730
    @Override
15731
    public int hashCode() {
15732
      return 0;
15733
    }
15734
 
15735
    public int compareTo(getSuccessfulPaymentCountForCoupon_args other) {
15736
      if (!getClass().equals(other.getClass())) {
15737
        return getClass().getName().compareTo(other.getClass().getName());
15738
      }
15739
 
15740
      int lastComparison = 0;
15741
      getSuccessfulPaymentCountForCoupon_args typedOther = (getSuccessfulPaymentCountForCoupon_args)other;
15742
 
3430 rajveer 15743
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3385 varun.gupt 15744
      if (lastComparison != 0) {
15745
        return lastComparison;
15746
      }
3430 rajveer 15747
      if (isSetCouponCode()) {
15748
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
15749
        if (lastComparison != 0) {
15750
          return lastComparison;
15751
        }
3385 varun.gupt 15752
      }
15753
      return 0;
15754
    }
15755
 
3430 rajveer 15756
    public _Fields fieldForId(int fieldId) {
15757
      return _Fields.findByThriftId(fieldId);
15758
    }
15759
 
15760
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15761
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 15762
      iprot.readStructBegin();
15763
      while (true)
15764
      {
15765
        field = iprot.readFieldBegin();
3430 rajveer 15766
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 15767
          break;
15768
        }
3430 rajveer 15769
        switch (field.id) {
15770
          case 1: // COUPON_CODE
15771
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
15772
              this.couponCode = iprot.readString();
15773
            } else { 
15774
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15775
            }
15776
            break;
15777
          default:
15778
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 15779
        }
3430 rajveer 15780
        iprot.readFieldEnd();
3385 varun.gupt 15781
      }
15782
      iprot.readStructEnd();
15783
      validate();
15784
    }
15785
 
3430 rajveer 15786
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 15787
      validate();
15788
 
15789
      oprot.writeStructBegin(STRUCT_DESC);
15790
      if (this.couponCode != null) {
15791
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
15792
        oprot.writeString(this.couponCode);
15793
        oprot.writeFieldEnd();
15794
      }
15795
      oprot.writeFieldStop();
15796
      oprot.writeStructEnd();
15797
    }
15798
 
15799
    @Override
15800
    public String toString() {
15801
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_args(");
15802
      boolean first = true;
15803
 
15804
      sb.append("couponCode:");
15805
      if (this.couponCode == null) {
15806
        sb.append("null");
15807
      } else {
15808
        sb.append(this.couponCode);
15809
      }
15810
      first = false;
15811
      sb.append(")");
15812
      return sb.toString();
15813
    }
15814
 
3430 rajveer 15815
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 15816
      // check for required fields
15817
    }
15818
 
3430 rajveer 15819
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15820
      try {
15821
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15822
      } catch (org.apache.thrift.TException te) {
15823
        throw new java.io.IOException(te);
15824
      }
15825
    }
15826
 
15827
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15828
      try {
15829
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15830
      } catch (org.apache.thrift.TException te) {
15831
        throw new java.io.IOException(te);
15832
      }
15833
    }
15834
 
3385 varun.gupt 15835
  }
15836
 
3430 rajveer 15837
  public static class getSuccessfulPaymentCountForCoupon_result implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_result, getSuccessfulPaymentCountForCoupon_result._Fields>, java.io.Serializable, Cloneable   {
15838
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_result");
3385 varun.gupt 15839
 
3430 rajveer 15840
    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);
15841
    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 15842
 
3430 rajveer 15843
    private long success; // required
15844
    private PromotionException pex; // required
3385 varun.gupt 15845
 
15846
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 15847
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 15848
      SUCCESS((short)0, "success"),
15849
      PEX((short)1, "pex");
15850
 
15851
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15852
 
15853
      static {
15854
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15855
          byName.put(field.getFieldName(), field);
15856
        }
15857
      }
15858
 
15859
      /**
15860
       * Find the _Fields constant that matches fieldId, or null if its not found.
15861
       */
15862
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 15863
        switch(fieldId) {
15864
          case 0: // SUCCESS
15865
            return SUCCESS;
15866
          case 1: // PEX
15867
            return PEX;
15868
          default:
15869
            return null;
15870
        }
3385 varun.gupt 15871
      }
15872
 
15873
      /**
15874
       * Find the _Fields constant that matches fieldId, throwing an exception
15875
       * if it is not found.
15876
       */
15877
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15878
        _Fields fields = findByThriftId(fieldId);
15879
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15880
        return fields;
15881
      }
15882
 
15883
      /**
15884
       * Find the _Fields constant that matches name, or null if its not found.
15885
       */
15886
      public static _Fields findByName(String name) {
15887
        return byName.get(name);
15888
      }
15889
 
15890
      private final short _thriftId;
15891
      private final String _fieldName;
15892
 
15893
      _Fields(short thriftId, String fieldName) {
15894
        _thriftId = thriftId;
15895
        _fieldName = fieldName;
15896
      }
15897
 
15898
      public short getThriftFieldId() {
15899
        return _thriftId;
15900
      }
15901
 
15902
      public String getFieldName() {
15903
        return _fieldName;
15904
      }
15905
    }
15906
 
15907
    // isset id assignments
15908
    private static final int __SUCCESS_ISSET_ID = 0;
15909
    private BitSet __isset_bit_vector = new BitSet(1);
15910
 
3430 rajveer 15911
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 15912
    static {
3430 rajveer 15913
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15914
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15915
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
15916
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15917
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
15918
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15919
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_result.class, metaDataMap);
3385 varun.gupt 15920
    }
15921
 
15922
    public getSuccessfulPaymentCountForCoupon_result() {
15923
    }
15924
 
15925
    public getSuccessfulPaymentCountForCoupon_result(
15926
      long success,
15927
      PromotionException pex)
15928
    {
15929
      this();
15930
      this.success = success;
15931
      setSuccessIsSet(true);
15932
      this.pex = pex;
15933
    }
15934
 
15935
    /**
15936
     * Performs a deep copy on <i>other</i>.
15937
     */
15938
    public getSuccessfulPaymentCountForCoupon_result(getSuccessfulPaymentCountForCoupon_result other) {
15939
      __isset_bit_vector.clear();
15940
      __isset_bit_vector.or(other.__isset_bit_vector);
15941
      this.success = other.success;
15942
      if (other.isSetPex()) {
15943
        this.pex = new PromotionException(other.pex);
15944
      }
15945
    }
15946
 
15947
    public getSuccessfulPaymentCountForCoupon_result deepCopy() {
15948
      return new getSuccessfulPaymentCountForCoupon_result(this);
15949
    }
15950
 
3430 rajveer 15951
    @Override
15952
    public void clear() {
15953
      setSuccessIsSet(false);
15954
      this.success = 0;
15955
      this.pex = null;
3385 varun.gupt 15956
    }
15957
 
15958
    public long getSuccess() {
15959
      return this.success;
15960
    }
15961
 
3430 rajveer 15962
    public void setSuccess(long success) {
3385 varun.gupt 15963
      this.success = success;
15964
      setSuccessIsSet(true);
15965
    }
15966
 
15967
    public void unsetSuccess() {
15968
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
15969
    }
15970
 
3430 rajveer 15971
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 15972
    public boolean isSetSuccess() {
15973
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
15974
    }
15975
 
15976
    public void setSuccessIsSet(boolean value) {
15977
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
15978
    }
15979
 
15980
    public PromotionException getPex() {
15981
      return this.pex;
15982
    }
15983
 
3430 rajveer 15984
    public void setPex(PromotionException pex) {
3385 varun.gupt 15985
      this.pex = pex;
15986
    }
15987
 
15988
    public void unsetPex() {
15989
      this.pex = null;
15990
    }
15991
 
3430 rajveer 15992
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 15993
    public boolean isSetPex() {
15994
      return this.pex != null;
15995
    }
15996
 
15997
    public void setPexIsSet(boolean value) {
15998
      if (!value) {
15999
        this.pex = null;
16000
      }
16001
    }
16002
 
16003
    public void setFieldValue(_Fields field, Object value) {
16004
      switch (field) {
16005
      case SUCCESS:
16006
        if (value == null) {
16007
          unsetSuccess();
16008
        } else {
16009
          setSuccess((Long)value);
16010
        }
16011
        break;
16012
 
16013
      case PEX:
16014
        if (value == null) {
16015
          unsetPex();
16016
        } else {
16017
          setPex((PromotionException)value);
16018
        }
16019
        break;
16020
 
16021
      }
16022
    }
16023
 
16024
    public Object getFieldValue(_Fields field) {
16025
      switch (field) {
16026
      case SUCCESS:
3430 rajveer 16027
        return Long.valueOf(getSuccess());
3385 varun.gupt 16028
 
16029
      case PEX:
16030
        return getPex();
16031
 
16032
      }
16033
      throw new IllegalStateException();
16034
    }
16035
 
3430 rajveer 16036
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16037
    public boolean isSet(_Fields field) {
16038
      if (field == null) {
16039
        throw new IllegalArgumentException();
16040
      }
3385 varun.gupt 16041
 
16042
      switch (field) {
16043
      case SUCCESS:
16044
        return isSetSuccess();
16045
      case PEX:
16046
        return isSetPex();
16047
      }
16048
      throw new IllegalStateException();
16049
    }
16050
 
16051
    @Override
16052
    public boolean equals(Object that) {
16053
      if (that == null)
16054
        return false;
16055
      if (that instanceof getSuccessfulPaymentCountForCoupon_result)
16056
        return this.equals((getSuccessfulPaymentCountForCoupon_result)that);
16057
      return false;
16058
    }
16059
 
16060
    public boolean equals(getSuccessfulPaymentCountForCoupon_result that) {
16061
      if (that == null)
16062
        return false;
16063
 
16064
      boolean this_present_success = true;
16065
      boolean that_present_success = true;
16066
      if (this_present_success || that_present_success) {
16067
        if (!(this_present_success && that_present_success))
16068
          return false;
16069
        if (this.success != that.success)
16070
          return false;
16071
      }
16072
 
16073
      boolean this_present_pex = true && this.isSetPex();
16074
      boolean that_present_pex = true && that.isSetPex();
16075
      if (this_present_pex || that_present_pex) {
16076
        if (!(this_present_pex && that_present_pex))
16077
          return false;
16078
        if (!this.pex.equals(that.pex))
16079
          return false;
16080
      }
16081
 
16082
      return true;
16083
    }
16084
 
16085
    @Override
16086
    public int hashCode() {
16087
      return 0;
16088
    }
16089
 
16090
    public int compareTo(getSuccessfulPaymentCountForCoupon_result other) {
16091
      if (!getClass().equals(other.getClass())) {
16092
        return getClass().getName().compareTo(other.getClass().getName());
16093
      }
16094
 
16095
      int lastComparison = 0;
16096
      getSuccessfulPaymentCountForCoupon_result typedOther = (getSuccessfulPaymentCountForCoupon_result)other;
16097
 
3430 rajveer 16098
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 16099
      if (lastComparison != 0) {
16100
        return lastComparison;
16101
      }
3430 rajveer 16102
      if (isSetSuccess()) {
16103
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
16104
        if (lastComparison != 0) {
16105
          return lastComparison;
16106
        }
3385 varun.gupt 16107
      }
3430 rajveer 16108
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 16109
      if (lastComparison != 0) {
16110
        return lastComparison;
16111
      }
3430 rajveer 16112
      if (isSetPex()) {
16113
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
16114
        if (lastComparison != 0) {
16115
          return lastComparison;
16116
        }
3385 varun.gupt 16117
      }
16118
      return 0;
16119
    }
16120
 
3430 rajveer 16121
    public _Fields fieldForId(int fieldId) {
16122
      return _Fields.findByThriftId(fieldId);
16123
    }
16124
 
16125
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16126
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 16127
      iprot.readStructBegin();
16128
      while (true)
16129
      {
16130
        field = iprot.readFieldBegin();
3430 rajveer 16131
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 16132
          break;
16133
        }
3430 rajveer 16134
        switch (field.id) {
16135
          case 0: // SUCCESS
16136
            if (field.type == org.apache.thrift.protocol.TType.I64) {
16137
              this.success = iprot.readI64();
16138
              setSuccessIsSet(true);
16139
            } else { 
16140
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16141
            }
16142
            break;
16143
          case 1: // PEX
16144
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
16145
              this.pex = new PromotionException();
16146
              this.pex.read(iprot);
16147
            } else { 
16148
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16149
            }
16150
            break;
16151
          default:
16152
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 16153
        }
3430 rajveer 16154
        iprot.readFieldEnd();
3385 varun.gupt 16155
      }
16156
      iprot.readStructEnd();
16157
      validate();
16158
    }
16159
 
3430 rajveer 16160
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 16161
      oprot.writeStructBegin(STRUCT_DESC);
16162
 
16163
      if (this.isSetSuccess()) {
16164
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
16165
        oprot.writeI64(this.success);
16166
        oprot.writeFieldEnd();
16167
      } else if (this.isSetPex()) {
16168
        oprot.writeFieldBegin(PEX_FIELD_DESC);
16169
        this.pex.write(oprot);
16170
        oprot.writeFieldEnd();
16171
      }
16172
      oprot.writeFieldStop();
16173
      oprot.writeStructEnd();
16174
    }
16175
 
16176
    @Override
16177
    public String toString() {
16178
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_result(");
16179
      boolean first = true;
16180
 
16181
      sb.append("success:");
16182
      sb.append(this.success);
16183
      first = false;
16184
      if (!first) sb.append(", ");
16185
      sb.append("pex:");
16186
      if (this.pex == null) {
16187
        sb.append("null");
16188
      } else {
16189
        sb.append(this.pex);
16190
      }
16191
      first = false;
16192
      sb.append(")");
16193
      return sb.toString();
16194
    }
16195
 
3430 rajveer 16196
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 16197
      // check for required fields
16198
    }
16199
 
3430 rajveer 16200
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16201
      try {
16202
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16203
      } catch (org.apache.thrift.TException te) {
16204
        throw new java.io.IOException(te);
16205
      }
16206
    }
16207
 
16208
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16209
      try {
16210
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16211
      } catch (org.apache.thrift.TException te) {
16212
        throw new java.io.IOException(te);
16213
      }
16214
    }
16215
 
3385 varun.gupt 16216
  }
16217
 
3430 rajveer 16218
  public static class getRuleDocString_args implements org.apache.thrift.TBase<getRuleDocString_args, getRuleDocString_args._Fields>, java.io.Serializable, Cloneable   {
16219
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_args");
3385 varun.gupt 16220
 
3430 rajveer 16221
    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 16222
 
3430 rajveer 16223
    private String ruleName; // required
3385 varun.gupt 16224
 
16225
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 16226
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 16227
      RULE_NAME((short)1, "ruleName");
16228
 
16229
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16230
 
16231
      static {
16232
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16233
          byName.put(field.getFieldName(), field);
16234
        }
16235
      }
16236
 
16237
      /**
16238
       * Find the _Fields constant that matches fieldId, or null if its not found.
16239
       */
16240
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 16241
        switch(fieldId) {
16242
          case 1: // RULE_NAME
16243
            return RULE_NAME;
16244
          default:
16245
            return null;
16246
        }
3385 varun.gupt 16247
      }
16248
 
16249
      /**
16250
       * Find the _Fields constant that matches fieldId, throwing an exception
16251
       * if it is not found.
16252
       */
16253
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16254
        _Fields fields = findByThriftId(fieldId);
16255
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16256
        return fields;
16257
      }
16258
 
16259
      /**
16260
       * Find the _Fields constant that matches name, or null if its not found.
16261
       */
16262
      public static _Fields findByName(String name) {
16263
        return byName.get(name);
16264
      }
16265
 
16266
      private final short _thriftId;
16267
      private final String _fieldName;
16268
 
16269
      _Fields(short thriftId, String fieldName) {
16270
        _thriftId = thriftId;
16271
        _fieldName = fieldName;
16272
      }
16273
 
16274
      public short getThriftFieldId() {
16275
        return _thriftId;
16276
      }
16277
 
16278
      public String getFieldName() {
16279
        return _fieldName;
16280
      }
16281
    }
16282
 
16283
    // isset id assignments
16284
 
3430 rajveer 16285
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 16286
    static {
3430 rajveer 16287
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16288
      tmpMap.put(_Fields.RULE_NAME, new org.apache.thrift.meta_data.FieldMetaData("ruleName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16289
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
16290
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16291
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_args.class, metaDataMap);
3385 varun.gupt 16292
    }
16293
 
16294
    public getRuleDocString_args() {
16295
    }
16296
 
16297
    public getRuleDocString_args(
16298
      String ruleName)
16299
    {
16300
      this();
16301
      this.ruleName = ruleName;
16302
    }
16303
 
16304
    /**
16305
     * Performs a deep copy on <i>other</i>.
16306
     */
16307
    public getRuleDocString_args(getRuleDocString_args other) {
16308
      if (other.isSetRuleName()) {
16309
        this.ruleName = other.ruleName;
16310
      }
16311
    }
16312
 
16313
    public getRuleDocString_args deepCopy() {
16314
      return new getRuleDocString_args(this);
16315
    }
16316
 
3430 rajveer 16317
    @Override
16318
    public void clear() {
16319
      this.ruleName = null;
3385 varun.gupt 16320
    }
16321
 
16322
    public String getRuleName() {
16323
      return this.ruleName;
16324
    }
16325
 
3430 rajveer 16326
    public void setRuleName(String ruleName) {
3385 varun.gupt 16327
      this.ruleName = ruleName;
16328
    }
16329
 
16330
    public void unsetRuleName() {
16331
      this.ruleName = null;
16332
    }
16333
 
3430 rajveer 16334
    /** Returns true if field ruleName is set (has been assigned a value) and false otherwise */
3385 varun.gupt 16335
    public boolean isSetRuleName() {
16336
      return this.ruleName != null;
16337
    }
16338
 
16339
    public void setRuleNameIsSet(boolean value) {
16340
      if (!value) {
16341
        this.ruleName = null;
16342
      }
16343
    }
16344
 
16345
    public void setFieldValue(_Fields field, Object value) {
16346
      switch (field) {
16347
      case RULE_NAME:
16348
        if (value == null) {
16349
          unsetRuleName();
16350
        } else {
16351
          setRuleName((String)value);
16352
        }
16353
        break;
16354
 
16355
      }
16356
    }
16357
 
16358
    public Object getFieldValue(_Fields field) {
16359
      switch (field) {
16360
      case RULE_NAME:
16361
        return getRuleName();
16362
 
16363
      }
16364
      throw new IllegalStateException();
16365
    }
16366
 
3430 rajveer 16367
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16368
    public boolean isSet(_Fields field) {
16369
      if (field == null) {
16370
        throw new IllegalArgumentException();
16371
      }
3385 varun.gupt 16372
 
16373
      switch (field) {
16374
      case RULE_NAME:
16375
        return isSetRuleName();
16376
      }
16377
      throw new IllegalStateException();
16378
    }
16379
 
16380
    @Override
16381
    public boolean equals(Object that) {
16382
      if (that == null)
16383
        return false;
16384
      if (that instanceof getRuleDocString_args)
16385
        return this.equals((getRuleDocString_args)that);
16386
      return false;
16387
    }
16388
 
16389
    public boolean equals(getRuleDocString_args that) {
16390
      if (that == null)
16391
        return false;
16392
 
16393
      boolean this_present_ruleName = true && this.isSetRuleName();
16394
      boolean that_present_ruleName = true && that.isSetRuleName();
16395
      if (this_present_ruleName || that_present_ruleName) {
16396
        if (!(this_present_ruleName && that_present_ruleName))
16397
          return false;
16398
        if (!this.ruleName.equals(that.ruleName))
16399
          return false;
16400
      }
16401
 
16402
      return true;
16403
    }
16404
 
16405
    @Override
16406
    public int hashCode() {
16407
      return 0;
16408
    }
16409
 
16410
    public int compareTo(getRuleDocString_args other) {
16411
      if (!getClass().equals(other.getClass())) {
16412
        return getClass().getName().compareTo(other.getClass().getName());
16413
      }
16414
 
16415
      int lastComparison = 0;
16416
      getRuleDocString_args typedOther = (getRuleDocString_args)other;
16417
 
3430 rajveer 16418
      lastComparison = Boolean.valueOf(isSetRuleName()).compareTo(typedOther.isSetRuleName());
3385 varun.gupt 16419
      if (lastComparison != 0) {
16420
        return lastComparison;
16421
      }
3430 rajveer 16422
      if (isSetRuleName()) {
16423
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleName, typedOther.ruleName);
16424
        if (lastComparison != 0) {
16425
          return lastComparison;
16426
        }
3385 varun.gupt 16427
      }
16428
      return 0;
16429
    }
16430
 
3430 rajveer 16431
    public _Fields fieldForId(int fieldId) {
16432
      return _Fields.findByThriftId(fieldId);
16433
    }
16434
 
16435
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16436
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 16437
      iprot.readStructBegin();
16438
      while (true)
16439
      {
16440
        field = iprot.readFieldBegin();
3430 rajveer 16441
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 16442
          break;
16443
        }
3430 rajveer 16444
        switch (field.id) {
16445
          case 1: // RULE_NAME
16446
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
16447
              this.ruleName = iprot.readString();
16448
            } else { 
16449
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16450
            }
16451
            break;
16452
          default:
16453
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 16454
        }
3430 rajveer 16455
        iprot.readFieldEnd();
3385 varun.gupt 16456
      }
16457
      iprot.readStructEnd();
16458
      validate();
16459
    }
16460
 
3430 rajveer 16461
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 16462
      validate();
16463
 
16464
      oprot.writeStructBegin(STRUCT_DESC);
16465
      if (this.ruleName != null) {
16466
        oprot.writeFieldBegin(RULE_NAME_FIELD_DESC);
16467
        oprot.writeString(this.ruleName);
16468
        oprot.writeFieldEnd();
16469
      }
16470
      oprot.writeFieldStop();
16471
      oprot.writeStructEnd();
16472
    }
16473
 
16474
    @Override
16475
    public String toString() {
16476
      StringBuilder sb = new StringBuilder("getRuleDocString_args(");
16477
      boolean first = true;
16478
 
16479
      sb.append("ruleName:");
16480
      if (this.ruleName == null) {
16481
        sb.append("null");
16482
      } else {
16483
        sb.append(this.ruleName);
16484
      }
16485
      first = false;
16486
      sb.append(")");
16487
      return sb.toString();
16488
    }
16489
 
3430 rajveer 16490
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 16491
      // check for required fields
16492
    }
16493
 
3430 rajveer 16494
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16495
      try {
16496
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16497
      } catch (org.apache.thrift.TException te) {
16498
        throw new java.io.IOException(te);
16499
      }
16500
    }
16501
 
16502
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16503
      try {
16504
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16505
      } catch (org.apache.thrift.TException te) {
16506
        throw new java.io.IOException(te);
16507
      }
16508
    }
16509
 
3385 varun.gupt 16510
  }
16511
 
3430 rajveer 16512
  public static class getRuleDocString_result implements org.apache.thrift.TBase<getRuleDocString_result, getRuleDocString_result._Fields>, java.io.Serializable, Cloneable   {
16513
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_result");
3385 varun.gupt 16514
 
3430 rajveer 16515
    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 16516
 
3430 rajveer 16517
    private String success; // required
3385 varun.gupt 16518
 
16519
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 16520
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 16521
      SUCCESS((short)0, "success");
16522
 
16523
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16524
 
16525
      static {
16526
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16527
          byName.put(field.getFieldName(), field);
16528
        }
16529
      }
16530
 
16531
      /**
16532
       * Find the _Fields constant that matches fieldId, or null if its not found.
16533
       */
16534
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 16535
        switch(fieldId) {
16536
          case 0: // SUCCESS
16537
            return SUCCESS;
16538
          default:
16539
            return null;
16540
        }
3385 varun.gupt 16541
      }
16542
 
16543
      /**
16544
       * Find the _Fields constant that matches fieldId, throwing an exception
16545
       * if it is not found.
16546
       */
16547
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16548
        _Fields fields = findByThriftId(fieldId);
16549
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16550
        return fields;
16551
      }
16552
 
16553
      /**
16554
       * Find the _Fields constant that matches name, or null if its not found.
16555
       */
16556
      public static _Fields findByName(String name) {
16557
        return byName.get(name);
16558
      }
16559
 
16560
      private final short _thriftId;
16561
      private final String _fieldName;
16562
 
16563
      _Fields(short thriftId, String fieldName) {
16564
        _thriftId = thriftId;
16565
        _fieldName = fieldName;
16566
      }
16567
 
16568
      public short getThriftFieldId() {
16569
        return _thriftId;
16570
      }
16571
 
16572
      public String getFieldName() {
16573
        return _fieldName;
16574
      }
16575
    }
16576
 
16577
    // isset id assignments
16578
 
3430 rajveer 16579
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 16580
    static {
3430 rajveer 16581
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16582
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16583
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
16584
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16585
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_result.class, metaDataMap);
3385 varun.gupt 16586
    }
16587
 
16588
    public getRuleDocString_result() {
16589
    }
16590
 
16591
    public getRuleDocString_result(
16592
      String success)
16593
    {
16594
      this();
16595
      this.success = success;
16596
    }
16597
 
16598
    /**
16599
     * Performs a deep copy on <i>other</i>.
16600
     */
16601
    public getRuleDocString_result(getRuleDocString_result other) {
16602
      if (other.isSetSuccess()) {
16603
        this.success = other.success;
16604
      }
16605
    }
16606
 
16607
    public getRuleDocString_result deepCopy() {
16608
      return new getRuleDocString_result(this);
16609
    }
16610
 
3430 rajveer 16611
    @Override
16612
    public void clear() {
16613
      this.success = null;
3385 varun.gupt 16614
    }
16615
 
16616
    public String getSuccess() {
16617
      return this.success;
16618
    }
16619
 
3430 rajveer 16620
    public void setSuccess(String success) {
3385 varun.gupt 16621
      this.success = success;
16622
    }
16623
 
16624
    public void unsetSuccess() {
16625
      this.success = null;
16626
    }
16627
 
3430 rajveer 16628
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 16629
    public boolean isSetSuccess() {
16630
      return this.success != null;
16631
    }
16632
 
16633
    public void setSuccessIsSet(boolean value) {
16634
      if (!value) {
16635
        this.success = null;
16636
      }
16637
    }
16638
 
16639
    public void setFieldValue(_Fields field, Object value) {
16640
      switch (field) {
16641
      case SUCCESS:
16642
        if (value == null) {
16643
          unsetSuccess();
16644
        } else {
16645
          setSuccess((String)value);
16646
        }
16647
        break;
16648
 
16649
      }
16650
    }
16651
 
16652
    public Object getFieldValue(_Fields field) {
16653
      switch (field) {
16654
      case SUCCESS:
16655
        return getSuccess();
16656
 
16657
      }
16658
      throw new IllegalStateException();
16659
    }
16660
 
3430 rajveer 16661
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16662
    public boolean isSet(_Fields field) {
16663
      if (field == null) {
16664
        throw new IllegalArgumentException();
16665
      }
3385 varun.gupt 16666
 
16667
      switch (field) {
16668
      case SUCCESS:
16669
        return isSetSuccess();
16670
      }
16671
      throw new IllegalStateException();
16672
    }
16673
 
16674
    @Override
16675
    public boolean equals(Object that) {
16676
      if (that == null)
16677
        return false;
16678
      if (that instanceof getRuleDocString_result)
16679
        return this.equals((getRuleDocString_result)that);
16680
      return false;
16681
    }
16682
 
16683
    public boolean equals(getRuleDocString_result that) {
16684
      if (that == null)
16685
        return false;
16686
 
16687
      boolean this_present_success = true && this.isSetSuccess();
16688
      boolean that_present_success = true && that.isSetSuccess();
16689
      if (this_present_success || that_present_success) {
16690
        if (!(this_present_success && that_present_success))
16691
          return false;
16692
        if (!this.success.equals(that.success))
16693
          return false;
16694
      }
16695
 
16696
      return true;
16697
    }
16698
 
16699
    @Override
16700
    public int hashCode() {
16701
      return 0;
16702
    }
16703
 
16704
    public int compareTo(getRuleDocString_result other) {
16705
      if (!getClass().equals(other.getClass())) {
16706
        return getClass().getName().compareTo(other.getClass().getName());
16707
      }
16708
 
16709
      int lastComparison = 0;
16710
      getRuleDocString_result typedOther = (getRuleDocString_result)other;
16711
 
3430 rajveer 16712
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 16713
      if (lastComparison != 0) {
16714
        return lastComparison;
16715
      }
3430 rajveer 16716
      if (isSetSuccess()) {
16717
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
16718
        if (lastComparison != 0) {
16719
          return lastComparison;
16720
        }
3385 varun.gupt 16721
      }
16722
      return 0;
16723
    }
16724
 
3430 rajveer 16725
    public _Fields fieldForId(int fieldId) {
16726
      return _Fields.findByThriftId(fieldId);
16727
    }
16728
 
16729
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16730
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 16731
      iprot.readStructBegin();
16732
      while (true)
16733
      {
16734
        field = iprot.readFieldBegin();
3430 rajveer 16735
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 16736
          break;
16737
        }
3430 rajveer 16738
        switch (field.id) {
16739
          case 0: // SUCCESS
16740
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
16741
              this.success = iprot.readString();
16742
            } else { 
16743
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16744
            }
16745
            break;
16746
          default:
16747
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 16748
        }
3430 rajveer 16749
        iprot.readFieldEnd();
3385 varun.gupt 16750
      }
16751
      iprot.readStructEnd();
16752
      validate();
16753
    }
16754
 
3430 rajveer 16755
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 16756
      oprot.writeStructBegin(STRUCT_DESC);
16757
 
16758
      if (this.isSetSuccess()) {
16759
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
16760
        oprot.writeString(this.success);
16761
        oprot.writeFieldEnd();
16762
      }
16763
      oprot.writeFieldStop();
16764
      oprot.writeStructEnd();
16765
    }
16766
 
16767
    @Override
16768
    public String toString() {
16769
      StringBuilder sb = new StringBuilder("getRuleDocString_result(");
16770
      boolean first = true;
16771
 
16772
      sb.append("success:");
16773
      if (this.success == null) {
16774
        sb.append("null");
16775
      } else {
16776
        sb.append(this.success);
16777
      }
16778
      first = false;
16779
      sb.append(")");
16780
      return sb.toString();
16781
    }
16782
 
3430 rajveer 16783
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 16784
      // check for required fields
16785
    }
16786
 
3430 rajveer 16787
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16788
      try {
16789
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16790
      } catch (org.apache.thrift.TException te) {
16791
        throw new java.io.IOException(te);
16792
      }
16793
    }
16794
 
16795
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16796
      try {
16797
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16798
      } catch (org.apache.thrift.TException te) {
16799
        throw new java.io.IOException(te);
16800
      }
16801
    }
16802
 
3385 varun.gupt 16803
  }
16804
 
4189 varun.gupt 16805
  public static class getItemDiscountMap_args implements org.apache.thrift.TBase<getItemDiscountMap_args, getItemDiscountMap_args._Fields>, java.io.Serializable, Cloneable   {
16806
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_args");
16807
 
16808
    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);
16809
 
16810
    private List<Long> itemIds; // required
16811
 
16812
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
16813
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
16814
      ITEM_IDS((short)1, "itemIds");
16815
 
16816
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16817
 
16818
      static {
16819
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16820
          byName.put(field.getFieldName(), field);
16821
        }
16822
      }
16823
 
16824
      /**
16825
       * Find the _Fields constant that matches fieldId, or null if its not found.
16826
       */
16827
      public static _Fields findByThriftId(int fieldId) {
16828
        switch(fieldId) {
16829
          case 1: // ITEM_IDS
16830
            return ITEM_IDS;
16831
          default:
16832
            return null;
16833
        }
16834
      }
16835
 
16836
      /**
16837
       * Find the _Fields constant that matches fieldId, throwing an exception
16838
       * if it is not found.
16839
       */
16840
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16841
        _Fields fields = findByThriftId(fieldId);
16842
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16843
        return fields;
16844
      }
16845
 
16846
      /**
16847
       * Find the _Fields constant that matches name, or null if its not found.
16848
       */
16849
      public static _Fields findByName(String name) {
16850
        return byName.get(name);
16851
      }
16852
 
16853
      private final short _thriftId;
16854
      private final String _fieldName;
16855
 
16856
      _Fields(short thriftId, String fieldName) {
16857
        _thriftId = thriftId;
16858
        _fieldName = fieldName;
16859
      }
16860
 
16861
      public short getThriftFieldId() {
16862
        return _thriftId;
16863
      }
16864
 
16865
      public String getFieldName() {
16866
        return _fieldName;
16867
      }
16868
    }
16869
 
16870
    // isset id assignments
16871
 
16872
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
16873
    static {
16874
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16875
      tmpMap.put(_Fields.ITEM_IDS, new org.apache.thrift.meta_data.FieldMetaData("itemIds", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16876
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
16877
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
16878
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16879
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_args.class, metaDataMap);
16880
    }
16881
 
16882
    public getItemDiscountMap_args() {
16883
    }
16884
 
16885
    public getItemDiscountMap_args(
16886
      List<Long> itemIds)
16887
    {
16888
      this();
16889
      this.itemIds = itemIds;
16890
    }
16891
 
16892
    /**
16893
     * Performs a deep copy on <i>other</i>.
16894
     */
16895
    public getItemDiscountMap_args(getItemDiscountMap_args other) {
16896
      if (other.isSetItemIds()) {
16897
        List<Long> __this__itemIds = new ArrayList<Long>();
16898
        for (Long other_element : other.itemIds) {
16899
          __this__itemIds.add(other_element);
16900
        }
16901
        this.itemIds = __this__itemIds;
16902
      }
16903
    }
16904
 
16905
    public getItemDiscountMap_args deepCopy() {
16906
      return new getItemDiscountMap_args(this);
16907
    }
16908
 
16909
    @Override
16910
    public void clear() {
16911
      this.itemIds = null;
16912
    }
16913
 
16914
    public int getItemIdsSize() {
16915
      return (this.itemIds == null) ? 0 : this.itemIds.size();
16916
    }
16917
 
16918
    public java.util.Iterator<Long> getItemIdsIterator() {
16919
      return (this.itemIds == null) ? null : this.itemIds.iterator();
16920
    }
16921
 
16922
    public void addToItemIds(long elem) {
16923
      if (this.itemIds == null) {
16924
        this.itemIds = new ArrayList<Long>();
16925
      }
16926
      this.itemIds.add(elem);
16927
    }
16928
 
16929
    public List<Long> getItemIds() {
16930
      return this.itemIds;
16931
    }
16932
 
16933
    public void setItemIds(List<Long> itemIds) {
16934
      this.itemIds = itemIds;
16935
    }
16936
 
16937
    public void unsetItemIds() {
16938
      this.itemIds = null;
16939
    }
16940
 
16941
    /** Returns true if field itemIds is set (has been assigned a value) and false otherwise */
16942
    public boolean isSetItemIds() {
16943
      return this.itemIds != null;
16944
    }
16945
 
16946
    public void setItemIdsIsSet(boolean value) {
16947
      if (!value) {
16948
        this.itemIds = null;
16949
      }
16950
    }
16951
 
16952
    public void setFieldValue(_Fields field, Object value) {
16953
      switch (field) {
16954
      case ITEM_IDS:
16955
        if (value == null) {
16956
          unsetItemIds();
16957
        } else {
16958
          setItemIds((List<Long>)value);
16959
        }
16960
        break;
16961
 
16962
      }
16963
    }
16964
 
16965
    public Object getFieldValue(_Fields field) {
16966
      switch (field) {
16967
      case ITEM_IDS:
16968
        return getItemIds();
16969
 
16970
      }
16971
      throw new IllegalStateException();
16972
    }
16973
 
16974
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16975
    public boolean isSet(_Fields field) {
16976
      if (field == null) {
16977
        throw new IllegalArgumentException();
16978
      }
16979
 
16980
      switch (field) {
16981
      case ITEM_IDS:
16982
        return isSetItemIds();
16983
      }
16984
      throw new IllegalStateException();
16985
    }
16986
 
16987
    @Override
16988
    public boolean equals(Object that) {
16989
      if (that == null)
16990
        return false;
16991
      if (that instanceof getItemDiscountMap_args)
16992
        return this.equals((getItemDiscountMap_args)that);
16993
      return false;
16994
    }
16995
 
16996
    public boolean equals(getItemDiscountMap_args that) {
16997
      if (that == null)
16998
        return false;
16999
 
17000
      boolean this_present_itemIds = true && this.isSetItemIds();
17001
      boolean that_present_itemIds = true && that.isSetItemIds();
17002
      if (this_present_itemIds || that_present_itemIds) {
17003
        if (!(this_present_itemIds && that_present_itemIds))
17004
          return false;
17005
        if (!this.itemIds.equals(that.itemIds))
17006
          return false;
17007
      }
17008
 
17009
      return true;
17010
    }
17011
 
17012
    @Override
17013
    public int hashCode() {
17014
      return 0;
17015
    }
17016
 
17017
    public int compareTo(getItemDiscountMap_args other) {
17018
      if (!getClass().equals(other.getClass())) {
17019
        return getClass().getName().compareTo(other.getClass().getName());
17020
      }
17021
 
17022
      int lastComparison = 0;
17023
      getItemDiscountMap_args typedOther = (getItemDiscountMap_args)other;
17024
 
17025
      lastComparison = Boolean.valueOf(isSetItemIds()).compareTo(typedOther.isSetItemIds());
17026
      if (lastComparison != 0) {
17027
        return lastComparison;
17028
      }
17029
      if (isSetItemIds()) {
17030
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemIds, typedOther.itemIds);
17031
        if (lastComparison != 0) {
17032
          return lastComparison;
17033
        }
17034
      }
17035
      return 0;
17036
    }
17037
 
17038
    public _Fields fieldForId(int fieldId) {
17039
      return _Fields.findByThriftId(fieldId);
17040
    }
17041
 
17042
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17043
      org.apache.thrift.protocol.TField field;
17044
      iprot.readStructBegin();
17045
      while (true)
17046
      {
17047
        field = iprot.readFieldBegin();
17048
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17049
          break;
17050
        }
17051
        switch (field.id) {
17052
          case 1: // ITEM_IDS
17053
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
17054
              {
11592 amit.gupta 17055
                org.apache.thrift.protocol.TList _list42 = iprot.readListBegin();
17056
                this.itemIds = new ArrayList<Long>(_list42.size);
17057
                for (int _i43 = 0; _i43 < _list42.size; ++_i43)
4189 varun.gupt 17058
                {
11592 amit.gupta 17059
                  long _elem44; // required
17060
                  _elem44 = iprot.readI64();
17061
                  this.itemIds.add(_elem44);
4189 varun.gupt 17062
                }
17063
                iprot.readListEnd();
17064
              }
17065
            } else { 
17066
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17067
            }
17068
            break;
17069
          default:
17070
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17071
        }
17072
        iprot.readFieldEnd();
17073
      }
17074
      iprot.readStructEnd();
17075
      validate();
17076
    }
17077
 
17078
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17079
      validate();
17080
 
17081
      oprot.writeStructBegin(STRUCT_DESC);
17082
      if (this.itemIds != null) {
17083
        oprot.writeFieldBegin(ITEM_IDS_FIELD_DESC);
17084
        {
17085
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.itemIds.size()));
11592 amit.gupta 17086
          for (long _iter45 : this.itemIds)
4189 varun.gupt 17087
          {
11592 amit.gupta 17088
            oprot.writeI64(_iter45);
4189 varun.gupt 17089
          }
17090
          oprot.writeListEnd();
17091
        }
17092
        oprot.writeFieldEnd();
17093
      }
17094
      oprot.writeFieldStop();
17095
      oprot.writeStructEnd();
17096
    }
17097
 
17098
    @Override
17099
    public String toString() {
17100
      StringBuilder sb = new StringBuilder("getItemDiscountMap_args(");
17101
      boolean first = true;
17102
 
17103
      sb.append("itemIds:");
17104
      if (this.itemIds == null) {
17105
        sb.append("null");
17106
      } else {
17107
        sb.append(this.itemIds);
17108
      }
17109
      first = false;
17110
      sb.append(")");
17111
      return sb.toString();
17112
    }
17113
 
17114
    public void validate() throws org.apache.thrift.TException {
17115
      // check for required fields
17116
    }
17117
 
17118
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17119
      try {
17120
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17121
      } catch (org.apache.thrift.TException te) {
17122
        throw new java.io.IOException(te);
17123
      }
17124
    }
17125
 
17126
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
17127
      try {
17128
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
17129
      } catch (org.apache.thrift.TException te) {
17130
        throw new java.io.IOException(te);
17131
      }
17132
    }
17133
 
17134
  }
17135
 
17136
  public static class getItemDiscountMap_result implements org.apache.thrift.TBase<getItemDiscountMap_result, getItemDiscountMap_result._Fields>, java.io.Serializable, Cloneable   {
17137
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_result");
17138
 
17139
    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);
17140
    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);
17141
 
17142
    private List<ItemCouponDiscount> success; // required
17143
    private PromotionException pex; // required
17144
 
17145
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
17146
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
17147
      SUCCESS((short)0, "success"),
17148
      PEX((short)1, "pex");
17149
 
17150
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
17151
 
17152
      static {
17153
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
17154
          byName.put(field.getFieldName(), field);
17155
        }
17156
      }
17157
 
17158
      /**
17159
       * Find the _Fields constant that matches fieldId, or null if its not found.
17160
       */
17161
      public static _Fields findByThriftId(int fieldId) {
17162
        switch(fieldId) {
17163
          case 0: // SUCCESS
17164
            return SUCCESS;
17165
          case 1: // PEX
17166
            return PEX;
17167
          default:
17168
            return null;
17169
        }
17170
      }
17171
 
17172
      /**
17173
       * Find the _Fields constant that matches fieldId, throwing an exception
17174
       * if it is not found.
17175
       */
17176
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17177
        _Fields fields = findByThriftId(fieldId);
17178
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17179
        return fields;
17180
      }
17181
 
17182
      /**
17183
       * Find the _Fields constant that matches name, or null if its not found.
17184
       */
17185
      public static _Fields findByName(String name) {
17186
        return byName.get(name);
17187
      }
17188
 
17189
      private final short _thriftId;
17190
      private final String _fieldName;
17191
 
17192
      _Fields(short thriftId, String fieldName) {
17193
        _thriftId = thriftId;
17194
        _fieldName = fieldName;
17195
      }
17196
 
17197
      public short getThriftFieldId() {
17198
        return _thriftId;
17199
      }
17200
 
17201
      public String getFieldName() {
17202
        return _fieldName;
17203
      }
17204
    }
17205
 
17206
    // isset id assignments
17207
 
17208
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
17209
    static {
17210
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
17211
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17212
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
17213
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ItemCouponDiscount.class))));
17214
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17215
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
17216
      metaDataMap = Collections.unmodifiableMap(tmpMap);
17217
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_result.class, metaDataMap);
17218
    }
17219
 
17220
    public getItemDiscountMap_result() {
17221
    }
17222
 
17223
    public getItemDiscountMap_result(
17224
      List<ItemCouponDiscount> success,
17225
      PromotionException pex)
17226
    {
17227
      this();
17228
      this.success = success;
17229
      this.pex = pex;
17230
    }
17231
 
17232
    /**
17233
     * Performs a deep copy on <i>other</i>.
17234
     */
17235
    public getItemDiscountMap_result(getItemDiscountMap_result other) {
17236
      if (other.isSetSuccess()) {
17237
        List<ItemCouponDiscount> __this__success = new ArrayList<ItemCouponDiscount>();
17238
        for (ItemCouponDiscount other_element : other.success) {
17239
          __this__success.add(new ItemCouponDiscount(other_element));
17240
        }
17241
        this.success = __this__success;
17242
      }
17243
      if (other.isSetPex()) {
17244
        this.pex = new PromotionException(other.pex);
17245
      }
17246
    }
17247
 
17248
    public getItemDiscountMap_result deepCopy() {
17249
      return new getItemDiscountMap_result(this);
17250
    }
17251
 
17252
    @Override
17253
    public void clear() {
17254
      this.success = null;
17255
      this.pex = null;
17256
    }
17257
 
17258
    public int getSuccessSize() {
17259
      return (this.success == null) ? 0 : this.success.size();
17260
    }
17261
 
17262
    public java.util.Iterator<ItemCouponDiscount> getSuccessIterator() {
17263
      return (this.success == null) ? null : this.success.iterator();
17264
    }
17265
 
17266
    public void addToSuccess(ItemCouponDiscount elem) {
17267
      if (this.success == null) {
17268
        this.success = new ArrayList<ItemCouponDiscount>();
17269
      }
17270
      this.success.add(elem);
17271
    }
17272
 
17273
    public List<ItemCouponDiscount> getSuccess() {
17274
      return this.success;
17275
    }
17276
 
17277
    public void setSuccess(List<ItemCouponDiscount> success) {
17278
      this.success = success;
17279
    }
17280
 
17281
    public void unsetSuccess() {
17282
      this.success = null;
17283
    }
17284
 
17285
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
17286
    public boolean isSetSuccess() {
17287
      return this.success != null;
17288
    }
17289
 
17290
    public void setSuccessIsSet(boolean value) {
17291
      if (!value) {
17292
        this.success = null;
17293
      }
17294
    }
17295
 
17296
    public PromotionException getPex() {
17297
      return this.pex;
17298
    }
17299
 
17300
    public void setPex(PromotionException pex) {
17301
      this.pex = pex;
17302
    }
17303
 
17304
    public void unsetPex() {
17305
      this.pex = null;
17306
    }
17307
 
17308
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
17309
    public boolean isSetPex() {
17310
      return this.pex != null;
17311
    }
17312
 
17313
    public void setPexIsSet(boolean value) {
17314
      if (!value) {
17315
        this.pex = null;
17316
      }
17317
    }
17318
 
17319
    public void setFieldValue(_Fields field, Object value) {
17320
      switch (field) {
17321
      case SUCCESS:
17322
        if (value == null) {
17323
          unsetSuccess();
17324
        } else {
17325
          setSuccess((List<ItemCouponDiscount>)value);
17326
        }
17327
        break;
17328
 
17329
      case PEX:
17330
        if (value == null) {
17331
          unsetPex();
17332
        } else {
17333
          setPex((PromotionException)value);
17334
        }
17335
        break;
17336
 
17337
      }
17338
    }
17339
 
17340
    public Object getFieldValue(_Fields field) {
17341
      switch (field) {
17342
      case SUCCESS:
17343
        return getSuccess();
17344
 
17345
      case PEX:
17346
        return getPex();
17347
 
17348
      }
17349
      throw new IllegalStateException();
17350
    }
17351
 
17352
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
17353
    public boolean isSet(_Fields field) {
17354
      if (field == null) {
17355
        throw new IllegalArgumentException();
17356
      }
17357
 
17358
      switch (field) {
17359
      case SUCCESS:
17360
        return isSetSuccess();
17361
      case PEX:
17362
        return isSetPex();
17363
      }
17364
      throw new IllegalStateException();
17365
    }
17366
 
17367
    @Override
17368
    public boolean equals(Object that) {
17369
      if (that == null)
17370
        return false;
17371
      if (that instanceof getItemDiscountMap_result)
17372
        return this.equals((getItemDiscountMap_result)that);
17373
      return false;
17374
    }
17375
 
17376
    public boolean equals(getItemDiscountMap_result that) {
17377
      if (that == null)
17378
        return false;
17379
 
17380
      boolean this_present_success = true && this.isSetSuccess();
17381
      boolean that_present_success = true && that.isSetSuccess();
17382
      if (this_present_success || that_present_success) {
17383
        if (!(this_present_success && that_present_success))
17384
          return false;
17385
        if (!this.success.equals(that.success))
17386
          return false;
17387
      }
17388
 
17389
      boolean this_present_pex = true && this.isSetPex();
17390
      boolean that_present_pex = true && that.isSetPex();
17391
      if (this_present_pex || that_present_pex) {
17392
        if (!(this_present_pex && that_present_pex))
17393
          return false;
17394
        if (!this.pex.equals(that.pex))
17395
          return false;
17396
      }
17397
 
17398
      return true;
17399
    }
17400
 
17401
    @Override
17402
    public int hashCode() {
17403
      return 0;
17404
    }
17405
 
17406
    public int compareTo(getItemDiscountMap_result other) {
17407
      if (!getClass().equals(other.getClass())) {
17408
        return getClass().getName().compareTo(other.getClass().getName());
17409
      }
17410
 
17411
      int lastComparison = 0;
17412
      getItemDiscountMap_result typedOther = (getItemDiscountMap_result)other;
17413
 
17414
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
17415
      if (lastComparison != 0) {
17416
        return lastComparison;
17417
      }
17418
      if (isSetSuccess()) {
17419
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
17420
        if (lastComparison != 0) {
17421
          return lastComparison;
17422
        }
17423
      }
17424
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
17425
      if (lastComparison != 0) {
17426
        return lastComparison;
17427
      }
17428
      if (isSetPex()) {
17429
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
17430
        if (lastComparison != 0) {
17431
          return lastComparison;
17432
        }
17433
      }
17434
      return 0;
17435
    }
17436
 
17437
    public _Fields fieldForId(int fieldId) {
17438
      return _Fields.findByThriftId(fieldId);
17439
    }
17440
 
17441
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17442
      org.apache.thrift.protocol.TField field;
17443
      iprot.readStructBegin();
17444
      while (true)
17445
      {
17446
        field = iprot.readFieldBegin();
17447
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17448
          break;
17449
        }
17450
        switch (field.id) {
17451
          case 0: // SUCCESS
17452
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
17453
              {
11592 amit.gupta 17454
                org.apache.thrift.protocol.TList _list46 = iprot.readListBegin();
17455
                this.success = new ArrayList<ItemCouponDiscount>(_list46.size);
17456
                for (int _i47 = 0; _i47 < _list46.size; ++_i47)
4189 varun.gupt 17457
                {
11592 amit.gupta 17458
                  ItemCouponDiscount _elem48; // required
17459
                  _elem48 = new ItemCouponDiscount();
17460
                  _elem48.read(iprot);
17461
                  this.success.add(_elem48);
4189 varun.gupt 17462
                }
17463
                iprot.readListEnd();
17464
              }
17465
            } else { 
17466
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17467
            }
17468
            break;
17469
          case 1: // PEX
17470
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
17471
              this.pex = new PromotionException();
17472
              this.pex.read(iprot);
17473
            } else { 
17474
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17475
            }
17476
            break;
17477
          default:
17478
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17479
        }
17480
        iprot.readFieldEnd();
17481
      }
17482
      iprot.readStructEnd();
17483
      validate();
17484
    }
17485
 
17486
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17487
      oprot.writeStructBegin(STRUCT_DESC);
17488
 
17489
      if (this.isSetSuccess()) {
17490
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
17491
        {
17492
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
11592 amit.gupta 17493
          for (ItemCouponDiscount _iter49 : this.success)
4189 varun.gupt 17494
          {
11592 amit.gupta 17495
            _iter49.write(oprot);
4189 varun.gupt 17496
          }
17497
          oprot.writeListEnd();
17498
        }
17499
        oprot.writeFieldEnd();
17500
      } else if (this.isSetPex()) {
17501
        oprot.writeFieldBegin(PEX_FIELD_DESC);
17502
        this.pex.write(oprot);
17503
        oprot.writeFieldEnd();
17504
      }
17505
      oprot.writeFieldStop();
17506
      oprot.writeStructEnd();
17507
    }
17508
 
17509
    @Override
17510
    public String toString() {
17511
      StringBuilder sb = new StringBuilder("getItemDiscountMap_result(");
17512
      boolean first = true;
17513
 
17514
      sb.append("success:");
17515
      if (this.success == null) {
17516
        sb.append("null");
17517
      } else {
17518
        sb.append(this.success);
17519
      }
17520
      first = false;
17521
      if (!first) sb.append(", ");
17522
      sb.append("pex:");
17523
      if (this.pex == null) {
17524
        sb.append("null");
17525
      } else {
17526
        sb.append(this.pex);
17527
      }
17528
      first = false;
17529
      sb.append(")");
17530
      return sb.toString();
17531
    }
17532
 
17533
    public void validate() throws org.apache.thrift.TException {
17534
      // check for required fields
17535
    }
17536
 
17537
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17538
      try {
17539
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17540
      } catch (org.apache.thrift.TException te) {
17541
        throw new java.io.IOException(te);
17542
      }
17543
    }
17544
 
17545
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
17546
      try {
17547
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
17548
      } catch (org.apache.thrift.TException te) {
17549
        throw new java.io.IOException(te);
17550
      }
17551
    }
17552
 
17553
  }
17554
 
4494 varun.gupt 17555
  public static class getDiscountsForEntity_args implements org.apache.thrift.TBase<getDiscountsForEntity_args, getDiscountsForEntity_args._Fields>, java.io.Serializable, Cloneable   {
17556
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_args");
17557
 
17558
    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);
17559
 
17560
    private long entityId; // required
17561
 
17562
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
17563
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
17564
      ENTITY_ID((short)1, "entityId");
17565
 
17566
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
17567
 
17568
      static {
17569
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
17570
          byName.put(field.getFieldName(), field);
17571
        }
17572
      }
17573
 
17574
      /**
17575
       * Find the _Fields constant that matches fieldId, or null if its not found.
17576
       */
17577
      public static _Fields findByThriftId(int fieldId) {
17578
        switch(fieldId) {
17579
          case 1: // ENTITY_ID
17580
            return ENTITY_ID;
17581
          default:
17582
            return null;
17583
        }
17584
      }
17585
 
17586
      /**
17587
       * Find the _Fields constant that matches fieldId, throwing an exception
17588
       * if it is not found.
17589
       */
17590
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17591
        _Fields fields = findByThriftId(fieldId);
17592
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17593
        return fields;
17594
      }
17595
 
17596
      /**
17597
       * Find the _Fields constant that matches name, or null if its not found.
17598
       */
17599
      public static _Fields findByName(String name) {
17600
        return byName.get(name);
17601
      }
17602
 
17603
      private final short _thriftId;
17604
      private final String _fieldName;
17605
 
17606
      _Fields(short thriftId, String fieldName) {
17607
        _thriftId = thriftId;
17608
        _fieldName = fieldName;
17609
      }
17610
 
17611
      public short getThriftFieldId() {
17612
        return _thriftId;
17613
      }
17614
 
17615
      public String getFieldName() {
17616
        return _fieldName;
17617
      }
17618
    }
17619
 
17620
    // isset id assignments
17621
    private static final int __ENTITYID_ISSET_ID = 0;
17622
    private BitSet __isset_bit_vector = new BitSet(1);
17623
 
17624
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
17625
    static {
17626
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
17627
      tmpMap.put(_Fields.ENTITY_ID, new org.apache.thrift.meta_data.FieldMetaData("entityId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17628
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
17629
      metaDataMap = Collections.unmodifiableMap(tmpMap);
17630
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_args.class, metaDataMap);
17631
    }
17632
 
17633
    public getDiscountsForEntity_args() {
17634
    }
17635
 
17636
    public getDiscountsForEntity_args(
17637
      long entityId)
17638
    {
17639
      this();
17640
      this.entityId = entityId;
17641
      setEntityIdIsSet(true);
17642
    }
17643
 
17644
    /**
17645
     * Performs a deep copy on <i>other</i>.
17646
     */
17647
    public getDiscountsForEntity_args(getDiscountsForEntity_args other) {
17648
      __isset_bit_vector.clear();
17649
      __isset_bit_vector.or(other.__isset_bit_vector);
17650
      this.entityId = other.entityId;
17651
    }
17652
 
17653
    public getDiscountsForEntity_args deepCopy() {
17654
      return new getDiscountsForEntity_args(this);
17655
    }
17656
 
17657
    @Override
17658
    public void clear() {
17659
      setEntityIdIsSet(false);
17660
      this.entityId = 0;
17661
    }
17662
 
17663
    public long getEntityId() {
17664
      return this.entityId;
17665
    }
17666
 
17667
    public void setEntityId(long entityId) {
17668
      this.entityId = entityId;
17669
      setEntityIdIsSet(true);
17670
    }
17671
 
17672
    public void unsetEntityId() {
17673
      __isset_bit_vector.clear(__ENTITYID_ISSET_ID);
17674
    }
17675
 
17676
    /** Returns true if field entityId is set (has been assigned a value) and false otherwise */
17677
    public boolean isSetEntityId() {
17678
      return __isset_bit_vector.get(__ENTITYID_ISSET_ID);
17679
    }
17680
 
17681
    public void setEntityIdIsSet(boolean value) {
17682
      __isset_bit_vector.set(__ENTITYID_ISSET_ID, value);
17683
    }
17684
 
17685
    public void setFieldValue(_Fields field, Object value) {
17686
      switch (field) {
17687
      case ENTITY_ID:
17688
        if (value == null) {
17689
          unsetEntityId();
17690
        } else {
17691
          setEntityId((Long)value);
17692
        }
17693
        break;
17694
 
17695
      }
17696
    }
17697
 
17698
    public Object getFieldValue(_Fields field) {
17699
      switch (field) {
17700
      case ENTITY_ID:
17701
        return Long.valueOf(getEntityId());
17702
 
17703
      }
17704
      throw new IllegalStateException();
17705
    }
17706
 
17707
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
17708
    public boolean isSet(_Fields field) {
17709
      if (field == null) {
17710
        throw new IllegalArgumentException();
17711
      }
17712
 
17713
      switch (field) {
17714
      case ENTITY_ID:
17715
        return isSetEntityId();
17716
      }
17717
      throw new IllegalStateException();
17718
    }
17719
 
17720
    @Override
17721
    public boolean equals(Object that) {
17722
      if (that == null)
17723
        return false;
17724
      if (that instanceof getDiscountsForEntity_args)
17725
        return this.equals((getDiscountsForEntity_args)that);
17726
      return false;
17727
    }
17728
 
17729
    public boolean equals(getDiscountsForEntity_args that) {
17730
      if (that == null)
17731
        return false;
17732
 
17733
      boolean this_present_entityId = true;
17734
      boolean that_present_entityId = true;
17735
      if (this_present_entityId || that_present_entityId) {
17736
        if (!(this_present_entityId && that_present_entityId))
17737
          return false;
17738
        if (this.entityId != that.entityId)
17739
          return false;
17740
      }
17741
 
17742
      return true;
17743
    }
17744
 
17745
    @Override
17746
    public int hashCode() {
17747
      return 0;
17748
    }
17749
 
17750
    public int compareTo(getDiscountsForEntity_args other) {
17751
      if (!getClass().equals(other.getClass())) {
17752
        return getClass().getName().compareTo(other.getClass().getName());
17753
      }
17754
 
17755
      int lastComparison = 0;
17756
      getDiscountsForEntity_args typedOther = (getDiscountsForEntity_args)other;
17757
 
17758
      lastComparison = Boolean.valueOf(isSetEntityId()).compareTo(typedOther.isSetEntityId());
17759
      if (lastComparison != 0) {
17760
        return lastComparison;
17761
      }
17762
      if (isSetEntityId()) {
17763
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityId, typedOther.entityId);
17764
        if (lastComparison != 0) {
17765
          return lastComparison;
17766
        }
17767
      }
17768
      return 0;
17769
    }
17770
 
17771
    public _Fields fieldForId(int fieldId) {
17772
      return _Fields.findByThriftId(fieldId);
17773
    }
17774
 
17775
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17776
      org.apache.thrift.protocol.TField field;
17777
      iprot.readStructBegin();
17778
      while (true)
17779
      {
17780
        field = iprot.readFieldBegin();
17781
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17782
          break;
17783
        }
17784
        switch (field.id) {
17785
          case 1: // ENTITY_ID
17786
            if (field.type == org.apache.thrift.protocol.TType.I64) {
17787
              this.entityId = iprot.readI64();
17788
              setEntityIdIsSet(true);
17789
            } else { 
17790
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17791
            }
17792
            break;
17793
          default:
17794
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17795
        }
17796
        iprot.readFieldEnd();
17797
      }
17798
      iprot.readStructEnd();
17799
      validate();
17800
    }
17801
 
17802
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17803
      validate();
17804
 
17805
      oprot.writeStructBegin(STRUCT_DESC);
17806
      oprot.writeFieldBegin(ENTITY_ID_FIELD_DESC);
17807
      oprot.writeI64(this.entityId);
17808
      oprot.writeFieldEnd();
17809
      oprot.writeFieldStop();
17810
      oprot.writeStructEnd();
17811
    }
17812
 
17813
    @Override
17814
    public String toString() {
17815
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_args(");
17816
      boolean first = true;
17817
 
17818
      sb.append("entityId:");
17819
      sb.append(this.entityId);
17820
      first = false;
17821
      sb.append(")");
17822
      return sb.toString();
17823
    }
17824
 
17825
    public void validate() throws org.apache.thrift.TException {
17826
      // check for required fields
17827
    }
17828
 
17829
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17830
      try {
17831
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17832
      } catch (org.apache.thrift.TException te) {
17833
        throw new java.io.IOException(te);
17834
      }
17835
    }
17836
 
17837
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
17838
      try {
17839
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
17840
        __isset_bit_vector = new BitSet(1);
17841
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
17842
      } catch (org.apache.thrift.TException te) {
17843
        throw new java.io.IOException(te);
17844
      }
17845
    }
17846
 
17847
  }
17848
 
17849
  public static class getDiscountsForEntity_result implements org.apache.thrift.TBase<getDiscountsForEntity_result, getDiscountsForEntity_result._Fields>, java.io.Serializable, Cloneable   {
17850
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_result");
17851
 
17852
    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);
17853
 
17854
    private Map<String,Double> success; // required
17855
 
17856
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
17857
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
17858
      SUCCESS((short)0, "success");
17859
 
17860
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
17861
 
17862
      static {
17863
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
17864
          byName.put(field.getFieldName(), field);
17865
        }
17866
      }
17867
 
17868
      /**
17869
       * Find the _Fields constant that matches fieldId, or null if its not found.
17870
       */
17871
      public static _Fields findByThriftId(int fieldId) {
17872
        switch(fieldId) {
17873
          case 0: // SUCCESS
17874
            return SUCCESS;
17875
          default:
17876
            return null;
17877
        }
17878
      }
17879
 
17880
      /**
17881
       * Find the _Fields constant that matches fieldId, throwing an exception
17882
       * if it is not found.
17883
       */
17884
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17885
        _Fields fields = findByThriftId(fieldId);
17886
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17887
        return fields;
17888
      }
17889
 
17890
      /**
17891
       * Find the _Fields constant that matches name, or null if its not found.
17892
       */
17893
      public static _Fields findByName(String name) {
17894
        return byName.get(name);
17895
      }
17896
 
17897
      private final short _thriftId;
17898
      private final String _fieldName;
17899
 
17900
      _Fields(short thriftId, String fieldName) {
17901
        _thriftId = thriftId;
17902
        _fieldName = fieldName;
17903
      }
17904
 
17905
      public short getThriftFieldId() {
17906
        return _thriftId;
17907
      }
17908
 
17909
      public String getFieldName() {
17910
        return _fieldName;
17911
      }
17912
    }
17913
 
17914
    // isset id assignments
17915
 
17916
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
17917
    static {
17918
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
17919
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17920
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
17921
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
17922
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
17923
      metaDataMap = Collections.unmodifiableMap(tmpMap);
17924
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_result.class, metaDataMap);
17925
    }
17926
 
17927
    public getDiscountsForEntity_result() {
17928
    }
17929
 
17930
    public getDiscountsForEntity_result(
17931
      Map<String,Double> success)
17932
    {
17933
      this();
17934
      this.success = success;
17935
    }
17936
 
17937
    /**
17938
     * Performs a deep copy on <i>other</i>.
17939
     */
17940
    public getDiscountsForEntity_result(getDiscountsForEntity_result other) {
17941
      if (other.isSetSuccess()) {
17942
        Map<String,Double> __this__success = new HashMap<String,Double>();
17943
        for (Map.Entry<String, Double> other_element : other.success.entrySet()) {
17944
 
17945
          String other_element_key = other_element.getKey();
17946
          Double other_element_value = other_element.getValue();
17947
 
17948
          String __this__success_copy_key = other_element_key;
17949
 
17950
          Double __this__success_copy_value = other_element_value;
17951
 
17952
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
17953
        }
17954
        this.success = __this__success;
17955
      }
17956
    }
17957
 
17958
    public getDiscountsForEntity_result deepCopy() {
17959
      return new getDiscountsForEntity_result(this);
17960
    }
17961
 
17962
    @Override
17963
    public void clear() {
17964
      this.success = null;
17965
    }
17966
 
17967
    public int getSuccessSize() {
17968
      return (this.success == null) ? 0 : this.success.size();
17969
    }
17970
 
17971
    public void putToSuccess(String key, double val) {
17972
      if (this.success == null) {
17973
        this.success = new HashMap<String,Double>();
17974
      }
17975
      this.success.put(key, val);
17976
    }
17977
 
17978
    public Map<String,Double> getSuccess() {
17979
      return this.success;
17980
    }
17981
 
17982
    public void setSuccess(Map<String,Double> success) {
17983
      this.success = success;
17984
    }
17985
 
17986
    public void unsetSuccess() {
17987
      this.success = null;
17988
    }
17989
 
17990
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
17991
    public boolean isSetSuccess() {
17992
      return this.success != null;
17993
    }
17994
 
17995
    public void setSuccessIsSet(boolean value) {
17996
      if (!value) {
17997
        this.success = null;
17998
      }
17999
    }
18000
 
18001
    public void setFieldValue(_Fields field, Object value) {
18002
      switch (field) {
18003
      case SUCCESS:
18004
        if (value == null) {
18005
          unsetSuccess();
18006
        } else {
18007
          setSuccess((Map<String,Double>)value);
18008
        }
18009
        break;
18010
 
18011
      }
18012
    }
18013
 
18014
    public Object getFieldValue(_Fields field) {
18015
      switch (field) {
18016
      case SUCCESS:
18017
        return getSuccess();
18018
 
18019
      }
18020
      throw new IllegalStateException();
18021
    }
18022
 
18023
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
18024
    public boolean isSet(_Fields field) {
18025
      if (field == null) {
18026
        throw new IllegalArgumentException();
18027
      }
18028
 
18029
      switch (field) {
18030
      case SUCCESS:
18031
        return isSetSuccess();
18032
      }
18033
      throw new IllegalStateException();
18034
    }
18035
 
18036
    @Override
18037
    public boolean equals(Object that) {
18038
      if (that == null)
18039
        return false;
18040
      if (that instanceof getDiscountsForEntity_result)
18041
        return this.equals((getDiscountsForEntity_result)that);
18042
      return false;
18043
    }
18044
 
18045
    public boolean equals(getDiscountsForEntity_result that) {
18046
      if (that == null)
18047
        return false;
18048
 
18049
      boolean this_present_success = true && this.isSetSuccess();
18050
      boolean that_present_success = true && that.isSetSuccess();
18051
      if (this_present_success || that_present_success) {
18052
        if (!(this_present_success && that_present_success))
18053
          return false;
18054
        if (!this.success.equals(that.success))
18055
          return false;
18056
      }
18057
 
18058
      return true;
18059
    }
18060
 
18061
    @Override
18062
    public int hashCode() {
18063
      return 0;
18064
    }
18065
 
18066
    public int compareTo(getDiscountsForEntity_result other) {
18067
      if (!getClass().equals(other.getClass())) {
18068
        return getClass().getName().compareTo(other.getClass().getName());
18069
      }
18070
 
18071
      int lastComparison = 0;
18072
      getDiscountsForEntity_result typedOther = (getDiscountsForEntity_result)other;
18073
 
18074
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
18075
      if (lastComparison != 0) {
18076
        return lastComparison;
18077
      }
18078
      if (isSetSuccess()) {
18079
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
18080
        if (lastComparison != 0) {
18081
          return lastComparison;
18082
        }
18083
      }
18084
      return 0;
18085
    }
18086
 
18087
    public _Fields fieldForId(int fieldId) {
18088
      return _Fields.findByThriftId(fieldId);
18089
    }
18090
 
18091
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
18092
      org.apache.thrift.protocol.TField field;
18093
      iprot.readStructBegin();
18094
      while (true)
18095
      {
18096
        field = iprot.readFieldBegin();
18097
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
18098
          break;
18099
        }
18100
        switch (field.id) {
18101
          case 0: // SUCCESS
18102
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
18103
              {
11592 amit.gupta 18104
                org.apache.thrift.protocol.TMap _map50 = iprot.readMapBegin();
18105
                this.success = new HashMap<String,Double>(2*_map50.size);
18106
                for (int _i51 = 0; _i51 < _map50.size; ++_i51)
4494 varun.gupt 18107
                {
11592 amit.gupta 18108
                  String _key52; // required
18109
                  double _val53; // required
18110
                  _key52 = iprot.readString();
18111
                  _val53 = iprot.readDouble();
18112
                  this.success.put(_key52, _val53);
4494 varun.gupt 18113
                }
18114
                iprot.readMapEnd();
18115
              }
18116
            } else { 
18117
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18118
            }
18119
            break;
18120
          default:
18121
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18122
        }
18123
        iprot.readFieldEnd();
18124
      }
18125
      iprot.readStructEnd();
18126
      validate();
18127
    }
18128
 
18129
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
18130
      oprot.writeStructBegin(STRUCT_DESC);
18131
 
18132
      if (this.isSetSuccess()) {
18133
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
18134
        {
18135
          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 18136
          for (Map.Entry<String, Double> _iter54 : this.success.entrySet())
4494 varun.gupt 18137
          {
11592 amit.gupta 18138
            oprot.writeString(_iter54.getKey());
18139
            oprot.writeDouble(_iter54.getValue());
4494 varun.gupt 18140
          }
18141
          oprot.writeMapEnd();
18142
        }
18143
        oprot.writeFieldEnd();
18144
      }
18145
      oprot.writeFieldStop();
18146
      oprot.writeStructEnd();
18147
    }
18148
 
18149
    @Override
18150
    public String toString() {
18151
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_result(");
18152
      boolean first = true;
18153
 
18154
      sb.append("success:");
18155
      if (this.success == null) {
18156
        sb.append("null");
18157
      } else {
18158
        sb.append(this.success);
18159
      }
18160
      first = false;
18161
      sb.append(")");
18162
      return sb.toString();
18163
    }
18164
 
18165
    public void validate() throws org.apache.thrift.TException {
18166
      // check for required fields
18167
    }
18168
 
18169
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
18170
      try {
18171
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
18172
      } catch (org.apache.thrift.TException te) {
18173
        throw new java.io.IOException(te);
18174
      }
18175
    }
18176
 
18177
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
18178
      try {
18179
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
18180
      } catch (org.apache.thrift.TException te) {
18181
        throw new java.io.IOException(te);
18182
      }
18183
    }
18184
 
18185
  }
18186
 
5469 rajveer 18187
  public static class addVoucher_args implements org.apache.thrift.TBase<addVoucher_args, addVoucher_args._Fields>, java.io.Serializable, Cloneable   {
18188
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_args");
18189
 
18190
    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);
18191
 
18192
    private Voucher voucher; // required
18193
 
18194
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
18195
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
18196
      VOUCHER((short)1, "voucher");
18197
 
18198
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
18199
 
18200
      static {
18201
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
18202
          byName.put(field.getFieldName(), field);
18203
        }
18204
      }
18205
 
18206
      /**
18207
       * Find the _Fields constant that matches fieldId, or null if its not found.
18208
       */
18209
      public static _Fields findByThriftId(int fieldId) {
18210
        switch(fieldId) {
18211
          case 1: // VOUCHER
18212
            return VOUCHER;
18213
          default:
18214
            return null;
18215
        }
18216
      }
18217
 
18218
      /**
18219
       * Find the _Fields constant that matches fieldId, throwing an exception
18220
       * if it is not found.
18221
       */
18222
      public static _Fields findByThriftIdOrThrow(int fieldId) {
18223
        _Fields fields = findByThriftId(fieldId);
18224
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
18225
        return fields;
18226
      }
18227
 
18228
      /**
18229
       * Find the _Fields constant that matches name, or null if its not found.
18230
       */
18231
      public static _Fields findByName(String name) {
18232
        return byName.get(name);
18233
      }
18234
 
18235
      private final short _thriftId;
18236
      private final String _fieldName;
18237
 
18238
      _Fields(short thriftId, String fieldName) {
18239
        _thriftId = thriftId;
18240
        _fieldName = fieldName;
18241
      }
18242
 
18243
      public short getThriftFieldId() {
18244
        return _thriftId;
18245
      }
18246
 
18247
      public String getFieldName() {
18248
        return _fieldName;
18249
      }
18250
    }
18251
 
18252
    // isset id assignments
18253
 
18254
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
18255
    static {
18256
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
18257
      tmpMap.put(_Fields.VOUCHER, new org.apache.thrift.meta_data.FieldMetaData("voucher", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18258
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
18259
      metaDataMap = Collections.unmodifiableMap(tmpMap);
18260
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_args.class, metaDataMap);
18261
    }
18262
 
18263
    public addVoucher_args() {
18264
    }
18265
 
18266
    public addVoucher_args(
18267
      Voucher voucher)
18268
    {
18269
      this();
18270
      this.voucher = voucher;
18271
    }
18272
 
18273
    /**
18274
     * Performs a deep copy on <i>other</i>.
18275
     */
18276
    public addVoucher_args(addVoucher_args other) {
18277
      if (other.isSetVoucher()) {
18278
        this.voucher = new Voucher(other.voucher);
18279
      }
18280
    }
18281
 
18282
    public addVoucher_args deepCopy() {
18283
      return new addVoucher_args(this);
18284
    }
18285
 
18286
    @Override
18287
    public void clear() {
18288
      this.voucher = null;
18289
    }
18290
 
18291
    public Voucher getVoucher() {
18292
      return this.voucher;
18293
    }
18294
 
18295
    public void setVoucher(Voucher voucher) {
18296
      this.voucher = voucher;
18297
    }
18298
 
18299
    public void unsetVoucher() {
18300
      this.voucher = null;
18301
    }
18302
 
18303
    /** Returns true if field voucher is set (has been assigned a value) and false otherwise */
18304
    public boolean isSetVoucher() {
18305
      return this.voucher != null;
18306
    }
18307
 
18308
    public void setVoucherIsSet(boolean value) {
18309
      if (!value) {
18310
        this.voucher = null;
18311
      }
18312
    }
18313
 
18314
    public void setFieldValue(_Fields field, Object value) {
18315
      switch (field) {
18316
      case VOUCHER:
18317
        if (value == null) {
18318
          unsetVoucher();
18319
        } else {
18320
          setVoucher((Voucher)value);
18321
        }
18322
        break;
18323
 
18324
      }
18325
    }
18326
 
18327
    public Object getFieldValue(_Fields field) {
18328
      switch (field) {
18329
      case VOUCHER:
18330
        return getVoucher();
18331
 
18332
      }
18333
      throw new IllegalStateException();
18334
    }
18335
 
18336
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
18337
    public boolean isSet(_Fields field) {
18338
      if (field == null) {
18339
        throw new IllegalArgumentException();
18340
      }
18341
 
18342
      switch (field) {
18343
      case VOUCHER:
18344
        return isSetVoucher();
18345
      }
18346
      throw new IllegalStateException();
18347
    }
18348
 
18349
    @Override
18350
    public boolean equals(Object that) {
18351
      if (that == null)
18352
        return false;
18353
      if (that instanceof addVoucher_args)
18354
        return this.equals((addVoucher_args)that);
18355
      return false;
18356
    }
18357
 
18358
    public boolean equals(addVoucher_args that) {
18359
      if (that == null)
18360
        return false;
18361
 
18362
      boolean this_present_voucher = true && this.isSetVoucher();
18363
      boolean that_present_voucher = true && that.isSetVoucher();
18364
      if (this_present_voucher || that_present_voucher) {
18365
        if (!(this_present_voucher && that_present_voucher))
18366
          return false;
18367
        if (!this.voucher.equals(that.voucher))
18368
          return false;
18369
      }
18370
 
18371
      return true;
18372
    }
18373
 
18374
    @Override
18375
    public int hashCode() {
18376
      return 0;
18377
    }
18378
 
18379
    public int compareTo(addVoucher_args other) {
18380
      if (!getClass().equals(other.getClass())) {
18381
        return getClass().getName().compareTo(other.getClass().getName());
18382
      }
18383
 
18384
      int lastComparison = 0;
18385
      addVoucher_args typedOther = (addVoucher_args)other;
18386
 
18387
      lastComparison = Boolean.valueOf(isSetVoucher()).compareTo(typedOther.isSetVoucher());
18388
      if (lastComparison != 0) {
18389
        return lastComparison;
18390
      }
18391
      if (isSetVoucher()) {
18392
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucher, typedOther.voucher);
18393
        if (lastComparison != 0) {
18394
          return lastComparison;
18395
        }
18396
      }
18397
      return 0;
18398
    }
18399
 
18400
    public _Fields fieldForId(int fieldId) {
18401
      return _Fields.findByThriftId(fieldId);
18402
    }
18403
 
18404
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
18405
      org.apache.thrift.protocol.TField field;
18406
      iprot.readStructBegin();
18407
      while (true)
18408
      {
18409
        field = iprot.readFieldBegin();
18410
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
18411
          break;
18412
        }
18413
        switch (field.id) {
18414
          case 1: // VOUCHER
18415
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
18416
              this.voucher = new Voucher();
18417
              this.voucher.read(iprot);
18418
            } else { 
18419
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18420
            }
18421
            break;
18422
          default:
18423
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18424
        }
18425
        iprot.readFieldEnd();
18426
      }
18427
      iprot.readStructEnd();
18428
      validate();
18429
    }
18430
 
18431
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
18432
      validate();
18433
 
18434
      oprot.writeStructBegin(STRUCT_DESC);
18435
      if (this.voucher != null) {
18436
        oprot.writeFieldBegin(VOUCHER_FIELD_DESC);
18437
        this.voucher.write(oprot);
18438
        oprot.writeFieldEnd();
18439
      }
18440
      oprot.writeFieldStop();
18441
      oprot.writeStructEnd();
18442
    }
18443
 
18444
    @Override
18445
    public String toString() {
18446
      StringBuilder sb = new StringBuilder("addVoucher_args(");
18447
      boolean first = true;
18448
 
18449
      sb.append("voucher:");
18450
      if (this.voucher == null) {
18451
        sb.append("null");
18452
      } else {
18453
        sb.append(this.voucher);
18454
      }
18455
      first = false;
18456
      sb.append(")");
18457
      return sb.toString();
18458
    }
18459
 
18460
    public void validate() throws org.apache.thrift.TException {
18461
      // check for required fields
18462
    }
18463
 
18464
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
18465
      try {
18466
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
18467
      } catch (org.apache.thrift.TException te) {
18468
        throw new java.io.IOException(te);
18469
      }
18470
    }
18471
 
18472
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
18473
      try {
18474
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
18475
      } catch (org.apache.thrift.TException te) {
18476
        throw new java.io.IOException(te);
18477
      }
18478
    }
18479
 
18480
  }
18481
 
18482
  public static class addVoucher_result implements org.apache.thrift.TBase<addVoucher_result, addVoucher_result._Fields>, java.io.Serializable, Cloneable   {
18483
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_result");
18484
 
18485
 
18486
 
18487
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
18488
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
18489
;
18490
 
18491
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
18492
 
18493
      static {
18494
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
18495
          byName.put(field.getFieldName(), field);
18496
        }
18497
      }
18498
 
18499
      /**
18500
       * Find the _Fields constant that matches fieldId, or null if its not found.
18501
       */
18502
      public static _Fields findByThriftId(int fieldId) {
18503
        switch(fieldId) {
18504
          default:
18505
            return null;
18506
        }
18507
      }
18508
 
18509
      /**
18510
       * Find the _Fields constant that matches fieldId, throwing an exception
18511
       * if it is not found.
18512
       */
18513
      public static _Fields findByThriftIdOrThrow(int fieldId) {
18514
        _Fields fields = findByThriftId(fieldId);
18515
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
18516
        return fields;
18517
      }
18518
 
18519
      /**
18520
       * Find the _Fields constant that matches name, or null if its not found.
18521
       */
18522
      public static _Fields findByName(String name) {
18523
        return byName.get(name);
18524
      }
18525
 
18526
      private final short _thriftId;
18527
      private final String _fieldName;
18528
 
18529
      _Fields(short thriftId, String fieldName) {
18530
        _thriftId = thriftId;
18531
        _fieldName = fieldName;
18532
      }
18533
 
18534
      public short getThriftFieldId() {
18535
        return _thriftId;
18536
      }
18537
 
18538
      public String getFieldName() {
18539
        return _fieldName;
18540
      }
18541
    }
18542
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
18543
    static {
18544
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
18545
      metaDataMap = Collections.unmodifiableMap(tmpMap);
18546
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_result.class, metaDataMap);
18547
    }
18548
 
18549
    public addVoucher_result() {
18550
    }
18551
 
18552
    /**
18553
     * Performs a deep copy on <i>other</i>.
18554
     */
18555
    public addVoucher_result(addVoucher_result other) {
18556
    }
18557
 
18558
    public addVoucher_result deepCopy() {
18559
      return new addVoucher_result(this);
18560
    }
18561
 
18562
    @Override
18563
    public void clear() {
18564
    }
18565
 
18566
    public void setFieldValue(_Fields field, Object value) {
18567
      switch (field) {
18568
      }
18569
    }
18570
 
18571
    public Object getFieldValue(_Fields field) {
18572
      switch (field) {
18573
      }
18574
      throw new IllegalStateException();
18575
    }
18576
 
18577
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
18578
    public boolean isSet(_Fields field) {
18579
      if (field == null) {
18580
        throw new IllegalArgumentException();
18581
      }
18582
 
18583
      switch (field) {
18584
      }
18585
      throw new IllegalStateException();
18586
    }
18587
 
18588
    @Override
18589
    public boolean equals(Object that) {
18590
      if (that == null)
18591
        return false;
18592
      if (that instanceof addVoucher_result)
18593
        return this.equals((addVoucher_result)that);
18594
      return false;
18595
    }
18596
 
18597
    public boolean equals(addVoucher_result that) {
18598
      if (that == null)
18599
        return false;
18600
 
18601
      return true;
18602
    }
18603
 
18604
    @Override
18605
    public int hashCode() {
18606
      return 0;
18607
    }
18608
 
18609
    public int compareTo(addVoucher_result other) {
18610
      if (!getClass().equals(other.getClass())) {
18611
        return getClass().getName().compareTo(other.getClass().getName());
18612
      }
18613
 
18614
      int lastComparison = 0;
18615
      addVoucher_result typedOther = (addVoucher_result)other;
18616
 
18617
      return 0;
18618
    }
18619
 
18620
    public _Fields fieldForId(int fieldId) {
18621
      return _Fields.findByThriftId(fieldId);
18622
    }
18623
 
18624
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
18625
      org.apache.thrift.protocol.TField field;
18626
      iprot.readStructBegin();
18627
      while (true)
18628
      {
18629
        field = iprot.readFieldBegin();
18630
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
18631
          break;
18632
        }
18633
        switch (field.id) {
18634
          default:
18635
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18636
        }
18637
        iprot.readFieldEnd();
18638
      }
18639
      iprot.readStructEnd();
18640
      validate();
18641
    }
18642
 
18643
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
18644
      oprot.writeStructBegin(STRUCT_DESC);
18645
 
18646
      oprot.writeFieldStop();
18647
      oprot.writeStructEnd();
18648
    }
18649
 
18650
    @Override
18651
    public String toString() {
18652
      StringBuilder sb = new StringBuilder("addVoucher_result(");
18653
      boolean first = true;
18654
 
18655
      sb.append(")");
18656
      return sb.toString();
18657
    }
18658
 
18659
    public void validate() throws org.apache.thrift.TException {
18660
      // check for required fields
18661
    }
18662
 
18663
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
18664
      try {
18665
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
18666
      } catch (org.apache.thrift.TException te) {
18667
        throw new java.io.IOException(te);
18668
      }
18669
    }
18670
 
18671
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
18672
      try {
18673
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
18674
      } catch (org.apache.thrift.TException te) {
18675
        throw new java.io.IOException(te);
18676
      }
18677
    }
18678
 
18679
  }
18680
 
18681
  public static class assignVoucher_args implements org.apache.thrift.TBase<assignVoucher_args, assignVoucher_args._Fields>, java.io.Serializable, Cloneable   {
18682
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_args");
18683
 
18684
    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);
18685
    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);
18686
    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);
18687
    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);
18688
 
18689
    private long userId; // required
18690
    private String userEmail; // required
18691
    private VoucherType voucherType; // required
18692
    private long amount; // required
18693
 
18694
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
18695
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
18696
      USER_ID((short)1, "userId"),
18697
      USER_EMAIL((short)2, "userEmail"),
18698
      /**
18699
       * 
18700
       * @see VoucherType
18701
       */
18702
      VOUCHER_TYPE((short)3, "voucherType"),
18703
      AMOUNT((short)4, "amount");
18704
 
18705
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
18706
 
18707
      static {
18708
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
18709
          byName.put(field.getFieldName(), field);
18710
        }
18711
      }
18712
 
18713
      /**
18714
       * Find the _Fields constant that matches fieldId, or null if its not found.
18715
       */
18716
      public static _Fields findByThriftId(int fieldId) {
18717
        switch(fieldId) {
18718
          case 1: // USER_ID
18719
            return USER_ID;
18720
          case 2: // USER_EMAIL
18721
            return USER_EMAIL;
18722
          case 3: // VOUCHER_TYPE
18723
            return VOUCHER_TYPE;
18724
          case 4: // AMOUNT
18725
            return AMOUNT;
18726
          default:
18727
            return null;
18728
        }
18729
      }
18730
 
18731
      /**
18732
       * Find the _Fields constant that matches fieldId, throwing an exception
18733
       * if it is not found.
18734
       */
18735
      public static _Fields findByThriftIdOrThrow(int fieldId) {
18736
        _Fields fields = findByThriftId(fieldId);
18737
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
18738
        return fields;
18739
      }
18740
 
18741
      /**
18742
       * Find the _Fields constant that matches name, or null if its not found.
18743
       */
18744
      public static _Fields findByName(String name) {
18745
        return byName.get(name);
18746
      }
18747
 
18748
      private final short _thriftId;
18749
      private final String _fieldName;
18750
 
18751
      _Fields(short thriftId, String fieldName) {
18752
        _thriftId = thriftId;
18753
        _fieldName = fieldName;
18754
      }
18755
 
18756
      public short getThriftFieldId() {
18757
        return _thriftId;
18758
      }
18759
 
18760
      public String getFieldName() {
18761
        return _fieldName;
18762
      }
18763
    }
18764
 
18765
    // isset id assignments
18766
    private static final int __USERID_ISSET_ID = 0;
18767
    private static final int __AMOUNT_ISSET_ID = 1;
18768
    private BitSet __isset_bit_vector = new BitSet(2);
18769
 
18770
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
18771
    static {
18772
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
18773
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18774
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
18775
      tmpMap.put(_Fields.USER_EMAIL, new org.apache.thrift.meta_data.FieldMetaData("userEmail", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18776
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
18777
      tmpMap.put(_Fields.VOUCHER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("voucherType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18778
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, VoucherType.class)));
18779
      tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18780
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
18781
      metaDataMap = Collections.unmodifiableMap(tmpMap);
18782
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_args.class, metaDataMap);
18783
    }
18784
 
18785
    public assignVoucher_args() {
18786
    }
18787
 
18788
    public assignVoucher_args(
18789
      long userId,
18790
      String userEmail,
18791
      VoucherType voucherType,
18792
      long amount)
18793
    {
18794
      this();
18795
      this.userId = userId;
18796
      setUserIdIsSet(true);
18797
      this.userEmail = userEmail;
18798
      this.voucherType = voucherType;
18799
      this.amount = amount;
18800
      setAmountIsSet(true);
18801
    }
18802
 
18803
    /**
18804
     * Performs a deep copy on <i>other</i>.
18805
     */
18806
    public assignVoucher_args(assignVoucher_args other) {
18807
      __isset_bit_vector.clear();
18808
      __isset_bit_vector.or(other.__isset_bit_vector);
18809
      this.userId = other.userId;
18810
      if (other.isSetUserEmail()) {
18811
        this.userEmail = other.userEmail;
18812
      }
18813
      if (other.isSetVoucherType()) {
18814
        this.voucherType = other.voucherType;
18815
      }
18816
      this.amount = other.amount;
18817
    }
18818
 
18819
    public assignVoucher_args deepCopy() {
18820
      return new assignVoucher_args(this);
18821
    }
18822
 
18823
    @Override
18824
    public void clear() {
18825
      setUserIdIsSet(false);
18826
      this.userId = 0;
18827
      this.userEmail = null;
18828
      this.voucherType = null;
18829
      setAmountIsSet(false);
18830
      this.amount = 0;
18831
    }
18832
 
18833
    public long getUserId() {
18834
      return this.userId;
18835
    }
18836
 
18837
    public void setUserId(long userId) {
18838
      this.userId = userId;
18839
      setUserIdIsSet(true);
18840
    }
18841
 
18842
    public void unsetUserId() {
18843
      __isset_bit_vector.clear(__USERID_ISSET_ID);
18844
    }
18845
 
18846
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
18847
    public boolean isSetUserId() {
18848
      return __isset_bit_vector.get(__USERID_ISSET_ID);
18849
    }
18850
 
18851
    public void setUserIdIsSet(boolean value) {
18852
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
18853
    }
18854
 
18855
    public String getUserEmail() {
18856
      return this.userEmail;
18857
    }
18858
 
18859
    public void setUserEmail(String userEmail) {
18860
      this.userEmail = userEmail;
18861
    }
18862
 
18863
    public void unsetUserEmail() {
18864
      this.userEmail = null;
18865
    }
18866
 
18867
    /** Returns true if field userEmail is set (has been assigned a value) and false otherwise */
18868
    public boolean isSetUserEmail() {
18869
      return this.userEmail != null;
18870
    }
18871
 
18872
    public void setUserEmailIsSet(boolean value) {
18873
      if (!value) {
18874
        this.userEmail = null;
18875
      }
18876
    }
18877
 
18878
    /**
18879
     * 
18880
     * @see VoucherType
18881
     */
18882
    public VoucherType getVoucherType() {
18883
      return this.voucherType;
18884
    }
18885
 
18886
    /**
18887
     * 
18888
     * @see VoucherType
18889
     */
18890
    public void setVoucherType(VoucherType voucherType) {
18891
      this.voucherType = voucherType;
18892
    }
18893
 
18894
    public void unsetVoucherType() {
18895
      this.voucherType = null;
18896
    }
18897
 
18898
    /** Returns true if field voucherType is set (has been assigned a value) and false otherwise */
18899
    public boolean isSetVoucherType() {
18900
      return this.voucherType != null;
18901
    }
18902
 
18903
    public void setVoucherTypeIsSet(boolean value) {
18904
      if (!value) {
18905
        this.voucherType = null;
18906
      }
18907
    }
18908
 
18909
    public long getAmount() {
18910
      return this.amount;
18911
    }
18912
 
18913
    public void setAmount(long amount) {
18914
      this.amount = amount;
18915
      setAmountIsSet(true);
18916
    }
18917
 
18918
    public void unsetAmount() {
18919
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
18920
    }
18921
 
18922
    /** Returns true if field amount is set (has been assigned a value) and false otherwise */
18923
    public boolean isSetAmount() {
18924
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
18925
    }
18926
 
18927
    public void setAmountIsSet(boolean value) {
18928
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
18929
    }
18930
 
18931
    public void setFieldValue(_Fields field, Object value) {
18932
      switch (field) {
18933
      case USER_ID:
18934
        if (value == null) {
18935
          unsetUserId();
18936
        } else {
18937
          setUserId((Long)value);
18938
        }
18939
        break;
18940
 
18941
      case USER_EMAIL:
18942
        if (value == null) {
18943
          unsetUserEmail();
18944
        } else {
18945
          setUserEmail((String)value);
18946
        }
18947
        break;
18948
 
18949
      case VOUCHER_TYPE:
18950
        if (value == null) {
18951
          unsetVoucherType();
18952
        } else {
18953
          setVoucherType((VoucherType)value);
18954
        }
18955
        break;
18956
 
18957
      case AMOUNT:
18958
        if (value == null) {
18959
          unsetAmount();
18960
        } else {
18961
          setAmount((Long)value);
18962
        }
18963
        break;
18964
 
18965
      }
18966
    }
18967
 
18968
    public Object getFieldValue(_Fields field) {
18969
      switch (field) {
18970
      case USER_ID:
18971
        return Long.valueOf(getUserId());
18972
 
18973
      case USER_EMAIL:
18974
        return getUserEmail();
18975
 
18976
      case VOUCHER_TYPE:
18977
        return getVoucherType();
18978
 
18979
      case AMOUNT:
18980
        return Long.valueOf(getAmount());
18981
 
18982
      }
18983
      throw new IllegalStateException();
18984
    }
18985
 
18986
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
18987
    public boolean isSet(_Fields field) {
18988
      if (field == null) {
18989
        throw new IllegalArgumentException();
18990
      }
18991
 
18992
      switch (field) {
18993
      case USER_ID:
18994
        return isSetUserId();
18995
      case USER_EMAIL:
18996
        return isSetUserEmail();
18997
      case VOUCHER_TYPE:
18998
        return isSetVoucherType();
18999
      case AMOUNT:
19000
        return isSetAmount();
19001
      }
19002
      throw new IllegalStateException();
19003
    }
19004
 
19005
    @Override
19006
    public boolean equals(Object that) {
19007
      if (that == null)
19008
        return false;
19009
      if (that instanceof assignVoucher_args)
19010
        return this.equals((assignVoucher_args)that);
19011
      return false;
19012
    }
19013
 
19014
    public boolean equals(assignVoucher_args that) {
19015
      if (that == null)
19016
        return false;
19017
 
19018
      boolean this_present_userId = true;
19019
      boolean that_present_userId = true;
19020
      if (this_present_userId || that_present_userId) {
19021
        if (!(this_present_userId && that_present_userId))
19022
          return false;
19023
        if (this.userId != that.userId)
19024
          return false;
19025
      }
19026
 
19027
      boolean this_present_userEmail = true && this.isSetUserEmail();
19028
      boolean that_present_userEmail = true && that.isSetUserEmail();
19029
      if (this_present_userEmail || that_present_userEmail) {
19030
        if (!(this_present_userEmail && that_present_userEmail))
19031
          return false;
19032
        if (!this.userEmail.equals(that.userEmail))
19033
          return false;
19034
      }
19035
 
19036
      boolean this_present_voucherType = true && this.isSetVoucherType();
19037
      boolean that_present_voucherType = true && that.isSetVoucherType();
19038
      if (this_present_voucherType || that_present_voucherType) {
19039
        if (!(this_present_voucherType && that_present_voucherType))
19040
          return false;
19041
        if (!this.voucherType.equals(that.voucherType))
19042
          return false;
19043
      }
19044
 
19045
      boolean this_present_amount = true;
19046
      boolean that_present_amount = true;
19047
      if (this_present_amount || that_present_amount) {
19048
        if (!(this_present_amount && that_present_amount))
19049
          return false;
19050
        if (this.amount != that.amount)
19051
          return false;
19052
      }
19053
 
19054
      return true;
19055
    }
19056
 
19057
    @Override
19058
    public int hashCode() {
19059
      return 0;
19060
    }
19061
 
19062
    public int compareTo(assignVoucher_args other) {
19063
      if (!getClass().equals(other.getClass())) {
19064
        return getClass().getName().compareTo(other.getClass().getName());
19065
      }
19066
 
19067
      int lastComparison = 0;
19068
      assignVoucher_args typedOther = (assignVoucher_args)other;
19069
 
19070
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
19071
      if (lastComparison != 0) {
19072
        return lastComparison;
19073
      }
19074
      if (isSetUserId()) {
19075
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
19076
        if (lastComparison != 0) {
19077
          return lastComparison;
19078
        }
19079
      }
19080
      lastComparison = Boolean.valueOf(isSetUserEmail()).compareTo(typedOther.isSetUserEmail());
19081
      if (lastComparison != 0) {
19082
        return lastComparison;
19083
      }
19084
      if (isSetUserEmail()) {
19085
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userEmail, typedOther.userEmail);
19086
        if (lastComparison != 0) {
19087
          return lastComparison;
19088
        }
19089
      }
19090
      lastComparison = Boolean.valueOf(isSetVoucherType()).compareTo(typedOther.isSetVoucherType());
19091
      if (lastComparison != 0) {
19092
        return lastComparison;
19093
      }
19094
      if (isSetVoucherType()) {
19095
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherType, typedOther.voucherType);
19096
        if (lastComparison != 0) {
19097
          return lastComparison;
19098
        }
19099
      }
19100
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
19101
      if (lastComparison != 0) {
19102
        return lastComparison;
19103
      }
19104
      if (isSetAmount()) {
19105
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
19106
        if (lastComparison != 0) {
19107
          return lastComparison;
19108
        }
19109
      }
19110
      return 0;
19111
    }
19112
 
19113
    public _Fields fieldForId(int fieldId) {
19114
      return _Fields.findByThriftId(fieldId);
19115
    }
19116
 
19117
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
19118
      org.apache.thrift.protocol.TField field;
19119
      iprot.readStructBegin();
19120
      while (true)
19121
      {
19122
        field = iprot.readFieldBegin();
19123
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
19124
          break;
19125
        }
19126
        switch (field.id) {
19127
          case 1: // USER_ID
19128
            if (field.type == org.apache.thrift.protocol.TType.I64) {
19129
              this.userId = iprot.readI64();
19130
              setUserIdIsSet(true);
19131
            } else { 
19132
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19133
            }
19134
            break;
19135
          case 2: // USER_EMAIL
19136
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
19137
              this.userEmail = iprot.readString();
19138
            } else { 
19139
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19140
            }
19141
            break;
19142
          case 3: // VOUCHER_TYPE
19143
            if (field.type == org.apache.thrift.protocol.TType.I32) {
19144
              this.voucherType = VoucherType.findByValue(iprot.readI32());
19145
            } else { 
19146
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19147
            }
19148
            break;
19149
          case 4: // AMOUNT
19150
            if (field.type == org.apache.thrift.protocol.TType.I64) {
19151
              this.amount = iprot.readI64();
19152
              setAmountIsSet(true);
19153
            } else { 
19154
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19155
            }
19156
            break;
19157
          default:
19158
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19159
        }
19160
        iprot.readFieldEnd();
19161
      }
19162
      iprot.readStructEnd();
19163
      validate();
19164
    }
19165
 
19166
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
19167
      validate();
19168
 
19169
      oprot.writeStructBegin(STRUCT_DESC);
19170
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
19171
      oprot.writeI64(this.userId);
19172
      oprot.writeFieldEnd();
19173
      if (this.userEmail != null) {
19174
        oprot.writeFieldBegin(USER_EMAIL_FIELD_DESC);
19175
        oprot.writeString(this.userEmail);
19176
        oprot.writeFieldEnd();
19177
      }
19178
      if (this.voucherType != null) {
19179
        oprot.writeFieldBegin(VOUCHER_TYPE_FIELD_DESC);
19180
        oprot.writeI32(this.voucherType.getValue());
19181
        oprot.writeFieldEnd();
19182
      }
19183
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
19184
      oprot.writeI64(this.amount);
19185
      oprot.writeFieldEnd();
19186
      oprot.writeFieldStop();
19187
      oprot.writeStructEnd();
19188
    }
19189
 
19190
    @Override
19191
    public String toString() {
19192
      StringBuilder sb = new StringBuilder("assignVoucher_args(");
19193
      boolean first = true;
19194
 
19195
      sb.append("userId:");
19196
      sb.append(this.userId);
19197
      first = false;
19198
      if (!first) sb.append(", ");
19199
      sb.append("userEmail:");
19200
      if (this.userEmail == null) {
19201
        sb.append("null");
19202
      } else {
19203
        sb.append(this.userEmail);
19204
      }
19205
      first = false;
19206
      if (!first) sb.append(", ");
19207
      sb.append("voucherType:");
19208
      if (this.voucherType == null) {
19209
        sb.append("null");
19210
      } else {
19211
        sb.append(this.voucherType);
19212
      }
19213
      first = false;
19214
      if (!first) sb.append(", ");
19215
      sb.append("amount:");
19216
      sb.append(this.amount);
19217
      first = false;
19218
      sb.append(")");
19219
      return sb.toString();
19220
    }
19221
 
19222
    public void validate() throws org.apache.thrift.TException {
19223
      // check for required fields
19224
    }
19225
 
19226
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
19227
      try {
19228
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
19229
      } catch (org.apache.thrift.TException te) {
19230
        throw new java.io.IOException(te);
19231
      }
19232
    }
19233
 
19234
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
19235
      try {
19236
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
19237
        __isset_bit_vector = new BitSet(1);
19238
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
19239
      } catch (org.apache.thrift.TException te) {
19240
        throw new java.io.IOException(te);
19241
      }
19242
    }
19243
 
19244
  }
19245
 
19246
  public static class assignVoucher_result implements org.apache.thrift.TBase<assignVoucher_result, assignVoucher_result._Fields>, java.io.Serializable, Cloneable   {
19247
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_result");
19248
 
19249
    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);
19250
 
19251
    private Voucher success; // required
19252
 
19253
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
19254
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
19255
      SUCCESS((short)0, "success");
19256
 
19257
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
19258
 
19259
      static {
19260
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
19261
          byName.put(field.getFieldName(), field);
19262
        }
19263
      }
19264
 
19265
      /**
19266
       * Find the _Fields constant that matches fieldId, or null if its not found.
19267
       */
19268
      public static _Fields findByThriftId(int fieldId) {
19269
        switch(fieldId) {
19270
          case 0: // SUCCESS
19271
            return SUCCESS;
19272
          default:
19273
            return null;
19274
        }
19275
      }
19276
 
19277
      /**
19278
       * Find the _Fields constant that matches fieldId, throwing an exception
19279
       * if it is not found.
19280
       */
19281
      public static _Fields findByThriftIdOrThrow(int fieldId) {
19282
        _Fields fields = findByThriftId(fieldId);
19283
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
19284
        return fields;
19285
      }
19286
 
19287
      /**
19288
       * Find the _Fields constant that matches name, or null if its not found.
19289
       */
19290
      public static _Fields findByName(String name) {
19291
        return byName.get(name);
19292
      }
19293
 
19294
      private final short _thriftId;
19295
      private final String _fieldName;
19296
 
19297
      _Fields(short thriftId, String fieldName) {
19298
        _thriftId = thriftId;
19299
        _fieldName = fieldName;
19300
      }
19301
 
19302
      public short getThriftFieldId() {
19303
        return _thriftId;
19304
      }
19305
 
19306
      public String getFieldName() {
19307
        return _fieldName;
19308
      }
19309
    }
19310
 
19311
    // isset id assignments
19312
 
19313
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
19314
    static {
19315
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
19316
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
19317
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
19318
      metaDataMap = Collections.unmodifiableMap(tmpMap);
19319
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_result.class, metaDataMap);
19320
    }
19321
 
19322
    public assignVoucher_result() {
19323
    }
19324
 
19325
    public assignVoucher_result(
19326
      Voucher success)
19327
    {
19328
      this();
19329
      this.success = success;
19330
    }
19331
 
19332
    /**
19333
     * Performs a deep copy on <i>other</i>.
19334
     */
19335
    public assignVoucher_result(assignVoucher_result other) {
19336
      if (other.isSetSuccess()) {
19337
        this.success = new Voucher(other.success);
19338
      }
19339
    }
19340
 
19341
    public assignVoucher_result deepCopy() {
19342
      return new assignVoucher_result(this);
19343
    }
19344
 
19345
    @Override
19346
    public void clear() {
19347
      this.success = null;
19348
    }
19349
 
19350
    public Voucher getSuccess() {
19351
      return this.success;
19352
    }
19353
 
19354
    public void setSuccess(Voucher success) {
19355
      this.success = success;
19356
    }
19357
 
19358
    public void unsetSuccess() {
19359
      this.success = null;
19360
    }
19361
 
19362
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
19363
    public boolean isSetSuccess() {
19364
      return this.success != null;
19365
    }
19366
 
19367
    public void setSuccessIsSet(boolean value) {
19368
      if (!value) {
19369
        this.success = null;
19370
      }
19371
    }
19372
 
19373
    public void setFieldValue(_Fields field, Object value) {
19374
      switch (field) {
19375
      case SUCCESS:
19376
        if (value == null) {
19377
          unsetSuccess();
19378
        } else {
19379
          setSuccess((Voucher)value);
19380
        }
19381
        break;
19382
 
19383
      }
19384
    }
19385
 
19386
    public Object getFieldValue(_Fields field) {
19387
      switch (field) {
19388
      case SUCCESS:
19389
        return getSuccess();
19390
 
19391
      }
19392
      throw new IllegalStateException();
19393
    }
19394
 
19395
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
19396
    public boolean isSet(_Fields field) {
19397
      if (field == null) {
19398
        throw new IllegalArgumentException();
19399
      }
19400
 
19401
      switch (field) {
19402
      case SUCCESS:
19403
        return isSetSuccess();
19404
      }
19405
      throw new IllegalStateException();
19406
    }
19407
 
19408
    @Override
19409
    public boolean equals(Object that) {
19410
      if (that == null)
19411
        return false;
19412
      if (that instanceof assignVoucher_result)
19413
        return this.equals((assignVoucher_result)that);
19414
      return false;
19415
    }
19416
 
19417
    public boolean equals(assignVoucher_result that) {
19418
      if (that == null)
19419
        return false;
19420
 
19421
      boolean this_present_success = true && this.isSetSuccess();
19422
      boolean that_present_success = true && that.isSetSuccess();
19423
      if (this_present_success || that_present_success) {
19424
        if (!(this_present_success && that_present_success))
19425
          return false;
19426
        if (!this.success.equals(that.success))
19427
          return false;
19428
      }
19429
 
19430
      return true;
19431
    }
19432
 
19433
    @Override
19434
    public int hashCode() {
19435
      return 0;
19436
    }
19437
 
19438
    public int compareTo(assignVoucher_result other) {
19439
      if (!getClass().equals(other.getClass())) {
19440
        return getClass().getName().compareTo(other.getClass().getName());
19441
      }
19442
 
19443
      int lastComparison = 0;
19444
      assignVoucher_result typedOther = (assignVoucher_result)other;
19445
 
19446
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
19447
      if (lastComparison != 0) {
19448
        return lastComparison;
19449
      }
19450
      if (isSetSuccess()) {
19451
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
19452
        if (lastComparison != 0) {
19453
          return lastComparison;
19454
        }
19455
      }
19456
      return 0;
19457
    }
19458
 
19459
    public _Fields fieldForId(int fieldId) {
19460
      return _Fields.findByThriftId(fieldId);
19461
    }
19462
 
19463
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
19464
      org.apache.thrift.protocol.TField field;
19465
      iprot.readStructBegin();
19466
      while (true)
19467
      {
19468
        field = iprot.readFieldBegin();
19469
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
19470
          break;
19471
        }
19472
        switch (field.id) {
19473
          case 0: // SUCCESS
19474
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
19475
              this.success = new Voucher();
19476
              this.success.read(iprot);
19477
            } else { 
19478
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19479
            }
19480
            break;
19481
          default:
19482
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19483
        }
19484
        iprot.readFieldEnd();
19485
      }
19486
      iprot.readStructEnd();
19487
      validate();
19488
    }
19489
 
19490
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
19491
      oprot.writeStructBegin(STRUCT_DESC);
19492
 
19493
      if (this.isSetSuccess()) {
19494
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
19495
        this.success.write(oprot);
19496
        oprot.writeFieldEnd();
19497
      }
19498
      oprot.writeFieldStop();
19499
      oprot.writeStructEnd();
19500
    }
19501
 
19502
    @Override
19503
    public String toString() {
19504
      StringBuilder sb = new StringBuilder("assignVoucher_result(");
19505
      boolean first = true;
19506
 
19507
      sb.append("success:");
19508
      if (this.success == null) {
19509
        sb.append("null");
19510
      } else {
19511
        sb.append(this.success);
19512
      }
19513
      first = false;
19514
      sb.append(")");
19515
      return sb.toString();
19516
    }
19517
 
19518
    public void validate() throws org.apache.thrift.TException {
19519
      // check for required fields
19520
    }
19521
 
19522
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
19523
      try {
19524
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
19525
      } catch (org.apache.thrift.TException te) {
19526
        throw new java.io.IOException(te);
19527
      }
19528
    }
19529
 
19530
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
19531
      try {
19532
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
19533
      } catch (org.apache.thrift.TException te) {
19534
        throw new java.io.IOException(te);
19535
      }
19536
    }
19537
 
19538
  }
19539
 
19540
  public static class markVoucherAsRedeemed_args implements org.apache.thrift.TBase<markVoucherAsRedeemed_args, markVoucherAsRedeemed_args._Fields>, java.io.Serializable, Cloneable   {
19541
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_args");
19542
 
19543
    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);
19544
    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);
19545
 
19546
    private String voucherCode; // required
19547
    private long redeemedOn; // required
19548
 
19549
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
19550
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
19551
      VOUCHER_CODE((short)1, "voucherCode"),
19552
      REDEEMED_ON((short)2, "redeemedOn");
19553
 
19554
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
19555
 
19556
      static {
19557
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
19558
          byName.put(field.getFieldName(), field);
19559
        }
19560
      }
19561
 
19562
      /**
19563
       * Find the _Fields constant that matches fieldId, or null if its not found.
19564
       */
19565
      public static _Fields findByThriftId(int fieldId) {
19566
        switch(fieldId) {
19567
          case 1: // VOUCHER_CODE
19568
            return VOUCHER_CODE;
19569
          case 2: // REDEEMED_ON
19570
            return REDEEMED_ON;
19571
          default:
19572
            return null;
19573
        }
19574
      }
19575
 
19576
      /**
19577
       * Find the _Fields constant that matches fieldId, throwing an exception
19578
       * if it is not found.
19579
       */
19580
      public static _Fields findByThriftIdOrThrow(int fieldId) {
19581
        _Fields fields = findByThriftId(fieldId);
19582
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
19583
        return fields;
19584
      }
19585
 
19586
      /**
19587
       * Find the _Fields constant that matches name, or null if its not found.
19588
       */
19589
      public static _Fields findByName(String name) {
19590
        return byName.get(name);
19591
      }
19592
 
19593
      private final short _thriftId;
19594
      private final String _fieldName;
19595
 
19596
      _Fields(short thriftId, String fieldName) {
19597
        _thriftId = thriftId;
19598
        _fieldName = fieldName;
19599
      }
19600
 
19601
      public short getThriftFieldId() {
19602
        return _thriftId;
19603
      }
19604
 
19605
      public String getFieldName() {
19606
        return _fieldName;
19607
      }
19608
    }
19609
 
19610
    // isset id assignments
19611
    private static final int __REDEEMEDON_ISSET_ID = 0;
19612
    private BitSet __isset_bit_vector = new BitSet(1);
19613
 
19614
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
19615
    static {
19616
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
19617
      tmpMap.put(_Fields.VOUCHER_CODE, new org.apache.thrift.meta_data.FieldMetaData("voucherCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
19618
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
19619
      tmpMap.put(_Fields.REDEEMED_ON, new org.apache.thrift.meta_data.FieldMetaData("redeemedOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
19620
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
19621
      metaDataMap = Collections.unmodifiableMap(tmpMap);
19622
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_args.class, metaDataMap);
19623
    }
19624
 
19625
    public markVoucherAsRedeemed_args() {
19626
    }
19627
 
19628
    public markVoucherAsRedeemed_args(
19629
      String voucherCode,
19630
      long redeemedOn)
19631
    {
19632
      this();
19633
      this.voucherCode = voucherCode;
19634
      this.redeemedOn = redeemedOn;
19635
      setRedeemedOnIsSet(true);
19636
    }
19637
 
19638
    /**
19639
     * Performs a deep copy on <i>other</i>.
19640
     */
19641
    public markVoucherAsRedeemed_args(markVoucherAsRedeemed_args other) {
19642
      __isset_bit_vector.clear();
19643
      __isset_bit_vector.or(other.__isset_bit_vector);
19644
      if (other.isSetVoucherCode()) {
19645
        this.voucherCode = other.voucherCode;
19646
      }
19647
      this.redeemedOn = other.redeemedOn;
19648
    }
19649
 
19650
    public markVoucherAsRedeemed_args deepCopy() {
19651
      return new markVoucherAsRedeemed_args(this);
19652
    }
19653
 
19654
    @Override
19655
    public void clear() {
19656
      this.voucherCode = null;
19657
      setRedeemedOnIsSet(false);
19658
      this.redeemedOn = 0;
19659
    }
19660
 
19661
    public String getVoucherCode() {
19662
      return this.voucherCode;
19663
    }
19664
 
19665
    public void setVoucherCode(String voucherCode) {
19666
      this.voucherCode = voucherCode;
19667
    }
19668
 
19669
    public void unsetVoucherCode() {
19670
      this.voucherCode = null;
19671
    }
19672
 
19673
    /** Returns true if field voucherCode is set (has been assigned a value) and false otherwise */
19674
    public boolean isSetVoucherCode() {
19675
      return this.voucherCode != null;
19676
    }
19677
 
19678
    public void setVoucherCodeIsSet(boolean value) {
19679
      if (!value) {
19680
        this.voucherCode = null;
19681
      }
19682
    }
19683
 
19684
    public long getRedeemedOn() {
19685
      return this.redeemedOn;
19686
    }
19687
 
19688
    public void setRedeemedOn(long redeemedOn) {
19689
      this.redeemedOn = redeemedOn;
19690
      setRedeemedOnIsSet(true);
19691
    }
19692
 
19693
    public void unsetRedeemedOn() {
19694
      __isset_bit_vector.clear(__REDEEMEDON_ISSET_ID);
19695
    }
19696
 
19697
    /** Returns true if field redeemedOn is set (has been assigned a value) and false otherwise */
19698
    public boolean isSetRedeemedOn() {
19699
      return __isset_bit_vector.get(__REDEEMEDON_ISSET_ID);
19700
    }
19701
 
19702
    public void setRedeemedOnIsSet(boolean value) {
19703
      __isset_bit_vector.set(__REDEEMEDON_ISSET_ID, value);
19704
    }
19705
 
19706
    public void setFieldValue(_Fields field, Object value) {
19707
      switch (field) {
19708
      case VOUCHER_CODE:
19709
        if (value == null) {
19710
          unsetVoucherCode();
19711
        } else {
19712
          setVoucherCode((String)value);
19713
        }
19714
        break;
19715
 
19716
      case REDEEMED_ON:
19717
        if (value == null) {
19718
          unsetRedeemedOn();
19719
        } else {
19720
          setRedeemedOn((Long)value);
19721
        }
19722
        break;
19723
 
19724
      }
19725
    }
19726
 
19727
    public Object getFieldValue(_Fields field) {
19728
      switch (field) {
19729
      case VOUCHER_CODE:
19730
        return getVoucherCode();
19731
 
19732
      case REDEEMED_ON:
19733
        return Long.valueOf(getRedeemedOn());
19734
 
19735
      }
19736
      throw new IllegalStateException();
19737
    }
19738
 
19739
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
19740
    public boolean isSet(_Fields field) {
19741
      if (field == null) {
19742
        throw new IllegalArgumentException();
19743
      }
19744
 
19745
      switch (field) {
19746
      case VOUCHER_CODE:
19747
        return isSetVoucherCode();
19748
      case REDEEMED_ON:
19749
        return isSetRedeemedOn();
19750
      }
19751
      throw new IllegalStateException();
19752
    }
19753
 
19754
    @Override
19755
    public boolean equals(Object that) {
19756
      if (that == null)
19757
        return false;
19758
      if (that instanceof markVoucherAsRedeemed_args)
19759
        return this.equals((markVoucherAsRedeemed_args)that);
19760
      return false;
19761
    }
19762
 
19763
    public boolean equals(markVoucherAsRedeemed_args that) {
19764
      if (that == null)
19765
        return false;
19766
 
19767
      boolean this_present_voucherCode = true && this.isSetVoucherCode();
19768
      boolean that_present_voucherCode = true && that.isSetVoucherCode();
19769
      if (this_present_voucherCode || that_present_voucherCode) {
19770
        if (!(this_present_voucherCode && that_present_voucherCode))
19771
          return false;
19772
        if (!this.voucherCode.equals(that.voucherCode))
19773
          return false;
19774
      }
19775
 
19776
      boolean this_present_redeemedOn = true;
19777
      boolean that_present_redeemedOn = true;
19778
      if (this_present_redeemedOn || that_present_redeemedOn) {
19779
        if (!(this_present_redeemedOn && that_present_redeemedOn))
19780
          return false;
19781
        if (this.redeemedOn != that.redeemedOn)
19782
          return false;
19783
      }
19784
 
19785
      return true;
19786
    }
19787
 
19788
    @Override
19789
    public int hashCode() {
19790
      return 0;
19791
    }
19792
 
19793
    public int compareTo(markVoucherAsRedeemed_args other) {
19794
      if (!getClass().equals(other.getClass())) {
19795
        return getClass().getName().compareTo(other.getClass().getName());
19796
      }
19797
 
19798
      int lastComparison = 0;
19799
      markVoucherAsRedeemed_args typedOther = (markVoucherAsRedeemed_args)other;
19800
 
19801
      lastComparison = Boolean.valueOf(isSetVoucherCode()).compareTo(typedOther.isSetVoucherCode());
19802
      if (lastComparison != 0) {
19803
        return lastComparison;
19804
      }
19805
      if (isSetVoucherCode()) {
19806
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherCode, typedOther.voucherCode);
19807
        if (lastComparison != 0) {
19808
          return lastComparison;
19809
        }
19810
      }
19811
      lastComparison = Boolean.valueOf(isSetRedeemedOn()).compareTo(typedOther.isSetRedeemedOn());
19812
      if (lastComparison != 0) {
19813
        return lastComparison;
19814
      }
19815
      if (isSetRedeemedOn()) {
19816
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.redeemedOn, typedOther.redeemedOn);
19817
        if (lastComparison != 0) {
19818
          return lastComparison;
19819
        }
19820
      }
19821
      return 0;
19822
    }
19823
 
19824
    public _Fields fieldForId(int fieldId) {
19825
      return _Fields.findByThriftId(fieldId);
19826
    }
19827
 
19828
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
19829
      org.apache.thrift.protocol.TField field;
19830
      iprot.readStructBegin();
19831
      while (true)
19832
      {
19833
        field = iprot.readFieldBegin();
19834
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
19835
          break;
19836
        }
19837
        switch (field.id) {
19838
          case 1: // VOUCHER_CODE
19839
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
19840
              this.voucherCode = iprot.readString();
19841
            } else { 
19842
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19843
            }
19844
            break;
19845
          case 2: // REDEEMED_ON
19846
            if (field.type == org.apache.thrift.protocol.TType.I64) {
19847
              this.redeemedOn = iprot.readI64();
19848
              setRedeemedOnIsSet(true);
19849
            } else { 
19850
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19851
            }
19852
            break;
19853
          default:
19854
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19855
        }
19856
        iprot.readFieldEnd();
19857
      }
19858
      iprot.readStructEnd();
19859
      validate();
19860
    }
19861
 
19862
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
19863
      validate();
19864
 
19865
      oprot.writeStructBegin(STRUCT_DESC);
19866
      if (this.voucherCode != null) {
19867
        oprot.writeFieldBegin(VOUCHER_CODE_FIELD_DESC);
19868
        oprot.writeString(this.voucherCode);
19869
        oprot.writeFieldEnd();
19870
      }
19871
      oprot.writeFieldBegin(REDEEMED_ON_FIELD_DESC);
19872
      oprot.writeI64(this.redeemedOn);
19873
      oprot.writeFieldEnd();
19874
      oprot.writeFieldStop();
19875
      oprot.writeStructEnd();
19876
    }
19877
 
19878
    @Override
19879
    public String toString() {
19880
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_args(");
19881
      boolean first = true;
19882
 
19883
      sb.append("voucherCode:");
19884
      if (this.voucherCode == null) {
19885
        sb.append("null");
19886
      } else {
19887
        sb.append(this.voucherCode);
19888
      }
19889
      first = false;
19890
      if (!first) sb.append(", ");
19891
      sb.append("redeemedOn:");
19892
      sb.append(this.redeemedOn);
19893
      first = false;
19894
      sb.append(")");
19895
      return sb.toString();
19896
    }
19897
 
19898
    public void validate() throws org.apache.thrift.TException {
19899
      // check for required fields
19900
    }
19901
 
19902
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
19903
      try {
19904
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
19905
      } catch (org.apache.thrift.TException te) {
19906
        throw new java.io.IOException(te);
19907
      }
19908
    }
19909
 
19910
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
19911
      try {
19912
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
19913
        __isset_bit_vector = new BitSet(1);
19914
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
19915
      } catch (org.apache.thrift.TException te) {
19916
        throw new java.io.IOException(te);
19917
      }
19918
    }
19919
 
19920
  }
19921
 
19922
  public static class markVoucherAsRedeemed_result implements org.apache.thrift.TBase<markVoucherAsRedeemed_result, markVoucherAsRedeemed_result._Fields>, java.io.Serializable, Cloneable   {
19923
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_result");
19924
 
19925
    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);
19926
 
19927
    private boolean success; // required
19928
 
19929
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
19930
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
19931
      SUCCESS((short)0, "success");
19932
 
19933
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
19934
 
19935
      static {
19936
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
19937
          byName.put(field.getFieldName(), field);
19938
        }
19939
      }
19940
 
19941
      /**
19942
       * Find the _Fields constant that matches fieldId, or null if its not found.
19943
       */
19944
      public static _Fields findByThriftId(int fieldId) {
19945
        switch(fieldId) {
19946
          case 0: // SUCCESS
19947
            return SUCCESS;
19948
          default:
19949
            return null;
19950
        }
19951
      }
19952
 
19953
      /**
19954
       * Find the _Fields constant that matches fieldId, throwing an exception
19955
       * if it is not found.
19956
       */
19957
      public static _Fields findByThriftIdOrThrow(int fieldId) {
19958
        _Fields fields = findByThriftId(fieldId);
19959
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
19960
        return fields;
19961
      }
19962
 
19963
      /**
19964
       * Find the _Fields constant that matches name, or null if its not found.
19965
       */
19966
      public static _Fields findByName(String name) {
19967
        return byName.get(name);
19968
      }
19969
 
19970
      private final short _thriftId;
19971
      private final String _fieldName;
19972
 
19973
      _Fields(short thriftId, String fieldName) {
19974
        _thriftId = thriftId;
19975
        _fieldName = fieldName;
19976
      }
19977
 
19978
      public short getThriftFieldId() {
19979
        return _thriftId;
19980
      }
19981
 
19982
      public String getFieldName() {
19983
        return _fieldName;
19984
      }
19985
    }
19986
 
19987
    // isset id assignments
19988
    private static final int __SUCCESS_ISSET_ID = 0;
19989
    private BitSet __isset_bit_vector = new BitSet(1);
19990
 
19991
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
19992
    static {
19993
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
19994
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
19995
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
19996
      metaDataMap = Collections.unmodifiableMap(tmpMap);
19997
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_result.class, metaDataMap);
19998
    }
19999
 
20000
    public markVoucherAsRedeemed_result() {
20001
    }
20002
 
20003
    public markVoucherAsRedeemed_result(
20004
      boolean success)
20005
    {
20006
      this();
20007
      this.success = success;
20008
      setSuccessIsSet(true);
20009
    }
20010
 
20011
    /**
20012
     * Performs a deep copy on <i>other</i>.
20013
     */
20014
    public markVoucherAsRedeemed_result(markVoucherAsRedeemed_result other) {
20015
      __isset_bit_vector.clear();
20016
      __isset_bit_vector.or(other.__isset_bit_vector);
20017
      this.success = other.success;
20018
    }
20019
 
20020
    public markVoucherAsRedeemed_result deepCopy() {
20021
      return new markVoucherAsRedeemed_result(this);
20022
    }
20023
 
20024
    @Override
20025
    public void clear() {
20026
      setSuccessIsSet(false);
20027
      this.success = false;
20028
    }
20029
 
20030
    public boolean isSuccess() {
20031
      return this.success;
20032
    }
20033
 
20034
    public void setSuccess(boolean success) {
20035
      this.success = success;
20036
      setSuccessIsSet(true);
20037
    }
20038
 
20039
    public void unsetSuccess() {
20040
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
20041
    }
20042
 
20043
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
20044
    public boolean isSetSuccess() {
20045
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
20046
    }
20047
 
20048
    public void setSuccessIsSet(boolean value) {
20049
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
20050
    }
20051
 
20052
    public void setFieldValue(_Fields field, Object value) {
20053
      switch (field) {
20054
      case SUCCESS:
20055
        if (value == null) {
20056
          unsetSuccess();
20057
        } else {
20058
          setSuccess((Boolean)value);
20059
        }
20060
        break;
20061
 
20062
      }
20063
    }
20064
 
20065
    public Object getFieldValue(_Fields field) {
20066
      switch (field) {
20067
      case SUCCESS:
20068
        return Boolean.valueOf(isSuccess());
20069
 
20070
      }
20071
      throw new IllegalStateException();
20072
    }
20073
 
20074
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
20075
    public boolean isSet(_Fields field) {
20076
      if (field == null) {
20077
        throw new IllegalArgumentException();
20078
      }
20079
 
20080
      switch (field) {
20081
      case SUCCESS:
20082
        return isSetSuccess();
20083
      }
20084
      throw new IllegalStateException();
20085
    }
20086
 
20087
    @Override
20088
    public boolean equals(Object that) {
20089
      if (that == null)
20090
        return false;
20091
      if (that instanceof markVoucherAsRedeemed_result)
20092
        return this.equals((markVoucherAsRedeemed_result)that);
20093
      return false;
20094
    }
20095
 
20096
    public boolean equals(markVoucherAsRedeemed_result that) {
20097
      if (that == null)
20098
        return false;
20099
 
20100
      boolean this_present_success = true;
20101
      boolean that_present_success = true;
20102
      if (this_present_success || that_present_success) {
20103
        if (!(this_present_success && that_present_success))
20104
          return false;
20105
        if (this.success != that.success)
20106
          return false;
20107
      }
20108
 
20109
      return true;
20110
    }
20111
 
20112
    @Override
20113
    public int hashCode() {
20114
      return 0;
20115
    }
20116
 
20117
    public int compareTo(markVoucherAsRedeemed_result other) {
20118
      if (!getClass().equals(other.getClass())) {
20119
        return getClass().getName().compareTo(other.getClass().getName());
20120
      }
20121
 
20122
      int lastComparison = 0;
20123
      markVoucherAsRedeemed_result typedOther = (markVoucherAsRedeemed_result)other;
20124
 
20125
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
20126
      if (lastComparison != 0) {
20127
        return lastComparison;
20128
      }
20129
      if (isSetSuccess()) {
20130
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
20131
        if (lastComparison != 0) {
20132
          return lastComparison;
20133
        }
20134
      }
20135
      return 0;
20136
    }
20137
 
20138
    public _Fields fieldForId(int fieldId) {
20139
      return _Fields.findByThriftId(fieldId);
20140
    }
20141
 
20142
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
20143
      org.apache.thrift.protocol.TField field;
20144
      iprot.readStructBegin();
20145
      while (true)
20146
      {
20147
        field = iprot.readFieldBegin();
20148
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
20149
          break;
20150
        }
20151
        switch (field.id) {
20152
          case 0: // SUCCESS
20153
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
20154
              this.success = iprot.readBool();
20155
              setSuccessIsSet(true);
20156
            } else { 
20157
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
20158
            }
20159
            break;
20160
          default:
20161
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
20162
        }
20163
        iprot.readFieldEnd();
20164
      }
20165
      iprot.readStructEnd();
20166
      validate();
20167
    }
20168
 
20169
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
20170
      oprot.writeStructBegin(STRUCT_DESC);
20171
 
20172
      if (this.isSetSuccess()) {
20173
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
20174
        oprot.writeBool(this.success);
20175
        oprot.writeFieldEnd();
20176
      }
20177
      oprot.writeFieldStop();
20178
      oprot.writeStructEnd();
20179
    }
20180
 
20181
    @Override
20182
    public String toString() {
20183
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_result(");
20184
      boolean first = true;
20185
 
20186
      sb.append("success:");
20187
      sb.append(this.success);
20188
      first = false;
20189
      sb.append(")");
20190
      return sb.toString();
20191
    }
20192
 
20193
    public void validate() throws org.apache.thrift.TException {
20194
      // check for required fields
20195
    }
20196
 
20197
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
20198
      try {
20199
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
20200
      } catch (org.apache.thrift.TException te) {
20201
        throw new java.io.IOException(te);
20202
      }
20203
    }
20204
 
20205
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
20206
      try {
20207
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
20208
      } catch (org.apache.thrift.TException te) {
20209
        throw new java.io.IOException(te);
20210
      }
20211
    }
20212
 
20213
  }
20214
 
1982 varun.gupt 20215
}