Subversion Repositories SmartDukaan

Rev

Rev 9791 | Rev 11819 | 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
 
6356 amit.gupta 38
    public boolean isCodApplicable(String couponCode) throws PromotionException, org.apache.thrift.TException;
39
 
3430 rajveer 40
    public List<Promotion> getAllPromotions() throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 41
 
3430 rajveer 42
    public Promotion getPromotionById(long promotionId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 43
 
3430 rajveer 44
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 45
 
3430 rajveer 46
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 47
 
6736 amit.gupta 48
    public Map<Long,Double> getEmiDiscount(long cartId) throws PromotionException, org.apache.thrift.TException;
49
 
6433 anupam.sin 50
    public Map<Long,String> applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws PromotionException, org.apache.thrift.TException;
51
 
3430 rajveer 52
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 53
 
3430 rajveer 54
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 55
 
6497 amit.gupta 56
    public List<Coupon> getActiveCodes(long promotionId) throws PromotionException, org.apache.thrift.TException;
57
 
58
    public void deleteCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
59
 
7092 amit.gupta 60
    public List<Coupon> getAllCouponsByPromotionId(long promotionId) throws PromotionException, org.apache.thrift.TException;
61
 
3385 varun.gupt 62
    /**
63
     * Returns a list of active coupons
64
     */
3430 rajveer 65
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException;
3385 varun.gupt 66
 
67
    /**
6561 amit.gupta 68
     * Creates a coupon with prefix (optional, pass null)and returns couponcode if successfully created.
6250 amit.gupta 69
     * 
70
     * @param promotionId
8707 manish.sha 71
     * @param couponCategory
6730 anupam.sin 72
     * @param couponCode
6679 anupam.sin 73
     * @param arguments
6356 amit.gupta 74
     * @param isCod
6561 amit.gupta 75
     * @param prefix
6250 amit.gupta 76
     */
8707 manish.sha 77
    public String createCoupon(long promotionId, long couponCategory, String couponCode, String arguments, boolean isCod, String prefix) throws PromotionException, org.apache.thrift.TException;
6250 amit.gupta 78
 
79
    /**
3385 varun.gupt 80
     * Returns the count of successful payments done using a given coupon
81
     * 
82
     * @param couponCode
83
     */
3430 rajveer 84
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
3385 varun.gupt 85
 
86
    /**
87
     * Returns the doc string of the rule module
88
     * 
89
     * @param ruleName
90
     */
3430 rajveer 91
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException;
3385 varun.gupt 92
 
4189 varun.gupt 93
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException;
94
 
4494 varun.gupt 95
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException;
96
 
5469 rajveer 97
    public void addVoucher(Voucher voucher) throws org.apache.thrift.TException;
98
 
99
    public Voucher assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException;
100
 
101
    public boolean markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException;
102
 
1982 varun.gupt 103
  }
104
 
3430 rajveer 105
  public interface AsyncIface extends in.shop2020.generic.GenericService .AsyncIface {
1982 varun.gupt 106
 
3430 rajveer 107
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.createPromotion_call> resultHandler) throws org.apache.thrift.TException;
1982 varun.gupt 108
 
7746 amit.gupta 109
    public void removeAllCouponsByPromotionId(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.removeAllCouponsByPromotionId_call> resultHandler) throws org.apache.thrift.TException;
110
 
6301 amit.gupta 111
    public void getCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCoupon_call> resultHandler) throws org.apache.thrift.TException;
112
 
113
    public void isGiftVoucher(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.isGiftVoucher_call> resultHandler) throws org.apache.thrift.TException;
114
 
6356 amit.gupta 115
    public void isCodApplicable(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.isCodApplicable_call> resultHandler) throws org.apache.thrift.TException;
116
 
3430 rajveer 117
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllPromotions_call> resultHandler) throws org.apache.thrift.TException;
118
 
119
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPromotionById_call> resultHandler) throws org.apache.thrift.TException;
120
 
121
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException;
122
 
123
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyCoupon_call> resultHandler) throws org.apache.thrift.TException;
124
 
6736 amit.gupta 125
    public void getEmiDiscount(long cartId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getEmiDiscount_call> resultHandler) throws org.apache.thrift.TException;
126
 
6433 anupam.sin 127
    public void applyRechargeCoupon(String couponCode, long totalAmount, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyRechargeCoupon_call> resultHandler) throws org.apache.thrift.TException;
128
 
3430 rajveer 129
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException;
130
 
131
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException;
132
 
6497 amit.gupta 133
    public void getActiveCodes(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getActiveCodes_call> resultHandler) throws org.apache.thrift.TException;
134
 
135
    public void deleteCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.deleteCoupon_call> resultHandler) throws org.apache.thrift.TException;
136
 
7092 amit.gupta 137
    public void getAllCouponsByPromotionId(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllCouponsByPromotionId_call> resultHandler) throws org.apache.thrift.TException;
138
 
3430 rajveer 139
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException;
140
 
8707 manish.sha 141
    public void createCoupon(long promotionId, long couponCategory, String couponCode, String arguments, boolean isCod, String prefix, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.createCoupon_call> resultHandler) throws org.apache.thrift.TException;
6250 amit.gupta 142
 
3430 rajveer 143
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException;
144
 
145
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getRuleDocString_call> resultHandler) throws org.apache.thrift.TException;
146
 
4189 varun.gupt 147
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException;
148
 
4494 varun.gupt 149
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException;
150
 
5469 rajveer 151
    public void addVoucher(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.addVoucher_call> resultHandler) throws org.apache.thrift.TException;
152
 
153
    public void assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.assignVoucher_call> resultHandler) throws org.apache.thrift.TException;
154
 
155
    public void markVoucherAsRedeemed(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.markVoucherAsRedeemed_call> resultHandler) throws org.apache.thrift.TException;
156
 
3430 rajveer 157
  }
158
 
159
  public static class Client extends in.shop2020.generic.GenericService.Client implements Iface {
160
    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
161
      public Factory() {}
162
      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
163
        return new Client(prot);
164
      }
165
      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
166
        return new Client(iprot, oprot);
167
      }
1982 varun.gupt 168
    }
169
 
3430 rajveer 170
    public Client(org.apache.thrift.protocol.TProtocol prot)
1982 varun.gupt 171
    {
3430 rajveer 172
      super(prot, prot);
1982 varun.gupt 173
    }
174
 
3430 rajveer 175
    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
176
      super(iprot, oprot);
1982 varun.gupt 177
    }
178
 
3430 rajveer 179
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 180
    {
181
      send_createPromotion(name, ruleExecutionSrc, startOn, endOn);
182
      recv_createPromotion();
183
    }
184
 
3430 rajveer 185
    public void send_createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws org.apache.thrift.TException
1982 varun.gupt 186
    {
187
      createPromotion_args args = new createPromotion_args();
3430 rajveer 188
      args.setName(name);
189
      args.setRuleExecutionSrc(ruleExecutionSrc);
190
      args.setStartOn(startOn);
191
      args.setEndOn(endOn);
192
      sendBase("createPromotion", args);
1982 varun.gupt 193
    }
194
 
3430 rajveer 195
    public void recv_createPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 196
    {
197
      createPromotion_result result = new createPromotion_result();
3430 rajveer 198
      receiveBase(result, "createPromotion");
1982 varun.gupt 199
      if (result.pex != null) {
200
        throw result.pex;
201
      }
202
      return;
203
    }
204
 
7746 amit.gupta 205
    public long removeAllCouponsByPromotionId(long promotionId) throws PromotionException, org.apache.thrift.TException
206
    {
207
      send_removeAllCouponsByPromotionId(promotionId);
208
      return recv_removeAllCouponsByPromotionId();
209
    }
210
 
211
    public void send_removeAllCouponsByPromotionId(long promotionId) throws org.apache.thrift.TException
212
    {
213
      removeAllCouponsByPromotionId_args args = new removeAllCouponsByPromotionId_args();
214
      args.setPromotionId(promotionId);
215
      sendBase("removeAllCouponsByPromotionId", args);
216
    }
217
 
218
    public long recv_removeAllCouponsByPromotionId() throws PromotionException, org.apache.thrift.TException
219
    {
220
      removeAllCouponsByPromotionId_result result = new removeAllCouponsByPromotionId_result();
221
      receiveBase(result, "removeAllCouponsByPromotionId");
222
      if (result.isSetSuccess()) {
223
        return result.success;
224
      }
225
      if (result.pex != null) {
226
        throw result.pex;
227
      }
228
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "removeAllCouponsByPromotionId failed: unknown result");
229
    }
230
 
6301 amit.gupta 231
    public Coupon getCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
232
    {
233
      send_getCoupon(couponCode);
234
      return recv_getCoupon();
235
    }
236
 
237
    public void send_getCoupon(String couponCode) throws org.apache.thrift.TException
238
    {
239
      getCoupon_args args = new getCoupon_args();
240
      args.setCouponCode(couponCode);
241
      sendBase("getCoupon", args);
242
    }
243
 
244
    public Coupon recv_getCoupon() throws PromotionException, org.apache.thrift.TException
245
    {
246
      getCoupon_result result = new getCoupon_result();
247
      receiveBase(result, "getCoupon");
248
      if (result.isSetSuccess()) {
249
        return result.success;
250
      }
251
      if (result.pex != null) {
252
        throw result.pex;
253
      }
254
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCoupon failed: unknown result");
255
    }
256
 
257
    public boolean isGiftVoucher(String couponCode) throws PromotionException, org.apache.thrift.TException
258
    {
259
      send_isGiftVoucher(couponCode);
260
      return recv_isGiftVoucher();
261
    }
262
 
263
    public void send_isGiftVoucher(String couponCode) throws org.apache.thrift.TException
264
    {
265
      isGiftVoucher_args args = new isGiftVoucher_args();
266
      args.setCouponCode(couponCode);
267
      sendBase("isGiftVoucher", args);
268
    }
269
 
270
    public boolean recv_isGiftVoucher() throws PromotionException, org.apache.thrift.TException
271
    {
272
      isGiftVoucher_result result = new isGiftVoucher_result();
273
      receiveBase(result, "isGiftVoucher");
274
      if (result.isSetSuccess()) {
275
        return result.success;
276
      }
277
      if (result.pex != null) {
278
        throw result.pex;
279
      }
280
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isGiftVoucher failed: unknown result");
281
    }
282
 
6356 amit.gupta 283
    public boolean isCodApplicable(String couponCode) throws PromotionException, org.apache.thrift.TException
284
    {
285
      send_isCodApplicable(couponCode);
286
      return recv_isCodApplicable();
287
    }
288
 
289
    public void send_isCodApplicable(String couponCode) throws org.apache.thrift.TException
290
    {
291
      isCodApplicable_args args = new isCodApplicable_args();
292
      args.setCouponCode(couponCode);
293
      sendBase("isCodApplicable", args);
294
    }
295
 
296
    public boolean recv_isCodApplicable() throws PromotionException, org.apache.thrift.TException
297
    {
298
      isCodApplicable_result result = new isCodApplicable_result();
299
      receiveBase(result, "isCodApplicable");
300
      if (result.isSetSuccess()) {
301
        return result.success;
302
      }
303
      if (result.pex != null) {
304
        throw result.pex;
305
      }
306
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isCodApplicable failed: unknown result");
307
    }
308
 
3430 rajveer 309
    public List<Promotion> getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 310
    {
311
      send_getAllPromotions();
312
      return recv_getAllPromotions();
313
    }
314
 
3430 rajveer 315
    public void send_getAllPromotions() throws org.apache.thrift.TException
1982 varun.gupt 316
    {
317
      getAllPromotions_args args = new getAllPromotions_args();
3430 rajveer 318
      sendBase("getAllPromotions", args);
1982 varun.gupt 319
    }
320
 
3430 rajveer 321
    public List<Promotion> recv_getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 322
    {
323
      getAllPromotions_result result = new getAllPromotions_result();
3430 rajveer 324
      receiveBase(result, "getAllPromotions");
1982 varun.gupt 325
      if (result.isSetSuccess()) {
326
        return result.success;
327
      }
328
      if (result.pex != null) {
329
        throw result.pex;
330
      }
3430 rajveer 331
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllPromotions failed: unknown result");
1982 varun.gupt 332
    }
333
 
3430 rajveer 334
    public Promotion getPromotionById(long promotionId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 335
    {
336
      send_getPromotionById(promotionId);
337
      return recv_getPromotionById();
338
    }
339
 
3430 rajveer 340
    public void send_getPromotionById(long promotionId) throws org.apache.thrift.TException
1982 varun.gupt 341
    {
342
      getPromotionById_args args = new getPromotionById_args();
3430 rajveer 343
      args.setPromotionId(promotionId);
344
      sendBase("getPromotionById", args);
1982 varun.gupt 345
    }
346
 
3430 rajveer 347
    public Promotion recv_getPromotionById() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 348
    {
349
      getPromotionById_result result = new getPromotionById_result();
3430 rajveer 350
      receiveBase(result, "getPromotionById");
1982 varun.gupt 351
      if (result.isSetSuccess()) {
352
        return result.success;
353
      }
354
      if (result.pex != null) {
355
        throw result.pex;
356
      }
3430 rajveer 357
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPromotionById failed: unknown result");
1982 varun.gupt 358
    }
359
 
3430 rajveer 360
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 361
    {
362
      send_generateCouponsForPromotion(promotionId, couponCode);
363
      recv_generateCouponsForPromotion();
364
    }
365
 
3430 rajveer 366
    public void send_generateCouponsForPromotion(long promotionId, String couponCode) throws org.apache.thrift.TException
1982 varun.gupt 367
    {
368
      generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
3430 rajveer 369
      args.setPromotionId(promotionId);
370
      args.setCouponCode(couponCode);
371
      sendBase("generateCouponsForPromotion", args);
1982 varun.gupt 372
    }
373
 
3430 rajveer 374
    public void recv_generateCouponsForPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 375
    {
376
      generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
3430 rajveer 377
      receiveBase(result, "generateCouponsForPromotion");
1982 varun.gupt 378
      if (result.pex != null) {
379
        throw result.pex;
380
      }
381
      return;
382
    }
383
 
3430 rajveer 384
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 385
    {
386
      send_applyCoupon(couponCode, cartId);
387
      return recv_applyCoupon();
388
    }
389
 
3430 rajveer 390
    public void send_applyCoupon(String couponCode, long cartId) throws org.apache.thrift.TException
1982 varun.gupt 391
    {
392
      applyCoupon_args args = new applyCoupon_args();
3430 rajveer 393
      args.setCouponCode(couponCode);
394
      args.setCartId(cartId);
395
      sendBase("applyCoupon", args);
1982 varun.gupt 396
    }
397
 
3430 rajveer 398
    public Cart recv_applyCoupon() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 399
    {
400
      applyCoupon_result result = new applyCoupon_result();
3430 rajveer 401
      receiveBase(result, "applyCoupon");
1982 varun.gupt 402
      if (result.isSetSuccess()) {
403
        return result.success;
404
      }
405
      if (result.pex != null) {
406
        throw result.pex;
407
      }
3430 rajveer 408
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "applyCoupon failed: unknown result");
1982 varun.gupt 409
    }
410
 
6736 amit.gupta 411
    public Map<Long,Double> getEmiDiscount(long cartId) throws PromotionException, org.apache.thrift.TException
412
    {
413
      send_getEmiDiscount(cartId);
414
      return recv_getEmiDiscount();
415
    }
416
 
417
    public void send_getEmiDiscount(long cartId) throws org.apache.thrift.TException
418
    {
419
      getEmiDiscount_args args = new getEmiDiscount_args();
420
      args.setCartId(cartId);
421
      sendBase("getEmiDiscount", args);
422
    }
423
 
424
    public Map<Long,Double> recv_getEmiDiscount() throws PromotionException, org.apache.thrift.TException
425
    {
426
      getEmiDiscount_result result = new getEmiDiscount_result();
427
      receiveBase(result, "getEmiDiscount");
428
      if (result.isSetSuccess()) {
429
        return result.success;
430
      }
431
      if (result.pex != null) {
432
        throw result.pex;
433
      }
434
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getEmiDiscount failed: unknown result");
435
    }
436
 
6433 anupam.sin 437
    public Map<Long,String> applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws PromotionException, org.apache.thrift.TException
438
    {
439
      send_applyRechargeCoupon(couponCode, totalAmount, userId);
440
      return recv_applyRechargeCoupon();
441
    }
442
 
443
    public void send_applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws org.apache.thrift.TException
444
    {
445
      applyRechargeCoupon_args args = new applyRechargeCoupon_args();
446
      args.setCouponCode(couponCode);
447
      args.setTotalAmount(totalAmount);
448
      args.setUserId(userId);
449
      sendBase("applyRechargeCoupon", args);
450
    }
451
 
452
    public Map<Long,String> recv_applyRechargeCoupon() throws PromotionException, org.apache.thrift.TException
453
    {
454
      applyRechargeCoupon_result result = new applyRechargeCoupon_result();
455
      receiveBase(result, "applyRechargeCoupon");
456
      if (result.isSetSuccess()) {
457
        return result.success;
458
      }
459
      if (result.pex != null) {
460
        throw result.pex;
461
      }
462
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "applyRechargeCoupon failed: unknown result");
463
    }
464
 
3430 rajveer 465
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 466
    {
467
      send_trackCouponUsage(couponCode, transactionId, userId);
468
      recv_trackCouponUsage();
469
    }
470
 
3430 rajveer 471
    public void send_trackCouponUsage(String couponCode, long transactionId, long userId) throws org.apache.thrift.TException
1982 varun.gupt 472
    {
473
      trackCouponUsage_args args = new trackCouponUsage_args();
3430 rajveer 474
      args.setCouponCode(couponCode);
475
      args.setTransactionId(transactionId);
476
      args.setUserId(userId);
477
      sendBase("trackCouponUsage", args);
1982 varun.gupt 478
    }
479
 
3430 rajveer 480
    public void recv_trackCouponUsage() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 481
    {
482
      trackCouponUsage_result result = new trackCouponUsage_result();
3430 rajveer 483
      receiveBase(result, "trackCouponUsage");
1982 varun.gupt 484
      if (result.pex != null) {
485
        throw result.pex;
486
      }
487
      return;
488
    }
489
 
3430 rajveer 490
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 491
    {
492
      send_getCouponUsageCountByUser(couponCode, userId);
493
      return recv_getCouponUsageCountByUser();
494
    }
495
 
3430 rajveer 496
    public void send_getCouponUsageCountByUser(String couponCode, long userId) throws org.apache.thrift.TException
1982 varun.gupt 497
    {
498
      getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
3430 rajveer 499
      args.setCouponCode(couponCode);
500
      args.setUserId(userId);
501
      sendBase("getCouponUsageCountByUser", args);
1982 varun.gupt 502
    }
503
 
3430 rajveer 504
    public long recv_getCouponUsageCountByUser() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 505
    {
506
      getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
3430 rajveer 507
      receiveBase(result, "getCouponUsageCountByUser");
1982 varun.gupt 508
      if (result.isSetSuccess()) {
509
        return result.success;
510
      }
511
      if (result.pex != null) {
512
        throw result.pex;
513
      }
3430 rajveer 514
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCouponUsageCountByUser failed: unknown result");
1982 varun.gupt 515
    }
516
 
6497 amit.gupta 517
    public List<Coupon> getActiveCodes(long promotionId) throws PromotionException, org.apache.thrift.TException
518
    {
519
      send_getActiveCodes(promotionId);
520
      return recv_getActiveCodes();
521
    }
522
 
523
    public void send_getActiveCodes(long promotionId) throws org.apache.thrift.TException
524
    {
525
      getActiveCodes_args args = new getActiveCodes_args();
526
      args.setPromotionId(promotionId);
527
      sendBase("getActiveCodes", args);
528
    }
529
 
530
    public List<Coupon> recv_getActiveCodes() throws PromotionException, org.apache.thrift.TException
531
    {
532
      getActiveCodes_result result = new getActiveCodes_result();
533
      receiveBase(result, "getActiveCodes");
534
      if (result.isSetSuccess()) {
535
        return result.success;
536
      }
537
      if (result.pex != null) {
538
        throw result.pex;
539
      }
540
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getActiveCodes failed: unknown result");
541
    }
542
 
543
    public void deleteCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
544
    {
545
      send_deleteCoupon(couponCode);
546
      recv_deleteCoupon();
547
    }
548
 
549
    public void send_deleteCoupon(String couponCode) throws org.apache.thrift.TException
550
    {
551
      deleteCoupon_args args = new deleteCoupon_args();
552
      args.setCouponCode(couponCode);
553
      sendBase("deleteCoupon", args);
554
    }
555
 
556
    public void recv_deleteCoupon() throws PromotionException, org.apache.thrift.TException
557
    {
558
      deleteCoupon_result result = new deleteCoupon_result();
559
      receiveBase(result, "deleteCoupon");
560
      if (result.pex != null) {
561
        throw result.pex;
562
      }
563
      return;
564
    }
565
 
7092 amit.gupta 566
    public List<Coupon> getAllCouponsByPromotionId(long promotionId) throws PromotionException, org.apache.thrift.TException
567
    {
568
      send_getAllCouponsByPromotionId(promotionId);
569
      return recv_getAllCouponsByPromotionId();
570
    }
571
 
572
    public void send_getAllCouponsByPromotionId(long promotionId) throws org.apache.thrift.TException
573
    {
574
      getAllCouponsByPromotionId_args args = new getAllCouponsByPromotionId_args();
575
      args.setPromotionId(promotionId);
576
      sendBase("getAllCouponsByPromotionId", args);
577
    }
578
 
579
    public List<Coupon> recv_getAllCouponsByPromotionId() throws PromotionException, org.apache.thrift.TException
580
    {
581
      getAllCouponsByPromotionId_result result = new getAllCouponsByPromotionId_result();
582
      receiveBase(result, "getAllCouponsByPromotionId");
583
      if (result.isSetSuccess()) {
584
        return result.success;
585
      }
586
      if (result.pex != null) {
587
        throw result.pex;
588
      }
589
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllCouponsByPromotionId failed: unknown result");
590
    }
591
 
3430 rajveer 592
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 593
    {
594
      send_getActiveCoupons();
595
      return recv_getActiveCoupons();
596
    }
597
 
3430 rajveer 598
    public void send_getActiveCoupons() throws org.apache.thrift.TException
3385 varun.gupt 599
    {
600
      getActiveCoupons_args args = new getActiveCoupons_args();
3430 rajveer 601
      sendBase("getActiveCoupons", args);
3385 varun.gupt 602
    }
603
 
3430 rajveer 604
    public List<Coupon> recv_getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 605
    {
606
      getActiveCoupons_result result = new getActiveCoupons_result();
3430 rajveer 607
      receiveBase(result, "getActiveCoupons");
3385 varun.gupt 608
      if (result.isSetSuccess()) {
609
        return result.success;
610
      }
611
      if (result.pex != null) {
612
        throw result.pex;
613
      }
3430 rajveer 614
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getActiveCoupons failed: unknown result");
3385 varun.gupt 615
    }
616
 
8707 manish.sha 617
    public String createCoupon(long promotionId, long couponCategory, String couponCode, String arguments, boolean isCod, String prefix) throws PromotionException, org.apache.thrift.TException
6250 amit.gupta 618
    {
8707 manish.sha 619
      send_createCoupon(promotionId, couponCategory, couponCode, arguments, isCod, prefix);
6250 amit.gupta 620
      return recv_createCoupon();
621
    }
622
 
8707 manish.sha 623
    public void send_createCoupon(long promotionId, long couponCategory, String couponCode, String arguments, boolean isCod, String prefix) throws org.apache.thrift.TException
6250 amit.gupta 624
    {
625
      createCoupon_args args = new createCoupon_args();
626
      args.setPromotionId(promotionId);
8707 manish.sha 627
      args.setCouponCategory(couponCategory);
6730 anupam.sin 628
      args.setCouponCode(couponCode);
6679 anupam.sin 629
      args.setArguments(arguments);
6356 amit.gupta 630
      args.setIsCod(isCod);
6561 amit.gupta 631
      args.setPrefix(prefix);
6250 amit.gupta 632
      sendBase("createCoupon", args);
633
    }
634
 
635
    public String recv_createCoupon() throws PromotionException, org.apache.thrift.TException
636
    {
637
      createCoupon_result result = new createCoupon_result();
638
      receiveBase(result, "createCoupon");
639
      if (result.isSetSuccess()) {
640
        return result.success;
641
      }
642
      if (result.pex != null) {
643
        throw result.pex;
644
      }
645
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createCoupon failed: unknown result");
646
    }
647
 
3430 rajveer 648
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 649
    {
650
      send_getSuccessfulPaymentCountForCoupon(couponCode);
651
      return recv_getSuccessfulPaymentCountForCoupon();
652
    }
653
 
3430 rajveer 654
    public void send_getSuccessfulPaymentCountForCoupon(String couponCode) throws org.apache.thrift.TException
3385 varun.gupt 655
    {
656
      getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
3430 rajveer 657
      args.setCouponCode(couponCode);
658
      sendBase("getSuccessfulPaymentCountForCoupon", args);
3385 varun.gupt 659
    }
660
 
3430 rajveer 661
    public long recv_getSuccessfulPaymentCountForCoupon() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 662
    {
663
      getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
3430 rajveer 664
      receiveBase(result, "getSuccessfulPaymentCountForCoupon");
3385 varun.gupt 665
      if (result.isSetSuccess()) {
666
        return result.success;
667
      }
668
      if (result.pex != null) {
669
        throw result.pex;
670
      }
3430 rajveer 671
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSuccessfulPaymentCountForCoupon failed: unknown result");
3385 varun.gupt 672
    }
673
 
3430 rajveer 674
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 675
    {
676
      send_getRuleDocString(ruleName);
677
      return recv_getRuleDocString();
678
    }
679
 
3430 rajveer 680
    public void send_getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 681
    {
682
      getRuleDocString_args args = new getRuleDocString_args();
3430 rajveer 683
      args.setRuleName(ruleName);
684
      sendBase("getRuleDocString", args);
3385 varun.gupt 685
    }
686
 
3430 rajveer 687
    public String recv_getRuleDocString() throws org.apache.thrift.TException
3385 varun.gupt 688
    {
689
      getRuleDocString_result result = new getRuleDocString_result();
3430 rajveer 690
      receiveBase(result, "getRuleDocString");
3385 varun.gupt 691
      if (result.isSetSuccess()) {
692
        return result.success;
693
      }
3430 rajveer 694
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRuleDocString failed: unknown result");
3385 varun.gupt 695
    }
696
 
4189 varun.gupt 697
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException
698
    {
699
      send_getItemDiscountMap(itemIds);
700
      return recv_getItemDiscountMap();
701
    }
702
 
703
    public void send_getItemDiscountMap(List<Long> itemIds) throws org.apache.thrift.TException
704
    {
705
      getItemDiscountMap_args args = new getItemDiscountMap_args();
706
      args.setItemIds(itemIds);
707
      sendBase("getItemDiscountMap", args);
708
    }
709
 
710
    public List<ItemCouponDiscount> recv_getItemDiscountMap() throws PromotionException, org.apache.thrift.TException
711
    {
712
      getItemDiscountMap_result result = new getItemDiscountMap_result();
713
      receiveBase(result, "getItemDiscountMap");
714
      if (result.isSetSuccess()) {
715
        return result.success;
716
      }
717
      if (result.pex != null) {
718
        throw result.pex;
719
      }
720
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemDiscountMap failed: unknown result");
721
    }
722
 
4494 varun.gupt 723
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
724
    {
725
      send_getDiscountsForEntity(entityId);
726
      return recv_getDiscountsForEntity();
727
    }
728
 
729
    public void send_getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
730
    {
731
      getDiscountsForEntity_args args = new getDiscountsForEntity_args();
732
      args.setEntityId(entityId);
733
      sendBase("getDiscountsForEntity", args);
734
    }
735
 
736
    public Map<String,Double> recv_getDiscountsForEntity() throws org.apache.thrift.TException
737
    {
738
      getDiscountsForEntity_result result = new getDiscountsForEntity_result();
739
      receiveBase(result, "getDiscountsForEntity");
740
      if (result.isSetSuccess()) {
741
        return result.success;
742
      }
743
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getDiscountsForEntity failed: unknown result");
744
    }
745
 
5469 rajveer 746
    public void addVoucher(Voucher voucher) throws org.apache.thrift.TException
747
    {
748
      send_addVoucher(voucher);
749
      recv_addVoucher();
750
    }
751
 
752
    public void send_addVoucher(Voucher voucher) throws org.apache.thrift.TException
753
    {
754
      addVoucher_args args = new addVoucher_args();
755
      args.setVoucher(voucher);
756
      sendBase("addVoucher", args);
757
    }
758
 
759
    public void recv_addVoucher() throws org.apache.thrift.TException
760
    {
761
      addVoucher_result result = new addVoucher_result();
762
      receiveBase(result, "addVoucher");
763
      return;
764
    }
765
 
766
    public Voucher assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException
767
    {
768
      send_assignVoucher(userId, userEmail, voucherType, amount);
769
      return recv_assignVoucher();
770
    }
771
 
772
    public void send_assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException
773
    {
774
      assignVoucher_args args = new assignVoucher_args();
775
      args.setUserId(userId);
776
      args.setUserEmail(userEmail);
777
      args.setVoucherType(voucherType);
778
      args.setAmount(amount);
779
      sendBase("assignVoucher", args);
780
    }
781
 
782
    public Voucher recv_assignVoucher() throws org.apache.thrift.TException
783
    {
784
      assignVoucher_result result = new assignVoucher_result();
785
      receiveBase(result, "assignVoucher");
786
      if (result.isSetSuccess()) {
787
        return result.success;
788
      }
789
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "assignVoucher failed: unknown result");
790
    }
791
 
792
    public boolean markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException
793
    {
794
      send_markVoucherAsRedeemed(voucherCode, redeemedOn);
795
      return recv_markVoucherAsRedeemed();
796
    }
797
 
798
    public void send_markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException
799
    {
800
      markVoucherAsRedeemed_args args = new markVoucherAsRedeemed_args();
801
      args.setVoucherCode(voucherCode);
802
      args.setRedeemedOn(redeemedOn);
803
      sendBase("markVoucherAsRedeemed", args);
804
    }
805
 
806
    public boolean recv_markVoucherAsRedeemed() throws org.apache.thrift.TException
807
    {
808
      markVoucherAsRedeemed_result result = new markVoucherAsRedeemed_result();
809
      receiveBase(result, "markVoucherAsRedeemed");
810
      if (result.isSetSuccess()) {
811
        return result.success;
812
      }
813
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "markVoucherAsRedeemed failed: unknown result");
814
    }
815
 
1982 varun.gupt 816
  }
3430 rajveer 817
  public static class AsyncClient extends in.shop2020.generic.GenericService.AsyncClient implements AsyncIface {
818
    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
819
      private org.apache.thrift.async.TAsyncClientManager clientManager;
820
      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
821
      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
822
        this.clientManager = clientManager;
823
        this.protocolFactory = protocolFactory;
824
      }
825
      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
826
        return new AsyncClient(protocolFactory, clientManager, transport);
827
      }
1982 varun.gupt 828
    }
829
 
3430 rajveer 830
    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
831
      super(protocolFactory, clientManager, transport);
832
    }
1982 varun.gupt 833
 
3430 rajveer 834
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn, org.apache.thrift.async.AsyncMethodCallback<createPromotion_call> resultHandler) throws org.apache.thrift.TException {
835
      checkReady();
836
      createPromotion_call method_call = new createPromotion_call(name, ruleExecutionSrc, startOn, endOn, resultHandler, this, ___protocolFactory, ___transport);
837
      this.___currentMethod = method_call;
838
      ___manager.call(method_call);
1982 varun.gupt 839
    }
840
 
3430 rajveer 841
    public static class createPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
842
      private String name;
843
      private String ruleExecutionSrc;
844
      private long startOn;
845
      private long endOn;
846
      public createPromotion_call(String name, String ruleExecutionSrc, long startOn, long endOn, org.apache.thrift.async.AsyncMethodCallback<createPromotion_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
847
        super(client, protocolFactory, transport, resultHandler, false);
848
        this.name = name;
849
        this.ruleExecutionSrc = ruleExecutionSrc;
850
        this.startOn = startOn;
851
        this.endOn = endOn;
1982 varun.gupt 852
      }
853
 
3430 rajveer 854
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
855
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
1982 varun.gupt 856
        createPromotion_args args = new createPromotion_args();
3430 rajveer 857
        args.setName(name);
858
        args.setRuleExecutionSrc(ruleExecutionSrc);
859
        args.setStartOn(startOn);
860
        args.setEndOn(endOn);
861
        args.write(prot);
862
        prot.writeMessageEnd();
1982 varun.gupt 863
      }
864
 
3430 rajveer 865
      public void getResult() throws PromotionException, org.apache.thrift.TException {
866
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
867
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 868
        }
3430 rajveer 869
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
870
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
871
        (new Client(prot)).recv_createPromotion();
1982 varun.gupt 872
      }
3430 rajveer 873
    }
1982 varun.gupt 874
 
7746 amit.gupta 875
    public void removeAllCouponsByPromotionId(long promotionId, org.apache.thrift.async.AsyncMethodCallback<removeAllCouponsByPromotionId_call> resultHandler) throws org.apache.thrift.TException {
876
      checkReady();
877
      removeAllCouponsByPromotionId_call method_call = new removeAllCouponsByPromotionId_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
878
      this.___currentMethod = method_call;
879
      ___manager.call(method_call);
880
    }
881
 
882
    public static class removeAllCouponsByPromotionId_call extends org.apache.thrift.async.TAsyncMethodCall {
883
      private long promotionId;
884
      public removeAllCouponsByPromotionId_call(long promotionId, org.apache.thrift.async.AsyncMethodCallback<removeAllCouponsByPromotionId_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
885
        super(client, protocolFactory, transport, resultHandler, false);
886
        this.promotionId = promotionId;
887
      }
888
 
889
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
890
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("removeAllCouponsByPromotionId", org.apache.thrift.protocol.TMessageType.CALL, 0));
891
        removeAllCouponsByPromotionId_args args = new removeAllCouponsByPromotionId_args();
892
        args.setPromotionId(promotionId);
893
        args.write(prot);
894
        prot.writeMessageEnd();
895
      }
896
 
897
      public long getResult() throws PromotionException, org.apache.thrift.TException {
898
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
899
          throw new IllegalStateException("Method call not finished!");
900
        }
901
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
902
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
903
        return (new Client(prot)).recv_removeAllCouponsByPromotionId();
904
      }
905
    }
906
 
6301 amit.gupta 907
    public void getCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getCoupon_call> resultHandler) throws org.apache.thrift.TException {
908
      checkReady();
909
      getCoupon_call method_call = new getCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
910
      this.___currentMethod = method_call;
911
      ___manager.call(method_call);
912
    }
913
 
914
    public static class getCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
915
      private String couponCode;
916
      public getCoupon_call(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getCoupon_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
917
        super(client, protocolFactory, transport, resultHandler, false);
918
        this.couponCode = couponCode;
919
      }
920
 
921
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
922
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
923
        getCoupon_args args = new getCoupon_args();
924
        args.setCouponCode(couponCode);
925
        args.write(prot);
926
        prot.writeMessageEnd();
927
      }
928
 
929
      public Coupon getResult() throws PromotionException, org.apache.thrift.TException {
930
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
931
          throw new IllegalStateException("Method call not finished!");
932
        }
933
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
934
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
935
        return (new Client(prot)).recv_getCoupon();
936
      }
937
    }
938
 
939
    public void isGiftVoucher(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isGiftVoucher_call> resultHandler) throws org.apache.thrift.TException {
940
      checkReady();
941
      isGiftVoucher_call method_call = new isGiftVoucher_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
942
      this.___currentMethod = method_call;
943
      ___manager.call(method_call);
944
    }
945
 
946
    public static class isGiftVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
947
      private String couponCode;
948
      public isGiftVoucher_call(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isGiftVoucher_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
949
        super(client, protocolFactory, transport, resultHandler, false);
950
        this.couponCode = couponCode;
951
      }
952
 
953
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
954
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isGiftVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
955
        isGiftVoucher_args args = new isGiftVoucher_args();
956
        args.setCouponCode(couponCode);
957
        args.write(prot);
958
        prot.writeMessageEnd();
959
      }
960
 
961
      public boolean getResult() throws PromotionException, org.apache.thrift.TException {
962
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
963
          throw new IllegalStateException("Method call not finished!");
964
        }
965
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
966
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
967
        return (new Client(prot)).recv_isGiftVoucher();
968
      }
969
    }
970
 
6356 amit.gupta 971
    public void isCodApplicable(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isCodApplicable_call> resultHandler) throws org.apache.thrift.TException {
972
      checkReady();
973
      isCodApplicable_call method_call = new isCodApplicable_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
974
      this.___currentMethod = method_call;
975
      ___manager.call(method_call);
976
    }
977
 
978
    public static class isCodApplicable_call extends org.apache.thrift.async.TAsyncMethodCall {
979
      private String couponCode;
980
      public isCodApplicable_call(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isCodApplicable_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
981
        super(client, protocolFactory, transport, resultHandler, false);
982
        this.couponCode = couponCode;
983
      }
984
 
985
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
986
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isCodApplicable", org.apache.thrift.protocol.TMessageType.CALL, 0));
987
        isCodApplicable_args args = new isCodApplicable_args();
988
        args.setCouponCode(couponCode);
989
        args.write(prot);
990
        prot.writeMessageEnd();
991
      }
992
 
993
      public boolean getResult() throws PromotionException, org.apache.thrift.TException {
994
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
995
          throw new IllegalStateException("Method call not finished!");
996
        }
997
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
998
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
999
        return (new Client(prot)).recv_isCodApplicable();
1000
      }
1001
    }
1002
 
3430 rajveer 1003
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<getAllPromotions_call> resultHandler) throws org.apache.thrift.TException {
1004
      checkReady();
1005
      getAllPromotions_call method_call = new getAllPromotions_call(resultHandler, this, ___protocolFactory, ___transport);
1006
      this.___currentMethod = method_call;
1007
      ___manager.call(method_call);
1982 varun.gupt 1008
    }
1009
 
3430 rajveer 1010
    public static class getAllPromotions_call extends org.apache.thrift.async.TAsyncMethodCall {
1011
      public getAllPromotions_call(org.apache.thrift.async.AsyncMethodCallback<getAllPromotions_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1012
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 1013
      }
1014
 
3430 rajveer 1015
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1016
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllPromotions", org.apache.thrift.protocol.TMessageType.CALL, 0));
1017
        getAllPromotions_args args = new getAllPromotions_args();
1018
        args.write(prot);
1019
        prot.writeMessageEnd();
1020
      }
1982 varun.gupt 1021
 
3430 rajveer 1022
      public List<Promotion> getResult() throws PromotionException, org.apache.thrift.TException {
1023
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1024
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 1025
        }
3430 rajveer 1026
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1027
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1028
        return (new Client(prot)).recv_getAllPromotions();
1982 varun.gupt 1029
      }
3430 rajveer 1030
    }
1982 varun.gupt 1031
 
3430 rajveer 1032
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getPromotionById_call> resultHandler) throws org.apache.thrift.TException {
1033
      checkReady();
1034
      getPromotionById_call method_call = new getPromotionById_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
1035
      this.___currentMethod = method_call;
1036
      ___manager.call(method_call);
1982 varun.gupt 1037
    }
1038
 
3430 rajveer 1039
    public static class getPromotionById_call extends org.apache.thrift.async.TAsyncMethodCall {
1040
      private long promotionId;
1041
      public getPromotionById_call(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getPromotionById_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1042
        super(client, protocolFactory, transport, resultHandler, false);
1043
        this.promotionId = promotionId;
1982 varun.gupt 1044
      }
1045
 
3430 rajveer 1046
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1047
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPromotionById", org.apache.thrift.protocol.TMessageType.CALL, 0));
1048
        getPromotionById_args args = new getPromotionById_args();
1049
        args.setPromotionId(promotionId);
1050
        args.write(prot);
1051
        prot.writeMessageEnd();
1052
      }
1982 varun.gupt 1053
 
3430 rajveer 1054
      public Promotion getResult() throws PromotionException, org.apache.thrift.TException {
1055
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1056
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 1057
        }
3430 rajveer 1058
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1059
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1060
        return (new Client(prot)).recv_getPromotionById();
1982 varun.gupt 1061
      }
3430 rajveer 1062
    }
1982 varun.gupt 1063
 
3430 rajveer 1064
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException {
1065
      checkReady();
1066
      generateCouponsForPromotion_call method_call = new generateCouponsForPromotion_call(promotionId, couponCode, resultHandler, this, ___protocolFactory, ___transport);
1067
      this.___currentMethod = method_call;
1068
      ___manager.call(method_call);
1982 varun.gupt 1069
    }
1070
 
3430 rajveer 1071
    public static class generateCouponsForPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
1072
      private long promotionId;
1073
      private String couponCode;
1074
      public generateCouponsForPromotion_call(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<generateCouponsForPromotion_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1075
        super(client, protocolFactory, transport, resultHandler, false);
1076
        this.promotionId = promotionId;
1077
        this.couponCode = couponCode;
1982 varun.gupt 1078
      }
1079
 
3430 rajveer 1080
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1081
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("generateCouponsForPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
1082
        generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
1083
        args.setPromotionId(promotionId);
1084
        args.setCouponCode(couponCode);
1085
        args.write(prot);
1086
        prot.writeMessageEnd();
3385 varun.gupt 1087
      }
1088
 
3430 rajveer 1089
      public void getResult() throws PromotionException, org.apache.thrift.TException {
1090
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1091
          throw new IllegalStateException("Method call not finished!");
3385 varun.gupt 1092
        }
3430 rajveer 1093
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1094
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1095
        (new Client(prot)).recv_generateCouponsForPromotion();
3385 varun.gupt 1096
      }
1097
    }
1098
 
3430 rajveer 1099
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<applyCoupon_call> resultHandler) throws org.apache.thrift.TException {
1100
      checkReady();
1101
      applyCoupon_call method_call = new applyCoupon_call(couponCode, cartId, resultHandler, this, ___protocolFactory, ___transport);
1102
      this.___currentMethod = method_call;
1103
      ___manager.call(method_call);
3385 varun.gupt 1104
    }
1105
 
3430 rajveer 1106
    public static class applyCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1107
      private String couponCode;
1108
      private long cartId;
1109
      public applyCoupon_call(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<applyCoupon_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1110
        super(client, protocolFactory, transport, resultHandler, false);
1111
        this.couponCode = couponCode;
1112
        this.cartId = cartId;
1982 varun.gupt 1113
      }
1114
 
3430 rajveer 1115
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1116
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("applyCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1117
        applyCoupon_args args = new applyCoupon_args();
1118
        args.setCouponCode(couponCode);
1119
        args.setCartId(cartId);
1120
        args.write(prot);
1121
        prot.writeMessageEnd();
1982 varun.gupt 1122
      }
1123
 
3430 rajveer 1124
      public Cart getResult() throws PromotionException, org.apache.thrift.TException {
1125
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1126
          throw new IllegalStateException("Method call not finished!");
1127
        }
1128
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1129
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1130
        return (new Client(prot)).recv_applyCoupon();
1982 varun.gupt 1131
      }
3430 rajveer 1132
    }
1982 varun.gupt 1133
 
6736 amit.gupta 1134
    public void getEmiDiscount(long cartId, org.apache.thrift.async.AsyncMethodCallback<getEmiDiscount_call> resultHandler) throws org.apache.thrift.TException {
1135
      checkReady();
1136
      getEmiDiscount_call method_call = new getEmiDiscount_call(cartId, resultHandler, this, ___protocolFactory, ___transport);
1137
      this.___currentMethod = method_call;
1138
      ___manager.call(method_call);
1139
    }
1140
 
1141
    public static class getEmiDiscount_call extends org.apache.thrift.async.TAsyncMethodCall {
1142
      private long cartId;
1143
      public getEmiDiscount_call(long cartId, org.apache.thrift.async.AsyncMethodCallback<getEmiDiscount_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1144
        super(client, protocolFactory, transport, resultHandler, false);
1145
        this.cartId = cartId;
1146
      }
1147
 
1148
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1149
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getEmiDiscount", org.apache.thrift.protocol.TMessageType.CALL, 0));
1150
        getEmiDiscount_args args = new getEmiDiscount_args();
1151
        args.setCartId(cartId);
1152
        args.write(prot);
1153
        prot.writeMessageEnd();
1154
      }
1155
 
1156
      public Map<Long,Double> getResult() throws PromotionException, org.apache.thrift.TException {
1157
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1158
          throw new IllegalStateException("Method call not finished!");
1159
        }
1160
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1161
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1162
        return (new Client(prot)).recv_getEmiDiscount();
1163
      }
1164
    }
1165
 
6433 anupam.sin 1166
    public void applyRechargeCoupon(String couponCode, long totalAmount, long userId, org.apache.thrift.async.AsyncMethodCallback<applyRechargeCoupon_call> resultHandler) throws org.apache.thrift.TException {
1167
      checkReady();
1168
      applyRechargeCoupon_call method_call = new applyRechargeCoupon_call(couponCode, totalAmount, userId, resultHandler, this, ___protocolFactory, ___transport);
1169
      this.___currentMethod = method_call;
1170
      ___manager.call(method_call);
1171
    }
1172
 
1173
    public static class applyRechargeCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1174
      private String couponCode;
1175
      private long totalAmount;
1176
      private long userId;
1177
      public applyRechargeCoupon_call(String couponCode, long totalAmount, long userId, org.apache.thrift.async.AsyncMethodCallback<applyRechargeCoupon_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1178
        super(client, protocolFactory, transport, resultHandler, false);
1179
        this.couponCode = couponCode;
1180
        this.totalAmount = totalAmount;
1181
        this.userId = userId;
1182
      }
1183
 
1184
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1185
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("applyRechargeCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1186
        applyRechargeCoupon_args args = new applyRechargeCoupon_args();
1187
        args.setCouponCode(couponCode);
1188
        args.setTotalAmount(totalAmount);
1189
        args.setUserId(userId);
1190
        args.write(prot);
1191
        prot.writeMessageEnd();
1192
      }
1193
 
1194
      public Map<Long,String> getResult() throws PromotionException, org.apache.thrift.TException {
1195
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1196
          throw new IllegalStateException("Method call not finished!");
1197
        }
1198
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1199
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1200
        return (new Client(prot)).recv_applyRechargeCoupon();
1201
      }
1202
    }
1203
 
3430 rajveer 1204
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException {
1205
      checkReady();
1206
      trackCouponUsage_call method_call = new trackCouponUsage_call(couponCode, transactionId, userId, resultHandler, this, ___protocolFactory, ___transport);
1207
      this.___currentMethod = method_call;
1208
      ___manager.call(method_call);
1209
    }
1982 varun.gupt 1210
 
3430 rajveer 1211
    public static class trackCouponUsage_call extends org.apache.thrift.async.TAsyncMethodCall {
1212
      private String couponCode;
1213
      private long transactionId;
1214
      private long userId;
1215
      public trackCouponUsage_call(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<trackCouponUsage_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1216
        super(client, protocolFactory, transport, resultHandler, false);
1217
        this.couponCode = couponCode;
1218
        this.transactionId = transactionId;
1219
        this.userId = userId;
1982 varun.gupt 1220
      }
1221
 
3430 rajveer 1222
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1223
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("trackCouponUsage", org.apache.thrift.protocol.TMessageType.CALL, 0));
1224
        trackCouponUsage_args args = new trackCouponUsage_args();
1225
        args.setCouponCode(couponCode);
1226
        args.setTransactionId(transactionId);
1227
        args.setUserId(userId);
1228
        args.write(prot);
1229
        prot.writeMessageEnd();
1982 varun.gupt 1230
      }
1231
 
3430 rajveer 1232
      public void getResult() throws PromotionException, org.apache.thrift.TException {
1233
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1234
          throw new IllegalStateException("Method call not finished!");
1235
        }
1236
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1237
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1238
        (new Client(prot)).recv_trackCouponUsage();
1982 varun.gupt 1239
      }
1240
    }
1241
 
3430 rajveer 1242
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException {
1243
      checkReady();
1244
      getCouponUsageCountByUser_call method_call = new getCouponUsageCountByUser_call(couponCode, userId, resultHandler, this, ___protocolFactory, ___transport);
1245
      this.___currentMethod = method_call;
1246
      ___manager.call(method_call);
1982 varun.gupt 1247
    }
1248
 
3430 rajveer 1249
    public static class getCouponUsageCountByUser_call extends org.apache.thrift.async.TAsyncMethodCall {
1250
      private String couponCode;
1251
      private long userId;
1252
      public getCouponUsageCountByUser_call(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<getCouponUsageCountByUser_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1253
        super(client, protocolFactory, transport, resultHandler, false);
1254
        this.couponCode = couponCode;
1255
        this.userId = userId;
1256
      }
1982 varun.gupt 1257
 
3430 rajveer 1258
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1259
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCouponUsageCountByUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
1260
        getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
1261
        args.setCouponCode(couponCode);
1262
        args.setUserId(userId);
1263
        args.write(prot);
1264
        prot.writeMessageEnd();
1265
      }
1982 varun.gupt 1266
 
3430 rajveer 1267
      public long getResult() throws PromotionException, org.apache.thrift.TException {
1268
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1269
          throw new IllegalStateException("Method call not finished!");
1270
        }
1271
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1272
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1273
        return (new Client(prot)).recv_getCouponUsageCountByUser();
1274
      }
1982 varun.gupt 1275
    }
1276
 
6497 amit.gupta 1277
    public void getActiveCodes(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getActiveCodes_call> resultHandler) throws org.apache.thrift.TException {
1278
      checkReady();
1279
      getActiveCodes_call method_call = new getActiveCodes_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
1280
      this.___currentMethod = method_call;
1281
      ___manager.call(method_call);
1282
    }
1283
 
1284
    public static class getActiveCodes_call extends org.apache.thrift.async.TAsyncMethodCall {
1285
      private long promotionId;
1286
      public getActiveCodes_call(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getActiveCodes_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1287
        super(client, protocolFactory, transport, resultHandler, false);
1288
        this.promotionId = promotionId;
1289
      }
1290
 
1291
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1292
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getActiveCodes", org.apache.thrift.protocol.TMessageType.CALL, 0));
1293
        getActiveCodes_args args = new getActiveCodes_args();
1294
        args.setPromotionId(promotionId);
1295
        args.write(prot);
1296
        prot.writeMessageEnd();
1297
      }
1298
 
1299
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
1300
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1301
          throw new IllegalStateException("Method call not finished!");
1302
        }
1303
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1304
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1305
        return (new Client(prot)).recv_getActiveCodes();
1306
      }
1307
    }
1308
 
1309
    public void deleteCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<deleteCoupon_call> resultHandler) throws org.apache.thrift.TException {
1310
      checkReady();
1311
      deleteCoupon_call method_call = new deleteCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
1312
      this.___currentMethod = method_call;
1313
      ___manager.call(method_call);
1314
    }
1315
 
1316
    public static class deleteCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1317
      private String couponCode;
1318
      public deleteCoupon_call(String couponCode, org.apache.thrift.async.AsyncMethodCallback<deleteCoupon_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1319
        super(client, protocolFactory, transport, resultHandler, false);
1320
        this.couponCode = couponCode;
1321
      }
1322
 
1323
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1324
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1325
        deleteCoupon_args args = new deleteCoupon_args();
1326
        args.setCouponCode(couponCode);
1327
        args.write(prot);
1328
        prot.writeMessageEnd();
1329
      }
1330
 
1331
      public void getResult() throws PromotionException, org.apache.thrift.TException {
1332
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1333
          throw new IllegalStateException("Method call not finished!");
1334
        }
1335
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1336
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1337
        (new Client(prot)).recv_deleteCoupon();
1338
      }
1339
    }
1340
 
7092 amit.gupta 1341
    public void getAllCouponsByPromotionId(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getAllCouponsByPromotionId_call> resultHandler) throws org.apache.thrift.TException {
1342
      checkReady();
1343
      getAllCouponsByPromotionId_call method_call = new getAllCouponsByPromotionId_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
1344
      this.___currentMethod = method_call;
1345
      ___manager.call(method_call);
1346
    }
1347
 
1348
    public static class getAllCouponsByPromotionId_call extends org.apache.thrift.async.TAsyncMethodCall {
1349
      private long promotionId;
1350
      public getAllCouponsByPromotionId_call(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getAllCouponsByPromotionId_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1351
        super(client, protocolFactory, transport, resultHandler, false);
1352
        this.promotionId = promotionId;
1353
      }
1354
 
1355
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1356
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllCouponsByPromotionId", org.apache.thrift.protocol.TMessageType.CALL, 0));
1357
        getAllCouponsByPromotionId_args args = new getAllCouponsByPromotionId_args();
1358
        args.setPromotionId(promotionId);
1359
        args.write(prot);
1360
        prot.writeMessageEnd();
1361
      }
1362
 
1363
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
1364
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1365
          throw new IllegalStateException("Method call not finished!");
1366
        }
1367
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1368
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1369
        return (new Client(prot)).recv_getAllCouponsByPromotionId();
1370
      }
1371
    }
1372
 
3430 rajveer 1373
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException {
1374
      checkReady();
1375
      getActiveCoupons_call method_call = new getActiveCoupons_call(resultHandler, this, ___protocolFactory, ___transport);
1376
      this.___currentMethod = method_call;
1377
      ___manager.call(method_call);
1982 varun.gupt 1378
    }
1379
 
3430 rajveer 1380
    public static class getActiveCoupons_call extends org.apache.thrift.async.TAsyncMethodCall {
1381
      public getActiveCoupons_call(org.apache.thrift.async.AsyncMethodCallback<getActiveCoupons_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1382
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 1383
      }
1384
 
3430 rajveer 1385
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1386
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getActiveCoupons", org.apache.thrift.protocol.TMessageType.CALL, 0));
1387
        getActiveCoupons_args args = new getActiveCoupons_args();
1388
        args.write(prot);
1389
        prot.writeMessageEnd();
1390
      }
1982 varun.gupt 1391
 
3430 rajveer 1392
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
1393
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1394
          throw new IllegalStateException("Method call not finished!");
1395
        }
1396
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1397
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1398
        return (new Client(prot)).recv_getActiveCoupons();
1982 varun.gupt 1399
      }
1400
    }
1401
 
8707 manish.sha 1402
    public void createCoupon(long promotionId, long couponCategory, String couponCode, String arguments, boolean isCod, String prefix, org.apache.thrift.async.AsyncMethodCallback<createCoupon_call> resultHandler) throws org.apache.thrift.TException {
6250 amit.gupta 1403
      checkReady();
8707 manish.sha 1404
      createCoupon_call method_call = new createCoupon_call(promotionId, couponCategory, couponCode, arguments, isCod, prefix, resultHandler, this, ___protocolFactory, ___transport);
6250 amit.gupta 1405
      this.___currentMethod = method_call;
1406
      ___manager.call(method_call);
1407
    }
1408
 
1409
    public static class createCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1410
      private long promotionId;
8707 manish.sha 1411
      private long couponCategory;
6730 anupam.sin 1412
      private String couponCode;
6679 anupam.sin 1413
      private String arguments;
6356 amit.gupta 1414
      private boolean isCod;
6561 amit.gupta 1415
      private String prefix;
8707 manish.sha 1416
      public createCoupon_call(long promotionId, long couponCategory, String couponCode, String arguments, boolean isCod, String prefix, org.apache.thrift.async.AsyncMethodCallback<createCoupon_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
6250 amit.gupta 1417
        super(client, protocolFactory, transport, resultHandler, false);
1418
        this.promotionId = promotionId;
8707 manish.sha 1419
        this.couponCategory = couponCategory;
6730 anupam.sin 1420
        this.couponCode = couponCode;
6679 anupam.sin 1421
        this.arguments = arguments;
6356 amit.gupta 1422
        this.isCod = isCod;
6561 amit.gupta 1423
        this.prefix = prefix;
6250 amit.gupta 1424
      }
1425
 
1426
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1427
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1428
        createCoupon_args args = new createCoupon_args();
1429
        args.setPromotionId(promotionId);
8707 manish.sha 1430
        args.setCouponCategory(couponCategory);
6730 anupam.sin 1431
        args.setCouponCode(couponCode);
6679 anupam.sin 1432
        args.setArguments(arguments);
6356 amit.gupta 1433
        args.setIsCod(isCod);
6561 amit.gupta 1434
        args.setPrefix(prefix);
6250 amit.gupta 1435
        args.write(prot);
1436
        prot.writeMessageEnd();
1437
      }
1438
 
1439
      public String getResult() throws PromotionException, org.apache.thrift.TException {
1440
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1441
          throw new IllegalStateException("Method call not finished!");
1442
        }
1443
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1444
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1445
        return (new Client(prot)).recv_createCoupon();
1446
      }
1447
    }
1448
 
3430 rajveer 1449
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException {
1450
      checkReady();
1451
      getSuccessfulPaymentCountForCoupon_call method_call = new getSuccessfulPaymentCountForCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
1452
      this.___currentMethod = method_call;
1453
      ___manager.call(method_call);
1982 varun.gupt 1454
    }
1455
 
3430 rajveer 1456
    public static class getSuccessfulPaymentCountForCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1457
      private String couponCode;
1458
      public getSuccessfulPaymentCountForCoupon_call(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getSuccessfulPaymentCountForCoupon_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1459
        super(client, protocolFactory, transport, resultHandler, false);
1460
        this.couponCode = couponCode;
1982 varun.gupt 1461
      }
1462
 
3430 rajveer 1463
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1464
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSuccessfulPaymentCountForCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1465
        getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
1466
        args.setCouponCode(couponCode);
1467
        args.write(prot);
1468
        prot.writeMessageEnd();
1469
      }
1982 varun.gupt 1470
 
3430 rajveer 1471
      public long getResult() throws PromotionException, org.apache.thrift.TException {
1472
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1473
          throw new IllegalStateException("Method call not finished!");
1474
        }
1475
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1476
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1477
        return (new Client(prot)).recv_getSuccessfulPaymentCountForCoupon();
1478
      }
1982 varun.gupt 1479
    }
1480
 
3430 rajveer 1481
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<getRuleDocString_call> resultHandler) throws org.apache.thrift.TException {
1482
      checkReady();
1483
      getRuleDocString_call method_call = new getRuleDocString_call(ruleName, resultHandler, this, ___protocolFactory, ___transport);
1484
      this.___currentMethod = method_call;
1485
      ___manager.call(method_call);
1982 varun.gupt 1486
    }
1487
 
3430 rajveer 1488
    public static class getRuleDocString_call extends org.apache.thrift.async.TAsyncMethodCall {
1489
      private String ruleName;
1490
      public getRuleDocString_call(String ruleName, org.apache.thrift.async.AsyncMethodCallback<getRuleDocString_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1491
        super(client, protocolFactory, transport, resultHandler, false);
1492
        this.ruleName = ruleName;
1493
      }
1982 varun.gupt 1494
 
3430 rajveer 1495
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1496
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRuleDocString", org.apache.thrift.protocol.TMessageType.CALL, 0));
1497
        getRuleDocString_args args = new getRuleDocString_args();
1498
        args.setRuleName(ruleName);
1499
        args.write(prot);
1500
        prot.writeMessageEnd();
1982 varun.gupt 1501
      }
1502
 
3430 rajveer 1503
      public String getResult() throws org.apache.thrift.TException {
1504
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1505
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 1506
        }
3430 rajveer 1507
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1508
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1509
        return (new Client(prot)).recv_getRuleDocString();
1982 varun.gupt 1510
      }
1511
    }
1512
 
4189 varun.gupt 1513
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException {
1514
      checkReady();
1515
      getItemDiscountMap_call method_call = new getItemDiscountMap_call(itemIds, resultHandler, this, ___protocolFactory, ___transport);
1516
      this.___currentMethod = method_call;
1517
      ___manager.call(method_call);
1518
    }
1519
 
1520
    public static class getItemDiscountMap_call extends org.apache.thrift.async.TAsyncMethodCall {
1521
      private List<Long> itemIds;
1522
      public getItemDiscountMap_call(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<getItemDiscountMap_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1523
        super(client, protocolFactory, transport, resultHandler, false);
1524
        this.itemIds = itemIds;
1525
      }
1526
 
1527
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1528
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getItemDiscountMap", org.apache.thrift.protocol.TMessageType.CALL, 0));
1529
        getItemDiscountMap_args args = new getItemDiscountMap_args();
1530
        args.setItemIds(itemIds);
1531
        args.write(prot);
1532
        prot.writeMessageEnd();
1533
      }
1534
 
1535
      public List<ItemCouponDiscount> getResult() throws PromotionException, org.apache.thrift.TException {
1536
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1537
          throw new IllegalStateException("Method call not finished!");
1538
        }
1539
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1540
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1541
        return (new Client(prot)).recv_getItemDiscountMap();
1542
      }
1543
    }
1544
 
4494 varun.gupt 1545
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException {
1546
      checkReady();
1547
      getDiscountsForEntity_call method_call = new getDiscountsForEntity_call(entityId, resultHandler, this, ___protocolFactory, ___transport);
1548
      this.___currentMethod = method_call;
1549
      ___manager.call(method_call);
1550
    }
1551
 
1552
    public static class getDiscountsForEntity_call extends org.apache.thrift.async.TAsyncMethodCall {
1553
      private long entityId;
1554
      public getDiscountsForEntity_call(long entityId, org.apache.thrift.async.AsyncMethodCallback<getDiscountsForEntity_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1555
        super(client, protocolFactory, transport, resultHandler, false);
1556
        this.entityId = entityId;
1557
      }
1558
 
1559
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1560
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getDiscountsForEntity", org.apache.thrift.protocol.TMessageType.CALL, 0));
1561
        getDiscountsForEntity_args args = new getDiscountsForEntity_args();
1562
        args.setEntityId(entityId);
1563
        args.write(prot);
1564
        prot.writeMessageEnd();
1565
      }
1566
 
1567
      public Map<String,Double> getResult() throws org.apache.thrift.TException {
1568
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1569
          throw new IllegalStateException("Method call not finished!");
1570
        }
1571
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1572
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1573
        return (new Client(prot)).recv_getDiscountsForEntity();
1574
      }
1575
    }
1576
 
5469 rajveer 1577
    public void addVoucher(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<addVoucher_call> resultHandler) throws org.apache.thrift.TException {
1578
      checkReady();
1579
      addVoucher_call method_call = new addVoucher_call(voucher, resultHandler, this, ___protocolFactory, ___transport);
1580
      this.___currentMethod = method_call;
1581
      ___manager.call(method_call);
1582
    }
1583
 
1584
    public static class addVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
1585
      private Voucher voucher;
1586
      public addVoucher_call(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<addVoucher_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1587
        super(client, protocolFactory, transport, resultHandler, false);
1588
        this.voucher = voucher;
1589
      }
1590
 
1591
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1592
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
1593
        addVoucher_args args = new addVoucher_args();
1594
        args.setVoucher(voucher);
1595
        args.write(prot);
1596
        prot.writeMessageEnd();
1597
      }
1598
 
1599
      public void getResult() throws org.apache.thrift.TException {
1600
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1601
          throw new IllegalStateException("Method call not finished!");
1602
        }
1603
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1604
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1605
        (new Client(prot)).recv_addVoucher();
1606
      }
1607
    }
1608
 
1609
    public void assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount, org.apache.thrift.async.AsyncMethodCallback<assignVoucher_call> resultHandler) throws org.apache.thrift.TException {
1610
      checkReady();
1611
      assignVoucher_call method_call = new assignVoucher_call(userId, userEmail, voucherType, amount, resultHandler, this, ___protocolFactory, ___transport);
1612
      this.___currentMethod = method_call;
1613
      ___manager.call(method_call);
1614
    }
1615
 
1616
    public static class assignVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
1617
      private long userId;
1618
      private String userEmail;
1619
      private VoucherType voucherType;
1620
      private long amount;
1621
      public assignVoucher_call(long userId, String userEmail, VoucherType voucherType, long amount, org.apache.thrift.async.AsyncMethodCallback<assignVoucher_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1622
        super(client, protocolFactory, transport, resultHandler, false);
1623
        this.userId = userId;
1624
        this.userEmail = userEmail;
1625
        this.voucherType = voucherType;
1626
        this.amount = amount;
1627
      }
1628
 
1629
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1630
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("assignVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
1631
        assignVoucher_args args = new assignVoucher_args();
1632
        args.setUserId(userId);
1633
        args.setUserEmail(userEmail);
1634
        args.setVoucherType(voucherType);
1635
        args.setAmount(amount);
1636
        args.write(prot);
1637
        prot.writeMessageEnd();
1638
      }
1639
 
1640
      public Voucher getResult() throws org.apache.thrift.TException {
1641
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1642
          throw new IllegalStateException("Method call not finished!");
1643
        }
1644
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1645
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1646
        return (new Client(prot)).recv_assignVoucher();
1647
      }
1648
    }
1649
 
1650
    public void markVoucherAsRedeemed(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<markVoucherAsRedeemed_call> resultHandler) throws org.apache.thrift.TException {
1651
      checkReady();
1652
      markVoucherAsRedeemed_call method_call = new markVoucherAsRedeemed_call(voucherCode, redeemedOn, resultHandler, this, ___protocolFactory, ___transport);
1653
      this.___currentMethod = method_call;
1654
      ___manager.call(method_call);
1655
    }
1656
 
1657
    public static class markVoucherAsRedeemed_call extends org.apache.thrift.async.TAsyncMethodCall {
1658
      private String voucherCode;
1659
      private long redeemedOn;
1660
      public markVoucherAsRedeemed_call(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<markVoucherAsRedeemed_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1661
        super(client, protocolFactory, transport, resultHandler, false);
1662
        this.voucherCode = voucherCode;
1663
        this.redeemedOn = redeemedOn;
1664
      }
1665
 
1666
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1667
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("markVoucherAsRedeemed", org.apache.thrift.protocol.TMessageType.CALL, 0));
1668
        markVoucherAsRedeemed_args args = new markVoucherAsRedeemed_args();
1669
        args.setVoucherCode(voucherCode);
1670
        args.setRedeemedOn(redeemedOn);
1671
        args.write(prot);
1672
        prot.writeMessageEnd();
1673
      }
1674
 
1675
      public boolean getResult() throws org.apache.thrift.TException {
1676
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1677
          throw new IllegalStateException("Method call not finished!");
1678
        }
1679
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1680
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1681
        return (new Client(prot)).recv_markVoucherAsRedeemed();
1682
      }
1683
    }
1684
 
3430 rajveer 1685
  }
1982 varun.gupt 1686
 
3430 rajveer 1687
  public static class Processor<I extends Iface> extends in.shop2020.generic.GenericService.Processor implements org.apache.thrift.TProcessor {
1688
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
1689
    public Processor(I iface) {
1690
      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
1982 varun.gupt 1691
    }
1692
 
3430 rajveer 1693
    protected Processor(I iface, Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
1694
      super(iface, getProcessMap(processMap));
1982 varun.gupt 1695
    }
1696
 
3430 rajveer 1697
    private static <I extends Iface> Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> getProcessMap(Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
1698
      processMap.put("createPromotion", new createPromotion());
7746 amit.gupta 1699
      processMap.put("removeAllCouponsByPromotionId", new removeAllCouponsByPromotionId());
6301 amit.gupta 1700
      processMap.put("getCoupon", new getCoupon());
1701
      processMap.put("isGiftVoucher", new isGiftVoucher());
6356 amit.gupta 1702
      processMap.put("isCodApplicable", new isCodApplicable());
3430 rajveer 1703
      processMap.put("getAllPromotions", new getAllPromotions());
1704
      processMap.put("getPromotionById", new getPromotionById());
1705
      processMap.put("generateCouponsForPromotion", new generateCouponsForPromotion());
1706
      processMap.put("applyCoupon", new applyCoupon());
6736 amit.gupta 1707
      processMap.put("getEmiDiscount", new getEmiDiscount());
6433 anupam.sin 1708
      processMap.put("applyRechargeCoupon", new applyRechargeCoupon());
3430 rajveer 1709
      processMap.put("trackCouponUsage", new trackCouponUsage());
1710
      processMap.put("getCouponUsageCountByUser", new getCouponUsageCountByUser());
6497 amit.gupta 1711
      processMap.put("getActiveCodes", new getActiveCodes());
1712
      processMap.put("deleteCoupon", new deleteCoupon());
7092 amit.gupta 1713
      processMap.put("getAllCouponsByPromotionId", new getAllCouponsByPromotionId());
3430 rajveer 1714
      processMap.put("getActiveCoupons", new getActiveCoupons());
6250 amit.gupta 1715
      processMap.put("createCoupon", new createCoupon());
3430 rajveer 1716
      processMap.put("getSuccessfulPaymentCountForCoupon", new getSuccessfulPaymentCountForCoupon());
1717
      processMap.put("getRuleDocString", new getRuleDocString());
4189 varun.gupt 1718
      processMap.put("getItemDiscountMap", new getItemDiscountMap());
4494 varun.gupt 1719
      processMap.put("getDiscountsForEntity", new getDiscountsForEntity());
5469 rajveer 1720
      processMap.put("addVoucher", new addVoucher());
1721
      processMap.put("assignVoucher", new assignVoucher());
1722
      processMap.put("markVoucherAsRedeemed", new markVoucherAsRedeemed());
3430 rajveer 1723
      return processMap;
1982 varun.gupt 1724
    }
1725
 
3430 rajveer 1726
    private static class createPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createPromotion_args> {
1727
      public createPromotion() {
1728
        super("createPromotion");
1729
      }
1982 varun.gupt 1730
 
3430 rajveer 1731
      protected createPromotion_args getEmptyArgsInstance() {
1732
        return new createPromotion_args();
1733
      }
1982 varun.gupt 1734
 
3430 rajveer 1735
      protected createPromotion_result getResult(I iface, createPromotion_args args) throws org.apache.thrift.TException {
1736
        createPromotion_result result = new createPromotion_result();
1737
        try {
1738
          iface.createPromotion(args.name, args.ruleExecutionSrc, args.startOn, args.endOn);
1739
        } catch (PromotionException pex) {
1740
          result.pex = pex;
1982 varun.gupt 1741
        }
3430 rajveer 1742
        return result;
1982 varun.gupt 1743
      }
3430 rajveer 1744
    }
1982 varun.gupt 1745
 
7746 amit.gupta 1746
    private static class removeAllCouponsByPromotionId<I extends Iface> extends org.apache.thrift.ProcessFunction<I, removeAllCouponsByPromotionId_args> {
1747
      public removeAllCouponsByPromotionId() {
1748
        super("removeAllCouponsByPromotionId");
1749
      }
1750
 
1751
      protected removeAllCouponsByPromotionId_args getEmptyArgsInstance() {
1752
        return new removeAllCouponsByPromotionId_args();
1753
      }
1754
 
1755
      protected removeAllCouponsByPromotionId_result getResult(I iface, removeAllCouponsByPromotionId_args args) throws org.apache.thrift.TException {
1756
        removeAllCouponsByPromotionId_result result = new removeAllCouponsByPromotionId_result();
1757
        try {
1758
          result.success = iface.removeAllCouponsByPromotionId(args.promotionId);
1759
          result.setSuccessIsSet(true);
1760
        } catch (PromotionException pex) {
1761
          result.pex = pex;
1762
        }
1763
        return result;
1764
      }
1765
    }
1766
 
6301 amit.gupta 1767
    private static class getCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCoupon_args> {
1768
      public getCoupon() {
1769
        super("getCoupon");
1770
      }
1771
 
1772
      protected getCoupon_args getEmptyArgsInstance() {
1773
        return new getCoupon_args();
1774
      }
1775
 
1776
      protected getCoupon_result getResult(I iface, getCoupon_args args) throws org.apache.thrift.TException {
1777
        getCoupon_result result = new getCoupon_result();
1778
        try {
1779
          result.success = iface.getCoupon(args.couponCode);
1780
        } catch (PromotionException pex) {
1781
          result.pex = pex;
1782
        }
1783
        return result;
1784
      }
1785
    }
1786
 
1787
    private static class isGiftVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isGiftVoucher_args> {
1788
      public isGiftVoucher() {
1789
        super("isGiftVoucher");
1790
      }
1791
 
1792
      protected isGiftVoucher_args getEmptyArgsInstance() {
1793
        return new isGiftVoucher_args();
1794
      }
1795
 
1796
      protected isGiftVoucher_result getResult(I iface, isGiftVoucher_args args) throws org.apache.thrift.TException {
1797
        isGiftVoucher_result result = new isGiftVoucher_result();
1798
        try {
1799
          result.success = iface.isGiftVoucher(args.couponCode);
1800
          result.setSuccessIsSet(true);
1801
        } catch (PromotionException pex) {
1802
          result.pex = pex;
1803
        }
1804
        return result;
1805
      }
1806
    }
1807
 
6356 amit.gupta 1808
    private static class isCodApplicable<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isCodApplicable_args> {
1809
      public isCodApplicable() {
1810
        super("isCodApplicable");
1811
      }
1812
 
1813
      protected isCodApplicable_args getEmptyArgsInstance() {
1814
        return new isCodApplicable_args();
1815
      }
1816
 
1817
      protected isCodApplicable_result getResult(I iface, isCodApplicable_args args) throws org.apache.thrift.TException {
1818
        isCodApplicable_result result = new isCodApplicable_result();
1819
        try {
1820
          result.success = iface.isCodApplicable(args.couponCode);
1821
          result.setSuccessIsSet(true);
1822
        } catch (PromotionException pex) {
1823
          result.pex = pex;
1824
        }
1825
        return result;
1826
      }
1827
    }
1828
 
3430 rajveer 1829
    private static class getAllPromotions<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllPromotions_args> {
1830
      public getAllPromotions() {
1831
        super("getAllPromotions");
1982 varun.gupt 1832
      }
1833
 
3430 rajveer 1834
      protected getAllPromotions_args getEmptyArgsInstance() {
1835
        return new getAllPromotions_args();
1982 varun.gupt 1836
      }
1837
 
3430 rajveer 1838
      protected getAllPromotions_result getResult(I iface, getAllPromotions_args args) throws org.apache.thrift.TException {
1839
        getAllPromotions_result result = new getAllPromotions_result();
1840
        try {
1841
          result.success = iface.getAllPromotions();
1842
        } catch (PromotionException pex) {
1843
          result.pex = pex;
1844
        }
1845
        return result;
1982 varun.gupt 1846
      }
3430 rajveer 1847
    }
1982 varun.gupt 1848
 
3430 rajveer 1849
    private static class getPromotionById<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPromotionById_args> {
1850
      public getPromotionById() {
1851
        super("getPromotionById");
1982 varun.gupt 1852
      }
1853
 
3430 rajveer 1854
      protected getPromotionById_args getEmptyArgsInstance() {
1855
        return new getPromotionById_args();
1982 varun.gupt 1856
      }
1857
 
3430 rajveer 1858
      protected getPromotionById_result getResult(I iface, getPromotionById_args args) throws org.apache.thrift.TException {
1859
        getPromotionById_result result = new getPromotionById_result();
1860
        try {
1861
          result.success = iface.getPromotionById(args.promotionId);
1862
        } catch (PromotionException pex) {
1863
          result.pex = pex;
1864
        }
1865
        return result;
1982 varun.gupt 1866
      }
1867
    }
1868
 
3430 rajveer 1869
    private static class generateCouponsForPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, generateCouponsForPromotion_args> {
1870
      public generateCouponsForPromotion() {
1871
        super("generateCouponsForPromotion");
1872
      }
1982 varun.gupt 1873
 
3430 rajveer 1874
      protected generateCouponsForPromotion_args getEmptyArgsInstance() {
1875
        return new generateCouponsForPromotion_args();
1876
      }
1982 varun.gupt 1877
 
3430 rajveer 1878
      protected generateCouponsForPromotion_result getResult(I iface, generateCouponsForPromotion_args args) throws org.apache.thrift.TException {
1879
        generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
1880
        try {
1881
          iface.generateCouponsForPromotion(args.promotionId, args.couponCode);
1882
        } catch (PromotionException pex) {
1883
          result.pex = pex;
1884
        }
1885
        return result;
1886
      }
1982 varun.gupt 1887
    }
1888
 
3430 rajveer 1889
    private static class applyCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, applyCoupon_args> {
1890
      public applyCoupon() {
1891
        super("applyCoupon");
1892
      }
1982 varun.gupt 1893
 
3430 rajveer 1894
      protected applyCoupon_args getEmptyArgsInstance() {
1895
        return new applyCoupon_args();
1896
      }
1982 varun.gupt 1897
 
3430 rajveer 1898
      protected applyCoupon_result getResult(I iface, applyCoupon_args args) throws org.apache.thrift.TException {
1899
        applyCoupon_result result = new applyCoupon_result();
1900
        try {
1901
          result.success = iface.applyCoupon(args.couponCode, args.cartId);
1902
        } catch (PromotionException pex) {
1903
          result.pex = pex;
1904
        }
1905
        return result;
1982 varun.gupt 1906
      }
1907
    }
1908
 
6736 amit.gupta 1909
    private static class getEmiDiscount<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getEmiDiscount_args> {
1910
      public getEmiDiscount() {
1911
        super("getEmiDiscount");
1912
      }
1913
 
1914
      protected getEmiDiscount_args getEmptyArgsInstance() {
1915
        return new getEmiDiscount_args();
1916
      }
1917
 
1918
      protected getEmiDiscount_result getResult(I iface, getEmiDiscount_args args) throws org.apache.thrift.TException {
1919
        getEmiDiscount_result result = new getEmiDiscount_result();
1920
        try {
1921
          result.success = iface.getEmiDiscount(args.cartId);
1922
        } catch (PromotionException pex) {
1923
          result.pex = pex;
1924
        }
1925
        return result;
1926
      }
1927
    }
1928
 
6433 anupam.sin 1929
    private static class applyRechargeCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, applyRechargeCoupon_args> {
1930
      public applyRechargeCoupon() {
1931
        super("applyRechargeCoupon");
1932
      }
1933
 
1934
      protected applyRechargeCoupon_args getEmptyArgsInstance() {
1935
        return new applyRechargeCoupon_args();
1936
      }
1937
 
1938
      protected applyRechargeCoupon_result getResult(I iface, applyRechargeCoupon_args args) throws org.apache.thrift.TException {
1939
        applyRechargeCoupon_result result = new applyRechargeCoupon_result();
1940
        try {
1941
          result.success = iface.applyRechargeCoupon(args.couponCode, args.totalAmount, args.userId);
1942
        } catch (PromotionException pex) {
1943
          result.pex = pex;
1944
        }
1945
        return result;
1946
      }
1947
    }
1948
 
3430 rajveer 1949
    private static class trackCouponUsage<I extends Iface> extends org.apache.thrift.ProcessFunction<I, trackCouponUsage_args> {
1950
      public trackCouponUsage() {
1951
        super("trackCouponUsage");
1952
      }
1982 varun.gupt 1953
 
3430 rajveer 1954
      protected trackCouponUsage_args getEmptyArgsInstance() {
1955
        return new trackCouponUsage_args();
1982 varun.gupt 1956
      }
1957
 
3430 rajveer 1958
      protected trackCouponUsage_result getResult(I iface, trackCouponUsage_args args) throws org.apache.thrift.TException {
1959
        trackCouponUsage_result result = new trackCouponUsage_result();
1960
        try {
1961
          iface.trackCouponUsage(args.couponCode, args.transactionId, args.userId);
1962
        } catch (PromotionException pex) {
1963
          result.pex = pex;
1964
        }
1965
        return result;
1966
      }
1982 varun.gupt 1967
    }
1968
 
3430 rajveer 1969
    private static class getCouponUsageCountByUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCouponUsageCountByUser_args> {
1970
      public getCouponUsageCountByUser() {
1971
        super("getCouponUsageCountByUser");
1982 varun.gupt 1972
      }
1973
 
3430 rajveer 1974
      protected getCouponUsageCountByUser_args getEmptyArgsInstance() {
1975
        return new getCouponUsageCountByUser_args();
1976
      }
1982 varun.gupt 1977
 
3430 rajveer 1978
      protected getCouponUsageCountByUser_result getResult(I iface, getCouponUsageCountByUser_args args) throws org.apache.thrift.TException {
1979
        getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
1980
        try {
1981
          result.success = iface.getCouponUsageCountByUser(args.couponCode, args.userId);
1982
          result.setSuccessIsSet(true);
1983
        } catch (PromotionException pex) {
1984
          result.pex = pex;
1985
        }
1986
        return result;
1987
      }
1982 varun.gupt 1988
    }
1989
 
6497 amit.gupta 1990
    private static class getActiveCodes<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getActiveCodes_args> {
1991
      public getActiveCodes() {
1992
        super("getActiveCodes");
1993
      }
1994
 
1995
      protected getActiveCodes_args getEmptyArgsInstance() {
1996
        return new getActiveCodes_args();
1997
      }
1998
 
1999
      protected getActiveCodes_result getResult(I iface, getActiveCodes_args args) throws org.apache.thrift.TException {
2000
        getActiveCodes_result result = new getActiveCodes_result();
2001
        try {
2002
          result.success = iface.getActiveCodes(args.promotionId);
2003
        } catch (PromotionException pex) {
2004
          result.pex = pex;
2005
        }
2006
        return result;
2007
      }
2008
    }
2009
 
2010
    private static class deleteCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, deleteCoupon_args> {
2011
      public deleteCoupon() {
2012
        super("deleteCoupon");
2013
      }
2014
 
2015
      protected deleteCoupon_args getEmptyArgsInstance() {
2016
        return new deleteCoupon_args();
2017
      }
2018
 
2019
      protected deleteCoupon_result getResult(I iface, deleteCoupon_args args) throws org.apache.thrift.TException {
2020
        deleteCoupon_result result = new deleteCoupon_result();
2021
        try {
2022
          iface.deleteCoupon(args.couponCode);
2023
        } catch (PromotionException pex) {
2024
          result.pex = pex;
2025
        }
2026
        return result;
2027
      }
2028
    }
2029
 
7092 amit.gupta 2030
    private static class getAllCouponsByPromotionId<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllCouponsByPromotionId_args> {
2031
      public getAllCouponsByPromotionId() {
2032
        super("getAllCouponsByPromotionId");
2033
      }
2034
 
2035
      protected getAllCouponsByPromotionId_args getEmptyArgsInstance() {
2036
        return new getAllCouponsByPromotionId_args();
2037
      }
2038
 
2039
      protected getAllCouponsByPromotionId_result getResult(I iface, getAllCouponsByPromotionId_args args) throws org.apache.thrift.TException {
2040
        getAllCouponsByPromotionId_result result = new getAllCouponsByPromotionId_result();
2041
        try {
2042
          result.success = iface.getAllCouponsByPromotionId(args.promotionId);
2043
        } catch (PromotionException pex) {
2044
          result.pex = pex;
2045
        }
2046
        return result;
2047
      }
2048
    }
2049
 
3430 rajveer 2050
    private static class getActiveCoupons<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getActiveCoupons_args> {
2051
      public getActiveCoupons() {
2052
        super("getActiveCoupons");
2053
      }
1982 varun.gupt 2054
 
3430 rajveer 2055
      protected getActiveCoupons_args getEmptyArgsInstance() {
2056
        return new getActiveCoupons_args();
2057
      }
1982 varun.gupt 2058
 
3430 rajveer 2059
      protected getActiveCoupons_result getResult(I iface, getActiveCoupons_args args) throws org.apache.thrift.TException {
2060
        getActiveCoupons_result result = new getActiveCoupons_result();
2061
        try {
2062
          result.success = iface.getActiveCoupons();
2063
        } catch (PromotionException pex) {
2064
          result.pex = pex;
2065
        }
2066
        return result;
2067
      }
1982 varun.gupt 2068
    }
2069
 
6250 amit.gupta 2070
    private static class createCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createCoupon_args> {
2071
      public createCoupon() {
2072
        super("createCoupon");
2073
      }
2074
 
2075
      protected createCoupon_args getEmptyArgsInstance() {
2076
        return new createCoupon_args();
2077
      }
2078
 
2079
      protected createCoupon_result getResult(I iface, createCoupon_args args) throws org.apache.thrift.TException {
2080
        createCoupon_result result = new createCoupon_result();
2081
        try {
8707 manish.sha 2082
          result.success = iface.createCoupon(args.promotionId, args.couponCategory, args.couponCode, args.arguments, args.isCod, args.prefix);
6250 amit.gupta 2083
        } catch (PromotionException pex) {
2084
          result.pex = pex;
2085
        }
2086
        return result;
2087
      }
2088
    }
2089
 
3430 rajveer 2090
    private static class getSuccessfulPaymentCountForCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSuccessfulPaymentCountForCoupon_args> {
2091
      public getSuccessfulPaymentCountForCoupon() {
2092
        super("getSuccessfulPaymentCountForCoupon");
1982 varun.gupt 2093
      }
2094
 
3430 rajveer 2095
      protected getSuccessfulPaymentCountForCoupon_args getEmptyArgsInstance() {
2096
        return new getSuccessfulPaymentCountForCoupon_args();
2097
      }
1982 varun.gupt 2098
 
3430 rajveer 2099
      protected getSuccessfulPaymentCountForCoupon_result getResult(I iface, getSuccessfulPaymentCountForCoupon_args args) throws org.apache.thrift.TException {
2100
        getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
2101
        try {
2102
          result.success = iface.getSuccessfulPaymentCountForCoupon(args.couponCode);
2103
          result.setSuccessIsSet(true);
2104
        } catch (PromotionException pex) {
2105
          result.pex = pex;
1982 varun.gupt 2106
        }
3430 rajveer 2107
        return result;
1982 varun.gupt 2108
      }
2109
    }
2110
 
3430 rajveer 2111
    private static class getRuleDocString<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getRuleDocString_args> {
2112
      public getRuleDocString() {
2113
        super("getRuleDocString");
2114
      }
1982 varun.gupt 2115
 
3430 rajveer 2116
      protected getRuleDocString_args getEmptyArgsInstance() {
2117
        return new getRuleDocString_args();
2118
      }
1982 varun.gupt 2119
 
3430 rajveer 2120
      protected getRuleDocString_result getResult(I iface, getRuleDocString_args args) throws org.apache.thrift.TException {
2121
        getRuleDocString_result result = new getRuleDocString_result();
2122
        result.success = iface.getRuleDocString(args.ruleName);
2123
        return result;
2124
      }
1982 varun.gupt 2125
    }
2126
 
4189 varun.gupt 2127
    private static class getItemDiscountMap<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getItemDiscountMap_args> {
2128
      public getItemDiscountMap() {
2129
        super("getItemDiscountMap");
2130
      }
2131
 
2132
      protected getItemDiscountMap_args getEmptyArgsInstance() {
2133
        return new getItemDiscountMap_args();
2134
      }
2135
 
2136
      protected getItemDiscountMap_result getResult(I iface, getItemDiscountMap_args args) throws org.apache.thrift.TException {
2137
        getItemDiscountMap_result result = new getItemDiscountMap_result();
2138
        try {
2139
          result.success = iface.getItemDiscountMap(args.itemIds);
2140
        } catch (PromotionException pex) {
2141
          result.pex = pex;
2142
        }
2143
        return result;
2144
      }
2145
    }
2146
 
4494 varun.gupt 2147
    private static class getDiscountsForEntity<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getDiscountsForEntity_args> {
2148
      public getDiscountsForEntity() {
2149
        super("getDiscountsForEntity");
2150
      }
2151
 
2152
      protected getDiscountsForEntity_args getEmptyArgsInstance() {
2153
        return new getDiscountsForEntity_args();
2154
      }
2155
 
2156
      protected getDiscountsForEntity_result getResult(I iface, getDiscountsForEntity_args args) throws org.apache.thrift.TException {
2157
        getDiscountsForEntity_result result = new getDiscountsForEntity_result();
2158
        result.success = iface.getDiscountsForEntity(args.entityId);
2159
        return result;
2160
      }
2161
    }
2162
 
5469 rajveer 2163
    private static class addVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addVoucher_args> {
2164
      public addVoucher() {
2165
        super("addVoucher");
2166
      }
2167
 
2168
      protected addVoucher_args getEmptyArgsInstance() {
2169
        return new addVoucher_args();
2170
      }
2171
 
2172
      protected addVoucher_result getResult(I iface, addVoucher_args args) throws org.apache.thrift.TException {
2173
        addVoucher_result result = new addVoucher_result();
2174
        iface.addVoucher(args.voucher);
2175
        return result;
2176
      }
2177
    }
2178
 
2179
    private static class assignVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, assignVoucher_args> {
2180
      public assignVoucher() {
2181
        super("assignVoucher");
2182
      }
2183
 
2184
      protected assignVoucher_args getEmptyArgsInstance() {
2185
        return new assignVoucher_args();
2186
      }
2187
 
2188
      protected assignVoucher_result getResult(I iface, assignVoucher_args args) throws org.apache.thrift.TException {
2189
        assignVoucher_result result = new assignVoucher_result();
2190
        result.success = iface.assignVoucher(args.userId, args.userEmail, args.voucherType, args.amount);
2191
        return result;
2192
      }
2193
    }
2194
 
2195
    private static class markVoucherAsRedeemed<I extends Iface> extends org.apache.thrift.ProcessFunction<I, markVoucherAsRedeemed_args> {
2196
      public markVoucherAsRedeemed() {
2197
        super("markVoucherAsRedeemed");
2198
      }
2199
 
2200
      protected markVoucherAsRedeemed_args getEmptyArgsInstance() {
2201
        return new markVoucherAsRedeemed_args();
2202
      }
2203
 
2204
      protected markVoucherAsRedeemed_result getResult(I iface, markVoucherAsRedeemed_args args) throws org.apache.thrift.TException {
2205
        markVoucherAsRedeemed_result result = new markVoucherAsRedeemed_result();
2206
        result.success = iface.markVoucherAsRedeemed(args.voucherCode, args.redeemedOn);
2207
        result.setSuccessIsSet(true);
2208
        return result;
2209
      }
2210
    }
2211
 
1982 varun.gupt 2212
  }
2213
 
3430 rajveer 2214
  public static class createPromotion_args implements org.apache.thrift.TBase<createPromotion_args, createPromotion_args._Fields>, java.io.Serializable, Cloneable   {
2215
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_args");
1982 varun.gupt 2216
 
3430 rajveer 2217
    private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1);
2218
    private static final org.apache.thrift.protocol.TField RULE_EXECUTION_SRC_FIELD_DESC = new org.apache.thrift.protocol.TField("ruleExecutionSrc", org.apache.thrift.protocol.TType.STRING, (short)2);
2219
    private static final org.apache.thrift.protocol.TField START_ON_FIELD_DESC = new org.apache.thrift.protocol.TField("startOn", org.apache.thrift.protocol.TType.I64, (short)3);
2220
    private static final org.apache.thrift.protocol.TField END_ON_FIELD_DESC = new org.apache.thrift.protocol.TField("endOn", org.apache.thrift.protocol.TType.I64, (short)4);
1982 varun.gupt 2221
 
3430 rajveer 2222
    private String name; // required
2223
    private String ruleExecutionSrc; // required
2224
    private long startOn; // required
2225
    private long endOn; // required
1982 varun.gupt 2226
 
2227
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2228
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2229
      NAME((short)1, "name"),
2230
      RULE_EXECUTION_SRC((short)2, "ruleExecutionSrc"),
2231
      START_ON((short)3, "startOn"),
2232
      END_ON((short)4, "endOn");
2233
 
2234
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2235
 
2236
      static {
2237
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2238
          byName.put(field.getFieldName(), field);
2239
        }
2240
      }
2241
 
2242
      /**
2243
       * Find the _Fields constant that matches fieldId, or null if its not found.
2244
       */
2245
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2246
        switch(fieldId) {
2247
          case 1: // NAME
2248
            return NAME;
2249
          case 2: // RULE_EXECUTION_SRC
2250
            return RULE_EXECUTION_SRC;
2251
          case 3: // START_ON
2252
            return START_ON;
2253
          case 4: // END_ON
2254
            return END_ON;
2255
          default:
2256
            return null;
2257
        }
1982 varun.gupt 2258
      }
2259
 
2260
      /**
2261
       * Find the _Fields constant that matches fieldId, throwing an exception
2262
       * if it is not found.
2263
       */
2264
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2265
        _Fields fields = findByThriftId(fieldId);
2266
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2267
        return fields;
2268
      }
2269
 
2270
      /**
2271
       * Find the _Fields constant that matches name, or null if its not found.
2272
       */
2273
      public static _Fields findByName(String name) {
2274
        return byName.get(name);
2275
      }
2276
 
2277
      private final short _thriftId;
2278
      private final String _fieldName;
2279
 
2280
      _Fields(short thriftId, String fieldName) {
2281
        _thriftId = thriftId;
2282
        _fieldName = fieldName;
2283
      }
2284
 
2285
      public short getThriftFieldId() {
2286
        return _thriftId;
2287
      }
2288
 
2289
      public String getFieldName() {
2290
        return _fieldName;
2291
      }
2292
    }
2293
 
2294
    // isset id assignments
2295
    private static final int __STARTON_ISSET_ID = 0;
2296
    private static final int __ENDON_ISSET_ID = 1;
2297
    private BitSet __isset_bit_vector = new BitSet(2);
2298
 
3430 rajveer 2299
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2300
    static {
3430 rajveer 2301
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2302
      tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2303
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
2304
      tmpMap.put(_Fields.RULE_EXECUTION_SRC, new org.apache.thrift.meta_data.FieldMetaData("ruleExecutionSrc", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2305
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
2306
      tmpMap.put(_Fields.START_ON, new org.apache.thrift.meta_data.FieldMetaData("startOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2307
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
2308
      tmpMap.put(_Fields.END_ON, new org.apache.thrift.meta_data.FieldMetaData("endOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2309
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
2310
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2311
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_args.class, metaDataMap);
1982 varun.gupt 2312
    }
2313
 
2314
    public createPromotion_args() {
2315
    }
2316
 
2317
    public createPromotion_args(
2318
      String name,
2319
      String ruleExecutionSrc,
2320
      long startOn,
2321
      long endOn)
2322
    {
2323
      this();
2324
      this.name = name;
2325
      this.ruleExecutionSrc = ruleExecutionSrc;
2326
      this.startOn = startOn;
2327
      setStartOnIsSet(true);
2328
      this.endOn = endOn;
2329
      setEndOnIsSet(true);
2330
    }
2331
 
2332
    /**
2333
     * Performs a deep copy on <i>other</i>.
2334
     */
2335
    public createPromotion_args(createPromotion_args other) {
2336
      __isset_bit_vector.clear();
2337
      __isset_bit_vector.or(other.__isset_bit_vector);
2338
      if (other.isSetName()) {
2339
        this.name = other.name;
2340
      }
2341
      if (other.isSetRuleExecutionSrc()) {
2342
        this.ruleExecutionSrc = other.ruleExecutionSrc;
2343
      }
2344
      this.startOn = other.startOn;
2345
      this.endOn = other.endOn;
2346
    }
2347
 
2348
    public createPromotion_args deepCopy() {
2349
      return new createPromotion_args(this);
2350
    }
2351
 
3430 rajveer 2352
    @Override
2353
    public void clear() {
2354
      this.name = null;
2355
      this.ruleExecutionSrc = null;
2356
      setStartOnIsSet(false);
2357
      this.startOn = 0;
2358
      setEndOnIsSet(false);
2359
      this.endOn = 0;
1982 varun.gupt 2360
    }
2361
 
2362
    public String getName() {
2363
      return this.name;
2364
    }
2365
 
3430 rajveer 2366
    public void setName(String name) {
1982 varun.gupt 2367
      this.name = name;
2368
    }
2369
 
2370
    public void unsetName() {
2371
      this.name = null;
2372
    }
2373
 
3430 rajveer 2374
    /** Returns true if field name is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2375
    public boolean isSetName() {
2376
      return this.name != null;
2377
    }
2378
 
2379
    public void setNameIsSet(boolean value) {
2380
      if (!value) {
2381
        this.name = null;
2382
      }
2383
    }
2384
 
2385
    public String getRuleExecutionSrc() {
2386
      return this.ruleExecutionSrc;
2387
    }
2388
 
3430 rajveer 2389
    public void setRuleExecutionSrc(String ruleExecutionSrc) {
1982 varun.gupt 2390
      this.ruleExecutionSrc = ruleExecutionSrc;
2391
    }
2392
 
2393
    public void unsetRuleExecutionSrc() {
2394
      this.ruleExecutionSrc = null;
2395
    }
2396
 
3430 rajveer 2397
    /** Returns true if field ruleExecutionSrc is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2398
    public boolean isSetRuleExecutionSrc() {
2399
      return this.ruleExecutionSrc != null;
2400
    }
2401
 
2402
    public void setRuleExecutionSrcIsSet(boolean value) {
2403
      if (!value) {
2404
        this.ruleExecutionSrc = null;
2405
      }
2406
    }
2407
 
2408
    public long getStartOn() {
2409
      return this.startOn;
2410
    }
2411
 
3430 rajveer 2412
    public void setStartOn(long startOn) {
1982 varun.gupt 2413
      this.startOn = startOn;
2414
      setStartOnIsSet(true);
2415
    }
2416
 
2417
    public void unsetStartOn() {
2418
      __isset_bit_vector.clear(__STARTON_ISSET_ID);
2419
    }
2420
 
3430 rajveer 2421
    /** Returns true if field startOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2422
    public boolean isSetStartOn() {
2423
      return __isset_bit_vector.get(__STARTON_ISSET_ID);
2424
    }
2425
 
2426
    public void setStartOnIsSet(boolean value) {
2427
      __isset_bit_vector.set(__STARTON_ISSET_ID, value);
2428
    }
2429
 
2430
    public long getEndOn() {
2431
      return this.endOn;
2432
    }
2433
 
3430 rajveer 2434
    public void setEndOn(long endOn) {
1982 varun.gupt 2435
      this.endOn = endOn;
2436
      setEndOnIsSet(true);
2437
    }
2438
 
2439
    public void unsetEndOn() {
2440
      __isset_bit_vector.clear(__ENDON_ISSET_ID);
2441
    }
2442
 
3430 rajveer 2443
    /** Returns true if field endOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2444
    public boolean isSetEndOn() {
2445
      return __isset_bit_vector.get(__ENDON_ISSET_ID);
2446
    }
2447
 
2448
    public void setEndOnIsSet(boolean value) {
2449
      __isset_bit_vector.set(__ENDON_ISSET_ID, value);
2450
    }
2451
 
2452
    public void setFieldValue(_Fields field, Object value) {
2453
      switch (field) {
2454
      case NAME:
2455
        if (value == null) {
2456
          unsetName();
2457
        } else {
2458
          setName((String)value);
2459
        }
2460
        break;
2461
 
2462
      case RULE_EXECUTION_SRC:
2463
        if (value == null) {
2464
          unsetRuleExecutionSrc();
2465
        } else {
2466
          setRuleExecutionSrc((String)value);
2467
        }
2468
        break;
2469
 
2470
      case START_ON:
2471
        if (value == null) {
2472
          unsetStartOn();
2473
        } else {
2474
          setStartOn((Long)value);
2475
        }
2476
        break;
2477
 
2478
      case END_ON:
2479
        if (value == null) {
2480
          unsetEndOn();
2481
        } else {
2482
          setEndOn((Long)value);
2483
        }
2484
        break;
2485
 
2486
      }
2487
    }
2488
 
2489
    public Object getFieldValue(_Fields field) {
2490
      switch (field) {
2491
      case NAME:
2492
        return getName();
2493
 
2494
      case RULE_EXECUTION_SRC:
2495
        return getRuleExecutionSrc();
2496
 
2497
      case START_ON:
3430 rajveer 2498
        return Long.valueOf(getStartOn());
1982 varun.gupt 2499
 
2500
      case END_ON:
3430 rajveer 2501
        return Long.valueOf(getEndOn());
1982 varun.gupt 2502
 
2503
      }
2504
      throw new IllegalStateException();
2505
    }
2506
 
3430 rajveer 2507
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2508
    public boolean isSet(_Fields field) {
2509
      if (field == null) {
2510
        throw new IllegalArgumentException();
2511
      }
1982 varun.gupt 2512
 
2513
      switch (field) {
2514
      case NAME:
2515
        return isSetName();
2516
      case RULE_EXECUTION_SRC:
2517
        return isSetRuleExecutionSrc();
2518
      case START_ON:
2519
        return isSetStartOn();
2520
      case END_ON:
2521
        return isSetEndOn();
2522
      }
2523
      throw new IllegalStateException();
2524
    }
2525
 
2526
    @Override
2527
    public boolean equals(Object that) {
2528
      if (that == null)
2529
        return false;
2530
      if (that instanceof createPromotion_args)
2531
        return this.equals((createPromotion_args)that);
2532
      return false;
2533
    }
2534
 
2535
    public boolean equals(createPromotion_args that) {
2536
      if (that == null)
2537
        return false;
2538
 
2539
      boolean this_present_name = true && this.isSetName();
2540
      boolean that_present_name = true && that.isSetName();
2541
      if (this_present_name || that_present_name) {
2542
        if (!(this_present_name && that_present_name))
2543
          return false;
2544
        if (!this.name.equals(that.name))
2545
          return false;
2546
      }
2547
 
2548
      boolean this_present_ruleExecutionSrc = true && this.isSetRuleExecutionSrc();
2549
      boolean that_present_ruleExecutionSrc = true && that.isSetRuleExecutionSrc();
2550
      if (this_present_ruleExecutionSrc || that_present_ruleExecutionSrc) {
2551
        if (!(this_present_ruleExecutionSrc && that_present_ruleExecutionSrc))
2552
          return false;
2553
        if (!this.ruleExecutionSrc.equals(that.ruleExecutionSrc))
2554
          return false;
2555
      }
2556
 
2557
      boolean this_present_startOn = true;
2558
      boolean that_present_startOn = true;
2559
      if (this_present_startOn || that_present_startOn) {
2560
        if (!(this_present_startOn && that_present_startOn))
2561
          return false;
2562
        if (this.startOn != that.startOn)
2563
          return false;
2564
      }
2565
 
2566
      boolean this_present_endOn = true;
2567
      boolean that_present_endOn = true;
2568
      if (this_present_endOn || that_present_endOn) {
2569
        if (!(this_present_endOn && that_present_endOn))
2570
          return false;
2571
        if (this.endOn != that.endOn)
2572
          return false;
2573
      }
2574
 
2575
      return true;
2576
    }
2577
 
2578
    @Override
2579
    public int hashCode() {
2580
      return 0;
2581
    }
2582
 
2583
    public int compareTo(createPromotion_args other) {
2584
      if (!getClass().equals(other.getClass())) {
2585
        return getClass().getName().compareTo(other.getClass().getName());
2586
      }
2587
 
2588
      int lastComparison = 0;
2589
      createPromotion_args typedOther = (createPromotion_args)other;
2590
 
3430 rajveer 2591
      lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
1982 varun.gupt 2592
      if (lastComparison != 0) {
2593
        return lastComparison;
2594
      }
3430 rajveer 2595
      if (isSetName()) {
2596
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
2597
        if (lastComparison != 0) {
2598
          return lastComparison;
2599
        }
1982 varun.gupt 2600
      }
3430 rajveer 2601
      lastComparison = Boolean.valueOf(isSetRuleExecutionSrc()).compareTo(typedOther.isSetRuleExecutionSrc());
1982 varun.gupt 2602
      if (lastComparison != 0) {
2603
        return lastComparison;
2604
      }
3430 rajveer 2605
      if (isSetRuleExecutionSrc()) {
2606
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleExecutionSrc, typedOther.ruleExecutionSrc);
2607
        if (lastComparison != 0) {
2608
          return lastComparison;
2609
        }
1982 varun.gupt 2610
      }
3430 rajveer 2611
      lastComparison = Boolean.valueOf(isSetStartOn()).compareTo(typedOther.isSetStartOn());
1982 varun.gupt 2612
      if (lastComparison != 0) {
2613
        return lastComparison;
2614
      }
3430 rajveer 2615
      if (isSetStartOn()) {
2616
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startOn, typedOther.startOn);
2617
        if (lastComparison != 0) {
2618
          return lastComparison;
2619
        }
1982 varun.gupt 2620
      }
3430 rajveer 2621
      lastComparison = Boolean.valueOf(isSetEndOn()).compareTo(typedOther.isSetEndOn());
1982 varun.gupt 2622
      if (lastComparison != 0) {
2623
        return lastComparison;
2624
      }
3430 rajveer 2625
      if (isSetEndOn()) {
2626
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endOn, typedOther.endOn);
2627
        if (lastComparison != 0) {
2628
          return lastComparison;
2629
        }
1982 varun.gupt 2630
      }
2631
      return 0;
2632
    }
2633
 
3430 rajveer 2634
    public _Fields fieldForId(int fieldId) {
2635
      return _Fields.findByThriftId(fieldId);
2636
    }
2637
 
2638
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2639
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2640
      iprot.readStructBegin();
2641
      while (true)
2642
      {
2643
        field = iprot.readFieldBegin();
3430 rajveer 2644
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2645
          break;
2646
        }
3430 rajveer 2647
        switch (field.id) {
2648
          case 1: // NAME
2649
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
2650
              this.name = iprot.readString();
2651
            } else { 
2652
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2653
            }
2654
            break;
2655
          case 2: // RULE_EXECUTION_SRC
2656
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
2657
              this.ruleExecutionSrc = iprot.readString();
2658
            } else { 
2659
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2660
            }
2661
            break;
2662
          case 3: // START_ON
2663
            if (field.type == org.apache.thrift.protocol.TType.I64) {
2664
              this.startOn = iprot.readI64();
2665
              setStartOnIsSet(true);
2666
            } else { 
2667
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2668
            }
2669
            break;
2670
          case 4: // END_ON
2671
            if (field.type == org.apache.thrift.protocol.TType.I64) {
2672
              this.endOn = iprot.readI64();
2673
              setEndOnIsSet(true);
2674
            } else { 
2675
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2676
            }
2677
            break;
2678
          default:
2679
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2680
        }
3430 rajveer 2681
        iprot.readFieldEnd();
1982 varun.gupt 2682
      }
2683
      iprot.readStructEnd();
2684
      validate();
2685
    }
2686
 
3430 rajveer 2687
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2688
      validate();
2689
 
2690
      oprot.writeStructBegin(STRUCT_DESC);
2691
      if (this.name != null) {
2692
        oprot.writeFieldBegin(NAME_FIELD_DESC);
2693
        oprot.writeString(this.name);
2694
        oprot.writeFieldEnd();
2695
      }
2696
      if (this.ruleExecutionSrc != null) {
2697
        oprot.writeFieldBegin(RULE_EXECUTION_SRC_FIELD_DESC);
2698
        oprot.writeString(this.ruleExecutionSrc);
2699
        oprot.writeFieldEnd();
2700
      }
2701
      oprot.writeFieldBegin(START_ON_FIELD_DESC);
2702
      oprot.writeI64(this.startOn);
2703
      oprot.writeFieldEnd();
2704
      oprot.writeFieldBegin(END_ON_FIELD_DESC);
2705
      oprot.writeI64(this.endOn);
2706
      oprot.writeFieldEnd();
2707
      oprot.writeFieldStop();
2708
      oprot.writeStructEnd();
2709
    }
2710
 
2711
    @Override
2712
    public String toString() {
2713
      StringBuilder sb = new StringBuilder("createPromotion_args(");
2714
      boolean first = true;
2715
 
2716
      sb.append("name:");
2717
      if (this.name == null) {
2718
        sb.append("null");
2719
      } else {
2720
        sb.append(this.name);
2721
      }
2722
      first = false;
2723
      if (!first) sb.append(", ");
2724
      sb.append("ruleExecutionSrc:");
2725
      if (this.ruleExecutionSrc == null) {
2726
        sb.append("null");
2727
      } else {
2728
        sb.append(this.ruleExecutionSrc);
2729
      }
2730
      first = false;
2731
      if (!first) sb.append(", ");
2732
      sb.append("startOn:");
2733
      sb.append(this.startOn);
2734
      first = false;
2735
      if (!first) sb.append(", ");
2736
      sb.append("endOn:");
2737
      sb.append(this.endOn);
2738
      first = false;
2739
      sb.append(")");
2740
      return sb.toString();
2741
    }
2742
 
3430 rajveer 2743
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2744
      // check for required fields
2745
    }
2746
 
3430 rajveer 2747
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2748
      try {
2749
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2750
      } catch (org.apache.thrift.TException te) {
2751
        throw new java.io.IOException(te);
2752
      }
2753
    }
2754
 
2755
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2756
      try {
2757
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
2758
        __isset_bit_vector = new BitSet(1);
2759
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2760
      } catch (org.apache.thrift.TException te) {
2761
        throw new java.io.IOException(te);
2762
      }
2763
    }
2764
 
1982 varun.gupt 2765
  }
2766
 
3430 rajveer 2767
  public static class createPromotion_result implements org.apache.thrift.TBase<createPromotion_result, createPromotion_result._Fields>, java.io.Serializable, Cloneable   {
2768
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_result");
1982 varun.gupt 2769
 
3430 rajveer 2770
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
1982 varun.gupt 2771
 
3430 rajveer 2772
    private PromotionException pex; // required
1982 varun.gupt 2773
 
2774
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2775
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2776
      PEX((short)1, "pex");
2777
 
2778
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2779
 
2780
      static {
2781
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2782
          byName.put(field.getFieldName(), field);
2783
        }
2784
      }
2785
 
2786
      /**
2787
       * Find the _Fields constant that matches fieldId, or null if its not found.
2788
       */
2789
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2790
        switch(fieldId) {
2791
          case 1: // PEX
2792
            return PEX;
2793
          default:
2794
            return null;
2795
        }
1982 varun.gupt 2796
      }
2797
 
2798
      /**
2799
       * Find the _Fields constant that matches fieldId, throwing an exception
2800
       * if it is not found.
2801
       */
2802
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2803
        _Fields fields = findByThriftId(fieldId);
2804
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2805
        return fields;
2806
      }
2807
 
2808
      /**
2809
       * Find the _Fields constant that matches name, or null if its not found.
2810
       */
2811
      public static _Fields findByName(String name) {
2812
        return byName.get(name);
2813
      }
2814
 
2815
      private final short _thriftId;
2816
      private final String _fieldName;
2817
 
2818
      _Fields(short thriftId, String fieldName) {
2819
        _thriftId = thriftId;
2820
        _fieldName = fieldName;
2821
      }
2822
 
2823
      public short getThriftFieldId() {
2824
        return _thriftId;
2825
      }
2826
 
2827
      public String getFieldName() {
2828
        return _fieldName;
2829
      }
2830
    }
2831
 
2832
    // isset id assignments
2833
 
3430 rajveer 2834
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2835
    static {
3430 rajveer 2836
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2837
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2838
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
2839
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2840
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_result.class, metaDataMap);
1982 varun.gupt 2841
    }
2842
 
2843
    public createPromotion_result() {
2844
    }
2845
 
2846
    public createPromotion_result(
2847
      PromotionException pex)
2848
    {
2849
      this();
2850
      this.pex = pex;
2851
    }
2852
 
2853
    /**
2854
     * Performs a deep copy on <i>other</i>.
2855
     */
2856
    public createPromotion_result(createPromotion_result other) {
2857
      if (other.isSetPex()) {
2858
        this.pex = new PromotionException(other.pex);
2859
      }
2860
    }
2861
 
2862
    public createPromotion_result deepCopy() {
2863
      return new createPromotion_result(this);
2864
    }
2865
 
3430 rajveer 2866
    @Override
2867
    public void clear() {
2868
      this.pex = null;
1982 varun.gupt 2869
    }
2870
 
2871
    public PromotionException getPex() {
2872
      return this.pex;
2873
    }
2874
 
3430 rajveer 2875
    public void setPex(PromotionException pex) {
1982 varun.gupt 2876
      this.pex = pex;
2877
    }
2878
 
2879
    public void unsetPex() {
2880
      this.pex = null;
2881
    }
2882
 
3430 rajveer 2883
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2884
    public boolean isSetPex() {
2885
      return this.pex != null;
2886
    }
2887
 
2888
    public void setPexIsSet(boolean value) {
2889
      if (!value) {
2890
        this.pex = null;
2891
      }
2892
    }
2893
 
2894
    public void setFieldValue(_Fields field, Object value) {
2895
      switch (field) {
2896
      case PEX:
2897
        if (value == null) {
2898
          unsetPex();
2899
        } else {
2900
          setPex((PromotionException)value);
2901
        }
2902
        break;
2903
 
2904
      }
2905
    }
2906
 
2907
    public Object getFieldValue(_Fields field) {
2908
      switch (field) {
2909
      case PEX:
2910
        return getPex();
2911
 
2912
      }
2913
      throw new IllegalStateException();
2914
    }
2915
 
3430 rajveer 2916
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2917
    public boolean isSet(_Fields field) {
2918
      if (field == null) {
2919
        throw new IllegalArgumentException();
2920
      }
1982 varun.gupt 2921
 
2922
      switch (field) {
2923
      case PEX:
2924
        return isSetPex();
2925
      }
2926
      throw new IllegalStateException();
2927
    }
2928
 
2929
    @Override
2930
    public boolean equals(Object that) {
2931
      if (that == null)
2932
        return false;
2933
      if (that instanceof createPromotion_result)
2934
        return this.equals((createPromotion_result)that);
2935
      return false;
2936
    }
2937
 
2938
    public boolean equals(createPromotion_result that) {
2939
      if (that == null)
2940
        return false;
2941
 
2942
      boolean this_present_pex = true && this.isSetPex();
2943
      boolean that_present_pex = true && that.isSetPex();
2944
      if (this_present_pex || that_present_pex) {
2945
        if (!(this_present_pex && that_present_pex))
2946
          return false;
2947
        if (!this.pex.equals(that.pex))
2948
          return false;
2949
      }
2950
 
2951
      return true;
2952
    }
2953
 
2954
    @Override
2955
    public int hashCode() {
2956
      return 0;
2957
    }
2958
 
2959
    public int compareTo(createPromotion_result other) {
2960
      if (!getClass().equals(other.getClass())) {
2961
        return getClass().getName().compareTo(other.getClass().getName());
2962
      }
2963
 
2964
      int lastComparison = 0;
2965
      createPromotion_result typedOther = (createPromotion_result)other;
2966
 
3430 rajveer 2967
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 2968
      if (lastComparison != 0) {
2969
        return lastComparison;
2970
      }
3430 rajveer 2971
      if (isSetPex()) {
2972
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
2973
        if (lastComparison != 0) {
2974
          return lastComparison;
2975
        }
1982 varun.gupt 2976
      }
2977
      return 0;
2978
    }
2979
 
3430 rajveer 2980
    public _Fields fieldForId(int fieldId) {
2981
      return _Fields.findByThriftId(fieldId);
2982
    }
2983
 
2984
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2985
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2986
      iprot.readStructBegin();
2987
      while (true)
2988
      {
2989
        field = iprot.readFieldBegin();
3430 rajveer 2990
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2991
          break;
2992
        }
3430 rajveer 2993
        switch (field.id) {
2994
          case 1: // PEX
2995
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
2996
              this.pex = new PromotionException();
2997
              this.pex.read(iprot);
2998
            } else { 
2999
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3000
            }
3001
            break;
3002
          default:
3003
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 3004
        }
3430 rajveer 3005
        iprot.readFieldEnd();
1982 varun.gupt 3006
      }
3007
      iprot.readStructEnd();
3008
      validate();
3009
    }
3010
 
3430 rajveer 3011
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 3012
      oprot.writeStructBegin(STRUCT_DESC);
3013
 
3014
      if (this.isSetPex()) {
3015
        oprot.writeFieldBegin(PEX_FIELD_DESC);
3016
        this.pex.write(oprot);
3017
        oprot.writeFieldEnd();
3018
      }
3019
      oprot.writeFieldStop();
3020
      oprot.writeStructEnd();
3021
    }
3022
 
3023
    @Override
3024
    public String toString() {
3025
      StringBuilder sb = new StringBuilder("createPromotion_result(");
3026
      boolean first = true;
3027
 
3028
      sb.append("pex:");
3029
      if (this.pex == null) {
3030
        sb.append("null");
3031
      } else {
3032
        sb.append(this.pex);
3033
      }
3034
      first = false;
3035
      sb.append(")");
3036
      return sb.toString();
3037
    }
3038
 
3430 rajveer 3039
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 3040
      // check for required fields
3041
    }
3042
 
3430 rajveer 3043
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3044
      try {
3045
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3046
      } catch (org.apache.thrift.TException te) {
3047
        throw new java.io.IOException(te);
3048
      }
3049
    }
3050
 
3051
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3052
      try {
3053
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3054
      } catch (org.apache.thrift.TException te) {
3055
        throw new java.io.IOException(te);
3056
      }
3057
    }
3058
 
1982 varun.gupt 3059
  }
3060
 
7746 amit.gupta 3061
  public static class removeAllCouponsByPromotionId_args implements org.apache.thrift.TBase<removeAllCouponsByPromotionId_args, removeAllCouponsByPromotionId_args._Fields>, java.io.Serializable, Cloneable   {
3062
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("removeAllCouponsByPromotionId_args");
3063
 
3064
    private static final org.apache.thrift.protocol.TField PROMOTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("promotionId", org.apache.thrift.protocol.TType.I64, (short)1);
3065
 
3066
    private long promotionId; // required
3067
 
3068
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3069
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3070
      PROMOTION_ID((short)1, "promotionId");
3071
 
3072
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3073
 
3074
      static {
3075
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3076
          byName.put(field.getFieldName(), field);
3077
        }
3078
      }
3079
 
3080
      /**
3081
       * Find the _Fields constant that matches fieldId, or null if its not found.
3082
       */
3083
      public static _Fields findByThriftId(int fieldId) {
3084
        switch(fieldId) {
3085
          case 1: // PROMOTION_ID
3086
            return PROMOTION_ID;
3087
          default:
3088
            return null;
3089
        }
3090
      }
3091
 
3092
      /**
3093
       * Find the _Fields constant that matches fieldId, throwing an exception
3094
       * if it is not found.
3095
       */
3096
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3097
        _Fields fields = findByThriftId(fieldId);
3098
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3099
        return fields;
3100
      }
3101
 
3102
      /**
3103
       * Find the _Fields constant that matches name, or null if its not found.
3104
       */
3105
      public static _Fields findByName(String name) {
3106
        return byName.get(name);
3107
      }
3108
 
3109
      private final short _thriftId;
3110
      private final String _fieldName;
3111
 
3112
      _Fields(short thriftId, String fieldName) {
3113
        _thriftId = thriftId;
3114
        _fieldName = fieldName;
3115
      }
3116
 
3117
      public short getThriftFieldId() {
3118
        return _thriftId;
3119
      }
3120
 
3121
      public String getFieldName() {
3122
        return _fieldName;
3123
      }
3124
    }
3125
 
3126
    // isset id assignments
3127
    private static final int __PROMOTIONID_ISSET_ID = 0;
3128
    private BitSet __isset_bit_vector = new BitSet(1);
3129
 
3130
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3131
    static {
3132
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3133
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3134
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
3135
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3136
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(removeAllCouponsByPromotionId_args.class, metaDataMap);
3137
    }
3138
 
3139
    public removeAllCouponsByPromotionId_args() {
3140
    }
3141
 
3142
    public removeAllCouponsByPromotionId_args(
3143
      long promotionId)
3144
    {
3145
      this();
3146
      this.promotionId = promotionId;
3147
      setPromotionIdIsSet(true);
3148
    }
3149
 
3150
    /**
3151
     * Performs a deep copy on <i>other</i>.
3152
     */
3153
    public removeAllCouponsByPromotionId_args(removeAllCouponsByPromotionId_args other) {
3154
      __isset_bit_vector.clear();
3155
      __isset_bit_vector.or(other.__isset_bit_vector);
3156
      this.promotionId = other.promotionId;
3157
    }
3158
 
3159
    public removeAllCouponsByPromotionId_args deepCopy() {
3160
      return new removeAllCouponsByPromotionId_args(this);
3161
    }
3162
 
3163
    @Override
3164
    public void clear() {
3165
      setPromotionIdIsSet(false);
3166
      this.promotionId = 0;
3167
    }
3168
 
3169
    public long getPromotionId() {
3170
      return this.promotionId;
3171
    }
3172
 
3173
    public void setPromotionId(long promotionId) {
3174
      this.promotionId = promotionId;
3175
      setPromotionIdIsSet(true);
3176
    }
3177
 
3178
    public void unsetPromotionId() {
3179
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
3180
    }
3181
 
3182
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
3183
    public boolean isSetPromotionId() {
3184
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
3185
    }
3186
 
3187
    public void setPromotionIdIsSet(boolean value) {
3188
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
3189
    }
3190
 
3191
    public void setFieldValue(_Fields field, Object value) {
3192
      switch (field) {
3193
      case PROMOTION_ID:
3194
        if (value == null) {
3195
          unsetPromotionId();
3196
        } else {
3197
          setPromotionId((Long)value);
3198
        }
3199
        break;
3200
 
3201
      }
3202
    }
3203
 
3204
    public Object getFieldValue(_Fields field) {
3205
      switch (field) {
3206
      case PROMOTION_ID:
3207
        return Long.valueOf(getPromotionId());
3208
 
3209
      }
3210
      throw new IllegalStateException();
3211
    }
3212
 
3213
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3214
    public boolean isSet(_Fields field) {
3215
      if (field == null) {
3216
        throw new IllegalArgumentException();
3217
      }
3218
 
3219
      switch (field) {
3220
      case PROMOTION_ID:
3221
        return isSetPromotionId();
3222
      }
3223
      throw new IllegalStateException();
3224
    }
3225
 
3226
    @Override
3227
    public boolean equals(Object that) {
3228
      if (that == null)
3229
        return false;
3230
      if (that instanceof removeAllCouponsByPromotionId_args)
3231
        return this.equals((removeAllCouponsByPromotionId_args)that);
3232
      return false;
3233
    }
3234
 
3235
    public boolean equals(removeAllCouponsByPromotionId_args that) {
3236
      if (that == null)
3237
        return false;
3238
 
3239
      boolean this_present_promotionId = true;
3240
      boolean that_present_promotionId = true;
3241
      if (this_present_promotionId || that_present_promotionId) {
3242
        if (!(this_present_promotionId && that_present_promotionId))
3243
          return false;
3244
        if (this.promotionId != that.promotionId)
3245
          return false;
3246
      }
3247
 
3248
      return true;
3249
    }
3250
 
3251
    @Override
3252
    public int hashCode() {
3253
      return 0;
3254
    }
3255
 
3256
    public int compareTo(removeAllCouponsByPromotionId_args other) {
3257
      if (!getClass().equals(other.getClass())) {
3258
        return getClass().getName().compareTo(other.getClass().getName());
3259
      }
3260
 
3261
      int lastComparison = 0;
3262
      removeAllCouponsByPromotionId_args typedOther = (removeAllCouponsByPromotionId_args)other;
3263
 
3264
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
3265
      if (lastComparison != 0) {
3266
        return lastComparison;
3267
      }
3268
      if (isSetPromotionId()) {
3269
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
3270
        if (lastComparison != 0) {
3271
          return lastComparison;
3272
        }
3273
      }
3274
      return 0;
3275
    }
3276
 
3277
    public _Fields fieldForId(int fieldId) {
3278
      return _Fields.findByThriftId(fieldId);
3279
    }
3280
 
3281
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3282
      org.apache.thrift.protocol.TField field;
3283
      iprot.readStructBegin();
3284
      while (true)
3285
      {
3286
        field = iprot.readFieldBegin();
3287
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3288
          break;
3289
        }
3290
        switch (field.id) {
3291
          case 1: // PROMOTION_ID
3292
            if (field.type == org.apache.thrift.protocol.TType.I64) {
3293
              this.promotionId = iprot.readI64();
3294
              setPromotionIdIsSet(true);
3295
            } else { 
3296
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3297
            }
3298
            break;
3299
          default:
3300
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3301
        }
3302
        iprot.readFieldEnd();
3303
      }
3304
      iprot.readStructEnd();
3305
      validate();
3306
    }
3307
 
3308
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3309
      validate();
3310
 
3311
      oprot.writeStructBegin(STRUCT_DESC);
3312
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
3313
      oprot.writeI64(this.promotionId);
3314
      oprot.writeFieldEnd();
3315
      oprot.writeFieldStop();
3316
      oprot.writeStructEnd();
3317
    }
3318
 
3319
    @Override
3320
    public String toString() {
3321
      StringBuilder sb = new StringBuilder("removeAllCouponsByPromotionId_args(");
3322
      boolean first = true;
3323
 
3324
      sb.append("promotionId:");
3325
      sb.append(this.promotionId);
3326
      first = false;
3327
      sb.append(")");
3328
      return sb.toString();
3329
    }
3330
 
3331
    public void validate() throws org.apache.thrift.TException {
3332
      // check for required fields
3333
    }
3334
 
3335
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3336
      try {
3337
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3338
      } catch (org.apache.thrift.TException te) {
3339
        throw new java.io.IOException(te);
3340
      }
3341
    }
3342
 
3343
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3344
      try {
3345
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
3346
        __isset_bit_vector = new BitSet(1);
3347
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3348
      } catch (org.apache.thrift.TException te) {
3349
        throw new java.io.IOException(te);
3350
      }
3351
    }
3352
 
3353
  }
3354
 
3355
  public static class removeAllCouponsByPromotionId_result implements org.apache.thrift.TBase<removeAllCouponsByPromotionId_result, removeAllCouponsByPromotionId_result._Fields>, java.io.Serializable, Cloneable   {
3356
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("removeAllCouponsByPromotionId_result");
3357
 
3358
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0);
3359
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
3360
 
3361
    private long success; // required
3362
    private PromotionException pex; // required
3363
 
3364
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3365
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3366
      SUCCESS((short)0, "success"),
3367
      PEX((short)1, "pex");
3368
 
3369
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3370
 
3371
      static {
3372
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3373
          byName.put(field.getFieldName(), field);
3374
        }
3375
      }
3376
 
3377
      /**
3378
       * Find the _Fields constant that matches fieldId, or null if its not found.
3379
       */
3380
      public static _Fields findByThriftId(int fieldId) {
3381
        switch(fieldId) {
3382
          case 0: // SUCCESS
3383
            return SUCCESS;
3384
          case 1: // PEX
3385
            return PEX;
3386
          default:
3387
            return null;
3388
        }
3389
      }
3390
 
3391
      /**
3392
       * Find the _Fields constant that matches fieldId, throwing an exception
3393
       * if it is not found.
3394
       */
3395
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3396
        _Fields fields = findByThriftId(fieldId);
3397
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3398
        return fields;
3399
      }
3400
 
3401
      /**
3402
       * Find the _Fields constant that matches name, or null if its not found.
3403
       */
3404
      public static _Fields findByName(String name) {
3405
        return byName.get(name);
3406
      }
3407
 
3408
      private final short _thriftId;
3409
      private final String _fieldName;
3410
 
3411
      _Fields(short thriftId, String fieldName) {
3412
        _thriftId = thriftId;
3413
        _fieldName = fieldName;
3414
      }
3415
 
3416
      public short getThriftFieldId() {
3417
        return _thriftId;
3418
      }
3419
 
3420
      public String getFieldName() {
3421
        return _fieldName;
3422
      }
3423
    }
3424
 
3425
    // isset id assignments
3426
    private static final int __SUCCESS_ISSET_ID = 0;
3427
    private BitSet __isset_bit_vector = new BitSet(1);
3428
 
3429
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3430
    static {
3431
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3432
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3433
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
3434
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3435
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
3436
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3437
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(removeAllCouponsByPromotionId_result.class, metaDataMap);
3438
    }
3439
 
3440
    public removeAllCouponsByPromotionId_result() {
3441
    }
3442
 
3443
    public removeAllCouponsByPromotionId_result(
3444
      long success,
3445
      PromotionException pex)
3446
    {
3447
      this();
3448
      this.success = success;
3449
      setSuccessIsSet(true);
3450
      this.pex = pex;
3451
    }
3452
 
3453
    /**
3454
     * Performs a deep copy on <i>other</i>.
3455
     */
3456
    public removeAllCouponsByPromotionId_result(removeAllCouponsByPromotionId_result other) {
3457
      __isset_bit_vector.clear();
3458
      __isset_bit_vector.or(other.__isset_bit_vector);
3459
      this.success = other.success;
3460
      if (other.isSetPex()) {
3461
        this.pex = new PromotionException(other.pex);
3462
      }
3463
    }
3464
 
3465
    public removeAllCouponsByPromotionId_result deepCopy() {
3466
      return new removeAllCouponsByPromotionId_result(this);
3467
    }
3468
 
3469
    @Override
3470
    public void clear() {
3471
      setSuccessIsSet(false);
3472
      this.success = 0;
3473
      this.pex = null;
3474
    }
3475
 
3476
    public long getSuccess() {
3477
      return this.success;
3478
    }
3479
 
3480
    public void setSuccess(long success) {
3481
      this.success = success;
3482
      setSuccessIsSet(true);
3483
    }
3484
 
3485
    public void unsetSuccess() {
3486
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
3487
    }
3488
 
3489
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3490
    public boolean isSetSuccess() {
3491
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
3492
    }
3493
 
3494
    public void setSuccessIsSet(boolean value) {
3495
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
3496
    }
3497
 
3498
    public PromotionException getPex() {
3499
      return this.pex;
3500
    }
3501
 
3502
    public void setPex(PromotionException pex) {
3503
      this.pex = pex;
3504
    }
3505
 
3506
    public void unsetPex() {
3507
      this.pex = null;
3508
    }
3509
 
3510
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3511
    public boolean isSetPex() {
3512
      return this.pex != null;
3513
    }
3514
 
3515
    public void setPexIsSet(boolean value) {
3516
      if (!value) {
3517
        this.pex = null;
3518
      }
3519
    }
3520
 
3521
    public void setFieldValue(_Fields field, Object value) {
3522
      switch (field) {
3523
      case SUCCESS:
3524
        if (value == null) {
3525
          unsetSuccess();
3526
        } else {
3527
          setSuccess((Long)value);
3528
        }
3529
        break;
3530
 
3531
      case PEX:
3532
        if (value == null) {
3533
          unsetPex();
3534
        } else {
3535
          setPex((PromotionException)value);
3536
        }
3537
        break;
3538
 
3539
      }
3540
    }
3541
 
3542
    public Object getFieldValue(_Fields field) {
3543
      switch (field) {
3544
      case SUCCESS:
3545
        return Long.valueOf(getSuccess());
3546
 
3547
      case PEX:
3548
        return getPex();
3549
 
3550
      }
3551
      throw new IllegalStateException();
3552
    }
3553
 
3554
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3555
    public boolean isSet(_Fields field) {
3556
      if (field == null) {
3557
        throw new IllegalArgumentException();
3558
      }
3559
 
3560
      switch (field) {
3561
      case SUCCESS:
3562
        return isSetSuccess();
3563
      case PEX:
3564
        return isSetPex();
3565
      }
3566
      throw new IllegalStateException();
3567
    }
3568
 
3569
    @Override
3570
    public boolean equals(Object that) {
3571
      if (that == null)
3572
        return false;
3573
      if (that instanceof removeAllCouponsByPromotionId_result)
3574
        return this.equals((removeAllCouponsByPromotionId_result)that);
3575
      return false;
3576
    }
3577
 
3578
    public boolean equals(removeAllCouponsByPromotionId_result that) {
3579
      if (that == null)
3580
        return false;
3581
 
3582
      boolean this_present_success = true;
3583
      boolean that_present_success = true;
3584
      if (this_present_success || that_present_success) {
3585
        if (!(this_present_success && that_present_success))
3586
          return false;
3587
        if (this.success != that.success)
3588
          return false;
3589
      }
3590
 
3591
      boolean this_present_pex = true && this.isSetPex();
3592
      boolean that_present_pex = true && that.isSetPex();
3593
      if (this_present_pex || that_present_pex) {
3594
        if (!(this_present_pex && that_present_pex))
3595
          return false;
3596
        if (!this.pex.equals(that.pex))
3597
          return false;
3598
      }
3599
 
3600
      return true;
3601
    }
3602
 
3603
    @Override
3604
    public int hashCode() {
3605
      return 0;
3606
    }
3607
 
3608
    public int compareTo(removeAllCouponsByPromotionId_result other) {
3609
      if (!getClass().equals(other.getClass())) {
3610
        return getClass().getName().compareTo(other.getClass().getName());
3611
      }
3612
 
3613
      int lastComparison = 0;
3614
      removeAllCouponsByPromotionId_result typedOther = (removeAllCouponsByPromotionId_result)other;
3615
 
3616
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3617
      if (lastComparison != 0) {
3618
        return lastComparison;
3619
      }
3620
      if (isSetSuccess()) {
3621
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
3622
        if (lastComparison != 0) {
3623
          return lastComparison;
3624
        }
3625
      }
3626
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3627
      if (lastComparison != 0) {
3628
        return lastComparison;
3629
      }
3630
      if (isSetPex()) {
3631
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
3632
        if (lastComparison != 0) {
3633
          return lastComparison;
3634
        }
3635
      }
3636
      return 0;
3637
    }
3638
 
3639
    public _Fields fieldForId(int fieldId) {
3640
      return _Fields.findByThriftId(fieldId);
3641
    }
3642
 
3643
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3644
      org.apache.thrift.protocol.TField field;
3645
      iprot.readStructBegin();
3646
      while (true)
3647
      {
3648
        field = iprot.readFieldBegin();
3649
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3650
          break;
3651
        }
3652
        switch (field.id) {
3653
          case 0: // SUCCESS
3654
            if (field.type == org.apache.thrift.protocol.TType.I64) {
3655
              this.success = iprot.readI64();
3656
              setSuccessIsSet(true);
3657
            } else { 
3658
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3659
            }
3660
            break;
3661
          case 1: // PEX
3662
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3663
              this.pex = new PromotionException();
3664
              this.pex.read(iprot);
3665
            } else { 
3666
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3667
            }
3668
            break;
3669
          default:
3670
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3671
        }
3672
        iprot.readFieldEnd();
3673
      }
3674
      iprot.readStructEnd();
3675
      validate();
3676
    }
3677
 
3678
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3679
      oprot.writeStructBegin(STRUCT_DESC);
3680
 
3681
      if (this.isSetSuccess()) {
3682
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
3683
        oprot.writeI64(this.success);
3684
        oprot.writeFieldEnd();
3685
      } else if (this.isSetPex()) {
3686
        oprot.writeFieldBegin(PEX_FIELD_DESC);
3687
        this.pex.write(oprot);
3688
        oprot.writeFieldEnd();
3689
      }
3690
      oprot.writeFieldStop();
3691
      oprot.writeStructEnd();
3692
    }
3693
 
3694
    @Override
3695
    public String toString() {
3696
      StringBuilder sb = new StringBuilder("removeAllCouponsByPromotionId_result(");
3697
      boolean first = true;
3698
 
3699
      sb.append("success:");
3700
      sb.append(this.success);
3701
      first = false;
3702
      if (!first) sb.append(", ");
3703
      sb.append("pex:");
3704
      if (this.pex == null) {
3705
        sb.append("null");
3706
      } else {
3707
        sb.append(this.pex);
3708
      }
3709
      first = false;
3710
      sb.append(")");
3711
      return sb.toString();
3712
    }
3713
 
3714
    public void validate() throws org.apache.thrift.TException {
3715
      // check for required fields
3716
    }
3717
 
3718
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3719
      try {
3720
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3721
      } catch (org.apache.thrift.TException te) {
3722
        throw new java.io.IOException(te);
3723
      }
3724
    }
3725
 
3726
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3727
      try {
3728
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3729
      } catch (org.apache.thrift.TException te) {
3730
        throw new java.io.IOException(te);
3731
      }
3732
    }
3733
 
3734
  }
3735
 
6301 amit.gupta 3736
  public static class getCoupon_args implements org.apache.thrift.TBase<getCoupon_args, getCoupon_args._Fields>, java.io.Serializable, Cloneable   {
3737
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCoupon_args");
3738
 
3739
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)1);
3740
 
3741
    private String couponCode; // required
3742
 
3743
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3744
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3745
      COUPON_CODE((short)1, "couponCode");
3746
 
3747
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3748
 
3749
      static {
3750
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3751
          byName.put(field.getFieldName(), field);
3752
        }
3753
      }
3754
 
3755
      /**
3756
       * Find the _Fields constant that matches fieldId, or null if its not found.
3757
       */
3758
      public static _Fields findByThriftId(int fieldId) {
3759
        switch(fieldId) {
3760
          case 1: // COUPON_CODE
3761
            return COUPON_CODE;
3762
          default:
3763
            return null;
3764
        }
3765
      }
3766
 
3767
      /**
3768
       * Find the _Fields constant that matches fieldId, throwing an exception
3769
       * if it is not found.
3770
       */
3771
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3772
        _Fields fields = findByThriftId(fieldId);
3773
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3774
        return fields;
3775
      }
3776
 
3777
      /**
3778
       * Find the _Fields constant that matches name, or null if its not found.
3779
       */
3780
      public static _Fields findByName(String name) {
3781
        return byName.get(name);
3782
      }
3783
 
3784
      private final short _thriftId;
3785
      private final String _fieldName;
3786
 
3787
      _Fields(short thriftId, String fieldName) {
3788
        _thriftId = thriftId;
3789
        _fieldName = fieldName;
3790
      }
3791
 
3792
      public short getThriftFieldId() {
3793
        return _thriftId;
3794
      }
3795
 
3796
      public String getFieldName() {
3797
        return _fieldName;
3798
      }
3799
    }
3800
 
3801
    // isset id assignments
3802
 
3803
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3804
    static {
3805
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3806
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3807
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
3808
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3809
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCoupon_args.class, metaDataMap);
3810
    }
3811
 
3812
    public getCoupon_args() {
3813
    }
3814
 
3815
    public getCoupon_args(
3816
      String couponCode)
3817
    {
3818
      this();
3819
      this.couponCode = couponCode;
3820
    }
3821
 
3822
    /**
3823
     * Performs a deep copy on <i>other</i>.
3824
     */
3825
    public getCoupon_args(getCoupon_args other) {
3826
      if (other.isSetCouponCode()) {
3827
        this.couponCode = other.couponCode;
3828
      }
3829
    }
3830
 
3831
    public getCoupon_args deepCopy() {
3832
      return new getCoupon_args(this);
3833
    }
3834
 
3835
    @Override
3836
    public void clear() {
3837
      this.couponCode = null;
3838
    }
3839
 
3840
    public String getCouponCode() {
3841
      return this.couponCode;
3842
    }
3843
 
3844
    public void setCouponCode(String couponCode) {
3845
      this.couponCode = couponCode;
3846
    }
3847
 
3848
    public void unsetCouponCode() {
3849
      this.couponCode = null;
3850
    }
3851
 
3852
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3853
    public boolean isSetCouponCode() {
3854
      return this.couponCode != null;
3855
    }
3856
 
3857
    public void setCouponCodeIsSet(boolean value) {
3858
      if (!value) {
3859
        this.couponCode = null;
3860
      }
3861
    }
3862
 
3863
    public void setFieldValue(_Fields field, Object value) {
3864
      switch (field) {
3865
      case COUPON_CODE:
3866
        if (value == null) {
3867
          unsetCouponCode();
3868
        } else {
3869
          setCouponCode((String)value);
3870
        }
3871
        break;
3872
 
3873
      }
3874
    }
3875
 
3876
    public Object getFieldValue(_Fields field) {
3877
      switch (field) {
3878
      case COUPON_CODE:
3879
        return getCouponCode();
3880
 
3881
      }
3882
      throw new IllegalStateException();
3883
    }
3884
 
3885
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3886
    public boolean isSet(_Fields field) {
3887
      if (field == null) {
3888
        throw new IllegalArgumentException();
3889
      }
3890
 
3891
      switch (field) {
3892
      case COUPON_CODE:
3893
        return isSetCouponCode();
3894
      }
3895
      throw new IllegalStateException();
3896
    }
3897
 
3898
    @Override
3899
    public boolean equals(Object that) {
3900
      if (that == null)
3901
        return false;
3902
      if (that instanceof getCoupon_args)
3903
        return this.equals((getCoupon_args)that);
3904
      return false;
3905
    }
3906
 
3907
    public boolean equals(getCoupon_args that) {
3908
      if (that == null)
3909
        return false;
3910
 
3911
      boolean this_present_couponCode = true && this.isSetCouponCode();
3912
      boolean that_present_couponCode = true && that.isSetCouponCode();
3913
      if (this_present_couponCode || that_present_couponCode) {
3914
        if (!(this_present_couponCode && that_present_couponCode))
3915
          return false;
3916
        if (!this.couponCode.equals(that.couponCode))
3917
          return false;
3918
      }
3919
 
3920
      return true;
3921
    }
3922
 
3923
    @Override
3924
    public int hashCode() {
3925
      return 0;
3926
    }
3927
 
3928
    public int compareTo(getCoupon_args other) {
3929
      if (!getClass().equals(other.getClass())) {
3930
        return getClass().getName().compareTo(other.getClass().getName());
3931
      }
3932
 
3933
      int lastComparison = 0;
3934
      getCoupon_args typedOther = (getCoupon_args)other;
3935
 
3936
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3937
      if (lastComparison != 0) {
3938
        return lastComparison;
3939
      }
3940
      if (isSetCouponCode()) {
3941
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
3942
        if (lastComparison != 0) {
3943
          return lastComparison;
3944
        }
3945
      }
3946
      return 0;
3947
    }
3948
 
3949
    public _Fields fieldForId(int fieldId) {
3950
      return _Fields.findByThriftId(fieldId);
3951
    }
3952
 
3953
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3954
      org.apache.thrift.protocol.TField field;
3955
      iprot.readStructBegin();
3956
      while (true)
3957
      {
3958
        field = iprot.readFieldBegin();
3959
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3960
          break;
3961
        }
3962
        switch (field.id) {
3963
          case 1: // COUPON_CODE
3964
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
3965
              this.couponCode = iprot.readString();
3966
            } else { 
3967
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3968
            }
3969
            break;
3970
          default:
3971
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3972
        }
3973
        iprot.readFieldEnd();
3974
      }
3975
      iprot.readStructEnd();
3976
      validate();
3977
    }
3978
 
3979
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3980
      validate();
3981
 
3982
      oprot.writeStructBegin(STRUCT_DESC);
3983
      if (this.couponCode != null) {
3984
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
3985
        oprot.writeString(this.couponCode);
3986
        oprot.writeFieldEnd();
3987
      }
3988
      oprot.writeFieldStop();
3989
      oprot.writeStructEnd();
3990
    }
3991
 
3992
    @Override
3993
    public String toString() {
3994
      StringBuilder sb = new StringBuilder("getCoupon_args(");
3995
      boolean first = true;
3996
 
3997
      sb.append("couponCode:");
3998
      if (this.couponCode == null) {
3999
        sb.append("null");
4000
      } else {
4001
        sb.append(this.couponCode);
4002
      }
4003
      first = false;
4004
      sb.append(")");
4005
      return sb.toString();
4006
    }
4007
 
4008
    public void validate() throws org.apache.thrift.TException {
4009
      // check for required fields
4010
    }
4011
 
4012
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4013
      try {
4014
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4015
      } catch (org.apache.thrift.TException te) {
4016
        throw new java.io.IOException(te);
4017
      }
4018
    }
4019
 
4020
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4021
      try {
4022
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4023
      } catch (org.apache.thrift.TException te) {
4024
        throw new java.io.IOException(te);
4025
      }
4026
    }
4027
 
4028
  }
4029
 
4030
  public static class getCoupon_result implements org.apache.thrift.TBase<getCoupon_result, getCoupon_result._Fields>, java.io.Serializable, Cloneable   {
4031
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCoupon_result");
4032
 
4033
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
4034
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
4035
 
4036
    private Coupon success; // required
4037
    private PromotionException pex; // required
4038
 
4039
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4040
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4041
      SUCCESS((short)0, "success"),
4042
      PEX((short)1, "pex");
4043
 
4044
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4045
 
4046
      static {
4047
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4048
          byName.put(field.getFieldName(), field);
4049
        }
4050
      }
4051
 
4052
      /**
4053
       * Find the _Fields constant that matches fieldId, or null if its not found.
4054
       */
4055
      public static _Fields findByThriftId(int fieldId) {
4056
        switch(fieldId) {
4057
          case 0: // SUCCESS
4058
            return SUCCESS;
4059
          case 1: // PEX
4060
            return PEX;
4061
          default:
4062
            return null;
4063
        }
4064
      }
4065
 
4066
      /**
4067
       * Find the _Fields constant that matches fieldId, throwing an exception
4068
       * if it is not found.
4069
       */
4070
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4071
        _Fields fields = findByThriftId(fieldId);
4072
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4073
        return fields;
4074
      }
4075
 
4076
      /**
4077
       * Find the _Fields constant that matches name, or null if its not found.
4078
       */
4079
      public static _Fields findByName(String name) {
4080
        return byName.get(name);
4081
      }
4082
 
4083
      private final short _thriftId;
4084
      private final String _fieldName;
4085
 
4086
      _Fields(short thriftId, String fieldName) {
4087
        _thriftId = thriftId;
4088
        _fieldName = fieldName;
4089
      }
4090
 
4091
      public short getThriftFieldId() {
4092
        return _thriftId;
4093
      }
4094
 
4095
      public String getFieldName() {
4096
        return _fieldName;
4097
      }
4098
    }
4099
 
4100
    // isset id assignments
4101
 
4102
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4103
    static {
4104
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4105
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4106
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class)));
4107
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4108
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4109
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4110
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCoupon_result.class, metaDataMap);
4111
    }
4112
 
4113
    public getCoupon_result() {
4114
    }
4115
 
4116
    public getCoupon_result(
4117
      Coupon success,
4118
      PromotionException pex)
4119
    {
4120
      this();
4121
      this.success = success;
4122
      this.pex = pex;
4123
    }
4124
 
4125
    /**
4126
     * Performs a deep copy on <i>other</i>.
4127
     */
4128
    public getCoupon_result(getCoupon_result other) {
4129
      if (other.isSetSuccess()) {
4130
        this.success = new Coupon(other.success);
4131
      }
4132
      if (other.isSetPex()) {
4133
        this.pex = new PromotionException(other.pex);
4134
      }
4135
    }
4136
 
4137
    public getCoupon_result deepCopy() {
4138
      return new getCoupon_result(this);
4139
    }
4140
 
4141
    @Override
4142
    public void clear() {
4143
      this.success = null;
4144
      this.pex = null;
4145
    }
4146
 
4147
    public Coupon getSuccess() {
4148
      return this.success;
4149
    }
4150
 
4151
    public void setSuccess(Coupon success) {
4152
      this.success = success;
4153
    }
4154
 
4155
    public void unsetSuccess() {
4156
      this.success = null;
4157
    }
4158
 
4159
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
4160
    public boolean isSetSuccess() {
4161
      return this.success != null;
4162
    }
4163
 
4164
    public void setSuccessIsSet(boolean value) {
4165
      if (!value) {
4166
        this.success = null;
4167
      }
4168
    }
4169
 
4170
    public PromotionException getPex() {
4171
      return this.pex;
4172
    }
4173
 
4174
    public void setPex(PromotionException pex) {
4175
      this.pex = pex;
4176
    }
4177
 
4178
    public void unsetPex() {
4179
      this.pex = null;
4180
    }
4181
 
4182
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
4183
    public boolean isSetPex() {
4184
      return this.pex != null;
4185
    }
4186
 
4187
    public void setPexIsSet(boolean value) {
4188
      if (!value) {
4189
        this.pex = null;
4190
      }
4191
    }
4192
 
4193
    public void setFieldValue(_Fields field, Object value) {
4194
      switch (field) {
4195
      case SUCCESS:
4196
        if (value == null) {
4197
          unsetSuccess();
4198
        } else {
4199
          setSuccess((Coupon)value);
4200
        }
4201
        break;
4202
 
4203
      case PEX:
4204
        if (value == null) {
4205
          unsetPex();
4206
        } else {
4207
          setPex((PromotionException)value);
4208
        }
4209
        break;
4210
 
4211
      }
4212
    }
4213
 
4214
    public Object getFieldValue(_Fields field) {
4215
      switch (field) {
4216
      case SUCCESS:
4217
        return getSuccess();
4218
 
4219
      case PEX:
4220
        return getPex();
4221
 
4222
      }
4223
      throw new IllegalStateException();
4224
    }
4225
 
4226
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4227
    public boolean isSet(_Fields field) {
4228
      if (field == null) {
4229
        throw new IllegalArgumentException();
4230
      }
4231
 
4232
      switch (field) {
4233
      case SUCCESS:
4234
        return isSetSuccess();
4235
      case PEX:
4236
        return isSetPex();
4237
      }
4238
      throw new IllegalStateException();
4239
    }
4240
 
4241
    @Override
4242
    public boolean equals(Object that) {
4243
      if (that == null)
4244
        return false;
4245
      if (that instanceof getCoupon_result)
4246
        return this.equals((getCoupon_result)that);
4247
      return false;
4248
    }
4249
 
4250
    public boolean equals(getCoupon_result that) {
4251
      if (that == null)
4252
        return false;
4253
 
4254
      boolean this_present_success = true && this.isSetSuccess();
4255
      boolean that_present_success = true && that.isSetSuccess();
4256
      if (this_present_success || that_present_success) {
4257
        if (!(this_present_success && that_present_success))
4258
          return false;
4259
        if (!this.success.equals(that.success))
4260
          return false;
4261
      }
4262
 
4263
      boolean this_present_pex = true && this.isSetPex();
4264
      boolean that_present_pex = true && that.isSetPex();
4265
      if (this_present_pex || that_present_pex) {
4266
        if (!(this_present_pex && that_present_pex))
4267
          return false;
4268
        if (!this.pex.equals(that.pex))
4269
          return false;
4270
      }
4271
 
4272
      return true;
4273
    }
4274
 
4275
    @Override
4276
    public int hashCode() {
4277
      return 0;
4278
    }
4279
 
4280
    public int compareTo(getCoupon_result other) {
4281
      if (!getClass().equals(other.getClass())) {
4282
        return getClass().getName().compareTo(other.getClass().getName());
4283
      }
4284
 
4285
      int lastComparison = 0;
4286
      getCoupon_result typedOther = (getCoupon_result)other;
4287
 
4288
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
4289
      if (lastComparison != 0) {
4290
        return lastComparison;
4291
      }
4292
      if (isSetSuccess()) {
4293
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4294
        if (lastComparison != 0) {
4295
          return lastComparison;
4296
        }
4297
      }
4298
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
4299
      if (lastComparison != 0) {
4300
        return lastComparison;
4301
      }
4302
      if (isSetPex()) {
4303
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
4304
        if (lastComparison != 0) {
4305
          return lastComparison;
4306
        }
4307
      }
4308
      return 0;
4309
    }
4310
 
4311
    public _Fields fieldForId(int fieldId) {
4312
      return _Fields.findByThriftId(fieldId);
4313
    }
4314
 
4315
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4316
      org.apache.thrift.protocol.TField field;
4317
      iprot.readStructBegin();
4318
      while (true)
4319
      {
4320
        field = iprot.readFieldBegin();
4321
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4322
          break;
4323
        }
4324
        switch (field.id) {
4325
          case 0: // SUCCESS
4326
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4327
              this.success = new Coupon();
4328
              this.success.read(iprot);
4329
            } else { 
4330
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4331
            }
4332
            break;
4333
          case 1: // PEX
4334
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4335
              this.pex = new PromotionException();
4336
              this.pex.read(iprot);
4337
            } else { 
4338
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4339
            }
4340
            break;
4341
          default:
4342
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4343
        }
4344
        iprot.readFieldEnd();
4345
      }
4346
      iprot.readStructEnd();
4347
      validate();
4348
    }
4349
 
4350
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4351
      oprot.writeStructBegin(STRUCT_DESC);
4352
 
4353
      if (this.isSetSuccess()) {
4354
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4355
        this.success.write(oprot);
4356
        oprot.writeFieldEnd();
4357
      } else if (this.isSetPex()) {
4358
        oprot.writeFieldBegin(PEX_FIELD_DESC);
4359
        this.pex.write(oprot);
4360
        oprot.writeFieldEnd();
4361
      }
4362
      oprot.writeFieldStop();
4363
      oprot.writeStructEnd();
4364
    }
4365
 
4366
    @Override
4367
    public String toString() {
4368
      StringBuilder sb = new StringBuilder("getCoupon_result(");
4369
      boolean first = true;
4370
 
4371
      sb.append("success:");
4372
      if (this.success == null) {
4373
        sb.append("null");
4374
      } else {
4375
        sb.append(this.success);
4376
      }
4377
      first = false;
4378
      if (!first) sb.append(", ");
4379
      sb.append("pex:");
4380
      if (this.pex == null) {
4381
        sb.append("null");
4382
      } else {
4383
        sb.append(this.pex);
4384
      }
4385
      first = false;
4386
      sb.append(")");
4387
      return sb.toString();
4388
    }
4389
 
4390
    public void validate() throws org.apache.thrift.TException {
4391
      // check for required fields
4392
    }
4393
 
4394
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4395
      try {
4396
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4397
      } catch (org.apache.thrift.TException te) {
4398
        throw new java.io.IOException(te);
4399
      }
4400
    }
4401
 
4402
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4403
      try {
4404
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4405
      } catch (org.apache.thrift.TException te) {
4406
        throw new java.io.IOException(te);
4407
      }
4408
    }
4409
 
4410
  }
4411
 
4412
  public static class isGiftVoucher_args implements org.apache.thrift.TBase<isGiftVoucher_args, isGiftVoucher_args._Fields>, java.io.Serializable, Cloneable   {
4413
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isGiftVoucher_args");
4414
 
4415
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)1);
4416
 
4417
    private String couponCode; // required
4418
 
4419
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4420
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4421
      COUPON_CODE((short)1, "couponCode");
4422
 
4423
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4424
 
4425
      static {
4426
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4427
          byName.put(field.getFieldName(), field);
4428
        }
4429
      }
4430
 
4431
      /**
4432
       * Find the _Fields constant that matches fieldId, or null if its not found.
4433
       */
4434
      public static _Fields findByThriftId(int fieldId) {
4435
        switch(fieldId) {
4436
          case 1: // COUPON_CODE
4437
            return COUPON_CODE;
4438
          default:
4439
            return null;
4440
        }
4441
      }
4442
 
4443
      /**
4444
       * Find the _Fields constant that matches fieldId, throwing an exception
4445
       * if it is not found.
4446
       */
4447
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4448
        _Fields fields = findByThriftId(fieldId);
4449
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4450
        return fields;
4451
      }
4452
 
4453
      /**
4454
       * Find the _Fields constant that matches name, or null if its not found.
4455
       */
4456
      public static _Fields findByName(String name) {
4457
        return byName.get(name);
4458
      }
4459
 
4460
      private final short _thriftId;
4461
      private final String _fieldName;
4462
 
4463
      _Fields(short thriftId, String fieldName) {
4464
        _thriftId = thriftId;
4465
        _fieldName = fieldName;
4466
      }
4467
 
4468
      public short getThriftFieldId() {
4469
        return _thriftId;
4470
      }
4471
 
4472
      public String getFieldName() {
4473
        return _fieldName;
4474
      }
4475
    }
4476
 
4477
    // isset id assignments
4478
 
4479
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4480
    static {
4481
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4482
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4483
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
4484
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4485
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isGiftVoucher_args.class, metaDataMap);
4486
    }
4487
 
4488
    public isGiftVoucher_args() {
4489
    }
4490
 
4491
    public isGiftVoucher_args(
4492
      String couponCode)
4493
    {
4494
      this();
4495
      this.couponCode = couponCode;
4496
    }
4497
 
4498
    /**
4499
     * Performs a deep copy on <i>other</i>.
4500
     */
4501
    public isGiftVoucher_args(isGiftVoucher_args other) {
4502
      if (other.isSetCouponCode()) {
4503
        this.couponCode = other.couponCode;
4504
      }
4505
    }
4506
 
4507
    public isGiftVoucher_args deepCopy() {
4508
      return new isGiftVoucher_args(this);
4509
    }
4510
 
4511
    @Override
4512
    public void clear() {
4513
      this.couponCode = null;
4514
    }
4515
 
4516
    public String getCouponCode() {
4517
      return this.couponCode;
4518
    }
4519
 
4520
    public void setCouponCode(String couponCode) {
4521
      this.couponCode = couponCode;
4522
    }
4523
 
4524
    public void unsetCouponCode() {
4525
      this.couponCode = null;
4526
    }
4527
 
4528
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
4529
    public boolean isSetCouponCode() {
4530
      return this.couponCode != null;
4531
    }
4532
 
4533
    public void setCouponCodeIsSet(boolean value) {
4534
      if (!value) {
4535
        this.couponCode = null;
4536
      }
4537
    }
4538
 
4539
    public void setFieldValue(_Fields field, Object value) {
4540
      switch (field) {
4541
      case COUPON_CODE:
4542
        if (value == null) {
4543
          unsetCouponCode();
4544
        } else {
4545
          setCouponCode((String)value);
4546
        }
4547
        break;
4548
 
4549
      }
4550
    }
4551
 
4552
    public Object getFieldValue(_Fields field) {
4553
      switch (field) {
4554
      case COUPON_CODE:
4555
        return getCouponCode();
4556
 
4557
      }
4558
      throw new IllegalStateException();
4559
    }
4560
 
4561
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4562
    public boolean isSet(_Fields field) {
4563
      if (field == null) {
4564
        throw new IllegalArgumentException();
4565
      }
4566
 
4567
      switch (field) {
4568
      case COUPON_CODE:
4569
        return isSetCouponCode();
4570
      }
4571
      throw new IllegalStateException();
4572
    }
4573
 
4574
    @Override
4575
    public boolean equals(Object that) {
4576
      if (that == null)
4577
        return false;
4578
      if (that instanceof isGiftVoucher_args)
4579
        return this.equals((isGiftVoucher_args)that);
4580
      return false;
4581
    }
4582
 
4583
    public boolean equals(isGiftVoucher_args that) {
4584
      if (that == null)
4585
        return false;
4586
 
4587
      boolean this_present_couponCode = true && this.isSetCouponCode();
4588
      boolean that_present_couponCode = true && that.isSetCouponCode();
4589
      if (this_present_couponCode || that_present_couponCode) {
4590
        if (!(this_present_couponCode && that_present_couponCode))
4591
          return false;
4592
        if (!this.couponCode.equals(that.couponCode))
4593
          return false;
4594
      }
4595
 
4596
      return true;
4597
    }
4598
 
4599
    @Override
4600
    public int hashCode() {
4601
      return 0;
4602
    }
4603
 
4604
    public int compareTo(isGiftVoucher_args other) {
4605
      if (!getClass().equals(other.getClass())) {
4606
        return getClass().getName().compareTo(other.getClass().getName());
4607
      }
4608
 
4609
      int lastComparison = 0;
4610
      isGiftVoucher_args typedOther = (isGiftVoucher_args)other;
4611
 
4612
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
4613
      if (lastComparison != 0) {
4614
        return lastComparison;
4615
      }
4616
      if (isSetCouponCode()) {
4617
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
4618
        if (lastComparison != 0) {
4619
          return lastComparison;
4620
        }
4621
      }
4622
      return 0;
4623
    }
4624
 
4625
    public _Fields fieldForId(int fieldId) {
4626
      return _Fields.findByThriftId(fieldId);
4627
    }
4628
 
4629
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4630
      org.apache.thrift.protocol.TField field;
4631
      iprot.readStructBegin();
4632
      while (true)
4633
      {
4634
        field = iprot.readFieldBegin();
4635
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4636
          break;
4637
        }
4638
        switch (field.id) {
4639
          case 1: // COUPON_CODE
4640
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
4641
              this.couponCode = iprot.readString();
4642
            } else { 
4643
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4644
            }
4645
            break;
4646
          default:
4647
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4648
        }
4649
        iprot.readFieldEnd();
4650
      }
4651
      iprot.readStructEnd();
4652
      validate();
4653
    }
4654
 
4655
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4656
      validate();
4657
 
4658
      oprot.writeStructBegin(STRUCT_DESC);
4659
      if (this.couponCode != null) {
4660
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
4661
        oprot.writeString(this.couponCode);
4662
        oprot.writeFieldEnd();
4663
      }
4664
      oprot.writeFieldStop();
4665
      oprot.writeStructEnd();
4666
    }
4667
 
4668
    @Override
4669
    public String toString() {
4670
      StringBuilder sb = new StringBuilder("isGiftVoucher_args(");
4671
      boolean first = true;
4672
 
4673
      sb.append("couponCode:");
4674
      if (this.couponCode == null) {
4675
        sb.append("null");
4676
      } else {
4677
        sb.append(this.couponCode);
4678
      }
4679
      first = false;
4680
      sb.append(")");
4681
      return sb.toString();
4682
    }
4683
 
4684
    public void validate() throws org.apache.thrift.TException {
4685
      // check for required fields
4686
    }
4687
 
4688
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4689
      try {
4690
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4691
      } catch (org.apache.thrift.TException te) {
4692
        throw new java.io.IOException(te);
4693
      }
4694
    }
4695
 
4696
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4697
      try {
4698
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4699
      } catch (org.apache.thrift.TException te) {
4700
        throw new java.io.IOException(te);
4701
      }
4702
    }
4703
 
4704
  }
4705
 
4706
  public static class isGiftVoucher_result implements org.apache.thrift.TBase<isGiftVoucher_result, isGiftVoucher_result._Fields>, java.io.Serializable, Cloneable   {
4707
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isGiftVoucher_result");
4708
 
4709
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
4710
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
4711
 
4712
    private boolean success; // required
4713
    private PromotionException pex; // required
4714
 
4715
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4716
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4717
      SUCCESS((short)0, "success"),
4718
      PEX((short)1, "pex");
4719
 
4720
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4721
 
4722
      static {
4723
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4724
          byName.put(field.getFieldName(), field);
4725
        }
4726
      }
4727
 
4728
      /**
4729
       * Find the _Fields constant that matches fieldId, or null if its not found.
4730
       */
4731
      public static _Fields findByThriftId(int fieldId) {
4732
        switch(fieldId) {
4733
          case 0: // SUCCESS
4734
            return SUCCESS;
4735
          case 1: // PEX
4736
            return PEX;
4737
          default:
4738
            return null;
4739
        }
4740
      }
4741
 
4742
      /**
4743
       * Find the _Fields constant that matches fieldId, throwing an exception
4744
       * if it is not found.
4745
       */
4746
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4747
        _Fields fields = findByThriftId(fieldId);
4748
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4749
        return fields;
4750
      }
4751
 
4752
      /**
4753
       * Find the _Fields constant that matches name, or null if its not found.
4754
       */
4755
      public static _Fields findByName(String name) {
4756
        return byName.get(name);
4757
      }
4758
 
4759
      private final short _thriftId;
4760
      private final String _fieldName;
4761
 
4762
      _Fields(short thriftId, String fieldName) {
4763
        _thriftId = thriftId;
4764
        _fieldName = fieldName;
4765
      }
4766
 
4767
      public short getThriftFieldId() {
4768
        return _thriftId;
4769
      }
4770
 
4771
      public String getFieldName() {
4772
        return _fieldName;
4773
      }
4774
    }
4775
 
4776
    // isset id assignments
4777
    private static final int __SUCCESS_ISSET_ID = 0;
4778
    private BitSet __isset_bit_vector = new BitSet(1);
4779
 
4780
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4781
    static {
4782
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4783
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4784
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
4785
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4786
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4787
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4788
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isGiftVoucher_result.class, metaDataMap);
4789
    }
4790
 
4791
    public isGiftVoucher_result() {
4792
    }
4793
 
4794
    public isGiftVoucher_result(
4795
      boolean success,
4796
      PromotionException pex)
4797
    {
4798
      this();
4799
      this.success = success;
4800
      setSuccessIsSet(true);
4801
      this.pex = pex;
4802
    }
4803
 
4804
    /**
4805
     * Performs a deep copy on <i>other</i>.
4806
     */
4807
    public isGiftVoucher_result(isGiftVoucher_result other) {
4808
      __isset_bit_vector.clear();
4809
      __isset_bit_vector.or(other.__isset_bit_vector);
4810
      this.success = other.success;
4811
      if (other.isSetPex()) {
4812
        this.pex = new PromotionException(other.pex);
4813
      }
4814
    }
4815
 
4816
    public isGiftVoucher_result deepCopy() {
4817
      return new isGiftVoucher_result(this);
4818
    }
4819
 
4820
    @Override
4821
    public void clear() {
4822
      setSuccessIsSet(false);
4823
      this.success = false;
4824
      this.pex = null;
4825
    }
4826
 
4827
    public boolean isSuccess() {
4828
      return this.success;
4829
    }
4830
 
4831
    public void setSuccess(boolean success) {
4832
      this.success = success;
4833
      setSuccessIsSet(true);
4834
    }
4835
 
4836
    public void unsetSuccess() {
4837
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
4838
    }
4839
 
4840
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
4841
    public boolean isSetSuccess() {
4842
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
4843
    }
4844
 
4845
    public void setSuccessIsSet(boolean value) {
4846
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
4847
    }
4848
 
4849
    public PromotionException getPex() {
4850
      return this.pex;
4851
    }
4852
 
4853
    public void setPex(PromotionException pex) {
4854
      this.pex = pex;
4855
    }
4856
 
4857
    public void unsetPex() {
4858
      this.pex = null;
4859
    }
4860
 
4861
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
4862
    public boolean isSetPex() {
4863
      return this.pex != null;
4864
    }
4865
 
4866
    public void setPexIsSet(boolean value) {
4867
      if (!value) {
4868
        this.pex = null;
4869
      }
4870
    }
4871
 
4872
    public void setFieldValue(_Fields field, Object value) {
4873
      switch (field) {
4874
      case SUCCESS:
4875
        if (value == null) {
4876
          unsetSuccess();
4877
        } else {
4878
          setSuccess((Boolean)value);
4879
        }
4880
        break;
4881
 
4882
      case PEX:
4883
        if (value == null) {
4884
          unsetPex();
4885
        } else {
4886
          setPex((PromotionException)value);
4887
        }
4888
        break;
4889
 
4890
      }
4891
    }
4892
 
4893
    public Object getFieldValue(_Fields field) {
4894
      switch (field) {
4895
      case SUCCESS:
4896
        return Boolean.valueOf(isSuccess());
4897
 
4898
      case PEX:
4899
        return getPex();
4900
 
4901
      }
4902
      throw new IllegalStateException();
4903
    }
4904
 
4905
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4906
    public boolean isSet(_Fields field) {
4907
      if (field == null) {
4908
        throw new IllegalArgumentException();
4909
      }
4910
 
4911
      switch (field) {
4912
      case SUCCESS:
4913
        return isSetSuccess();
4914
      case PEX:
4915
        return isSetPex();
4916
      }
4917
      throw new IllegalStateException();
4918
    }
4919
 
4920
    @Override
4921
    public boolean equals(Object that) {
4922
      if (that == null)
4923
        return false;
4924
      if (that instanceof isGiftVoucher_result)
4925
        return this.equals((isGiftVoucher_result)that);
4926
      return false;
4927
    }
4928
 
4929
    public boolean equals(isGiftVoucher_result that) {
4930
      if (that == null)
4931
        return false;
4932
 
4933
      boolean this_present_success = true;
4934
      boolean that_present_success = true;
4935
      if (this_present_success || that_present_success) {
4936
        if (!(this_present_success && that_present_success))
4937
          return false;
4938
        if (this.success != that.success)
4939
          return false;
4940
      }
4941
 
4942
      boolean this_present_pex = true && this.isSetPex();
4943
      boolean that_present_pex = true && that.isSetPex();
4944
      if (this_present_pex || that_present_pex) {
4945
        if (!(this_present_pex && that_present_pex))
4946
          return false;
4947
        if (!this.pex.equals(that.pex))
4948
          return false;
4949
      }
4950
 
4951
      return true;
4952
    }
4953
 
4954
    @Override
4955
    public int hashCode() {
4956
      return 0;
4957
    }
4958
 
4959
    public int compareTo(isGiftVoucher_result other) {
4960
      if (!getClass().equals(other.getClass())) {
4961
        return getClass().getName().compareTo(other.getClass().getName());
4962
      }
4963
 
4964
      int lastComparison = 0;
4965
      isGiftVoucher_result typedOther = (isGiftVoucher_result)other;
4966
 
4967
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
4968
      if (lastComparison != 0) {
4969
        return lastComparison;
4970
      }
4971
      if (isSetSuccess()) {
4972
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4973
        if (lastComparison != 0) {
4974
          return lastComparison;
4975
        }
4976
      }
4977
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
4978
      if (lastComparison != 0) {
4979
        return lastComparison;
4980
      }
4981
      if (isSetPex()) {
4982
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
4983
        if (lastComparison != 0) {
4984
          return lastComparison;
4985
        }
4986
      }
4987
      return 0;
4988
    }
4989
 
4990
    public _Fields fieldForId(int fieldId) {
4991
      return _Fields.findByThriftId(fieldId);
4992
    }
4993
 
4994
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4995
      org.apache.thrift.protocol.TField field;
4996
      iprot.readStructBegin();
4997
      while (true)
4998
      {
4999
        field = iprot.readFieldBegin();
5000
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
5001
          break;
5002
        }
5003
        switch (field.id) {
5004
          case 0: // SUCCESS
5005
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
5006
              this.success = iprot.readBool();
5007
              setSuccessIsSet(true);
5008
            } else { 
5009
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5010
            }
5011
            break;
5012
          case 1: // PEX
5013
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5014
              this.pex = new PromotionException();
5015
              this.pex.read(iprot);
5016
            } else { 
5017
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5018
            }
5019
            break;
5020
          default:
5021
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5022
        }
5023
        iprot.readFieldEnd();
5024
      }
5025
      iprot.readStructEnd();
5026
      validate();
5027
    }
5028
 
5029
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
5030
      oprot.writeStructBegin(STRUCT_DESC);
5031
 
5032
      if (this.isSetSuccess()) {
5033
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
5034
        oprot.writeBool(this.success);
5035
        oprot.writeFieldEnd();
5036
      } else if (this.isSetPex()) {
5037
        oprot.writeFieldBegin(PEX_FIELD_DESC);
5038
        this.pex.write(oprot);
5039
        oprot.writeFieldEnd();
5040
      }
5041
      oprot.writeFieldStop();
5042
      oprot.writeStructEnd();
5043
    }
5044
 
5045
    @Override
5046
    public String toString() {
5047
      StringBuilder sb = new StringBuilder("isGiftVoucher_result(");
5048
      boolean first = true;
5049
 
5050
      sb.append("success:");
5051
      sb.append(this.success);
5052
      first = false;
5053
      if (!first) sb.append(", ");
5054
      sb.append("pex:");
5055
      if (this.pex == null) {
5056
        sb.append("null");
5057
      } else {
5058
        sb.append(this.pex);
5059
      }
5060
      first = false;
5061
      sb.append(")");
5062
      return sb.toString();
5063
    }
5064
 
5065
    public void validate() throws org.apache.thrift.TException {
5066
      // check for required fields
5067
    }
5068
 
5069
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5070
      try {
5071
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5072
      } catch (org.apache.thrift.TException te) {
5073
        throw new java.io.IOException(te);
5074
      }
5075
    }
5076
 
5077
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5078
      try {
5079
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5080
      } catch (org.apache.thrift.TException te) {
5081
        throw new java.io.IOException(te);
5082
      }
5083
    }
5084
 
5085
  }
5086
 
6356 amit.gupta 5087
  public static class isCodApplicable_args implements org.apache.thrift.TBase<isCodApplicable_args, isCodApplicable_args._Fields>, java.io.Serializable, Cloneable   {
5088
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isCodApplicable_args");
5089
 
5090
    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);
5091
 
5092
    private String couponCode; // required
5093
 
5094
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
5095
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
5096
      COUPON_CODE((short)1, "couponCode");
5097
 
5098
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5099
 
5100
      static {
5101
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5102
          byName.put(field.getFieldName(), field);
5103
        }
5104
      }
5105
 
5106
      /**
5107
       * Find the _Fields constant that matches fieldId, or null if its not found.
5108
       */
5109
      public static _Fields findByThriftId(int fieldId) {
5110
        switch(fieldId) {
5111
          case 1: // COUPON_CODE
5112
            return COUPON_CODE;
5113
          default:
5114
            return null;
5115
        }
5116
      }
5117
 
5118
      /**
5119
       * Find the _Fields constant that matches fieldId, throwing an exception
5120
       * if it is not found.
5121
       */
5122
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5123
        _Fields fields = findByThriftId(fieldId);
5124
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5125
        return fields;
5126
      }
5127
 
5128
      /**
5129
       * Find the _Fields constant that matches name, or null if its not found.
5130
       */
5131
      public static _Fields findByName(String name) {
5132
        return byName.get(name);
5133
      }
5134
 
5135
      private final short _thriftId;
5136
      private final String _fieldName;
5137
 
5138
      _Fields(short thriftId, String fieldName) {
5139
        _thriftId = thriftId;
5140
        _fieldName = fieldName;
5141
      }
5142
 
5143
      public short getThriftFieldId() {
5144
        return _thriftId;
5145
      }
5146
 
5147
      public String getFieldName() {
5148
        return _fieldName;
5149
      }
5150
    }
5151
 
5152
    // isset id assignments
5153
 
5154
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
5155
    static {
5156
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5157
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5158
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
5159
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5160
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isCodApplicable_args.class, metaDataMap);
5161
    }
5162
 
5163
    public isCodApplicable_args() {
5164
    }
5165
 
5166
    public isCodApplicable_args(
5167
      String couponCode)
5168
    {
5169
      this();
5170
      this.couponCode = couponCode;
5171
    }
5172
 
5173
    /**
5174
     * Performs a deep copy on <i>other</i>.
5175
     */
5176
    public isCodApplicable_args(isCodApplicable_args other) {
5177
      if (other.isSetCouponCode()) {
5178
        this.couponCode = other.couponCode;
5179
      }
5180
    }
5181
 
5182
    public isCodApplicable_args deepCopy() {
5183
      return new isCodApplicable_args(this);
5184
    }
5185
 
5186
    @Override
5187
    public void clear() {
5188
      this.couponCode = null;
5189
    }
5190
 
5191
    public String getCouponCode() {
5192
      return this.couponCode;
5193
    }
5194
 
5195
    public void setCouponCode(String couponCode) {
5196
      this.couponCode = couponCode;
5197
    }
5198
 
5199
    public void unsetCouponCode() {
5200
      this.couponCode = null;
5201
    }
5202
 
5203
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
5204
    public boolean isSetCouponCode() {
5205
      return this.couponCode != null;
5206
    }
5207
 
5208
    public void setCouponCodeIsSet(boolean value) {
5209
      if (!value) {
5210
        this.couponCode = null;
5211
      }
5212
    }
5213
 
5214
    public void setFieldValue(_Fields field, Object value) {
5215
      switch (field) {
5216
      case COUPON_CODE:
5217
        if (value == null) {
5218
          unsetCouponCode();
5219
        } else {
5220
          setCouponCode((String)value);
5221
        }
5222
        break;
5223
 
5224
      }
5225
    }
5226
 
5227
    public Object getFieldValue(_Fields field) {
5228
      switch (field) {
5229
      case COUPON_CODE:
5230
        return getCouponCode();
5231
 
5232
      }
5233
      throw new IllegalStateException();
5234
    }
5235
 
5236
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5237
    public boolean isSet(_Fields field) {
5238
      if (field == null) {
5239
        throw new IllegalArgumentException();
5240
      }
5241
 
5242
      switch (field) {
5243
      case COUPON_CODE:
5244
        return isSetCouponCode();
5245
      }
5246
      throw new IllegalStateException();
5247
    }
5248
 
5249
    @Override
5250
    public boolean equals(Object that) {
5251
      if (that == null)
5252
        return false;
5253
      if (that instanceof isCodApplicable_args)
5254
        return this.equals((isCodApplicable_args)that);
5255
      return false;
5256
    }
5257
 
5258
    public boolean equals(isCodApplicable_args that) {
5259
      if (that == null)
5260
        return false;
5261
 
5262
      boolean this_present_couponCode = true && this.isSetCouponCode();
5263
      boolean that_present_couponCode = true && that.isSetCouponCode();
5264
      if (this_present_couponCode || that_present_couponCode) {
5265
        if (!(this_present_couponCode && that_present_couponCode))
5266
          return false;
5267
        if (!this.couponCode.equals(that.couponCode))
5268
          return false;
5269
      }
5270
 
5271
      return true;
5272
    }
5273
 
5274
    @Override
5275
    public int hashCode() {
5276
      return 0;
5277
    }
5278
 
5279
    public int compareTo(isCodApplicable_args other) {
5280
      if (!getClass().equals(other.getClass())) {
5281
        return getClass().getName().compareTo(other.getClass().getName());
5282
      }
5283
 
5284
      int lastComparison = 0;
5285
      isCodApplicable_args typedOther = (isCodApplicable_args)other;
5286
 
5287
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
5288
      if (lastComparison != 0) {
5289
        return lastComparison;
5290
      }
5291
      if (isSetCouponCode()) {
5292
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
5293
        if (lastComparison != 0) {
5294
          return lastComparison;
5295
        }
5296
      }
5297
      return 0;
5298
    }
5299
 
5300
    public _Fields fieldForId(int fieldId) {
5301
      return _Fields.findByThriftId(fieldId);
5302
    }
5303
 
5304
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5305
      org.apache.thrift.protocol.TField field;
5306
      iprot.readStructBegin();
5307
      while (true)
5308
      {
5309
        field = iprot.readFieldBegin();
5310
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
5311
          break;
5312
        }
5313
        switch (field.id) {
5314
          case 1: // COUPON_CODE
5315
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
5316
              this.couponCode = iprot.readString();
5317
            } else { 
5318
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5319
            }
5320
            break;
5321
          default:
5322
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5323
        }
5324
        iprot.readFieldEnd();
5325
      }
5326
      iprot.readStructEnd();
5327
      validate();
5328
    }
5329
 
5330
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
5331
      validate();
5332
 
5333
      oprot.writeStructBegin(STRUCT_DESC);
5334
      if (this.couponCode != null) {
5335
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
5336
        oprot.writeString(this.couponCode);
5337
        oprot.writeFieldEnd();
5338
      }
5339
      oprot.writeFieldStop();
5340
      oprot.writeStructEnd();
5341
    }
5342
 
5343
    @Override
5344
    public String toString() {
5345
      StringBuilder sb = new StringBuilder("isCodApplicable_args(");
5346
      boolean first = true;
5347
 
5348
      sb.append("couponCode:");
5349
      if (this.couponCode == null) {
5350
        sb.append("null");
5351
      } else {
5352
        sb.append(this.couponCode);
5353
      }
5354
      first = false;
5355
      sb.append(")");
5356
      return sb.toString();
5357
    }
5358
 
5359
    public void validate() throws org.apache.thrift.TException {
5360
      // check for required fields
5361
    }
5362
 
5363
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5364
      try {
5365
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5366
      } catch (org.apache.thrift.TException te) {
5367
        throw new java.io.IOException(te);
5368
      }
5369
    }
5370
 
5371
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5372
      try {
5373
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5374
      } catch (org.apache.thrift.TException te) {
5375
        throw new java.io.IOException(te);
5376
      }
5377
    }
5378
 
5379
  }
5380
 
5381
  public static class isCodApplicable_result implements org.apache.thrift.TBase<isCodApplicable_result, isCodApplicable_result._Fields>, java.io.Serializable, Cloneable   {
5382
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isCodApplicable_result");
5383
 
5384
    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);
5385
    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);
5386
 
5387
    private boolean success; // required
5388
    private PromotionException pex; // required
5389
 
5390
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
5391
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
5392
      SUCCESS((short)0, "success"),
5393
      PEX((short)1, "pex");
5394
 
5395
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5396
 
5397
      static {
5398
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5399
          byName.put(field.getFieldName(), field);
5400
        }
5401
      }
5402
 
5403
      /**
5404
       * Find the _Fields constant that matches fieldId, or null if its not found.
5405
       */
5406
      public static _Fields findByThriftId(int fieldId) {
5407
        switch(fieldId) {
5408
          case 0: // SUCCESS
5409
            return SUCCESS;
5410
          case 1: // PEX
5411
            return PEX;
5412
          default:
5413
            return null;
5414
        }
5415
      }
5416
 
5417
      /**
5418
       * Find the _Fields constant that matches fieldId, throwing an exception
5419
       * if it is not found.
5420
       */
5421
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5422
        _Fields fields = findByThriftId(fieldId);
5423
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5424
        return fields;
5425
      }
5426
 
5427
      /**
5428
       * Find the _Fields constant that matches name, or null if its not found.
5429
       */
5430
      public static _Fields findByName(String name) {
5431
        return byName.get(name);
5432
      }
5433
 
5434
      private final short _thriftId;
5435
      private final String _fieldName;
5436
 
5437
      _Fields(short thriftId, String fieldName) {
5438
        _thriftId = thriftId;
5439
        _fieldName = fieldName;
5440
      }
5441
 
5442
      public short getThriftFieldId() {
5443
        return _thriftId;
5444
      }
5445
 
5446
      public String getFieldName() {
5447
        return _fieldName;
5448
      }
5449
    }
5450
 
5451
    // isset id assignments
5452
    private static final int __SUCCESS_ISSET_ID = 0;
5453
    private BitSet __isset_bit_vector = new BitSet(1);
5454
 
5455
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
5456
    static {
5457
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5458
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5459
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
5460
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5461
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
5462
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5463
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isCodApplicable_result.class, metaDataMap);
5464
    }
5465
 
5466
    public isCodApplicable_result() {
5467
    }
5468
 
5469
    public isCodApplicable_result(
5470
      boolean success,
5471
      PromotionException pex)
5472
    {
5473
      this();
5474
      this.success = success;
5475
      setSuccessIsSet(true);
5476
      this.pex = pex;
5477
    }
5478
 
5479
    /**
5480
     * Performs a deep copy on <i>other</i>.
5481
     */
5482
    public isCodApplicable_result(isCodApplicable_result other) {
5483
      __isset_bit_vector.clear();
5484
      __isset_bit_vector.or(other.__isset_bit_vector);
5485
      this.success = other.success;
5486
      if (other.isSetPex()) {
5487
        this.pex = new PromotionException(other.pex);
5488
      }
5489
    }
5490
 
5491
    public isCodApplicable_result deepCopy() {
5492
      return new isCodApplicable_result(this);
5493
    }
5494
 
5495
    @Override
5496
    public void clear() {
5497
      setSuccessIsSet(false);
5498
      this.success = false;
5499
      this.pex = null;
5500
    }
5501
 
5502
    public boolean isSuccess() {
5503
      return this.success;
5504
    }
5505
 
5506
    public void setSuccess(boolean success) {
5507
      this.success = success;
5508
      setSuccessIsSet(true);
5509
    }
5510
 
5511
    public void unsetSuccess() {
5512
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
5513
    }
5514
 
5515
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
5516
    public boolean isSetSuccess() {
5517
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
5518
    }
5519
 
5520
    public void setSuccessIsSet(boolean value) {
5521
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
5522
    }
5523
 
5524
    public PromotionException getPex() {
5525
      return this.pex;
5526
    }
5527
 
5528
    public void setPex(PromotionException pex) {
5529
      this.pex = pex;
5530
    }
5531
 
5532
    public void unsetPex() {
5533
      this.pex = null;
5534
    }
5535
 
5536
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
5537
    public boolean isSetPex() {
5538
      return this.pex != null;
5539
    }
5540
 
5541
    public void setPexIsSet(boolean value) {
5542
      if (!value) {
5543
        this.pex = null;
5544
      }
5545
    }
5546
 
5547
    public void setFieldValue(_Fields field, Object value) {
5548
      switch (field) {
5549
      case SUCCESS:
5550
        if (value == null) {
5551
          unsetSuccess();
5552
        } else {
5553
          setSuccess((Boolean)value);
5554
        }
5555
        break;
5556
 
5557
      case PEX:
5558
        if (value == null) {
5559
          unsetPex();
5560
        } else {
5561
          setPex((PromotionException)value);
5562
        }
5563
        break;
5564
 
5565
      }
5566
    }
5567
 
5568
    public Object getFieldValue(_Fields field) {
5569
      switch (field) {
5570
      case SUCCESS:
5571
        return Boolean.valueOf(isSuccess());
5572
 
5573
      case PEX:
5574
        return getPex();
5575
 
5576
      }
5577
      throw new IllegalStateException();
5578
    }
5579
 
5580
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5581
    public boolean isSet(_Fields field) {
5582
      if (field == null) {
5583
        throw new IllegalArgumentException();
5584
      }
5585
 
5586
      switch (field) {
5587
      case SUCCESS:
5588
        return isSetSuccess();
5589
      case PEX:
5590
        return isSetPex();
5591
      }
5592
      throw new IllegalStateException();
5593
    }
5594
 
5595
    @Override
5596
    public boolean equals(Object that) {
5597
      if (that == null)
5598
        return false;
5599
      if (that instanceof isCodApplicable_result)
5600
        return this.equals((isCodApplicable_result)that);
5601
      return false;
5602
    }
5603
 
5604
    public boolean equals(isCodApplicable_result that) {
5605
      if (that == null)
5606
        return false;
5607
 
5608
      boolean this_present_success = true;
5609
      boolean that_present_success = true;
5610
      if (this_present_success || that_present_success) {
5611
        if (!(this_present_success && that_present_success))
5612
          return false;
5613
        if (this.success != that.success)
5614
          return false;
5615
      }
5616
 
5617
      boolean this_present_pex = true && this.isSetPex();
5618
      boolean that_present_pex = true && that.isSetPex();
5619
      if (this_present_pex || that_present_pex) {
5620
        if (!(this_present_pex && that_present_pex))
5621
          return false;
5622
        if (!this.pex.equals(that.pex))
5623
          return false;
5624
      }
5625
 
5626
      return true;
5627
    }
5628
 
5629
    @Override
5630
    public int hashCode() {
5631
      return 0;
5632
    }
5633
 
5634
    public int compareTo(isCodApplicable_result other) {
5635
      if (!getClass().equals(other.getClass())) {
5636
        return getClass().getName().compareTo(other.getClass().getName());
5637
      }
5638
 
5639
      int lastComparison = 0;
5640
      isCodApplicable_result typedOther = (isCodApplicable_result)other;
5641
 
5642
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
5643
      if (lastComparison != 0) {
5644
        return lastComparison;
5645
      }
5646
      if (isSetSuccess()) {
5647
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
5648
        if (lastComparison != 0) {
5649
          return lastComparison;
5650
        }
5651
      }
5652
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
5653
      if (lastComparison != 0) {
5654
        return lastComparison;
5655
      }
5656
      if (isSetPex()) {
5657
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
5658
        if (lastComparison != 0) {
5659
          return lastComparison;
5660
        }
5661
      }
5662
      return 0;
5663
    }
5664
 
5665
    public _Fields fieldForId(int fieldId) {
5666
      return _Fields.findByThriftId(fieldId);
5667
    }
5668
 
5669
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5670
      org.apache.thrift.protocol.TField field;
5671
      iprot.readStructBegin();
5672
      while (true)
5673
      {
5674
        field = iprot.readFieldBegin();
5675
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
5676
          break;
5677
        }
5678
        switch (field.id) {
5679
          case 0: // SUCCESS
5680
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
5681
              this.success = iprot.readBool();
5682
              setSuccessIsSet(true);
5683
            } else { 
5684
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5685
            }
5686
            break;
5687
          case 1: // PEX
5688
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5689
              this.pex = new PromotionException();
5690
              this.pex.read(iprot);
5691
            } else { 
5692
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5693
            }
5694
            break;
5695
          default:
5696
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5697
        }
5698
        iprot.readFieldEnd();
5699
      }
5700
      iprot.readStructEnd();
5701
      validate();
5702
    }
5703
 
5704
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
5705
      oprot.writeStructBegin(STRUCT_DESC);
5706
 
5707
      if (this.isSetSuccess()) {
5708
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
5709
        oprot.writeBool(this.success);
5710
        oprot.writeFieldEnd();
5711
      } else if (this.isSetPex()) {
5712
        oprot.writeFieldBegin(PEX_FIELD_DESC);
5713
        this.pex.write(oprot);
5714
        oprot.writeFieldEnd();
5715
      }
5716
      oprot.writeFieldStop();
5717
      oprot.writeStructEnd();
5718
    }
5719
 
5720
    @Override
5721
    public String toString() {
5722
      StringBuilder sb = new StringBuilder("isCodApplicable_result(");
5723
      boolean first = true;
5724
 
5725
      sb.append("success:");
5726
      sb.append(this.success);
5727
      first = false;
5728
      if (!first) sb.append(", ");
5729
      sb.append("pex:");
5730
      if (this.pex == null) {
5731
        sb.append("null");
5732
      } else {
5733
        sb.append(this.pex);
5734
      }
5735
      first = false;
5736
      sb.append(")");
5737
      return sb.toString();
5738
    }
5739
 
5740
    public void validate() throws org.apache.thrift.TException {
5741
      // check for required fields
5742
    }
5743
 
5744
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5745
      try {
5746
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5747
      } catch (org.apache.thrift.TException te) {
5748
        throw new java.io.IOException(te);
5749
      }
5750
    }
5751
 
5752
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5753
      try {
5754
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5755
      } catch (org.apache.thrift.TException te) {
5756
        throw new java.io.IOException(te);
5757
      }
5758
    }
5759
 
5760
  }
5761
 
3430 rajveer 5762
  public static class getAllPromotions_args implements org.apache.thrift.TBase<getAllPromotions_args, getAllPromotions_args._Fields>, java.io.Serializable, Cloneable   {
5763
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_args");
1982 varun.gupt 5764
 
5765
 
5766
 
5767
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5768
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5769
;
5770
 
5771
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5772
 
5773
      static {
5774
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5775
          byName.put(field.getFieldName(), field);
5776
        }
5777
      }
5778
 
5779
      /**
5780
       * Find the _Fields constant that matches fieldId, or null if its not found.
5781
       */
5782
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5783
        switch(fieldId) {
5784
          default:
5785
            return null;
5786
        }
1982 varun.gupt 5787
      }
5788
 
5789
      /**
5790
       * Find the _Fields constant that matches fieldId, throwing an exception
5791
       * if it is not found.
5792
       */
5793
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5794
        _Fields fields = findByThriftId(fieldId);
5795
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5796
        return fields;
5797
      }
5798
 
5799
      /**
5800
       * Find the _Fields constant that matches name, or null if its not found.
5801
       */
5802
      public static _Fields findByName(String name) {
5803
        return byName.get(name);
5804
      }
5805
 
5806
      private final short _thriftId;
5807
      private final String _fieldName;
5808
 
5809
      _Fields(short thriftId, String fieldName) {
5810
        _thriftId = thriftId;
5811
        _fieldName = fieldName;
5812
      }
5813
 
5814
      public short getThriftFieldId() {
5815
        return _thriftId;
5816
      }
5817
 
5818
      public String getFieldName() {
5819
        return _fieldName;
5820
      }
5821
    }
3430 rajveer 5822
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5823
    static {
3430 rajveer 5824
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5825
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5826
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_args.class, metaDataMap);
1982 varun.gupt 5827
    }
5828
 
5829
    public getAllPromotions_args() {
5830
    }
5831
 
5832
    /**
5833
     * Performs a deep copy on <i>other</i>.
5834
     */
5835
    public getAllPromotions_args(getAllPromotions_args other) {
5836
    }
5837
 
5838
    public getAllPromotions_args deepCopy() {
5839
      return new getAllPromotions_args(this);
5840
    }
5841
 
3430 rajveer 5842
    @Override
5843
    public void clear() {
1982 varun.gupt 5844
    }
5845
 
5846
    public void setFieldValue(_Fields field, Object value) {
5847
      switch (field) {
5848
      }
5849
    }
5850
 
5851
    public Object getFieldValue(_Fields field) {
5852
      switch (field) {
5853
      }
5854
      throw new IllegalStateException();
5855
    }
5856
 
3430 rajveer 5857
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5858
    public boolean isSet(_Fields field) {
5859
      if (field == null) {
5860
        throw new IllegalArgumentException();
5861
      }
1982 varun.gupt 5862
 
5863
      switch (field) {
5864
      }
5865
      throw new IllegalStateException();
5866
    }
5867
 
5868
    @Override
5869
    public boolean equals(Object that) {
5870
      if (that == null)
5871
        return false;
5872
      if (that instanceof getAllPromotions_args)
5873
        return this.equals((getAllPromotions_args)that);
5874
      return false;
5875
    }
5876
 
5877
    public boolean equals(getAllPromotions_args that) {
5878
      if (that == null)
5879
        return false;
5880
 
5881
      return true;
5882
    }
5883
 
5884
    @Override
5885
    public int hashCode() {
5886
      return 0;
5887
    }
5888
 
5889
    public int compareTo(getAllPromotions_args other) {
5890
      if (!getClass().equals(other.getClass())) {
5891
        return getClass().getName().compareTo(other.getClass().getName());
5892
      }
5893
 
5894
      int lastComparison = 0;
5895
      getAllPromotions_args typedOther = (getAllPromotions_args)other;
5896
 
5897
      return 0;
5898
    }
5899
 
3430 rajveer 5900
    public _Fields fieldForId(int fieldId) {
5901
      return _Fields.findByThriftId(fieldId);
5902
    }
5903
 
5904
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5905
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5906
      iprot.readStructBegin();
5907
      while (true)
5908
      {
5909
        field = iprot.readFieldBegin();
3430 rajveer 5910
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5911
          break;
5912
        }
3430 rajveer 5913
        switch (field.id) {
5914
          default:
5915
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5916
        }
3430 rajveer 5917
        iprot.readFieldEnd();
1982 varun.gupt 5918
      }
5919
      iprot.readStructEnd();
5920
      validate();
5921
    }
5922
 
3430 rajveer 5923
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5924
      validate();
5925
 
5926
      oprot.writeStructBegin(STRUCT_DESC);
5927
      oprot.writeFieldStop();
5928
      oprot.writeStructEnd();
5929
    }
5930
 
5931
    @Override
5932
    public String toString() {
5933
      StringBuilder sb = new StringBuilder("getAllPromotions_args(");
5934
      boolean first = true;
5935
 
5936
      sb.append(")");
5937
      return sb.toString();
5938
    }
5939
 
3430 rajveer 5940
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5941
      // check for required fields
5942
    }
5943
 
3430 rajveer 5944
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5945
      try {
5946
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5947
      } catch (org.apache.thrift.TException te) {
5948
        throw new java.io.IOException(te);
5949
      }
5950
    }
5951
 
5952
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5953
      try {
5954
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5955
      } catch (org.apache.thrift.TException te) {
5956
        throw new java.io.IOException(te);
5957
      }
5958
    }
5959
 
1982 varun.gupt 5960
  }
5961
 
3430 rajveer 5962
  public static class getAllPromotions_result implements org.apache.thrift.TBase<getAllPromotions_result, getAllPromotions_result._Fields>, java.io.Serializable, Cloneable   {
5963
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_result");
1982 varun.gupt 5964
 
3430 rajveer 5965
    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);
5966
    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 5967
 
3430 rajveer 5968
    private List<Promotion> success; // required
5969
    private PromotionException pex; // required
1982 varun.gupt 5970
 
5971
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5972
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5973
      SUCCESS((short)0, "success"),
5974
      PEX((short)1, "pex");
5975
 
5976
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5977
 
5978
      static {
5979
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5980
          byName.put(field.getFieldName(), field);
5981
        }
5982
      }
5983
 
5984
      /**
5985
       * Find the _Fields constant that matches fieldId, or null if its not found.
5986
       */
5987
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5988
        switch(fieldId) {
5989
          case 0: // SUCCESS
5990
            return SUCCESS;
5991
          case 1: // PEX
5992
            return PEX;
5993
          default:
5994
            return null;
5995
        }
1982 varun.gupt 5996
      }
5997
 
5998
      /**
5999
       * Find the _Fields constant that matches fieldId, throwing an exception
6000
       * if it is not found.
6001
       */
6002
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6003
        _Fields fields = findByThriftId(fieldId);
6004
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6005
        return fields;
6006
      }
6007
 
6008
      /**
6009
       * Find the _Fields constant that matches name, or null if its not found.
6010
       */
6011
      public static _Fields findByName(String name) {
6012
        return byName.get(name);
6013
      }
6014
 
6015
      private final short _thriftId;
6016
      private final String _fieldName;
6017
 
6018
      _Fields(short thriftId, String fieldName) {
6019
        _thriftId = thriftId;
6020
        _fieldName = fieldName;
6021
      }
6022
 
6023
      public short getThriftFieldId() {
6024
        return _thriftId;
6025
      }
6026
 
6027
      public String getFieldName() {
6028
        return _fieldName;
6029
      }
6030
    }
6031
 
6032
    // isset id assignments
6033
 
3430 rajveer 6034
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6035
    static {
3430 rajveer 6036
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6037
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6038
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
6039
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class))));
6040
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6041
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
6042
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6043
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_result.class, metaDataMap);
1982 varun.gupt 6044
    }
6045
 
6046
    public getAllPromotions_result() {
6047
    }
6048
 
6049
    public getAllPromotions_result(
6050
      List<Promotion> success,
6051
      PromotionException pex)
6052
    {
6053
      this();
6054
      this.success = success;
6055
      this.pex = pex;
6056
    }
6057
 
6058
    /**
6059
     * Performs a deep copy on <i>other</i>.
6060
     */
6061
    public getAllPromotions_result(getAllPromotions_result other) {
6062
      if (other.isSetSuccess()) {
6063
        List<Promotion> __this__success = new ArrayList<Promotion>();
6064
        for (Promotion other_element : other.success) {
6065
          __this__success.add(new Promotion(other_element));
6066
        }
6067
        this.success = __this__success;
6068
      }
6069
      if (other.isSetPex()) {
6070
        this.pex = new PromotionException(other.pex);
6071
      }
6072
    }
6073
 
6074
    public getAllPromotions_result deepCopy() {
6075
      return new getAllPromotions_result(this);
6076
    }
6077
 
3430 rajveer 6078
    @Override
6079
    public void clear() {
6080
      this.success = null;
6081
      this.pex = null;
1982 varun.gupt 6082
    }
6083
 
6084
    public int getSuccessSize() {
6085
      return (this.success == null) ? 0 : this.success.size();
6086
    }
6087
 
6088
    public java.util.Iterator<Promotion> getSuccessIterator() {
6089
      return (this.success == null) ? null : this.success.iterator();
6090
    }
6091
 
6092
    public void addToSuccess(Promotion elem) {
6093
      if (this.success == null) {
6094
        this.success = new ArrayList<Promotion>();
6095
      }
6096
      this.success.add(elem);
6097
    }
6098
 
6099
    public List<Promotion> getSuccess() {
6100
      return this.success;
6101
    }
6102
 
3430 rajveer 6103
    public void setSuccess(List<Promotion> success) {
1982 varun.gupt 6104
      this.success = success;
6105
    }
6106
 
6107
    public void unsetSuccess() {
6108
      this.success = null;
6109
    }
6110
 
3430 rajveer 6111
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6112
    public boolean isSetSuccess() {
6113
      return this.success != null;
6114
    }
6115
 
6116
    public void setSuccessIsSet(boolean value) {
6117
      if (!value) {
6118
        this.success = null;
6119
      }
6120
    }
6121
 
6122
    public PromotionException getPex() {
6123
      return this.pex;
6124
    }
6125
 
3430 rajveer 6126
    public void setPex(PromotionException pex) {
1982 varun.gupt 6127
      this.pex = pex;
6128
    }
6129
 
6130
    public void unsetPex() {
6131
      this.pex = null;
6132
    }
6133
 
3430 rajveer 6134
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6135
    public boolean isSetPex() {
6136
      return this.pex != null;
6137
    }
6138
 
6139
    public void setPexIsSet(boolean value) {
6140
      if (!value) {
6141
        this.pex = null;
6142
      }
6143
    }
6144
 
6145
    public void setFieldValue(_Fields field, Object value) {
6146
      switch (field) {
6147
      case SUCCESS:
6148
        if (value == null) {
6149
          unsetSuccess();
6150
        } else {
6151
          setSuccess((List<Promotion>)value);
6152
        }
6153
        break;
6154
 
6155
      case PEX:
6156
        if (value == null) {
6157
          unsetPex();
6158
        } else {
6159
          setPex((PromotionException)value);
6160
        }
6161
        break;
6162
 
6163
      }
6164
    }
6165
 
6166
    public Object getFieldValue(_Fields field) {
6167
      switch (field) {
6168
      case SUCCESS:
6169
        return getSuccess();
6170
 
6171
      case PEX:
6172
        return getPex();
6173
 
6174
      }
6175
      throw new IllegalStateException();
6176
    }
6177
 
3430 rajveer 6178
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6179
    public boolean isSet(_Fields field) {
6180
      if (field == null) {
6181
        throw new IllegalArgumentException();
6182
      }
1982 varun.gupt 6183
 
6184
      switch (field) {
6185
      case SUCCESS:
6186
        return isSetSuccess();
6187
      case PEX:
6188
        return isSetPex();
6189
      }
6190
      throw new IllegalStateException();
6191
    }
6192
 
6193
    @Override
6194
    public boolean equals(Object that) {
6195
      if (that == null)
6196
        return false;
6197
      if (that instanceof getAllPromotions_result)
6198
        return this.equals((getAllPromotions_result)that);
6199
      return false;
6200
    }
6201
 
6202
    public boolean equals(getAllPromotions_result that) {
6203
      if (that == null)
6204
        return false;
6205
 
6206
      boolean this_present_success = true && this.isSetSuccess();
6207
      boolean that_present_success = true && that.isSetSuccess();
6208
      if (this_present_success || that_present_success) {
6209
        if (!(this_present_success && that_present_success))
6210
          return false;
6211
        if (!this.success.equals(that.success))
6212
          return false;
6213
      }
6214
 
6215
      boolean this_present_pex = true && this.isSetPex();
6216
      boolean that_present_pex = true && that.isSetPex();
6217
      if (this_present_pex || that_present_pex) {
6218
        if (!(this_present_pex && that_present_pex))
6219
          return false;
6220
        if (!this.pex.equals(that.pex))
6221
          return false;
6222
      }
6223
 
6224
      return true;
6225
    }
6226
 
6227
    @Override
6228
    public int hashCode() {
6229
      return 0;
6230
    }
6231
 
6232
    public int compareTo(getAllPromotions_result other) {
6233
      if (!getClass().equals(other.getClass())) {
6234
        return getClass().getName().compareTo(other.getClass().getName());
6235
      }
6236
 
6237
      int lastComparison = 0;
6238
      getAllPromotions_result typedOther = (getAllPromotions_result)other;
6239
 
3430 rajveer 6240
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 6241
      if (lastComparison != 0) {
6242
        return lastComparison;
6243
      }
3430 rajveer 6244
      if (isSetSuccess()) {
6245
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
6246
        if (lastComparison != 0) {
6247
          return lastComparison;
6248
        }
1982 varun.gupt 6249
      }
3430 rajveer 6250
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 6251
      if (lastComparison != 0) {
6252
        return lastComparison;
6253
      }
3430 rajveer 6254
      if (isSetPex()) {
6255
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
6256
        if (lastComparison != 0) {
6257
          return lastComparison;
6258
        }
1982 varun.gupt 6259
      }
6260
      return 0;
6261
    }
6262
 
3430 rajveer 6263
    public _Fields fieldForId(int fieldId) {
6264
      return _Fields.findByThriftId(fieldId);
6265
    }
6266
 
6267
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6268
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6269
      iprot.readStructBegin();
6270
      while (true)
6271
      {
6272
        field = iprot.readFieldBegin();
3430 rajveer 6273
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6274
          break;
6275
        }
3430 rajveer 6276
        switch (field.id) {
6277
          case 0: // SUCCESS
6278
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
6279
              {
11592 amit.gupta 6280
                org.apache.thrift.protocol.TList _list16 = iprot.readListBegin();
6281
                this.success = new ArrayList<Promotion>(_list16.size);
6282
                for (int _i17 = 0; _i17 < _list16.size; ++_i17)
1982 varun.gupt 6283
                {
11592 amit.gupta 6284
                  Promotion _elem18; // required
6285
                  _elem18 = new Promotion();
6286
                  _elem18.read(iprot);
6287
                  this.success.add(_elem18);
1982 varun.gupt 6288
                }
3430 rajveer 6289
                iprot.readListEnd();
1982 varun.gupt 6290
              }
3430 rajveer 6291
            } else { 
6292
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6293
            }
6294
            break;
6295
          case 1: // PEX
6296
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6297
              this.pex = new PromotionException();
6298
              this.pex.read(iprot);
6299
            } else { 
6300
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6301
            }
6302
            break;
6303
          default:
6304
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6305
        }
3430 rajveer 6306
        iprot.readFieldEnd();
1982 varun.gupt 6307
      }
6308
      iprot.readStructEnd();
6309
      validate();
6310
    }
6311
 
3430 rajveer 6312
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6313
      oprot.writeStructBegin(STRUCT_DESC);
6314
 
6315
      if (this.isSetSuccess()) {
6316
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
6317
        {
3430 rajveer 6318
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
11592 amit.gupta 6319
          for (Promotion _iter19 : this.success)
1982 varun.gupt 6320
          {
11592 amit.gupta 6321
            _iter19.write(oprot);
1982 varun.gupt 6322
          }
6323
          oprot.writeListEnd();
6324
        }
6325
        oprot.writeFieldEnd();
6326
      } else if (this.isSetPex()) {
6327
        oprot.writeFieldBegin(PEX_FIELD_DESC);
6328
        this.pex.write(oprot);
6329
        oprot.writeFieldEnd();
6330
      }
6331
      oprot.writeFieldStop();
6332
      oprot.writeStructEnd();
6333
    }
6334
 
6335
    @Override
6336
    public String toString() {
6337
      StringBuilder sb = new StringBuilder("getAllPromotions_result(");
6338
      boolean first = true;
6339
 
6340
      sb.append("success:");
6341
      if (this.success == null) {
6342
        sb.append("null");
6343
      } else {
6344
        sb.append(this.success);
6345
      }
6346
      first = false;
6347
      if (!first) sb.append(", ");
6348
      sb.append("pex:");
6349
      if (this.pex == null) {
6350
        sb.append("null");
6351
      } else {
6352
        sb.append(this.pex);
6353
      }
6354
      first = false;
6355
      sb.append(")");
6356
      return sb.toString();
6357
    }
6358
 
3430 rajveer 6359
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6360
      // check for required fields
6361
    }
6362
 
3430 rajveer 6363
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6364
      try {
6365
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6366
      } catch (org.apache.thrift.TException te) {
6367
        throw new java.io.IOException(te);
6368
      }
6369
    }
6370
 
6371
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6372
      try {
6373
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6374
      } catch (org.apache.thrift.TException te) {
6375
        throw new java.io.IOException(te);
6376
      }
6377
    }
6378
 
1982 varun.gupt 6379
  }
6380
 
3430 rajveer 6381
  public static class getPromotionById_args implements org.apache.thrift.TBase<getPromotionById_args, getPromotionById_args._Fields>, java.io.Serializable, Cloneable   {
6382
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_args");
1982 varun.gupt 6383
 
3430 rajveer 6384
    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 6385
 
3430 rajveer 6386
    private long promotionId; // required
1982 varun.gupt 6387
 
6388
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6389
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6390
      PROMOTION_ID((short)1, "promotionId");
6391
 
6392
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6393
 
6394
      static {
6395
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6396
          byName.put(field.getFieldName(), field);
6397
        }
6398
      }
6399
 
6400
      /**
6401
       * Find the _Fields constant that matches fieldId, or null if its not found.
6402
       */
6403
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6404
        switch(fieldId) {
6405
          case 1: // PROMOTION_ID
6406
            return PROMOTION_ID;
6407
          default:
6408
            return null;
6409
        }
1982 varun.gupt 6410
      }
6411
 
6412
      /**
6413
       * Find the _Fields constant that matches fieldId, throwing an exception
6414
       * if it is not found.
6415
       */
6416
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6417
        _Fields fields = findByThriftId(fieldId);
6418
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6419
        return fields;
6420
      }
6421
 
6422
      /**
6423
       * Find the _Fields constant that matches name, or null if its not found.
6424
       */
6425
      public static _Fields findByName(String name) {
6426
        return byName.get(name);
6427
      }
6428
 
6429
      private final short _thriftId;
6430
      private final String _fieldName;
6431
 
6432
      _Fields(short thriftId, String fieldName) {
6433
        _thriftId = thriftId;
6434
        _fieldName = fieldName;
6435
      }
6436
 
6437
      public short getThriftFieldId() {
6438
        return _thriftId;
6439
      }
6440
 
6441
      public String getFieldName() {
6442
        return _fieldName;
6443
      }
6444
    }
6445
 
6446
    // isset id assignments
6447
    private static final int __PROMOTIONID_ISSET_ID = 0;
6448
    private BitSet __isset_bit_vector = new BitSet(1);
6449
 
3430 rajveer 6450
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6451
    static {
3430 rajveer 6452
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6453
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6454
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6455
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6456
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_args.class, metaDataMap);
1982 varun.gupt 6457
    }
6458
 
6459
    public getPromotionById_args() {
6460
    }
6461
 
6462
    public getPromotionById_args(
6463
      long promotionId)
6464
    {
6465
      this();
6466
      this.promotionId = promotionId;
6467
      setPromotionIdIsSet(true);
6468
    }
6469
 
6470
    /**
6471
     * Performs a deep copy on <i>other</i>.
6472
     */
6473
    public getPromotionById_args(getPromotionById_args other) {
6474
      __isset_bit_vector.clear();
6475
      __isset_bit_vector.or(other.__isset_bit_vector);
6476
      this.promotionId = other.promotionId;
6477
    }
6478
 
6479
    public getPromotionById_args deepCopy() {
6480
      return new getPromotionById_args(this);
6481
    }
6482
 
3430 rajveer 6483
    @Override
6484
    public void clear() {
6485
      setPromotionIdIsSet(false);
6486
      this.promotionId = 0;
1982 varun.gupt 6487
    }
6488
 
6489
    public long getPromotionId() {
6490
      return this.promotionId;
6491
    }
6492
 
3430 rajveer 6493
    public void setPromotionId(long promotionId) {
1982 varun.gupt 6494
      this.promotionId = promotionId;
6495
      setPromotionIdIsSet(true);
6496
    }
6497
 
6498
    public void unsetPromotionId() {
6499
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
6500
    }
6501
 
3430 rajveer 6502
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6503
    public boolean isSetPromotionId() {
6504
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
6505
    }
6506
 
6507
    public void setPromotionIdIsSet(boolean value) {
6508
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
6509
    }
6510
 
6511
    public void setFieldValue(_Fields field, Object value) {
6512
      switch (field) {
6513
      case PROMOTION_ID:
6514
        if (value == null) {
6515
          unsetPromotionId();
6516
        } else {
6517
          setPromotionId((Long)value);
6518
        }
6519
        break;
6520
 
6521
      }
6522
    }
6523
 
6524
    public Object getFieldValue(_Fields field) {
6525
      switch (field) {
6526
      case PROMOTION_ID:
3430 rajveer 6527
        return Long.valueOf(getPromotionId());
1982 varun.gupt 6528
 
6529
      }
6530
      throw new IllegalStateException();
6531
    }
6532
 
3430 rajveer 6533
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6534
    public boolean isSet(_Fields field) {
6535
      if (field == null) {
6536
        throw new IllegalArgumentException();
6537
      }
1982 varun.gupt 6538
 
6539
      switch (field) {
6540
      case PROMOTION_ID:
6541
        return isSetPromotionId();
6542
      }
6543
      throw new IllegalStateException();
6544
    }
6545
 
6546
    @Override
6547
    public boolean equals(Object that) {
6548
      if (that == null)
6549
        return false;
6550
      if (that instanceof getPromotionById_args)
6551
        return this.equals((getPromotionById_args)that);
6552
      return false;
6553
    }
6554
 
6555
    public boolean equals(getPromotionById_args that) {
6556
      if (that == null)
6557
        return false;
6558
 
6559
      boolean this_present_promotionId = true;
6560
      boolean that_present_promotionId = true;
6561
      if (this_present_promotionId || that_present_promotionId) {
6562
        if (!(this_present_promotionId && that_present_promotionId))
6563
          return false;
6564
        if (this.promotionId != that.promotionId)
6565
          return false;
6566
      }
6567
 
6568
      return true;
6569
    }
6570
 
6571
    @Override
6572
    public int hashCode() {
6573
      return 0;
6574
    }
6575
 
6576
    public int compareTo(getPromotionById_args other) {
6577
      if (!getClass().equals(other.getClass())) {
6578
        return getClass().getName().compareTo(other.getClass().getName());
6579
      }
6580
 
6581
      int lastComparison = 0;
6582
      getPromotionById_args typedOther = (getPromotionById_args)other;
6583
 
3430 rajveer 6584
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 6585
      if (lastComparison != 0) {
6586
        return lastComparison;
6587
      }
3430 rajveer 6588
      if (isSetPromotionId()) {
6589
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
6590
        if (lastComparison != 0) {
6591
          return lastComparison;
6592
        }
1982 varun.gupt 6593
      }
6594
      return 0;
6595
    }
6596
 
3430 rajveer 6597
    public _Fields fieldForId(int fieldId) {
6598
      return _Fields.findByThriftId(fieldId);
6599
    }
6600
 
6601
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6602
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6603
      iprot.readStructBegin();
6604
      while (true)
6605
      {
6606
        field = iprot.readFieldBegin();
3430 rajveer 6607
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6608
          break;
6609
        }
3430 rajveer 6610
        switch (field.id) {
6611
          case 1: // PROMOTION_ID
6612
            if (field.type == org.apache.thrift.protocol.TType.I64) {
6613
              this.promotionId = iprot.readI64();
6614
              setPromotionIdIsSet(true);
6615
            } else { 
6616
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6617
            }
6618
            break;
6619
          default:
6620
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6621
        }
3430 rajveer 6622
        iprot.readFieldEnd();
1982 varun.gupt 6623
      }
6624
      iprot.readStructEnd();
6625
      validate();
6626
    }
6627
 
3430 rajveer 6628
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6629
      validate();
6630
 
6631
      oprot.writeStructBegin(STRUCT_DESC);
6632
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
6633
      oprot.writeI64(this.promotionId);
6634
      oprot.writeFieldEnd();
6635
      oprot.writeFieldStop();
6636
      oprot.writeStructEnd();
6637
    }
6638
 
6639
    @Override
6640
    public String toString() {
6641
      StringBuilder sb = new StringBuilder("getPromotionById_args(");
6642
      boolean first = true;
6643
 
6644
      sb.append("promotionId:");
6645
      sb.append(this.promotionId);
6646
      first = false;
6647
      sb.append(")");
6648
      return sb.toString();
6649
    }
6650
 
3430 rajveer 6651
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6652
      // check for required fields
6653
    }
6654
 
3430 rajveer 6655
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6656
      try {
6657
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6658
      } catch (org.apache.thrift.TException te) {
6659
        throw new java.io.IOException(te);
6660
      }
6661
    }
6662
 
6663
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6664
      try {
6665
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
6666
        __isset_bit_vector = new BitSet(1);
6667
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6668
      } catch (org.apache.thrift.TException te) {
6669
        throw new java.io.IOException(te);
6670
      }
6671
    }
6672
 
1982 varun.gupt 6673
  }
6674
 
3430 rajveer 6675
  public static class getPromotionById_result implements org.apache.thrift.TBase<getPromotionById_result, getPromotionById_result._Fields>, java.io.Serializable, Cloneable   {
6676
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_result");
1982 varun.gupt 6677
 
3430 rajveer 6678
    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);
6679
    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 6680
 
3430 rajveer 6681
    private Promotion success; // required
6682
    private PromotionException pex; // required
1982 varun.gupt 6683
 
6684
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6685
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6686
      SUCCESS((short)0, "success"),
6687
      PEX((short)1, "pex");
6688
 
6689
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6690
 
6691
      static {
6692
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6693
          byName.put(field.getFieldName(), field);
6694
        }
6695
      }
6696
 
6697
      /**
6698
       * Find the _Fields constant that matches fieldId, or null if its not found.
6699
       */
6700
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6701
        switch(fieldId) {
6702
          case 0: // SUCCESS
6703
            return SUCCESS;
6704
          case 1: // PEX
6705
            return PEX;
6706
          default:
6707
            return null;
6708
        }
1982 varun.gupt 6709
      }
6710
 
6711
      /**
6712
       * Find the _Fields constant that matches fieldId, throwing an exception
6713
       * if it is not found.
6714
       */
6715
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6716
        _Fields fields = findByThriftId(fieldId);
6717
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6718
        return fields;
6719
      }
6720
 
6721
      /**
6722
       * Find the _Fields constant that matches name, or null if its not found.
6723
       */
6724
      public static _Fields findByName(String name) {
6725
        return byName.get(name);
6726
      }
6727
 
6728
      private final short _thriftId;
6729
      private final String _fieldName;
6730
 
6731
      _Fields(short thriftId, String fieldName) {
6732
        _thriftId = thriftId;
6733
        _fieldName = fieldName;
6734
      }
6735
 
6736
      public short getThriftFieldId() {
6737
        return _thriftId;
6738
      }
6739
 
6740
      public String getFieldName() {
6741
        return _fieldName;
6742
      }
6743
    }
6744
 
6745
    // isset id assignments
6746
 
3430 rajveer 6747
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6748
    static {
3430 rajveer 6749
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6750
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6751
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class)));
6752
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6753
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
6754
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6755
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_result.class, metaDataMap);
1982 varun.gupt 6756
    }
6757
 
6758
    public getPromotionById_result() {
6759
    }
6760
 
6761
    public getPromotionById_result(
6762
      Promotion success,
6763
      PromotionException pex)
6764
    {
6765
      this();
6766
      this.success = success;
6767
      this.pex = pex;
6768
    }
6769
 
6770
    /**
6771
     * Performs a deep copy on <i>other</i>.
6772
     */
6773
    public getPromotionById_result(getPromotionById_result other) {
6774
      if (other.isSetSuccess()) {
6775
        this.success = new Promotion(other.success);
6776
      }
6777
      if (other.isSetPex()) {
6778
        this.pex = new PromotionException(other.pex);
6779
      }
6780
    }
6781
 
6782
    public getPromotionById_result deepCopy() {
6783
      return new getPromotionById_result(this);
6784
    }
6785
 
3430 rajveer 6786
    @Override
6787
    public void clear() {
6788
      this.success = null;
6789
      this.pex = null;
1982 varun.gupt 6790
    }
6791
 
6792
    public Promotion getSuccess() {
6793
      return this.success;
6794
    }
6795
 
3430 rajveer 6796
    public void setSuccess(Promotion success) {
1982 varun.gupt 6797
      this.success = success;
6798
    }
6799
 
6800
    public void unsetSuccess() {
6801
      this.success = null;
6802
    }
6803
 
3430 rajveer 6804
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6805
    public boolean isSetSuccess() {
6806
      return this.success != null;
6807
    }
6808
 
6809
    public void setSuccessIsSet(boolean value) {
6810
      if (!value) {
6811
        this.success = null;
6812
      }
6813
    }
6814
 
6815
    public PromotionException getPex() {
6816
      return this.pex;
6817
    }
6818
 
3430 rajveer 6819
    public void setPex(PromotionException pex) {
1982 varun.gupt 6820
      this.pex = pex;
6821
    }
6822
 
6823
    public void unsetPex() {
6824
      this.pex = null;
6825
    }
6826
 
3430 rajveer 6827
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6828
    public boolean isSetPex() {
6829
      return this.pex != null;
6830
    }
6831
 
6832
    public void setPexIsSet(boolean value) {
6833
      if (!value) {
6834
        this.pex = null;
6835
      }
6836
    }
6837
 
6838
    public void setFieldValue(_Fields field, Object value) {
6839
      switch (field) {
6840
      case SUCCESS:
6841
        if (value == null) {
6842
          unsetSuccess();
6843
        } else {
6844
          setSuccess((Promotion)value);
6845
        }
6846
        break;
6847
 
6848
      case PEX:
6849
        if (value == null) {
6850
          unsetPex();
6851
        } else {
6852
          setPex((PromotionException)value);
6853
        }
6854
        break;
6855
 
6856
      }
6857
    }
6858
 
6859
    public Object getFieldValue(_Fields field) {
6860
      switch (field) {
6861
      case SUCCESS:
6862
        return getSuccess();
6863
 
6864
      case PEX:
6865
        return getPex();
6866
 
6867
      }
6868
      throw new IllegalStateException();
6869
    }
6870
 
3430 rajveer 6871
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6872
    public boolean isSet(_Fields field) {
6873
      if (field == null) {
6874
        throw new IllegalArgumentException();
6875
      }
1982 varun.gupt 6876
 
6877
      switch (field) {
6878
      case SUCCESS:
6879
        return isSetSuccess();
6880
      case PEX:
6881
        return isSetPex();
6882
      }
6883
      throw new IllegalStateException();
6884
    }
6885
 
6886
    @Override
6887
    public boolean equals(Object that) {
6888
      if (that == null)
6889
        return false;
6890
      if (that instanceof getPromotionById_result)
6891
        return this.equals((getPromotionById_result)that);
6892
      return false;
6893
    }
6894
 
6895
    public boolean equals(getPromotionById_result that) {
6896
      if (that == null)
6897
        return false;
6898
 
6899
      boolean this_present_success = true && this.isSetSuccess();
6900
      boolean that_present_success = true && that.isSetSuccess();
6901
      if (this_present_success || that_present_success) {
6902
        if (!(this_present_success && that_present_success))
6903
          return false;
6904
        if (!this.success.equals(that.success))
6905
          return false;
6906
      }
6907
 
6908
      boolean this_present_pex = true && this.isSetPex();
6909
      boolean that_present_pex = true && that.isSetPex();
6910
      if (this_present_pex || that_present_pex) {
6911
        if (!(this_present_pex && that_present_pex))
6912
          return false;
6913
        if (!this.pex.equals(that.pex))
6914
          return false;
6915
      }
6916
 
6917
      return true;
6918
    }
6919
 
6920
    @Override
6921
    public int hashCode() {
6922
      return 0;
6923
    }
6924
 
6925
    public int compareTo(getPromotionById_result other) {
6926
      if (!getClass().equals(other.getClass())) {
6927
        return getClass().getName().compareTo(other.getClass().getName());
6928
      }
6929
 
6930
      int lastComparison = 0;
6931
      getPromotionById_result typedOther = (getPromotionById_result)other;
6932
 
3430 rajveer 6933
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 6934
      if (lastComparison != 0) {
6935
        return lastComparison;
6936
      }
3430 rajveer 6937
      if (isSetSuccess()) {
6938
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
6939
        if (lastComparison != 0) {
6940
          return lastComparison;
6941
        }
1982 varun.gupt 6942
      }
3430 rajveer 6943
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 6944
      if (lastComparison != 0) {
6945
        return lastComparison;
6946
      }
3430 rajveer 6947
      if (isSetPex()) {
6948
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
6949
        if (lastComparison != 0) {
6950
          return lastComparison;
6951
        }
1982 varun.gupt 6952
      }
6953
      return 0;
6954
    }
6955
 
3430 rajveer 6956
    public _Fields fieldForId(int fieldId) {
6957
      return _Fields.findByThriftId(fieldId);
6958
    }
6959
 
6960
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6961
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6962
      iprot.readStructBegin();
6963
      while (true)
6964
      {
6965
        field = iprot.readFieldBegin();
3430 rajveer 6966
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6967
          break;
6968
        }
3430 rajveer 6969
        switch (field.id) {
6970
          case 0: // SUCCESS
6971
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6972
              this.success = new Promotion();
6973
              this.success.read(iprot);
6974
            } else { 
6975
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6976
            }
6977
            break;
6978
          case 1: // PEX
6979
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6980
              this.pex = new PromotionException();
6981
              this.pex.read(iprot);
6982
            } else { 
6983
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6984
            }
6985
            break;
6986
          default:
6987
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6988
        }
3430 rajveer 6989
        iprot.readFieldEnd();
1982 varun.gupt 6990
      }
6991
      iprot.readStructEnd();
6992
      validate();
6993
    }
6994
 
3430 rajveer 6995
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6996
      oprot.writeStructBegin(STRUCT_DESC);
6997
 
6998
      if (this.isSetSuccess()) {
6999
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
7000
        this.success.write(oprot);
7001
        oprot.writeFieldEnd();
7002
      } else if (this.isSetPex()) {
7003
        oprot.writeFieldBegin(PEX_FIELD_DESC);
7004
        this.pex.write(oprot);
7005
        oprot.writeFieldEnd();
7006
      }
7007
      oprot.writeFieldStop();
7008
      oprot.writeStructEnd();
7009
    }
7010
 
7011
    @Override
7012
    public String toString() {
7013
      StringBuilder sb = new StringBuilder("getPromotionById_result(");
7014
      boolean first = true;
7015
 
7016
      sb.append("success:");
7017
      if (this.success == null) {
7018
        sb.append("null");
7019
      } else {
7020
        sb.append(this.success);
7021
      }
7022
      first = false;
7023
      if (!first) sb.append(", ");
7024
      sb.append("pex:");
7025
      if (this.pex == null) {
7026
        sb.append("null");
7027
      } else {
7028
        sb.append(this.pex);
7029
      }
7030
      first = false;
7031
      sb.append(")");
7032
      return sb.toString();
7033
    }
7034
 
3430 rajveer 7035
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7036
      // check for required fields
7037
    }
7038
 
3430 rajveer 7039
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7040
      try {
7041
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7042
      } catch (org.apache.thrift.TException te) {
7043
        throw new java.io.IOException(te);
7044
      }
7045
    }
7046
 
7047
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7048
      try {
7049
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7050
      } catch (org.apache.thrift.TException te) {
7051
        throw new java.io.IOException(te);
7052
      }
7053
    }
7054
 
1982 varun.gupt 7055
  }
7056
 
3430 rajveer 7057
  public static class generateCouponsForPromotion_args implements org.apache.thrift.TBase<generateCouponsForPromotion_args, generateCouponsForPromotion_args._Fields>, java.io.Serializable, Cloneable   {
7058
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_args");
1982 varun.gupt 7059
 
3430 rajveer 7060
    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);
7061
    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 7062
 
3430 rajveer 7063
    private long promotionId; // required
7064
    private String couponCode; // required
1982 varun.gupt 7065
 
7066
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7067
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 7068
      PROMOTION_ID((short)1, "promotionId"),
7069
      COUPON_CODE((short)2, "couponCode");
7070
 
7071
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7072
 
7073
      static {
7074
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7075
          byName.put(field.getFieldName(), field);
7076
        }
7077
      }
7078
 
7079
      /**
7080
       * Find the _Fields constant that matches fieldId, or null if its not found.
7081
       */
7082
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7083
        switch(fieldId) {
7084
          case 1: // PROMOTION_ID
7085
            return PROMOTION_ID;
7086
          case 2: // COUPON_CODE
7087
            return COUPON_CODE;
7088
          default:
7089
            return null;
7090
        }
1982 varun.gupt 7091
      }
7092
 
7093
      /**
7094
       * Find the _Fields constant that matches fieldId, throwing an exception
7095
       * if it is not found.
7096
       */
7097
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7098
        _Fields fields = findByThriftId(fieldId);
7099
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7100
        return fields;
7101
      }
7102
 
7103
      /**
7104
       * Find the _Fields constant that matches name, or null if its not found.
7105
       */
7106
      public static _Fields findByName(String name) {
7107
        return byName.get(name);
7108
      }
7109
 
7110
      private final short _thriftId;
7111
      private final String _fieldName;
7112
 
7113
      _Fields(short thriftId, String fieldName) {
7114
        _thriftId = thriftId;
7115
        _fieldName = fieldName;
7116
      }
7117
 
7118
      public short getThriftFieldId() {
7119
        return _thriftId;
7120
      }
7121
 
7122
      public String getFieldName() {
7123
        return _fieldName;
7124
      }
7125
    }
7126
 
7127
    // isset id assignments
7128
    private static final int __PROMOTIONID_ISSET_ID = 0;
7129
    private BitSet __isset_bit_vector = new BitSet(1);
7130
 
3430 rajveer 7131
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 7132
    static {
3430 rajveer 7133
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7134
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7135
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7136
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7137
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
7138
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7139
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_args.class, metaDataMap);
1982 varun.gupt 7140
    }
7141
 
7142
    public generateCouponsForPromotion_args() {
7143
    }
7144
 
7145
    public generateCouponsForPromotion_args(
7146
      long promotionId,
7147
      String couponCode)
7148
    {
7149
      this();
7150
      this.promotionId = promotionId;
7151
      setPromotionIdIsSet(true);
7152
      this.couponCode = couponCode;
7153
    }
7154
 
7155
    /**
7156
     * Performs a deep copy on <i>other</i>.
7157
     */
7158
    public generateCouponsForPromotion_args(generateCouponsForPromotion_args other) {
7159
      __isset_bit_vector.clear();
7160
      __isset_bit_vector.or(other.__isset_bit_vector);
7161
      this.promotionId = other.promotionId;
7162
      if (other.isSetCouponCode()) {
7163
        this.couponCode = other.couponCode;
7164
      }
7165
    }
7166
 
7167
    public generateCouponsForPromotion_args deepCopy() {
7168
      return new generateCouponsForPromotion_args(this);
7169
    }
7170
 
3430 rajveer 7171
    @Override
7172
    public void clear() {
7173
      setPromotionIdIsSet(false);
7174
      this.promotionId = 0;
7175
      this.couponCode = null;
1982 varun.gupt 7176
    }
7177
 
7178
    public long getPromotionId() {
7179
      return this.promotionId;
7180
    }
7181
 
3430 rajveer 7182
    public void setPromotionId(long promotionId) {
1982 varun.gupt 7183
      this.promotionId = promotionId;
7184
      setPromotionIdIsSet(true);
7185
    }
7186
 
7187
    public void unsetPromotionId() {
7188
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
7189
    }
7190
 
3430 rajveer 7191
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7192
    public boolean isSetPromotionId() {
7193
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
7194
    }
7195
 
7196
    public void setPromotionIdIsSet(boolean value) {
7197
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
7198
    }
7199
 
7200
    public String getCouponCode() {
7201
      return this.couponCode;
7202
    }
7203
 
3430 rajveer 7204
    public void setCouponCode(String couponCode) {
1982 varun.gupt 7205
      this.couponCode = couponCode;
7206
    }
7207
 
7208
    public void unsetCouponCode() {
7209
      this.couponCode = null;
7210
    }
7211
 
3430 rajveer 7212
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7213
    public boolean isSetCouponCode() {
7214
      return this.couponCode != null;
7215
    }
7216
 
7217
    public void setCouponCodeIsSet(boolean value) {
7218
      if (!value) {
7219
        this.couponCode = null;
7220
      }
7221
    }
7222
 
7223
    public void setFieldValue(_Fields field, Object value) {
7224
      switch (field) {
7225
      case PROMOTION_ID:
7226
        if (value == null) {
7227
          unsetPromotionId();
7228
        } else {
7229
          setPromotionId((Long)value);
7230
        }
7231
        break;
7232
 
7233
      case COUPON_CODE:
7234
        if (value == null) {
7235
          unsetCouponCode();
7236
        } else {
7237
          setCouponCode((String)value);
7238
        }
7239
        break;
7240
 
7241
      }
7242
    }
7243
 
7244
    public Object getFieldValue(_Fields field) {
7245
      switch (field) {
7246
      case PROMOTION_ID:
3430 rajveer 7247
        return Long.valueOf(getPromotionId());
1982 varun.gupt 7248
 
7249
      case COUPON_CODE:
7250
        return getCouponCode();
7251
 
7252
      }
7253
      throw new IllegalStateException();
7254
    }
7255
 
3430 rajveer 7256
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7257
    public boolean isSet(_Fields field) {
7258
      if (field == null) {
7259
        throw new IllegalArgumentException();
7260
      }
1982 varun.gupt 7261
 
7262
      switch (field) {
7263
      case PROMOTION_ID:
7264
        return isSetPromotionId();
7265
      case COUPON_CODE:
7266
        return isSetCouponCode();
7267
      }
7268
      throw new IllegalStateException();
7269
    }
7270
 
7271
    @Override
7272
    public boolean equals(Object that) {
7273
      if (that == null)
7274
        return false;
7275
      if (that instanceof generateCouponsForPromotion_args)
7276
        return this.equals((generateCouponsForPromotion_args)that);
7277
      return false;
7278
    }
7279
 
7280
    public boolean equals(generateCouponsForPromotion_args that) {
7281
      if (that == null)
7282
        return false;
7283
 
7284
      boolean this_present_promotionId = true;
7285
      boolean that_present_promotionId = true;
7286
      if (this_present_promotionId || that_present_promotionId) {
7287
        if (!(this_present_promotionId && that_present_promotionId))
7288
          return false;
7289
        if (this.promotionId != that.promotionId)
7290
          return false;
7291
      }
7292
 
7293
      boolean this_present_couponCode = true && this.isSetCouponCode();
7294
      boolean that_present_couponCode = true && that.isSetCouponCode();
7295
      if (this_present_couponCode || that_present_couponCode) {
7296
        if (!(this_present_couponCode && that_present_couponCode))
7297
          return false;
7298
        if (!this.couponCode.equals(that.couponCode))
7299
          return false;
7300
      }
7301
 
7302
      return true;
7303
    }
7304
 
7305
    @Override
7306
    public int hashCode() {
7307
      return 0;
7308
    }
7309
 
7310
    public int compareTo(generateCouponsForPromotion_args other) {
7311
      if (!getClass().equals(other.getClass())) {
7312
        return getClass().getName().compareTo(other.getClass().getName());
7313
      }
7314
 
7315
      int lastComparison = 0;
7316
      generateCouponsForPromotion_args typedOther = (generateCouponsForPromotion_args)other;
7317
 
3430 rajveer 7318
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 7319
      if (lastComparison != 0) {
7320
        return lastComparison;
7321
      }
3430 rajveer 7322
      if (isSetPromotionId()) {
7323
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
7324
        if (lastComparison != 0) {
7325
          return lastComparison;
7326
        }
1982 varun.gupt 7327
      }
3430 rajveer 7328
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 7329
      if (lastComparison != 0) {
7330
        return lastComparison;
7331
      }
3430 rajveer 7332
      if (isSetCouponCode()) {
7333
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
7334
        if (lastComparison != 0) {
7335
          return lastComparison;
7336
        }
1982 varun.gupt 7337
      }
7338
      return 0;
7339
    }
7340
 
3430 rajveer 7341
    public _Fields fieldForId(int fieldId) {
7342
      return _Fields.findByThriftId(fieldId);
7343
    }
7344
 
7345
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7346
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 7347
      iprot.readStructBegin();
7348
      while (true)
7349
      {
7350
        field = iprot.readFieldBegin();
3430 rajveer 7351
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 7352
          break;
7353
        }
3430 rajveer 7354
        switch (field.id) {
7355
          case 1: // PROMOTION_ID
7356
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7357
              this.promotionId = iprot.readI64();
7358
              setPromotionIdIsSet(true);
7359
            } else { 
7360
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7361
            }
7362
            break;
7363
          case 2: // COUPON_CODE
7364
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
7365
              this.couponCode = iprot.readString();
7366
            } else { 
7367
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7368
            }
7369
            break;
7370
          default:
7371
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 7372
        }
3430 rajveer 7373
        iprot.readFieldEnd();
1982 varun.gupt 7374
      }
7375
      iprot.readStructEnd();
7376
      validate();
7377
    }
7378
 
3430 rajveer 7379
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 7380
      validate();
7381
 
7382
      oprot.writeStructBegin(STRUCT_DESC);
7383
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
7384
      oprot.writeI64(this.promotionId);
7385
      oprot.writeFieldEnd();
7386
      if (this.couponCode != null) {
7387
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
7388
        oprot.writeString(this.couponCode);
7389
        oprot.writeFieldEnd();
7390
      }
7391
      oprot.writeFieldStop();
7392
      oprot.writeStructEnd();
7393
    }
7394
 
7395
    @Override
7396
    public String toString() {
7397
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_args(");
7398
      boolean first = true;
7399
 
7400
      sb.append("promotionId:");
7401
      sb.append(this.promotionId);
7402
      first = false;
7403
      if (!first) sb.append(", ");
7404
      sb.append("couponCode:");
7405
      if (this.couponCode == null) {
7406
        sb.append("null");
7407
      } else {
7408
        sb.append(this.couponCode);
7409
      }
7410
      first = false;
7411
      sb.append(")");
7412
      return sb.toString();
7413
    }
7414
 
3430 rajveer 7415
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7416
      // check for required fields
7417
    }
7418
 
3430 rajveer 7419
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7420
      try {
7421
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7422
      } catch (org.apache.thrift.TException te) {
7423
        throw new java.io.IOException(te);
7424
      }
7425
    }
7426
 
7427
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7428
      try {
7429
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
7430
        __isset_bit_vector = new BitSet(1);
7431
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7432
      } catch (org.apache.thrift.TException te) {
7433
        throw new java.io.IOException(te);
7434
      }
7435
    }
7436
 
1982 varun.gupt 7437
  }
7438
 
3430 rajveer 7439
  public static class generateCouponsForPromotion_result implements org.apache.thrift.TBase<generateCouponsForPromotion_result, generateCouponsForPromotion_result._Fields>, java.io.Serializable, Cloneable   {
7440
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_result");
1982 varun.gupt 7441
 
3430 rajveer 7442
    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 7443
 
3430 rajveer 7444
    private PromotionException pex; // required
1982 varun.gupt 7445
 
7446
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7447
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 7448
      PEX((short)1, "pex");
7449
 
7450
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7451
 
7452
      static {
7453
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7454
          byName.put(field.getFieldName(), field);
7455
        }
7456
      }
7457
 
7458
      /**
7459
       * Find the _Fields constant that matches fieldId, or null if its not found.
7460
       */
7461
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7462
        switch(fieldId) {
7463
          case 1: // PEX
7464
            return PEX;
7465
          default:
7466
            return null;
7467
        }
1982 varun.gupt 7468
      }
7469
 
7470
      /**
7471
       * Find the _Fields constant that matches fieldId, throwing an exception
7472
       * if it is not found.
7473
       */
7474
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7475
        _Fields fields = findByThriftId(fieldId);
7476
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7477
        return fields;
7478
      }
7479
 
7480
      /**
7481
       * Find the _Fields constant that matches name, or null if its not found.
7482
       */
7483
      public static _Fields findByName(String name) {
7484
        return byName.get(name);
7485
      }
7486
 
7487
      private final short _thriftId;
7488
      private final String _fieldName;
7489
 
7490
      _Fields(short thriftId, String fieldName) {
7491
        _thriftId = thriftId;
7492
        _fieldName = fieldName;
7493
      }
7494
 
7495
      public short getThriftFieldId() {
7496
        return _thriftId;
7497
      }
7498
 
7499
      public String getFieldName() {
7500
        return _fieldName;
7501
      }
7502
    }
7503
 
7504
    // isset id assignments
7505
 
3430 rajveer 7506
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 7507
    static {
3430 rajveer 7508
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7509
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7510
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
7511
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7512
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_result.class, metaDataMap);
1982 varun.gupt 7513
    }
7514
 
7515
    public generateCouponsForPromotion_result() {
7516
    }
7517
 
7518
    public generateCouponsForPromotion_result(
7519
      PromotionException pex)
7520
    {
7521
      this();
7522
      this.pex = pex;
7523
    }
7524
 
7525
    /**
7526
     * Performs a deep copy on <i>other</i>.
7527
     */
7528
    public generateCouponsForPromotion_result(generateCouponsForPromotion_result other) {
7529
      if (other.isSetPex()) {
7530
        this.pex = new PromotionException(other.pex);
7531
      }
7532
    }
7533
 
7534
    public generateCouponsForPromotion_result deepCopy() {
7535
      return new generateCouponsForPromotion_result(this);
7536
    }
7537
 
3430 rajveer 7538
    @Override
7539
    public void clear() {
7540
      this.pex = null;
1982 varun.gupt 7541
    }
7542
 
7543
    public PromotionException getPex() {
7544
      return this.pex;
7545
    }
7546
 
3430 rajveer 7547
    public void setPex(PromotionException pex) {
1982 varun.gupt 7548
      this.pex = pex;
7549
    }
7550
 
7551
    public void unsetPex() {
7552
      this.pex = null;
7553
    }
7554
 
3430 rajveer 7555
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7556
    public boolean isSetPex() {
7557
      return this.pex != null;
7558
    }
7559
 
7560
    public void setPexIsSet(boolean value) {
7561
      if (!value) {
7562
        this.pex = null;
7563
      }
7564
    }
7565
 
7566
    public void setFieldValue(_Fields field, Object value) {
7567
      switch (field) {
7568
      case PEX:
7569
        if (value == null) {
7570
          unsetPex();
7571
        } else {
7572
          setPex((PromotionException)value);
7573
        }
7574
        break;
7575
 
7576
      }
7577
    }
7578
 
7579
    public Object getFieldValue(_Fields field) {
7580
      switch (field) {
7581
      case PEX:
7582
        return getPex();
7583
 
7584
      }
7585
      throw new IllegalStateException();
7586
    }
7587
 
3430 rajveer 7588
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7589
    public boolean isSet(_Fields field) {
7590
      if (field == null) {
7591
        throw new IllegalArgumentException();
7592
      }
1982 varun.gupt 7593
 
7594
      switch (field) {
7595
      case PEX:
7596
        return isSetPex();
7597
      }
7598
      throw new IllegalStateException();
7599
    }
7600
 
7601
    @Override
7602
    public boolean equals(Object that) {
7603
      if (that == null)
7604
        return false;
7605
      if (that instanceof generateCouponsForPromotion_result)
7606
        return this.equals((generateCouponsForPromotion_result)that);
7607
      return false;
7608
    }
7609
 
7610
    public boolean equals(generateCouponsForPromotion_result that) {
7611
      if (that == null)
7612
        return false;
7613
 
7614
      boolean this_present_pex = true && this.isSetPex();
7615
      boolean that_present_pex = true && that.isSetPex();
7616
      if (this_present_pex || that_present_pex) {
7617
        if (!(this_present_pex && that_present_pex))
7618
          return false;
7619
        if (!this.pex.equals(that.pex))
7620
          return false;
7621
      }
7622
 
7623
      return true;
7624
    }
7625
 
7626
    @Override
7627
    public int hashCode() {
7628
      return 0;
7629
    }
7630
 
7631
    public int compareTo(generateCouponsForPromotion_result other) {
7632
      if (!getClass().equals(other.getClass())) {
7633
        return getClass().getName().compareTo(other.getClass().getName());
7634
      }
7635
 
7636
      int lastComparison = 0;
7637
      generateCouponsForPromotion_result typedOther = (generateCouponsForPromotion_result)other;
7638
 
3430 rajveer 7639
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 7640
      if (lastComparison != 0) {
7641
        return lastComparison;
7642
      }
3430 rajveer 7643
      if (isSetPex()) {
7644
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
7645
        if (lastComparison != 0) {
7646
          return lastComparison;
7647
        }
1982 varun.gupt 7648
      }
7649
      return 0;
7650
    }
7651
 
3430 rajveer 7652
    public _Fields fieldForId(int fieldId) {
7653
      return _Fields.findByThriftId(fieldId);
7654
    }
7655
 
7656
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7657
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 7658
      iprot.readStructBegin();
7659
      while (true)
7660
      {
7661
        field = iprot.readFieldBegin();
3430 rajveer 7662
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 7663
          break;
7664
        }
3430 rajveer 7665
        switch (field.id) {
7666
          case 1: // PEX
7667
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
7668
              this.pex = new PromotionException();
7669
              this.pex.read(iprot);
7670
            } else { 
7671
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7672
            }
7673
            break;
7674
          default:
7675
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 7676
        }
3430 rajveer 7677
        iprot.readFieldEnd();
1982 varun.gupt 7678
      }
7679
      iprot.readStructEnd();
7680
      validate();
7681
    }
7682
 
3430 rajveer 7683
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 7684
      oprot.writeStructBegin(STRUCT_DESC);
7685
 
7686
      if (this.isSetPex()) {
7687
        oprot.writeFieldBegin(PEX_FIELD_DESC);
7688
        this.pex.write(oprot);
7689
        oprot.writeFieldEnd();
7690
      }
7691
      oprot.writeFieldStop();
7692
      oprot.writeStructEnd();
7693
    }
7694
 
7695
    @Override
7696
    public String toString() {
7697
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_result(");
7698
      boolean first = true;
7699
 
7700
      sb.append("pex:");
7701
      if (this.pex == null) {
7702
        sb.append("null");
7703
      } else {
7704
        sb.append(this.pex);
7705
      }
7706
      first = false;
7707
      sb.append(")");
7708
      return sb.toString();
7709
    }
7710
 
3430 rajveer 7711
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7712
      // check for required fields
7713
    }
7714
 
3430 rajveer 7715
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7716
      try {
7717
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7718
      } catch (org.apache.thrift.TException te) {
7719
        throw new java.io.IOException(te);
7720
      }
7721
    }
7722
 
7723
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7724
      try {
7725
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7726
      } catch (org.apache.thrift.TException te) {
7727
        throw new java.io.IOException(te);
7728
      }
7729
    }
7730
 
1982 varun.gupt 7731
  }
7732
 
3430 rajveer 7733
  public static class applyCoupon_args implements org.apache.thrift.TBase<applyCoupon_args, applyCoupon_args._Fields>, java.io.Serializable, Cloneable   {
7734
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_args");
1982 varun.gupt 7735
 
3430 rajveer 7736
    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);
7737
    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 7738
 
3430 rajveer 7739
    private String couponCode; // required
7740
    private long cartId; // required
1982 varun.gupt 7741
 
7742
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7743
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 7744
      COUPON_CODE((short)1, "couponCode"),
7745
      CART_ID((short)2, "cartId");
7746
 
7747
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7748
 
7749
      static {
7750
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7751
          byName.put(field.getFieldName(), field);
7752
        }
7753
      }
7754
 
7755
      /**
7756
       * Find the _Fields constant that matches fieldId, or null if its not found.
7757
       */
7758
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7759
        switch(fieldId) {
7760
          case 1: // COUPON_CODE
7761
            return COUPON_CODE;
7762
          case 2: // CART_ID
7763
            return CART_ID;
7764
          default:
7765
            return null;
7766
        }
1982 varun.gupt 7767
      }
7768
 
7769
      /**
7770
       * Find the _Fields constant that matches fieldId, throwing an exception
7771
       * if it is not found.
7772
       */
7773
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7774
        _Fields fields = findByThriftId(fieldId);
7775
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7776
        return fields;
7777
      }
7778
 
7779
      /**
7780
       * Find the _Fields constant that matches name, or null if its not found.
7781
       */
7782
      public static _Fields findByName(String name) {
7783
        return byName.get(name);
7784
      }
7785
 
7786
      private final short _thriftId;
7787
      private final String _fieldName;
7788
 
7789
      _Fields(short thriftId, String fieldName) {
7790
        _thriftId = thriftId;
7791
        _fieldName = fieldName;
7792
      }
7793
 
7794
      public short getThriftFieldId() {
7795
        return _thriftId;
7796
      }
7797
 
7798
      public String getFieldName() {
7799
        return _fieldName;
7800
      }
7801
    }
7802
 
7803
    // isset id assignments
7804
    private static final int __CARTID_ISSET_ID = 0;
7805
    private BitSet __isset_bit_vector = new BitSet(1);
7806
 
3430 rajveer 7807
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 7808
    static {
3430 rajveer 7809
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7810
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7811
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
7812
      tmpMap.put(_Fields.CART_ID, new org.apache.thrift.meta_data.FieldMetaData("cartId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7813
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7814
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7815
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_args.class, metaDataMap);
1982 varun.gupt 7816
    }
7817
 
7818
    public applyCoupon_args() {
7819
    }
7820
 
7821
    public applyCoupon_args(
7822
      String couponCode,
7823
      long cartId)
7824
    {
7825
      this();
7826
      this.couponCode = couponCode;
7827
      this.cartId = cartId;
7828
      setCartIdIsSet(true);
7829
    }
7830
 
7831
    /**
7832
     * Performs a deep copy on <i>other</i>.
7833
     */
7834
    public applyCoupon_args(applyCoupon_args other) {
7835
      __isset_bit_vector.clear();
7836
      __isset_bit_vector.or(other.__isset_bit_vector);
7837
      if (other.isSetCouponCode()) {
7838
        this.couponCode = other.couponCode;
7839
      }
7840
      this.cartId = other.cartId;
7841
    }
7842
 
7843
    public applyCoupon_args deepCopy() {
7844
      return new applyCoupon_args(this);
7845
    }
7846
 
3430 rajveer 7847
    @Override
7848
    public void clear() {
7849
      this.couponCode = null;
7850
      setCartIdIsSet(false);
7851
      this.cartId = 0;
1982 varun.gupt 7852
    }
7853
 
7854
    public String getCouponCode() {
7855
      return this.couponCode;
7856
    }
7857
 
3430 rajveer 7858
    public void setCouponCode(String couponCode) {
1982 varun.gupt 7859
      this.couponCode = couponCode;
7860
    }
7861
 
7862
    public void unsetCouponCode() {
7863
      this.couponCode = null;
7864
    }
7865
 
3430 rajveer 7866
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7867
    public boolean isSetCouponCode() {
7868
      return this.couponCode != null;
7869
    }
7870
 
7871
    public void setCouponCodeIsSet(boolean value) {
7872
      if (!value) {
7873
        this.couponCode = null;
7874
      }
7875
    }
7876
 
7877
    public long getCartId() {
7878
      return this.cartId;
7879
    }
7880
 
3430 rajveer 7881
    public void setCartId(long cartId) {
1982 varun.gupt 7882
      this.cartId = cartId;
7883
      setCartIdIsSet(true);
7884
    }
7885
 
7886
    public void unsetCartId() {
7887
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
7888
    }
7889
 
3430 rajveer 7890
    /** Returns true if field cartId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7891
    public boolean isSetCartId() {
7892
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
7893
    }
7894
 
7895
    public void setCartIdIsSet(boolean value) {
7896
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
7897
    }
7898
 
7899
    public void setFieldValue(_Fields field, Object value) {
7900
      switch (field) {
7901
      case COUPON_CODE:
7902
        if (value == null) {
7903
          unsetCouponCode();
7904
        } else {
7905
          setCouponCode((String)value);
7906
        }
7907
        break;
7908
 
7909
      case CART_ID:
7910
        if (value == null) {
7911
          unsetCartId();
7912
        } else {
7913
          setCartId((Long)value);
7914
        }
7915
        break;
7916
 
7917
      }
7918
    }
7919
 
7920
    public Object getFieldValue(_Fields field) {
7921
      switch (field) {
7922
      case COUPON_CODE:
7923
        return getCouponCode();
7924
 
7925
      case CART_ID:
3430 rajveer 7926
        return Long.valueOf(getCartId());
1982 varun.gupt 7927
 
7928
      }
7929
      throw new IllegalStateException();
7930
    }
7931
 
3430 rajveer 7932
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7933
    public boolean isSet(_Fields field) {
7934
      if (field == null) {
7935
        throw new IllegalArgumentException();
7936
      }
1982 varun.gupt 7937
 
7938
      switch (field) {
7939
      case COUPON_CODE:
7940
        return isSetCouponCode();
7941
      case CART_ID:
7942
        return isSetCartId();
7943
      }
7944
      throw new IllegalStateException();
7945
    }
7946
 
7947
    @Override
7948
    public boolean equals(Object that) {
7949
      if (that == null)
7950
        return false;
7951
      if (that instanceof applyCoupon_args)
7952
        return this.equals((applyCoupon_args)that);
7953
      return false;
7954
    }
7955
 
7956
    public boolean equals(applyCoupon_args that) {
7957
      if (that == null)
7958
        return false;
7959
 
7960
      boolean this_present_couponCode = true && this.isSetCouponCode();
7961
      boolean that_present_couponCode = true && that.isSetCouponCode();
7962
      if (this_present_couponCode || that_present_couponCode) {
7963
        if (!(this_present_couponCode && that_present_couponCode))
7964
          return false;
7965
        if (!this.couponCode.equals(that.couponCode))
7966
          return false;
7967
      }
7968
 
7969
      boolean this_present_cartId = true;
7970
      boolean that_present_cartId = true;
7971
      if (this_present_cartId || that_present_cartId) {
7972
        if (!(this_present_cartId && that_present_cartId))
7973
          return false;
7974
        if (this.cartId != that.cartId)
7975
          return false;
7976
      }
7977
 
7978
      return true;
7979
    }
7980
 
7981
    @Override
7982
    public int hashCode() {
7983
      return 0;
7984
    }
7985
 
7986
    public int compareTo(applyCoupon_args other) {
7987
      if (!getClass().equals(other.getClass())) {
7988
        return getClass().getName().compareTo(other.getClass().getName());
7989
      }
7990
 
7991
      int lastComparison = 0;
7992
      applyCoupon_args typedOther = (applyCoupon_args)other;
7993
 
3430 rajveer 7994
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 7995
      if (lastComparison != 0) {
7996
        return lastComparison;
7997
      }
3430 rajveer 7998
      if (isSetCouponCode()) {
7999
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
8000
        if (lastComparison != 0) {
8001
          return lastComparison;
8002
        }
1982 varun.gupt 8003
      }
3430 rajveer 8004
      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(typedOther.isSetCartId());
1982 varun.gupt 8005
      if (lastComparison != 0) {
8006
        return lastComparison;
8007
      }
3430 rajveer 8008
      if (isSetCartId()) {
8009
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cartId, typedOther.cartId);
8010
        if (lastComparison != 0) {
8011
          return lastComparison;
8012
        }
1982 varun.gupt 8013
      }
8014
      return 0;
8015
    }
8016
 
3430 rajveer 8017
    public _Fields fieldForId(int fieldId) {
8018
      return _Fields.findByThriftId(fieldId);
8019
    }
8020
 
8021
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8022
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 8023
      iprot.readStructBegin();
8024
      while (true)
8025
      {
8026
        field = iprot.readFieldBegin();
3430 rajveer 8027
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 8028
          break;
8029
        }
3430 rajveer 8030
        switch (field.id) {
8031
          case 1: // COUPON_CODE
8032
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
8033
              this.couponCode = iprot.readString();
8034
            } else { 
8035
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8036
            }
8037
            break;
8038
          case 2: // CART_ID
8039
            if (field.type == org.apache.thrift.protocol.TType.I64) {
8040
              this.cartId = iprot.readI64();
8041
              setCartIdIsSet(true);
8042
            } else { 
8043
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8044
            }
8045
            break;
8046
          default:
8047
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 8048
        }
3430 rajveer 8049
        iprot.readFieldEnd();
1982 varun.gupt 8050
      }
8051
      iprot.readStructEnd();
8052
      validate();
8053
    }
8054
 
3430 rajveer 8055
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 8056
      validate();
8057
 
8058
      oprot.writeStructBegin(STRUCT_DESC);
8059
      if (this.couponCode != null) {
8060
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
8061
        oprot.writeString(this.couponCode);
8062
        oprot.writeFieldEnd();
8063
      }
8064
      oprot.writeFieldBegin(CART_ID_FIELD_DESC);
8065
      oprot.writeI64(this.cartId);
8066
      oprot.writeFieldEnd();
8067
      oprot.writeFieldStop();
8068
      oprot.writeStructEnd();
8069
    }
8070
 
8071
    @Override
8072
    public String toString() {
8073
      StringBuilder sb = new StringBuilder("applyCoupon_args(");
8074
      boolean first = true;
8075
 
8076
      sb.append("couponCode:");
8077
      if (this.couponCode == null) {
8078
        sb.append("null");
8079
      } else {
8080
        sb.append(this.couponCode);
8081
      }
8082
      first = false;
8083
      if (!first) sb.append(", ");
8084
      sb.append("cartId:");
8085
      sb.append(this.cartId);
8086
      first = false;
8087
      sb.append(")");
8088
      return sb.toString();
8089
    }
8090
 
3430 rajveer 8091
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 8092
      // check for required fields
8093
    }
8094
 
3430 rajveer 8095
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8096
      try {
8097
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8098
      } catch (org.apache.thrift.TException te) {
8099
        throw new java.io.IOException(te);
8100
      }
8101
    }
8102
 
8103
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8104
      try {
8105
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
8106
        __isset_bit_vector = new BitSet(1);
8107
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8108
      } catch (org.apache.thrift.TException te) {
8109
        throw new java.io.IOException(te);
8110
      }
8111
    }
8112
 
1982 varun.gupt 8113
  }
8114
 
3430 rajveer 8115
  public static class applyCoupon_result implements org.apache.thrift.TBase<applyCoupon_result, applyCoupon_result._Fields>, java.io.Serializable, Cloneable   {
8116
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_result");
1982 varun.gupt 8117
 
3430 rajveer 8118
    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);
8119
    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 8120
 
3430 rajveer 8121
    private Cart success; // required
8122
    private PromotionException pex; // required
1982 varun.gupt 8123
 
8124
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 8125
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 8126
      SUCCESS((short)0, "success"),
8127
      PEX((short)1, "pex");
8128
 
8129
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8130
 
8131
      static {
8132
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8133
          byName.put(field.getFieldName(), field);
8134
        }
8135
      }
8136
 
8137
      /**
8138
       * Find the _Fields constant that matches fieldId, or null if its not found.
8139
       */
8140
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 8141
        switch(fieldId) {
8142
          case 0: // SUCCESS
8143
            return SUCCESS;
8144
          case 1: // PEX
8145
            return PEX;
8146
          default:
8147
            return null;
8148
        }
1982 varun.gupt 8149
      }
8150
 
8151
      /**
8152
       * Find the _Fields constant that matches fieldId, throwing an exception
8153
       * if it is not found.
8154
       */
8155
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8156
        _Fields fields = findByThriftId(fieldId);
8157
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8158
        return fields;
8159
      }
8160
 
8161
      /**
8162
       * Find the _Fields constant that matches name, or null if its not found.
8163
       */
8164
      public static _Fields findByName(String name) {
8165
        return byName.get(name);
8166
      }
8167
 
8168
      private final short _thriftId;
8169
      private final String _fieldName;
8170
 
8171
      _Fields(short thriftId, String fieldName) {
8172
        _thriftId = thriftId;
8173
        _fieldName = fieldName;
8174
      }
8175
 
8176
      public short getThriftFieldId() {
8177
        return _thriftId;
8178
      }
8179
 
8180
      public String getFieldName() {
8181
        return _fieldName;
8182
      }
8183
    }
8184
 
8185
    // isset id assignments
8186
 
3430 rajveer 8187
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 8188
    static {
3430 rajveer 8189
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8190
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8191
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Cart.class)));
8192
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8193
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
8194
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8195
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_result.class, metaDataMap);
1982 varun.gupt 8196
    }
8197
 
8198
    public applyCoupon_result() {
8199
    }
8200
 
8201
    public applyCoupon_result(
8202
      Cart success,
8203
      PromotionException pex)
8204
    {
8205
      this();
8206
      this.success = success;
8207
      this.pex = pex;
8208
    }
8209
 
8210
    /**
8211
     * Performs a deep copy on <i>other</i>.
8212
     */
8213
    public applyCoupon_result(applyCoupon_result other) {
8214
      if (other.isSetSuccess()) {
8215
        this.success = new Cart(other.success);
8216
      }
8217
      if (other.isSetPex()) {
8218
        this.pex = new PromotionException(other.pex);
8219
      }
8220
    }
8221
 
8222
    public applyCoupon_result deepCopy() {
8223
      return new applyCoupon_result(this);
8224
    }
8225
 
3430 rajveer 8226
    @Override
8227
    public void clear() {
8228
      this.success = null;
8229
      this.pex = null;
1982 varun.gupt 8230
    }
8231
 
8232
    public Cart getSuccess() {
8233
      return this.success;
8234
    }
8235
 
3430 rajveer 8236
    public void setSuccess(Cart success) {
1982 varun.gupt 8237
      this.success = success;
8238
    }
8239
 
8240
    public void unsetSuccess() {
8241
      this.success = null;
8242
    }
8243
 
3430 rajveer 8244
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 8245
    public boolean isSetSuccess() {
8246
      return this.success != null;
8247
    }
8248
 
8249
    public void setSuccessIsSet(boolean value) {
8250
      if (!value) {
8251
        this.success = null;
8252
      }
8253
    }
8254
 
8255
    public PromotionException getPex() {
8256
      return this.pex;
8257
    }
8258
 
3430 rajveer 8259
    public void setPex(PromotionException pex) {
1982 varun.gupt 8260
      this.pex = pex;
8261
    }
8262
 
8263
    public void unsetPex() {
8264
      this.pex = null;
8265
    }
8266
 
3430 rajveer 8267
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 8268
    public boolean isSetPex() {
8269
      return this.pex != null;
8270
    }
8271
 
8272
    public void setPexIsSet(boolean value) {
8273
      if (!value) {
8274
        this.pex = null;
8275
      }
8276
    }
8277
 
8278
    public void setFieldValue(_Fields field, Object value) {
8279
      switch (field) {
8280
      case SUCCESS:
8281
        if (value == null) {
8282
          unsetSuccess();
8283
        } else {
8284
          setSuccess((Cart)value);
8285
        }
8286
        break;
8287
 
8288
      case PEX:
8289
        if (value == null) {
8290
          unsetPex();
8291
        } else {
8292
          setPex((PromotionException)value);
8293
        }
8294
        break;
8295
 
8296
      }
8297
    }
8298
 
8299
    public Object getFieldValue(_Fields field) {
8300
      switch (field) {
8301
      case SUCCESS:
8302
        return getSuccess();
8303
 
8304
      case PEX:
8305
        return getPex();
8306
 
8307
      }
8308
      throw new IllegalStateException();
8309
    }
8310
 
3430 rajveer 8311
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8312
    public boolean isSet(_Fields field) {
8313
      if (field == null) {
8314
        throw new IllegalArgumentException();
8315
      }
1982 varun.gupt 8316
 
8317
      switch (field) {
8318
      case SUCCESS:
8319
        return isSetSuccess();
8320
      case PEX:
8321
        return isSetPex();
8322
      }
8323
      throw new IllegalStateException();
8324
    }
8325
 
8326
    @Override
8327
    public boolean equals(Object that) {
8328
      if (that == null)
8329
        return false;
8330
      if (that instanceof applyCoupon_result)
8331
        return this.equals((applyCoupon_result)that);
8332
      return false;
8333
    }
8334
 
8335
    public boolean equals(applyCoupon_result that) {
8336
      if (that == null)
8337
        return false;
8338
 
8339
      boolean this_present_success = true && this.isSetSuccess();
8340
      boolean that_present_success = true && that.isSetSuccess();
8341
      if (this_present_success || that_present_success) {
8342
        if (!(this_present_success && that_present_success))
8343
          return false;
8344
        if (!this.success.equals(that.success))
8345
          return false;
8346
      }
8347
 
8348
      boolean this_present_pex = true && this.isSetPex();
8349
      boolean that_present_pex = true && that.isSetPex();
8350
      if (this_present_pex || that_present_pex) {
8351
        if (!(this_present_pex && that_present_pex))
8352
          return false;
8353
        if (!this.pex.equals(that.pex))
8354
          return false;
8355
      }
8356
 
8357
      return true;
8358
    }
8359
 
8360
    @Override
8361
    public int hashCode() {
8362
      return 0;
8363
    }
8364
 
8365
    public int compareTo(applyCoupon_result other) {
8366
      if (!getClass().equals(other.getClass())) {
8367
        return getClass().getName().compareTo(other.getClass().getName());
8368
      }
8369
 
8370
      int lastComparison = 0;
8371
      applyCoupon_result typedOther = (applyCoupon_result)other;
8372
 
3430 rajveer 8373
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 8374
      if (lastComparison != 0) {
8375
        return lastComparison;
8376
      }
3430 rajveer 8377
      if (isSetSuccess()) {
8378
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
8379
        if (lastComparison != 0) {
8380
          return lastComparison;
8381
        }
1982 varun.gupt 8382
      }
3430 rajveer 8383
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 8384
      if (lastComparison != 0) {
8385
        return lastComparison;
8386
      }
3430 rajveer 8387
      if (isSetPex()) {
8388
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
8389
        if (lastComparison != 0) {
8390
          return lastComparison;
8391
        }
1982 varun.gupt 8392
      }
8393
      return 0;
8394
    }
8395
 
3430 rajveer 8396
    public _Fields fieldForId(int fieldId) {
8397
      return _Fields.findByThriftId(fieldId);
8398
    }
8399
 
8400
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8401
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 8402
      iprot.readStructBegin();
8403
      while (true)
8404
      {
8405
        field = iprot.readFieldBegin();
3430 rajveer 8406
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 8407
          break;
8408
        }
3430 rajveer 8409
        switch (field.id) {
8410
          case 0: // SUCCESS
8411
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
8412
              this.success = new Cart();
8413
              this.success.read(iprot);
8414
            } else { 
8415
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8416
            }
8417
            break;
8418
          case 1: // PEX
8419
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
8420
              this.pex = new PromotionException();
8421
              this.pex.read(iprot);
8422
            } else { 
8423
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8424
            }
8425
            break;
8426
          default:
8427
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 8428
        }
3430 rajveer 8429
        iprot.readFieldEnd();
1982 varun.gupt 8430
      }
8431
      iprot.readStructEnd();
8432
      validate();
8433
    }
8434
 
3430 rajveer 8435
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 8436
      oprot.writeStructBegin(STRUCT_DESC);
8437
 
8438
      if (this.isSetSuccess()) {
8439
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
8440
        this.success.write(oprot);
8441
        oprot.writeFieldEnd();
8442
      } else if (this.isSetPex()) {
8443
        oprot.writeFieldBegin(PEX_FIELD_DESC);
8444
        this.pex.write(oprot);
8445
        oprot.writeFieldEnd();
8446
      }
8447
      oprot.writeFieldStop();
8448
      oprot.writeStructEnd();
8449
    }
8450
 
8451
    @Override
8452
    public String toString() {
8453
      StringBuilder sb = new StringBuilder("applyCoupon_result(");
8454
      boolean first = true;
8455
 
8456
      sb.append("success:");
8457
      if (this.success == null) {
8458
        sb.append("null");
8459
      } else {
8460
        sb.append(this.success);
8461
      }
8462
      first = false;
8463
      if (!first) sb.append(", ");
8464
      sb.append("pex:");
8465
      if (this.pex == null) {
8466
        sb.append("null");
8467
      } else {
8468
        sb.append(this.pex);
8469
      }
8470
      first = false;
8471
      sb.append(")");
8472
      return sb.toString();
8473
    }
8474
 
3430 rajveer 8475
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 8476
      // check for required fields
8477
    }
8478
 
3430 rajveer 8479
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8480
      try {
8481
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8482
      } catch (org.apache.thrift.TException te) {
8483
        throw new java.io.IOException(te);
8484
      }
8485
    }
8486
 
8487
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8488
      try {
8489
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8490
      } catch (org.apache.thrift.TException te) {
8491
        throw new java.io.IOException(te);
8492
      }
8493
    }
8494
 
1982 varun.gupt 8495
  }
8496
 
6736 amit.gupta 8497
  public static class getEmiDiscount_args implements org.apache.thrift.TBase<getEmiDiscount_args, getEmiDiscount_args._Fields>, java.io.Serializable, Cloneable   {
8498
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getEmiDiscount_args");
8499
 
8500
    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);
8501
 
8502
    private long cartId; // required
8503
 
8504
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8505
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
8506
      CART_ID((short)1, "cartId");
8507
 
8508
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8509
 
8510
      static {
8511
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8512
          byName.put(field.getFieldName(), field);
8513
        }
8514
      }
8515
 
8516
      /**
8517
       * Find the _Fields constant that matches fieldId, or null if its not found.
8518
       */
8519
      public static _Fields findByThriftId(int fieldId) {
8520
        switch(fieldId) {
8521
          case 1: // CART_ID
8522
            return CART_ID;
8523
          default:
8524
            return null;
8525
        }
8526
      }
8527
 
8528
      /**
8529
       * Find the _Fields constant that matches fieldId, throwing an exception
8530
       * if it is not found.
8531
       */
8532
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8533
        _Fields fields = findByThriftId(fieldId);
8534
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8535
        return fields;
8536
      }
8537
 
8538
      /**
8539
       * Find the _Fields constant that matches name, or null if its not found.
8540
       */
8541
      public static _Fields findByName(String name) {
8542
        return byName.get(name);
8543
      }
8544
 
8545
      private final short _thriftId;
8546
      private final String _fieldName;
8547
 
8548
      _Fields(short thriftId, String fieldName) {
8549
        _thriftId = thriftId;
8550
        _fieldName = fieldName;
8551
      }
8552
 
8553
      public short getThriftFieldId() {
8554
        return _thriftId;
8555
      }
8556
 
8557
      public String getFieldName() {
8558
        return _fieldName;
8559
      }
8560
    }
8561
 
8562
    // isset id assignments
8563
    private static final int __CARTID_ISSET_ID = 0;
8564
    private BitSet __isset_bit_vector = new BitSet(1);
8565
 
8566
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
8567
    static {
8568
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8569
      tmpMap.put(_Fields.CART_ID, new org.apache.thrift.meta_data.FieldMetaData("cartId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8570
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8571
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8572
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getEmiDiscount_args.class, metaDataMap);
8573
    }
8574
 
8575
    public getEmiDiscount_args() {
8576
    }
8577
 
8578
    public getEmiDiscount_args(
8579
      long cartId)
8580
    {
8581
      this();
8582
      this.cartId = cartId;
8583
      setCartIdIsSet(true);
8584
    }
8585
 
8586
    /**
8587
     * Performs a deep copy on <i>other</i>.
8588
     */
8589
    public getEmiDiscount_args(getEmiDiscount_args other) {
8590
      __isset_bit_vector.clear();
8591
      __isset_bit_vector.or(other.__isset_bit_vector);
8592
      this.cartId = other.cartId;
8593
    }
8594
 
8595
    public getEmiDiscount_args deepCopy() {
8596
      return new getEmiDiscount_args(this);
8597
    }
8598
 
8599
    @Override
8600
    public void clear() {
8601
      setCartIdIsSet(false);
8602
      this.cartId = 0;
8603
    }
8604
 
8605
    public long getCartId() {
8606
      return this.cartId;
8607
    }
8608
 
8609
    public void setCartId(long cartId) {
8610
      this.cartId = cartId;
8611
      setCartIdIsSet(true);
8612
    }
8613
 
8614
    public void unsetCartId() {
8615
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
8616
    }
8617
 
8618
    /** Returns true if field cartId is set (has been assigned a value) and false otherwise */
8619
    public boolean isSetCartId() {
8620
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
8621
    }
8622
 
8623
    public void setCartIdIsSet(boolean value) {
8624
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
8625
    }
8626
 
8627
    public void setFieldValue(_Fields field, Object value) {
8628
      switch (field) {
8629
      case CART_ID:
8630
        if (value == null) {
8631
          unsetCartId();
8632
        } else {
8633
          setCartId((Long)value);
8634
        }
8635
        break;
8636
 
8637
      }
8638
    }
8639
 
8640
    public Object getFieldValue(_Fields field) {
8641
      switch (field) {
8642
      case CART_ID:
8643
        return Long.valueOf(getCartId());
8644
 
8645
      }
8646
      throw new IllegalStateException();
8647
    }
8648
 
8649
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8650
    public boolean isSet(_Fields field) {
8651
      if (field == null) {
8652
        throw new IllegalArgumentException();
8653
      }
8654
 
8655
      switch (field) {
8656
      case CART_ID:
8657
        return isSetCartId();
8658
      }
8659
      throw new IllegalStateException();
8660
    }
8661
 
8662
    @Override
8663
    public boolean equals(Object that) {
8664
      if (that == null)
8665
        return false;
8666
      if (that instanceof getEmiDiscount_args)
8667
        return this.equals((getEmiDiscount_args)that);
8668
      return false;
8669
    }
8670
 
8671
    public boolean equals(getEmiDiscount_args that) {
8672
      if (that == null)
8673
        return false;
8674
 
8675
      boolean this_present_cartId = true;
8676
      boolean that_present_cartId = true;
8677
      if (this_present_cartId || that_present_cartId) {
8678
        if (!(this_present_cartId && that_present_cartId))
8679
          return false;
8680
        if (this.cartId != that.cartId)
8681
          return false;
8682
      }
8683
 
8684
      return true;
8685
    }
8686
 
8687
    @Override
8688
    public int hashCode() {
8689
      return 0;
8690
    }
8691
 
8692
    public int compareTo(getEmiDiscount_args other) {
8693
      if (!getClass().equals(other.getClass())) {
8694
        return getClass().getName().compareTo(other.getClass().getName());
8695
      }
8696
 
8697
      int lastComparison = 0;
8698
      getEmiDiscount_args typedOther = (getEmiDiscount_args)other;
8699
 
8700
      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(typedOther.isSetCartId());
8701
      if (lastComparison != 0) {
8702
        return lastComparison;
8703
      }
8704
      if (isSetCartId()) {
8705
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cartId, typedOther.cartId);
8706
        if (lastComparison != 0) {
8707
          return lastComparison;
8708
        }
8709
      }
8710
      return 0;
8711
    }
8712
 
8713
    public _Fields fieldForId(int fieldId) {
8714
      return _Fields.findByThriftId(fieldId);
8715
    }
8716
 
8717
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8718
      org.apache.thrift.protocol.TField field;
8719
      iprot.readStructBegin();
8720
      while (true)
8721
      {
8722
        field = iprot.readFieldBegin();
8723
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
8724
          break;
8725
        }
8726
        switch (field.id) {
8727
          case 1: // CART_ID
8728
            if (field.type == org.apache.thrift.protocol.TType.I64) {
8729
              this.cartId = iprot.readI64();
8730
              setCartIdIsSet(true);
8731
            } else { 
8732
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8733
            }
8734
            break;
8735
          default:
8736
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8737
        }
8738
        iprot.readFieldEnd();
8739
      }
8740
      iprot.readStructEnd();
8741
      validate();
8742
    }
8743
 
8744
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
8745
      validate();
8746
 
8747
      oprot.writeStructBegin(STRUCT_DESC);
8748
      oprot.writeFieldBegin(CART_ID_FIELD_DESC);
8749
      oprot.writeI64(this.cartId);
8750
      oprot.writeFieldEnd();
8751
      oprot.writeFieldStop();
8752
      oprot.writeStructEnd();
8753
    }
8754
 
8755
    @Override
8756
    public String toString() {
8757
      StringBuilder sb = new StringBuilder("getEmiDiscount_args(");
8758
      boolean first = true;
8759
 
8760
      sb.append("cartId:");
8761
      sb.append(this.cartId);
8762
      first = false;
8763
      sb.append(")");
8764
      return sb.toString();
8765
    }
8766
 
8767
    public void validate() throws org.apache.thrift.TException {
8768
      // check for required fields
8769
    }
8770
 
8771
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8772
      try {
8773
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8774
      } catch (org.apache.thrift.TException te) {
8775
        throw new java.io.IOException(te);
8776
      }
8777
    }
8778
 
8779
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8780
      try {
8781
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
8782
        __isset_bit_vector = new BitSet(1);
8783
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8784
      } catch (org.apache.thrift.TException te) {
8785
        throw new java.io.IOException(te);
8786
      }
8787
    }
8788
 
8789
  }
8790
 
8791
  public static class getEmiDiscount_result implements org.apache.thrift.TBase<getEmiDiscount_result, getEmiDiscount_result._Fields>, java.io.Serializable, Cloneable   {
8792
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getEmiDiscount_result");
8793
 
8794
    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);
8795
    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);
8796
 
8797
    private Map<Long,Double> success; // required
8798
    private PromotionException pex; // required
8799
 
8800
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8801
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
8802
      SUCCESS((short)0, "success"),
8803
      PEX((short)1, "pex");
8804
 
8805
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8806
 
8807
      static {
8808
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8809
          byName.put(field.getFieldName(), field);
8810
        }
8811
      }
8812
 
8813
      /**
8814
       * Find the _Fields constant that matches fieldId, or null if its not found.
8815
       */
8816
      public static _Fields findByThriftId(int fieldId) {
8817
        switch(fieldId) {
8818
          case 0: // SUCCESS
8819
            return SUCCESS;
8820
          case 1: // PEX
8821
            return PEX;
8822
          default:
8823
            return null;
8824
        }
8825
      }
8826
 
8827
      /**
8828
       * Find the _Fields constant that matches fieldId, throwing an exception
8829
       * if it is not found.
8830
       */
8831
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8832
        _Fields fields = findByThriftId(fieldId);
8833
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8834
        return fields;
8835
      }
8836
 
8837
      /**
8838
       * Find the _Fields constant that matches name, or null if its not found.
8839
       */
8840
      public static _Fields findByName(String name) {
8841
        return byName.get(name);
8842
      }
8843
 
8844
      private final short _thriftId;
8845
      private final String _fieldName;
8846
 
8847
      _Fields(short thriftId, String fieldName) {
8848
        _thriftId = thriftId;
8849
        _fieldName = fieldName;
8850
      }
8851
 
8852
      public short getThriftFieldId() {
8853
        return _thriftId;
8854
      }
8855
 
8856
      public String getFieldName() {
8857
        return _fieldName;
8858
      }
8859
    }
8860
 
8861
    // isset id assignments
8862
 
8863
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
8864
    static {
8865
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8866
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8867
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
8868
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), 
8869
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
8870
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8871
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
8872
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8873
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getEmiDiscount_result.class, metaDataMap);
8874
    }
8875
 
8876
    public getEmiDiscount_result() {
8877
    }
8878
 
8879
    public getEmiDiscount_result(
8880
      Map<Long,Double> success,
8881
      PromotionException pex)
8882
    {
8883
      this();
8884
      this.success = success;
8885
      this.pex = pex;
8886
    }
8887
 
8888
    /**
8889
     * Performs a deep copy on <i>other</i>.
8890
     */
8891
    public getEmiDiscount_result(getEmiDiscount_result other) {
8892
      if (other.isSetSuccess()) {
8893
        Map<Long,Double> __this__success = new HashMap<Long,Double>();
8894
        for (Map.Entry<Long, Double> other_element : other.success.entrySet()) {
8895
 
8896
          Long other_element_key = other_element.getKey();
8897
          Double other_element_value = other_element.getValue();
8898
 
8899
          Long __this__success_copy_key = other_element_key;
8900
 
8901
          Double __this__success_copy_value = other_element_value;
8902
 
8903
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
8904
        }
8905
        this.success = __this__success;
8906
      }
8907
      if (other.isSetPex()) {
8908
        this.pex = new PromotionException(other.pex);
8909
      }
8910
    }
8911
 
8912
    public getEmiDiscount_result deepCopy() {
8913
      return new getEmiDiscount_result(this);
8914
    }
8915
 
8916
    @Override
8917
    public void clear() {
8918
      this.success = null;
8919
      this.pex = null;
8920
    }
8921
 
8922
    public int getSuccessSize() {
8923
      return (this.success == null) ? 0 : this.success.size();
8924
    }
8925
 
8926
    public void putToSuccess(long key, double val) {
8927
      if (this.success == null) {
8928
        this.success = new HashMap<Long,Double>();
8929
      }
8930
      this.success.put(key, val);
8931
    }
8932
 
8933
    public Map<Long,Double> getSuccess() {
8934
      return this.success;
8935
    }
8936
 
8937
    public void setSuccess(Map<Long,Double> success) {
8938
      this.success = success;
8939
    }
8940
 
8941
    public void unsetSuccess() {
8942
      this.success = null;
8943
    }
8944
 
8945
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
8946
    public boolean isSetSuccess() {
8947
      return this.success != null;
8948
    }
8949
 
8950
    public void setSuccessIsSet(boolean value) {
8951
      if (!value) {
8952
        this.success = null;
8953
      }
8954
    }
8955
 
8956
    public PromotionException getPex() {
8957
      return this.pex;
8958
    }
8959
 
8960
    public void setPex(PromotionException pex) {
8961
      this.pex = pex;
8962
    }
8963
 
8964
    public void unsetPex() {
8965
      this.pex = null;
8966
    }
8967
 
8968
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
8969
    public boolean isSetPex() {
8970
      return this.pex != null;
8971
    }
8972
 
8973
    public void setPexIsSet(boolean value) {
8974
      if (!value) {
8975
        this.pex = null;
8976
      }
8977
    }
8978
 
8979
    public void setFieldValue(_Fields field, Object value) {
8980
      switch (field) {
8981
      case SUCCESS:
8982
        if (value == null) {
8983
          unsetSuccess();
8984
        } else {
8985
          setSuccess((Map<Long,Double>)value);
8986
        }
8987
        break;
8988
 
8989
      case PEX:
8990
        if (value == null) {
8991
          unsetPex();
8992
        } else {
8993
          setPex((PromotionException)value);
8994
        }
8995
        break;
8996
 
8997
      }
8998
    }
8999
 
9000
    public Object getFieldValue(_Fields field) {
9001
      switch (field) {
9002
      case SUCCESS:
9003
        return getSuccess();
9004
 
9005
      case PEX:
9006
        return getPex();
9007
 
9008
      }
9009
      throw new IllegalStateException();
9010
    }
9011
 
9012
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9013
    public boolean isSet(_Fields field) {
9014
      if (field == null) {
9015
        throw new IllegalArgumentException();
9016
      }
9017
 
9018
      switch (field) {
9019
      case SUCCESS:
9020
        return isSetSuccess();
9021
      case PEX:
9022
        return isSetPex();
9023
      }
9024
      throw new IllegalStateException();
9025
    }
9026
 
9027
    @Override
9028
    public boolean equals(Object that) {
9029
      if (that == null)
9030
        return false;
9031
      if (that instanceof getEmiDiscount_result)
9032
        return this.equals((getEmiDiscount_result)that);
9033
      return false;
9034
    }
9035
 
9036
    public boolean equals(getEmiDiscount_result that) {
9037
      if (that == null)
9038
        return false;
9039
 
9040
      boolean this_present_success = true && this.isSetSuccess();
9041
      boolean that_present_success = true && that.isSetSuccess();
9042
      if (this_present_success || that_present_success) {
9043
        if (!(this_present_success && that_present_success))
9044
          return false;
9045
        if (!this.success.equals(that.success))
9046
          return false;
9047
      }
9048
 
9049
      boolean this_present_pex = true && this.isSetPex();
9050
      boolean that_present_pex = true && that.isSetPex();
9051
      if (this_present_pex || that_present_pex) {
9052
        if (!(this_present_pex && that_present_pex))
9053
          return false;
9054
        if (!this.pex.equals(that.pex))
9055
          return false;
9056
      }
9057
 
9058
      return true;
9059
    }
9060
 
9061
    @Override
9062
    public int hashCode() {
9063
      return 0;
9064
    }
9065
 
9066
    public int compareTo(getEmiDiscount_result other) {
9067
      if (!getClass().equals(other.getClass())) {
9068
        return getClass().getName().compareTo(other.getClass().getName());
9069
      }
9070
 
9071
      int lastComparison = 0;
9072
      getEmiDiscount_result typedOther = (getEmiDiscount_result)other;
9073
 
9074
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
9075
      if (lastComparison != 0) {
9076
        return lastComparison;
9077
      }
9078
      if (isSetSuccess()) {
9079
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
9080
        if (lastComparison != 0) {
9081
          return lastComparison;
9082
        }
9083
      }
9084
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
9085
      if (lastComparison != 0) {
9086
        return lastComparison;
9087
      }
9088
      if (isSetPex()) {
9089
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
9090
        if (lastComparison != 0) {
9091
          return lastComparison;
9092
        }
9093
      }
9094
      return 0;
9095
    }
9096
 
9097
    public _Fields fieldForId(int fieldId) {
9098
      return _Fields.findByThriftId(fieldId);
9099
    }
9100
 
9101
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9102
      org.apache.thrift.protocol.TField field;
9103
      iprot.readStructBegin();
9104
      while (true)
9105
      {
9106
        field = iprot.readFieldBegin();
9107
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
9108
          break;
9109
        }
9110
        switch (field.id) {
9111
          case 0: // SUCCESS
9112
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
9113
              {
11592 amit.gupta 9114
                org.apache.thrift.protocol.TMap _map20 = iprot.readMapBegin();
9115
                this.success = new HashMap<Long,Double>(2*_map20.size);
9116
                for (int _i21 = 0; _i21 < _map20.size; ++_i21)
6736 amit.gupta 9117
                {
11592 amit.gupta 9118
                  long _key22; // required
9119
                  double _val23; // required
9120
                  _key22 = iprot.readI64();
9121
                  _val23 = iprot.readDouble();
9122
                  this.success.put(_key22, _val23);
6736 amit.gupta 9123
                }
9124
                iprot.readMapEnd();
9125
              }
9126
            } else { 
9127
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9128
            }
9129
            break;
9130
          case 1: // PEX
9131
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
9132
              this.pex = new PromotionException();
9133
              this.pex.read(iprot);
9134
            } else { 
9135
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9136
            }
9137
            break;
9138
          default:
9139
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9140
        }
9141
        iprot.readFieldEnd();
9142
      }
9143
      iprot.readStructEnd();
9144
      validate();
9145
    }
9146
 
9147
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
9148
      oprot.writeStructBegin(STRUCT_DESC);
9149
 
9150
      if (this.isSetSuccess()) {
9151
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
9152
        {
9153
          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 9154
          for (Map.Entry<Long, Double> _iter24 : this.success.entrySet())
6736 amit.gupta 9155
          {
11592 amit.gupta 9156
            oprot.writeI64(_iter24.getKey());
9157
            oprot.writeDouble(_iter24.getValue());
6736 amit.gupta 9158
          }
9159
          oprot.writeMapEnd();
9160
        }
9161
        oprot.writeFieldEnd();
9162
      } else if (this.isSetPex()) {
9163
        oprot.writeFieldBegin(PEX_FIELD_DESC);
9164
        this.pex.write(oprot);
9165
        oprot.writeFieldEnd();
9166
      }
9167
      oprot.writeFieldStop();
9168
      oprot.writeStructEnd();
9169
    }
9170
 
9171
    @Override
9172
    public String toString() {
9173
      StringBuilder sb = new StringBuilder("getEmiDiscount_result(");
9174
      boolean first = true;
9175
 
9176
      sb.append("success:");
9177
      if (this.success == null) {
9178
        sb.append("null");
9179
      } else {
9180
        sb.append(this.success);
9181
      }
9182
      first = false;
9183
      if (!first) sb.append(", ");
9184
      sb.append("pex:");
9185
      if (this.pex == null) {
9186
        sb.append("null");
9187
      } else {
9188
        sb.append(this.pex);
9189
      }
9190
      first = false;
9191
      sb.append(")");
9192
      return sb.toString();
9193
    }
9194
 
9195
    public void validate() throws org.apache.thrift.TException {
9196
      // check for required fields
9197
    }
9198
 
9199
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9200
      try {
9201
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9202
      } catch (org.apache.thrift.TException te) {
9203
        throw new java.io.IOException(te);
9204
      }
9205
    }
9206
 
9207
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9208
      try {
9209
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9210
      } catch (org.apache.thrift.TException te) {
9211
        throw new java.io.IOException(te);
9212
      }
9213
    }
9214
 
9215
  }
9216
 
6433 anupam.sin 9217
  public static class applyRechargeCoupon_args implements org.apache.thrift.TBase<applyRechargeCoupon_args, applyRechargeCoupon_args._Fields>, java.io.Serializable, Cloneable   {
9218
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyRechargeCoupon_args");
9219
 
9220
    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);
9221
    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);
9222
    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);
9223
 
9224
    private String couponCode; // required
9225
    private long totalAmount; // required
9226
    private long userId; // required
9227
 
9228
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9229
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
9230
      COUPON_CODE((short)1, "couponCode"),
9231
      TOTAL_AMOUNT((short)2, "totalAmount"),
9232
      USER_ID((short)3, "userId");
9233
 
9234
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9235
 
9236
      static {
9237
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9238
          byName.put(field.getFieldName(), field);
9239
        }
9240
      }
9241
 
9242
      /**
9243
       * Find the _Fields constant that matches fieldId, or null if its not found.
9244
       */
9245
      public static _Fields findByThriftId(int fieldId) {
9246
        switch(fieldId) {
9247
          case 1: // COUPON_CODE
9248
            return COUPON_CODE;
9249
          case 2: // TOTAL_AMOUNT
9250
            return TOTAL_AMOUNT;
9251
          case 3: // USER_ID
9252
            return USER_ID;
9253
          default:
9254
            return null;
9255
        }
9256
      }
9257
 
9258
      /**
9259
       * Find the _Fields constant that matches fieldId, throwing an exception
9260
       * if it is not found.
9261
       */
9262
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9263
        _Fields fields = findByThriftId(fieldId);
9264
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9265
        return fields;
9266
      }
9267
 
9268
      /**
9269
       * Find the _Fields constant that matches name, or null if its not found.
9270
       */
9271
      public static _Fields findByName(String name) {
9272
        return byName.get(name);
9273
      }
9274
 
9275
      private final short _thriftId;
9276
      private final String _fieldName;
9277
 
9278
      _Fields(short thriftId, String fieldName) {
9279
        _thriftId = thriftId;
9280
        _fieldName = fieldName;
9281
      }
9282
 
9283
      public short getThriftFieldId() {
9284
        return _thriftId;
9285
      }
9286
 
9287
      public String getFieldName() {
9288
        return _fieldName;
9289
      }
9290
    }
9291
 
9292
    // isset id assignments
9293
    private static final int __TOTALAMOUNT_ISSET_ID = 0;
9294
    private static final int __USERID_ISSET_ID = 1;
9295
    private BitSet __isset_bit_vector = new BitSet(2);
9296
 
9297
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
9298
    static {
9299
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9300
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9301
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
9302
      tmpMap.put(_Fields.TOTAL_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("totalAmount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9303
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9304
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9305
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9306
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9307
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyRechargeCoupon_args.class, metaDataMap);
9308
    }
9309
 
9310
    public applyRechargeCoupon_args() {
9311
    }
9312
 
9313
    public applyRechargeCoupon_args(
9314
      String couponCode,
9315
      long totalAmount,
9316
      long userId)
9317
    {
9318
      this();
9319
      this.couponCode = couponCode;
9320
      this.totalAmount = totalAmount;
9321
      setTotalAmountIsSet(true);
9322
      this.userId = userId;
9323
      setUserIdIsSet(true);
9324
    }
9325
 
9326
    /**
9327
     * Performs a deep copy on <i>other</i>.
9328
     */
9329
    public applyRechargeCoupon_args(applyRechargeCoupon_args other) {
9330
      __isset_bit_vector.clear();
9331
      __isset_bit_vector.or(other.__isset_bit_vector);
9332
      if (other.isSetCouponCode()) {
9333
        this.couponCode = other.couponCode;
9334
      }
9335
      this.totalAmount = other.totalAmount;
9336
      this.userId = other.userId;
9337
    }
9338
 
9339
    public applyRechargeCoupon_args deepCopy() {
9340
      return new applyRechargeCoupon_args(this);
9341
    }
9342
 
9343
    @Override
9344
    public void clear() {
9345
      this.couponCode = null;
9346
      setTotalAmountIsSet(false);
9347
      this.totalAmount = 0;
9348
      setUserIdIsSet(false);
9349
      this.userId = 0;
9350
    }
9351
 
9352
    public String getCouponCode() {
9353
      return this.couponCode;
9354
    }
9355
 
9356
    public void setCouponCode(String couponCode) {
9357
      this.couponCode = couponCode;
9358
    }
9359
 
9360
    public void unsetCouponCode() {
9361
      this.couponCode = null;
9362
    }
9363
 
9364
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
9365
    public boolean isSetCouponCode() {
9366
      return this.couponCode != null;
9367
    }
9368
 
9369
    public void setCouponCodeIsSet(boolean value) {
9370
      if (!value) {
9371
        this.couponCode = null;
9372
      }
9373
    }
9374
 
9375
    public long getTotalAmount() {
9376
      return this.totalAmount;
9377
    }
9378
 
9379
    public void setTotalAmount(long totalAmount) {
9380
      this.totalAmount = totalAmount;
9381
      setTotalAmountIsSet(true);
9382
    }
9383
 
9384
    public void unsetTotalAmount() {
9385
      __isset_bit_vector.clear(__TOTALAMOUNT_ISSET_ID);
9386
    }
9387
 
9388
    /** Returns true if field totalAmount is set (has been assigned a value) and false otherwise */
9389
    public boolean isSetTotalAmount() {
9390
      return __isset_bit_vector.get(__TOTALAMOUNT_ISSET_ID);
9391
    }
9392
 
9393
    public void setTotalAmountIsSet(boolean value) {
9394
      __isset_bit_vector.set(__TOTALAMOUNT_ISSET_ID, value);
9395
    }
9396
 
9397
    public long getUserId() {
9398
      return this.userId;
9399
    }
9400
 
9401
    public void setUserId(long userId) {
9402
      this.userId = userId;
9403
      setUserIdIsSet(true);
9404
    }
9405
 
9406
    public void unsetUserId() {
9407
      __isset_bit_vector.clear(__USERID_ISSET_ID);
9408
    }
9409
 
9410
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
9411
    public boolean isSetUserId() {
9412
      return __isset_bit_vector.get(__USERID_ISSET_ID);
9413
    }
9414
 
9415
    public void setUserIdIsSet(boolean value) {
9416
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
9417
    }
9418
 
9419
    public void setFieldValue(_Fields field, Object value) {
9420
      switch (field) {
9421
      case COUPON_CODE:
9422
        if (value == null) {
9423
          unsetCouponCode();
9424
        } else {
9425
          setCouponCode((String)value);
9426
        }
9427
        break;
9428
 
9429
      case TOTAL_AMOUNT:
9430
        if (value == null) {
9431
          unsetTotalAmount();
9432
        } else {
9433
          setTotalAmount((Long)value);
9434
        }
9435
        break;
9436
 
9437
      case USER_ID:
9438
        if (value == null) {
9439
          unsetUserId();
9440
        } else {
9441
          setUserId((Long)value);
9442
        }
9443
        break;
9444
 
9445
      }
9446
    }
9447
 
9448
    public Object getFieldValue(_Fields field) {
9449
      switch (field) {
9450
      case COUPON_CODE:
9451
        return getCouponCode();
9452
 
9453
      case TOTAL_AMOUNT:
9454
        return Long.valueOf(getTotalAmount());
9455
 
9456
      case USER_ID:
9457
        return Long.valueOf(getUserId());
9458
 
9459
      }
9460
      throw new IllegalStateException();
9461
    }
9462
 
9463
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9464
    public boolean isSet(_Fields field) {
9465
      if (field == null) {
9466
        throw new IllegalArgumentException();
9467
      }
9468
 
9469
      switch (field) {
9470
      case COUPON_CODE:
9471
        return isSetCouponCode();
9472
      case TOTAL_AMOUNT:
9473
        return isSetTotalAmount();
9474
      case USER_ID:
9475
        return isSetUserId();
9476
      }
9477
      throw new IllegalStateException();
9478
    }
9479
 
9480
    @Override
9481
    public boolean equals(Object that) {
9482
      if (that == null)
9483
        return false;
9484
      if (that instanceof applyRechargeCoupon_args)
9485
        return this.equals((applyRechargeCoupon_args)that);
9486
      return false;
9487
    }
9488
 
9489
    public boolean equals(applyRechargeCoupon_args that) {
9490
      if (that == null)
9491
        return false;
9492
 
9493
      boolean this_present_couponCode = true && this.isSetCouponCode();
9494
      boolean that_present_couponCode = true && that.isSetCouponCode();
9495
      if (this_present_couponCode || that_present_couponCode) {
9496
        if (!(this_present_couponCode && that_present_couponCode))
9497
          return false;
9498
        if (!this.couponCode.equals(that.couponCode))
9499
          return false;
9500
      }
9501
 
9502
      boolean this_present_totalAmount = true;
9503
      boolean that_present_totalAmount = true;
9504
      if (this_present_totalAmount || that_present_totalAmount) {
9505
        if (!(this_present_totalAmount && that_present_totalAmount))
9506
          return false;
9507
        if (this.totalAmount != that.totalAmount)
9508
          return false;
9509
      }
9510
 
9511
      boolean this_present_userId = true;
9512
      boolean that_present_userId = true;
9513
      if (this_present_userId || that_present_userId) {
9514
        if (!(this_present_userId && that_present_userId))
9515
          return false;
9516
        if (this.userId != that.userId)
9517
          return false;
9518
      }
9519
 
9520
      return true;
9521
    }
9522
 
9523
    @Override
9524
    public int hashCode() {
9525
      return 0;
9526
    }
9527
 
9528
    public int compareTo(applyRechargeCoupon_args other) {
9529
      if (!getClass().equals(other.getClass())) {
9530
        return getClass().getName().compareTo(other.getClass().getName());
9531
      }
9532
 
9533
      int lastComparison = 0;
9534
      applyRechargeCoupon_args typedOther = (applyRechargeCoupon_args)other;
9535
 
9536
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
9537
      if (lastComparison != 0) {
9538
        return lastComparison;
9539
      }
9540
      if (isSetCouponCode()) {
9541
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
9542
        if (lastComparison != 0) {
9543
          return lastComparison;
9544
        }
9545
      }
9546
      lastComparison = Boolean.valueOf(isSetTotalAmount()).compareTo(typedOther.isSetTotalAmount());
9547
      if (lastComparison != 0) {
9548
        return lastComparison;
9549
      }
9550
      if (isSetTotalAmount()) {
9551
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.totalAmount, typedOther.totalAmount);
9552
        if (lastComparison != 0) {
9553
          return lastComparison;
9554
        }
9555
      }
9556
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
9557
      if (lastComparison != 0) {
9558
        return lastComparison;
9559
      }
9560
      if (isSetUserId()) {
9561
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
9562
        if (lastComparison != 0) {
9563
          return lastComparison;
9564
        }
9565
      }
9566
      return 0;
9567
    }
9568
 
9569
    public _Fields fieldForId(int fieldId) {
9570
      return _Fields.findByThriftId(fieldId);
9571
    }
9572
 
9573
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9574
      org.apache.thrift.protocol.TField field;
9575
      iprot.readStructBegin();
9576
      while (true)
9577
      {
9578
        field = iprot.readFieldBegin();
9579
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
9580
          break;
9581
        }
9582
        switch (field.id) {
9583
          case 1: // COUPON_CODE
9584
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
9585
              this.couponCode = iprot.readString();
9586
            } else { 
9587
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9588
            }
9589
            break;
9590
          case 2: // TOTAL_AMOUNT
9591
            if (field.type == org.apache.thrift.protocol.TType.I64) {
9592
              this.totalAmount = iprot.readI64();
9593
              setTotalAmountIsSet(true);
9594
            } else { 
9595
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9596
            }
9597
            break;
9598
          case 3: // USER_ID
9599
            if (field.type == org.apache.thrift.protocol.TType.I64) {
9600
              this.userId = iprot.readI64();
9601
              setUserIdIsSet(true);
9602
            } else { 
9603
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9604
            }
9605
            break;
9606
          default:
9607
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9608
        }
9609
        iprot.readFieldEnd();
9610
      }
9611
      iprot.readStructEnd();
9612
      validate();
9613
    }
9614
 
9615
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
9616
      validate();
9617
 
9618
      oprot.writeStructBegin(STRUCT_DESC);
9619
      if (this.couponCode != null) {
9620
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
9621
        oprot.writeString(this.couponCode);
9622
        oprot.writeFieldEnd();
9623
      }
9624
      oprot.writeFieldBegin(TOTAL_AMOUNT_FIELD_DESC);
9625
      oprot.writeI64(this.totalAmount);
9626
      oprot.writeFieldEnd();
9627
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
9628
      oprot.writeI64(this.userId);
9629
      oprot.writeFieldEnd();
9630
      oprot.writeFieldStop();
9631
      oprot.writeStructEnd();
9632
    }
9633
 
9634
    @Override
9635
    public String toString() {
9636
      StringBuilder sb = new StringBuilder("applyRechargeCoupon_args(");
9637
      boolean first = true;
9638
 
9639
      sb.append("couponCode:");
9640
      if (this.couponCode == null) {
9641
        sb.append("null");
9642
      } else {
9643
        sb.append(this.couponCode);
9644
      }
9645
      first = false;
9646
      if (!first) sb.append(", ");
9647
      sb.append("totalAmount:");
9648
      sb.append(this.totalAmount);
9649
      first = false;
9650
      if (!first) sb.append(", ");
9651
      sb.append("userId:");
9652
      sb.append(this.userId);
9653
      first = false;
9654
      sb.append(")");
9655
      return sb.toString();
9656
    }
9657
 
9658
    public void validate() throws org.apache.thrift.TException {
9659
      // check for required fields
9660
    }
9661
 
9662
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9663
      try {
9664
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9665
      } catch (org.apache.thrift.TException te) {
9666
        throw new java.io.IOException(te);
9667
      }
9668
    }
9669
 
9670
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9671
      try {
9672
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
9673
        __isset_bit_vector = new BitSet(1);
9674
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9675
      } catch (org.apache.thrift.TException te) {
9676
        throw new java.io.IOException(te);
9677
      }
9678
    }
9679
 
9680
  }
9681
 
9682
  public static class applyRechargeCoupon_result implements org.apache.thrift.TBase<applyRechargeCoupon_result, applyRechargeCoupon_result._Fields>, java.io.Serializable, Cloneable   {
9683
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyRechargeCoupon_result");
9684
 
9685
    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);
9686
    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);
9687
 
9688
    private Map<Long,String> success; // required
9689
    private PromotionException pex; // required
9690
 
9691
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9692
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
9693
      SUCCESS((short)0, "success"),
9694
      PEX((short)1, "pex");
9695
 
9696
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9697
 
9698
      static {
9699
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9700
          byName.put(field.getFieldName(), field);
9701
        }
9702
      }
9703
 
9704
      /**
9705
       * Find the _Fields constant that matches fieldId, or null if its not found.
9706
       */
9707
      public static _Fields findByThriftId(int fieldId) {
9708
        switch(fieldId) {
9709
          case 0: // SUCCESS
9710
            return SUCCESS;
9711
          case 1: // PEX
9712
            return PEX;
9713
          default:
9714
            return null;
9715
        }
9716
      }
9717
 
9718
      /**
9719
       * Find the _Fields constant that matches fieldId, throwing an exception
9720
       * if it is not found.
9721
       */
9722
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9723
        _Fields fields = findByThriftId(fieldId);
9724
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9725
        return fields;
9726
      }
9727
 
9728
      /**
9729
       * Find the _Fields constant that matches name, or null if its not found.
9730
       */
9731
      public static _Fields findByName(String name) {
9732
        return byName.get(name);
9733
      }
9734
 
9735
      private final short _thriftId;
9736
      private final String _fieldName;
9737
 
9738
      _Fields(short thriftId, String fieldName) {
9739
        _thriftId = thriftId;
9740
        _fieldName = fieldName;
9741
      }
9742
 
9743
      public short getThriftFieldId() {
9744
        return _thriftId;
9745
      }
9746
 
9747
      public String getFieldName() {
9748
        return _fieldName;
9749
      }
9750
    }
9751
 
9752
    // isset id assignments
9753
 
9754
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
9755
    static {
9756
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9757
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9758
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
9759
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), 
9760
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
9761
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9762
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
9763
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9764
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyRechargeCoupon_result.class, metaDataMap);
9765
    }
9766
 
9767
    public applyRechargeCoupon_result() {
9768
    }
9769
 
9770
    public applyRechargeCoupon_result(
9771
      Map<Long,String> success,
9772
      PromotionException pex)
9773
    {
9774
      this();
9775
      this.success = success;
9776
      this.pex = pex;
9777
    }
9778
 
9779
    /**
9780
     * Performs a deep copy on <i>other</i>.
9781
     */
9782
    public applyRechargeCoupon_result(applyRechargeCoupon_result other) {
9783
      if (other.isSetSuccess()) {
9784
        Map<Long,String> __this__success = new HashMap<Long,String>();
9785
        for (Map.Entry<Long, String> other_element : other.success.entrySet()) {
9786
 
9787
          Long other_element_key = other_element.getKey();
9788
          String other_element_value = other_element.getValue();
9789
 
9790
          Long __this__success_copy_key = other_element_key;
9791
 
9792
          String __this__success_copy_value = other_element_value;
9793
 
9794
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
9795
        }
9796
        this.success = __this__success;
9797
      }
9798
      if (other.isSetPex()) {
9799
        this.pex = new PromotionException(other.pex);
9800
      }
9801
    }
9802
 
9803
    public applyRechargeCoupon_result deepCopy() {
9804
      return new applyRechargeCoupon_result(this);
9805
    }
9806
 
9807
    @Override
9808
    public void clear() {
9809
      this.success = null;
9810
      this.pex = null;
9811
    }
9812
 
9813
    public int getSuccessSize() {
9814
      return (this.success == null) ? 0 : this.success.size();
9815
    }
9816
 
9817
    public void putToSuccess(long key, String val) {
9818
      if (this.success == null) {
9819
        this.success = new HashMap<Long,String>();
9820
      }
9821
      this.success.put(key, val);
9822
    }
9823
 
9824
    public Map<Long,String> getSuccess() {
9825
      return this.success;
9826
    }
9827
 
9828
    public void setSuccess(Map<Long,String> success) {
9829
      this.success = success;
9830
    }
9831
 
9832
    public void unsetSuccess() {
9833
      this.success = null;
9834
    }
9835
 
9836
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
9837
    public boolean isSetSuccess() {
9838
      return this.success != null;
9839
    }
9840
 
9841
    public void setSuccessIsSet(boolean value) {
9842
      if (!value) {
9843
        this.success = null;
9844
      }
9845
    }
9846
 
9847
    public PromotionException getPex() {
9848
      return this.pex;
9849
    }
9850
 
9851
    public void setPex(PromotionException pex) {
9852
      this.pex = pex;
9853
    }
9854
 
9855
    public void unsetPex() {
9856
      this.pex = null;
9857
    }
9858
 
9859
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
9860
    public boolean isSetPex() {
9861
      return this.pex != null;
9862
    }
9863
 
9864
    public void setPexIsSet(boolean value) {
9865
      if (!value) {
9866
        this.pex = null;
9867
      }
9868
    }
9869
 
9870
    public void setFieldValue(_Fields field, Object value) {
9871
      switch (field) {
9872
      case SUCCESS:
9873
        if (value == null) {
9874
          unsetSuccess();
9875
        } else {
9876
          setSuccess((Map<Long,String>)value);
9877
        }
9878
        break;
9879
 
9880
      case PEX:
9881
        if (value == null) {
9882
          unsetPex();
9883
        } else {
9884
          setPex((PromotionException)value);
9885
        }
9886
        break;
9887
 
9888
      }
9889
    }
9890
 
9891
    public Object getFieldValue(_Fields field) {
9892
      switch (field) {
9893
      case SUCCESS:
9894
        return getSuccess();
9895
 
9896
      case PEX:
9897
        return getPex();
9898
 
9899
      }
9900
      throw new IllegalStateException();
9901
    }
9902
 
9903
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9904
    public boolean isSet(_Fields field) {
9905
      if (field == null) {
9906
        throw new IllegalArgumentException();
9907
      }
9908
 
9909
      switch (field) {
9910
      case SUCCESS:
9911
        return isSetSuccess();
9912
      case PEX:
9913
        return isSetPex();
9914
      }
9915
      throw new IllegalStateException();
9916
    }
9917
 
9918
    @Override
9919
    public boolean equals(Object that) {
9920
      if (that == null)
9921
        return false;
9922
      if (that instanceof applyRechargeCoupon_result)
9923
        return this.equals((applyRechargeCoupon_result)that);
9924
      return false;
9925
    }
9926
 
9927
    public boolean equals(applyRechargeCoupon_result that) {
9928
      if (that == null)
9929
        return false;
9930
 
9931
      boolean this_present_success = true && this.isSetSuccess();
9932
      boolean that_present_success = true && that.isSetSuccess();
9933
      if (this_present_success || that_present_success) {
9934
        if (!(this_present_success && that_present_success))
9935
          return false;
9936
        if (!this.success.equals(that.success))
9937
          return false;
9938
      }
9939
 
9940
      boolean this_present_pex = true && this.isSetPex();
9941
      boolean that_present_pex = true && that.isSetPex();
9942
      if (this_present_pex || that_present_pex) {
9943
        if (!(this_present_pex && that_present_pex))
9944
          return false;
9945
        if (!this.pex.equals(that.pex))
9946
          return false;
9947
      }
9948
 
9949
      return true;
9950
    }
9951
 
9952
    @Override
9953
    public int hashCode() {
9954
      return 0;
9955
    }
9956
 
9957
    public int compareTo(applyRechargeCoupon_result other) {
9958
      if (!getClass().equals(other.getClass())) {
9959
        return getClass().getName().compareTo(other.getClass().getName());
9960
      }
9961
 
9962
      int lastComparison = 0;
9963
      applyRechargeCoupon_result typedOther = (applyRechargeCoupon_result)other;
9964
 
9965
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
9966
      if (lastComparison != 0) {
9967
        return lastComparison;
9968
      }
9969
      if (isSetSuccess()) {
9970
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
9971
        if (lastComparison != 0) {
9972
          return lastComparison;
9973
        }
9974
      }
9975
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
9976
      if (lastComparison != 0) {
9977
        return lastComparison;
9978
      }
9979
      if (isSetPex()) {
9980
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
9981
        if (lastComparison != 0) {
9982
          return lastComparison;
9983
        }
9984
      }
9985
      return 0;
9986
    }
9987
 
9988
    public _Fields fieldForId(int fieldId) {
9989
      return _Fields.findByThriftId(fieldId);
9990
    }
9991
 
9992
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9993
      org.apache.thrift.protocol.TField field;
9994
      iprot.readStructBegin();
9995
      while (true)
9996
      {
9997
        field = iprot.readFieldBegin();
9998
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
9999
          break;
10000
        }
10001
        switch (field.id) {
10002
          case 0: // SUCCESS
10003
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
10004
              {
11592 amit.gupta 10005
                org.apache.thrift.protocol.TMap _map25 = iprot.readMapBegin();
10006
                this.success = new HashMap<Long,String>(2*_map25.size);
10007
                for (int _i26 = 0; _i26 < _map25.size; ++_i26)
6433 anupam.sin 10008
                {
11592 amit.gupta 10009
                  long _key27; // required
10010
                  String _val28; // required
10011
                  _key27 = iprot.readI64();
10012
                  _val28 = iprot.readString();
10013
                  this.success.put(_key27, _val28);
6433 anupam.sin 10014
                }
10015
                iprot.readMapEnd();
10016
              }
10017
            } else { 
10018
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10019
            }
10020
            break;
10021
          case 1: // PEX
10022
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
10023
              this.pex = new PromotionException();
10024
              this.pex.read(iprot);
10025
            } else { 
10026
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10027
            }
10028
            break;
10029
          default:
10030
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10031
        }
10032
        iprot.readFieldEnd();
10033
      }
10034
      iprot.readStructEnd();
10035
      validate();
10036
    }
10037
 
10038
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
10039
      oprot.writeStructBegin(STRUCT_DESC);
10040
 
10041
      if (this.isSetSuccess()) {
10042
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
10043
        {
10044
          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 10045
          for (Map.Entry<Long, String> _iter29 : this.success.entrySet())
6433 anupam.sin 10046
          {
11592 amit.gupta 10047
            oprot.writeI64(_iter29.getKey());
10048
            oprot.writeString(_iter29.getValue());
6433 anupam.sin 10049
          }
10050
          oprot.writeMapEnd();
10051
        }
10052
        oprot.writeFieldEnd();
10053
      } else if (this.isSetPex()) {
10054
        oprot.writeFieldBegin(PEX_FIELD_DESC);
10055
        this.pex.write(oprot);
10056
        oprot.writeFieldEnd();
10057
      }
10058
      oprot.writeFieldStop();
10059
      oprot.writeStructEnd();
10060
    }
10061
 
10062
    @Override
10063
    public String toString() {
10064
      StringBuilder sb = new StringBuilder("applyRechargeCoupon_result(");
10065
      boolean first = true;
10066
 
10067
      sb.append("success:");
10068
      if (this.success == null) {
10069
        sb.append("null");
10070
      } else {
10071
        sb.append(this.success);
10072
      }
10073
      first = false;
10074
      if (!first) sb.append(", ");
10075
      sb.append("pex:");
10076
      if (this.pex == null) {
10077
        sb.append("null");
10078
      } else {
10079
        sb.append(this.pex);
10080
      }
10081
      first = false;
10082
      sb.append(")");
10083
      return sb.toString();
10084
    }
10085
 
10086
    public void validate() throws org.apache.thrift.TException {
10087
      // check for required fields
10088
    }
10089
 
10090
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10091
      try {
10092
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10093
      } catch (org.apache.thrift.TException te) {
10094
        throw new java.io.IOException(te);
10095
      }
10096
    }
10097
 
10098
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10099
      try {
10100
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10101
      } catch (org.apache.thrift.TException te) {
10102
        throw new java.io.IOException(te);
10103
      }
10104
    }
10105
 
10106
  }
10107
 
3430 rajveer 10108
  public static class trackCouponUsage_args implements org.apache.thrift.TBase<trackCouponUsage_args, trackCouponUsage_args._Fields>, java.io.Serializable, Cloneable   {
10109
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_args");
1982 varun.gupt 10110
 
3430 rajveer 10111
    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);
10112
    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);
10113
    private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.I64, (short)3);
1982 varun.gupt 10114
 
3430 rajveer 10115
    private String couponCode; // required
10116
    private long transactionId; // required
10117
    private long userId; // required
1982 varun.gupt 10118
 
10119
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 10120
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 10121
      COUPON_CODE((short)1, "couponCode"),
10122
      TRANSACTION_ID((short)2, "transactionId"),
10123
      USER_ID((short)3, "userId");
10124
 
10125
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10126
 
10127
      static {
10128
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10129
          byName.put(field.getFieldName(), field);
10130
        }
10131
      }
10132
 
10133
      /**
10134
       * Find the _Fields constant that matches fieldId, or null if its not found.
10135
       */
10136
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 10137
        switch(fieldId) {
10138
          case 1: // COUPON_CODE
10139
            return COUPON_CODE;
10140
          case 2: // TRANSACTION_ID
10141
            return TRANSACTION_ID;
10142
          case 3: // USER_ID
10143
            return USER_ID;
10144
          default:
10145
            return null;
10146
        }
1982 varun.gupt 10147
      }
10148
 
10149
      /**
10150
       * Find the _Fields constant that matches fieldId, throwing an exception
10151
       * if it is not found.
10152
       */
10153
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10154
        _Fields fields = findByThriftId(fieldId);
10155
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10156
        return fields;
10157
      }
10158
 
10159
      /**
10160
       * Find the _Fields constant that matches name, or null if its not found.
10161
       */
10162
      public static _Fields findByName(String name) {
10163
        return byName.get(name);
10164
      }
10165
 
10166
      private final short _thriftId;
10167
      private final String _fieldName;
10168
 
10169
      _Fields(short thriftId, String fieldName) {
10170
        _thriftId = thriftId;
10171
        _fieldName = fieldName;
10172
      }
10173
 
10174
      public short getThriftFieldId() {
10175
        return _thriftId;
10176
      }
10177
 
10178
      public String getFieldName() {
10179
        return _fieldName;
10180
      }
10181
    }
10182
 
10183
    // isset id assignments
10184
    private static final int __TRANSACTIONID_ISSET_ID = 0;
10185
    private static final int __USERID_ISSET_ID = 1;
10186
    private BitSet __isset_bit_vector = new BitSet(2);
10187
 
3430 rajveer 10188
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 10189
    static {
3430 rajveer 10190
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10191
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10192
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
10193
      tmpMap.put(_Fields.TRANSACTION_ID, new org.apache.thrift.meta_data.FieldMetaData("transactionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10194
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
10195
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10196
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
10197
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10198
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_args.class, metaDataMap);
1982 varun.gupt 10199
    }
10200
 
10201
    public trackCouponUsage_args() {
10202
    }
10203
 
10204
    public trackCouponUsage_args(
10205
      String couponCode,
10206
      long transactionId,
10207
      long userId)
10208
    {
10209
      this();
10210
      this.couponCode = couponCode;
10211
      this.transactionId = transactionId;
10212
      setTransactionIdIsSet(true);
10213
      this.userId = userId;
10214
      setUserIdIsSet(true);
10215
    }
10216
 
10217
    /**
10218
     * Performs a deep copy on <i>other</i>.
10219
     */
10220
    public trackCouponUsage_args(trackCouponUsage_args other) {
10221
      __isset_bit_vector.clear();
10222
      __isset_bit_vector.or(other.__isset_bit_vector);
10223
      if (other.isSetCouponCode()) {
10224
        this.couponCode = other.couponCode;
10225
      }
10226
      this.transactionId = other.transactionId;
10227
      this.userId = other.userId;
10228
    }
10229
 
10230
    public trackCouponUsage_args deepCopy() {
10231
      return new trackCouponUsage_args(this);
10232
    }
10233
 
3430 rajveer 10234
    @Override
10235
    public void clear() {
10236
      this.couponCode = null;
10237
      setTransactionIdIsSet(false);
10238
      this.transactionId = 0;
10239
      setUserIdIsSet(false);
10240
      this.userId = 0;
1982 varun.gupt 10241
    }
10242
 
10243
    public String getCouponCode() {
10244
      return this.couponCode;
10245
    }
10246
 
3430 rajveer 10247
    public void setCouponCode(String couponCode) {
1982 varun.gupt 10248
      this.couponCode = couponCode;
10249
    }
10250
 
10251
    public void unsetCouponCode() {
10252
      this.couponCode = null;
10253
    }
10254
 
3430 rajveer 10255
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 10256
    public boolean isSetCouponCode() {
10257
      return this.couponCode != null;
10258
    }
10259
 
10260
    public void setCouponCodeIsSet(boolean value) {
10261
      if (!value) {
10262
        this.couponCode = null;
10263
      }
10264
    }
10265
 
10266
    public long getTransactionId() {
10267
      return this.transactionId;
10268
    }
10269
 
3430 rajveer 10270
    public void setTransactionId(long transactionId) {
1982 varun.gupt 10271
      this.transactionId = transactionId;
10272
      setTransactionIdIsSet(true);
10273
    }
10274
 
10275
    public void unsetTransactionId() {
10276
      __isset_bit_vector.clear(__TRANSACTIONID_ISSET_ID);
10277
    }
10278
 
3430 rajveer 10279
    /** Returns true if field transactionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 10280
    public boolean isSetTransactionId() {
10281
      return __isset_bit_vector.get(__TRANSACTIONID_ISSET_ID);
10282
    }
10283
 
10284
    public void setTransactionIdIsSet(boolean value) {
10285
      __isset_bit_vector.set(__TRANSACTIONID_ISSET_ID, value);
10286
    }
10287
 
10288
    public long getUserId() {
10289
      return this.userId;
10290
    }
10291
 
3430 rajveer 10292
    public void setUserId(long userId) {
1982 varun.gupt 10293
      this.userId = userId;
10294
      setUserIdIsSet(true);
10295
    }
10296
 
10297
    public void unsetUserId() {
10298
      __isset_bit_vector.clear(__USERID_ISSET_ID);
10299
    }
10300
 
3430 rajveer 10301
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 10302
    public boolean isSetUserId() {
10303
      return __isset_bit_vector.get(__USERID_ISSET_ID);
10304
    }
10305
 
10306
    public void setUserIdIsSet(boolean value) {
10307
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
10308
    }
10309
 
10310
    public void setFieldValue(_Fields field, Object value) {
10311
      switch (field) {
10312
      case COUPON_CODE:
10313
        if (value == null) {
10314
          unsetCouponCode();
10315
        } else {
10316
          setCouponCode((String)value);
10317
        }
10318
        break;
10319
 
10320
      case TRANSACTION_ID:
10321
        if (value == null) {
10322
          unsetTransactionId();
10323
        } else {
10324
          setTransactionId((Long)value);
10325
        }
10326
        break;
10327
 
10328
      case USER_ID:
10329
        if (value == null) {
10330
          unsetUserId();
10331
        } else {
10332
          setUserId((Long)value);
10333
        }
10334
        break;
10335
 
10336
      }
10337
    }
10338
 
10339
    public Object getFieldValue(_Fields field) {
10340
      switch (field) {
10341
      case COUPON_CODE:
10342
        return getCouponCode();
10343
 
10344
      case TRANSACTION_ID:
3430 rajveer 10345
        return Long.valueOf(getTransactionId());
1982 varun.gupt 10346
 
10347
      case USER_ID:
3430 rajveer 10348
        return Long.valueOf(getUserId());
1982 varun.gupt 10349
 
10350
      }
10351
      throw new IllegalStateException();
10352
    }
10353
 
3430 rajveer 10354
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10355
    public boolean isSet(_Fields field) {
10356
      if (field == null) {
10357
        throw new IllegalArgumentException();
10358
      }
1982 varun.gupt 10359
 
10360
      switch (field) {
10361
      case COUPON_CODE:
10362
        return isSetCouponCode();
10363
      case TRANSACTION_ID:
10364
        return isSetTransactionId();
10365
      case USER_ID:
10366
        return isSetUserId();
10367
      }
10368
      throw new IllegalStateException();
10369
    }
10370
 
10371
    @Override
10372
    public boolean equals(Object that) {
10373
      if (that == null)
10374
        return false;
10375
      if (that instanceof trackCouponUsage_args)
10376
        return this.equals((trackCouponUsage_args)that);
10377
      return false;
10378
    }
10379
 
10380
    public boolean equals(trackCouponUsage_args that) {
10381
      if (that == null)
10382
        return false;
10383
 
10384
      boolean this_present_couponCode = true && this.isSetCouponCode();
10385
      boolean that_present_couponCode = true && that.isSetCouponCode();
10386
      if (this_present_couponCode || that_present_couponCode) {
10387
        if (!(this_present_couponCode && that_present_couponCode))
10388
          return false;
10389
        if (!this.couponCode.equals(that.couponCode))
10390
          return false;
10391
      }
10392
 
10393
      boolean this_present_transactionId = true;
10394
      boolean that_present_transactionId = true;
10395
      if (this_present_transactionId || that_present_transactionId) {
10396
        if (!(this_present_transactionId && that_present_transactionId))
10397
          return false;
10398
        if (this.transactionId != that.transactionId)
10399
          return false;
10400
      }
10401
 
10402
      boolean this_present_userId = true;
10403
      boolean that_present_userId = true;
10404
      if (this_present_userId || that_present_userId) {
10405
        if (!(this_present_userId && that_present_userId))
10406
          return false;
10407
        if (this.userId != that.userId)
10408
          return false;
10409
      }
10410
 
10411
      return true;
10412
    }
10413
 
10414
    @Override
10415
    public int hashCode() {
10416
      return 0;
10417
    }
10418
 
10419
    public int compareTo(trackCouponUsage_args other) {
10420
      if (!getClass().equals(other.getClass())) {
10421
        return getClass().getName().compareTo(other.getClass().getName());
10422
      }
10423
 
10424
      int lastComparison = 0;
10425
      trackCouponUsage_args typedOther = (trackCouponUsage_args)other;
10426
 
3430 rajveer 10427
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 10428
      if (lastComparison != 0) {
10429
        return lastComparison;
10430
      }
3430 rajveer 10431
      if (isSetCouponCode()) {
10432
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
10433
        if (lastComparison != 0) {
10434
          return lastComparison;
10435
        }
1982 varun.gupt 10436
      }
3430 rajveer 10437
      lastComparison = Boolean.valueOf(isSetTransactionId()).compareTo(typedOther.isSetTransactionId());
1982 varun.gupt 10438
      if (lastComparison != 0) {
10439
        return lastComparison;
10440
      }
3430 rajveer 10441
      if (isSetTransactionId()) {
10442
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transactionId, typedOther.transactionId);
10443
        if (lastComparison != 0) {
10444
          return lastComparison;
10445
        }
1982 varun.gupt 10446
      }
3430 rajveer 10447
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 10448
      if (lastComparison != 0) {
10449
        return lastComparison;
10450
      }
3430 rajveer 10451
      if (isSetUserId()) {
10452
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
10453
        if (lastComparison != 0) {
10454
          return lastComparison;
10455
        }
1982 varun.gupt 10456
      }
10457
      return 0;
10458
    }
10459
 
3430 rajveer 10460
    public _Fields fieldForId(int fieldId) {
10461
      return _Fields.findByThriftId(fieldId);
10462
    }
10463
 
10464
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10465
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 10466
      iprot.readStructBegin();
10467
      while (true)
10468
      {
10469
        field = iprot.readFieldBegin();
3430 rajveer 10470
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 10471
          break;
10472
        }
3430 rajveer 10473
        switch (field.id) {
10474
          case 1: // COUPON_CODE
10475
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
10476
              this.couponCode = iprot.readString();
10477
            } else { 
10478
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10479
            }
10480
            break;
10481
          case 2: // TRANSACTION_ID
10482
            if (field.type == org.apache.thrift.protocol.TType.I64) {
10483
              this.transactionId = iprot.readI64();
10484
              setTransactionIdIsSet(true);
10485
            } else { 
10486
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10487
            }
10488
            break;
10489
          case 3: // USER_ID
10490
            if (field.type == org.apache.thrift.protocol.TType.I64) {
10491
              this.userId = iprot.readI64();
10492
              setUserIdIsSet(true);
10493
            } else { 
10494
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10495
            }
10496
            break;
10497
          default:
10498
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 10499
        }
3430 rajveer 10500
        iprot.readFieldEnd();
1982 varun.gupt 10501
      }
10502
      iprot.readStructEnd();
10503
      validate();
10504
    }
10505
 
3430 rajveer 10506
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 10507
      validate();
10508
 
10509
      oprot.writeStructBegin(STRUCT_DESC);
10510
      if (this.couponCode != null) {
10511
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
10512
        oprot.writeString(this.couponCode);
10513
        oprot.writeFieldEnd();
10514
      }
10515
      oprot.writeFieldBegin(TRANSACTION_ID_FIELD_DESC);
10516
      oprot.writeI64(this.transactionId);
10517
      oprot.writeFieldEnd();
10518
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
10519
      oprot.writeI64(this.userId);
10520
      oprot.writeFieldEnd();
10521
      oprot.writeFieldStop();
10522
      oprot.writeStructEnd();
10523
    }
10524
 
10525
    @Override
10526
    public String toString() {
10527
      StringBuilder sb = new StringBuilder("trackCouponUsage_args(");
10528
      boolean first = true;
10529
 
10530
      sb.append("couponCode:");
10531
      if (this.couponCode == null) {
10532
        sb.append("null");
10533
      } else {
10534
        sb.append(this.couponCode);
10535
      }
10536
      first = false;
10537
      if (!first) sb.append(", ");
10538
      sb.append("transactionId:");
10539
      sb.append(this.transactionId);
10540
      first = false;
10541
      if (!first) sb.append(", ");
10542
      sb.append("userId:");
10543
      sb.append(this.userId);
10544
      first = false;
10545
      sb.append(")");
10546
      return sb.toString();
10547
    }
10548
 
3430 rajveer 10549
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 10550
      // check for required fields
10551
    }
10552
 
3430 rajveer 10553
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10554
      try {
10555
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10556
      } catch (org.apache.thrift.TException te) {
10557
        throw new java.io.IOException(te);
10558
      }
10559
    }
10560
 
10561
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10562
      try {
10563
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
10564
        __isset_bit_vector = new BitSet(1);
10565
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10566
      } catch (org.apache.thrift.TException te) {
10567
        throw new java.io.IOException(te);
10568
      }
10569
    }
10570
 
1982 varun.gupt 10571
  }
10572
 
3430 rajveer 10573
  public static class trackCouponUsage_result implements org.apache.thrift.TBase<trackCouponUsage_result, trackCouponUsage_result._Fields>, java.io.Serializable, Cloneable   {
10574
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_result");
1982 varun.gupt 10575
 
3430 rajveer 10576
    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 10577
 
3430 rajveer 10578
    private PromotionException pex; // required
1982 varun.gupt 10579
 
10580
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 10581
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 10582
      PEX((short)1, "pex");
10583
 
10584
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10585
 
10586
      static {
10587
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10588
          byName.put(field.getFieldName(), field);
10589
        }
10590
      }
10591
 
10592
      /**
10593
       * Find the _Fields constant that matches fieldId, or null if its not found.
10594
       */
10595
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 10596
        switch(fieldId) {
10597
          case 1: // PEX
10598
            return PEX;
10599
          default:
10600
            return null;
10601
        }
1982 varun.gupt 10602
      }
10603
 
10604
      /**
10605
       * Find the _Fields constant that matches fieldId, throwing an exception
10606
       * if it is not found.
10607
       */
10608
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10609
        _Fields fields = findByThriftId(fieldId);
10610
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10611
        return fields;
10612
      }
10613
 
10614
      /**
10615
       * Find the _Fields constant that matches name, or null if its not found.
10616
       */
10617
      public static _Fields findByName(String name) {
10618
        return byName.get(name);
10619
      }
10620
 
10621
      private final short _thriftId;
10622
      private final String _fieldName;
10623
 
10624
      _Fields(short thriftId, String fieldName) {
10625
        _thriftId = thriftId;
10626
        _fieldName = fieldName;
10627
      }
10628
 
10629
      public short getThriftFieldId() {
10630
        return _thriftId;
10631
      }
10632
 
10633
      public String getFieldName() {
10634
        return _fieldName;
10635
      }
10636
    }
10637
 
10638
    // isset id assignments
10639
 
3430 rajveer 10640
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 10641
    static {
3430 rajveer 10642
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10643
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10644
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
10645
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10646
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_result.class, metaDataMap);
1982 varun.gupt 10647
    }
10648
 
10649
    public trackCouponUsage_result() {
10650
    }
10651
 
10652
    public trackCouponUsage_result(
10653
      PromotionException pex)
10654
    {
10655
      this();
10656
      this.pex = pex;
10657
    }
10658
 
10659
    /**
10660
     * Performs a deep copy on <i>other</i>.
10661
     */
10662
    public trackCouponUsage_result(trackCouponUsage_result other) {
10663
      if (other.isSetPex()) {
10664
        this.pex = new PromotionException(other.pex);
10665
      }
10666
    }
10667
 
10668
    public trackCouponUsage_result deepCopy() {
10669
      return new trackCouponUsage_result(this);
10670
    }
10671
 
3430 rajveer 10672
    @Override
10673
    public void clear() {
10674
      this.pex = null;
1982 varun.gupt 10675
    }
10676
 
10677
    public PromotionException getPex() {
10678
      return this.pex;
10679
    }
10680
 
3430 rajveer 10681
    public void setPex(PromotionException pex) {
1982 varun.gupt 10682
      this.pex = pex;
10683
    }
10684
 
10685
    public void unsetPex() {
10686
      this.pex = null;
10687
    }
10688
 
3430 rajveer 10689
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 10690
    public boolean isSetPex() {
10691
      return this.pex != null;
10692
    }
10693
 
10694
    public void setPexIsSet(boolean value) {
10695
      if (!value) {
10696
        this.pex = null;
10697
      }
10698
    }
10699
 
10700
    public void setFieldValue(_Fields field, Object value) {
10701
      switch (field) {
10702
      case PEX:
10703
        if (value == null) {
10704
          unsetPex();
10705
        } else {
10706
          setPex((PromotionException)value);
10707
        }
10708
        break;
10709
 
10710
      }
10711
    }
10712
 
10713
    public Object getFieldValue(_Fields field) {
10714
      switch (field) {
10715
      case PEX:
10716
        return getPex();
10717
 
10718
      }
10719
      throw new IllegalStateException();
10720
    }
10721
 
3430 rajveer 10722
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10723
    public boolean isSet(_Fields field) {
10724
      if (field == null) {
10725
        throw new IllegalArgumentException();
10726
      }
1982 varun.gupt 10727
 
10728
      switch (field) {
10729
      case PEX:
10730
        return isSetPex();
10731
      }
10732
      throw new IllegalStateException();
10733
    }
10734
 
10735
    @Override
10736
    public boolean equals(Object that) {
10737
      if (that == null)
10738
        return false;
10739
      if (that instanceof trackCouponUsage_result)
10740
        return this.equals((trackCouponUsage_result)that);
10741
      return false;
10742
    }
10743
 
10744
    public boolean equals(trackCouponUsage_result that) {
10745
      if (that == null)
10746
        return false;
10747
 
10748
      boolean this_present_pex = true && this.isSetPex();
10749
      boolean that_present_pex = true && that.isSetPex();
10750
      if (this_present_pex || that_present_pex) {
10751
        if (!(this_present_pex && that_present_pex))
10752
          return false;
10753
        if (!this.pex.equals(that.pex))
10754
          return false;
10755
      }
10756
 
10757
      return true;
10758
    }
10759
 
10760
    @Override
10761
    public int hashCode() {
10762
      return 0;
10763
    }
10764
 
10765
    public int compareTo(trackCouponUsage_result other) {
10766
      if (!getClass().equals(other.getClass())) {
10767
        return getClass().getName().compareTo(other.getClass().getName());
10768
      }
10769
 
10770
      int lastComparison = 0;
10771
      trackCouponUsage_result typedOther = (trackCouponUsage_result)other;
10772
 
3430 rajveer 10773
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 10774
      if (lastComparison != 0) {
10775
        return lastComparison;
10776
      }
3430 rajveer 10777
      if (isSetPex()) {
10778
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
10779
        if (lastComparison != 0) {
10780
          return lastComparison;
10781
        }
1982 varun.gupt 10782
      }
10783
      return 0;
10784
    }
10785
 
3430 rajveer 10786
    public _Fields fieldForId(int fieldId) {
10787
      return _Fields.findByThriftId(fieldId);
10788
    }
10789
 
10790
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10791
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 10792
      iprot.readStructBegin();
10793
      while (true)
10794
      {
10795
        field = iprot.readFieldBegin();
3430 rajveer 10796
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 10797
          break;
10798
        }
3430 rajveer 10799
        switch (field.id) {
10800
          case 1: // PEX
10801
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
10802
              this.pex = new PromotionException();
10803
              this.pex.read(iprot);
10804
            } else { 
10805
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10806
            }
10807
            break;
10808
          default:
10809
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 10810
        }
3430 rajveer 10811
        iprot.readFieldEnd();
1982 varun.gupt 10812
      }
10813
      iprot.readStructEnd();
10814
      validate();
10815
    }
10816
 
3430 rajveer 10817
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 10818
      oprot.writeStructBegin(STRUCT_DESC);
10819
 
10820
      if (this.isSetPex()) {
10821
        oprot.writeFieldBegin(PEX_FIELD_DESC);
10822
        this.pex.write(oprot);
10823
        oprot.writeFieldEnd();
10824
      }
10825
      oprot.writeFieldStop();
10826
      oprot.writeStructEnd();
10827
    }
10828
 
10829
    @Override
10830
    public String toString() {
10831
      StringBuilder sb = new StringBuilder("trackCouponUsage_result(");
10832
      boolean first = true;
10833
 
10834
      sb.append("pex:");
10835
      if (this.pex == null) {
10836
        sb.append("null");
10837
      } else {
10838
        sb.append(this.pex);
10839
      }
10840
      first = false;
10841
      sb.append(")");
10842
      return sb.toString();
10843
    }
10844
 
3430 rajveer 10845
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 10846
      // check for required fields
10847
    }
10848
 
3430 rajveer 10849
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10850
      try {
10851
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10852
      } catch (org.apache.thrift.TException te) {
10853
        throw new java.io.IOException(te);
10854
      }
10855
    }
10856
 
10857
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10858
      try {
10859
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10860
      } catch (org.apache.thrift.TException te) {
10861
        throw new java.io.IOException(te);
10862
      }
10863
    }
10864
 
1982 varun.gupt 10865
  }
10866
 
3430 rajveer 10867
  public static class getCouponUsageCountByUser_args implements org.apache.thrift.TBase<getCouponUsageCountByUser_args, getCouponUsageCountByUser_args._Fields>, java.io.Serializable, Cloneable   {
10868
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_args");
1982 varun.gupt 10869
 
3430 rajveer 10870
    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);
10871
    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 10872
 
3430 rajveer 10873
    private String couponCode; // required
10874
    private long userId; // required
1982 varun.gupt 10875
 
10876
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 10877
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 10878
      COUPON_CODE((short)1, "couponCode"),
10879
      USER_ID((short)2, "userId");
10880
 
10881
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10882
 
10883
      static {
10884
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10885
          byName.put(field.getFieldName(), field);
10886
        }
10887
      }
10888
 
10889
      /**
10890
       * Find the _Fields constant that matches fieldId, or null if its not found.
10891
       */
10892
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 10893
        switch(fieldId) {
10894
          case 1: // COUPON_CODE
10895
            return COUPON_CODE;
10896
          case 2: // USER_ID
10897
            return USER_ID;
10898
          default:
10899
            return null;
10900
        }
1982 varun.gupt 10901
      }
10902
 
10903
      /**
10904
       * Find the _Fields constant that matches fieldId, throwing an exception
10905
       * if it is not found.
10906
       */
10907
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10908
        _Fields fields = findByThriftId(fieldId);
10909
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10910
        return fields;
10911
      }
10912
 
10913
      /**
10914
       * Find the _Fields constant that matches name, or null if its not found.
10915
       */
10916
      public static _Fields findByName(String name) {
10917
        return byName.get(name);
10918
      }
10919
 
10920
      private final short _thriftId;
10921
      private final String _fieldName;
10922
 
10923
      _Fields(short thriftId, String fieldName) {
10924
        _thriftId = thriftId;
10925
        _fieldName = fieldName;
10926
      }
10927
 
10928
      public short getThriftFieldId() {
10929
        return _thriftId;
10930
      }
10931
 
10932
      public String getFieldName() {
10933
        return _fieldName;
10934
      }
10935
    }
10936
 
10937
    // isset id assignments
10938
    private static final int __USERID_ISSET_ID = 0;
10939
    private BitSet __isset_bit_vector = new BitSet(1);
10940
 
3430 rajveer 10941
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 10942
    static {
3430 rajveer 10943
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10944
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10945
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
10946
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10947
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
10948
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10949
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_args.class, metaDataMap);
1982 varun.gupt 10950
    }
10951
 
10952
    public getCouponUsageCountByUser_args() {
10953
    }
10954
 
10955
    public getCouponUsageCountByUser_args(
10956
      String couponCode,
10957
      long userId)
10958
    {
10959
      this();
10960
      this.couponCode = couponCode;
10961
      this.userId = userId;
10962
      setUserIdIsSet(true);
10963
    }
10964
 
10965
    /**
10966
     * Performs a deep copy on <i>other</i>.
10967
     */
10968
    public getCouponUsageCountByUser_args(getCouponUsageCountByUser_args other) {
10969
      __isset_bit_vector.clear();
10970
      __isset_bit_vector.or(other.__isset_bit_vector);
10971
      if (other.isSetCouponCode()) {
10972
        this.couponCode = other.couponCode;
10973
      }
10974
      this.userId = other.userId;
10975
    }
10976
 
10977
    public getCouponUsageCountByUser_args deepCopy() {
10978
      return new getCouponUsageCountByUser_args(this);
10979
    }
10980
 
3430 rajveer 10981
    @Override
10982
    public void clear() {
10983
      this.couponCode = null;
10984
      setUserIdIsSet(false);
10985
      this.userId = 0;
1982 varun.gupt 10986
    }
10987
 
10988
    public String getCouponCode() {
10989
      return this.couponCode;
10990
    }
10991
 
3430 rajveer 10992
    public void setCouponCode(String couponCode) {
1982 varun.gupt 10993
      this.couponCode = couponCode;
10994
    }
10995
 
10996
    public void unsetCouponCode() {
10997
      this.couponCode = null;
10998
    }
10999
 
3430 rajveer 11000
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 11001
    public boolean isSetCouponCode() {
11002
      return this.couponCode != null;
11003
    }
11004
 
11005
    public void setCouponCodeIsSet(boolean value) {
11006
      if (!value) {
11007
        this.couponCode = null;
11008
      }
11009
    }
11010
 
11011
    public long getUserId() {
11012
      return this.userId;
11013
    }
11014
 
3430 rajveer 11015
    public void setUserId(long userId) {
1982 varun.gupt 11016
      this.userId = userId;
11017
      setUserIdIsSet(true);
11018
    }
11019
 
11020
    public void unsetUserId() {
11021
      __isset_bit_vector.clear(__USERID_ISSET_ID);
11022
    }
11023
 
3430 rajveer 11024
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 11025
    public boolean isSetUserId() {
11026
      return __isset_bit_vector.get(__USERID_ISSET_ID);
11027
    }
11028
 
11029
    public void setUserIdIsSet(boolean value) {
11030
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
11031
    }
11032
 
11033
    public void setFieldValue(_Fields field, Object value) {
11034
      switch (field) {
11035
      case COUPON_CODE:
11036
        if (value == null) {
11037
          unsetCouponCode();
11038
        } else {
11039
          setCouponCode((String)value);
11040
        }
11041
        break;
11042
 
11043
      case USER_ID:
11044
        if (value == null) {
11045
          unsetUserId();
11046
        } else {
11047
          setUserId((Long)value);
11048
        }
11049
        break;
11050
 
11051
      }
11052
    }
11053
 
11054
    public Object getFieldValue(_Fields field) {
11055
      switch (field) {
11056
      case COUPON_CODE:
11057
        return getCouponCode();
11058
 
11059
      case USER_ID:
3430 rajveer 11060
        return Long.valueOf(getUserId());
1982 varun.gupt 11061
 
11062
      }
11063
      throw new IllegalStateException();
11064
    }
11065
 
3430 rajveer 11066
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11067
    public boolean isSet(_Fields field) {
11068
      if (field == null) {
11069
        throw new IllegalArgumentException();
11070
      }
1982 varun.gupt 11071
 
11072
      switch (field) {
11073
      case COUPON_CODE:
11074
        return isSetCouponCode();
11075
      case USER_ID:
11076
        return isSetUserId();
11077
      }
11078
      throw new IllegalStateException();
11079
    }
11080
 
11081
    @Override
11082
    public boolean equals(Object that) {
11083
      if (that == null)
11084
        return false;
11085
      if (that instanceof getCouponUsageCountByUser_args)
11086
        return this.equals((getCouponUsageCountByUser_args)that);
11087
      return false;
11088
    }
11089
 
11090
    public boolean equals(getCouponUsageCountByUser_args that) {
11091
      if (that == null)
11092
        return false;
11093
 
11094
      boolean this_present_couponCode = true && this.isSetCouponCode();
11095
      boolean that_present_couponCode = true && that.isSetCouponCode();
11096
      if (this_present_couponCode || that_present_couponCode) {
11097
        if (!(this_present_couponCode && that_present_couponCode))
11098
          return false;
11099
        if (!this.couponCode.equals(that.couponCode))
11100
          return false;
11101
      }
11102
 
11103
      boolean this_present_userId = true;
11104
      boolean that_present_userId = true;
11105
      if (this_present_userId || that_present_userId) {
11106
        if (!(this_present_userId && that_present_userId))
11107
          return false;
11108
        if (this.userId != that.userId)
11109
          return false;
11110
      }
11111
 
11112
      return true;
11113
    }
11114
 
11115
    @Override
11116
    public int hashCode() {
11117
      return 0;
11118
    }
11119
 
11120
    public int compareTo(getCouponUsageCountByUser_args other) {
11121
      if (!getClass().equals(other.getClass())) {
11122
        return getClass().getName().compareTo(other.getClass().getName());
11123
      }
11124
 
11125
      int lastComparison = 0;
11126
      getCouponUsageCountByUser_args typedOther = (getCouponUsageCountByUser_args)other;
11127
 
3430 rajveer 11128
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 11129
      if (lastComparison != 0) {
11130
        return lastComparison;
11131
      }
3430 rajveer 11132
      if (isSetCouponCode()) {
11133
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
11134
        if (lastComparison != 0) {
11135
          return lastComparison;
11136
        }
1982 varun.gupt 11137
      }
3430 rajveer 11138
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 11139
      if (lastComparison != 0) {
11140
        return lastComparison;
11141
      }
3430 rajveer 11142
      if (isSetUserId()) {
11143
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
11144
        if (lastComparison != 0) {
11145
          return lastComparison;
11146
        }
1982 varun.gupt 11147
      }
11148
      return 0;
11149
    }
11150
 
3430 rajveer 11151
    public _Fields fieldForId(int fieldId) {
11152
      return _Fields.findByThriftId(fieldId);
11153
    }
11154
 
11155
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11156
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 11157
      iprot.readStructBegin();
11158
      while (true)
11159
      {
11160
        field = iprot.readFieldBegin();
3430 rajveer 11161
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 11162
          break;
11163
        }
3430 rajveer 11164
        switch (field.id) {
11165
          case 1: // COUPON_CODE
11166
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
11167
              this.couponCode = iprot.readString();
11168
            } else { 
11169
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11170
            }
11171
            break;
11172
          case 2: // USER_ID
11173
            if (field.type == org.apache.thrift.protocol.TType.I64) {
11174
              this.userId = iprot.readI64();
11175
              setUserIdIsSet(true);
11176
            } else { 
11177
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11178
            }
11179
            break;
11180
          default:
11181
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 11182
        }
3430 rajveer 11183
        iprot.readFieldEnd();
1982 varun.gupt 11184
      }
11185
      iprot.readStructEnd();
11186
      validate();
11187
    }
11188
 
3430 rajveer 11189
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 11190
      validate();
11191
 
11192
      oprot.writeStructBegin(STRUCT_DESC);
11193
      if (this.couponCode != null) {
11194
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
11195
        oprot.writeString(this.couponCode);
11196
        oprot.writeFieldEnd();
11197
      }
11198
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
11199
      oprot.writeI64(this.userId);
11200
      oprot.writeFieldEnd();
11201
      oprot.writeFieldStop();
11202
      oprot.writeStructEnd();
11203
    }
11204
 
11205
    @Override
11206
    public String toString() {
11207
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_args(");
11208
      boolean first = true;
11209
 
11210
      sb.append("couponCode:");
11211
      if (this.couponCode == null) {
11212
        sb.append("null");
11213
      } else {
11214
        sb.append(this.couponCode);
11215
      }
11216
      first = false;
11217
      if (!first) sb.append(", ");
11218
      sb.append("userId:");
11219
      sb.append(this.userId);
11220
      first = false;
11221
      sb.append(")");
11222
      return sb.toString();
11223
    }
11224
 
3430 rajveer 11225
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 11226
      // check for required fields
11227
    }
11228
 
3430 rajveer 11229
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11230
      try {
11231
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11232
      } catch (org.apache.thrift.TException te) {
11233
        throw new java.io.IOException(te);
11234
      }
11235
    }
11236
 
11237
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11238
      try {
11239
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
11240
        __isset_bit_vector = new BitSet(1);
11241
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11242
      } catch (org.apache.thrift.TException te) {
11243
        throw new java.io.IOException(te);
11244
      }
11245
    }
11246
 
1982 varun.gupt 11247
  }
11248
 
3430 rajveer 11249
  public static class getCouponUsageCountByUser_result implements org.apache.thrift.TBase<getCouponUsageCountByUser_result, getCouponUsageCountByUser_result._Fields>, java.io.Serializable, Cloneable   {
11250
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_result");
1982 varun.gupt 11251
 
3430 rajveer 11252
    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);
11253
    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 11254
 
3430 rajveer 11255
    private long success; // required
11256
    private PromotionException pex; // required
1982 varun.gupt 11257
 
11258
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 11259
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 11260
      SUCCESS((short)0, "success"),
11261
      PEX((short)1, "pex");
11262
 
11263
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11264
 
11265
      static {
11266
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11267
          byName.put(field.getFieldName(), field);
11268
        }
11269
      }
11270
 
11271
      /**
11272
       * Find the _Fields constant that matches fieldId, or null if its not found.
11273
       */
11274
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 11275
        switch(fieldId) {
11276
          case 0: // SUCCESS
11277
            return SUCCESS;
11278
          case 1: // PEX
11279
            return PEX;
11280
          default:
11281
            return null;
11282
        }
1982 varun.gupt 11283
      }
11284
 
11285
      /**
11286
       * Find the _Fields constant that matches fieldId, throwing an exception
11287
       * if it is not found.
11288
       */
11289
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11290
        _Fields fields = findByThriftId(fieldId);
11291
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11292
        return fields;
11293
      }
11294
 
11295
      /**
11296
       * Find the _Fields constant that matches name, or null if its not found.
11297
       */
11298
      public static _Fields findByName(String name) {
11299
        return byName.get(name);
11300
      }
11301
 
11302
      private final short _thriftId;
11303
      private final String _fieldName;
11304
 
11305
      _Fields(short thriftId, String fieldName) {
11306
        _thriftId = thriftId;
11307
        _fieldName = fieldName;
11308
      }
11309
 
11310
      public short getThriftFieldId() {
11311
        return _thriftId;
11312
      }
11313
 
11314
      public String getFieldName() {
11315
        return _fieldName;
11316
      }
11317
    }
11318
 
11319
    // isset id assignments
11320
    private static final int __SUCCESS_ISSET_ID = 0;
11321
    private BitSet __isset_bit_vector = new BitSet(1);
11322
 
3430 rajveer 11323
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 11324
    static {
3430 rajveer 11325
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11326
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11327
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
11328
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11329
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
11330
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11331
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_result.class, metaDataMap);
1982 varun.gupt 11332
    }
11333
 
11334
    public getCouponUsageCountByUser_result() {
11335
    }
11336
 
11337
    public getCouponUsageCountByUser_result(
11338
      long success,
11339
      PromotionException pex)
11340
    {
11341
      this();
11342
      this.success = success;
11343
      setSuccessIsSet(true);
11344
      this.pex = pex;
11345
    }
11346
 
11347
    /**
11348
     * Performs a deep copy on <i>other</i>.
11349
     */
11350
    public getCouponUsageCountByUser_result(getCouponUsageCountByUser_result other) {
11351
      __isset_bit_vector.clear();
11352
      __isset_bit_vector.or(other.__isset_bit_vector);
11353
      this.success = other.success;
11354
      if (other.isSetPex()) {
11355
        this.pex = new PromotionException(other.pex);
11356
      }
11357
    }
11358
 
11359
    public getCouponUsageCountByUser_result deepCopy() {
11360
      return new getCouponUsageCountByUser_result(this);
11361
    }
11362
 
3430 rajveer 11363
    @Override
11364
    public void clear() {
11365
      setSuccessIsSet(false);
11366
      this.success = 0;
11367
      this.pex = null;
1982 varun.gupt 11368
    }
11369
 
11370
    public long getSuccess() {
11371
      return this.success;
11372
    }
11373
 
3430 rajveer 11374
    public void setSuccess(long success) {
1982 varun.gupt 11375
      this.success = success;
11376
      setSuccessIsSet(true);
11377
    }
11378
 
11379
    public void unsetSuccess() {
11380
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
11381
    }
11382
 
3430 rajveer 11383
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 11384
    public boolean isSetSuccess() {
11385
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
11386
    }
11387
 
11388
    public void setSuccessIsSet(boolean value) {
11389
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
11390
    }
11391
 
11392
    public PromotionException getPex() {
11393
      return this.pex;
11394
    }
11395
 
3430 rajveer 11396
    public void setPex(PromotionException pex) {
1982 varun.gupt 11397
      this.pex = pex;
11398
    }
11399
 
11400
    public void unsetPex() {
11401
      this.pex = null;
11402
    }
11403
 
3430 rajveer 11404
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 11405
    public boolean isSetPex() {
11406
      return this.pex != null;
11407
    }
11408
 
11409
    public void setPexIsSet(boolean value) {
11410
      if (!value) {
11411
        this.pex = null;
11412
      }
11413
    }
11414
 
11415
    public void setFieldValue(_Fields field, Object value) {
11416
      switch (field) {
11417
      case SUCCESS:
11418
        if (value == null) {
11419
          unsetSuccess();
11420
        } else {
11421
          setSuccess((Long)value);
11422
        }
11423
        break;
11424
 
11425
      case PEX:
11426
        if (value == null) {
11427
          unsetPex();
11428
        } else {
11429
          setPex((PromotionException)value);
11430
        }
11431
        break;
11432
 
11433
      }
11434
    }
11435
 
11436
    public Object getFieldValue(_Fields field) {
11437
      switch (field) {
11438
      case SUCCESS:
3430 rajveer 11439
        return Long.valueOf(getSuccess());
1982 varun.gupt 11440
 
11441
      case PEX:
11442
        return getPex();
11443
 
11444
      }
11445
      throw new IllegalStateException();
11446
    }
11447
 
3430 rajveer 11448
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11449
    public boolean isSet(_Fields field) {
11450
      if (field == null) {
11451
        throw new IllegalArgumentException();
11452
      }
1982 varun.gupt 11453
 
11454
      switch (field) {
11455
      case SUCCESS:
11456
        return isSetSuccess();
11457
      case PEX:
11458
        return isSetPex();
11459
      }
11460
      throw new IllegalStateException();
11461
    }
11462
 
11463
    @Override
11464
    public boolean equals(Object that) {
11465
      if (that == null)
11466
        return false;
11467
      if (that instanceof getCouponUsageCountByUser_result)
11468
        return this.equals((getCouponUsageCountByUser_result)that);
11469
      return false;
11470
    }
11471
 
11472
    public boolean equals(getCouponUsageCountByUser_result that) {
11473
      if (that == null)
11474
        return false;
11475
 
11476
      boolean this_present_success = true;
11477
      boolean that_present_success = true;
11478
      if (this_present_success || that_present_success) {
11479
        if (!(this_present_success && that_present_success))
11480
          return false;
11481
        if (this.success != that.success)
11482
          return false;
11483
      }
11484
 
11485
      boolean this_present_pex = true && this.isSetPex();
11486
      boolean that_present_pex = true && that.isSetPex();
11487
      if (this_present_pex || that_present_pex) {
11488
        if (!(this_present_pex && that_present_pex))
11489
          return false;
11490
        if (!this.pex.equals(that.pex))
11491
          return false;
11492
      }
11493
 
11494
      return true;
11495
    }
11496
 
11497
    @Override
11498
    public int hashCode() {
11499
      return 0;
11500
    }
11501
 
11502
    public int compareTo(getCouponUsageCountByUser_result other) {
11503
      if (!getClass().equals(other.getClass())) {
11504
        return getClass().getName().compareTo(other.getClass().getName());
11505
      }
11506
 
11507
      int lastComparison = 0;
11508
      getCouponUsageCountByUser_result typedOther = (getCouponUsageCountByUser_result)other;
11509
 
3430 rajveer 11510
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 11511
      if (lastComparison != 0) {
11512
        return lastComparison;
11513
      }
3430 rajveer 11514
      if (isSetSuccess()) {
11515
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
11516
        if (lastComparison != 0) {
11517
          return lastComparison;
11518
        }
1982 varun.gupt 11519
      }
3430 rajveer 11520
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 11521
      if (lastComparison != 0) {
11522
        return lastComparison;
11523
      }
3430 rajveer 11524
      if (isSetPex()) {
11525
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
11526
        if (lastComparison != 0) {
11527
          return lastComparison;
11528
        }
1982 varun.gupt 11529
      }
11530
      return 0;
11531
    }
11532
 
3430 rajveer 11533
    public _Fields fieldForId(int fieldId) {
11534
      return _Fields.findByThriftId(fieldId);
11535
    }
11536
 
11537
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11538
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 11539
      iprot.readStructBegin();
11540
      while (true)
11541
      {
11542
        field = iprot.readFieldBegin();
3430 rajveer 11543
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 11544
          break;
11545
        }
3430 rajveer 11546
        switch (field.id) {
11547
          case 0: // SUCCESS
11548
            if (field.type == org.apache.thrift.protocol.TType.I64) {
11549
              this.success = iprot.readI64();
11550
              setSuccessIsSet(true);
11551
            } else { 
11552
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11553
            }
11554
            break;
11555
          case 1: // PEX
11556
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
11557
              this.pex = new PromotionException();
11558
              this.pex.read(iprot);
11559
            } else { 
11560
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11561
            }
11562
            break;
11563
          default:
11564
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 11565
        }
3430 rajveer 11566
        iprot.readFieldEnd();
1982 varun.gupt 11567
      }
11568
      iprot.readStructEnd();
11569
      validate();
11570
    }
11571
 
3430 rajveer 11572
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 11573
      oprot.writeStructBegin(STRUCT_DESC);
11574
 
11575
      if (this.isSetSuccess()) {
11576
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
11577
        oprot.writeI64(this.success);
11578
        oprot.writeFieldEnd();
11579
      } else if (this.isSetPex()) {
11580
        oprot.writeFieldBegin(PEX_FIELD_DESC);
11581
        this.pex.write(oprot);
11582
        oprot.writeFieldEnd();
11583
      }
11584
      oprot.writeFieldStop();
11585
      oprot.writeStructEnd();
11586
    }
11587
 
11588
    @Override
11589
    public String toString() {
11590
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_result(");
11591
      boolean first = true;
11592
 
11593
      sb.append("success:");
11594
      sb.append(this.success);
11595
      first = false;
11596
      if (!first) sb.append(", ");
11597
      sb.append("pex:");
11598
      if (this.pex == null) {
11599
        sb.append("null");
11600
      } else {
11601
        sb.append(this.pex);
11602
      }
11603
      first = false;
11604
      sb.append(")");
11605
      return sb.toString();
11606
    }
11607
 
3430 rajveer 11608
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 11609
      // check for required fields
11610
    }
11611
 
3430 rajveer 11612
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11613
      try {
11614
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11615
      } catch (org.apache.thrift.TException te) {
11616
        throw new java.io.IOException(te);
11617
      }
11618
    }
11619
 
11620
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11621
      try {
11622
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11623
      } catch (org.apache.thrift.TException te) {
11624
        throw new java.io.IOException(te);
11625
      }
11626
    }
11627
 
1982 varun.gupt 11628
  }
11629
 
6497 amit.gupta 11630
  public static class getActiveCodes_args implements org.apache.thrift.TBase<getActiveCodes_args, getActiveCodes_args._Fields>, java.io.Serializable, Cloneable   {
11631
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCodes_args");
11632
 
11633
    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);
11634
 
11635
    private long promotionId; // required
11636
 
11637
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11638
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11639
      PROMOTION_ID((short)1, "promotionId");
11640
 
11641
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11642
 
11643
      static {
11644
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11645
          byName.put(field.getFieldName(), field);
11646
        }
11647
      }
11648
 
11649
      /**
11650
       * Find the _Fields constant that matches fieldId, or null if its not found.
11651
       */
11652
      public static _Fields findByThriftId(int fieldId) {
11653
        switch(fieldId) {
11654
          case 1: // PROMOTION_ID
11655
            return PROMOTION_ID;
11656
          default:
11657
            return null;
11658
        }
11659
      }
11660
 
11661
      /**
11662
       * Find the _Fields constant that matches fieldId, throwing an exception
11663
       * if it is not found.
11664
       */
11665
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11666
        _Fields fields = findByThriftId(fieldId);
11667
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11668
        return fields;
11669
      }
11670
 
11671
      /**
11672
       * Find the _Fields constant that matches name, or null if its not found.
11673
       */
11674
      public static _Fields findByName(String name) {
11675
        return byName.get(name);
11676
      }
11677
 
11678
      private final short _thriftId;
11679
      private final String _fieldName;
11680
 
11681
      _Fields(short thriftId, String fieldName) {
11682
        _thriftId = thriftId;
11683
        _fieldName = fieldName;
11684
      }
11685
 
11686
      public short getThriftFieldId() {
11687
        return _thriftId;
11688
      }
11689
 
11690
      public String getFieldName() {
11691
        return _fieldName;
11692
      }
11693
    }
11694
 
11695
    // isset id assignments
11696
    private static final int __PROMOTIONID_ISSET_ID = 0;
11697
    private BitSet __isset_bit_vector = new BitSet(1);
11698
 
11699
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
11700
    static {
11701
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11702
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11703
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
11704
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11705
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCodes_args.class, metaDataMap);
11706
    }
11707
 
11708
    public getActiveCodes_args() {
11709
    }
11710
 
11711
    public getActiveCodes_args(
11712
      long promotionId)
11713
    {
11714
      this();
11715
      this.promotionId = promotionId;
11716
      setPromotionIdIsSet(true);
11717
    }
11718
 
11719
    /**
11720
     * Performs a deep copy on <i>other</i>.
11721
     */
11722
    public getActiveCodes_args(getActiveCodes_args other) {
11723
      __isset_bit_vector.clear();
11724
      __isset_bit_vector.or(other.__isset_bit_vector);
11725
      this.promotionId = other.promotionId;
11726
    }
11727
 
11728
    public getActiveCodes_args deepCopy() {
11729
      return new getActiveCodes_args(this);
11730
    }
11731
 
11732
    @Override
11733
    public void clear() {
11734
      setPromotionIdIsSet(false);
11735
      this.promotionId = 0;
11736
    }
11737
 
11738
    public long getPromotionId() {
11739
      return this.promotionId;
11740
    }
11741
 
11742
    public void setPromotionId(long promotionId) {
11743
      this.promotionId = promotionId;
11744
      setPromotionIdIsSet(true);
11745
    }
11746
 
11747
    public void unsetPromotionId() {
11748
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
11749
    }
11750
 
11751
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
11752
    public boolean isSetPromotionId() {
11753
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
11754
    }
11755
 
11756
    public void setPromotionIdIsSet(boolean value) {
11757
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
11758
    }
11759
 
11760
    public void setFieldValue(_Fields field, Object value) {
11761
      switch (field) {
11762
      case PROMOTION_ID:
11763
        if (value == null) {
11764
          unsetPromotionId();
11765
        } else {
11766
          setPromotionId((Long)value);
11767
        }
11768
        break;
11769
 
11770
      }
11771
    }
11772
 
11773
    public Object getFieldValue(_Fields field) {
11774
      switch (field) {
11775
      case PROMOTION_ID:
11776
        return Long.valueOf(getPromotionId());
11777
 
11778
      }
11779
      throw new IllegalStateException();
11780
    }
11781
 
11782
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11783
    public boolean isSet(_Fields field) {
11784
      if (field == null) {
11785
        throw new IllegalArgumentException();
11786
      }
11787
 
11788
      switch (field) {
11789
      case PROMOTION_ID:
11790
        return isSetPromotionId();
11791
      }
11792
      throw new IllegalStateException();
11793
    }
11794
 
11795
    @Override
11796
    public boolean equals(Object that) {
11797
      if (that == null)
11798
        return false;
11799
      if (that instanceof getActiveCodes_args)
11800
        return this.equals((getActiveCodes_args)that);
11801
      return false;
11802
    }
11803
 
11804
    public boolean equals(getActiveCodes_args that) {
11805
      if (that == null)
11806
        return false;
11807
 
11808
      boolean this_present_promotionId = true;
11809
      boolean that_present_promotionId = true;
11810
      if (this_present_promotionId || that_present_promotionId) {
11811
        if (!(this_present_promotionId && that_present_promotionId))
11812
          return false;
11813
        if (this.promotionId != that.promotionId)
11814
          return false;
11815
      }
11816
 
11817
      return true;
11818
    }
11819
 
11820
    @Override
11821
    public int hashCode() {
11822
      return 0;
11823
    }
11824
 
11825
    public int compareTo(getActiveCodes_args other) {
11826
      if (!getClass().equals(other.getClass())) {
11827
        return getClass().getName().compareTo(other.getClass().getName());
11828
      }
11829
 
11830
      int lastComparison = 0;
11831
      getActiveCodes_args typedOther = (getActiveCodes_args)other;
11832
 
11833
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
11834
      if (lastComparison != 0) {
11835
        return lastComparison;
11836
      }
11837
      if (isSetPromotionId()) {
11838
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
11839
        if (lastComparison != 0) {
11840
          return lastComparison;
11841
        }
11842
      }
11843
      return 0;
11844
    }
11845
 
11846
    public _Fields fieldForId(int fieldId) {
11847
      return _Fields.findByThriftId(fieldId);
11848
    }
11849
 
11850
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11851
      org.apache.thrift.protocol.TField field;
11852
      iprot.readStructBegin();
11853
      while (true)
11854
      {
11855
        field = iprot.readFieldBegin();
11856
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
11857
          break;
11858
        }
11859
        switch (field.id) {
11860
          case 1: // PROMOTION_ID
11861
            if (field.type == org.apache.thrift.protocol.TType.I64) {
11862
              this.promotionId = iprot.readI64();
11863
              setPromotionIdIsSet(true);
11864
            } else { 
11865
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11866
            }
11867
            break;
11868
          default:
11869
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11870
        }
11871
        iprot.readFieldEnd();
11872
      }
11873
      iprot.readStructEnd();
11874
      validate();
11875
    }
11876
 
11877
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
11878
      validate();
11879
 
11880
      oprot.writeStructBegin(STRUCT_DESC);
11881
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
11882
      oprot.writeI64(this.promotionId);
11883
      oprot.writeFieldEnd();
11884
      oprot.writeFieldStop();
11885
      oprot.writeStructEnd();
11886
    }
11887
 
11888
    @Override
11889
    public String toString() {
11890
      StringBuilder sb = new StringBuilder("getActiveCodes_args(");
11891
      boolean first = true;
11892
 
11893
      sb.append("promotionId:");
11894
      sb.append(this.promotionId);
11895
      first = false;
11896
      sb.append(")");
11897
      return sb.toString();
11898
    }
11899
 
11900
    public void validate() throws org.apache.thrift.TException {
11901
      // check for required fields
11902
    }
11903
 
11904
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11905
      try {
11906
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11907
      } catch (org.apache.thrift.TException te) {
11908
        throw new java.io.IOException(te);
11909
      }
11910
    }
11911
 
11912
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11913
      try {
11914
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
11915
        __isset_bit_vector = new BitSet(1);
11916
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11917
      } catch (org.apache.thrift.TException te) {
11918
        throw new java.io.IOException(te);
11919
      }
11920
    }
11921
 
11922
  }
11923
 
11924
  public static class getActiveCodes_result implements org.apache.thrift.TBase<getActiveCodes_result, getActiveCodes_result._Fields>, java.io.Serializable, Cloneable   {
11925
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCodes_result");
11926
 
11927
    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);
11928
    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);
11929
 
11930
    private List<Coupon> success; // required
11931
    private PromotionException pex; // required
11932
 
11933
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11934
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11935
      SUCCESS((short)0, "success"),
11936
      PEX((short)1, "pex");
11937
 
11938
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11939
 
11940
      static {
11941
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11942
          byName.put(field.getFieldName(), field);
11943
        }
11944
      }
11945
 
11946
      /**
11947
       * Find the _Fields constant that matches fieldId, or null if its not found.
11948
       */
11949
      public static _Fields findByThriftId(int fieldId) {
11950
        switch(fieldId) {
11951
          case 0: // SUCCESS
11952
            return SUCCESS;
11953
          case 1: // PEX
11954
            return PEX;
11955
          default:
11956
            return null;
11957
        }
11958
      }
11959
 
11960
      /**
11961
       * Find the _Fields constant that matches fieldId, throwing an exception
11962
       * if it is not found.
11963
       */
11964
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11965
        _Fields fields = findByThriftId(fieldId);
11966
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11967
        return fields;
11968
      }
11969
 
11970
      /**
11971
       * Find the _Fields constant that matches name, or null if its not found.
11972
       */
11973
      public static _Fields findByName(String name) {
11974
        return byName.get(name);
11975
      }
11976
 
11977
      private final short _thriftId;
11978
      private final String _fieldName;
11979
 
11980
      _Fields(short thriftId, String fieldName) {
11981
        _thriftId = thriftId;
11982
        _fieldName = fieldName;
11983
      }
11984
 
11985
      public short getThriftFieldId() {
11986
        return _thriftId;
11987
      }
11988
 
11989
      public String getFieldName() {
11990
        return _fieldName;
11991
      }
11992
    }
11993
 
11994
    // isset id assignments
11995
 
11996
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
11997
    static {
11998
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11999
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12000
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
12001
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
12002
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12003
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
12004
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12005
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCodes_result.class, metaDataMap);
12006
    }
12007
 
12008
    public getActiveCodes_result() {
12009
    }
12010
 
12011
    public getActiveCodes_result(
12012
      List<Coupon> success,
12013
      PromotionException pex)
12014
    {
12015
      this();
12016
      this.success = success;
12017
      this.pex = pex;
12018
    }
12019
 
12020
    /**
12021
     * Performs a deep copy on <i>other</i>.
12022
     */
12023
    public getActiveCodes_result(getActiveCodes_result other) {
12024
      if (other.isSetSuccess()) {
12025
        List<Coupon> __this__success = new ArrayList<Coupon>();
12026
        for (Coupon other_element : other.success) {
12027
          __this__success.add(new Coupon(other_element));
12028
        }
12029
        this.success = __this__success;
12030
      }
12031
      if (other.isSetPex()) {
12032
        this.pex = new PromotionException(other.pex);
12033
      }
12034
    }
12035
 
12036
    public getActiveCodes_result deepCopy() {
12037
      return new getActiveCodes_result(this);
12038
    }
12039
 
12040
    @Override
12041
    public void clear() {
12042
      this.success = null;
12043
      this.pex = null;
12044
    }
12045
 
12046
    public int getSuccessSize() {
12047
      return (this.success == null) ? 0 : this.success.size();
12048
    }
12049
 
12050
    public java.util.Iterator<Coupon> getSuccessIterator() {
12051
      return (this.success == null) ? null : this.success.iterator();
12052
    }
12053
 
12054
    public void addToSuccess(Coupon elem) {
12055
      if (this.success == null) {
12056
        this.success = new ArrayList<Coupon>();
12057
      }
12058
      this.success.add(elem);
12059
    }
12060
 
12061
    public List<Coupon> getSuccess() {
12062
      return this.success;
12063
    }
12064
 
12065
    public void setSuccess(List<Coupon> success) {
12066
      this.success = success;
12067
    }
12068
 
12069
    public void unsetSuccess() {
12070
      this.success = null;
12071
    }
12072
 
12073
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
12074
    public boolean isSetSuccess() {
12075
      return this.success != null;
12076
    }
12077
 
12078
    public void setSuccessIsSet(boolean value) {
12079
      if (!value) {
12080
        this.success = null;
12081
      }
12082
    }
12083
 
12084
    public PromotionException getPex() {
12085
      return this.pex;
12086
    }
12087
 
12088
    public void setPex(PromotionException pex) {
12089
      this.pex = pex;
12090
    }
12091
 
12092
    public void unsetPex() {
12093
      this.pex = null;
12094
    }
12095
 
12096
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
12097
    public boolean isSetPex() {
12098
      return this.pex != null;
12099
    }
12100
 
12101
    public void setPexIsSet(boolean value) {
12102
      if (!value) {
12103
        this.pex = null;
12104
      }
12105
    }
12106
 
12107
    public void setFieldValue(_Fields field, Object value) {
12108
      switch (field) {
12109
      case SUCCESS:
12110
        if (value == null) {
12111
          unsetSuccess();
12112
        } else {
12113
          setSuccess((List<Coupon>)value);
12114
        }
12115
        break;
12116
 
12117
      case PEX:
12118
        if (value == null) {
12119
          unsetPex();
12120
        } else {
12121
          setPex((PromotionException)value);
12122
        }
12123
        break;
12124
 
12125
      }
12126
    }
12127
 
12128
    public Object getFieldValue(_Fields field) {
12129
      switch (field) {
12130
      case SUCCESS:
12131
        return getSuccess();
12132
 
12133
      case PEX:
12134
        return getPex();
12135
 
12136
      }
12137
      throw new IllegalStateException();
12138
    }
12139
 
12140
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12141
    public boolean isSet(_Fields field) {
12142
      if (field == null) {
12143
        throw new IllegalArgumentException();
12144
      }
12145
 
12146
      switch (field) {
12147
      case SUCCESS:
12148
        return isSetSuccess();
12149
      case PEX:
12150
        return isSetPex();
12151
      }
12152
      throw new IllegalStateException();
12153
    }
12154
 
12155
    @Override
12156
    public boolean equals(Object that) {
12157
      if (that == null)
12158
        return false;
12159
      if (that instanceof getActiveCodes_result)
12160
        return this.equals((getActiveCodes_result)that);
12161
      return false;
12162
    }
12163
 
12164
    public boolean equals(getActiveCodes_result that) {
12165
      if (that == null)
12166
        return false;
12167
 
12168
      boolean this_present_success = true && this.isSetSuccess();
12169
      boolean that_present_success = true && that.isSetSuccess();
12170
      if (this_present_success || that_present_success) {
12171
        if (!(this_present_success && that_present_success))
12172
          return false;
12173
        if (!this.success.equals(that.success))
12174
          return false;
12175
      }
12176
 
12177
      boolean this_present_pex = true && this.isSetPex();
12178
      boolean that_present_pex = true && that.isSetPex();
12179
      if (this_present_pex || that_present_pex) {
12180
        if (!(this_present_pex && that_present_pex))
12181
          return false;
12182
        if (!this.pex.equals(that.pex))
12183
          return false;
12184
      }
12185
 
12186
      return true;
12187
    }
12188
 
12189
    @Override
12190
    public int hashCode() {
12191
      return 0;
12192
    }
12193
 
12194
    public int compareTo(getActiveCodes_result other) {
12195
      if (!getClass().equals(other.getClass())) {
12196
        return getClass().getName().compareTo(other.getClass().getName());
12197
      }
12198
 
12199
      int lastComparison = 0;
12200
      getActiveCodes_result typedOther = (getActiveCodes_result)other;
12201
 
12202
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
12203
      if (lastComparison != 0) {
12204
        return lastComparison;
12205
      }
12206
      if (isSetSuccess()) {
12207
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
12208
        if (lastComparison != 0) {
12209
          return lastComparison;
12210
        }
12211
      }
12212
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
12213
      if (lastComparison != 0) {
12214
        return lastComparison;
12215
      }
12216
      if (isSetPex()) {
12217
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
12218
        if (lastComparison != 0) {
12219
          return lastComparison;
12220
        }
12221
      }
12222
      return 0;
12223
    }
12224
 
12225
    public _Fields fieldForId(int fieldId) {
12226
      return _Fields.findByThriftId(fieldId);
12227
    }
12228
 
12229
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12230
      org.apache.thrift.protocol.TField field;
12231
      iprot.readStructBegin();
12232
      while (true)
12233
      {
12234
        field = iprot.readFieldBegin();
12235
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12236
          break;
12237
        }
12238
        switch (field.id) {
12239
          case 0: // SUCCESS
12240
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
12241
              {
11592 amit.gupta 12242
                org.apache.thrift.protocol.TList _list30 = iprot.readListBegin();
12243
                this.success = new ArrayList<Coupon>(_list30.size);
12244
                for (int _i31 = 0; _i31 < _list30.size; ++_i31)
6497 amit.gupta 12245
                {
11592 amit.gupta 12246
                  Coupon _elem32; // required
12247
                  _elem32 = new Coupon();
12248
                  _elem32.read(iprot);
12249
                  this.success.add(_elem32);
6497 amit.gupta 12250
                }
12251
                iprot.readListEnd();
12252
              }
12253
            } else { 
12254
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12255
            }
12256
            break;
12257
          case 1: // PEX
12258
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
12259
              this.pex = new PromotionException();
12260
              this.pex.read(iprot);
12261
            } else { 
12262
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12263
            }
12264
            break;
12265
          default:
12266
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12267
        }
12268
        iprot.readFieldEnd();
12269
      }
12270
      iprot.readStructEnd();
12271
      validate();
12272
    }
12273
 
12274
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12275
      oprot.writeStructBegin(STRUCT_DESC);
12276
 
12277
      if (this.isSetSuccess()) {
12278
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
12279
        {
12280
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
11592 amit.gupta 12281
          for (Coupon _iter33 : this.success)
6497 amit.gupta 12282
          {
11592 amit.gupta 12283
            _iter33.write(oprot);
6497 amit.gupta 12284
          }
12285
          oprot.writeListEnd();
12286
        }
12287
        oprot.writeFieldEnd();
12288
      } else if (this.isSetPex()) {
12289
        oprot.writeFieldBegin(PEX_FIELD_DESC);
12290
        this.pex.write(oprot);
12291
        oprot.writeFieldEnd();
12292
      }
12293
      oprot.writeFieldStop();
12294
      oprot.writeStructEnd();
12295
    }
12296
 
12297
    @Override
12298
    public String toString() {
12299
      StringBuilder sb = new StringBuilder("getActiveCodes_result(");
12300
      boolean first = true;
12301
 
12302
      sb.append("success:");
12303
      if (this.success == null) {
12304
        sb.append("null");
12305
      } else {
12306
        sb.append(this.success);
12307
      }
12308
      first = false;
12309
      if (!first) sb.append(", ");
12310
      sb.append("pex:");
12311
      if (this.pex == null) {
12312
        sb.append("null");
12313
      } else {
12314
        sb.append(this.pex);
12315
      }
12316
      first = false;
12317
      sb.append(")");
12318
      return sb.toString();
12319
    }
12320
 
12321
    public void validate() throws org.apache.thrift.TException {
12322
      // check for required fields
12323
    }
12324
 
12325
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12326
      try {
12327
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12328
      } catch (org.apache.thrift.TException te) {
12329
        throw new java.io.IOException(te);
12330
      }
12331
    }
12332
 
12333
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12334
      try {
12335
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12336
      } catch (org.apache.thrift.TException te) {
12337
        throw new java.io.IOException(te);
12338
      }
12339
    }
12340
 
12341
  }
12342
 
12343
  public static class deleteCoupon_args implements org.apache.thrift.TBase<deleteCoupon_args, deleteCoupon_args._Fields>, java.io.Serializable, Cloneable   {
12344
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteCoupon_args");
12345
 
12346
    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);
12347
 
12348
    private String couponCode; // required
12349
 
12350
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12351
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12352
      COUPON_CODE((short)1, "couponCode");
12353
 
12354
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12355
 
12356
      static {
12357
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12358
          byName.put(field.getFieldName(), field);
12359
        }
12360
      }
12361
 
12362
      /**
12363
       * Find the _Fields constant that matches fieldId, or null if its not found.
12364
       */
12365
      public static _Fields findByThriftId(int fieldId) {
12366
        switch(fieldId) {
12367
          case 1: // COUPON_CODE
12368
            return COUPON_CODE;
12369
          default:
12370
            return null;
12371
        }
12372
      }
12373
 
12374
      /**
12375
       * Find the _Fields constant that matches fieldId, throwing an exception
12376
       * if it is not found.
12377
       */
12378
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12379
        _Fields fields = findByThriftId(fieldId);
12380
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12381
        return fields;
12382
      }
12383
 
12384
      /**
12385
       * Find the _Fields constant that matches name, or null if its not found.
12386
       */
12387
      public static _Fields findByName(String name) {
12388
        return byName.get(name);
12389
      }
12390
 
12391
      private final short _thriftId;
12392
      private final String _fieldName;
12393
 
12394
      _Fields(short thriftId, String fieldName) {
12395
        _thriftId = thriftId;
12396
        _fieldName = fieldName;
12397
      }
12398
 
12399
      public short getThriftFieldId() {
12400
        return _thriftId;
12401
      }
12402
 
12403
      public String getFieldName() {
12404
        return _fieldName;
12405
      }
12406
    }
12407
 
12408
    // isset id assignments
12409
 
12410
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12411
    static {
12412
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12413
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12414
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
12415
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12416
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteCoupon_args.class, metaDataMap);
12417
    }
12418
 
12419
    public deleteCoupon_args() {
12420
    }
12421
 
12422
    public deleteCoupon_args(
12423
      String couponCode)
12424
    {
12425
      this();
12426
      this.couponCode = couponCode;
12427
    }
12428
 
12429
    /**
12430
     * Performs a deep copy on <i>other</i>.
12431
     */
12432
    public deleteCoupon_args(deleteCoupon_args other) {
12433
      if (other.isSetCouponCode()) {
12434
        this.couponCode = other.couponCode;
12435
      }
12436
    }
12437
 
12438
    public deleteCoupon_args deepCopy() {
12439
      return new deleteCoupon_args(this);
12440
    }
12441
 
12442
    @Override
12443
    public void clear() {
12444
      this.couponCode = null;
12445
    }
12446
 
12447
    public String getCouponCode() {
12448
      return this.couponCode;
12449
    }
12450
 
12451
    public void setCouponCode(String couponCode) {
12452
      this.couponCode = couponCode;
12453
    }
12454
 
12455
    public void unsetCouponCode() {
12456
      this.couponCode = null;
12457
    }
12458
 
12459
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
12460
    public boolean isSetCouponCode() {
12461
      return this.couponCode != null;
12462
    }
12463
 
12464
    public void setCouponCodeIsSet(boolean value) {
12465
      if (!value) {
12466
        this.couponCode = null;
12467
      }
12468
    }
12469
 
12470
    public void setFieldValue(_Fields field, Object value) {
12471
      switch (field) {
12472
      case COUPON_CODE:
12473
        if (value == null) {
12474
          unsetCouponCode();
12475
        } else {
12476
          setCouponCode((String)value);
12477
        }
12478
        break;
12479
 
12480
      }
12481
    }
12482
 
12483
    public Object getFieldValue(_Fields field) {
12484
      switch (field) {
12485
      case COUPON_CODE:
12486
        return getCouponCode();
12487
 
12488
      }
12489
      throw new IllegalStateException();
12490
    }
12491
 
12492
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12493
    public boolean isSet(_Fields field) {
12494
      if (field == null) {
12495
        throw new IllegalArgumentException();
12496
      }
12497
 
12498
      switch (field) {
12499
      case COUPON_CODE:
12500
        return isSetCouponCode();
12501
      }
12502
      throw new IllegalStateException();
12503
    }
12504
 
12505
    @Override
12506
    public boolean equals(Object that) {
12507
      if (that == null)
12508
        return false;
12509
      if (that instanceof deleteCoupon_args)
12510
        return this.equals((deleteCoupon_args)that);
12511
      return false;
12512
    }
12513
 
12514
    public boolean equals(deleteCoupon_args that) {
12515
      if (that == null)
12516
        return false;
12517
 
12518
      boolean this_present_couponCode = true && this.isSetCouponCode();
12519
      boolean that_present_couponCode = true && that.isSetCouponCode();
12520
      if (this_present_couponCode || that_present_couponCode) {
12521
        if (!(this_present_couponCode && that_present_couponCode))
12522
          return false;
12523
        if (!this.couponCode.equals(that.couponCode))
12524
          return false;
12525
      }
12526
 
12527
      return true;
12528
    }
12529
 
12530
    @Override
12531
    public int hashCode() {
12532
      return 0;
12533
    }
12534
 
12535
    public int compareTo(deleteCoupon_args other) {
12536
      if (!getClass().equals(other.getClass())) {
12537
        return getClass().getName().compareTo(other.getClass().getName());
12538
      }
12539
 
12540
      int lastComparison = 0;
12541
      deleteCoupon_args typedOther = (deleteCoupon_args)other;
12542
 
12543
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
12544
      if (lastComparison != 0) {
12545
        return lastComparison;
12546
      }
12547
      if (isSetCouponCode()) {
12548
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
12549
        if (lastComparison != 0) {
12550
          return lastComparison;
12551
        }
12552
      }
12553
      return 0;
12554
    }
12555
 
12556
    public _Fields fieldForId(int fieldId) {
12557
      return _Fields.findByThriftId(fieldId);
12558
    }
12559
 
12560
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12561
      org.apache.thrift.protocol.TField field;
12562
      iprot.readStructBegin();
12563
      while (true)
12564
      {
12565
        field = iprot.readFieldBegin();
12566
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12567
          break;
12568
        }
12569
        switch (field.id) {
12570
          case 1: // COUPON_CODE
12571
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
12572
              this.couponCode = iprot.readString();
12573
            } else { 
12574
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12575
            }
12576
            break;
12577
          default:
12578
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12579
        }
12580
        iprot.readFieldEnd();
12581
      }
12582
      iprot.readStructEnd();
12583
      validate();
12584
    }
12585
 
12586
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12587
      validate();
12588
 
12589
      oprot.writeStructBegin(STRUCT_DESC);
12590
      if (this.couponCode != null) {
12591
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
12592
        oprot.writeString(this.couponCode);
12593
        oprot.writeFieldEnd();
12594
      }
12595
      oprot.writeFieldStop();
12596
      oprot.writeStructEnd();
12597
    }
12598
 
12599
    @Override
12600
    public String toString() {
12601
      StringBuilder sb = new StringBuilder("deleteCoupon_args(");
12602
      boolean first = true;
12603
 
12604
      sb.append("couponCode:");
12605
      if (this.couponCode == null) {
12606
        sb.append("null");
12607
      } else {
12608
        sb.append(this.couponCode);
12609
      }
12610
      first = false;
12611
      sb.append(")");
12612
      return sb.toString();
12613
    }
12614
 
12615
    public void validate() throws org.apache.thrift.TException {
12616
      // check for required fields
12617
    }
12618
 
12619
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12620
      try {
12621
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12622
      } catch (org.apache.thrift.TException te) {
12623
        throw new java.io.IOException(te);
12624
      }
12625
    }
12626
 
12627
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12628
      try {
12629
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12630
      } catch (org.apache.thrift.TException te) {
12631
        throw new java.io.IOException(te);
12632
      }
12633
    }
12634
 
12635
  }
12636
 
12637
  public static class deleteCoupon_result implements org.apache.thrift.TBase<deleteCoupon_result, deleteCoupon_result._Fields>, java.io.Serializable, Cloneable   {
12638
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteCoupon_result");
12639
 
12640
    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);
12641
 
12642
    private PromotionException pex; // required
12643
 
12644
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12645
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12646
      PEX((short)1, "pex");
12647
 
12648
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12649
 
12650
      static {
12651
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12652
          byName.put(field.getFieldName(), field);
12653
        }
12654
      }
12655
 
12656
      /**
12657
       * Find the _Fields constant that matches fieldId, or null if its not found.
12658
       */
12659
      public static _Fields findByThriftId(int fieldId) {
12660
        switch(fieldId) {
12661
          case 1: // PEX
12662
            return PEX;
12663
          default:
12664
            return null;
12665
        }
12666
      }
12667
 
12668
      /**
12669
       * Find the _Fields constant that matches fieldId, throwing an exception
12670
       * if it is not found.
12671
       */
12672
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12673
        _Fields fields = findByThriftId(fieldId);
12674
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12675
        return fields;
12676
      }
12677
 
12678
      /**
12679
       * Find the _Fields constant that matches name, or null if its not found.
12680
       */
12681
      public static _Fields findByName(String name) {
12682
        return byName.get(name);
12683
      }
12684
 
12685
      private final short _thriftId;
12686
      private final String _fieldName;
12687
 
12688
      _Fields(short thriftId, String fieldName) {
12689
        _thriftId = thriftId;
12690
        _fieldName = fieldName;
12691
      }
12692
 
12693
      public short getThriftFieldId() {
12694
        return _thriftId;
12695
      }
12696
 
12697
      public String getFieldName() {
12698
        return _fieldName;
12699
      }
12700
    }
12701
 
12702
    // isset id assignments
12703
 
12704
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12705
    static {
12706
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12707
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12708
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
12709
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12710
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteCoupon_result.class, metaDataMap);
12711
    }
12712
 
12713
    public deleteCoupon_result() {
12714
    }
12715
 
12716
    public deleteCoupon_result(
12717
      PromotionException pex)
12718
    {
12719
      this();
12720
      this.pex = pex;
12721
    }
12722
 
12723
    /**
12724
     * Performs a deep copy on <i>other</i>.
12725
     */
12726
    public deleteCoupon_result(deleteCoupon_result other) {
12727
      if (other.isSetPex()) {
12728
        this.pex = new PromotionException(other.pex);
12729
      }
12730
    }
12731
 
12732
    public deleteCoupon_result deepCopy() {
12733
      return new deleteCoupon_result(this);
12734
    }
12735
 
12736
    @Override
12737
    public void clear() {
12738
      this.pex = null;
12739
    }
12740
 
12741
    public PromotionException getPex() {
12742
      return this.pex;
12743
    }
12744
 
12745
    public void setPex(PromotionException pex) {
12746
      this.pex = pex;
12747
    }
12748
 
12749
    public void unsetPex() {
12750
      this.pex = null;
12751
    }
12752
 
12753
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
12754
    public boolean isSetPex() {
12755
      return this.pex != null;
12756
    }
12757
 
12758
    public void setPexIsSet(boolean value) {
12759
      if (!value) {
12760
        this.pex = null;
12761
      }
12762
    }
12763
 
12764
    public void setFieldValue(_Fields field, Object value) {
12765
      switch (field) {
12766
      case PEX:
12767
        if (value == null) {
12768
          unsetPex();
12769
        } else {
12770
          setPex((PromotionException)value);
12771
        }
12772
        break;
12773
 
12774
      }
12775
    }
12776
 
12777
    public Object getFieldValue(_Fields field) {
12778
      switch (field) {
12779
      case PEX:
12780
        return getPex();
12781
 
12782
      }
12783
      throw new IllegalStateException();
12784
    }
12785
 
12786
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12787
    public boolean isSet(_Fields field) {
12788
      if (field == null) {
12789
        throw new IllegalArgumentException();
12790
      }
12791
 
12792
      switch (field) {
12793
      case PEX:
12794
        return isSetPex();
12795
      }
12796
      throw new IllegalStateException();
12797
    }
12798
 
12799
    @Override
12800
    public boolean equals(Object that) {
12801
      if (that == null)
12802
        return false;
12803
      if (that instanceof deleteCoupon_result)
12804
        return this.equals((deleteCoupon_result)that);
12805
      return false;
12806
    }
12807
 
12808
    public boolean equals(deleteCoupon_result that) {
12809
      if (that == null)
12810
        return false;
12811
 
12812
      boolean this_present_pex = true && this.isSetPex();
12813
      boolean that_present_pex = true && that.isSetPex();
12814
      if (this_present_pex || that_present_pex) {
12815
        if (!(this_present_pex && that_present_pex))
12816
          return false;
12817
        if (!this.pex.equals(that.pex))
12818
          return false;
12819
      }
12820
 
12821
      return true;
12822
    }
12823
 
12824
    @Override
12825
    public int hashCode() {
12826
      return 0;
12827
    }
12828
 
12829
    public int compareTo(deleteCoupon_result other) {
12830
      if (!getClass().equals(other.getClass())) {
12831
        return getClass().getName().compareTo(other.getClass().getName());
12832
      }
12833
 
12834
      int lastComparison = 0;
12835
      deleteCoupon_result typedOther = (deleteCoupon_result)other;
12836
 
12837
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
12838
      if (lastComparison != 0) {
12839
        return lastComparison;
12840
      }
12841
      if (isSetPex()) {
12842
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
12843
        if (lastComparison != 0) {
12844
          return lastComparison;
12845
        }
12846
      }
12847
      return 0;
12848
    }
12849
 
12850
    public _Fields fieldForId(int fieldId) {
12851
      return _Fields.findByThriftId(fieldId);
12852
    }
12853
 
12854
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12855
      org.apache.thrift.protocol.TField field;
12856
      iprot.readStructBegin();
12857
      while (true)
12858
      {
12859
        field = iprot.readFieldBegin();
12860
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12861
          break;
12862
        }
12863
        switch (field.id) {
12864
          case 1: // PEX
12865
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
12866
              this.pex = new PromotionException();
12867
              this.pex.read(iprot);
12868
            } else { 
12869
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12870
            }
12871
            break;
12872
          default:
12873
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12874
        }
12875
        iprot.readFieldEnd();
12876
      }
12877
      iprot.readStructEnd();
12878
      validate();
12879
    }
12880
 
12881
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12882
      oprot.writeStructBegin(STRUCT_DESC);
12883
 
12884
      if (this.isSetPex()) {
12885
        oprot.writeFieldBegin(PEX_FIELD_DESC);
12886
        this.pex.write(oprot);
12887
        oprot.writeFieldEnd();
12888
      }
12889
      oprot.writeFieldStop();
12890
      oprot.writeStructEnd();
12891
    }
12892
 
12893
    @Override
12894
    public String toString() {
12895
      StringBuilder sb = new StringBuilder("deleteCoupon_result(");
12896
      boolean first = true;
12897
 
12898
      sb.append("pex:");
12899
      if (this.pex == null) {
12900
        sb.append("null");
12901
      } else {
12902
        sb.append(this.pex);
12903
      }
12904
      first = false;
12905
      sb.append(")");
12906
      return sb.toString();
12907
    }
12908
 
12909
    public void validate() throws org.apache.thrift.TException {
12910
      // check for required fields
12911
    }
12912
 
12913
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12914
      try {
12915
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12916
      } catch (org.apache.thrift.TException te) {
12917
        throw new java.io.IOException(te);
12918
      }
12919
    }
12920
 
12921
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12922
      try {
12923
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12924
      } catch (org.apache.thrift.TException te) {
12925
        throw new java.io.IOException(te);
12926
      }
12927
    }
12928
 
12929
  }
12930
 
7092 amit.gupta 12931
  public static class getAllCouponsByPromotionId_args implements org.apache.thrift.TBase<getAllCouponsByPromotionId_args, getAllCouponsByPromotionId_args._Fields>, java.io.Serializable, Cloneable   {
12932
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllCouponsByPromotionId_args");
12933
 
12934
    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);
12935
 
12936
    private long promotionId; // required
12937
 
12938
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12939
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12940
      PROMOTION_ID((short)1, "promotionId");
12941
 
12942
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12943
 
12944
      static {
12945
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12946
          byName.put(field.getFieldName(), field);
12947
        }
12948
      }
12949
 
12950
      /**
12951
       * Find the _Fields constant that matches fieldId, or null if its not found.
12952
       */
12953
      public static _Fields findByThriftId(int fieldId) {
12954
        switch(fieldId) {
12955
          case 1: // PROMOTION_ID
12956
            return PROMOTION_ID;
12957
          default:
12958
            return null;
12959
        }
12960
      }
12961
 
12962
      /**
12963
       * Find the _Fields constant that matches fieldId, throwing an exception
12964
       * if it is not found.
12965
       */
12966
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12967
        _Fields fields = findByThriftId(fieldId);
12968
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12969
        return fields;
12970
      }
12971
 
12972
      /**
12973
       * Find the _Fields constant that matches name, or null if its not found.
12974
       */
12975
      public static _Fields findByName(String name) {
12976
        return byName.get(name);
12977
      }
12978
 
12979
      private final short _thriftId;
12980
      private final String _fieldName;
12981
 
12982
      _Fields(short thriftId, String fieldName) {
12983
        _thriftId = thriftId;
12984
        _fieldName = fieldName;
12985
      }
12986
 
12987
      public short getThriftFieldId() {
12988
        return _thriftId;
12989
      }
12990
 
12991
      public String getFieldName() {
12992
        return _fieldName;
12993
      }
12994
    }
12995
 
12996
    // isset id assignments
12997
    private static final int __PROMOTIONID_ISSET_ID = 0;
12998
    private BitSet __isset_bit_vector = new BitSet(1);
12999
 
13000
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
13001
    static {
13002
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13003
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13004
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
13005
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13006
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllCouponsByPromotionId_args.class, metaDataMap);
13007
    }
13008
 
13009
    public getAllCouponsByPromotionId_args() {
13010
    }
13011
 
13012
    public getAllCouponsByPromotionId_args(
13013
      long promotionId)
13014
    {
13015
      this();
13016
      this.promotionId = promotionId;
13017
      setPromotionIdIsSet(true);
13018
    }
13019
 
13020
    /**
13021
     * Performs a deep copy on <i>other</i>.
13022
     */
13023
    public getAllCouponsByPromotionId_args(getAllCouponsByPromotionId_args other) {
13024
      __isset_bit_vector.clear();
13025
      __isset_bit_vector.or(other.__isset_bit_vector);
13026
      this.promotionId = other.promotionId;
13027
    }
13028
 
13029
    public getAllCouponsByPromotionId_args deepCopy() {
13030
      return new getAllCouponsByPromotionId_args(this);
13031
    }
13032
 
13033
    @Override
13034
    public void clear() {
13035
      setPromotionIdIsSet(false);
13036
      this.promotionId = 0;
13037
    }
13038
 
13039
    public long getPromotionId() {
13040
      return this.promotionId;
13041
    }
13042
 
13043
    public void setPromotionId(long promotionId) {
13044
      this.promotionId = promotionId;
13045
      setPromotionIdIsSet(true);
13046
    }
13047
 
13048
    public void unsetPromotionId() {
13049
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
13050
    }
13051
 
13052
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
13053
    public boolean isSetPromotionId() {
13054
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
13055
    }
13056
 
13057
    public void setPromotionIdIsSet(boolean value) {
13058
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
13059
    }
13060
 
13061
    public void setFieldValue(_Fields field, Object value) {
13062
      switch (field) {
13063
      case PROMOTION_ID:
13064
        if (value == null) {
13065
          unsetPromotionId();
13066
        } else {
13067
          setPromotionId((Long)value);
13068
        }
13069
        break;
13070
 
13071
      }
13072
    }
13073
 
13074
    public Object getFieldValue(_Fields field) {
13075
      switch (field) {
13076
      case PROMOTION_ID:
13077
        return Long.valueOf(getPromotionId());
13078
 
13079
      }
13080
      throw new IllegalStateException();
13081
    }
13082
 
13083
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13084
    public boolean isSet(_Fields field) {
13085
      if (field == null) {
13086
        throw new IllegalArgumentException();
13087
      }
13088
 
13089
      switch (field) {
13090
      case PROMOTION_ID:
13091
        return isSetPromotionId();
13092
      }
13093
      throw new IllegalStateException();
13094
    }
13095
 
13096
    @Override
13097
    public boolean equals(Object that) {
13098
      if (that == null)
13099
        return false;
13100
      if (that instanceof getAllCouponsByPromotionId_args)
13101
        return this.equals((getAllCouponsByPromotionId_args)that);
13102
      return false;
13103
    }
13104
 
13105
    public boolean equals(getAllCouponsByPromotionId_args that) {
13106
      if (that == null)
13107
        return false;
13108
 
13109
      boolean this_present_promotionId = true;
13110
      boolean that_present_promotionId = true;
13111
      if (this_present_promotionId || that_present_promotionId) {
13112
        if (!(this_present_promotionId && that_present_promotionId))
13113
          return false;
13114
        if (this.promotionId != that.promotionId)
13115
          return false;
13116
      }
13117
 
13118
      return true;
13119
    }
13120
 
13121
    @Override
13122
    public int hashCode() {
13123
      return 0;
13124
    }
13125
 
13126
    public int compareTo(getAllCouponsByPromotionId_args other) {
13127
      if (!getClass().equals(other.getClass())) {
13128
        return getClass().getName().compareTo(other.getClass().getName());
13129
      }
13130
 
13131
      int lastComparison = 0;
13132
      getAllCouponsByPromotionId_args typedOther = (getAllCouponsByPromotionId_args)other;
13133
 
13134
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
13135
      if (lastComparison != 0) {
13136
        return lastComparison;
13137
      }
13138
      if (isSetPromotionId()) {
13139
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
13140
        if (lastComparison != 0) {
13141
          return lastComparison;
13142
        }
13143
      }
13144
      return 0;
13145
    }
13146
 
13147
    public _Fields fieldForId(int fieldId) {
13148
      return _Fields.findByThriftId(fieldId);
13149
    }
13150
 
13151
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13152
      org.apache.thrift.protocol.TField field;
13153
      iprot.readStructBegin();
13154
      while (true)
13155
      {
13156
        field = iprot.readFieldBegin();
13157
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
13158
          break;
13159
        }
13160
        switch (field.id) {
13161
          case 1: // PROMOTION_ID
13162
            if (field.type == org.apache.thrift.protocol.TType.I64) {
13163
              this.promotionId = iprot.readI64();
13164
              setPromotionIdIsSet(true);
13165
            } else { 
13166
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13167
            }
13168
            break;
13169
          default:
13170
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13171
        }
13172
        iprot.readFieldEnd();
13173
      }
13174
      iprot.readStructEnd();
13175
      validate();
13176
    }
13177
 
13178
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
13179
      validate();
13180
 
13181
      oprot.writeStructBegin(STRUCT_DESC);
13182
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
13183
      oprot.writeI64(this.promotionId);
13184
      oprot.writeFieldEnd();
13185
      oprot.writeFieldStop();
13186
      oprot.writeStructEnd();
13187
    }
13188
 
13189
    @Override
13190
    public String toString() {
13191
      StringBuilder sb = new StringBuilder("getAllCouponsByPromotionId_args(");
13192
      boolean first = true;
13193
 
13194
      sb.append("promotionId:");
13195
      sb.append(this.promotionId);
13196
      first = false;
13197
      sb.append(")");
13198
      return sb.toString();
13199
    }
13200
 
13201
    public void validate() throws org.apache.thrift.TException {
13202
      // check for required fields
13203
    }
13204
 
13205
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13206
      try {
13207
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13208
      } catch (org.apache.thrift.TException te) {
13209
        throw new java.io.IOException(te);
13210
      }
13211
    }
13212
 
13213
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13214
      try {
13215
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
13216
        __isset_bit_vector = new BitSet(1);
13217
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13218
      } catch (org.apache.thrift.TException te) {
13219
        throw new java.io.IOException(te);
13220
      }
13221
    }
13222
 
13223
  }
13224
 
13225
  public static class getAllCouponsByPromotionId_result implements org.apache.thrift.TBase<getAllCouponsByPromotionId_result, getAllCouponsByPromotionId_result._Fields>, java.io.Serializable, Cloneable   {
13226
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllCouponsByPromotionId_result");
13227
 
13228
    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);
13229
    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);
13230
 
13231
    private List<Coupon> success; // required
13232
    private PromotionException pex; // required
13233
 
13234
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
13235
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
13236
      SUCCESS((short)0, "success"),
13237
      PEX((short)1, "pex");
13238
 
13239
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13240
 
13241
      static {
13242
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13243
          byName.put(field.getFieldName(), field);
13244
        }
13245
      }
13246
 
13247
      /**
13248
       * Find the _Fields constant that matches fieldId, or null if its not found.
13249
       */
13250
      public static _Fields findByThriftId(int fieldId) {
13251
        switch(fieldId) {
13252
          case 0: // SUCCESS
13253
            return SUCCESS;
13254
          case 1: // PEX
13255
            return PEX;
13256
          default:
13257
            return null;
13258
        }
13259
      }
13260
 
13261
      /**
13262
       * Find the _Fields constant that matches fieldId, throwing an exception
13263
       * if it is not found.
13264
       */
13265
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13266
        _Fields fields = findByThriftId(fieldId);
13267
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13268
        return fields;
13269
      }
13270
 
13271
      /**
13272
       * Find the _Fields constant that matches name, or null if its not found.
13273
       */
13274
      public static _Fields findByName(String name) {
13275
        return byName.get(name);
13276
      }
13277
 
13278
      private final short _thriftId;
13279
      private final String _fieldName;
13280
 
13281
      _Fields(short thriftId, String fieldName) {
13282
        _thriftId = thriftId;
13283
        _fieldName = fieldName;
13284
      }
13285
 
13286
      public short getThriftFieldId() {
13287
        return _thriftId;
13288
      }
13289
 
13290
      public String getFieldName() {
13291
        return _fieldName;
13292
      }
13293
    }
13294
 
13295
    // isset id assignments
13296
 
13297
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
13298
    static {
13299
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13300
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13301
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
13302
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
13303
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13304
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
13305
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13306
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllCouponsByPromotionId_result.class, metaDataMap);
13307
    }
13308
 
13309
    public getAllCouponsByPromotionId_result() {
13310
    }
13311
 
13312
    public getAllCouponsByPromotionId_result(
13313
      List<Coupon> success,
13314
      PromotionException pex)
13315
    {
13316
      this();
13317
      this.success = success;
13318
      this.pex = pex;
13319
    }
13320
 
13321
    /**
13322
     * Performs a deep copy on <i>other</i>.
13323
     */
13324
    public getAllCouponsByPromotionId_result(getAllCouponsByPromotionId_result other) {
13325
      if (other.isSetSuccess()) {
13326
        List<Coupon> __this__success = new ArrayList<Coupon>();
13327
        for (Coupon other_element : other.success) {
13328
          __this__success.add(new Coupon(other_element));
13329
        }
13330
        this.success = __this__success;
13331
      }
13332
      if (other.isSetPex()) {
13333
        this.pex = new PromotionException(other.pex);
13334
      }
13335
    }
13336
 
13337
    public getAllCouponsByPromotionId_result deepCopy() {
13338
      return new getAllCouponsByPromotionId_result(this);
13339
    }
13340
 
13341
    @Override
13342
    public void clear() {
13343
      this.success = null;
13344
      this.pex = null;
13345
    }
13346
 
13347
    public int getSuccessSize() {
13348
      return (this.success == null) ? 0 : this.success.size();
13349
    }
13350
 
13351
    public java.util.Iterator<Coupon> getSuccessIterator() {
13352
      return (this.success == null) ? null : this.success.iterator();
13353
    }
13354
 
13355
    public void addToSuccess(Coupon elem) {
13356
      if (this.success == null) {
13357
        this.success = new ArrayList<Coupon>();
13358
      }
13359
      this.success.add(elem);
13360
    }
13361
 
13362
    public List<Coupon> getSuccess() {
13363
      return this.success;
13364
    }
13365
 
13366
    public void setSuccess(List<Coupon> success) {
13367
      this.success = success;
13368
    }
13369
 
13370
    public void unsetSuccess() {
13371
      this.success = null;
13372
    }
13373
 
13374
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
13375
    public boolean isSetSuccess() {
13376
      return this.success != null;
13377
    }
13378
 
13379
    public void setSuccessIsSet(boolean value) {
13380
      if (!value) {
13381
        this.success = null;
13382
      }
13383
    }
13384
 
13385
    public PromotionException getPex() {
13386
      return this.pex;
13387
    }
13388
 
13389
    public void setPex(PromotionException pex) {
13390
      this.pex = pex;
13391
    }
13392
 
13393
    public void unsetPex() {
13394
      this.pex = null;
13395
    }
13396
 
13397
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
13398
    public boolean isSetPex() {
13399
      return this.pex != null;
13400
    }
13401
 
13402
    public void setPexIsSet(boolean value) {
13403
      if (!value) {
13404
        this.pex = null;
13405
      }
13406
    }
13407
 
13408
    public void setFieldValue(_Fields field, Object value) {
13409
      switch (field) {
13410
      case SUCCESS:
13411
        if (value == null) {
13412
          unsetSuccess();
13413
        } else {
13414
          setSuccess((List<Coupon>)value);
13415
        }
13416
        break;
13417
 
13418
      case PEX:
13419
        if (value == null) {
13420
          unsetPex();
13421
        } else {
13422
          setPex((PromotionException)value);
13423
        }
13424
        break;
13425
 
13426
      }
13427
    }
13428
 
13429
    public Object getFieldValue(_Fields field) {
13430
      switch (field) {
13431
      case SUCCESS:
13432
        return getSuccess();
13433
 
13434
      case PEX:
13435
        return getPex();
13436
 
13437
      }
13438
      throw new IllegalStateException();
13439
    }
13440
 
13441
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13442
    public boolean isSet(_Fields field) {
13443
      if (field == null) {
13444
        throw new IllegalArgumentException();
13445
      }
13446
 
13447
      switch (field) {
13448
      case SUCCESS:
13449
        return isSetSuccess();
13450
      case PEX:
13451
        return isSetPex();
13452
      }
13453
      throw new IllegalStateException();
13454
    }
13455
 
13456
    @Override
13457
    public boolean equals(Object that) {
13458
      if (that == null)
13459
        return false;
13460
      if (that instanceof getAllCouponsByPromotionId_result)
13461
        return this.equals((getAllCouponsByPromotionId_result)that);
13462
      return false;
13463
    }
13464
 
13465
    public boolean equals(getAllCouponsByPromotionId_result that) {
13466
      if (that == null)
13467
        return false;
13468
 
13469
      boolean this_present_success = true && this.isSetSuccess();
13470
      boolean that_present_success = true && that.isSetSuccess();
13471
      if (this_present_success || that_present_success) {
13472
        if (!(this_present_success && that_present_success))
13473
          return false;
13474
        if (!this.success.equals(that.success))
13475
          return false;
13476
      }
13477
 
13478
      boolean this_present_pex = true && this.isSetPex();
13479
      boolean that_present_pex = true && that.isSetPex();
13480
      if (this_present_pex || that_present_pex) {
13481
        if (!(this_present_pex && that_present_pex))
13482
          return false;
13483
        if (!this.pex.equals(that.pex))
13484
          return false;
13485
      }
13486
 
13487
      return true;
13488
    }
13489
 
13490
    @Override
13491
    public int hashCode() {
13492
      return 0;
13493
    }
13494
 
13495
    public int compareTo(getAllCouponsByPromotionId_result other) {
13496
      if (!getClass().equals(other.getClass())) {
13497
        return getClass().getName().compareTo(other.getClass().getName());
13498
      }
13499
 
13500
      int lastComparison = 0;
13501
      getAllCouponsByPromotionId_result typedOther = (getAllCouponsByPromotionId_result)other;
13502
 
13503
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
13504
      if (lastComparison != 0) {
13505
        return lastComparison;
13506
      }
13507
      if (isSetSuccess()) {
13508
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
13509
        if (lastComparison != 0) {
13510
          return lastComparison;
13511
        }
13512
      }
13513
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
13514
      if (lastComparison != 0) {
13515
        return lastComparison;
13516
      }
13517
      if (isSetPex()) {
13518
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
13519
        if (lastComparison != 0) {
13520
          return lastComparison;
13521
        }
13522
      }
13523
      return 0;
13524
    }
13525
 
13526
    public _Fields fieldForId(int fieldId) {
13527
      return _Fields.findByThriftId(fieldId);
13528
    }
13529
 
13530
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13531
      org.apache.thrift.protocol.TField field;
13532
      iprot.readStructBegin();
13533
      while (true)
13534
      {
13535
        field = iprot.readFieldBegin();
13536
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
13537
          break;
13538
        }
13539
        switch (field.id) {
13540
          case 0: // SUCCESS
13541
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
13542
              {
11592 amit.gupta 13543
                org.apache.thrift.protocol.TList _list34 = iprot.readListBegin();
13544
                this.success = new ArrayList<Coupon>(_list34.size);
13545
                for (int _i35 = 0; _i35 < _list34.size; ++_i35)
7092 amit.gupta 13546
                {
11592 amit.gupta 13547
                  Coupon _elem36; // required
13548
                  _elem36 = new Coupon();
13549
                  _elem36.read(iprot);
13550
                  this.success.add(_elem36);
7092 amit.gupta 13551
                }
13552
                iprot.readListEnd();
13553
              }
13554
            } else { 
13555
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13556
            }
13557
            break;
13558
          case 1: // PEX
13559
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
13560
              this.pex = new PromotionException();
13561
              this.pex.read(iprot);
13562
            } else { 
13563
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13564
            }
13565
            break;
13566
          default:
13567
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13568
        }
13569
        iprot.readFieldEnd();
13570
      }
13571
      iprot.readStructEnd();
13572
      validate();
13573
    }
13574
 
13575
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
13576
      oprot.writeStructBegin(STRUCT_DESC);
13577
 
13578
      if (this.isSetSuccess()) {
13579
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
13580
        {
13581
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
11592 amit.gupta 13582
          for (Coupon _iter37 : this.success)
7092 amit.gupta 13583
          {
11592 amit.gupta 13584
            _iter37.write(oprot);
7092 amit.gupta 13585
          }
13586
          oprot.writeListEnd();
13587
        }
13588
        oprot.writeFieldEnd();
13589
      } else if (this.isSetPex()) {
13590
        oprot.writeFieldBegin(PEX_FIELD_DESC);
13591
        this.pex.write(oprot);
13592
        oprot.writeFieldEnd();
13593
      }
13594
      oprot.writeFieldStop();
13595
      oprot.writeStructEnd();
13596
    }
13597
 
13598
    @Override
13599
    public String toString() {
13600
      StringBuilder sb = new StringBuilder("getAllCouponsByPromotionId_result(");
13601
      boolean first = true;
13602
 
13603
      sb.append("success:");
13604
      if (this.success == null) {
13605
        sb.append("null");
13606
      } else {
13607
        sb.append(this.success);
13608
      }
13609
      first = false;
13610
      if (!first) sb.append(", ");
13611
      sb.append("pex:");
13612
      if (this.pex == null) {
13613
        sb.append("null");
13614
      } else {
13615
        sb.append(this.pex);
13616
      }
13617
      first = false;
13618
      sb.append(")");
13619
      return sb.toString();
13620
    }
13621
 
13622
    public void validate() throws org.apache.thrift.TException {
13623
      // check for required fields
13624
    }
13625
 
13626
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13627
      try {
13628
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13629
      } catch (org.apache.thrift.TException te) {
13630
        throw new java.io.IOException(te);
13631
      }
13632
    }
13633
 
13634
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13635
      try {
13636
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13637
      } catch (org.apache.thrift.TException te) {
13638
        throw new java.io.IOException(te);
13639
      }
13640
    }
13641
 
13642
  }
13643
 
3430 rajveer 13644
  public static class getActiveCoupons_args implements org.apache.thrift.TBase<getActiveCoupons_args, getActiveCoupons_args._Fields>, java.io.Serializable, Cloneable   {
13645
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_args");
3385 varun.gupt 13646
 
13647
 
13648
 
13649
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 13650
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 13651
;
13652
 
13653
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13654
 
13655
      static {
13656
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13657
          byName.put(field.getFieldName(), field);
13658
        }
13659
      }
13660
 
13661
      /**
13662
       * Find the _Fields constant that matches fieldId, or null if its not found.
13663
       */
13664
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 13665
        switch(fieldId) {
13666
          default:
13667
            return null;
13668
        }
3385 varun.gupt 13669
      }
13670
 
13671
      /**
13672
       * Find the _Fields constant that matches fieldId, throwing an exception
13673
       * if it is not found.
13674
       */
13675
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13676
        _Fields fields = findByThriftId(fieldId);
13677
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13678
        return fields;
13679
      }
13680
 
13681
      /**
13682
       * Find the _Fields constant that matches name, or null if its not found.
13683
       */
13684
      public static _Fields findByName(String name) {
13685
        return byName.get(name);
13686
      }
13687
 
13688
      private final short _thriftId;
13689
      private final String _fieldName;
13690
 
13691
      _Fields(short thriftId, String fieldName) {
13692
        _thriftId = thriftId;
13693
        _fieldName = fieldName;
13694
      }
13695
 
13696
      public short getThriftFieldId() {
13697
        return _thriftId;
13698
      }
13699
 
13700
      public String getFieldName() {
13701
        return _fieldName;
13702
      }
13703
    }
3430 rajveer 13704
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 13705
    static {
3430 rajveer 13706
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13707
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13708
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_args.class, metaDataMap);
3385 varun.gupt 13709
    }
13710
 
13711
    public getActiveCoupons_args() {
13712
    }
13713
 
13714
    /**
13715
     * Performs a deep copy on <i>other</i>.
13716
     */
13717
    public getActiveCoupons_args(getActiveCoupons_args other) {
13718
    }
13719
 
13720
    public getActiveCoupons_args deepCopy() {
13721
      return new getActiveCoupons_args(this);
13722
    }
13723
 
3430 rajveer 13724
    @Override
13725
    public void clear() {
3385 varun.gupt 13726
    }
13727
 
13728
    public void setFieldValue(_Fields field, Object value) {
13729
      switch (field) {
13730
      }
13731
    }
13732
 
13733
    public Object getFieldValue(_Fields field) {
13734
      switch (field) {
13735
      }
13736
      throw new IllegalStateException();
13737
    }
13738
 
3430 rajveer 13739
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13740
    public boolean isSet(_Fields field) {
13741
      if (field == null) {
13742
        throw new IllegalArgumentException();
13743
      }
3385 varun.gupt 13744
 
13745
      switch (field) {
13746
      }
13747
      throw new IllegalStateException();
13748
    }
13749
 
13750
    @Override
13751
    public boolean equals(Object that) {
13752
      if (that == null)
13753
        return false;
13754
      if (that instanceof getActiveCoupons_args)
13755
        return this.equals((getActiveCoupons_args)that);
13756
      return false;
13757
    }
13758
 
13759
    public boolean equals(getActiveCoupons_args that) {
13760
      if (that == null)
13761
        return false;
13762
 
13763
      return true;
13764
    }
13765
 
13766
    @Override
13767
    public int hashCode() {
13768
      return 0;
13769
    }
13770
 
13771
    public int compareTo(getActiveCoupons_args other) {
13772
      if (!getClass().equals(other.getClass())) {
13773
        return getClass().getName().compareTo(other.getClass().getName());
13774
      }
13775
 
13776
      int lastComparison = 0;
13777
      getActiveCoupons_args typedOther = (getActiveCoupons_args)other;
13778
 
13779
      return 0;
13780
    }
13781
 
3430 rajveer 13782
    public _Fields fieldForId(int fieldId) {
13783
      return _Fields.findByThriftId(fieldId);
13784
    }
13785
 
13786
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13787
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 13788
      iprot.readStructBegin();
13789
      while (true)
13790
      {
13791
        field = iprot.readFieldBegin();
3430 rajveer 13792
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 13793
          break;
13794
        }
3430 rajveer 13795
        switch (field.id) {
13796
          default:
13797
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 13798
        }
3430 rajveer 13799
        iprot.readFieldEnd();
3385 varun.gupt 13800
      }
13801
      iprot.readStructEnd();
13802
      validate();
13803
    }
13804
 
3430 rajveer 13805
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 13806
      validate();
13807
 
13808
      oprot.writeStructBegin(STRUCT_DESC);
13809
      oprot.writeFieldStop();
13810
      oprot.writeStructEnd();
13811
    }
13812
 
13813
    @Override
13814
    public String toString() {
13815
      StringBuilder sb = new StringBuilder("getActiveCoupons_args(");
13816
      boolean first = true;
13817
 
13818
      sb.append(")");
13819
      return sb.toString();
13820
    }
13821
 
3430 rajveer 13822
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 13823
      // check for required fields
13824
    }
13825
 
3430 rajveer 13826
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13827
      try {
13828
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13829
      } catch (org.apache.thrift.TException te) {
13830
        throw new java.io.IOException(te);
13831
      }
13832
    }
13833
 
13834
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13835
      try {
13836
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13837
      } catch (org.apache.thrift.TException te) {
13838
        throw new java.io.IOException(te);
13839
      }
13840
    }
13841
 
3385 varun.gupt 13842
  }
13843
 
3430 rajveer 13844
  public static class getActiveCoupons_result implements org.apache.thrift.TBase<getActiveCoupons_result, getActiveCoupons_result._Fields>, java.io.Serializable, Cloneable   {
13845
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_result");
3385 varun.gupt 13846
 
3430 rajveer 13847
    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);
13848
    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 13849
 
3430 rajveer 13850
    private List<Coupon> success; // required
13851
    private PromotionException pex; // required
3385 varun.gupt 13852
 
13853
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 13854
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 13855
      SUCCESS((short)0, "success"),
13856
      PEX((short)1, "pex");
13857
 
13858
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13859
 
13860
      static {
13861
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13862
          byName.put(field.getFieldName(), field);
13863
        }
13864
      }
13865
 
13866
      /**
13867
       * Find the _Fields constant that matches fieldId, or null if its not found.
13868
       */
13869
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 13870
        switch(fieldId) {
13871
          case 0: // SUCCESS
13872
            return SUCCESS;
13873
          case 1: // PEX
13874
            return PEX;
13875
          default:
13876
            return null;
13877
        }
3385 varun.gupt 13878
      }
13879
 
13880
      /**
13881
       * Find the _Fields constant that matches fieldId, throwing an exception
13882
       * if it is not found.
13883
       */
13884
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13885
        _Fields fields = findByThriftId(fieldId);
13886
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13887
        return fields;
13888
      }
13889
 
13890
      /**
13891
       * Find the _Fields constant that matches name, or null if its not found.
13892
       */
13893
      public static _Fields findByName(String name) {
13894
        return byName.get(name);
13895
      }
13896
 
13897
      private final short _thriftId;
13898
      private final String _fieldName;
13899
 
13900
      _Fields(short thriftId, String fieldName) {
13901
        _thriftId = thriftId;
13902
        _fieldName = fieldName;
13903
      }
13904
 
13905
      public short getThriftFieldId() {
13906
        return _thriftId;
13907
      }
13908
 
13909
      public String getFieldName() {
13910
        return _fieldName;
13911
      }
13912
    }
13913
 
13914
    // isset id assignments
13915
 
3430 rajveer 13916
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 13917
    static {
3430 rajveer 13918
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13919
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13920
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
13921
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
13922
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13923
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
13924
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13925
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_result.class, metaDataMap);
3385 varun.gupt 13926
    }
13927
 
13928
    public getActiveCoupons_result() {
13929
    }
13930
 
13931
    public getActiveCoupons_result(
13932
      List<Coupon> success,
13933
      PromotionException pex)
13934
    {
13935
      this();
13936
      this.success = success;
13937
      this.pex = pex;
13938
    }
13939
 
13940
    /**
13941
     * Performs a deep copy on <i>other</i>.
13942
     */
13943
    public getActiveCoupons_result(getActiveCoupons_result other) {
13944
      if (other.isSetSuccess()) {
13945
        List<Coupon> __this__success = new ArrayList<Coupon>();
13946
        for (Coupon other_element : other.success) {
13947
          __this__success.add(new Coupon(other_element));
13948
        }
13949
        this.success = __this__success;
13950
      }
13951
      if (other.isSetPex()) {
13952
        this.pex = new PromotionException(other.pex);
13953
      }
13954
    }
13955
 
13956
    public getActiveCoupons_result deepCopy() {
13957
      return new getActiveCoupons_result(this);
13958
    }
13959
 
3430 rajveer 13960
    @Override
13961
    public void clear() {
13962
      this.success = null;
13963
      this.pex = null;
3385 varun.gupt 13964
    }
13965
 
13966
    public int getSuccessSize() {
13967
      return (this.success == null) ? 0 : this.success.size();
13968
    }
13969
 
13970
    public java.util.Iterator<Coupon> getSuccessIterator() {
13971
      return (this.success == null) ? null : this.success.iterator();
13972
    }
13973
 
13974
    public void addToSuccess(Coupon elem) {
13975
      if (this.success == null) {
13976
        this.success = new ArrayList<Coupon>();
13977
      }
13978
      this.success.add(elem);
13979
    }
13980
 
13981
    public List<Coupon> getSuccess() {
13982
      return this.success;
13983
    }
13984
 
3430 rajveer 13985
    public void setSuccess(List<Coupon> success) {
3385 varun.gupt 13986
      this.success = success;
13987
    }
13988
 
13989
    public void unsetSuccess() {
13990
      this.success = null;
13991
    }
13992
 
3430 rajveer 13993
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 13994
    public boolean isSetSuccess() {
13995
      return this.success != null;
13996
    }
13997
 
13998
    public void setSuccessIsSet(boolean value) {
13999
      if (!value) {
14000
        this.success = null;
14001
      }
14002
    }
14003
 
14004
    public PromotionException getPex() {
14005
      return this.pex;
14006
    }
14007
 
3430 rajveer 14008
    public void setPex(PromotionException pex) {
3385 varun.gupt 14009
      this.pex = pex;
14010
    }
14011
 
14012
    public void unsetPex() {
14013
      this.pex = null;
14014
    }
14015
 
3430 rajveer 14016
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 14017
    public boolean isSetPex() {
14018
      return this.pex != null;
14019
    }
14020
 
14021
    public void setPexIsSet(boolean value) {
14022
      if (!value) {
14023
        this.pex = null;
14024
      }
14025
    }
14026
 
14027
    public void setFieldValue(_Fields field, Object value) {
14028
      switch (field) {
14029
      case SUCCESS:
14030
        if (value == null) {
14031
          unsetSuccess();
14032
        } else {
14033
          setSuccess((List<Coupon>)value);
14034
        }
14035
        break;
14036
 
14037
      case PEX:
14038
        if (value == null) {
14039
          unsetPex();
14040
        } else {
14041
          setPex((PromotionException)value);
14042
        }
14043
        break;
14044
 
14045
      }
14046
    }
14047
 
14048
    public Object getFieldValue(_Fields field) {
14049
      switch (field) {
14050
      case SUCCESS:
14051
        return getSuccess();
14052
 
14053
      case PEX:
14054
        return getPex();
14055
 
14056
      }
14057
      throw new IllegalStateException();
14058
    }
14059
 
3430 rajveer 14060
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14061
    public boolean isSet(_Fields field) {
14062
      if (field == null) {
14063
        throw new IllegalArgumentException();
14064
      }
3385 varun.gupt 14065
 
14066
      switch (field) {
14067
      case SUCCESS:
14068
        return isSetSuccess();
14069
      case PEX:
14070
        return isSetPex();
14071
      }
14072
      throw new IllegalStateException();
14073
    }
14074
 
14075
    @Override
14076
    public boolean equals(Object that) {
14077
      if (that == null)
14078
        return false;
14079
      if (that instanceof getActiveCoupons_result)
14080
        return this.equals((getActiveCoupons_result)that);
14081
      return false;
14082
    }
14083
 
14084
    public boolean equals(getActiveCoupons_result that) {
14085
      if (that == null)
14086
        return false;
14087
 
14088
      boolean this_present_success = true && this.isSetSuccess();
14089
      boolean that_present_success = true && that.isSetSuccess();
14090
      if (this_present_success || that_present_success) {
14091
        if (!(this_present_success && that_present_success))
14092
          return false;
14093
        if (!this.success.equals(that.success))
14094
          return false;
14095
      }
14096
 
14097
      boolean this_present_pex = true && this.isSetPex();
14098
      boolean that_present_pex = true && that.isSetPex();
14099
      if (this_present_pex || that_present_pex) {
14100
        if (!(this_present_pex && that_present_pex))
14101
          return false;
14102
        if (!this.pex.equals(that.pex))
14103
          return false;
14104
      }
14105
 
14106
      return true;
14107
    }
14108
 
14109
    @Override
14110
    public int hashCode() {
14111
      return 0;
14112
    }
14113
 
14114
    public int compareTo(getActiveCoupons_result other) {
14115
      if (!getClass().equals(other.getClass())) {
14116
        return getClass().getName().compareTo(other.getClass().getName());
14117
      }
14118
 
14119
      int lastComparison = 0;
14120
      getActiveCoupons_result typedOther = (getActiveCoupons_result)other;
14121
 
3430 rajveer 14122
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 14123
      if (lastComparison != 0) {
14124
        return lastComparison;
14125
      }
3430 rajveer 14126
      if (isSetSuccess()) {
14127
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
14128
        if (lastComparison != 0) {
14129
          return lastComparison;
14130
        }
3385 varun.gupt 14131
      }
3430 rajveer 14132
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 14133
      if (lastComparison != 0) {
14134
        return lastComparison;
14135
      }
3430 rajveer 14136
      if (isSetPex()) {
14137
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
14138
        if (lastComparison != 0) {
14139
          return lastComparison;
14140
        }
3385 varun.gupt 14141
      }
14142
      return 0;
14143
    }
14144
 
3430 rajveer 14145
    public _Fields fieldForId(int fieldId) {
14146
      return _Fields.findByThriftId(fieldId);
14147
    }
14148
 
14149
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14150
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 14151
      iprot.readStructBegin();
14152
      while (true)
14153
      {
14154
        field = iprot.readFieldBegin();
3430 rajveer 14155
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 14156
          break;
14157
        }
3430 rajveer 14158
        switch (field.id) {
14159
          case 0: // SUCCESS
14160
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
14161
              {
11592 amit.gupta 14162
                org.apache.thrift.protocol.TList _list38 = iprot.readListBegin();
14163
                this.success = new ArrayList<Coupon>(_list38.size);
14164
                for (int _i39 = 0; _i39 < _list38.size; ++_i39)
3385 varun.gupt 14165
                {
11592 amit.gupta 14166
                  Coupon _elem40; // required
14167
                  _elem40 = new Coupon();
14168
                  _elem40.read(iprot);
14169
                  this.success.add(_elem40);
3385 varun.gupt 14170
                }
3430 rajveer 14171
                iprot.readListEnd();
3385 varun.gupt 14172
              }
3430 rajveer 14173
            } else { 
14174
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14175
            }
14176
            break;
14177
          case 1: // PEX
14178
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
14179
              this.pex = new PromotionException();
14180
              this.pex.read(iprot);
14181
            } else { 
14182
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14183
            }
14184
            break;
14185
          default:
14186
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 14187
        }
3430 rajveer 14188
        iprot.readFieldEnd();
3385 varun.gupt 14189
      }
14190
      iprot.readStructEnd();
14191
      validate();
14192
    }
14193
 
3430 rajveer 14194
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 14195
      oprot.writeStructBegin(STRUCT_DESC);
14196
 
14197
      if (this.isSetSuccess()) {
14198
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
14199
        {
3430 rajveer 14200
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
11592 amit.gupta 14201
          for (Coupon _iter41 : this.success)
3385 varun.gupt 14202
          {
11592 amit.gupta 14203
            _iter41.write(oprot);
3385 varun.gupt 14204
          }
14205
          oprot.writeListEnd();
14206
        }
14207
        oprot.writeFieldEnd();
14208
      } else if (this.isSetPex()) {
14209
        oprot.writeFieldBegin(PEX_FIELD_DESC);
14210
        this.pex.write(oprot);
14211
        oprot.writeFieldEnd();
14212
      }
14213
      oprot.writeFieldStop();
14214
      oprot.writeStructEnd();
14215
    }
14216
 
14217
    @Override
14218
    public String toString() {
14219
      StringBuilder sb = new StringBuilder("getActiveCoupons_result(");
14220
      boolean first = true;
14221
 
14222
      sb.append("success:");
14223
      if (this.success == null) {
14224
        sb.append("null");
14225
      } else {
14226
        sb.append(this.success);
14227
      }
14228
      first = false;
14229
      if (!first) sb.append(", ");
14230
      sb.append("pex:");
14231
      if (this.pex == null) {
14232
        sb.append("null");
14233
      } else {
14234
        sb.append(this.pex);
14235
      }
14236
      first = false;
14237
      sb.append(")");
14238
      return sb.toString();
14239
    }
14240
 
3430 rajveer 14241
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 14242
      // check for required fields
14243
    }
14244
 
3430 rajveer 14245
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14246
      try {
14247
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14248
      } catch (org.apache.thrift.TException te) {
14249
        throw new java.io.IOException(te);
14250
      }
14251
    }
14252
 
14253
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14254
      try {
14255
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14256
      } catch (org.apache.thrift.TException te) {
14257
        throw new java.io.IOException(te);
14258
      }
14259
    }
14260
 
3385 varun.gupt 14261
  }
14262
 
6250 amit.gupta 14263
  public static class createCoupon_args implements org.apache.thrift.TBase<createCoupon_args, createCoupon_args._Fields>, java.io.Serializable, Cloneable   {
14264
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_args");
14265
 
14266
    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 14267
    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);
14268
    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);
14269
    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);
14270
    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);
14271
    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 14272
 
14273
    private long promotionId; // required
8707 manish.sha 14274
    private long couponCategory; // required
6730 anupam.sin 14275
    private String couponCode; // required
6679 anupam.sin 14276
    private String arguments; // required
6356 amit.gupta 14277
    private boolean isCod; // required
6561 amit.gupta 14278
    private String prefix; // required
6250 amit.gupta 14279
 
14280
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14281
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
14282
      PROMOTION_ID((short)1, "promotionId"),
8707 manish.sha 14283
      COUPON_CATEGORY((short)2, "couponCategory"),
14284
      COUPON_CODE((short)3, "couponCode"),
14285
      ARGUMENTS((short)4, "arguments"),
14286
      IS_COD((short)5, "isCod"),
14287
      PREFIX((short)6, "prefix");
6250 amit.gupta 14288
 
14289
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14290
 
14291
      static {
14292
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14293
          byName.put(field.getFieldName(), field);
14294
        }
14295
      }
14296
 
14297
      /**
14298
       * Find the _Fields constant that matches fieldId, or null if its not found.
14299
       */
14300
      public static _Fields findByThriftId(int fieldId) {
14301
        switch(fieldId) {
14302
          case 1: // PROMOTION_ID
14303
            return PROMOTION_ID;
8707 manish.sha 14304
          case 2: // COUPON_CATEGORY
14305
            return COUPON_CATEGORY;
14306
          case 3: // COUPON_CODE
6730 anupam.sin 14307
            return COUPON_CODE;
8707 manish.sha 14308
          case 4: // ARGUMENTS
6679 anupam.sin 14309
            return ARGUMENTS;
8707 manish.sha 14310
          case 5: // IS_COD
6356 amit.gupta 14311
            return IS_COD;
8707 manish.sha 14312
          case 6: // PREFIX
6561 amit.gupta 14313
            return PREFIX;
6250 amit.gupta 14314
          default:
14315
            return null;
14316
        }
14317
      }
14318
 
14319
      /**
14320
       * Find the _Fields constant that matches fieldId, throwing an exception
14321
       * if it is not found.
14322
       */
14323
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14324
        _Fields fields = findByThriftId(fieldId);
14325
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14326
        return fields;
14327
      }
14328
 
14329
      /**
14330
       * Find the _Fields constant that matches name, or null if its not found.
14331
       */
14332
      public static _Fields findByName(String name) {
14333
        return byName.get(name);
14334
      }
14335
 
14336
      private final short _thriftId;
14337
      private final String _fieldName;
14338
 
14339
      _Fields(short thriftId, String fieldName) {
14340
        _thriftId = thriftId;
14341
        _fieldName = fieldName;
14342
      }
14343
 
14344
      public short getThriftFieldId() {
14345
        return _thriftId;
14346
      }
14347
 
14348
      public String getFieldName() {
14349
        return _fieldName;
14350
      }
14351
    }
14352
 
14353
    // isset id assignments
14354
    private static final int __PROMOTIONID_ISSET_ID = 0;
8707 manish.sha 14355
    private static final int __COUPONCATEGORY_ISSET_ID = 1;
14356
    private static final int __ISCOD_ISSET_ID = 2;
14357
    private BitSet __isset_bit_vector = new BitSet(3);
6250 amit.gupta 14358
 
14359
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
14360
    static {
14361
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
14362
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14363
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8707 manish.sha 14364
      tmpMap.put(_Fields.COUPON_CATEGORY, new org.apache.thrift.meta_data.FieldMetaData("couponCategory", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14365
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6730 anupam.sin 14366
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14367
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6679 anupam.sin 14368
      tmpMap.put(_Fields.ARGUMENTS, new org.apache.thrift.meta_data.FieldMetaData("arguments", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6250 amit.gupta 14369
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6356 amit.gupta 14370
      tmpMap.put(_Fields.IS_COD, new org.apache.thrift.meta_data.FieldMetaData("isCod", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14371
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
6561 amit.gupta 14372
      tmpMap.put(_Fields.PREFIX, new org.apache.thrift.meta_data.FieldMetaData("prefix", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14373
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6250 amit.gupta 14374
      metaDataMap = Collections.unmodifiableMap(tmpMap);
14375
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_args.class, metaDataMap);
14376
    }
14377
 
14378
    public createCoupon_args() {
14379
    }
14380
 
14381
    public createCoupon_args(
14382
      long promotionId,
8707 manish.sha 14383
      long couponCategory,
6730 anupam.sin 14384
      String couponCode,
6679 anupam.sin 14385
      String arguments,
6356 amit.gupta 14386
      boolean isCod,
6561 amit.gupta 14387
      String prefix)
6250 amit.gupta 14388
    {
14389
      this();
14390
      this.promotionId = promotionId;
14391
      setPromotionIdIsSet(true);
8707 manish.sha 14392
      this.couponCategory = couponCategory;
14393
      setCouponCategoryIsSet(true);
6730 anupam.sin 14394
      this.couponCode = couponCode;
6679 anupam.sin 14395
      this.arguments = arguments;
6356 amit.gupta 14396
      this.isCod = isCod;
14397
      setIsCodIsSet(true);
6561 amit.gupta 14398
      this.prefix = prefix;
6250 amit.gupta 14399
    }
14400
 
14401
    /**
14402
     * Performs a deep copy on <i>other</i>.
14403
     */
14404
    public createCoupon_args(createCoupon_args other) {
14405
      __isset_bit_vector.clear();
14406
      __isset_bit_vector.or(other.__isset_bit_vector);
14407
      this.promotionId = other.promotionId;
8707 manish.sha 14408
      this.couponCategory = other.couponCategory;
6730 anupam.sin 14409
      if (other.isSetCouponCode()) {
14410
        this.couponCode = other.couponCode;
14411
      }
6679 anupam.sin 14412
      if (other.isSetArguments()) {
14413
        this.arguments = other.arguments;
6250 amit.gupta 14414
      }
6356 amit.gupta 14415
      this.isCod = other.isCod;
6561 amit.gupta 14416
      if (other.isSetPrefix()) {
14417
        this.prefix = other.prefix;
14418
      }
6250 amit.gupta 14419
    }
14420
 
14421
    public createCoupon_args deepCopy() {
14422
      return new createCoupon_args(this);
14423
    }
14424
 
14425
    @Override
14426
    public void clear() {
14427
      setPromotionIdIsSet(false);
14428
      this.promotionId = 0;
8707 manish.sha 14429
      setCouponCategoryIsSet(false);
14430
      this.couponCategory = 0;
6730 anupam.sin 14431
      this.couponCode = null;
6679 anupam.sin 14432
      this.arguments = null;
6356 amit.gupta 14433
      setIsCodIsSet(false);
14434
      this.isCod = false;
6561 amit.gupta 14435
      this.prefix = null;
6250 amit.gupta 14436
    }
14437
 
14438
    public long getPromotionId() {
14439
      return this.promotionId;
14440
    }
14441
 
14442
    public void setPromotionId(long promotionId) {
14443
      this.promotionId = promotionId;
14444
      setPromotionIdIsSet(true);
14445
    }
14446
 
14447
    public void unsetPromotionId() {
14448
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
14449
    }
14450
 
14451
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
14452
    public boolean isSetPromotionId() {
14453
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
14454
    }
14455
 
14456
    public void setPromotionIdIsSet(boolean value) {
14457
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
14458
    }
14459
 
8707 manish.sha 14460
    public long getCouponCategory() {
14461
      return this.couponCategory;
14462
    }
14463
 
14464
    public void setCouponCategory(long couponCategory) {
14465
      this.couponCategory = couponCategory;
14466
      setCouponCategoryIsSet(true);
14467
    }
14468
 
14469
    public void unsetCouponCategory() {
14470
      __isset_bit_vector.clear(__COUPONCATEGORY_ISSET_ID);
14471
    }
14472
 
14473
    /** Returns true if field couponCategory is set (has been assigned a value) and false otherwise */
14474
    public boolean isSetCouponCategory() {
14475
      return __isset_bit_vector.get(__COUPONCATEGORY_ISSET_ID);
14476
    }
14477
 
14478
    public void setCouponCategoryIsSet(boolean value) {
14479
      __isset_bit_vector.set(__COUPONCATEGORY_ISSET_ID, value);
14480
    }
14481
 
6730 anupam.sin 14482
    public String getCouponCode() {
14483
      return this.couponCode;
14484
    }
14485
 
14486
    public void setCouponCode(String couponCode) {
14487
      this.couponCode = couponCode;
14488
    }
14489
 
14490
    public void unsetCouponCode() {
14491
      this.couponCode = null;
14492
    }
14493
 
14494
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
14495
    public boolean isSetCouponCode() {
14496
      return this.couponCode != null;
14497
    }
14498
 
14499
    public void setCouponCodeIsSet(boolean value) {
14500
      if (!value) {
14501
        this.couponCode = null;
14502
      }
14503
    }
14504
 
6679 anupam.sin 14505
    public String getArguments() {
14506
      return this.arguments;
6250 amit.gupta 14507
    }
14508
 
6679 anupam.sin 14509
    public void setArguments(String arguments) {
14510
      this.arguments = arguments;
6250 amit.gupta 14511
    }
14512
 
6679 anupam.sin 14513
    public void unsetArguments() {
14514
      this.arguments = null;
6250 amit.gupta 14515
    }
14516
 
6679 anupam.sin 14517
    /** Returns true if field arguments is set (has been assigned a value) and false otherwise */
14518
    public boolean isSetArguments() {
14519
      return this.arguments != null;
6250 amit.gupta 14520
    }
14521
 
6679 anupam.sin 14522
    public void setArgumentsIsSet(boolean value) {
6250 amit.gupta 14523
      if (!value) {
6679 anupam.sin 14524
        this.arguments = null;
6250 amit.gupta 14525
      }
14526
    }
14527
 
6356 amit.gupta 14528
    public boolean isIsCod() {
14529
      return this.isCod;
14530
    }
14531
 
14532
    public void setIsCod(boolean isCod) {
14533
      this.isCod = isCod;
14534
      setIsCodIsSet(true);
14535
    }
14536
 
14537
    public void unsetIsCod() {
14538
      __isset_bit_vector.clear(__ISCOD_ISSET_ID);
14539
    }
14540
 
14541
    /** Returns true if field isCod is set (has been assigned a value) and false otherwise */
14542
    public boolean isSetIsCod() {
14543
      return __isset_bit_vector.get(__ISCOD_ISSET_ID);
14544
    }
14545
 
14546
    public void setIsCodIsSet(boolean value) {
14547
      __isset_bit_vector.set(__ISCOD_ISSET_ID, value);
14548
    }
14549
 
6561 amit.gupta 14550
    public String getPrefix() {
14551
      return this.prefix;
14552
    }
14553
 
14554
    public void setPrefix(String prefix) {
14555
      this.prefix = prefix;
14556
    }
14557
 
14558
    public void unsetPrefix() {
14559
      this.prefix = null;
14560
    }
14561
 
14562
    /** Returns true if field prefix is set (has been assigned a value) and false otherwise */
14563
    public boolean isSetPrefix() {
14564
      return this.prefix != null;
14565
    }
14566
 
14567
    public void setPrefixIsSet(boolean value) {
14568
      if (!value) {
14569
        this.prefix = null;
14570
      }
14571
    }
14572
 
6250 amit.gupta 14573
    public void setFieldValue(_Fields field, Object value) {
14574
      switch (field) {
14575
      case PROMOTION_ID:
14576
        if (value == null) {
14577
          unsetPromotionId();
14578
        } else {
14579
          setPromotionId((Long)value);
14580
        }
14581
        break;
14582
 
8707 manish.sha 14583
      case COUPON_CATEGORY:
14584
        if (value == null) {
14585
          unsetCouponCategory();
14586
        } else {
14587
          setCouponCategory((Long)value);
14588
        }
14589
        break;
14590
 
6730 anupam.sin 14591
      case COUPON_CODE:
14592
        if (value == null) {
14593
          unsetCouponCode();
14594
        } else {
14595
          setCouponCode((String)value);
14596
        }
14597
        break;
14598
 
6679 anupam.sin 14599
      case ARGUMENTS:
6250 amit.gupta 14600
        if (value == null) {
6679 anupam.sin 14601
          unsetArguments();
6250 amit.gupta 14602
        } else {
6679 anupam.sin 14603
          setArguments((String)value);
6250 amit.gupta 14604
        }
14605
        break;
14606
 
6356 amit.gupta 14607
      case IS_COD:
14608
        if (value == null) {
14609
          unsetIsCod();
14610
        } else {
14611
          setIsCod((Boolean)value);
14612
        }
14613
        break;
14614
 
6561 amit.gupta 14615
      case PREFIX:
14616
        if (value == null) {
14617
          unsetPrefix();
14618
        } else {
14619
          setPrefix((String)value);
14620
        }
14621
        break;
14622
 
6250 amit.gupta 14623
      }
14624
    }
14625
 
14626
    public Object getFieldValue(_Fields field) {
14627
      switch (field) {
14628
      case PROMOTION_ID:
14629
        return Long.valueOf(getPromotionId());
14630
 
8707 manish.sha 14631
      case COUPON_CATEGORY:
14632
        return Long.valueOf(getCouponCategory());
14633
 
6730 anupam.sin 14634
      case COUPON_CODE:
14635
        return getCouponCode();
14636
 
6679 anupam.sin 14637
      case ARGUMENTS:
14638
        return getArguments();
6250 amit.gupta 14639
 
6356 amit.gupta 14640
      case IS_COD:
14641
        return Boolean.valueOf(isIsCod());
14642
 
6561 amit.gupta 14643
      case PREFIX:
14644
        return getPrefix();
14645
 
6250 amit.gupta 14646
      }
14647
      throw new IllegalStateException();
14648
    }
14649
 
14650
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14651
    public boolean isSet(_Fields field) {
14652
      if (field == null) {
14653
        throw new IllegalArgumentException();
14654
      }
14655
 
14656
      switch (field) {
14657
      case PROMOTION_ID:
14658
        return isSetPromotionId();
8707 manish.sha 14659
      case COUPON_CATEGORY:
14660
        return isSetCouponCategory();
6730 anupam.sin 14661
      case COUPON_CODE:
14662
        return isSetCouponCode();
6679 anupam.sin 14663
      case ARGUMENTS:
14664
        return isSetArguments();
6356 amit.gupta 14665
      case IS_COD:
14666
        return isSetIsCod();
6561 amit.gupta 14667
      case PREFIX:
14668
        return isSetPrefix();
6250 amit.gupta 14669
      }
14670
      throw new IllegalStateException();
14671
    }
14672
 
14673
    @Override
14674
    public boolean equals(Object that) {
14675
      if (that == null)
14676
        return false;
14677
      if (that instanceof createCoupon_args)
14678
        return this.equals((createCoupon_args)that);
14679
      return false;
14680
    }
14681
 
14682
    public boolean equals(createCoupon_args that) {
14683
      if (that == null)
14684
        return false;
14685
 
14686
      boolean this_present_promotionId = true;
14687
      boolean that_present_promotionId = true;
14688
      if (this_present_promotionId || that_present_promotionId) {
14689
        if (!(this_present_promotionId && that_present_promotionId))
14690
          return false;
14691
        if (this.promotionId != that.promotionId)
14692
          return false;
14693
      }
14694
 
8707 manish.sha 14695
      boolean this_present_couponCategory = true;
14696
      boolean that_present_couponCategory = true;
14697
      if (this_present_couponCategory || that_present_couponCategory) {
14698
        if (!(this_present_couponCategory && that_present_couponCategory))
14699
          return false;
14700
        if (this.couponCategory != that.couponCategory)
14701
          return false;
14702
      }
14703
 
6730 anupam.sin 14704
      boolean this_present_couponCode = true && this.isSetCouponCode();
14705
      boolean that_present_couponCode = true && that.isSetCouponCode();
14706
      if (this_present_couponCode || that_present_couponCode) {
14707
        if (!(this_present_couponCode && that_present_couponCode))
14708
          return false;
14709
        if (!this.couponCode.equals(that.couponCode))
14710
          return false;
14711
      }
14712
 
6679 anupam.sin 14713
      boolean this_present_arguments = true && this.isSetArguments();
14714
      boolean that_present_arguments = true && that.isSetArguments();
14715
      if (this_present_arguments || that_present_arguments) {
14716
        if (!(this_present_arguments && that_present_arguments))
6250 amit.gupta 14717
          return false;
6679 anupam.sin 14718
        if (!this.arguments.equals(that.arguments))
6250 amit.gupta 14719
          return false;
14720
      }
14721
 
6356 amit.gupta 14722
      boolean this_present_isCod = true;
14723
      boolean that_present_isCod = true;
14724
      if (this_present_isCod || that_present_isCod) {
14725
        if (!(this_present_isCod && that_present_isCod))
14726
          return false;
14727
        if (this.isCod != that.isCod)
14728
          return false;
14729
      }
14730
 
6561 amit.gupta 14731
      boolean this_present_prefix = true && this.isSetPrefix();
14732
      boolean that_present_prefix = true && that.isSetPrefix();
14733
      if (this_present_prefix || that_present_prefix) {
14734
        if (!(this_present_prefix && that_present_prefix))
14735
          return false;
14736
        if (!this.prefix.equals(that.prefix))
14737
          return false;
14738
      }
14739
 
6250 amit.gupta 14740
      return true;
14741
    }
14742
 
14743
    @Override
14744
    public int hashCode() {
14745
      return 0;
14746
    }
14747
 
14748
    public int compareTo(createCoupon_args other) {
14749
      if (!getClass().equals(other.getClass())) {
14750
        return getClass().getName().compareTo(other.getClass().getName());
14751
      }
14752
 
14753
      int lastComparison = 0;
14754
      createCoupon_args typedOther = (createCoupon_args)other;
14755
 
14756
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
14757
      if (lastComparison != 0) {
14758
        return lastComparison;
14759
      }
14760
      if (isSetPromotionId()) {
14761
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
14762
        if (lastComparison != 0) {
14763
          return lastComparison;
14764
        }
14765
      }
8707 manish.sha 14766
      lastComparison = Boolean.valueOf(isSetCouponCategory()).compareTo(typedOther.isSetCouponCategory());
14767
      if (lastComparison != 0) {
14768
        return lastComparison;
14769
      }
14770
      if (isSetCouponCategory()) {
14771
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCategory, typedOther.couponCategory);
14772
        if (lastComparison != 0) {
14773
          return lastComparison;
14774
        }
14775
      }
6730 anupam.sin 14776
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
14777
      if (lastComparison != 0) {
14778
        return lastComparison;
14779
      }
14780
      if (isSetCouponCode()) {
14781
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
14782
        if (lastComparison != 0) {
14783
          return lastComparison;
14784
        }
14785
      }
6679 anupam.sin 14786
      lastComparison = Boolean.valueOf(isSetArguments()).compareTo(typedOther.isSetArguments());
6250 amit.gupta 14787
      if (lastComparison != 0) {
14788
        return lastComparison;
14789
      }
6679 anupam.sin 14790
      if (isSetArguments()) {
14791
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.arguments, typedOther.arguments);
6250 amit.gupta 14792
        if (lastComparison != 0) {
14793
          return lastComparison;
14794
        }
14795
      }
6356 amit.gupta 14796
      lastComparison = Boolean.valueOf(isSetIsCod()).compareTo(typedOther.isSetIsCod());
14797
      if (lastComparison != 0) {
14798
        return lastComparison;
14799
      }
14800
      if (isSetIsCod()) {
14801
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isCod, typedOther.isCod);
14802
        if (lastComparison != 0) {
14803
          return lastComparison;
14804
        }
14805
      }
6561 amit.gupta 14806
      lastComparison = Boolean.valueOf(isSetPrefix()).compareTo(typedOther.isSetPrefix());
14807
      if (lastComparison != 0) {
14808
        return lastComparison;
14809
      }
14810
      if (isSetPrefix()) {
14811
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.prefix, typedOther.prefix);
14812
        if (lastComparison != 0) {
14813
          return lastComparison;
14814
        }
14815
      }
6250 amit.gupta 14816
      return 0;
14817
    }
14818
 
14819
    public _Fields fieldForId(int fieldId) {
14820
      return _Fields.findByThriftId(fieldId);
14821
    }
14822
 
14823
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14824
      org.apache.thrift.protocol.TField field;
14825
      iprot.readStructBegin();
14826
      while (true)
14827
      {
14828
        field = iprot.readFieldBegin();
14829
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
14830
          break;
14831
        }
14832
        switch (field.id) {
14833
          case 1: // PROMOTION_ID
14834
            if (field.type == org.apache.thrift.protocol.TType.I64) {
14835
              this.promotionId = iprot.readI64();
14836
              setPromotionIdIsSet(true);
14837
            } else { 
14838
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14839
            }
14840
            break;
8707 manish.sha 14841
          case 2: // COUPON_CATEGORY
14842
            if (field.type == org.apache.thrift.protocol.TType.I64) {
14843
              this.couponCategory = iprot.readI64();
14844
              setCouponCategoryIsSet(true);
14845
            } else { 
14846
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14847
            }
14848
            break;
14849
          case 3: // COUPON_CODE
6250 amit.gupta 14850
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
6730 anupam.sin 14851
              this.couponCode = iprot.readString();
14852
            } else { 
14853
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14854
            }
14855
            break;
8707 manish.sha 14856
          case 4: // ARGUMENTS
6730 anupam.sin 14857
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
6679 anupam.sin 14858
              this.arguments = iprot.readString();
6250 amit.gupta 14859
            } else { 
14860
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14861
            }
14862
            break;
8707 manish.sha 14863
          case 5: // IS_COD
6356 amit.gupta 14864
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
14865
              this.isCod = iprot.readBool();
14866
              setIsCodIsSet(true);
14867
            } else { 
14868
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14869
            }
14870
            break;
8707 manish.sha 14871
          case 6: // PREFIX
6561 amit.gupta 14872
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
14873
              this.prefix = iprot.readString();
14874
            } else { 
14875
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14876
            }
14877
            break;
6250 amit.gupta 14878
          default:
14879
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14880
        }
14881
        iprot.readFieldEnd();
14882
      }
14883
      iprot.readStructEnd();
14884
      validate();
14885
    }
14886
 
14887
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
14888
      validate();
14889
 
14890
      oprot.writeStructBegin(STRUCT_DESC);
14891
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
14892
      oprot.writeI64(this.promotionId);
14893
      oprot.writeFieldEnd();
8707 manish.sha 14894
      oprot.writeFieldBegin(COUPON_CATEGORY_FIELD_DESC);
14895
      oprot.writeI64(this.couponCategory);
14896
      oprot.writeFieldEnd();
6730 anupam.sin 14897
      if (this.couponCode != null) {
14898
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
14899
        oprot.writeString(this.couponCode);
14900
        oprot.writeFieldEnd();
14901
      }
6679 anupam.sin 14902
      if (this.arguments != null) {
14903
        oprot.writeFieldBegin(ARGUMENTS_FIELD_DESC);
14904
        oprot.writeString(this.arguments);
6250 amit.gupta 14905
        oprot.writeFieldEnd();
14906
      }
6356 amit.gupta 14907
      oprot.writeFieldBegin(IS_COD_FIELD_DESC);
14908
      oprot.writeBool(this.isCod);
14909
      oprot.writeFieldEnd();
6561 amit.gupta 14910
      if (this.prefix != null) {
14911
        oprot.writeFieldBegin(PREFIX_FIELD_DESC);
14912
        oprot.writeString(this.prefix);
14913
        oprot.writeFieldEnd();
14914
      }
6250 amit.gupta 14915
      oprot.writeFieldStop();
14916
      oprot.writeStructEnd();
14917
    }
14918
 
14919
    @Override
14920
    public String toString() {
14921
      StringBuilder sb = new StringBuilder("createCoupon_args(");
14922
      boolean first = true;
14923
 
14924
      sb.append("promotionId:");
14925
      sb.append(this.promotionId);
14926
      first = false;
14927
      if (!first) sb.append(", ");
8707 manish.sha 14928
      sb.append("couponCategory:");
14929
      sb.append(this.couponCategory);
14930
      first = false;
14931
      if (!first) sb.append(", ");
6730 anupam.sin 14932
      sb.append("couponCode:");
14933
      if (this.couponCode == null) {
14934
        sb.append("null");
14935
      } else {
14936
        sb.append(this.couponCode);
14937
      }
14938
      first = false;
14939
      if (!first) sb.append(", ");
6679 anupam.sin 14940
      sb.append("arguments:");
14941
      if (this.arguments == null) {
6250 amit.gupta 14942
        sb.append("null");
14943
      } else {
6679 anupam.sin 14944
        sb.append(this.arguments);
6250 amit.gupta 14945
      }
14946
      first = false;
14947
      if (!first) sb.append(", ");
6356 amit.gupta 14948
      sb.append("isCod:");
14949
      sb.append(this.isCod);
14950
      first = false;
14951
      if (!first) sb.append(", ");
6561 amit.gupta 14952
      sb.append("prefix:");
14953
      if (this.prefix == null) {
14954
        sb.append("null");
14955
      } else {
14956
        sb.append(this.prefix);
14957
      }
14958
      first = false;
6250 amit.gupta 14959
      sb.append(")");
14960
      return sb.toString();
14961
    }
14962
 
14963
    public void validate() throws org.apache.thrift.TException {
14964
      // check for required fields
14965
    }
14966
 
14967
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14968
      try {
14969
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14970
      } catch (org.apache.thrift.TException te) {
14971
        throw new java.io.IOException(te);
14972
      }
14973
    }
14974
 
14975
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14976
      try {
14977
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14978
      } catch (org.apache.thrift.TException te) {
14979
        throw new java.io.IOException(te);
14980
      }
14981
    }
14982
 
14983
  }
14984
 
14985
  public static class createCoupon_result implements org.apache.thrift.TBase<createCoupon_result, createCoupon_result._Fields>, java.io.Serializable, Cloneable   {
14986
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_result");
14987
 
14988
    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);
14989
    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);
14990
 
14991
    private String success; // required
14992
    private PromotionException pex; // required
14993
 
14994
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14995
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
14996
      SUCCESS((short)0, "success"),
14997
      PEX((short)1, "pex");
14998
 
14999
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15000
 
15001
      static {
15002
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15003
          byName.put(field.getFieldName(), field);
15004
        }
15005
      }
15006
 
15007
      /**
15008
       * Find the _Fields constant that matches fieldId, or null if its not found.
15009
       */
15010
      public static _Fields findByThriftId(int fieldId) {
15011
        switch(fieldId) {
15012
          case 0: // SUCCESS
15013
            return SUCCESS;
15014
          case 1: // PEX
15015
            return PEX;
15016
          default:
15017
            return null;
15018
        }
15019
      }
15020
 
15021
      /**
15022
       * Find the _Fields constant that matches fieldId, throwing an exception
15023
       * if it is not found.
15024
       */
15025
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15026
        _Fields fields = findByThriftId(fieldId);
15027
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15028
        return fields;
15029
      }
15030
 
15031
      /**
15032
       * Find the _Fields constant that matches name, or null if its not found.
15033
       */
15034
      public static _Fields findByName(String name) {
15035
        return byName.get(name);
15036
      }
15037
 
15038
      private final short _thriftId;
15039
      private final String _fieldName;
15040
 
15041
      _Fields(short thriftId, String fieldName) {
15042
        _thriftId = thriftId;
15043
        _fieldName = fieldName;
15044
      }
15045
 
15046
      public short getThriftFieldId() {
15047
        return _thriftId;
15048
      }
15049
 
15050
      public String getFieldName() {
15051
        return _fieldName;
15052
      }
15053
    }
15054
 
15055
    // isset id assignments
15056
 
15057
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
15058
    static {
15059
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15060
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15061
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
15062
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15063
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
15064
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15065
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_result.class, metaDataMap);
15066
    }
15067
 
15068
    public createCoupon_result() {
15069
    }
15070
 
15071
    public createCoupon_result(
15072
      String success,
15073
      PromotionException pex)
15074
    {
15075
      this();
15076
      this.success = success;
15077
      this.pex = pex;
15078
    }
15079
 
15080
    /**
15081
     * Performs a deep copy on <i>other</i>.
15082
     */
15083
    public createCoupon_result(createCoupon_result other) {
15084
      if (other.isSetSuccess()) {
15085
        this.success = other.success;
15086
      }
15087
      if (other.isSetPex()) {
15088
        this.pex = new PromotionException(other.pex);
15089
      }
15090
    }
15091
 
15092
    public createCoupon_result deepCopy() {
15093
      return new createCoupon_result(this);
15094
    }
15095
 
15096
    @Override
15097
    public void clear() {
15098
      this.success = null;
15099
      this.pex = null;
15100
    }
15101
 
15102
    public String getSuccess() {
15103
      return this.success;
15104
    }
15105
 
15106
    public void setSuccess(String success) {
15107
      this.success = success;
15108
    }
15109
 
15110
    public void unsetSuccess() {
15111
      this.success = null;
15112
    }
15113
 
15114
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
15115
    public boolean isSetSuccess() {
15116
      return this.success != null;
15117
    }
15118
 
15119
    public void setSuccessIsSet(boolean value) {
15120
      if (!value) {
15121
        this.success = null;
15122
      }
15123
    }
15124
 
15125
    public PromotionException getPex() {
15126
      return this.pex;
15127
    }
15128
 
15129
    public void setPex(PromotionException pex) {
15130
      this.pex = pex;
15131
    }
15132
 
15133
    public void unsetPex() {
15134
      this.pex = null;
15135
    }
15136
 
15137
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
15138
    public boolean isSetPex() {
15139
      return this.pex != null;
15140
    }
15141
 
15142
    public void setPexIsSet(boolean value) {
15143
      if (!value) {
15144
        this.pex = null;
15145
      }
15146
    }
15147
 
15148
    public void setFieldValue(_Fields field, Object value) {
15149
      switch (field) {
15150
      case SUCCESS:
15151
        if (value == null) {
15152
          unsetSuccess();
15153
        } else {
15154
          setSuccess((String)value);
15155
        }
15156
        break;
15157
 
15158
      case PEX:
15159
        if (value == null) {
15160
          unsetPex();
15161
        } else {
15162
          setPex((PromotionException)value);
15163
        }
15164
        break;
15165
 
15166
      }
15167
    }
15168
 
15169
    public Object getFieldValue(_Fields field) {
15170
      switch (field) {
15171
      case SUCCESS:
15172
        return getSuccess();
15173
 
15174
      case PEX:
15175
        return getPex();
15176
 
15177
      }
15178
      throw new IllegalStateException();
15179
    }
15180
 
15181
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15182
    public boolean isSet(_Fields field) {
15183
      if (field == null) {
15184
        throw new IllegalArgumentException();
15185
      }
15186
 
15187
      switch (field) {
15188
      case SUCCESS:
15189
        return isSetSuccess();
15190
      case PEX:
15191
        return isSetPex();
15192
      }
15193
      throw new IllegalStateException();
15194
    }
15195
 
15196
    @Override
15197
    public boolean equals(Object that) {
15198
      if (that == null)
15199
        return false;
15200
      if (that instanceof createCoupon_result)
15201
        return this.equals((createCoupon_result)that);
15202
      return false;
15203
    }
15204
 
15205
    public boolean equals(createCoupon_result that) {
15206
      if (that == null)
15207
        return false;
15208
 
15209
      boolean this_present_success = true && this.isSetSuccess();
15210
      boolean that_present_success = true && that.isSetSuccess();
15211
      if (this_present_success || that_present_success) {
15212
        if (!(this_present_success && that_present_success))
15213
          return false;
15214
        if (!this.success.equals(that.success))
15215
          return false;
15216
      }
15217
 
15218
      boolean this_present_pex = true && this.isSetPex();
15219
      boolean that_present_pex = true && that.isSetPex();
15220
      if (this_present_pex || that_present_pex) {
15221
        if (!(this_present_pex && that_present_pex))
15222
          return false;
15223
        if (!this.pex.equals(that.pex))
15224
          return false;
15225
      }
15226
 
15227
      return true;
15228
    }
15229
 
15230
    @Override
15231
    public int hashCode() {
15232
      return 0;
15233
    }
15234
 
15235
    public int compareTo(createCoupon_result other) {
15236
      if (!getClass().equals(other.getClass())) {
15237
        return getClass().getName().compareTo(other.getClass().getName());
15238
      }
15239
 
15240
      int lastComparison = 0;
15241
      createCoupon_result typedOther = (createCoupon_result)other;
15242
 
15243
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
15244
      if (lastComparison != 0) {
15245
        return lastComparison;
15246
      }
15247
      if (isSetSuccess()) {
15248
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
15249
        if (lastComparison != 0) {
15250
          return lastComparison;
15251
        }
15252
      }
15253
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
15254
      if (lastComparison != 0) {
15255
        return lastComparison;
15256
      }
15257
      if (isSetPex()) {
15258
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
15259
        if (lastComparison != 0) {
15260
          return lastComparison;
15261
        }
15262
      }
15263
      return 0;
15264
    }
15265
 
15266
    public _Fields fieldForId(int fieldId) {
15267
      return _Fields.findByThriftId(fieldId);
15268
    }
15269
 
15270
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15271
      org.apache.thrift.protocol.TField field;
15272
      iprot.readStructBegin();
15273
      while (true)
15274
      {
15275
        field = iprot.readFieldBegin();
15276
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
15277
          break;
15278
        }
15279
        switch (field.id) {
15280
          case 0: // SUCCESS
15281
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
15282
              this.success = iprot.readString();
15283
            } else { 
15284
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15285
            }
15286
            break;
15287
          case 1: // PEX
15288
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
15289
              this.pex = new PromotionException();
15290
              this.pex.read(iprot);
15291
            } else { 
15292
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15293
            }
15294
            break;
15295
          default:
15296
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15297
        }
15298
        iprot.readFieldEnd();
15299
      }
15300
      iprot.readStructEnd();
15301
      validate();
15302
    }
15303
 
15304
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
15305
      oprot.writeStructBegin(STRUCT_DESC);
15306
 
15307
      if (this.isSetSuccess()) {
15308
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
15309
        oprot.writeString(this.success);
15310
        oprot.writeFieldEnd();
15311
      } else if (this.isSetPex()) {
15312
        oprot.writeFieldBegin(PEX_FIELD_DESC);
15313
        this.pex.write(oprot);
15314
        oprot.writeFieldEnd();
15315
      }
15316
      oprot.writeFieldStop();
15317
      oprot.writeStructEnd();
15318
    }
15319
 
15320
    @Override
15321
    public String toString() {
15322
      StringBuilder sb = new StringBuilder("createCoupon_result(");
15323
      boolean first = true;
15324
 
15325
      sb.append("success:");
15326
      if (this.success == null) {
15327
        sb.append("null");
15328
      } else {
15329
        sb.append(this.success);
15330
      }
15331
      first = false;
15332
      if (!first) sb.append(", ");
15333
      sb.append("pex:");
15334
      if (this.pex == null) {
15335
        sb.append("null");
15336
      } else {
15337
        sb.append(this.pex);
15338
      }
15339
      first = false;
15340
      sb.append(")");
15341
      return sb.toString();
15342
    }
15343
 
15344
    public void validate() throws org.apache.thrift.TException {
15345
      // check for required fields
15346
    }
15347
 
15348
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15349
      try {
15350
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15351
      } catch (org.apache.thrift.TException te) {
15352
        throw new java.io.IOException(te);
15353
      }
15354
    }
15355
 
15356
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15357
      try {
15358
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15359
      } catch (org.apache.thrift.TException te) {
15360
        throw new java.io.IOException(te);
15361
      }
15362
    }
15363
 
15364
  }
15365
 
3430 rajveer 15366
  public static class getSuccessfulPaymentCountForCoupon_args implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_args, getSuccessfulPaymentCountForCoupon_args._Fields>, java.io.Serializable, Cloneable   {
15367
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_args");
3385 varun.gupt 15368
 
3430 rajveer 15369
    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 15370
 
3430 rajveer 15371
    private String couponCode; // required
3385 varun.gupt 15372
 
15373
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 15374
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 15375
      COUPON_CODE((short)1, "couponCode");
15376
 
15377
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15378
 
15379
      static {
15380
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15381
          byName.put(field.getFieldName(), field);
15382
        }
15383
      }
15384
 
15385
      /**
15386
       * Find the _Fields constant that matches fieldId, or null if its not found.
15387
       */
15388
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 15389
        switch(fieldId) {
15390
          case 1: // COUPON_CODE
15391
            return COUPON_CODE;
15392
          default:
15393
            return null;
15394
        }
3385 varun.gupt 15395
      }
15396
 
15397
      /**
15398
       * Find the _Fields constant that matches fieldId, throwing an exception
15399
       * if it is not found.
15400
       */
15401
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15402
        _Fields fields = findByThriftId(fieldId);
15403
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15404
        return fields;
15405
      }
15406
 
15407
      /**
15408
       * Find the _Fields constant that matches name, or null if its not found.
15409
       */
15410
      public static _Fields findByName(String name) {
15411
        return byName.get(name);
15412
      }
15413
 
15414
      private final short _thriftId;
15415
      private final String _fieldName;
15416
 
15417
      _Fields(short thriftId, String fieldName) {
15418
        _thriftId = thriftId;
15419
        _fieldName = fieldName;
15420
      }
15421
 
15422
      public short getThriftFieldId() {
15423
        return _thriftId;
15424
      }
15425
 
15426
      public String getFieldName() {
15427
        return _fieldName;
15428
      }
15429
    }
15430
 
15431
    // isset id assignments
15432
 
3430 rajveer 15433
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 15434
    static {
3430 rajveer 15435
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15436
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15437
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
15438
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15439
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_args.class, metaDataMap);
3385 varun.gupt 15440
    }
15441
 
15442
    public getSuccessfulPaymentCountForCoupon_args() {
15443
    }
15444
 
15445
    public getSuccessfulPaymentCountForCoupon_args(
15446
      String couponCode)
15447
    {
15448
      this();
15449
      this.couponCode = couponCode;
15450
    }
15451
 
15452
    /**
15453
     * Performs a deep copy on <i>other</i>.
15454
     */
15455
    public getSuccessfulPaymentCountForCoupon_args(getSuccessfulPaymentCountForCoupon_args other) {
15456
      if (other.isSetCouponCode()) {
15457
        this.couponCode = other.couponCode;
15458
      }
15459
    }
15460
 
15461
    public getSuccessfulPaymentCountForCoupon_args deepCopy() {
15462
      return new getSuccessfulPaymentCountForCoupon_args(this);
15463
    }
15464
 
3430 rajveer 15465
    @Override
15466
    public void clear() {
15467
      this.couponCode = null;
3385 varun.gupt 15468
    }
15469
 
15470
    public String getCouponCode() {
15471
      return this.couponCode;
15472
    }
15473
 
3430 rajveer 15474
    public void setCouponCode(String couponCode) {
3385 varun.gupt 15475
      this.couponCode = couponCode;
15476
    }
15477
 
15478
    public void unsetCouponCode() {
15479
      this.couponCode = null;
15480
    }
15481
 
3430 rajveer 15482
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3385 varun.gupt 15483
    public boolean isSetCouponCode() {
15484
      return this.couponCode != null;
15485
    }
15486
 
15487
    public void setCouponCodeIsSet(boolean value) {
15488
      if (!value) {
15489
        this.couponCode = null;
15490
      }
15491
    }
15492
 
15493
    public void setFieldValue(_Fields field, Object value) {
15494
      switch (field) {
15495
      case COUPON_CODE:
15496
        if (value == null) {
15497
          unsetCouponCode();
15498
        } else {
15499
          setCouponCode((String)value);
15500
        }
15501
        break;
15502
 
15503
      }
15504
    }
15505
 
15506
    public Object getFieldValue(_Fields field) {
15507
      switch (field) {
15508
      case COUPON_CODE:
15509
        return getCouponCode();
15510
 
15511
      }
15512
      throw new IllegalStateException();
15513
    }
15514
 
3430 rajveer 15515
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15516
    public boolean isSet(_Fields field) {
15517
      if (field == null) {
15518
        throw new IllegalArgumentException();
15519
      }
3385 varun.gupt 15520
 
15521
      switch (field) {
15522
      case COUPON_CODE:
15523
        return isSetCouponCode();
15524
      }
15525
      throw new IllegalStateException();
15526
    }
15527
 
15528
    @Override
15529
    public boolean equals(Object that) {
15530
      if (that == null)
15531
        return false;
15532
      if (that instanceof getSuccessfulPaymentCountForCoupon_args)
15533
        return this.equals((getSuccessfulPaymentCountForCoupon_args)that);
15534
      return false;
15535
    }
15536
 
15537
    public boolean equals(getSuccessfulPaymentCountForCoupon_args that) {
15538
      if (that == null)
15539
        return false;
15540
 
15541
      boolean this_present_couponCode = true && this.isSetCouponCode();
15542
      boolean that_present_couponCode = true && that.isSetCouponCode();
15543
      if (this_present_couponCode || that_present_couponCode) {
15544
        if (!(this_present_couponCode && that_present_couponCode))
15545
          return false;
15546
        if (!this.couponCode.equals(that.couponCode))
15547
          return false;
15548
      }
15549
 
15550
      return true;
15551
    }
15552
 
15553
    @Override
15554
    public int hashCode() {
15555
      return 0;
15556
    }
15557
 
15558
    public int compareTo(getSuccessfulPaymentCountForCoupon_args other) {
15559
      if (!getClass().equals(other.getClass())) {
15560
        return getClass().getName().compareTo(other.getClass().getName());
15561
      }
15562
 
15563
      int lastComparison = 0;
15564
      getSuccessfulPaymentCountForCoupon_args typedOther = (getSuccessfulPaymentCountForCoupon_args)other;
15565
 
3430 rajveer 15566
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3385 varun.gupt 15567
      if (lastComparison != 0) {
15568
        return lastComparison;
15569
      }
3430 rajveer 15570
      if (isSetCouponCode()) {
15571
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
15572
        if (lastComparison != 0) {
15573
          return lastComparison;
15574
        }
3385 varun.gupt 15575
      }
15576
      return 0;
15577
    }
15578
 
3430 rajveer 15579
    public _Fields fieldForId(int fieldId) {
15580
      return _Fields.findByThriftId(fieldId);
15581
    }
15582
 
15583
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15584
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 15585
      iprot.readStructBegin();
15586
      while (true)
15587
      {
15588
        field = iprot.readFieldBegin();
3430 rajveer 15589
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 15590
          break;
15591
        }
3430 rajveer 15592
        switch (field.id) {
15593
          case 1: // COUPON_CODE
15594
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
15595
              this.couponCode = iprot.readString();
15596
            } else { 
15597
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15598
            }
15599
            break;
15600
          default:
15601
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 15602
        }
3430 rajveer 15603
        iprot.readFieldEnd();
3385 varun.gupt 15604
      }
15605
      iprot.readStructEnd();
15606
      validate();
15607
    }
15608
 
3430 rajveer 15609
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 15610
      validate();
15611
 
15612
      oprot.writeStructBegin(STRUCT_DESC);
15613
      if (this.couponCode != null) {
15614
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
15615
        oprot.writeString(this.couponCode);
15616
        oprot.writeFieldEnd();
15617
      }
15618
      oprot.writeFieldStop();
15619
      oprot.writeStructEnd();
15620
    }
15621
 
15622
    @Override
15623
    public String toString() {
15624
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_args(");
15625
      boolean first = true;
15626
 
15627
      sb.append("couponCode:");
15628
      if (this.couponCode == null) {
15629
        sb.append("null");
15630
      } else {
15631
        sb.append(this.couponCode);
15632
      }
15633
      first = false;
15634
      sb.append(")");
15635
      return sb.toString();
15636
    }
15637
 
3430 rajveer 15638
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 15639
      // check for required fields
15640
    }
15641
 
3430 rajveer 15642
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15643
      try {
15644
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15645
      } catch (org.apache.thrift.TException te) {
15646
        throw new java.io.IOException(te);
15647
      }
15648
    }
15649
 
15650
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15651
      try {
15652
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15653
      } catch (org.apache.thrift.TException te) {
15654
        throw new java.io.IOException(te);
15655
      }
15656
    }
15657
 
3385 varun.gupt 15658
  }
15659
 
3430 rajveer 15660
  public static class getSuccessfulPaymentCountForCoupon_result implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_result, getSuccessfulPaymentCountForCoupon_result._Fields>, java.io.Serializable, Cloneable   {
15661
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_result");
3385 varun.gupt 15662
 
3430 rajveer 15663
    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);
15664
    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 15665
 
3430 rajveer 15666
    private long success; // required
15667
    private PromotionException pex; // required
3385 varun.gupt 15668
 
15669
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 15670
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 15671
      SUCCESS((short)0, "success"),
15672
      PEX((short)1, "pex");
15673
 
15674
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15675
 
15676
      static {
15677
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15678
          byName.put(field.getFieldName(), field);
15679
        }
15680
      }
15681
 
15682
      /**
15683
       * Find the _Fields constant that matches fieldId, or null if its not found.
15684
       */
15685
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 15686
        switch(fieldId) {
15687
          case 0: // SUCCESS
15688
            return SUCCESS;
15689
          case 1: // PEX
15690
            return PEX;
15691
          default:
15692
            return null;
15693
        }
3385 varun.gupt 15694
      }
15695
 
15696
      /**
15697
       * Find the _Fields constant that matches fieldId, throwing an exception
15698
       * if it is not found.
15699
       */
15700
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15701
        _Fields fields = findByThriftId(fieldId);
15702
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15703
        return fields;
15704
      }
15705
 
15706
      /**
15707
       * Find the _Fields constant that matches name, or null if its not found.
15708
       */
15709
      public static _Fields findByName(String name) {
15710
        return byName.get(name);
15711
      }
15712
 
15713
      private final short _thriftId;
15714
      private final String _fieldName;
15715
 
15716
      _Fields(short thriftId, String fieldName) {
15717
        _thriftId = thriftId;
15718
        _fieldName = fieldName;
15719
      }
15720
 
15721
      public short getThriftFieldId() {
15722
        return _thriftId;
15723
      }
15724
 
15725
      public String getFieldName() {
15726
        return _fieldName;
15727
      }
15728
    }
15729
 
15730
    // isset id assignments
15731
    private static final int __SUCCESS_ISSET_ID = 0;
15732
    private BitSet __isset_bit_vector = new BitSet(1);
15733
 
3430 rajveer 15734
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 15735
    static {
3430 rajveer 15736
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15737
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15738
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
15739
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15740
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
15741
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15742
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_result.class, metaDataMap);
3385 varun.gupt 15743
    }
15744
 
15745
    public getSuccessfulPaymentCountForCoupon_result() {
15746
    }
15747
 
15748
    public getSuccessfulPaymentCountForCoupon_result(
15749
      long success,
15750
      PromotionException pex)
15751
    {
15752
      this();
15753
      this.success = success;
15754
      setSuccessIsSet(true);
15755
      this.pex = pex;
15756
    }
15757
 
15758
    /**
15759
     * Performs a deep copy on <i>other</i>.
15760
     */
15761
    public getSuccessfulPaymentCountForCoupon_result(getSuccessfulPaymentCountForCoupon_result other) {
15762
      __isset_bit_vector.clear();
15763
      __isset_bit_vector.or(other.__isset_bit_vector);
15764
      this.success = other.success;
15765
      if (other.isSetPex()) {
15766
        this.pex = new PromotionException(other.pex);
15767
      }
15768
    }
15769
 
15770
    public getSuccessfulPaymentCountForCoupon_result deepCopy() {
15771
      return new getSuccessfulPaymentCountForCoupon_result(this);
15772
    }
15773
 
3430 rajveer 15774
    @Override
15775
    public void clear() {
15776
      setSuccessIsSet(false);
15777
      this.success = 0;
15778
      this.pex = null;
3385 varun.gupt 15779
    }
15780
 
15781
    public long getSuccess() {
15782
      return this.success;
15783
    }
15784
 
3430 rajveer 15785
    public void setSuccess(long success) {
3385 varun.gupt 15786
      this.success = success;
15787
      setSuccessIsSet(true);
15788
    }
15789
 
15790
    public void unsetSuccess() {
15791
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
15792
    }
15793
 
3430 rajveer 15794
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 15795
    public boolean isSetSuccess() {
15796
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
15797
    }
15798
 
15799
    public void setSuccessIsSet(boolean value) {
15800
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
15801
    }
15802
 
15803
    public PromotionException getPex() {
15804
      return this.pex;
15805
    }
15806
 
3430 rajveer 15807
    public void setPex(PromotionException pex) {
3385 varun.gupt 15808
      this.pex = pex;
15809
    }
15810
 
15811
    public void unsetPex() {
15812
      this.pex = null;
15813
    }
15814
 
3430 rajveer 15815
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 15816
    public boolean isSetPex() {
15817
      return this.pex != null;
15818
    }
15819
 
15820
    public void setPexIsSet(boolean value) {
15821
      if (!value) {
15822
        this.pex = null;
15823
      }
15824
    }
15825
 
15826
    public void setFieldValue(_Fields field, Object value) {
15827
      switch (field) {
15828
      case SUCCESS:
15829
        if (value == null) {
15830
          unsetSuccess();
15831
        } else {
15832
          setSuccess((Long)value);
15833
        }
15834
        break;
15835
 
15836
      case PEX:
15837
        if (value == null) {
15838
          unsetPex();
15839
        } else {
15840
          setPex((PromotionException)value);
15841
        }
15842
        break;
15843
 
15844
      }
15845
    }
15846
 
15847
    public Object getFieldValue(_Fields field) {
15848
      switch (field) {
15849
      case SUCCESS:
3430 rajveer 15850
        return Long.valueOf(getSuccess());
3385 varun.gupt 15851
 
15852
      case PEX:
15853
        return getPex();
15854
 
15855
      }
15856
      throw new IllegalStateException();
15857
    }
15858
 
3430 rajveer 15859
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15860
    public boolean isSet(_Fields field) {
15861
      if (field == null) {
15862
        throw new IllegalArgumentException();
15863
      }
3385 varun.gupt 15864
 
15865
      switch (field) {
15866
      case SUCCESS:
15867
        return isSetSuccess();
15868
      case PEX:
15869
        return isSetPex();
15870
      }
15871
      throw new IllegalStateException();
15872
    }
15873
 
15874
    @Override
15875
    public boolean equals(Object that) {
15876
      if (that == null)
15877
        return false;
15878
      if (that instanceof getSuccessfulPaymentCountForCoupon_result)
15879
        return this.equals((getSuccessfulPaymentCountForCoupon_result)that);
15880
      return false;
15881
    }
15882
 
15883
    public boolean equals(getSuccessfulPaymentCountForCoupon_result that) {
15884
      if (that == null)
15885
        return false;
15886
 
15887
      boolean this_present_success = true;
15888
      boolean that_present_success = true;
15889
      if (this_present_success || that_present_success) {
15890
        if (!(this_present_success && that_present_success))
15891
          return false;
15892
        if (this.success != that.success)
15893
          return false;
15894
      }
15895
 
15896
      boolean this_present_pex = true && this.isSetPex();
15897
      boolean that_present_pex = true && that.isSetPex();
15898
      if (this_present_pex || that_present_pex) {
15899
        if (!(this_present_pex && that_present_pex))
15900
          return false;
15901
        if (!this.pex.equals(that.pex))
15902
          return false;
15903
      }
15904
 
15905
      return true;
15906
    }
15907
 
15908
    @Override
15909
    public int hashCode() {
15910
      return 0;
15911
    }
15912
 
15913
    public int compareTo(getSuccessfulPaymentCountForCoupon_result other) {
15914
      if (!getClass().equals(other.getClass())) {
15915
        return getClass().getName().compareTo(other.getClass().getName());
15916
      }
15917
 
15918
      int lastComparison = 0;
15919
      getSuccessfulPaymentCountForCoupon_result typedOther = (getSuccessfulPaymentCountForCoupon_result)other;
15920
 
3430 rajveer 15921
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 15922
      if (lastComparison != 0) {
15923
        return lastComparison;
15924
      }
3430 rajveer 15925
      if (isSetSuccess()) {
15926
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
15927
        if (lastComparison != 0) {
15928
          return lastComparison;
15929
        }
3385 varun.gupt 15930
      }
3430 rajveer 15931
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 15932
      if (lastComparison != 0) {
15933
        return lastComparison;
15934
      }
3430 rajveer 15935
      if (isSetPex()) {
15936
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
15937
        if (lastComparison != 0) {
15938
          return lastComparison;
15939
        }
3385 varun.gupt 15940
      }
15941
      return 0;
15942
    }
15943
 
3430 rajveer 15944
    public _Fields fieldForId(int fieldId) {
15945
      return _Fields.findByThriftId(fieldId);
15946
    }
15947
 
15948
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15949
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 15950
      iprot.readStructBegin();
15951
      while (true)
15952
      {
15953
        field = iprot.readFieldBegin();
3430 rajveer 15954
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 15955
          break;
15956
        }
3430 rajveer 15957
        switch (field.id) {
15958
          case 0: // SUCCESS
15959
            if (field.type == org.apache.thrift.protocol.TType.I64) {
15960
              this.success = iprot.readI64();
15961
              setSuccessIsSet(true);
15962
            } else { 
15963
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15964
            }
15965
            break;
15966
          case 1: // PEX
15967
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
15968
              this.pex = new PromotionException();
15969
              this.pex.read(iprot);
15970
            } else { 
15971
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15972
            }
15973
            break;
15974
          default:
15975
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 15976
        }
3430 rajveer 15977
        iprot.readFieldEnd();
3385 varun.gupt 15978
      }
15979
      iprot.readStructEnd();
15980
      validate();
15981
    }
15982
 
3430 rajveer 15983
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 15984
      oprot.writeStructBegin(STRUCT_DESC);
15985
 
15986
      if (this.isSetSuccess()) {
15987
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
15988
        oprot.writeI64(this.success);
15989
        oprot.writeFieldEnd();
15990
      } else if (this.isSetPex()) {
15991
        oprot.writeFieldBegin(PEX_FIELD_DESC);
15992
        this.pex.write(oprot);
15993
        oprot.writeFieldEnd();
15994
      }
15995
      oprot.writeFieldStop();
15996
      oprot.writeStructEnd();
15997
    }
15998
 
15999
    @Override
16000
    public String toString() {
16001
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_result(");
16002
      boolean first = true;
16003
 
16004
      sb.append("success:");
16005
      sb.append(this.success);
16006
      first = false;
16007
      if (!first) sb.append(", ");
16008
      sb.append("pex:");
16009
      if (this.pex == null) {
16010
        sb.append("null");
16011
      } else {
16012
        sb.append(this.pex);
16013
      }
16014
      first = false;
16015
      sb.append(")");
16016
      return sb.toString();
16017
    }
16018
 
3430 rajveer 16019
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 16020
      // check for required fields
16021
    }
16022
 
3430 rajveer 16023
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16024
      try {
16025
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16026
      } catch (org.apache.thrift.TException te) {
16027
        throw new java.io.IOException(te);
16028
      }
16029
    }
16030
 
16031
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16032
      try {
16033
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16034
      } catch (org.apache.thrift.TException te) {
16035
        throw new java.io.IOException(te);
16036
      }
16037
    }
16038
 
3385 varun.gupt 16039
  }
16040
 
3430 rajveer 16041
  public static class getRuleDocString_args implements org.apache.thrift.TBase<getRuleDocString_args, getRuleDocString_args._Fields>, java.io.Serializable, Cloneable   {
16042
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_args");
3385 varun.gupt 16043
 
3430 rajveer 16044
    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 16045
 
3430 rajveer 16046
    private String ruleName; // required
3385 varun.gupt 16047
 
16048
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 16049
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 16050
      RULE_NAME((short)1, "ruleName");
16051
 
16052
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16053
 
16054
      static {
16055
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16056
          byName.put(field.getFieldName(), field);
16057
        }
16058
      }
16059
 
16060
      /**
16061
       * Find the _Fields constant that matches fieldId, or null if its not found.
16062
       */
16063
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 16064
        switch(fieldId) {
16065
          case 1: // RULE_NAME
16066
            return RULE_NAME;
16067
          default:
16068
            return null;
16069
        }
3385 varun.gupt 16070
      }
16071
 
16072
      /**
16073
       * Find the _Fields constant that matches fieldId, throwing an exception
16074
       * if it is not found.
16075
       */
16076
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16077
        _Fields fields = findByThriftId(fieldId);
16078
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16079
        return fields;
16080
      }
16081
 
16082
      /**
16083
       * Find the _Fields constant that matches name, or null if its not found.
16084
       */
16085
      public static _Fields findByName(String name) {
16086
        return byName.get(name);
16087
      }
16088
 
16089
      private final short _thriftId;
16090
      private final String _fieldName;
16091
 
16092
      _Fields(short thriftId, String fieldName) {
16093
        _thriftId = thriftId;
16094
        _fieldName = fieldName;
16095
      }
16096
 
16097
      public short getThriftFieldId() {
16098
        return _thriftId;
16099
      }
16100
 
16101
      public String getFieldName() {
16102
        return _fieldName;
16103
      }
16104
    }
16105
 
16106
    // isset id assignments
16107
 
3430 rajveer 16108
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 16109
    static {
3430 rajveer 16110
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16111
      tmpMap.put(_Fields.RULE_NAME, new org.apache.thrift.meta_data.FieldMetaData("ruleName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16112
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
16113
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16114
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_args.class, metaDataMap);
3385 varun.gupt 16115
    }
16116
 
16117
    public getRuleDocString_args() {
16118
    }
16119
 
16120
    public getRuleDocString_args(
16121
      String ruleName)
16122
    {
16123
      this();
16124
      this.ruleName = ruleName;
16125
    }
16126
 
16127
    /**
16128
     * Performs a deep copy on <i>other</i>.
16129
     */
16130
    public getRuleDocString_args(getRuleDocString_args other) {
16131
      if (other.isSetRuleName()) {
16132
        this.ruleName = other.ruleName;
16133
      }
16134
    }
16135
 
16136
    public getRuleDocString_args deepCopy() {
16137
      return new getRuleDocString_args(this);
16138
    }
16139
 
3430 rajveer 16140
    @Override
16141
    public void clear() {
16142
      this.ruleName = null;
3385 varun.gupt 16143
    }
16144
 
16145
    public String getRuleName() {
16146
      return this.ruleName;
16147
    }
16148
 
3430 rajveer 16149
    public void setRuleName(String ruleName) {
3385 varun.gupt 16150
      this.ruleName = ruleName;
16151
    }
16152
 
16153
    public void unsetRuleName() {
16154
      this.ruleName = null;
16155
    }
16156
 
3430 rajveer 16157
    /** Returns true if field ruleName is set (has been assigned a value) and false otherwise */
3385 varun.gupt 16158
    public boolean isSetRuleName() {
16159
      return this.ruleName != null;
16160
    }
16161
 
16162
    public void setRuleNameIsSet(boolean value) {
16163
      if (!value) {
16164
        this.ruleName = null;
16165
      }
16166
    }
16167
 
16168
    public void setFieldValue(_Fields field, Object value) {
16169
      switch (field) {
16170
      case RULE_NAME:
16171
        if (value == null) {
16172
          unsetRuleName();
16173
        } else {
16174
          setRuleName((String)value);
16175
        }
16176
        break;
16177
 
16178
      }
16179
    }
16180
 
16181
    public Object getFieldValue(_Fields field) {
16182
      switch (field) {
16183
      case RULE_NAME:
16184
        return getRuleName();
16185
 
16186
      }
16187
      throw new IllegalStateException();
16188
    }
16189
 
3430 rajveer 16190
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16191
    public boolean isSet(_Fields field) {
16192
      if (field == null) {
16193
        throw new IllegalArgumentException();
16194
      }
3385 varun.gupt 16195
 
16196
      switch (field) {
16197
      case RULE_NAME:
16198
        return isSetRuleName();
16199
      }
16200
      throw new IllegalStateException();
16201
    }
16202
 
16203
    @Override
16204
    public boolean equals(Object that) {
16205
      if (that == null)
16206
        return false;
16207
      if (that instanceof getRuleDocString_args)
16208
        return this.equals((getRuleDocString_args)that);
16209
      return false;
16210
    }
16211
 
16212
    public boolean equals(getRuleDocString_args that) {
16213
      if (that == null)
16214
        return false;
16215
 
16216
      boolean this_present_ruleName = true && this.isSetRuleName();
16217
      boolean that_present_ruleName = true && that.isSetRuleName();
16218
      if (this_present_ruleName || that_present_ruleName) {
16219
        if (!(this_present_ruleName && that_present_ruleName))
16220
          return false;
16221
        if (!this.ruleName.equals(that.ruleName))
16222
          return false;
16223
      }
16224
 
16225
      return true;
16226
    }
16227
 
16228
    @Override
16229
    public int hashCode() {
16230
      return 0;
16231
    }
16232
 
16233
    public int compareTo(getRuleDocString_args other) {
16234
      if (!getClass().equals(other.getClass())) {
16235
        return getClass().getName().compareTo(other.getClass().getName());
16236
      }
16237
 
16238
      int lastComparison = 0;
16239
      getRuleDocString_args typedOther = (getRuleDocString_args)other;
16240
 
3430 rajveer 16241
      lastComparison = Boolean.valueOf(isSetRuleName()).compareTo(typedOther.isSetRuleName());
3385 varun.gupt 16242
      if (lastComparison != 0) {
16243
        return lastComparison;
16244
      }
3430 rajveer 16245
      if (isSetRuleName()) {
16246
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleName, typedOther.ruleName);
16247
        if (lastComparison != 0) {
16248
          return lastComparison;
16249
        }
3385 varun.gupt 16250
      }
16251
      return 0;
16252
    }
16253
 
3430 rajveer 16254
    public _Fields fieldForId(int fieldId) {
16255
      return _Fields.findByThriftId(fieldId);
16256
    }
16257
 
16258
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16259
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 16260
      iprot.readStructBegin();
16261
      while (true)
16262
      {
16263
        field = iprot.readFieldBegin();
3430 rajveer 16264
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 16265
          break;
16266
        }
3430 rajveer 16267
        switch (field.id) {
16268
          case 1: // RULE_NAME
16269
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
16270
              this.ruleName = iprot.readString();
16271
            } else { 
16272
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16273
            }
16274
            break;
16275
          default:
16276
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 16277
        }
3430 rajveer 16278
        iprot.readFieldEnd();
3385 varun.gupt 16279
      }
16280
      iprot.readStructEnd();
16281
      validate();
16282
    }
16283
 
3430 rajveer 16284
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 16285
      validate();
16286
 
16287
      oprot.writeStructBegin(STRUCT_DESC);
16288
      if (this.ruleName != null) {
16289
        oprot.writeFieldBegin(RULE_NAME_FIELD_DESC);
16290
        oprot.writeString(this.ruleName);
16291
        oprot.writeFieldEnd();
16292
      }
16293
      oprot.writeFieldStop();
16294
      oprot.writeStructEnd();
16295
    }
16296
 
16297
    @Override
16298
    public String toString() {
16299
      StringBuilder sb = new StringBuilder("getRuleDocString_args(");
16300
      boolean first = true;
16301
 
16302
      sb.append("ruleName:");
16303
      if (this.ruleName == null) {
16304
        sb.append("null");
16305
      } else {
16306
        sb.append(this.ruleName);
16307
      }
16308
      first = false;
16309
      sb.append(")");
16310
      return sb.toString();
16311
    }
16312
 
3430 rajveer 16313
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 16314
      // check for required fields
16315
    }
16316
 
3430 rajveer 16317
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16318
      try {
16319
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16320
      } catch (org.apache.thrift.TException te) {
16321
        throw new java.io.IOException(te);
16322
      }
16323
    }
16324
 
16325
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16326
      try {
16327
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16328
      } catch (org.apache.thrift.TException te) {
16329
        throw new java.io.IOException(te);
16330
      }
16331
    }
16332
 
3385 varun.gupt 16333
  }
16334
 
3430 rajveer 16335
  public static class getRuleDocString_result implements org.apache.thrift.TBase<getRuleDocString_result, getRuleDocString_result._Fields>, java.io.Serializable, Cloneable   {
16336
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_result");
3385 varun.gupt 16337
 
3430 rajveer 16338
    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 16339
 
3430 rajveer 16340
    private String success; // required
3385 varun.gupt 16341
 
16342
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 16343
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 16344
      SUCCESS((short)0, "success");
16345
 
16346
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16347
 
16348
      static {
16349
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16350
          byName.put(field.getFieldName(), field);
16351
        }
16352
      }
16353
 
16354
      /**
16355
       * Find the _Fields constant that matches fieldId, or null if its not found.
16356
       */
16357
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 16358
        switch(fieldId) {
16359
          case 0: // SUCCESS
16360
            return SUCCESS;
16361
          default:
16362
            return null;
16363
        }
3385 varun.gupt 16364
      }
16365
 
16366
      /**
16367
       * Find the _Fields constant that matches fieldId, throwing an exception
16368
       * if it is not found.
16369
       */
16370
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16371
        _Fields fields = findByThriftId(fieldId);
16372
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16373
        return fields;
16374
      }
16375
 
16376
      /**
16377
       * Find the _Fields constant that matches name, or null if its not found.
16378
       */
16379
      public static _Fields findByName(String name) {
16380
        return byName.get(name);
16381
      }
16382
 
16383
      private final short _thriftId;
16384
      private final String _fieldName;
16385
 
16386
      _Fields(short thriftId, String fieldName) {
16387
        _thriftId = thriftId;
16388
        _fieldName = fieldName;
16389
      }
16390
 
16391
      public short getThriftFieldId() {
16392
        return _thriftId;
16393
      }
16394
 
16395
      public String getFieldName() {
16396
        return _fieldName;
16397
      }
16398
    }
16399
 
16400
    // isset id assignments
16401
 
3430 rajveer 16402
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 16403
    static {
3430 rajveer 16404
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16405
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16406
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
16407
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16408
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_result.class, metaDataMap);
3385 varun.gupt 16409
    }
16410
 
16411
    public getRuleDocString_result() {
16412
    }
16413
 
16414
    public getRuleDocString_result(
16415
      String success)
16416
    {
16417
      this();
16418
      this.success = success;
16419
    }
16420
 
16421
    /**
16422
     * Performs a deep copy on <i>other</i>.
16423
     */
16424
    public getRuleDocString_result(getRuleDocString_result other) {
16425
      if (other.isSetSuccess()) {
16426
        this.success = other.success;
16427
      }
16428
    }
16429
 
16430
    public getRuleDocString_result deepCopy() {
16431
      return new getRuleDocString_result(this);
16432
    }
16433
 
3430 rajveer 16434
    @Override
16435
    public void clear() {
16436
      this.success = null;
3385 varun.gupt 16437
    }
16438
 
16439
    public String getSuccess() {
16440
      return this.success;
16441
    }
16442
 
3430 rajveer 16443
    public void setSuccess(String success) {
3385 varun.gupt 16444
      this.success = success;
16445
    }
16446
 
16447
    public void unsetSuccess() {
16448
      this.success = null;
16449
    }
16450
 
3430 rajveer 16451
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 16452
    public boolean isSetSuccess() {
16453
      return this.success != null;
16454
    }
16455
 
16456
    public void setSuccessIsSet(boolean value) {
16457
      if (!value) {
16458
        this.success = null;
16459
      }
16460
    }
16461
 
16462
    public void setFieldValue(_Fields field, Object value) {
16463
      switch (field) {
16464
      case SUCCESS:
16465
        if (value == null) {
16466
          unsetSuccess();
16467
        } else {
16468
          setSuccess((String)value);
16469
        }
16470
        break;
16471
 
16472
      }
16473
    }
16474
 
16475
    public Object getFieldValue(_Fields field) {
16476
      switch (field) {
16477
      case SUCCESS:
16478
        return getSuccess();
16479
 
16480
      }
16481
      throw new IllegalStateException();
16482
    }
16483
 
3430 rajveer 16484
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16485
    public boolean isSet(_Fields field) {
16486
      if (field == null) {
16487
        throw new IllegalArgumentException();
16488
      }
3385 varun.gupt 16489
 
16490
      switch (field) {
16491
      case SUCCESS:
16492
        return isSetSuccess();
16493
      }
16494
      throw new IllegalStateException();
16495
    }
16496
 
16497
    @Override
16498
    public boolean equals(Object that) {
16499
      if (that == null)
16500
        return false;
16501
      if (that instanceof getRuleDocString_result)
16502
        return this.equals((getRuleDocString_result)that);
16503
      return false;
16504
    }
16505
 
16506
    public boolean equals(getRuleDocString_result that) {
16507
      if (that == null)
16508
        return false;
16509
 
16510
      boolean this_present_success = true && this.isSetSuccess();
16511
      boolean that_present_success = true && that.isSetSuccess();
16512
      if (this_present_success || that_present_success) {
16513
        if (!(this_present_success && that_present_success))
16514
          return false;
16515
        if (!this.success.equals(that.success))
16516
          return false;
16517
      }
16518
 
16519
      return true;
16520
    }
16521
 
16522
    @Override
16523
    public int hashCode() {
16524
      return 0;
16525
    }
16526
 
16527
    public int compareTo(getRuleDocString_result other) {
16528
      if (!getClass().equals(other.getClass())) {
16529
        return getClass().getName().compareTo(other.getClass().getName());
16530
      }
16531
 
16532
      int lastComparison = 0;
16533
      getRuleDocString_result typedOther = (getRuleDocString_result)other;
16534
 
3430 rajveer 16535
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 16536
      if (lastComparison != 0) {
16537
        return lastComparison;
16538
      }
3430 rajveer 16539
      if (isSetSuccess()) {
16540
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
16541
        if (lastComparison != 0) {
16542
          return lastComparison;
16543
        }
3385 varun.gupt 16544
      }
16545
      return 0;
16546
    }
16547
 
3430 rajveer 16548
    public _Fields fieldForId(int fieldId) {
16549
      return _Fields.findByThriftId(fieldId);
16550
    }
16551
 
16552
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16553
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 16554
      iprot.readStructBegin();
16555
      while (true)
16556
      {
16557
        field = iprot.readFieldBegin();
3430 rajveer 16558
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 16559
          break;
16560
        }
3430 rajveer 16561
        switch (field.id) {
16562
          case 0: // SUCCESS
16563
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
16564
              this.success = iprot.readString();
16565
            } else { 
16566
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16567
            }
16568
            break;
16569
          default:
16570
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 16571
        }
3430 rajveer 16572
        iprot.readFieldEnd();
3385 varun.gupt 16573
      }
16574
      iprot.readStructEnd();
16575
      validate();
16576
    }
16577
 
3430 rajveer 16578
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 16579
      oprot.writeStructBegin(STRUCT_DESC);
16580
 
16581
      if (this.isSetSuccess()) {
16582
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
16583
        oprot.writeString(this.success);
16584
        oprot.writeFieldEnd();
16585
      }
16586
      oprot.writeFieldStop();
16587
      oprot.writeStructEnd();
16588
    }
16589
 
16590
    @Override
16591
    public String toString() {
16592
      StringBuilder sb = new StringBuilder("getRuleDocString_result(");
16593
      boolean first = true;
16594
 
16595
      sb.append("success:");
16596
      if (this.success == null) {
16597
        sb.append("null");
16598
      } else {
16599
        sb.append(this.success);
16600
      }
16601
      first = false;
16602
      sb.append(")");
16603
      return sb.toString();
16604
    }
16605
 
3430 rajveer 16606
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 16607
      // check for required fields
16608
    }
16609
 
3430 rajveer 16610
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16611
      try {
16612
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16613
      } catch (org.apache.thrift.TException te) {
16614
        throw new java.io.IOException(te);
16615
      }
16616
    }
16617
 
16618
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16619
      try {
16620
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16621
      } catch (org.apache.thrift.TException te) {
16622
        throw new java.io.IOException(te);
16623
      }
16624
    }
16625
 
3385 varun.gupt 16626
  }
16627
 
4189 varun.gupt 16628
  public static class getItemDiscountMap_args implements org.apache.thrift.TBase<getItemDiscountMap_args, getItemDiscountMap_args._Fields>, java.io.Serializable, Cloneable   {
16629
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_args");
16630
 
16631
    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);
16632
 
16633
    private List<Long> itemIds; // required
16634
 
16635
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
16636
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
16637
      ITEM_IDS((short)1, "itemIds");
16638
 
16639
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16640
 
16641
      static {
16642
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16643
          byName.put(field.getFieldName(), field);
16644
        }
16645
      }
16646
 
16647
      /**
16648
       * Find the _Fields constant that matches fieldId, or null if its not found.
16649
       */
16650
      public static _Fields findByThriftId(int fieldId) {
16651
        switch(fieldId) {
16652
          case 1: // ITEM_IDS
16653
            return ITEM_IDS;
16654
          default:
16655
            return null;
16656
        }
16657
      }
16658
 
16659
      /**
16660
       * Find the _Fields constant that matches fieldId, throwing an exception
16661
       * if it is not found.
16662
       */
16663
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16664
        _Fields fields = findByThriftId(fieldId);
16665
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16666
        return fields;
16667
      }
16668
 
16669
      /**
16670
       * Find the _Fields constant that matches name, or null if its not found.
16671
       */
16672
      public static _Fields findByName(String name) {
16673
        return byName.get(name);
16674
      }
16675
 
16676
      private final short _thriftId;
16677
      private final String _fieldName;
16678
 
16679
      _Fields(short thriftId, String fieldName) {
16680
        _thriftId = thriftId;
16681
        _fieldName = fieldName;
16682
      }
16683
 
16684
      public short getThriftFieldId() {
16685
        return _thriftId;
16686
      }
16687
 
16688
      public String getFieldName() {
16689
        return _fieldName;
16690
      }
16691
    }
16692
 
16693
    // isset id assignments
16694
 
16695
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
16696
    static {
16697
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16698
      tmpMap.put(_Fields.ITEM_IDS, new org.apache.thrift.meta_data.FieldMetaData("itemIds", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16699
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
16700
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
16701
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16702
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_args.class, metaDataMap);
16703
    }
16704
 
16705
    public getItemDiscountMap_args() {
16706
    }
16707
 
16708
    public getItemDiscountMap_args(
16709
      List<Long> itemIds)
16710
    {
16711
      this();
16712
      this.itemIds = itemIds;
16713
    }
16714
 
16715
    /**
16716
     * Performs a deep copy on <i>other</i>.
16717
     */
16718
    public getItemDiscountMap_args(getItemDiscountMap_args other) {
16719
      if (other.isSetItemIds()) {
16720
        List<Long> __this__itemIds = new ArrayList<Long>();
16721
        for (Long other_element : other.itemIds) {
16722
          __this__itemIds.add(other_element);
16723
        }
16724
        this.itemIds = __this__itemIds;
16725
      }
16726
    }
16727
 
16728
    public getItemDiscountMap_args deepCopy() {
16729
      return new getItemDiscountMap_args(this);
16730
    }
16731
 
16732
    @Override
16733
    public void clear() {
16734
      this.itemIds = null;
16735
    }
16736
 
16737
    public int getItemIdsSize() {
16738
      return (this.itemIds == null) ? 0 : this.itemIds.size();
16739
    }
16740
 
16741
    public java.util.Iterator<Long> getItemIdsIterator() {
16742
      return (this.itemIds == null) ? null : this.itemIds.iterator();
16743
    }
16744
 
16745
    public void addToItemIds(long elem) {
16746
      if (this.itemIds == null) {
16747
        this.itemIds = new ArrayList<Long>();
16748
      }
16749
      this.itemIds.add(elem);
16750
    }
16751
 
16752
    public List<Long> getItemIds() {
16753
      return this.itemIds;
16754
    }
16755
 
16756
    public void setItemIds(List<Long> itemIds) {
16757
      this.itemIds = itemIds;
16758
    }
16759
 
16760
    public void unsetItemIds() {
16761
      this.itemIds = null;
16762
    }
16763
 
16764
    /** Returns true if field itemIds is set (has been assigned a value) and false otherwise */
16765
    public boolean isSetItemIds() {
16766
      return this.itemIds != null;
16767
    }
16768
 
16769
    public void setItemIdsIsSet(boolean value) {
16770
      if (!value) {
16771
        this.itemIds = null;
16772
      }
16773
    }
16774
 
16775
    public void setFieldValue(_Fields field, Object value) {
16776
      switch (field) {
16777
      case ITEM_IDS:
16778
        if (value == null) {
16779
          unsetItemIds();
16780
        } else {
16781
          setItemIds((List<Long>)value);
16782
        }
16783
        break;
16784
 
16785
      }
16786
    }
16787
 
16788
    public Object getFieldValue(_Fields field) {
16789
      switch (field) {
16790
      case ITEM_IDS:
16791
        return getItemIds();
16792
 
16793
      }
16794
      throw new IllegalStateException();
16795
    }
16796
 
16797
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16798
    public boolean isSet(_Fields field) {
16799
      if (field == null) {
16800
        throw new IllegalArgumentException();
16801
      }
16802
 
16803
      switch (field) {
16804
      case ITEM_IDS:
16805
        return isSetItemIds();
16806
      }
16807
      throw new IllegalStateException();
16808
    }
16809
 
16810
    @Override
16811
    public boolean equals(Object that) {
16812
      if (that == null)
16813
        return false;
16814
      if (that instanceof getItemDiscountMap_args)
16815
        return this.equals((getItemDiscountMap_args)that);
16816
      return false;
16817
    }
16818
 
16819
    public boolean equals(getItemDiscountMap_args that) {
16820
      if (that == null)
16821
        return false;
16822
 
16823
      boolean this_present_itemIds = true && this.isSetItemIds();
16824
      boolean that_present_itemIds = true && that.isSetItemIds();
16825
      if (this_present_itemIds || that_present_itemIds) {
16826
        if (!(this_present_itemIds && that_present_itemIds))
16827
          return false;
16828
        if (!this.itemIds.equals(that.itemIds))
16829
          return false;
16830
      }
16831
 
16832
      return true;
16833
    }
16834
 
16835
    @Override
16836
    public int hashCode() {
16837
      return 0;
16838
    }
16839
 
16840
    public int compareTo(getItemDiscountMap_args other) {
16841
      if (!getClass().equals(other.getClass())) {
16842
        return getClass().getName().compareTo(other.getClass().getName());
16843
      }
16844
 
16845
      int lastComparison = 0;
16846
      getItemDiscountMap_args typedOther = (getItemDiscountMap_args)other;
16847
 
16848
      lastComparison = Boolean.valueOf(isSetItemIds()).compareTo(typedOther.isSetItemIds());
16849
      if (lastComparison != 0) {
16850
        return lastComparison;
16851
      }
16852
      if (isSetItemIds()) {
16853
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemIds, typedOther.itemIds);
16854
        if (lastComparison != 0) {
16855
          return lastComparison;
16856
        }
16857
      }
16858
      return 0;
16859
    }
16860
 
16861
    public _Fields fieldForId(int fieldId) {
16862
      return _Fields.findByThriftId(fieldId);
16863
    }
16864
 
16865
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16866
      org.apache.thrift.protocol.TField field;
16867
      iprot.readStructBegin();
16868
      while (true)
16869
      {
16870
        field = iprot.readFieldBegin();
16871
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
16872
          break;
16873
        }
16874
        switch (field.id) {
16875
          case 1: // ITEM_IDS
16876
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
16877
              {
11592 amit.gupta 16878
                org.apache.thrift.protocol.TList _list42 = iprot.readListBegin();
16879
                this.itemIds = new ArrayList<Long>(_list42.size);
16880
                for (int _i43 = 0; _i43 < _list42.size; ++_i43)
4189 varun.gupt 16881
                {
11592 amit.gupta 16882
                  long _elem44; // required
16883
                  _elem44 = iprot.readI64();
16884
                  this.itemIds.add(_elem44);
4189 varun.gupt 16885
                }
16886
                iprot.readListEnd();
16887
              }
16888
            } else { 
16889
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16890
            }
16891
            break;
16892
          default:
16893
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16894
        }
16895
        iprot.readFieldEnd();
16896
      }
16897
      iprot.readStructEnd();
16898
      validate();
16899
    }
16900
 
16901
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
16902
      validate();
16903
 
16904
      oprot.writeStructBegin(STRUCT_DESC);
16905
      if (this.itemIds != null) {
16906
        oprot.writeFieldBegin(ITEM_IDS_FIELD_DESC);
16907
        {
16908
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.itemIds.size()));
11592 amit.gupta 16909
          for (long _iter45 : this.itemIds)
4189 varun.gupt 16910
          {
11592 amit.gupta 16911
            oprot.writeI64(_iter45);
4189 varun.gupt 16912
          }
16913
          oprot.writeListEnd();
16914
        }
16915
        oprot.writeFieldEnd();
16916
      }
16917
      oprot.writeFieldStop();
16918
      oprot.writeStructEnd();
16919
    }
16920
 
16921
    @Override
16922
    public String toString() {
16923
      StringBuilder sb = new StringBuilder("getItemDiscountMap_args(");
16924
      boolean first = true;
16925
 
16926
      sb.append("itemIds:");
16927
      if (this.itemIds == null) {
16928
        sb.append("null");
16929
      } else {
16930
        sb.append(this.itemIds);
16931
      }
16932
      first = false;
16933
      sb.append(")");
16934
      return sb.toString();
16935
    }
16936
 
16937
    public void validate() throws org.apache.thrift.TException {
16938
      // check for required fields
16939
    }
16940
 
16941
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16942
      try {
16943
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16944
      } catch (org.apache.thrift.TException te) {
16945
        throw new java.io.IOException(te);
16946
      }
16947
    }
16948
 
16949
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16950
      try {
16951
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16952
      } catch (org.apache.thrift.TException te) {
16953
        throw new java.io.IOException(te);
16954
      }
16955
    }
16956
 
16957
  }
16958
 
16959
  public static class getItemDiscountMap_result implements org.apache.thrift.TBase<getItemDiscountMap_result, getItemDiscountMap_result._Fields>, java.io.Serializable, Cloneable   {
16960
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_result");
16961
 
16962
    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);
16963
    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);
16964
 
16965
    private List<ItemCouponDiscount> success; // required
16966
    private PromotionException pex; // required
16967
 
16968
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
16969
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
16970
      SUCCESS((short)0, "success"),
16971
      PEX((short)1, "pex");
16972
 
16973
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16974
 
16975
      static {
16976
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16977
          byName.put(field.getFieldName(), field);
16978
        }
16979
      }
16980
 
16981
      /**
16982
       * Find the _Fields constant that matches fieldId, or null if its not found.
16983
       */
16984
      public static _Fields findByThriftId(int fieldId) {
16985
        switch(fieldId) {
16986
          case 0: // SUCCESS
16987
            return SUCCESS;
16988
          case 1: // PEX
16989
            return PEX;
16990
          default:
16991
            return null;
16992
        }
16993
      }
16994
 
16995
      /**
16996
       * Find the _Fields constant that matches fieldId, throwing an exception
16997
       * if it is not found.
16998
       */
16999
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17000
        _Fields fields = findByThriftId(fieldId);
17001
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17002
        return fields;
17003
      }
17004
 
17005
      /**
17006
       * Find the _Fields constant that matches name, or null if its not found.
17007
       */
17008
      public static _Fields findByName(String name) {
17009
        return byName.get(name);
17010
      }
17011
 
17012
      private final short _thriftId;
17013
      private final String _fieldName;
17014
 
17015
      _Fields(short thriftId, String fieldName) {
17016
        _thriftId = thriftId;
17017
        _fieldName = fieldName;
17018
      }
17019
 
17020
      public short getThriftFieldId() {
17021
        return _thriftId;
17022
      }
17023
 
17024
      public String getFieldName() {
17025
        return _fieldName;
17026
      }
17027
    }
17028
 
17029
    // isset id assignments
17030
 
17031
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
17032
    static {
17033
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
17034
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17035
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
17036
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ItemCouponDiscount.class))));
17037
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17038
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
17039
      metaDataMap = Collections.unmodifiableMap(tmpMap);
17040
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_result.class, metaDataMap);
17041
    }
17042
 
17043
    public getItemDiscountMap_result() {
17044
    }
17045
 
17046
    public getItemDiscountMap_result(
17047
      List<ItemCouponDiscount> success,
17048
      PromotionException pex)
17049
    {
17050
      this();
17051
      this.success = success;
17052
      this.pex = pex;
17053
    }
17054
 
17055
    /**
17056
     * Performs a deep copy on <i>other</i>.
17057
     */
17058
    public getItemDiscountMap_result(getItemDiscountMap_result other) {
17059
      if (other.isSetSuccess()) {
17060
        List<ItemCouponDiscount> __this__success = new ArrayList<ItemCouponDiscount>();
17061
        for (ItemCouponDiscount other_element : other.success) {
17062
          __this__success.add(new ItemCouponDiscount(other_element));
17063
        }
17064
        this.success = __this__success;
17065
      }
17066
      if (other.isSetPex()) {
17067
        this.pex = new PromotionException(other.pex);
17068
      }
17069
    }
17070
 
17071
    public getItemDiscountMap_result deepCopy() {
17072
      return new getItemDiscountMap_result(this);
17073
    }
17074
 
17075
    @Override
17076
    public void clear() {
17077
      this.success = null;
17078
      this.pex = null;
17079
    }
17080
 
17081
    public int getSuccessSize() {
17082
      return (this.success == null) ? 0 : this.success.size();
17083
    }
17084
 
17085
    public java.util.Iterator<ItemCouponDiscount> getSuccessIterator() {
17086
      return (this.success == null) ? null : this.success.iterator();
17087
    }
17088
 
17089
    public void addToSuccess(ItemCouponDiscount elem) {
17090
      if (this.success == null) {
17091
        this.success = new ArrayList<ItemCouponDiscount>();
17092
      }
17093
      this.success.add(elem);
17094
    }
17095
 
17096
    public List<ItemCouponDiscount> getSuccess() {
17097
      return this.success;
17098
    }
17099
 
17100
    public void setSuccess(List<ItemCouponDiscount> success) {
17101
      this.success = success;
17102
    }
17103
 
17104
    public void unsetSuccess() {
17105
      this.success = null;
17106
    }
17107
 
17108
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
17109
    public boolean isSetSuccess() {
17110
      return this.success != null;
17111
    }
17112
 
17113
    public void setSuccessIsSet(boolean value) {
17114
      if (!value) {
17115
        this.success = null;
17116
      }
17117
    }
17118
 
17119
    public PromotionException getPex() {
17120
      return this.pex;
17121
    }
17122
 
17123
    public void setPex(PromotionException pex) {
17124
      this.pex = pex;
17125
    }
17126
 
17127
    public void unsetPex() {
17128
      this.pex = null;
17129
    }
17130
 
17131
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
17132
    public boolean isSetPex() {
17133
      return this.pex != null;
17134
    }
17135
 
17136
    public void setPexIsSet(boolean value) {
17137
      if (!value) {
17138
        this.pex = null;
17139
      }
17140
    }
17141
 
17142
    public void setFieldValue(_Fields field, Object value) {
17143
      switch (field) {
17144
      case SUCCESS:
17145
        if (value == null) {
17146
          unsetSuccess();
17147
        } else {
17148
          setSuccess((List<ItemCouponDiscount>)value);
17149
        }
17150
        break;
17151
 
17152
      case PEX:
17153
        if (value == null) {
17154
          unsetPex();
17155
        } else {
17156
          setPex((PromotionException)value);
17157
        }
17158
        break;
17159
 
17160
      }
17161
    }
17162
 
17163
    public Object getFieldValue(_Fields field) {
17164
      switch (field) {
17165
      case SUCCESS:
17166
        return getSuccess();
17167
 
17168
      case PEX:
17169
        return getPex();
17170
 
17171
      }
17172
      throw new IllegalStateException();
17173
    }
17174
 
17175
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
17176
    public boolean isSet(_Fields field) {
17177
      if (field == null) {
17178
        throw new IllegalArgumentException();
17179
      }
17180
 
17181
      switch (field) {
17182
      case SUCCESS:
17183
        return isSetSuccess();
17184
      case PEX:
17185
        return isSetPex();
17186
      }
17187
      throw new IllegalStateException();
17188
    }
17189
 
17190
    @Override
17191
    public boolean equals(Object that) {
17192
      if (that == null)
17193
        return false;
17194
      if (that instanceof getItemDiscountMap_result)
17195
        return this.equals((getItemDiscountMap_result)that);
17196
      return false;
17197
    }
17198
 
17199
    public boolean equals(getItemDiscountMap_result that) {
17200
      if (that == null)
17201
        return false;
17202
 
17203
      boolean this_present_success = true && this.isSetSuccess();
17204
      boolean that_present_success = true && that.isSetSuccess();
17205
      if (this_present_success || that_present_success) {
17206
        if (!(this_present_success && that_present_success))
17207
          return false;
17208
        if (!this.success.equals(that.success))
17209
          return false;
17210
      }
17211
 
17212
      boolean this_present_pex = true && this.isSetPex();
17213
      boolean that_present_pex = true && that.isSetPex();
17214
      if (this_present_pex || that_present_pex) {
17215
        if (!(this_present_pex && that_present_pex))
17216
          return false;
17217
        if (!this.pex.equals(that.pex))
17218
          return false;
17219
      }
17220
 
17221
      return true;
17222
    }
17223
 
17224
    @Override
17225
    public int hashCode() {
17226
      return 0;
17227
    }
17228
 
17229
    public int compareTo(getItemDiscountMap_result other) {
17230
      if (!getClass().equals(other.getClass())) {
17231
        return getClass().getName().compareTo(other.getClass().getName());
17232
      }
17233
 
17234
      int lastComparison = 0;
17235
      getItemDiscountMap_result typedOther = (getItemDiscountMap_result)other;
17236
 
17237
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
17238
      if (lastComparison != 0) {
17239
        return lastComparison;
17240
      }
17241
      if (isSetSuccess()) {
17242
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
17243
        if (lastComparison != 0) {
17244
          return lastComparison;
17245
        }
17246
      }
17247
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
17248
      if (lastComparison != 0) {
17249
        return lastComparison;
17250
      }
17251
      if (isSetPex()) {
17252
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
17253
        if (lastComparison != 0) {
17254
          return lastComparison;
17255
        }
17256
      }
17257
      return 0;
17258
    }
17259
 
17260
    public _Fields fieldForId(int fieldId) {
17261
      return _Fields.findByThriftId(fieldId);
17262
    }
17263
 
17264
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17265
      org.apache.thrift.protocol.TField field;
17266
      iprot.readStructBegin();
17267
      while (true)
17268
      {
17269
        field = iprot.readFieldBegin();
17270
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17271
          break;
17272
        }
17273
        switch (field.id) {
17274
          case 0: // SUCCESS
17275
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
17276
              {
11592 amit.gupta 17277
                org.apache.thrift.protocol.TList _list46 = iprot.readListBegin();
17278
                this.success = new ArrayList<ItemCouponDiscount>(_list46.size);
17279
                for (int _i47 = 0; _i47 < _list46.size; ++_i47)
4189 varun.gupt 17280
                {
11592 amit.gupta 17281
                  ItemCouponDiscount _elem48; // required
17282
                  _elem48 = new ItemCouponDiscount();
17283
                  _elem48.read(iprot);
17284
                  this.success.add(_elem48);
4189 varun.gupt 17285
                }
17286
                iprot.readListEnd();
17287
              }
17288
            } else { 
17289
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17290
            }
17291
            break;
17292
          case 1: // PEX
17293
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
17294
              this.pex = new PromotionException();
17295
              this.pex.read(iprot);
17296
            } else { 
17297
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17298
            }
17299
            break;
17300
          default:
17301
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17302
        }
17303
        iprot.readFieldEnd();
17304
      }
17305
      iprot.readStructEnd();
17306
      validate();
17307
    }
17308
 
17309
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17310
      oprot.writeStructBegin(STRUCT_DESC);
17311
 
17312
      if (this.isSetSuccess()) {
17313
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
17314
        {
17315
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
11592 amit.gupta 17316
          for (ItemCouponDiscount _iter49 : this.success)
4189 varun.gupt 17317
          {
11592 amit.gupta 17318
            _iter49.write(oprot);
4189 varun.gupt 17319
          }
17320
          oprot.writeListEnd();
17321
        }
17322
        oprot.writeFieldEnd();
17323
      } else if (this.isSetPex()) {
17324
        oprot.writeFieldBegin(PEX_FIELD_DESC);
17325
        this.pex.write(oprot);
17326
        oprot.writeFieldEnd();
17327
      }
17328
      oprot.writeFieldStop();
17329
      oprot.writeStructEnd();
17330
    }
17331
 
17332
    @Override
17333
    public String toString() {
17334
      StringBuilder sb = new StringBuilder("getItemDiscountMap_result(");
17335
      boolean first = true;
17336
 
17337
      sb.append("success:");
17338
      if (this.success == null) {
17339
        sb.append("null");
17340
      } else {
17341
        sb.append(this.success);
17342
      }
17343
      first = false;
17344
      if (!first) sb.append(", ");
17345
      sb.append("pex:");
17346
      if (this.pex == null) {
17347
        sb.append("null");
17348
      } else {
17349
        sb.append(this.pex);
17350
      }
17351
      first = false;
17352
      sb.append(")");
17353
      return sb.toString();
17354
    }
17355
 
17356
    public void validate() throws org.apache.thrift.TException {
17357
      // check for required fields
17358
    }
17359
 
17360
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17361
      try {
17362
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17363
      } catch (org.apache.thrift.TException te) {
17364
        throw new java.io.IOException(te);
17365
      }
17366
    }
17367
 
17368
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
17369
      try {
17370
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
17371
      } catch (org.apache.thrift.TException te) {
17372
        throw new java.io.IOException(te);
17373
      }
17374
    }
17375
 
17376
  }
17377
 
4494 varun.gupt 17378
  public static class getDiscountsForEntity_args implements org.apache.thrift.TBase<getDiscountsForEntity_args, getDiscountsForEntity_args._Fields>, java.io.Serializable, Cloneable   {
17379
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_args");
17380
 
17381
    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);
17382
 
17383
    private long entityId; // required
17384
 
17385
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
17386
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
17387
      ENTITY_ID((short)1, "entityId");
17388
 
17389
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
17390
 
17391
      static {
17392
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
17393
          byName.put(field.getFieldName(), field);
17394
        }
17395
      }
17396
 
17397
      /**
17398
       * Find the _Fields constant that matches fieldId, or null if its not found.
17399
       */
17400
      public static _Fields findByThriftId(int fieldId) {
17401
        switch(fieldId) {
17402
          case 1: // ENTITY_ID
17403
            return ENTITY_ID;
17404
          default:
17405
            return null;
17406
        }
17407
      }
17408
 
17409
      /**
17410
       * Find the _Fields constant that matches fieldId, throwing an exception
17411
       * if it is not found.
17412
       */
17413
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17414
        _Fields fields = findByThriftId(fieldId);
17415
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17416
        return fields;
17417
      }
17418
 
17419
      /**
17420
       * Find the _Fields constant that matches name, or null if its not found.
17421
       */
17422
      public static _Fields findByName(String name) {
17423
        return byName.get(name);
17424
      }
17425
 
17426
      private final short _thriftId;
17427
      private final String _fieldName;
17428
 
17429
      _Fields(short thriftId, String fieldName) {
17430
        _thriftId = thriftId;
17431
        _fieldName = fieldName;
17432
      }
17433
 
17434
      public short getThriftFieldId() {
17435
        return _thriftId;
17436
      }
17437
 
17438
      public String getFieldName() {
17439
        return _fieldName;
17440
      }
17441
    }
17442
 
17443
    // isset id assignments
17444
    private static final int __ENTITYID_ISSET_ID = 0;
17445
    private BitSet __isset_bit_vector = new BitSet(1);
17446
 
17447
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
17448
    static {
17449
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
17450
      tmpMap.put(_Fields.ENTITY_ID, new org.apache.thrift.meta_data.FieldMetaData("entityId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17451
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
17452
      metaDataMap = Collections.unmodifiableMap(tmpMap);
17453
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_args.class, metaDataMap);
17454
    }
17455
 
17456
    public getDiscountsForEntity_args() {
17457
    }
17458
 
17459
    public getDiscountsForEntity_args(
17460
      long entityId)
17461
    {
17462
      this();
17463
      this.entityId = entityId;
17464
      setEntityIdIsSet(true);
17465
    }
17466
 
17467
    /**
17468
     * Performs a deep copy on <i>other</i>.
17469
     */
17470
    public getDiscountsForEntity_args(getDiscountsForEntity_args other) {
17471
      __isset_bit_vector.clear();
17472
      __isset_bit_vector.or(other.__isset_bit_vector);
17473
      this.entityId = other.entityId;
17474
    }
17475
 
17476
    public getDiscountsForEntity_args deepCopy() {
17477
      return new getDiscountsForEntity_args(this);
17478
    }
17479
 
17480
    @Override
17481
    public void clear() {
17482
      setEntityIdIsSet(false);
17483
      this.entityId = 0;
17484
    }
17485
 
17486
    public long getEntityId() {
17487
      return this.entityId;
17488
    }
17489
 
17490
    public void setEntityId(long entityId) {
17491
      this.entityId = entityId;
17492
      setEntityIdIsSet(true);
17493
    }
17494
 
17495
    public void unsetEntityId() {
17496
      __isset_bit_vector.clear(__ENTITYID_ISSET_ID);
17497
    }
17498
 
17499
    /** Returns true if field entityId is set (has been assigned a value) and false otherwise */
17500
    public boolean isSetEntityId() {
17501
      return __isset_bit_vector.get(__ENTITYID_ISSET_ID);
17502
    }
17503
 
17504
    public void setEntityIdIsSet(boolean value) {
17505
      __isset_bit_vector.set(__ENTITYID_ISSET_ID, value);
17506
    }
17507
 
17508
    public void setFieldValue(_Fields field, Object value) {
17509
      switch (field) {
17510
      case ENTITY_ID:
17511
        if (value == null) {
17512
          unsetEntityId();
17513
        } else {
17514
          setEntityId((Long)value);
17515
        }
17516
        break;
17517
 
17518
      }
17519
    }
17520
 
17521
    public Object getFieldValue(_Fields field) {
17522
      switch (field) {
17523
      case ENTITY_ID:
17524
        return Long.valueOf(getEntityId());
17525
 
17526
      }
17527
      throw new IllegalStateException();
17528
    }
17529
 
17530
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
17531
    public boolean isSet(_Fields field) {
17532
      if (field == null) {
17533
        throw new IllegalArgumentException();
17534
      }
17535
 
17536
      switch (field) {
17537
      case ENTITY_ID:
17538
        return isSetEntityId();
17539
      }
17540
      throw new IllegalStateException();
17541
    }
17542
 
17543
    @Override
17544
    public boolean equals(Object that) {
17545
      if (that == null)
17546
        return false;
17547
      if (that instanceof getDiscountsForEntity_args)
17548
        return this.equals((getDiscountsForEntity_args)that);
17549
      return false;
17550
    }
17551
 
17552
    public boolean equals(getDiscountsForEntity_args that) {
17553
      if (that == null)
17554
        return false;
17555
 
17556
      boolean this_present_entityId = true;
17557
      boolean that_present_entityId = true;
17558
      if (this_present_entityId || that_present_entityId) {
17559
        if (!(this_present_entityId && that_present_entityId))
17560
          return false;
17561
        if (this.entityId != that.entityId)
17562
          return false;
17563
      }
17564
 
17565
      return true;
17566
    }
17567
 
17568
    @Override
17569
    public int hashCode() {
17570
      return 0;
17571
    }
17572
 
17573
    public int compareTo(getDiscountsForEntity_args other) {
17574
      if (!getClass().equals(other.getClass())) {
17575
        return getClass().getName().compareTo(other.getClass().getName());
17576
      }
17577
 
17578
      int lastComparison = 0;
17579
      getDiscountsForEntity_args typedOther = (getDiscountsForEntity_args)other;
17580
 
17581
      lastComparison = Boolean.valueOf(isSetEntityId()).compareTo(typedOther.isSetEntityId());
17582
      if (lastComparison != 0) {
17583
        return lastComparison;
17584
      }
17585
      if (isSetEntityId()) {
17586
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityId, typedOther.entityId);
17587
        if (lastComparison != 0) {
17588
          return lastComparison;
17589
        }
17590
      }
17591
      return 0;
17592
    }
17593
 
17594
    public _Fields fieldForId(int fieldId) {
17595
      return _Fields.findByThriftId(fieldId);
17596
    }
17597
 
17598
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17599
      org.apache.thrift.protocol.TField field;
17600
      iprot.readStructBegin();
17601
      while (true)
17602
      {
17603
        field = iprot.readFieldBegin();
17604
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17605
          break;
17606
        }
17607
        switch (field.id) {
17608
          case 1: // ENTITY_ID
17609
            if (field.type == org.apache.thrift.protocol.TType.I64) {
17610
              this.entityId = iprot.readI64();
17611
              setEntityIdIsSet(true);
17612
            } else { 
17613
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17614
            }
17615
            break;
17616
          default:
17617
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17618
        }
17619
        iprot.readFieldEnd();
17620
      }
17621
      iprot.readStructEnd();
17622
      validate();
17623
    }
17624
 
17625
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17626
      validate();
17627
 
17628
      oprot.writeStructBegin(STRUCT_DESC);
17629
      oprot.writeFieldBegin(ENTITY_ID_FIELD_DESC);
17630
      oprot.writeI64(this.entityId);
17631
      oprot.writeFieldEnd();
17632
      oprot.writeFieldStop();
17633
      oprot.writeStructEnd();
17634
    }
17635
 
17636
    @Override
17637
    public String toString() {
17638
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_args(");
17639
      boolean first = true;
17640
 
17641
      sb.append("entityId:");
17642
      sb.append(this.entityId);
17643
      first = false;
17644
      sb.append(")");
17645
      return sb.toString();
17646
    }
17647
 
17648
    public void validate() throws org.apache.thrift.TException {
17649
      // check for required fields
17650
    }
17651
 
17652
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17653
      try {
17654
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17655
      } catch (org.apache.thrift.TException te) {
17656
        throw new java.io.IOException(te);
17657
      }
17658
    }
17659
 
17660
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
17661
      try {
17662
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
17663
        __isset_bit_vector = new BitSet(1);
17664
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
17665
      } catch (org.apache.thrift.TException te) {
17666
        throw new java.io.IOException(te);
17667
      }
17668
    }
17669
 
17670
  }
17671
 
17672
  public static class getDiscountsForEntity_result implements org.apache.thrift.TBase<getDiscountsForEntity_result, getDiscountsForEntity_result._Fields>, java.io.Serializable, Cloneable   {
17673
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_result");
17674
 
17675
    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);
17676
 
17677
    private Map<String,Double> success; // required
17678
 
17679
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
17680
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
17681
      SUCCESS((short)0, "success");
17682
 
17683
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
17684
 
17685
      static {
17686
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
17687
          byName.put(field.getFieldName(), field);
17688
        }
17689
      }
17690
 
17691
      /**
17692
       * Find the _Fields constant that matches fieldId, or null if its not found.
17693
       */
17694
      public static _Fields findByThriftId(int fieldId) {
17695
        switch(fieldId) {
17696
          case 0: // SUCCESS
17697
            return SUCCESS;
17698
          default:
17699
            return null;
17700
        }
17701
      }
17702
 
17703
      /**
17704
       * Find the _Fields constant that matches fieldId, throwing an exception
17705
       * if it is not found.
17706
       */
17707
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17708
        _Fields fields = findByThriftId(fieldId);
17709
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17710
        return fields;
17711
      }
17712
 
17713
      /**
17714
       * Find the _Fields constant that matches name, or null if its not found.
17715
       */
17716
      public static _Fields findByName(String name) {
17717
        return byName.get(name);
17718
      }
17719
 
17720
      private final short _thriftId;
17721
      private final String _fieldName;
17722
 
17723
      _Fields(short thriftId, String fieldName) {
17724
        _thriftId = thriftId;
17725
        _fieldName = fieldName;
17726
      }
17727
 
17728
      public short getThriftFieldId() {
17729
        return _thriftId;
17730
      }
17731
 
17732
      public String getFieldName() {
17733
        return _fieldName;
17734
      }
17735
    }
17736
 
17737
    // isset id assignments
17738
 
17739
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
17740
    static {
17741
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
17742
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17743
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
17744
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
17745
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
17746
      metaDataMap = Collections.unmodifiableMap(tmpMap);
17747
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_result.class, metaDataMap);
17748
    }
17749
 
17750
    public getDiscountsForEntity_result() {
17751
    }
17752
 
17753
    public getDiscountsForEntity_result(
17754
      Map<String,Double> success)
17755
    {
17756
      this();
17757
      this.success = success;
17758
    }
17759
 
17760
    /**
17761
     * Performs a deep copy on <i>other</i>.
17762
     */
17763
    public getDiscountsForEntity_result(getDiscountsForEntity_result other) {
17764
      if (other.isSetSuccess()) {
17765
        Map<String,Double> __this__success = new HashMap<String,Double>();
17766
        for (Map.Entry<String, Double> other_element : other.success.entrySet()) {
17767
 
17768
          String other_element_key = other_element.getKey();
17769
          Double other_element_value = other_element.getValue();
17770
 
17771
          String __this__success_copy_key = other_element_key;
17772
 
17773
          Double __this__success_copy_value = other_element_value;
17774
 
17775
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
17776
        }
17777
        this.success = __this__success;
17778
      }
17779
    }
17780
 
17781
    public getDiscountsForEntity_result deepCopy() {
17782
      return new getDiscountsForEntity_result(this);
17783
    }
17784
 
17785
    @Override
17786
    public void clear() {
17787
      this.success = null;
17788
    }
17789
 
17790
    public int getSuccessSize() {
17791
      return (this.success == null) ? 0 : this.success.size();
17792
    }
17793
 
17794
    public void putToSuccess(String key, double val) {
17795
      if (this.success == null) {
17796
        this.success = new HashMap<String,Double>();
17797
      }
17798
      this.success.put(key, val);
17799
    }
17800
 
17801
    public Map<String,Double> getSuccess() {
17802
      return this.success;
17803
    }
17804
 
17805
    public void setSuccess(Map<String,Double> success) {
17806
      this.success = success;
17807
    }
17808
 
17809
    public void unsetSuccess() {
17810
      this.success = null;
17811
    }
17812
 
17813
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
17814
    public boolean isSetSuccess() {
17815
      return this.success != null;
17816
    }
17817
 
17818
    public void setSuccessIsSet(boolean value) {
17819
      if (!value) {
17820
        this.success = null;
17821
      }
17822
    }
17823
 
17824
    public void setFieldValue(_Fields field, Object value) {
17825
      switch (field) {
17826
      case SUCCESS:
17827
        if (value == null) {
17828
          unsetSuccess();
17829
        } else {
17830
          setSuccess((Map<String,Double>)value);
17831
        }
17832
        break;
17833
 
17834
      }
17835
    }
17836
 
17837
    public Object getFieldValue(_Fields field) {
17838
      switch (field) {
17839
      case SUCCESS:
17840
        return getSuccess();
17841
 
17842
      }
17843
      throw new IllegalStateException();
17844
    }
17845
 
17846
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
17847
    public boolean isSet(_Fields field) {
17848
      if (field == null) {
17849
        throw new IllegalArgumentException();
17850
      }
17851
 
17852
      switch (field) {
17853
      case SUCCESS:
17854
        return isSetSuccess();
17855
      }
17856
      throw new IllegalStateException();
17857
    }
17858
 
17859
    @Override
17860
    public boolean equals(Object that) {
17861
      if (that == null)
17862
        return false;
17863
      if (that instanceof getDiscountsForEntity_result)
17864
        return this.equals((getDiscountsForEntity_result)that);
17865
      return false;
17866
    }
17867
 
17868
    public boolean equals(getDiscountsForEntity_result that) {
17869
      if (that == null)
17870
        return false;
17871
 
17872
      boolean this_present_success = true && this.isSetSuccess();
17873
      boolean that_present_success = true && that.isSetSuccess();
17874
      if (this_present_success || that_present_success) {
17875
        if (!(this_present_success && that_present_success))
17876
          return false;
17877
        if (!this.success.equals(that.success))
17878
          return false;
17879
      }
17880
 
17881
      return true;
17882
    }
17883
 
17884
    @Override
17885
    public int hashCode() {
17886
      return 0;
17887
    }
17888
 
17889
    public int compareTo(getDiscountsForEntity_result other) {
17890
      if (!getClass().equals(other.getClass())) {
17891
        return getClass().getName().compareTo(other.getClass().getName());
17892
      }
17893
 
17894
      int lastComparison = 0;
17895
      getDiscountsForEntity_result typedOther = (getDiscountsForEntity_result)other;
17896
 
17897
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
17898
      if (lastComparison != 0) {
17899
        return lastComparison;
17900
      }
17901
      if (isSetSuccess()) {
17902
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
17903
        if (lastComparison != 0) {
17904
          return lastComparison;
17905
        }
17906
      }
17907
      return 0;
17908
    }
17909
 
17910
    public _Fields fieldForId(int fieldId) {
17911
      return _Fields.findByThriftId(fieldId);
17912
    }
17913
 
17914
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17915
      org.apache.thrift.protocol.TField field;
17916
      iprot.readStructBegin();
17917
      while (true)
17918
      {
17919
        field = iprot.readFieldBegin();
17920
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17921
          break;
17922
        }
17923
        switch (field.id) {
17924
          case 0: // SUCCESS
17925
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
17926
              {
11592 amit.gupta 17927
                org.apache.thrift.protocol.TMap _map50 = iprot.readMapBegin();
17928
                this.success = new HashMap<String,Double>(2*_map50.size);
17929
                for (int _i51 = 0; _i51 < _map50.size; ++_i51)
4494 varun.gupt 17930
                {
11592 amit.gupta 17931
                  String _key52; // required
17932
                  double _val53; // required
17933
                  _key52 = iprot.readString();
17934
                  _val53 = iprot.readDouble();
17935
                  this.success.put(_key52, _val53);
4494 varun.gupt 17936
                }
17937
                iprot.readMapEnd();
17938
              }
17939
            } else { 
17940
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17941
            }
17942
            break;
17943
          default:
17944
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17945
        }
17946
        iprot.readFieldEnd();
17947
      }
17948
      iprot.readStructEnd();
17949
      validate();
17950
    }
17951
 
17952
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17953
      oprot.writeStructBegin(STRUCT_DESC);
17954
 
17955
      if (this.isSetSuccess()) {
17956
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
17957
        {
17958
          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 17959
          for (Map.Entry<String, Double> _iter54 : this.success.entrySet())
4494 varun.gupt 17960
          {
11592 amit.gupta 17961
            oprot.writeString(_iter54.getKey());
17962
            oprot.writeDouble(_iter54.getValue());
4494 varun.gupt 17963
          }
17964
          oprot.writeMapEnd();
17965
        }
17966
        oprot.writeFieldEnd();
17967
      }
17968
      oprot.writeFieldStop();
17969
      oprot.writeStructEnd();
17970
    }
17971
 
17972
    @Override
17973
    public String toString() {
17974
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_result(");
17975
      boolean first = true;
17976
 
17977
      sb.append("success:");
17978
      if (this.success == null) {
17979
        sb.append("null");
17980
      } else {
17981
        sb.append(this.success);
17982
      }
17983
      first = false;
17984
      sb.append(")");
17985
      return sb.toString();
17986
    }
17987
 
17988
    public void validate() throws org.apache.thrift.TException {
17989
      // check for required fields
17990
    }
17991
 
17992
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17993
      try {
17994
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17995
      } catch (org.apache.thrift.TException te) {
17996
        throw new java.io.IOException(te);
17997
      }
17998
    }
17999
 
18000
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
18001
      try {
18002
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
18003
      } catch (org.apache.thrift.TException te) {
18004
        throw new java.io.IOException(te);
18005
      }
18006
    }
18007
 
18008
  }
18009
 
5469 rajveer 18010
  public static class addVoucher_args implements org.apache.thrift.TBase<addVoucher_args, addVoucher_args._Fields>, java.io.Serializable, Cloneable   {
18011
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_args");
18012
 
18013
    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);
18014
 
18015
    private Voucher voucher; // required
18016
 
18017
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
18018
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
18019
      VOUCHER((short)1, "voucher");
18020
 
18021
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
18022
 
18023
      static {
18024
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
18025
          byName.put(field.getFieldName(), field);
18026
        }
18027
      }
18028
 
18029
      /**
18030
       * Find the _Fields constant that matches fieldId, or null if its not found.
18031
       */
18032
      public static _Fields findByThriftId(int fieldId) {
18033
        switch(fieldId) {
18034
          case 1: // VOUCHER
18035
            return VOUCHER;
18036
          default:
18037
            return null;
18038
        }
18039
      }
18040
 
18041
      /**
18042
       * Find the _Fields constant that matches fieldId, throwing an exception
18043
       * if it is not found.
18044
       */
18045
      public static _Fields findByThriftIdOrThrow(int fieldId) {
18046
        _Fields fields = findByThriftId(fieldId);
18047
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
18048
        return fields;
18049
      }
18050
 
18051
      /**
18052
       * Find the _Fields constant that matches name, or null if its not found.
18053
       */
18054
      public static _Fields findByName(String name) {
18055
        return byName.get(name);
18056
      }
18057
 
18058
      private final short _thriftId;
18059
      private final String _fieldName;
18060
 
18061
      _Fields(short thriftId, String fieldName) {
18062
        _thriftId = thriftId;
18063
        _fieldName = fieldName;
18064
      }
18065
 
18066
      public short getThriftFieldId() {
18067
        return _thriftId;
18068
      }
18069
 
18070
      public String getFieldName() {
18071
        return _fieldName;
18072
      }
18073
    }
18074
 
18075
    // isset id assignments
18076
 
18077
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
18078
    static {
18079
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
18080
      tmpMap.put(_Fields.VOUCHER, new org.apache.thrift.meta_data.FieldMetaData("voucher", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18081
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
18082
      metaDataMap = Collections.unmodifiableMap(tmpMap);
18083
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_args.class, metaDataMap);
18084
    }
18085
 
18086
    public addVoucher_args() {
18087
    }
18088
 
18089
    public addVoucher_args(
18090
      Voucher voucher)
18091
    {
18092
      this();
18093
      this.voucher = voucher;
18094
    }
18095
 
18096
    /**
18097
     * Performs a deep copy on <i>other</i>.
18098
     */
18099
    public addVoucher_args(addVoucher_args other) {
18100
      if (other.isSetVoucher()) {
18101
        this.voucher = new Voucher(other.voucher);
18102
      }
18103
    }
18104
 
18105
    public addVoucher_args deepCopy() {
18106
      return new addVoucher_args(this);
18107
    }
18108
 
18109
    @Override
18110
    public void clear() {
18111
      this.voucher = null;
18112
    }
18113
 
18114
    public Voucher getVoucher() {
18115
      return this.voucher;
18116
    }
18117
 
18118
    public void setVoucher(Voucher voucher) {
18119
      this.voucher = voucher;
18120
    }
18121
 
18122
    public void unsetVoucher() {
18123
      this.voucher = null;
18124
    }
18125
 
18126
    /** Returns true if field voucher is set (has been assigned a value) and false otherwise */
18127
    public boolean isSetVoucher() {
18128
      return this.voucher != null;
18129
    }
18130
 
18131
    public void setVoucherIsSet(boolean value) {
18132
      if (!value) {
18133
        this.voucher = null;
18134
      }
18135
    }
18136
 
18137
    public void setFieldValue(_Fields field, Object value) {
18138
      switch (field) {
18139
      case VOUCHER:
18140
        if (value == null) {
18141
          unsetVoucher();
18142
        } else {
18143
          setVoucher((Voucher)value);
18144
        }
18145
        break;
18146
 
18147
      }
18148
    }
18149
 
18150
    public Object getFieldValue(_Fields field) {
18151
      switch (field) {
18152
      case VOUCHER:
18153
        return getVoucher();
18154
 
18155
      }
18156
      throw new IllegalStateException();
18157
    }
18158
 
18159
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
18160
    public boolean isSet(_Fields field) {
18161
      if (field == null) {
18162
        throw new IllegalArgumentException();
18163
      }
18164
 
18165
      switch (field) {
18166
      case VOUCHER:
18167
        return isSetVoucher();
18168
      }
18169
      throw new IllegalStateException();
18170
    }
18171
 
18172
    @Override
18173
    public boolean equals(Object that) {
18174
      if (that == null)
18175
        return false;
18176
      if (that instanceof addVoucher_args)
18177
        return this.equals((addVoucher_args)that);
18178
      return false;
18179
    }
18180
 
18181
    public boolean equals(addVoucher_args that) {
18182
      if (that == null)
18183
        return false;
18184
 
18185
      boolean this_present_voucher = true && this.isSetVoucher();
18186
      boolean that_present_voucher = true && that.isSetVoucher();
18187
      if (this_present_voucher || that_present_voucher) {
18188
        if (!(this_present_voucher && that_present_voucher))
18189
          return false;
18190
        if (!this.voucher.equals(that.voucher))
18191
          return false;
18192
      }
18193
 
18194
      return true;
18195
    }
18196
 
18197
    @Override
18198
    public int hashCode() {
18199
      return 0;
18200
    }
18201
 
18202
    public int compareTo(addVoucher_args other) {
18203
      if (!getClass().equals(other.getClass())) {
18204
        return getClass().getName().compareTo(other.getClass().getName());
18205
      }
18206
 
18207
      int lastComparison = 0;
18208
      addVoucher_args typedOther = (addVoucher_args)other;
18209
 
18210
      lastComparison = Boolean.valueOf(isSetVoucher()).compareTo(typedOther.isSetVoucher());
18211
      if (lastComparison != 0) {
18212
        return lastComparison;
18213
      }
18214
      if (isSetVoucher()) {
18215
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucher, typedOther.voucher);
18216
        if (lastComparison != 0) {
18217
          return lastComparison;
18218
        }
18219
      }
18220
      return 0;
18221
    }
18222
 
18223
    public _Fields fieldForId(int fieldId) {
18224
      return _Fields.findByThriftId(fieldId);
18225
    }
18226
 
18227
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
18228
      org.apache.thrift.protocol.TField field;
18229
      iprot.readStructBegin();
18230
      while (true)
18231
      {
18232
        field = iprot.readFieldBegin();
18233
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
18234
          break;
18235
        }
18236
        switch (field.id) {
18237
          case 1: // VOUCHER
18238
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
18239
              this.voucher = new Voucher();
18240
              this.voucher.read(iprot);
18241
            } else { 
18242
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18243
            }
18244
            break;
18245
          default:
18246
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18247
        }
18248
        iprot.readFieldEnd();
18249
      }
18250
      iprot.readStructEnd();
18251
      validate();
18252
    }
18253
 
18254
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
18255
      validate();
18256
 
18257
      oprot.writeStructBegin(STRUCT_DESC);
18258
      if (this.voucher != null) {
18259
        oprot.writeFieldBegin(VOUCHER_FIELD_DESC);
18260
        this.voucher.write(oprot);
18261
        oprot.writeFieldEnd();
18262
      }
18263
      oprot.writeFieldStop();
18264
      oprot.writeStructEnd();
18265
    }
18266
 
18267
    @Override
18268
    public String toString() {
18269
      StringBuilder sb = new StringBuilder("addVoucher_args(");
18270
      boolean first = true;
18271
 
18272
      sb.append("voucher:");
18273
      if (this.voucher == null) {
18274
        sb.append("null");
18275
      } else {
18276
        sb.append(this.voucher);
18277
      }
18278
      first = false;
18279
      sb.append(")");
18280
      return sb.toString();
18281
    }
18282
 
18283
    public void validate() throws org.apache.thrift.TException {
18284
      // check for required fields
18285
    }
18286
 
18287
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
18288
      try {
18289
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
18290
      } catch (org.apache.thrift.TException te) {
18291
        throw new java.io.IOException(te);
18292
      }
18293
    }
18294
 
18295
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
18296
      try {
18297
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
18298
      } catch (org.apache.thrift.TException te) {
18299
        throw new java.io.IOException(te);
18300
      }
18301
    }
18302
 
18303
  }
18304
 
18305
  public static class addVoucher_result implements org.apache.thrift.TBase<addVoucher_result, addVoucher_result._Fields>, java.io.Serializable, Cloneable   {
18306
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_result");
18307
 
18308
 
18309
 
18310
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
18311
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
18312
;
18313
 
18314
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
18315
 
18316
      static {
18317
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
18318
          byName.put(field.getFieldName(), field);
18319
        }
18320
      }
18321
 
18322
      /**
18323
       * Find the _Fields constant that matches fieldId, or null if its not found.
18324
       */
18325
      public static _Fields findByThriftId(int fieldId) {
18326
        switch(fieldId) {
18327
          default:
18328
            return null;
18329
        }
18330
      }
18331
 
18332
      /**
18333
       * Find the _Fields constant that matches fieldId, throwing an exception
18334
       * if it is not found.
18335
       */
18336
      public static _Fields findByThriftIdOrThrow(int fieldId) {
18337
        _Fields fields = findByThriftId(fieldId);
18338
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
18339
        return fields;
18340
      }
18341
 
18342
      /**
18343
       * Find the _Fields constant that matches name, or null if its not found.
18344
       */
18345
      public static _Fields findByName(String name) {
18346
        return byName.get(name);
18347
      }
18348
 
18349
      private final short _thriftId;
18350
      private final String _fieldName;
18351
 
18352
      _Fields(short thriftId, String fieldName) {
18353
        _thriftId = thriftId;
18354
        _fieldName = fieldName;
18355
      }
18356
 
18357
      public short getThriftFieldId() {
18358
        return _thriftId;
18359
      }
18360
 
18361
      public String getFieldName() {
18362
        return _fieldName;
18363
      }
18364
    }
18365
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
18366
    static {
18367
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
18368
      metaDataMap = Collections.unmodifiableMap(tmpMap);
18369
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_result.class, metaDataMap);
18370
    }
18371
 
18372
    public addVoucher_result() {
18373
    }
18374
 
18375
    /**
18376
     * Performs a deep copy on <i>other</i>.
18377
     */
18378
    public addVoucher_result(addVoucher_result other) {
18379
    }
18380
 
18381
    public addVoucher_result deepCopy() {
18382
      return new addVoucher_result(this);
18383
    }
18384
 
18385
    @Override
18386
    public void clear() {
18387
    }
18388
 
18389
    public void setFieldValue(_Fields field, Object value) {
18390
      switch (field) {
18391
      }
18392
    }
18393
 
18394
    public Object getFieldValue(_Fields field) {
18395
      switch (field) {
18396
      }
18397
      throw new IllegalStateException();
18398
    }
18399
 
18400
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
18401
    public boolean isSet(_Fields field) {
18402
      if (field == null) {
18403
        throw new IllegalArgumentException();
18404
      }
18405
 
18406
      switch (field) {
18407
      }
18408
      throw new IllegalStateException();
18409
    }
18410
 
18411
    @Override
18412
    public boolean equals(Object that) {
18413
      if (that == null)
18414
        return false;
18415
      if (that instanceof addVoucher_result)
18416
        return this.equals((addVoucher_result)that);
18417
      return false;
18418
    }
18419
 
18420
    public boolean equals(addVoucher_result that) {
18421
      if (that == null)
18422
        return false;
18423
 
18424
      return true;
18425
    }
18426
 
18427
    @Override
18428
    public int hashCode() {
18429
      return 0;
18430
    }
18431
 
18432
    public int compareTo(addVoucher_result other) {
18433
      if (!getClass().equals(other.getClass())) {
18434
        return getClass().getName().compareTo(other.getClass().getName());
18435
      }
18436
 
18437
      int lastComparison = 0;
18438
      addVoucher_result typedOther = (addVoucher_result)other;
18439
 
18440
      return 0;
18441
    }
18442
 
18443
    public _Fields fieldForId(int fieldId) {
18444
      return _Fields.findByThriftId(fieldId);
18445
    }
18446
 
18447
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
18448
      org.apache.thrift.protocol.TField field;
18449
      iprot.readStructBegin();
18450
      while (true)
18451
      {
18452
        field = iprot.readFieldBegin();
18453
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
18454
          break;
18455
        }
18456
        switch (field.id) {
18457
          default:
18458
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18459
        }
18460
        iprot.readFieldEnd();
18461
      }
18462
      iprot.readStructEnd();
18463
      validate();
18464
    }
18465
 
18466
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
18467
      oprot.writeStructBegin(STRUCT_DESC);
18468
 
18469
      oprot.writeFieldStop();
18470
      oprot.writeStructEnd();
18471
    }
18472
 
18473
    @Override
18474
    public String toString() {
18475
      StringBuilder sb = new StringBuilder("addVoucher_result(");
18476
      boolean first = true;
18477
 
18478
      sb.append(")");
18479
      return sb.toString();
18480
    }
18481
 
18482
    public void validate() throws org.apache.thrift.TException {
18483
      // check for required fields
18484
    }
18485
 
18486
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
18487
      try {
18488
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
18489
      } catch (org.apache.thrift.TException te) {
18490
        throw new java.io.IOException(te);
18491
      }
18492
    }
18493
 
18494
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
18495
      try {
18496
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
18497
      } catch (org.apache.thrift.TException te) {
18498
        throw new java.io.IOException(te);
18499
      }
18500
    }
18501
 
18502
  }
18503
 
18504
  public static class assignVoucher_args implements org.apache.thrift.TBase<assignVoucher_args, assignVoucher_args._Fields>, java.io.Serializable, Cloneable   {
18505
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_args");
18506
 
18507
    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);
18508
    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);
18509
    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);
18510
    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);
18511
 
18512
    private long userId; // required
18513
    private String userEmail; // required
18514
    private VoucherType voucherType; // required
18515
    private long amount; // required
18516
 
18517
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
18518
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
18519
      USER_ID((short)1, "userId"),
18520
      USER_EMAIL((short)2, "userEmail"),
18521
      /**
18522
       * 
18523
       * @see VoucherType
18524
       */
18525
      VOUCHER_TYPE((short)3, "voucherType"),
18526
      AMOUNT((short)4, "amount");
18527
 
18528
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
18529
 
18530
      static {
18531
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
18532
          byName.put(field.getFieldName(), field);
18533
        }
18534
      }
18535
 
18536
      /**
18537
       * Find the _Fields constant that matches fieldId, or null if its not found.
18538
       */
18539
      public static _Fields findByThriftId(int fieldId) {
18540
        switch(fieldId) {
18541
          case 1: // USER_ID
18542
            return USER_ID;
18543
          case 2: // USER_EMAIL
18544
            return USER_EMAIL;
18545
          case 3: // VOUCHER_TYPE
18546
            return VOUCHER_TYPE;
18547
          case 4: // AMOUNT
18548
            return AMOUNT;
18549
          default:
18550
            return null;
18551
        }
18552
      }
18553
 
18554
      /**
18555
       * Find the _Fields constant that matches fieldId, throwing an exception
18556
       * if it is not found.
18557
       */
18558
      public static _Fields findByThriftIdOrThrow(int fieldId) {
18559
        _Fields fields = findByThriftId(fieldId);
18560
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
18561
        return fields;
18562
      }
18563
 
18564
      /**
18565
       * Find the _Fields constant that matches name, or null if its not found.
18566
       */
18567
      public static _Fields findByName(String name) {
18568
        return byName.get(name);
18569
      }
18570
 
18571
      private final short _thriftId;
18572
      private final String _fieldName;
18573
 
18574
      _Fields(short thriftId, String fieldName) {
18575
        _thriftId = thriftId;
18576
        _fieldName = fieldName;
18577
      }
18578
 
18579
      public short getThriftFieldId() {
18580
        return _thriftId;
18581
      }
18582
 
18583
      public String getFieldName() {
18584
        return _fieldName;
18585
      }
18586
    }
18587
 
18588
    // isset id assignments
18589
    private static final int __USERID_ISSET_ID = 0;
18590
    private static final int __AMOUNT_ISSET_ID = 1;
18591
    private BitSet __isset_bit_vector = new BitSet(2);
18592
 
18593
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
18594
    static {
18595
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
18596
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18597
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
18598
      tmpMap.put(_Fields.USER_EMAIL, new org.apache.thrift.meta_data.FieldMetaData("userEmail", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18599
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
18600
      tmpMap.put(_Fields.VOUCHER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("voucherType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18601
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, VoucherType.class)));
18602
      tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18603
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
18604
      metaDataMap = Collections.unmodifiableMap(tmpMap);
18605
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_args.class, metaDataMap);
18606
    }
18607
 
18608
    public assignVoucher_args() {
18609
    }
18610
 
18611
    public assignVoucher_args(
18612
      long userId,
18613
      String userEmail,
18614
      VoucherType voucherType,
18615
      long amount)
18616
    {
18617
      this();
18618
      this.userId = userId;
18619
      setUserIdIsSet(true);
18620
      this.userEmail = userEmail;
18621
      this.voucherType = voucherType;
18622
      this.amount = amount;
18623
      setAmountIsSet(true);
18624
    }
18625
 
18626
    /**
18627
     * Performs a deep copy on <i>other</i>.
18628
     */
18629
    public assignVoucher_args(assignVoucher_args other) {
18630
      __isset_bit_vector.clear();
18631
      __isset_bit_vector.or(other.__isset_bit_vector);
18632
      this.userId = other.userId;
18633
      if (other.isSetUserEmail()) {
18634
        this.userEmail = other.userEmail;
18635
      }
18636
      if (other.isSetVoucherType()) {
18637
        this.voucherType = other.voucherType;
18638
      }
18639
      this.amount = other.amount;
18640
    }
18641
 
18642
    public assignVoucher_args deepCopy() {
18643
      return new assignVoucher_args(this);
18644
    }
18645
 
18646
    @Override
18647
    public void clear() {
18648
      setUserIdIsSet(false);
18649
      this.userId = 0;
18650
      this.userEmail = null;
18651
      this.voucherType = null;
18652
      setAmountIsSet(false);
18653
      this.amount = 0;
18654
    }
18655
 
18656
    public long getUserId() {
18657
      return this.userId;
18658
    }
18659
 
18660
    public void setUserId(long userId) {
18661
      this.userId = userId;
18662
      setUserIdIsSet(true);
18663
    }
18664
 
18665
    public void unsetUserId() {
18666
      __isset_bit_vector.clear(__USERID_ISSET_ID);
18667
    }
18668
 
18669
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
18670
    public boolean isSetUserId() {
18671
      return __isset_bit_vector.get(__USERID_ISSET_ID);
18672
    }
18673
 
18674
    public void setUserIdIsSet(boolean value) {
18675
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
18676
    }
18677
 
18678
    public String getUserEmail() {
18679
      return this.userEmail;
18680
    }
18681
 
18682
    public void setUserEmail(String userEmail) {
18683
      this.userEmail = userEmail;
18684
    }
18685
 
18686
    public void unsetUserEmail() {
18687
      this.userEmail = null;
18688
    }
18689
 
18690
    /** Returns true if field userEmail is set (has been assigned a value) and false otherwise */
18691
    public boolean isSetUserEmail() {
18692
      return this.userEmail != null;
18693
    }
18694
 
18695
    public void setUserEmailIsSet(boolean value) {
18696
      if (!value) {
18697
        this.userEmail = null;
18698
      }
18699
    }
18700
 
18701
    /**
18702
     * 
18703
     * @see VoucherType
18704
     */
18705
    public VoucherType getVoucherType() {
18706
      return this.voucherType;
18707
    }
18708
 
18709
    /**
18710
     * 
18711
     * @see VoucherType
18712
     */
18713
    public void setVoucherType(VoucherType voucherType) {
18714
      this.voucherType = voucherType;
18715
    }
18716
 
18717
    public void unsetVoucherType() {
18718
      this.voucherType = null;
18719
    }
18720
 
18721
    /** Returns true if field voucherType is set (has been assigned a value) and false otherwise */
18722
    public boolean isSetVoucherType() {
18723
      return this.voucherType != null;
18724
    }
18725
 
18726
    public void setVoucherTypeIsSet(boolean value) {
18727
      if (!value) {
18728
        this.voucherType = null;
18729
      }
18730
    }
18731
 
18732
    public long getAmount() {
18733
      return this.amount;
18734
    }
18735
 
18736
    public void setAmount(long amount) {
18737
      this.amount = amount;
18738
      setAmountIsSet(true);
18739
    }
18740
 
18741
    public void unsetAmount() {
18742
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
18743
    }
18744
 
18745
    /** Returns true if field amount is set (has been assigned a value) and false otherwise */
18746
    public boolean isSetAmount() {
18747
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
18748
    }
18749
 
18750
    public void setAmountIsSet(boolean value) {
18751
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
18752
    }
18753
 
18754
    public void setFieldValue(_Fields field, Object value) {
18755
      switch (field) {
18756
      case USER_ID:
18757
        if (value == null) {
18758
          unsetUserId();
18759
        } else {
18760
          setUserId((Long)value);
18761
        }
18762
        break;
18763
 
18764
      case USER_EMAIL:
18765
        if (value == null) {
18766
          unsetUserEmail();
18767
        } else {
18768
          setUserEmail((String)value);
18769
        }
18770
        break;
18771
 
18772
      case VOUCHER_TYPE:
18773
        if (value == null) {
18774
          unsetVoucherType();
18775
        } else {
18776
          setVoucherType((VoucherType)value);
18777
        }
18778
        break;
18779
 
18780
      case AMOUNT:
18781
        if (value == null) {
18782
          unsetAmount();
18783
        } else {
18784
          setAmount((Long)value);
18785
        }
18786
        break;
18787
 
18788
      }
18789
    }
18790
 
18791
    public Object getFieldValue(_Fields field) {
18792
      switch (field) {
18793
      case USER_ID:
18794
        return Long.valueOf(getUserId());
18795
 
18796
      case USER_EMAIL:
18797
        return getUserEmail();
18798
 
18799
      case VOUCHER_TYPE:
18800
        return getVoucherType();
18801
 
18802
      case AMOUNT:
18803
        return Long.valueOf(getAmount());
18804
 
18805
      }
18806
      throw new IllegalStateException();
18807
    }
18808
 
18809
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
18810
    public boolean isSet(_Fields field) {
18811
      if (field == null) {
18812
        throw new IllegalArgumentException();
18813
      }
18814
 
18815
      switch (field) {
18816
      case USER_ID:
18817
        return isSetUserId();
18818
      case USER_EMAIL:
18819
        return isSetUserEmail();
18820
      case VOUCHER_TYPE:
18821
        return isSetVoucherType();
18822
      case AMOUNT:
18823
        return isSetAmount();
18824
      }
18825
      throw new IllegalStateException();
18826
    }
18827
 
18828
    @Override
18829
    public boolean equals(Object that) {
18830
      if (that == null)
18831
        return false;
18832
      if (that instanceof assignVoucher_args)
18833
        return this.equals((assignVoucher_args)that);
18834
      return false;
18835
    }
18836
 
18837
    public boolean equals(assignVoucher_args that) {
18838
      if (that == null)
18839
        return false;
18840
 
18841
      boolean this_present_userId = true;
18842
      boolean that_present_userId = true;
18843
      if (this_present_userId || that_present_userId) {
18844
        if (!(this_present_userId && that_present_userId))
18845
          return false;
18846
        if (this.userId != that.userId)
18847
          return false;
18848
      }
18849
 
18850
      boolean this_present_userEmail = true && this.isSetUserEmail();
18851
      boolean that_present_userEmail = true && that.isSetUserEmail();
18852
      if (this_present_userEmail || that_present_userEmail) {
18853
        if (!(this_present_userEmail && that_present_userEmail))
18854
          return false;
18855
        if (!this.userEmail.equals(that.userEmail))
18856
          return false;
18857
      }
18858
 
18859
      boolean this_present_voucherType = true && this.isSetVoucherType();
18860
      boolean that_present_voucherType = true && that.isSetVoucherType();
18861
      if (this_present_voucherType || that_present_voucherType) {
18862
        if (!(this_present_voucherType && that_present_voucherType))
18863
          return false;
18864
        if (!this.voucherType.equals(that.voucherType))
18865
          return false;
18866
      }
18867
 
18868
      boolean this_present_amount = true;
18869
      boolean that_present_amount = true;
18870
      if (this_present_amount || that_present_amount) {
18871
        if (!(this_present_amount && that_present_amount))
18872
          return false;
18873
        if (this.amount != that.amount)
18874
          return false;
18875
      }
18876
 
18877
      return true;
18878
    }
18879
 
18880
    @Override
18881
    public int hashCode() {
18882
      return 0;
18883
    }
18884
 
18885
    public int compareTo(assignVoucher_args other) {
18886
      if (!getClass().equals(other.getClass())) {
18887
        return getClass().getName().compareTo(other.getClass().getName());
18888
      }
18889
 
18890
      int lastComparison = 0;
18891
      assignVoucher_args typedOther = (assignVoucher_args)other;
18892
 
18893
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
18894
      if (lastComparison != 0) {
18895
        return lastComparison;
18896
      }
18897
      if (isSetUserId()) {
18898
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
18899
        if (lastComparison != 0) {
18900
          return lastComparison;
18901
        }
18902
      }
18903
      lastComparison = Boolean.valueOf(isSetUserEmail()).compareTo(typedOther.isSetUserEmail());
18904
      if (lastComparison != 0) {
18905
        return lastComparison;
18906
      }
18907
      if (isSetUserEmail()) {
18908
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userEmail, typedOther.userEmail);
18909
        if (lastComparison != 0) {
18910
          return lastComparison;
18911
        }
18912
      }
18913
      lastComparison = Boolean.valueOf(isSetVoucherType()).compareTo(typedOther.isSetVoucherType());
18914
      if (lastComparison != 0) {
18915
        return lastComparison;
18916
      }
18917
      if (isSetVoucherType()) {
18918
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherType, typedOther.voucherType);
18919
        if (lastComparison != 0) {
18920
          return lastComparison;
18921
        }
18922
      }
18923
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
18924
      if (lastComparison != 0) {
18925
        return lastComparison;
18926
      }
18927
      if (isSetAmount()) {
18928
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
18929
        if (lastComparison != 0) {
18930
          return lastComparison;
18931
        }
18932
      }
18933
      return 0;
18934
    }
18935
 
18936
    public _Fields fieldForId(int fieldId) {
18937
      return _Fields.findByThriftId(fieldId);
18938
    }
18939
 
18940
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
18941
      org.apache.thrift.protocol.TField field;
18942
      iprot.readStructBegin();
18943
      while (true)
18944
      {
18945
        field = iprot.readFieldBegin();
18946
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
18947
          break;
18948
        }
18949
        switch (field.id) {
18950
          case 1: // USER_ID
18951
            if (field.type == org.apache.thrift.protocol.TType.I64) {
18952
              this.userId = iprot.readI64();
18953
              setUserIdIsSet(true);
18954
            } else { 
18955
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18956
            }
18957
            break;
18958
          case 2: // USER_EMAIL
18959
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
18960
              this.userEmail = iprot.readString();
18961
            } else { 
18962
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18963
            }
18964
            break;
18965
          case 3: // VOUCHER_TYPE
18966
            if (field.type == org.apache.thrift.protocol.TType.I32) {
18967
              this.voucherType = VoucherType.findByValue(iprot.readI32());
18968
            } else { 
18969
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18970
            }
18971
            break;
18972
          case 4: // AMOUNT
18973
            if (field.type == org.apache.thrift.protocol.TType.I64) {
18974
              this.amount = iprot.readI64();
18975
              setAmountIsSet(true);
18976
            } else { 
18977
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18978
            }
18979
            break;
18980
          default:
18981
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18982
        }
18983
        iprot.readFieldEnd();
18984
      }
18985
      iprot.readStructEnd();
18986
      validate();
18987
    }
18988
 
18989
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
18990
      validate();
18991
 
18992
      oprot.writeStructBegin(STRUCT_DESC);
18993
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
18994
      oprot.writeI64(this.userId);
18995
      oprot.writeFieldEnd();
18996
      if (this.userEmail != null) {
18997
        oprot.writeFieldBegin(USER_EMAIL_FIELD_DESC);
18998
        oprot.writeString(this.userEmail);
18999
        oprot.writeFieldEnd();
19000
      }
19001
      if (this.voucherType != null) {
19002
        oprot.writeFieldBegin(VOUCHER_TYPE_FIELD_DESC);
19003
        oprot.writeI32(this.voucherType.getValue());
19004
        oprot.writeFieldEnd();
19005
      }
19006
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
19007
      oprot.writeI64(this.amount);
19008
      oprot.writeFieldEnd();
19009
      oprot.writeFieldStop();
19010
      oprot.writeStructEnd();
19011
    }
19012
 
19013
    @Override
19014
    public String toString() {
19015
      StringBuilder sb = new StringBuilder("assignVoucher_args(");
19016
      boolean first = true;
19017
 
19018
      sb.append("userId:");
19019
      sb.append(this.userId);
19020
      first = false;
19021
      if (!first) sb.append(", ");
19022
      sb.append("userEmail:");
19023
      if (this.userEmail == null) {
19024
        sb.append("null");
19025
      } else {
19026
        sb.append(this.userEmail);
19027
      }
19028
      first = false;
19029
      if (!first) sb.append(", ");
19030
      sb.append("voucherType:");
19031
      if (this.voucherType == null) {
19032
        sb.append("null");
19033
      } else {
19034
        sb.append(this.voucherType);
19035
      }
19036
      first = false;
19037
      if (!first) sb.append(", ");
19038
      sb.append("amount:");
19039
      sb.append(this.amount);
19040
      first = false;
19041
      sb.append(")");
19042
      return sb.toString();
19043
    }
19044
 
19045
    public void validate() throws org.apache.thrift.TException {
19046
      // check for required fields
19047
    }
19048
 
19049
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
19050
      try {
19051
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
19052
      } catch (org.apache.thrift.TException te) {
19053
        throw new java.io.IOException(te);
19054
      }
19055
    }
19056
 
19057
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
19058
      try {
19059
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
19060
        __isset_bit_vector = new BitSet(1);
19061
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
19062
      } catch (org.apache.thrift.TException te) {
19063
        throw new java.io.IOException(te);
19064
      }
19065
    }
19066
 
19067
  }
19068
 
19069
  public static class assignVoucher_result implements org.apache.thrift.TBase<assignVoucher_result, assignVoucher_result._Fields>, java.io.Serializable, Cloneable   {
19070
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_result");
19071
 
19072
    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);
19073
 
19074
    private Voucher success; // required
19075
 
19076
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
19077
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
19078
      SUCCESS((short)0, "success");
19079
 
19080
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
19081
 
19082
      static {
19083
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
19084
          byName.put(field.getFieldName(), field);
19085
        }
19086
      }
19087
 
19088
      /**
19089
       * Find the _Fields constant that matches fieldId, or null if its not found.
19090
       */
19091
      public static _Fields findByThriftId(int fieldId) {
19092
        switch(fieldId) {
19093
          case 0: // SUCCESS
19094
            return SUCCESS;
19095
          default:
19096
            return null;
19097
        }
19098
      }
19099
 
19100
      /**
19101
       * Find the _Fields constant that matches fieldId, throwing an exception
19102
       * if it is not found.
19103
       */
19104
      public static _Fields findByThriftIdOrThrow(int fieldId) {
19105
        _Fields fields = findByThriftId(fieldId);
19106
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
19107
        return fields;
19108
      }
19109
 
19110
      /**
19111
       * Find the _Fields constant that matches name, or null if its not found.
19112
       */
19113
      public static _Fields findByName(String name) {
19114
        return byName.get(name);
19115
      }
19116
 
19117
      private final short _thriftId;
19118
      private final String _fieldName;
19119
 
19120
      _Fields(short thriftId, String fieldName) {
19121
        _thriftId = thriftId;
19122
        _fieldName = fieldName;
19123
      }
19124
 
19125
      public short getThriftFieldId() {
19126
        return _thriftId;
19127
      }
19128
 
19129
      public String getFieldName() {
19130
        return _fieldName;
19131
      }
19132
    }
19133
 
19134
    // isset id assignments
19135
 
19136
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
19137
    static {
19138
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
19139
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
19140
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
19141
      metaDataMap = Collections.unmodifiableMap(tmpMap);
19142
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_result.class, metaDataMap);
19143
    }
19144
 
19145
    public assignVoucher_result() {
19146
    }
19147
 
19148
    public assignVoucher_result(
19149
      Voucher success)
19150
    {
19151
      this();
19152
      this.success = success;
19153
    }
19154
 
19155
    /**
19156
     * Performs a deep copy on <i>other</i>.
19157
     */
19158
    public assignVoucher_result(assignVoucher_result other) {
19159
      if (other.isSetSuccess()) {
19160
        this.success = new Voucher(other.success);
19161
      }
19162
    }
19163
 
19164
    public assignVoucher_result deepCopy() {
19165
      return new assignVoucher_result(this);
19166
    }
19167
 
19168
    @Override
19169
    public void clear() {
19170
      this.success = null;
19171
    }
19172
 
19173
    public Voucher getSuccess() {
19174
      return this.success;
19175
    }
19176
 
19177
    public void setSuccess(Voucher success) {
19178
      this.success = success;
19179
    }
19180
 
19181
    public void unsetSuccess() {
19182
      this.success = null;
19183
    }
19184
 
19185
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
19186
    public boolean isSetSuccess() {
19187
      return this.success != null;
19188
    }
19189
 
19190
    public void setSuccessIsSet(boolean value) {
19191
      if (!value) {
19192
        this.success = null;
19193
      }
19194
    }
19195
 
19196
    public void setFieldValue(_Fields field, Object value) {
19197
      switch (field) {
19198
      case SUCCESS:
19199
        if (value == null) {
19200
          unsetSuccess();
19201
        } else {
19202
          setSuccess((Voucher)value);
19203
        }
19204
        break;
19205
 
19206
      }
19207
    }
19208
 
19209
    public Object getFieldValue(_Fields field) {
19210
      switch (field) {
19211
      case SUCCESS:
19212
        return getSuccess();
19213
 
19214
      }
19215
      throw new IllegalStateException();
19216
    }
19217
 
19218
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
19219
    public boolean isSet(_Fields field) {
19220
      if (field == null) {
19221
        throw new IllegalArgumentException();
19222
      }
19223
 
19224
      switch (field) {
19225
      case SUCCESS:
19226
        return isSetSuccess();
19227
      }
19228
      throw new IllegalStateException();
19229
    }
19230
 
19231
    @Override
19232
    public boolean equals(Object that) {
19233
      if (that == null)
19234
        return false;
19235
      if (that instanceof assignVoucher_result)
19236
        return this.equals((assignVoucher_result)that);
19237
      return false;
19238
    }
19239
 
19240
    public boolean equals(assignVoucher_result that) {
19241
      if (that == null)
19242
        return false;
19243
 
19244
      boolean this_present_success = true && this.isSetSuccess();
19245
      boolean that_present_success = true && that.isSetSuccess();
19246
      if (this_present_success || that_present_success) {
19247
        if (!(this_present_success && that_present_success))
19248
          return false;
19249
        if (!this.success.equals(that.success))
19250
          return false;
19251
      }
19252
 
19253
      return true;
19254
    }
19255
 
19256
    @Override
19257
    public int hashCode() {
19258
      return 0;
19259
    }
19260
 
19261
    public int compareTo(assignVoucher_result other) {
19262
      if (!getClass().equals(other.getClass())) {
19263
        return getClass().getName().compareTo(other.getClass().getName());
19264
      }
19265
 
19266
      int lastComparison = 0;
19267
      assignVoucher_result typedOther = (assignVoucher_result)other;
19268
 
19269
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
19270
      if (lastComparison != 0) {
19271
        return lastComparison;
19272
      }
19273
      if (isSetSuccess()) {
19274
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
19275
        if (lastComparison != 0) {
19276
          return lastComparison;
19277
        }
19278
      }
19279
      return 0;
19280
    }
19281
 
19282
    public _Fields fieldForId(int fieldId) {
19283
      return _Fields.findByThriftId(fieldId);
19284
    }
19285
 
19286
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
19287
      org.apache.thrift.protocol.TField field;
19288
      iprot.readStructBegin();
19289
      while (true)
19290
      {
19291
        field = iprot.readFieldBegin();
19292
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
19293
          break;
19294
        }
19295
        switch (field.id) {
19296
          case 0: // SUCCESS
19297
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
19298
              this.success = new Voucher();
19299
              this.success.read(iprot);
19300
            } else { 
19301
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19302
            }
19303
            break;
19304
          default:
19305
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19306
        }
19307
        iprot.readFieldEnd();
19308
      }
19309
      iprot.readStructEnd();
19310
      validate();
19311
    }
19312
 
19313
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
19314
      oprot.writeStructBegin(STRUCT_DESC);
19315
 
19316
      if (this.isSetSuccess()) {
19317
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
19318
        this.success.write(oprot);
19319
        oprot.writeFieldEnd();
19320
      }
19321
      oprot.writeFieldStop();
19322
      oprot.writeStructEnd();
19323
    }
19324
 
19325
    @Override
19326
    public String toString() {
19327
      StringBuilder sb = new StringBuilder("assignVoucher_result(");
19328
      boolean first = true;
19329
 
19330
      sb.append("success:");
19331
      if (this.success == null) {
19332
        sb.append("null");
19333
      } else {
19334
        sb.append(this.success);
19335
      }
19336
      first = false;
19337
      sb.append(")");
19338
      return sb.toString();
19339
    }
19340
 
19341
    public void validate() throws org.apache.thrift.TException {
19342
      // check for required fields
19343
    }
19344
 
19345
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
19346
      try {
19347
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
19348
      } catch (org.apache.thrift.TException te) {
19349
        throw new java.io.IOException(te);
19350
      }
19351
    }
19352
 
19353
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
19354
      try {
19355
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
19356
      } catch (org.apache.thrift.TException te) {
19357
        throw new java.io.IOException(te);
19358
      }
19359
    }
19360
 
19361
  }
19362
 
19363
  public static class markVoucherAsRedeemed_args implements org.apache.thrift.TBase<markVoucherAsRedeemed_args, markVoucherAsRedeemed_args._Fields>, java.io.Serializable, Cloneable   {
19364
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_args");
19365
 
19366
    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);
19367
    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);
19368
 
19369
    private String voucherCode; // required
19370
    private long redeemedOn; // required
19371
 
19372
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
19373
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
19374
      VOUCHER_CODE((short)1, "voucherCode"),
19375
      REDEEMED_ON((short)2, "redeemedOn");
19376
 
19377
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
19378
 
19379
      static {
19380
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
19381
          byName.put(field.getFieldName(), field);
19382
        }
19383
      }
19384
 
19385
      /**
19386
       * Find the _Fields constant that matches fieldId, or null if its not found.
19387
       */
19388
      public static _Fields findByThriftId(int fieldId) {
19389
        switch(fieldId) {
19390
          case 1: // VOUCHER_CODE
19391
            return VOUCHER_CODE;
19392
          case 2: // REDEEMED_ON
19393
            return REDEEMED_ON;
19394
          default:
19395
            return null;
19396
        }
19397
      }
19398
 
19399
      /**
19400
       * Find the _Fields constant that matches fieldId, throwing an exception
19401
       * if it is not found.
19402
       */
19403
      public static _Fields findByThriftIdOrThrow(int fieldId) {
19404
        _Fields fields = findByThriftId(fieldId);
19405
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
19406
        return fields;
19407
      }
19408
 
19409
      /**
19410
       * Find the _Fields constant that matches name, or null if its not found.
19411
       */
19412
      public static _Fields findByName(String name) {
19413
        return byName.get(name);
19414
      }
19415
 
19416
      private final short _thriftId;
19417
      private final String _fieldName;
19418
 
19419
      _Fields(short thriftId, String fieldName) {
19420
        _thriftId = thriftId;
19421
        _fieldName = fieldName;
19422
      }
19423
 
19424
      public short getThriftFieldId() {
19425
        return _thriftId;
19426
      }
19427
 
19428
      public String getFieldName() {
19429
        return _fieldName;
19430
      }
19431
    }
19432
 
19433
    // isset id assignments
19434
    private static final int __REDEEMEDON_ISSET_ID = 0;
19435
    private BitSet __isset_bit_vector = new BitSet(1);
19436
 
19437
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
19438
    static {
19439
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
19440
      tmpMap.put(_Fields.VOUCHER_CODE, new org.apache.thrift.meta_data.FieldMetaData("voucherCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
19441
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
19442
      tmpMap.put(_Fields.REDEEMED_ON, new org.apache.thrift.meta_data.FieldMetaData("redeemedOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
19443
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
19444
      metaDataMap = Collections.unmodifiableMap(tmpMap);
19445
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_args.class, metaDataMap);
19446
    }
19447
 
19448
    public markVoucherAsRedeemed_args() {
19449
    }
19450
 
19451
    public markVoucherAsRedeemed_args(
19452
      String voucherCode,
19453
      long redeemedOn)
19454
    {
19455
      this();
19456
      this.voucherCode = voucherCode;
19457
      this.redeemedOn = redeemedOn;
19458
      setRedeemedOnIsSet(true);
19459
    }
19460
 
19461
    /**
19462
     * Performs a deep copy on <i>other</i>.
19463
     */
19464
    public markVoucherAsRedeemed_args(markVoucherAsRedeemed_args other) {
19465
      __isset_bit_vector.clear();
19466
      __isset_bit_vector.or(other.__isset_bit_vector);
19467
      if (other.isSetVoucherCode()) {
19468
        this.voucherCode = other.voucherCode;
19469
      }
19470
      this.redeemedOn = other.redeemedOn;
19471
    }
19472
 
19473
    public markVoucherAsRedeemed_args deepCopy() {
19474
      return new markVoucherAsRedeemed_args(this);
19475
    }
19476
 
19477
    @Override
19478
    public void clear() {
19479
      this.voucherCode = null;
19480
      setRedeemedOnIsSet(false);
19481
      this.redeemedOn = 0;
19482
    }
19483
 
19484
    public String getVoucherCode() {
19485
      return this.voucherCode;
19486
    }
19487
 
19488
    public void setVoucherCode(String voucherCode) {
19489
      this.voucherCode = voucherCode;
19490
    }
19491
 
19492
    public void unsetVoucherCode() {
19493
      this.voucherCode = null;
19494
    }
19495
 
19496
    /** Returns true if field voucherCode is set (has been assigned a value) and false otherwise */
19497
    public boolean isSetVoucherCode() {
19498
      return this.voucherCode != null;
19499
    }
19500
 
19501
    public void setVoucherCodeIsSet(boolean value) {
19502
      if (!value) {
19503
        this.voucherCode = null;
19504
      }
19505
    }
19506
 
19507
    public long getRedeemedOn() {
19508
      return this.redeemedOn;
19509
    }
19510
 
19511
    public void setRedeemedOn(long redeemedOn) {
19512
      this.redeemedOn = redeemedOn;
19513
      setRedeemedOnIsSet(true);
19514
    }
19515
 
19516
    public void unsetRedeemedOn() {
19517
      __isset_bit_vector.clear(__REDEEMEDON_ISSET_ID);
19518
    }
19519
 
19520
    /** Returns true if field redeemedOn is set (has been assigned a value) and false otherwise */
19521
    public boolean isSetRedeemedOn() {
19522
      return __isset_bit_vector.get(__REDEEMEDON_ISSET_ID);
19523
    }
19524
 
19525
    public void setRedeemedOnIsSet(boolean value) {
19526
      __isset_bit_vector.set(__REDEEMEDON_ISSET_ID, value);
19527
    }
19528
 
19529
    public void setFieldValue(_Fields field, Object value) {
19530
      switch (field) {
19531
      case VOUCHER_CODE:
19532
        if (value == null) {
19533
          unsetVoucherCode();
19534
        } else {
19535
          setVoucherCode((String)value);
19536
        }
19537
        break;
19538
 
19539
      case REDEEMED_ON:
19540
        if (value == null) {
19541
          unsetRedeemedOn();
19542
        } else {
19543
          setRedeemedOn((Long)value);
19544
        }
19545
        break;
19546
 
19547
      }
19548
    }
19549
 
19550
    public Object getFieldValue(_Fields field) {
19551
      switch (field) {
19552
      case VOUCHER_CODE:
19553
        return getVoucherCode();
19554
 
19555
      case REDEEMED_ON:
19556
        return Long.valueOf(getRedeemedOn());
19557
 
19558
      }
19559
      throw new IllegalStateException();
19560
    }
19561
 
19562
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
19563
    public boolean isSet(_Fields field) {
19564
      if (field == null) {
19565
        throw new IllegalArgumentException();
19566
      }
19567
 
19568
      switch (field) {
19569
      case VOUCHER_CODE:
19570
        return isSetVoucherCode();
19571
      case REDEEMED_ON:
19572
        return isSetRedeemedOn();
19573
      }
19574
      throw new IllegalStateException();
19575
    }
19576
 
19577
    @Override
19578
    public boolean equals(Object that) {
19579
      if (that == null)
19580
        return false;
19581
      if (that instanceof markVoucherAsRedeemed_args)
19582
        return this.equals((markVoucherAsRedeemed_args)that);
19583
      return false;
19584
    }
19585
 
19586
    public boolean equals(markVoucherAsRedeemed_args that) {
19587
      if (that == null)
19588
        return false;
19589
 
19590
      boolean this_present_voucherCode = true && this.isSetVoucherCode();
19591
      boolean that_present_voucherCode = true && that.isSetVoucherCode();
19592
      if (this_present_voucherCode || that_present_voucherCode) {
19593
        if (!(this_present_voucherCode && that_present_voucherCode))
19594
          return false;
19595
        if (!this.voucherCode.equals(that.voucherCode))
19596
          return false;
19597
      }
19598
 
19599
      boolean this_present_redeemedOn = true;
19600
      boolean that_present_redeemedOn = true;
19601
      if (this_present_redeemedOn || that_present_redeemedOn) {
19602
        if (!(this_present_redeemedOn && that_present_redeemedOn))
19603
          return false;
19604
        if (this.redeemedOn != that.redeemedOn)
19605
          return false;
19606
      }
19607
 
19608
      return true;
19609
    }
19610
 
19611
    @Override
19612
    public int hashCode() {
19613
      return 0;
19614
    }
19615
 
19616
    public int compareTo(markVoucherAsRedeemed_args other) {
19617
      if (!getClass().equals(other.getClass())) {
19618
        return getClass().getName().compareTo(other.getClass().getName());
19619
      }
19620
 
19621
      int lastComparison = 0;
19622
      markVoucherAsRedeemed_args typedOther = (markVoucherAsRedeemed_args)other;
19623
 
19624
      lastComparison = Boolean.valueOf(isSetVoucherCode()).compareTo(typedOther.isSetVoucherCode());
19625
      if (lastComparison != 0) {
19626
        return lastComparison;
19627
      }
19628
      if (isSetVoucherCode()) {
19629
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherCode, typedOther.voucherCode);
19630
        if (lastComparison != 0) {
19631
          return lastComparison;
19632
        }
19633
      }
19634
      lastComparison = Boolean.valueOf(isSetRedeemedOn()).compareTo(typedOther.isSetRedeemedOn());
19635
      if (lastComparison != 0) {
19636
        return lastComparison;
19637
      }
19638
      if (isSetRedeemedOn()) {
19639
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.redeemedOn, typedOther.redeemedOn);
19640
        if (lastComparison != 0) {
19641
          return lastComparison;
19642
        }
19643
      }
19644
      return 0;
19645
    }
19646
 
19647
    public _Fields fieldForId(int fieldId) {
19648
      return _Fields.findByThriftId(fieldId);
19649
    }
19650
 
19651
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
19652
      org.apache.thrift.protocol.TField field;
19653
      iprot.readStructBegin();
19654
      while (true)
19655
      {
19656
        field = iprot.readFieldBegin();
19657
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
19658
          break;
19659
        }
19660
        switch (field.id) {
19661
          case 1: // VOUCHER_CODE
19662
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
19663
              this.voucherCode = iprot.readString();
19664
            } else { 
19665
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19666
            }
19667
            break;
19668
          case 2: // REDEEMED_ON
19669
            if (field.type == org.apache.thrift.protocol.TType.I64) {
19670
              this.redeemedOn = iprot.readI64();
19671
              setRedeemedOnIsSet(true);
19672
            } else { 
19673
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19674
            }
19675
            break;
19676
          default:
19677
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19678
        }
19679
        iprot.readFieldEnd();
19680
      }
19681
      iprot.readStructEnd();
19682
      validate();
19683
    }
19684
 
19685
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
19686
      validate();
19687
 
19688
      oprot.writeStructBegin(STRUCT_DESC);
19689
      if (this.voucherCode != null) {
19690
        oprot.writeFieldBegin(VOUCHER_CODE_FIELD_DESC);
19691
        oprot.writeString(this.voucherCode);
19692
        oprot.writeFieldEnd();
19693
      }
19694
      oprot.writeFieldBegin(REDEEMED_ON_FIELD_DESC);
19695
      oprot.writeI64(this.redeemedOn);
19696
      oprot.writeFieldEnd();
19697
      oprot.writeFieldStop();
19698
      oprot.writeStructEnd();
19699
    }
19700
 
19701
    @Override
19702
    public String toString() {
19703
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_args(");
19704
      boolean first = true;
19705
 
19706
      sb.append("voucherCode:");
19707
      if (this.voucherCode == null) {
19708
        sb.append("null");
19709
      } else {
19710
        sb.append(this.voucherCode);
19711
      }
19712
      first = false;
19713
      if (!first) sb.append(", ");
19714
      sb.append("redeemedOn:");
19715
      sb.append(this.redeemedOn);
19716
      first = false;
19717
      sb.append(")");
19718
      return sb.toString();
19719
    }
19720
 
19721
    public void validate() throws org.apache.thrift.TException {
19722
      // check for required fields
19723
    }
19724
 
19725
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
19726
      try {
19727
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
19728
      } catch (org.apache.thrift.TException te) {
19729
        throw new java.io.IOException(te);
19730
      }
19731
    }
19732
 
19733
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
19734
      try {
19735
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
19736
        __isset_bit_vector = new BitSet(1);
19737
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
19738
      } catch (org.apache.thrift.TException te) {
19739
        throw new java.io.IOException(te);
19740
      }
19741
    }
19742
 
19743
  }
19744
 
19745
  public static class markVoucherAsRedeemed_result implements org.apache.thrift.TBase<markVoucherAsRedeemed_result, markVoucherAsRedeemed_result._Fields>, java.io.Serializable, Cloneable   {
19746
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_result");
19747
 
19748
    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);
19749
 
19750
    private boolean success; // required
19751
 
19752
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
19753
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
19754
      SUCCESS((short)0, "success");
19755
 
19756
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
19757
 
19758
      static {
19759
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
19760
          byName.put(field.getFieldName(), field);
19761
        }
19762
      }
19763
 
19764
      /**
19765
       * Find the _Fields constant that matches fieldId, or null if its not found.
19766
       */
19767
      public static _Fields findByThriftId(int fieldId) {
19768
        switch(fieldId) {
19769
          case 0: // SUCCESS
19770
            return SUCCESS;
19771
          default:
19772
            return null;
19773
        }
19774
      }
19775
 
19776
      /**
19777
       * Find the _Fields constant that matches fieldId, throwing an exception
19778
       * if it is not found.
19779
       */
19780
      public static _Fields findByThriftIdOrThrow(int fieldId) {
19781
        _Fields fields = findByThriftId(fieldId);
19782
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
19783
        return fields;
19784
      }
19785
 
19786
      /**
19787
       * Find the _Fields constant that matches name, or null if its not found.
19788
       */
19789
      public static _Fields findByName(String name) {
19790
        return byName.get(name);
19791
      }
19792
 
19793
      private final short _thriftId;
19794
      private final String _fieldName;
19795
 
19796
      _Fields(short thriftId, String fieldName) {
19797
        _thriftId = thriftId;
19798
        _fieldName = fieldName;
19799
      }
19800
 
19801
      public short getThriftFieldId() {
19802
        return _thriftId;
19803
      }
19804
 
19805
      public String getFieldName() {
19806
        return _fieldName;
19807
      }
19808
    }
19809
 
19810
    // isset id assignments
19811
    private static final int __SUCCESS_ISSET_ID = 0;
19812
    private BitSet __isset_bit_vector = new BitSet(1);
19813
 
19814
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
19815
    static {
19816
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
19817
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
19818
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
19819
      metaDataMap = Collections.unmodifiableMap(tmpMap);
19820
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_result.class, metaDataMap);
19821
    }
19822
 
19823
    public markVoucherAsRedeemed_result() {
19824
    }
19825
 
19826
    public markVoucherAsRedeemed_result(
19827
      boolean success)
19828
    {
19829
      this();
19830
      this.success = success;
19831
      setSuccessIsSet(true);
19832
    }
19833
 
19834
    /**
19835
     * Performs a deep copy on <i>other</i>.
19836
     */
19837
    public markVoucherAsRedeemed_result(markVoucherAsRedeemed_result other) {
19838
      __isset_bit_vector.clear();
19839
      __isset_bit_vector.or(other.__isset_bit_vector);
19840
      this.success = other.success;
19841
    }
19842
 
19843
    public markVoucherAsRedeemed_result deepCopy() {
19844
      return new markVoucherAsRedeemed_result(this);
19845
    }
19846
 
19847
    @Override
19848
    public void clear() {
19849
      setSuccessIsSet(false);
19850
      this.success = false;
19851
    }
19852
 
19853
    public boolean isSuccess() {
19854
      return this.success;
19855
    }
19856
 
19857
    public void setSuccess(boolean success) {
19858
      this.success = success;
19859
      setSuccessIsSet(true);
19860
    }
19861
 
19862
    public void unsetSuccess() {
19863
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
19864
    }
19865
 
19866
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
19867
    public boolean isSetSuccess() {
19868
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
19869
    }
19870
 
19871
    public void setSuccessIsSet(boolean value) {
19872
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
19873
    }
19874
 
19875
    public void setFieldValue(_Fields field, Object value) {
19876
      switch (field) {
19877
      case SUCCESS:
19878
        if (value == null) {
19879
          unsetSuccess();
19880
        } else {
19881
          setSuccess((Boolean)value);
19882
        }
19883
        break;
19884
 
19885
      }
19886
    }
19887
 
19888
    public Object getFieldValue(_Fields field) {
19889
      switch (field) {
19890
      case SUCCESS:
19891
        return Boolean.valueOf(isSuccess());
19892
 
19893
      }
19894
      throw new IllegalStateException();
19895
    }
19896
 
19897
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
19898
    public boolean isSet(_Fields field) {
19899
      if (field == null) {
19900
        throw new IllegalArgumentException();
19901
      }
19902
 
19903
      switch (field) {
19904
      case SUCCESS:
19905
        return isSetSuccess();
19906
      }
19907
      throw new IllegalStateException();
19908
    }
19909
 
19910
    @Override
19911
    public boolean equals(Object that) {
19912
      if (that == null)
19913
        return false;
19914
      if (that instanceof markVoucherAsRedeemed_result)
19915
        return this.equals((markVoucherAsRedeemed_result)that);
19916
      return false;
19917
    }
19918
 
19919
    public boolean equals(markVoucherAsRedeemed_result that) {
19920
      if (that == null)
19921
        return false;
19922
 
19923
      boolean this_present_success = true;
19924
      boolean that_present_success = true;
19925
      if (this_present_success || that_present_success) {
19926
        if (!(this_present_success && that_present_success))
19927
          return false;
19928
        if (this.success != that.success)
19929
          return false;
19930
      }
19931
 
19932
      return true;
19933
    }
19934
 
19935
    @Override
19936
    public int hashCode() {
19937
      return 0;
19938
    }
19939
 
19940
    public int compareTo(markVoucherAsRedeemed_result other) {
19941
      if (!getClass().equals(other.getClass())) {
19942
        return getClass().getName().compareTo(other.getClass().getName());
19943
      }
19944
 
19945
      int lastComparison = 0;
19946
      markVoucherAsRedeemed_result typedOther = (markVoucherAsRedeemed_result)other;
19947
 
19948
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
19949
      if (lastComparison != 0) {
19950
        return lastComparison;
19951
      }
19952
      if (isSetSuccess()) {
19953
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
19954
        if (lastComparison != 0) {
19955
          return lastComparison;
19956
        }
19957
      }
19958
      return 0;
19959
    }
19960
 
19961
    public _Fields fieldForId(int fieldId) {
19962
      return _Fields.findByThriftId(fieldId);
19963
    }
19964
 
19965
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
19966
      org.apache.thrift.protocol.TField field;
19967
      iprot.readStructBegin();
19968
      while (true)
19969
      {
19970
        field = iprot.readFieldBegin();
19971
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
19972
          break;
19973
        }
19974
        switch (field.id) {
19975
          case 0: // SUCCESS
19976
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
19977
              this.success = iprot.readBool();
19978
              setSuccessIsSet(true);
19979
            } else { 
19980
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19981
            }
19982
            break;
19983
          default:
19984
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19985
        }
19986
        iprot.readFieldEnd();
19987
      }
19988
      iprot.readStructEnd();
19989
      validate();
19990
    }
19991
 
19992
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
19993
      oprot.writeStructBegin(STRUCT_DESC);
19994
 
19995
      if (this.isSetSuccess()) {
19996
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
19997
        oprot.writeBool(this.success);
19998
        oprot.writeFieldEnd();
19999
      }
20000
      oprot.writeFieldStop();
20001
      oprot.writeStructEnd();
20002
    }
20003
 
20004
    @Override
20005
    public String toString() {
20006
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_result(");
20007
      boolean first = true;
20008
 
20009
      sb.append("success:");
20010
      sb.append(this.success);
20011
      first = false;
20012
      sb.append(")");
20013
      return sb.toString();
20014
    }
20015
 
20016
    public void validate() throws org.apache.thrift.TException {
20017
      // check for required fields
20018
    }
20019
 
20020
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
20021
      try {
20022
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
20023
      } catch (org.apache.thrift.TException te) {
20024
        throw new java.io.IOException(te);
20025
      }
20026
    }
20027
 
20028
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
20029
      try {
20030
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
20031
      } catch (org.apache.thrift.TException te) {
20032
        throw new java.io.IOException(te);
20033
      }
20034
    }
20035
 
20036
  }
20037
 
1982 varun.gupt 20038
}