Subversion Repositories SmartDukaan

Rev

Rev 8707 | Rev 11592 | 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
              {
5327 rajveer 6280
                org.apache.thrift.protocol.TList _list12 = iprot.readListBegin();
6281
                this.success = new ArrayList<Promotion>(_list12.size);
6282
                for (int _i13 = 0; _i13 < _list12.size; ++_i13)
1982 varun.gupt 6283
                {
5327 rajveer 6284
                  Promotion _elem14; // required
6285
                  _elem14 = new Promotion();
6286
                  _elem14.read(iprot);
6287
                  this.success.add(_elem14);
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()));
5327 rajveer 6319
          for (Promotion _iter15 : this.success)
1982 varun.gupt 6320
          {
5327 rajveer 6321
            _iter15.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
              {
9114
                org.apache.thrift.protocol.TMap _map16 = iprot.readMapBegin();
9115
                this.success = new HashMap<Long,Double>(2*_map16.size);
9116
                for (int _i17 = 0; _i17 < _map16.size; ++_i17)
9117
                {
9118
                  long _key18; // required
9119
                  double _val19; // required
9120
                  _key18 = iprot.readI64();
9121
                  _val19 = iprot.readDouble();
9122
                  this.success.put(_key18, _val19);
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()));
9154
          for (Map.Entry<Long, Double> _iter20 : this.success.entrySet())
9155
          {
9156
            oprot.writeI64(_iter20.getKey());
9157
            oprot.writeDouble(_iter20.getValue());
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
              {
6736 amit.gupta 10005
                org.apache.thrift.protocol.TMap _map21 = iprot.readMapBegin();
10006
                this.success = new HashMap<Long,String>(2*_map21.size);
10007
                for (int _i22 = 0; _i22 < _map21.size; ++_i22)
6433 anupam.sin 10008
                {
6736 amit.gupta 10009
                  long _key23; // required
10010
                  String _val24; // required
10011
                  _key23 = iprot.readI64();
10012
                  _val24 = iprot.readString();
10013
                  this.success.put(_key23, _val24);
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()));
6736 amit.gupta 10045
          for (Map.Entry<Long, String> _iter25 : this.success.entrySet())
6433 anupam.sin 10046
          {
6736 amit.gupta 10047
            oprot.writeI64(_iter25.getKey());
10048
            oprot.writeString(_iter25.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
              {
6736 amit.gupta 12242
                org.apache.thrift.protocol.TList _list26 = iprot.readListBegin();
12243
                this.success = new ArrayList<Coupon>(_list26.size);
12244
                for (int _i27 = 0; _i27 < _list26.size; ++_i27)
6497 amit.gupta 12245
                {
6736 amit.gupta 12246
                  Coupon _elem28; // required
12247
                  _elem28 = new Coupon();
12248
                  _elem28.read(iprot);
12249
                  this.success.add(_elem28);
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()));
6736 amit.gupta 12281
          for (Coupon _iter29 : this.success)
6497 amit.gupta 12282
          {
6736 amit.gupta 12283
            _iter29.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
              {
13543
                org.apache.thrift.protocol.TList _list30 = iprot.readListBegin();
13544
                this.success = new ArrayList<Coupon>(_list30.size);
13545
                for (int _i31 = 0; _i31 < _list30.size; ++_i31)
13546
                {
13547
                  Coupon _elem32; // required
13548
                  _elem32 = new Coupon();
13549
                  _elem32.read(iprot);
13550
                  this.success.add(_elem32);
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()));
13582
          for (Coupon _iter33 : this.success)
13583
          {
13584
            _iter33.write(oprot);
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
              {
7092 amit.gupta 14162
                org.apache.thrift.protocol.TList _list34 = iprot.readListBegin();
14163
                this.success = new ArrayList<Coupon>(_list34.size);
14164
                for (int _i35 = 0; _i35 < _list34.size; ++_i35)
3385 varun.gupt 14165
                {
7092 amit.gupta 14166
                  Coupon _elem36; // required
14167
                  _elem36 = new Coupon();
14168
                  _elem36.read(iprot);
14169
                  this.success.add(_elem36);
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()));
7092 amit.gupta 14201
          for (Coupon _iter37 : this.success)
3385 varun.gupt 14202
          {
7092 amit.gupta 14203
            _iter37.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 {
9791 rajveer 14977
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
14978
        __isset_bit_vector = new BitSet(1);
6250 amit.gupta 14979
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14980
      } catch (org.apache.thrift.TException te) {
14981
        throw new java.io.IOException(te);
14982
      }
14983
    }
14984
 
14985
  }
14986
 
14987
  public static class createCoupon_result implements org.apache.thrift.TBase<createCoupon_result, createCoupon_result._Fields>, java.io.Serializable, Cloneable   {
14988
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_result");
14989
 
14990
    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);
14991
    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);
14992
 
14993
    private String success; // required
14994
    private PromotionException pex; // required
14995
 
14996
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14997
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
14998
      SUCCESS((short)0, "success"),
14999
      PEX((short)1, "pex");
15000
 
15001
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15002
 
15003
      static {
15004
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15005
          byName.put(field.getFieldName(), field);
15006
        }
15007
      }
15008
 
15009
      /**
15010
       * Find the _Fields constant that matches fieldId, or null if its not found.
15011
       */
15012
      public static _Fields findByThriftId(int fieldId) {
15013
        switch(fieldId) {
15014
          case 0: // SUCCESS
15015
            return SUCCESS;
15016
          case 1: // PEX
15017
            return PEX;
15018
          default:
15019
            return null;
15020
        }
15021
      }
15022
 
15023
      /**
15024
       * Find the _Fields constant that matches fieldId, throwing an exception
15025
       * if it is not found.
15026
       */
15027
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15028
        _Fields fields = findByThriftId(fieldId);
15029
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15030
        return fields;
15031
      }
15032
 
15033
      /**
15034
       * Find the _Fields constant that matches name, or null if its not found.
15035
       */
15036
      public static _Fields findByName(String name) {
15037
        return byName.get(name);
15038
      }
15039
 
15040
      private final short _thriftId;
15041
      private final String _fieldName;
15042
 
15043
      _Fields(short thriftId, String fieldName) {
15044
        _thriftId = thriftId;
15045
        _fieldName = fieldName;
15046
      }
15047
 
15048
      public short getThriftFieldId() {
15049
        return _thriftId;
15050
      }
15051
 
15052
      public String getFieldName() {
15053
        return _fieldName;
15054
      }
15055
    }
15056
 
15057
    // isset id assignments
15058
 
15059
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
15060
    static {
15061
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15062
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15063
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
15064
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15065
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
15066
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15067
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_result.class, metaDataMap);
15068
    }
15069
 
15070
    public createCoupon_result() {
15071
    }
15072
 
15073
    public createCoupon_result(
15074
      String success,
15075
      PromotionException pex)
15076
    {
15077
      this();
15078
      this.success = success;
15079
      this.pex = pex;
15080
    }
15081
 
15082
    /**
15083
     * Performs a deep copy on <i>other</i>.
15084
     */
15085
    public createCoupon_result(createCoupon_result other) {
15086
      if (other.isSetSuccess()) {
15087
        this.success = other.success;
15088
      }
15089
      if (other.isSetPex()) {
15090
        this.pex = new PromotionException(other.pex);
15091
      }
15092
    }
15093
 
15094
    public createCoupon_result deepCopy() {
15095
      return new createCoupon_result(this);
15096
    }
15097
 
15098
    @Override
15099
    public void clear() {
15100
      this.success = null;
15101
      this.pex = null;
15102
    }
15103
 
15104
    public String getSuccess() {
15105
      return this.success;
15106
    }
15107
 
15108
    public void setSuccess(String success) {
15109
      this.success = success;
15110
    }
15111
 
15112
    public void unsetSuccess() {
15113
      this.success = null;
15114
    }
15115
 
15116
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
15117
    public boolean isSetSuccess() {
15118
      return this.success != null;
15119
    }
15120
 
15121
    public void setSuccessIsSet(boolean value) {
15122
      if (!value) {
15123
        this.success = null;
15124
      }
15125
    }
15126
 
15127
    public PromotionException getPex() {
15128
      return this.pex;
15129
    }
15130
 
15131
    public void setPex(PromotionException pex) {
15132
      this.pex = pex;
15133
    }
15134
 
15135
    public void unsetPex() {
15136
      this.pex = null;
15137
    }
15138
 
15139
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
15140
    public boolean isSetPex() {
15141
      return this.pex != null;
15142
    }
15143
 
15144
    public void setPexIsSet(boolean value) {
15145
      if (!value) {
15146
        this.pex = null;
15147
      }
15148
    }
15149
 
15150
    public void setFieldValue(_Fields field, Object value) {
15151
      switch (field) {
15152
      case SUCCESS:
15153
        if (value == null) {
15154
          unsetSuccess();
15155
        } else {
15156
          setSuccess((String)value);
15157
        }
15158
        break;
15159
 
15160
      case PEX:
15161
        if (value == null) {
15162
          unsetPex();
15163
        } else {
15164
          setPex((PromotionException)value);
15165
        }
15166
        break;
15167
 
15168
      }
15169
    }
15170
 
15171
    public Object getFieldValue(_Fields field) {
15172
      switch (field) {
15173
      case SUCCESS:
15174
        return getSuccess();
15175
 
15176
      case PEX:
15177
        return getPex();
15178
 
15179
      }
15180
      throw new IllegalStateException();
15181
    }
15182
 
15183
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15184
    public boolean isSet(_Fields field) {
15185
      if (field == null) {
15186
        throw new IllegalArgumentException();
15187
      }
15188
 
15189
      switch (field) {
15190
      case SUCCESS:
15191
        return isSetSuccess();
15192
      case PEX:
15193
        return isSetPex();
15194
      }
15195
      throw new IllegalStateException();
15196
    }
15197
 
15198
    @Override
15199
    public boolean equals(Object that) {
15200
      if (that == null)
15201
        return false;
15202
      if (that instanceof createCoupon_result)
15203
        return this.equals((createCoupon_result)that);
15204
      return false;
15205
    }
15206
 
15207
    public boolean equals(createCoupon_result that) {
15208
      if (that == null)
15209
        return false;
15210
 
15211
      boolean this_present_success = true && this.isSetSuccess();
15212
      boolean that_present_success = true && that.isSetSuccess();
15213
      if (this_present_success || that_present_success) {
15214
        if (!(this_present_success && that_present_success))
15215
          return false;
15216
        if (!this.success.equals(that.success))
15217
          return false;
15218
      }
15219
 
15220
      boolean this_present_pex = true && this.isSetPex();
15221
      boolean that_present_pex = true && that.isSetPex();
15222
      if (this_present_pex || that_present_pex) {
15223
        if (!(this_present_pex && that_present_pex))
15224
          return false;
15225
        if (!this.pex.equals(that.pex))
15226
          return false;
15227
      }
15228
 
15229
      return true;
15230
    }
15231
 
15232
    @Override
15233
    public int hashCode() {
15234
      return 0;
15235
    }
15236
 
15237
    public int compareTo(createCoupon_result other) {
15238
      if (!getClass().equals(other.getClass())) {
15239
        return getClass().getName().compareTo(other.getClass().getName());
15240
      }
15241
 
15242
      int lastComparison = 0;
15243
      createCoupon_result typedOther = (createCoupon_result)other;
15244
 
15245
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
15246
      if (lastComparison != 0) {
15247
        return lastComparison;
15248
      }
15249
      if (isSetSuccess()) {
15250
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
15251
        if (lastComparison != 0) {
15252
          return lastComparison;
15253
        }
15254
      }
15255
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
15256
      if (lastComparison != 0) {
15257
        return lastComparison;
15258
      }
15259
      if (isSetPex()) {
15260
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
15261
        if (lastComparison != 0) {
15262
          return lastComparison;
15263
        }
15264
      }
15265
      return 0;
15266
    }
15267
 
15268
    public _Fields fieldForId(int fieldId) {
15269
      return _Fields.findByThriftId(fieldId);
15270
    }
15271
 
15272
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15273
      org.apache.thrift.protocol.TField field;
15274
      iprot.readStructBegin();
15275
      while (true)
15276
      {
15277
        field = iprot.readFieldBegin();
15278
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
15279
          break;
15280
        }
15281
        switch (field.id) {
15282
          case 0: // SUCCESS
15283
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
15284
              this.success = iprot.readString();
15285
            } else { 
15286
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15287
            }
15288
            break;
15289
          case 1: // PEX
15290
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
15291
              this.pex = new PromotionException();
15292
              this.pex.read(iprot);
15293
            } else { 
15294
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15295
            }
15296
            break;
15297
          default:
15298
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15299
        }
15300
        iprot.readFieldEnd();
15301
      }
15302
      iprot.readStructEnd();
15303
      validate();
15304
    }
15305
 
15306
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
15307
      oprot.writeStructBegin(STRUCT_DESC);
15308
 
15309
      if (this.isSetSuccess()) {
15310
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
15311
        oprot.writeString(this.success);
15312
        oprot.writeFieldEnd();
15313
      } else if (this.isSetPex()) {
15314
        oprot.writeFieldBegin(PEX_FIELD_DESC);
15315
        this.pex.write(oprot);
15316
        oprot.writeFieldEnd();
15317
      }
15318
      oprot.writeFieldStop();
15319
      oprot.writeStructEnd();
15320
    }
15321
 
15322
    @Override
15323
    public String toString() {
15324
      StringBuilder sb = new StringBuilder("createCoupon_result(");
15325
      boolean first = true;
15326
 
15327
      sb.append("success:");
15328
      if (this.success == null) {
15329
        sb.append("null");
15330
      } else {
15331
        sb.append(this.success);
15332
      }
15333
      first = false;
15334
      if (!first) sb.append(", ");
15335
      sb.append("pex:");
15336
      if (this.pex == null) {
15337
        sb.append("null");
15338
      } else {
15339
        sb.append(this.pex);
15340
      }
15341
      first = false;
15342
      sb.append(")");
15343
      return sb.toString();
15344
    }
15345
 
15346
    public void validate() throws org.apache.thrift.TException {
15347
      // check for required fields
15348
    }
15349
 
15350
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15351
      try {
15352
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15353
      } catch (org.apache.thrift.TException te) {
15354
        throw new java.io.IOException(te);
15355
      }
15356
    }
15357
 
15358
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15359
      try {
15360
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15361
      } catch (org.apache.thrift.TException te) {
15362
        throw new java.io.IOException(te);
15363
      }
15364
    }
15365
 
15366
  }
15367
 
3430 rajveer 15368
  public static class getSuccessfulPaymentCountForCoupon_args implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_args, getSuccessfulPaymentCountForCoupon_args._Fields>, java.io.Serializable, Cloneable   {
15369
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_args");
3385 varun.gupt 15370
 
3430 rajveer 15371
    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 15372
 
3430 rajveer 15373
    private String couponCode; // required
3385 varun.gupt 15374
 
15375
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 15376
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 15377
      COUPON_CODE((short)1, "couponCode");
15378
 
15379
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15380
 
15381
      static {
15382
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15383
          byName.put(field.getFieldName(), field);
15384
        }
15385
      }
15386
 
15387
      /**
15388
       * Find the _Fields constant that matches fieldId, or null if its not found.
15389
       */
15390
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 15391
        switch(fieldId) {
15392
          case 1: // COUPON_CODE
15393
            return COUPON_CODE;
15394
          default:
15395
            return null;
15396
        }
3385 varun.gupt 15397
      }
15398
 
15399
      /**
15400
       * Find the _Fields constant that matches fieldId, throwing an exception
15401
       * if it is not found.
15402
       */
15403
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15404
        _Fields fields = findByThriftId(fieldId);
15405
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15406
        return fields;
15407
      }
15408
 
15409
      /**
15410
       * Find the _Fields constant that matches name, or null if its not found.
15411
       */
15412
      public static _Fields findByName(String name) {
15413
        return byName.get(name);
15414
      }
15415
 
15416
      private final short _thriftId;
15417
      private final String _fieldName;
15418
 
15419
      _Fields(short thriftId, String fieldName) {
15420
        _thriftId = thriftId;
15421
        _fieldName = fieldName;
15422
      }
15423
 
15424
      public short getThriftFieldId() {
15425
        return _thriftId;
15426
      }
15427
 
15428
      public String getFieldName() {
15429
        return _fieldName;
15430
      }
15431
    }
15432
 
15433
    // isset id assignments
15434
 
3430 rajveer 15435
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 15436
    static {
3430 rajveer 15437
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15438
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15439
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
15440
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15441
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_args.class, metaDataMap);
3385 varun.gupt 15442
    }
15443
 
15444
    public getSuccessfulPaymentCountForCoupon_args() {
15445
    }
15446
 
15447
    public getSuccessfulPaymentCountForCoupon_args(
15448
      String couponCode)
15449
    {
15450
      this();
15451
      this.couponCode = couponCode;
15452
    }
15453
 
15454
    /**
15455
     * Performs a deep copy on <i>other</i>.
15456
     */
15457
    public getSuccessfulPaymentCountForCoupon_args(getSuccessfulPaymentCountForCoupon_args other) {
15458
      if (other.isSetCouponCode()) {
15459
        this.couponCode = other.couponCode;
15460
      }
15461
    }
15462
 
15463
    public getSuccessfulPaymentCountForCoupon_args deepCopy() {
15464
      return new getSuccessfulPaymentCountForCoupon_args(this);
15465
    }
15466
 
3430 rajveer 15467
    @Override
15468
    public void clear() {
15469
      this.couponCode = null;
3385 varun.gupt 15470
    }
15471
 
15472
    public String getCouponCode() {
15473
      return this.couponCode;
15474
    }
15475
 
3430 rajveer 15476
    public void setCouponCode(String couponCode) {
3385 varun.gupt 15477
      this.couponCode = couponCode;
15478
    }
15479
 
15480
    public void unsetCouponCode() {
15481
      this.couponCode = null;
15482
    }
15483
 
3430 rajveer 15484
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3385 varun.gupt 15485
    public boolean isSetCouponCode() {
15486
      return this.couponCode != null;
15487
    }
15488
 
15489
    public void setCouponCodeIsSet(boolean value) {
15490
      if (!value) {
15491
        this.couponCode = null;
15492
      }
15493
    }
15494
 
15495
    public void setFieldValue(_Fields field, Object value) {
15496
      switch (field) {
15497
      case COUPON_CODE:
15498
        if (value == null) {
15499
          unsetCouponCode();
15500
        } else {
15501
          setCouponCode((String)value);
15502
        }
15503
        break;
15504
 
15505
      }
15506
    }
15507
 
15508
    public Object getFieldValue(_Fields field) {
15509
      switch (field) {
15510
      case COUPON_CODE:
15511
        return getCouponCode();
15512
 
15513
      }
15514
      throw new IllegalStateException();
15515
    }
15516
 
3430 rajveer 15517
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15518
    public boolean isSet(_Fields field) {
15519
      if (field == null) {
15520
        throw new IllegalArgumentException();
15521
      }
3385 varun.gupt 15522
 
15523
      switch (field) {
15524
      case COUPON_CODE:
15525
        return isSetCouponCode();
15526
      }
15527
      throw new IllegalStateException();
15528
    }
15529
 
15530
    @Override
15531
    public boolean equals(Object that) {
15532
      if (that == null)
15533
        return false;
15534
      if (that instanceof getSuccessfulPaymentCountForCoupon_args)
15535
        return this.equals((getSuccessfulPaymentCountForCoupon_args)that);
15536
      return false;
15537
    }
15538
 
15539
    public boolean equals(getSuccessfulPaymentCountForCoupon_args that) {
15540
      if (that == null)
15541
        return false;
15542
 
15543
      boolean this_present_couponCode = true && this.isSetCouponCode();
15544
      boolean that_present_couponCode = true && that.isSetCouponCode();
15545
      if (this_present_couponCode || that_present_couponCode) {
15546
        if (!(this_present_couponCode && that_present_couponCode))
15547
          return false;
15548
        if (!this.couponCode.equals(that.couponCode))
15549
          return false;
15550
      }
15551
 
15552
      return true;
15553
    }
15554
 
15555
    @Override
15556
    public int hashCode() {
15557
      return 0;
15558
    }
15559
 
15560
    public int compareTo(getSuccessfulPaymentCountForCoupon_args other) {
15561
      if (!getClass().equals(other.getClass())) {
15562
        return getClass().getName().compareTo(other.getClass().getName());
15563
      }
15564
 
15565
      int lastComparison = 0;
15566
      getSuccessfulPaymentCountForCoupon_args typedOther = (getSuccessfulPaymentCountForCoupon_args)other;
15567
 
3430 rajveer 15568
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3385 varun.gupt 15569
      if (lastComparison != 0) {
15570
        return lastComparison;
15571
      }
3430 rajveer 15572
      if (isSetCouponCode()) {
15573
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
15574
        if (lastComparison != 0) {
15575
          return lastComparison;
15576
        }
3385 varun.gupt 15577
      }
15578
      return 0;
15579
    }
15580
 
3430 rajveer 15581
    public _Fields fieldForId(int fieldId) {
15582
      return _Fields.findByThriftId(fieldId);
15583
    }
15584
 
15585
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15586
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 15587
      iprot.readStructBegin();
15588
      while (true)
15589
      {
15590
        field = iprot.readFieldBegin();
3430 rajveer 15591
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 15592
          break;
15593
        }
3430 rajveer 15594
        switch (field.id) {
15595
          case 1: // COUPON_CODE
15596
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
15597
              this.couponCode = iprot.readString();
15598
            } else { 
15599
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15600
            }
15601
            break;
15602
          default:
15603
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 15604
        }
3430 rajveer 15605
        iprot.readFieldEnd();
3385 varun.gupt 15606
      }
15607
      iprot.readStructEnd();
15608
      validate();
15609
    }
15610
 
3430 rajveer 15611
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 15612
      validate();
15613
 
15614
      oprot.writeStructBegin(STRUCT_DESC);
15615
      if (this.couponCode != null) {
15616
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
15617
        oprot.writeString(this.couponCode);
15618
        oprot.writeFieldEnd();
15619
      }
15620
      oprot.writeFieldStop();
15621
      oprot.writeStructEnd();
15622
    }
15623
 
15624
    @Override
15625
    public String toString() {
15626
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_args(");
15627
      boolean first = true;
15628
 
15629
      sb.append("couponCode:");
15630
      if (this.couponCode == null) {
15631
        sb.append("null");
15632
      } else {
15633
        sb.append(this.couponCode);
15634
      }
15635
      first = false;
15636
      sb.append(")");
15637
      return sb.toString();
15638
    }
15639
 
3430 rajveer 15640
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 15641
      // check for required fields
15642
    }
15643
 
3430 rajveer 15644
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15645
      try {
15646
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15647
      } catch (org.apache.thrift.TException te) {
15648
        throw new java.io.IOException(te);
15649
      }
15650
    }
15651
 
15652
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15653
      try {
15654
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15655
      } catch (org.apache.thrift.TException te) {
15656
        throw new java.io.IOException(te);
15657
      }
15658
    }
15659
 
3385 varun.gupt 15660
  }
15661
 
3430 rajveer 15662
  public static class getSuccessfulPaymentCountForCoupon_result implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_result, getSuccessfulPaymentCountForCoupon_result._Fields>, java.io.Serializable, Cloneable   {
15663
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_result");
3385 varun.gupt 15664
 
3430 rajveer 15665
    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);
15666
    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 15667
 
3430 rajveer 15668
    private long success; // required
15669
    private PromotionException pex; // required
3385 varun.gupt 15670
 
15671
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 15672
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 15673
      SUCCESS((short)0, "success"),
15674
      PEX((short)1, "pex");
15675
 
15676
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15677
 
15678
      static {
15679
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15680
          byName.put(field.getFieldName(), field);
15681
        }
15682
      }
15683
 
15684
      /**
15685
       * Find the _Fields constant that matches fieldId, or null if its not found.
15686
       */
15687
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 15688
        switch(fieldId) {
15689
          case 0: // SUCCESS
15690
            return SUCCESS;
15691
          case 1: // PEX
15692
            return PEX;
15693
          default:
15694
            return null;
15695
        }
3385 varun.gupt 15696
      }
15697
 
15698
      /**
15699
       * Find the _Fields constant that matches fieldId, throwing an exception
15700
       * if it is not found.
15701
       */
15702
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15703
        _Fields fields = findByThriftId(fieldId);
15704
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15705
        return fields;
15706
      }
15707
 
15708
      /**
15709
       * Find the _Fields constant that matches name, or null if its not found.
15710
       */
15711
      public static _Fields findByName(String name) {
15712
        return byName.get(name);
15713
      }
15714
 
15715
      private final short _thriftId;
15716
      private final String _fieldName;
15717
 
15718
      _Fields(short thriftId, String fieldName) {
15719
        _thriftId = thriftId;
15720
        _fieldName = fieldName;
15721
      }
15722
 
15723
      public short getThriftFieldId() {
15724
        return _thriftId;
15725
      }
15726
 
15727
      public String getFieldName() {
15728
        return _fieldName;
15729
      }
15730
    }
15731
 
15732
    // isset id assignments
15733
    private static final int __SUCCESS_ISSET_ID = 0;
15734
    private BitSet __isset_bit_vector = new BitSet(1);
15735
 
3430 rajveer 15736
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 15737
    static {
3430 rajveer 15738
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15739
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15740
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
15741
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15742
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
15743
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15744
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_result.class, metaDataMap);
3385 varun.gupt 15745
    }
15746
 
15747
    public getSuccessfulPaymentCountForCoupon_result() {
15748
    }
15749
 
15750
    public getSuccessfulPaymentCountForCoupon_result(
15751
      long success,
15752
      PromotionException pex)
15753
    {
15754
      this();
15755
      this.success = success;
15756
      setSuccessIsSet(true);
15757
      this.pex = pex;
15758
    }
15759
 
15760
    /**
15761
     * Performs a deep copy on <i>other</i>.
15762
     */
15763
    public getSuccessfulPaymentCountForCoupon_result(getSuccessfulPaymentCountForCoupon_result other) {
15764
      __isset_bit_vector.clear();
15765
      __isset_bit_vector.or(other.__isset_bit_vector);
15766
      this.success = other.success;
15767
      if (other.isSetPex()) {
15768
        this.pex = new PromotionException(other.pex);
15769
      }
15770
    }
15771
 
15772
    public getSuccessfulPaymentCountForCoupon_result deepCopy() {
15773
      return new getSuccessfulPaymentCountForCoupon_result(this);
15774
    }
15775
 
3430 rajveer 15776
    @Override
15777
    public void clear() {
15778
      setSuccessIsSet(false);
15779
      this.success = 0;
15780
      this.pex = null;
3385 varun.gupt 15781
    }
15782
 
15783
    public long getSuccess() {
15784
      return this.success;
15785
    }
15786
 
3430 rajveer 15787
    public void setSuccess(long success) {
3385 varun.gupt 15788
      this.success = success;
15789
      setSuccessIsSet(true);
15790
    }
15791
 
15792
    public void unsetSuccess() {
15793
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
15794
    }
15795
 
3430 rajveer 15796
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 15797
    public boolean isSetSuccess() {
15798
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
15799
    }
15800
 
15801
    public void setSuccessIsSet(boolean value) {
15802
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
15803
    }
15804
 
15805
    public PromotionException getPex() {
15806
      return this.pex;
15807
    }
15808
 
3430 rajveer 15809
    public void setPex(PromotionException pex) {
3385 varun.gupt 15810
      this.pex = pex;
15811
    }
15812
 
15813
    public void unsetPex() {
15814
      this.pex = null;
15815
    }
15816
 
3430 rajveer 15817
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 15818
    public boolean isSetPex() {
15819
      return this.pex != null;
15820
    }
15821
 
15822
    public void setPexIsSet(boolean value) {
15823
      if (!value) {
15824
        this.pex = null;
15825
      }
15826
    }
15827
 
15828
    public void setFieldValue(_Fields field, Object value) {
15829
      switch (field) {
15830
      case SUCCESS:
15831
        if (value == null) {
15832
          unsetSuccess();
15833
        } else {
15834
          setSuccess((Long)value);
15835
        }
15836
        break;
15837
 
15838
      case PEX:
15839
        if (value == null) {
15840
          unsetPex();
15841
        } else {
15842
          setPex((PromotionException)value);
15843
        }
15844
        break;
15845
 
15846
      }
15847
    }
15848
 
15849
    public Object getFieldValue(_Fields field) {
15850
      switch (field) {
15851
      case SUCCESS:
3430 rajveer 15852
        return Long.valueOf(getSuccess());
3385 varun.gupt 15853
 
15854
      case PEX:
15855
        return getPex();
15856
 
15857
      }
15858
      throw new IllegalStateException();
15859
    }
15860
 
3430 rajveer 15861
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15862
    public boolean isSet(_Fields field) {
15863
      if (field == null) {
15864
        throw new IllegalArgumentException();
15865
      }
3385 varun.gupt 15866
 
15867
      switch (field) {
15868
      case SUCCESS:
15869
        return isSetSuccess();
15870
      case PEX:
15871
        return isSetPex();
15872
      }
15873
      throw new IllegalStateException();
15874
    }
15875
 
15876
    @Override
15877
    public boolean equals(Object that) {
15878
      if (that == null)
15879
        return false;
15880
      if (that instanceof getSuccessfulPaymentCountForCoupon_result)
15881
        return this.equals((getSuccessfulPaymentCountForCoupon_result)that);
15882
      return false;
15883
    }
15884
 
15885
    public boolean equals(getSuccessfulPaymentCountForCoupon_result that) {
15886
      if (that == null)
15887
        return false;
15888
 
15889
      boolean this_present_success = true;
15890
      boolean that_present_success = true;
15891
      if (this_present_success || that_present_success) {
15892
        if (!(this_present_success && that_present_success))
15893
          return false;
15894
        if (this.success != that.success)
15895
          return false;
15896
      }
15897
 
15898
      boolean this_present_pex = true && this.isSetPex();
15899
      boolean that_present_pex = true && that.isSetPex();
15900
      if (this_present_pex || that_present_pex) {
15901
        if (!(this_present_pex && that_present_pex))
15902
          return false;
15903
        if (!this.pex.equals(that.pex))
15904
          return false;
15905
      }
15906
 
15907
      return true;
15908
    }
15909
 
15910
    @Override
15911
    public int hashCode() {
15912
      return 0;
15913
    }
15914
 
15915
    public int compareTo(getSuccessfulPaymentCountForCoupon_result other) {
15916
      if (!getClass().equals(other.getClass())) {
15917
        return getClass().getName().compareTo(other.getClass().getName());
15918
      }
15919
 
15920
      int lastComparison = 0;
15921
      getSuccessfulPaymentCountForCoupon_result typedOther = (getSuccessfulPaymentCountForCoupon_result)other;
15922
 
3430 rajveer 15923
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 15924
      if (lastComparison != 0) {
15925
        return lastComparison;
15926
      }
3430 rajveer 15927
      if (isSetSuccess()) {
15928
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
15929
        if (lastComparison != 0) {
15930
          return lastComparison;
15931
        }
3385 varun.gupt 15932
      }
3430 rajveer 15933
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 15934
      if (lastComparison != 0) {
15935
        return lastComparison;
15936
      }
3430 rajveer 15937
      if (isSetPex()) {
15938
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
15939
        if (lastComparison != 0) {
15940
          return lastComparison;
15941
        }
3385 varun.gupt 15942
      }
15943
      return 0;
15944
    }
15945
 
3430 rajveer 15946
    public _Fields fieldForId(int fieldId) {
15947
      return _Fields.findByThriftId(fieldId);
15948
    }
15949
 
15950
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15951
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 15952
      iprot.readStructBegin();
15953
      while (true)
15954
      {
15955
        field = iprot.readFieldBegin();
3430 rajveer 15956
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 15957
          break;
15958
        }
3430 rajveer 15959
        switch (field.id) {
15960
          case 0: // SUCCESS
15961
            if (field.type == org.apache.thrift.protocol.TType.I64) {
15962
              this.success = iprot.readI64();
15963
              setSuccessIsSet(true);
15964
            } else { 
15965
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15966
            }
15967
            break;
15968
          case 1: // PEX
15969
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
15970
              this.pex = new PromotionException();
15971
              this.pex.read(iprot);
15972
            } else { 
15973
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15974
            }
15975
            break;
15976
          default:
15977
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 15978
        }
3430 rajveer 15979
        iprot.readFieldEnd();
3385 varun.gupt 15980
      }
15981
      iprot.readStructEnd();
15982
      validate();
15983
    }
15984
 
3430 rajveer 15985
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 15986
      oprot.writeStructBegin(STRUCT_DESC);
15987
 
15988
      if (this.isSetSuccess()) {
15989
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
15990
        oprot.writeI64(this.success);
15991
        oprot.writeFieldEnd();
15992
      } else if (this.isSetPex()) {
15993
        oprot.writeFieldBegin(PEX_FIELD_DESC);
15994
        this.pex.write(oprot);
15995
        oprot.writeFieldEnd();
15996
      }
15997
      oprot.writeFieldStop();
15998
      oprot.writeStructEnd();
15999
    }
16000
 
16001
    @Override
16002
    public String toString() {
16003
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_result(");
16004
      boolean first = true;
16005
 
16006
      sb.append("success:");
16007
      sb.append(this.success);
16008
      first = false;
16009
      if (!first) sb.append(", ");
16010
      sb.append("pex:");
16011
      if (this.pex == null) {
16012
        sb.append("null");
16013
      } else {
16014
        sb.append(this.pex);
16015
      }
16016
      first = false;
16017
      sb.append(")");
16018
      return sb.toString();
16019
    }
16020
 
3430 rajveer 16021
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 16022
      // check for required fields
16023
    }
16024
 
3430 rajveer 16025
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16026
      try {
16027
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16028
      } catch (org.apache.thrift.TException te) {
16029
        throw new java.io.IOException(te);
16030
      }
16031
    }
16032
 
16033
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16034
      try {
16035
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16036
      } catch (org.apache.thrift.TException te) {
16037
        throw new java.io.IOException(te);
16038
      }
16039
    }
16040
 
3385 varun.gupt 16041
  }
16042
 
3430 rajveer 16043
  public static class getRuleDocString_args implements org.apache.thrift.TBase<getRuleDocString_args, getRuleDocString_args._Fields>, java.io.Serializable, Cloneable   {
16044
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_args");
3385 varun.gupt 16045
 
3430 rajveer 16046
    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 16047
 
3430 rajveer 16048
    private String ruleName; // required
3385 varun.gupt 16049
 
16050
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 16051
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 16052
      RULE_NAME((short)1, "ruleName");
16053
 
16054
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16055
 
16056
      static {
16057
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16058
          byName.put(field.getFieldName(), field);
16059
        }
16060
      }
16061
 
16062
      /**
16063
       * Find the _Fields constant that matches fieldId, or null if its not found.
16064
       */
16065
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 16066
        switch(fieldId) {
16067
          case 1: // RULE_NAME
16068
            return RULE_NAME;
16069
          default:
16070
            return null;
16071
        }
3385 varun.gupt 16072
      }
16073
 
16074
      /**
16075
       * Find the _Fields constant that matches fieldId, throwing an exception
16076
       * if it is not found.
16077
       */
16078
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16079
        _Fields fields = findByThriftId(fieldId);
16080
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16081
        return fields;
16082
      }
16083
 
16084
      /**
16085
       * Find the _Fields constant that matches name, or null if its not found.
16086
       */
16087
      public static _Fields findByName(String name) {
16088
        return byName.get(name);
16089
      }
16090
 
16091
      private final short _thriftId;
16092
      private final String _fieldName;
16093
 
16094
      _Fields(short thriftId, String fieldName) {
16095
        _thriftId = thriftId;
16096
        _fieldName = fieldName;
16097
      }
16098
 
16099
      public short getThriftFieldId() {
16100
        return _thriftId;
16101
      }
16102
 
16103
      public String getFieldName() {
16104
        return _fieldName;
16105
      }
16106
    }
16107
 
16108
    // isset id assignments
16109
 
3430 rajveer 16110
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 16111
    static {
3430 rajveer 16112
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16113
      tmpMap.put(_Fields.RULE_NAME, new org.apache.thrift.meta_data.FieldMetaData("ruleName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16114
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
16115
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16116
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_args.class, metaDataMap);
3385 varun.gupt 16117
    }
16118
 
16119
    public getRuleDocString_args() {
16120
    }
16121
 
16122
    public getRuleDocString_args(
16123
      String ruleName)
16124
    {
16125
      this();
16126
      this.ruleName = ruleName;
16127
    }
16128
 
16129
    /**
16130
     * Performs a deep copy on <i>other</i>.
16131
     */
16132
    public getRuleDocString_args(getRuleDocString_args other) {
16133
      if (other.isSetRuleName()) {
16134
        this.ruleName = other.ruleName;
16135
      }
16136
    }
16137
 
16138
    public getRuleDocString_args deepCopy() {
16139
      return new getRuleDocString_args(this);
16140
    }
16141
 
3430 rajveer 16142
    @Override
16143
    public void clear() {
16144
      this.ruleName = null;
3385 varun.gupt 16145
    }
16146
 
16147
    public String getRuleName() {
16148
      return this.ruleName;
16149
    }
16150
 
3430 rajveer 16151
    public void setRuleName(String ruleName) {
3385 varun.gupt 16152
      this.ruleName = ruleName;
16153
    }
16154
 
16155
    public void unsetRuleName() {
16156
      this.ruleName = null;
16157
    }
16158
 
3430 rajveer 16159
    /** Returns true if field ruleName is set (has been assigned a value) and false otherwise */
3385 varun.gupt 16160
    public boolean isSetRuleName() {
16161
      return this.ruleName != null;
16162
    }
16163
 
16164
    public void setRuleNameIsSet(boolean value) {
16165
      if (!value) {
16166
        this.ruleName = null;
16167
      }
16168
    }
16169
 
16170
    public void setFieldValue(_Fields field, Object value) {
16171
      switch (field) {
16172
      case RULE_NAME:
16173
        if (value == null) {
16174
          unsetRuleName();
16175
        } else {
16176
          setRuleName((String)value);
16177
        }
16178
        break;
16179
 
16180
      }
16181
    }
16182
 
16183
    public Object getFieldValue(_Fields field) {
16184
      switch (field) {
16185
      case RULE_NAME:
16186
        return getRuleName();
16187
 
16188
      }
16189
      throw new IllegalStateException();
16190
    }
16191
 
3430 rajveer 16192
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16193
    public boolean isSet(_Fields field) {
16194
      if (field == null) {
16195
        throw new IllegalArgumentException();
16196
      }
3385 varun.gupt 16197
 
16198
      switch (field) {
16199
      case RULE_NAME:
16200
        return isSetRuleName();
16201
      }
16202
      throw new IllegalStateException();
16203
    }
16204
 
16205
    @Override
16206
    public boolean equals(Object that) {
16207
      if (that == null)
16208
        return false;
16209
      if (that instanceof getRuleDocString_args)
16210
        return this.equals((getRuleDocString_args)that);
16211
      return false;
16212
    }
16213
 
16214
    public boolean equals(getRuleDocString_args that) {
16215
      if (that == null)
16216
        return false;
16217
 
16218
      boolean this_present_ruleName = true && this.isSetRuleName();
16219
      boolean that_present_ruleName = true && that.isSetRuleName();
16220
      if (this_present_ruleName || that_present_ruleName) {
16221
        if (!(this_present_ruleName && that_present_ruleName))
16222
          return false;
16223
        if (!this.ruleName.equals(that.ruleName))
16224
          return false;
16225
      }
16226
 
16227
      return true;
16228
    }
16229
 
16230
    @Override
16231
    public int hashCode() {
16232
      return 0;
16233
    }
16234
 
16235
    public int compareTo(getRuleDocString_args other) {
16236
      if (!getClass().equals(other.getClass())) {
16237
        return getClass().getName().compareTo(other.getClass().getName());
16238
      }
16239
 
16240
      int lastComparison = 0;
16241
      getRuleDocString_args typedOther = (getRuleDocString_args)other;
16242
 
3430 rajveer 16243
      lastComparison = Boolean.valueOf(isSetRuleName()).compareTo(typedOther.isSetRuleName());
3385 varun.gupt 16244
      if (lastComparison != 0) {
16245
        return lastComparison;
16246
      }
3430 rajveer 16247
      if (isSetRuleName()) {
16248
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleName, typedOther.ruleName);
16249
        if (lastComparison != 0) {
16250
          return lastComparison;
16251
        }
3385 varun.gupt 16252
      }
16253
      return 0;
16254
    }
16255
 
3430 rajveer 16256
    public _Fields fieldForId(int fieldId) {
16257
      return _Fields.findByThriftId(fieldId);
16258
    }
16259
 
16260
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16261
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 16262
      iprot.readStructBegin();
16263
      while (true)
16264
      {
16265
        field = iprot.readFieldBegin();
3430 rajveer 16266
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 16267
          break;
16268
        }
3430 rajveer 16269
        switch (field.id) {
16270
          case 1: // RULE_NAME
16271
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
16272
              this.ruleName = iprot.readString();
16273
            } else { 
16274
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16275
            }
16276
            break;
16277
          default:
16278
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 16279
        }
3430 rajveer 16280
        iprot.readFieldEnd();
3385 varun.gupt 16281
      }
16282
      iprot.readStructEnd();
16283
      validate();
16284
    }
16285
 
3430 rajveer 16286
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 16287
      validate();
16288
 
16289
      oprot.writeStructBegin(STRUCT_DESC);
16290
      if (this.ruleName != null) {
16291
        oprot.writeFieldBegin(RULE_NAME_FIELD_DESC);
16292
        oprot.writeString(this.ruleName);
16293
        oprot.writeFieldEnd();
16294
      }
16295
      oprot.writeFieldStop();
16296
      oprot.writeStructEnd();
16297
    }
16298
 
16299
    @Override
16300
    public String toString() {
16301
      StringBuilder sb = new StringBuilder("getRuleDocString_args(");
16302
      boolean first = true;
16303
 
16304
      sb.append("ruleName:");
16305
      if (this.ruleName == null) {
16306
        sb.append("null");
16307
      } else {
16308
        sb.append(this.ruleName);
16309
      }
16310
      first = false;
16311
      sb.append(")");
16312
      return sb.toString();
16313
    }
16314
 
3430 rajveer 16315
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 16316
      // check for required fields
16317
    }
16318
 
3430 rajveer 16319
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16320
      try {
16321
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16322
      } catch (org.apache.thrift.TException te) {
16323
        throw new java.io.IOException(te);
16324
      }
16325
    }
16326
 
16327
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16328
      try {
16329
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16330
      } catch (org.apache.thrift.TException te) {
16331
        throw new java.io.IOException(te);
16332
      }
16333
    }
16334
 
3385 varun.gupt 16335
  }
16336
 
3430 rajveer 16337
  public static class getRuleDocString_result implements org.apache.thrift.TBase<getRuleDocString_result, getRuleDocString_result._Fields>, java.io.Serializable, Cloneable   {
16338
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_result");
3385 varun.gupt 16339
 
3430 rajveer 16340
    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 16341
 
3430 rajveer 16342
    private String success; // required
3385 varun.gupt 16343
 
16344
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 16345
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 16346
      SUCCESS((short)0, "success");
16347
 
16348
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16349
 
16350
      static {
16351
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16352
          byName.put(field.getFieldName(), field);
16353
        }
16354
      }
16355
 
16356
      /**
16357
       * Find the _Fields constant that matches fieldId, or null if its not found.
16358
       */
16359
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 16360
        switch(fieldId) {
16361
          case 0: // SUCCESS
16362
            return SUCCESS;
16363
          default:
16364
            return null;
16365
        }
3385 varun.gupt 16366
      }
16367
 
16368
      /**
16369
       * Find the _Fields constant that matches fieldId, throwing an exception
16370
       * if it is not found.
16371
       */
16372
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16373
        _Fields fields = findByThriftId(fieldId);
16374
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16375
        return fields;
16376
      }
16377
 
16378
      /**
16379
       * Find the _Fields constant that matches name, or null if its not found.
16380
       */
16381
      public static _Fields findByName(String name) {
16382
        return byName.get(name);
16383
      }
16384
 
16385
      private final short _thriftId;
16386
      private final String _fieldName;
16387
 
16388
      _Fields(short thriftId, String fieldName) {
16389
        _thriftId = thriftId;
16390
        _fieldName = fieldName;
16391
      }
16392
 
16393
      public short getThriftFieldId() {
16394
        return _thriftId;
16395
      }
16396
 
16397
      public String getFieldName() {
16398
        return _fieldName;
16399
      }
16400
    }
16401
 
16402
    // isset id assignments
16403
 
3430 rajveer 16404
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 16405
    static {
3430 rajveer 16406
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16407
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16408
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
16409
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16410
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_result.class, metaDataMap);
3385 varun.gupt 16411
    }
16412
 
16413
    public getRuleDocString_result() {
16414
    }
16415
 
16416
    public getRuleDocString_result(
16417
      String success)
16418
    {
16419
      this();
16420
      this.success = success;
16421
    }
16422
 
16423
    /**
16424
     * Performs a deep copy on <i>other</i>.
16425
     */
16426
    public getRuleDocString_result(getRuleDocString_result other) {
16427
      if (other.isSetSuccess()) {
16428
        this.success = other.success;
16429
      }
16430
    }
16431
 
16432
    public getRuleDocString_result deepCopy() {
16433
      return new getRuleDocString_result(this);
16434
    }
16435
 
3430 rajveer 16436
    @Override
16437
    public void clear() {
16438
      this.success = null;
3385 varun.gupt 16439
    }
16440
 
16441
    public String getSuccess() {
16442
      return this.success;
16443
    }
16444
 
3430 rajveer 16445
    public void setSuccess(String success) {
3385 varun.gupt 16446
      this.success = success;
16447
    }
16448
 
16449
    public void unsetSuccess() {
16450
      this.success = null;
16451
    }
16452
 
3430 rajveer 16453
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 16454
    public boolean isSetSuccess() {
16455
      return this.success != null;
16456
    }
16457
 
16458
    public void setSuccessIsSet(boolean value) {
16459
      if (!value) {
16460
        this.success = null;
16461
      }
16462
    }
16463
 
16464
    public void setFieldValue(_Fields field, Object value) {
16465
      switch (field) {
16466
      case SUCCESS:
16467
        if (value == null) {
16468
          unsetSuccess();
16469
        } else {
16470
          setSuccess((String)value);
16471
        }
16472
        break;
16473
 
16474
      }
16475
    }
16476
 
16477
    public Object getFieldValue(_Fields field) {
16478
      switch (field) {
16479
      case SUCCESS:
16480
        return getSuccess();
16481
 
16482
      }
16483
      throw new IllegalStateException();
16484
    }
16485
 
3430 rajveer 16486
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16487
    public boolean isSet(_Fields field) {
16488
      if (field == null) {
16489
        throw new IllegalArgumentException();
16490
      }
3385 varun.gupt 16491
 
16492
      switch (field) {
16493
      case SUCCESS:
16494
        return isSetSuccess();
16495
      }
16496
      throw new IllegalStateException();
16497
    }
16498
 
16499
    @Override
16500
    public boolean equals(Object that) {
16501
      if (that == null)
16502
        return false;
16503
      if (that instanceof getRuleDocString_result)
16504
        return this.equals((getRuleDocString_result)that);
16505
      return false;
16506
    }
16507
 
16508
    public boolean equals(getRuleDocString_result that) {
16509
      if (that == null)
16510
        return false;
16511
 
16512
      boolean this_present_success = true && this.isSetSuccess();
16513
      boolean that_present_success = true && that.isSetSuccess();
16514
      if (this_present_success || that_present_success) {
16515
        if (!(this_present_success && that_present_success))
16516
          return false;
16517
        if (!this.success.equals(that.success))
16518
          return false;
16519
      }
16520
 
16521
      return true;
16522
    }
16523
 
16524
    @Override
16525
    public int hashCode() {
16526
      return 0;
16527
    }
16528
 
16529
    public int compareTo(getRuleDocString_result other) {
16530
      if (!getClass().equals(other.getClass())) {
16531
        return getClass().getName().compareTo(other.getClass().getName());
16532
      }
16533
 
16534
      int lastComparison = 0;
16535
      getRuleDocString_result typedOther = (getRuleDocString_result)other;
16536
 
3430 rajveer 16537
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 16538
      if (lastComparison != 0) {
16539
        return lastComparison;
16540
      }
3430 rajveer 16541
      if (isSetSuccess()) {
16542
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
16543
        if (lastComparison != 0) {
16544
          return lastComparison;
16545
        }
3385 varun.gupt 16546
      }
16547
      return 0;
16548
    }
16549
 
3430 rajveer 16550
    public _Fields fieldForId(int fieldId) {
16551
      return _Fields.findByThriftId(fieldId);
16552
    }
16553
 
16554
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16555
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 16556
      iprot.readStructBegin();
16557
      while (true)
16558
      {
16559
        field = iprot.readFieldBegin();
3430 rajveer 16560
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 16561
          break;
16562
        }
3430 rajveer 16563
        switch (field.id) {
16564
          case 0: // SUCCESS
16565
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
16566
              this.success = iprot.readString();
16567
            } else { 
16568
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16569
            }
16570
            break;
16571
          default:
16572
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 16573
        }
3430 rajveer 16574
        iprot.readFieldEnd();
3385 varun.gupt 16575
      }
16576
      iprot.readStructEnd();
16577
      validate();
16578
    }
16579
 
3430 rajveer 16580
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 16581
      oprot.writeStructBegin(STRUCT_DESC);
16582
 
16583
      if (this.isSetSuccess()) {
16584
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
16585
        oprot.writeString(this.success);
16586
        oprot.writeFieldEnd();
16587
      }
16588
      oprot.writeFieldStop();
16589
      oprot.writeStructEnd();
16590
    }
16591
 
16592
    @Override
16593
    public String toString() {
16594
      StringBuilder sb = new StringBuilder("getRuleDocString_result(");
16595
      boolean first = true;
16596
 
16597
      sb.append("success:");
16598
      if (this.success == null) {
16599
        sb.append("null");
16600
      } else {
16601
        sb.append(this.success);
16602
      }
16603
      first = false;
16604
      sb.append(")");
16605
      return sb.toString();
16606
    }
16607
 
3430 rajveer 16608
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 16609
      // check for required fields
16610
    }
16611
 
3430 rajveer 16612
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16613
      try {
16614
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16615
      } catch (org.apache.thrift.TException te) {
16616
        throw new java.io.IOException(te);
16617
      }
16618
    }
16619
 
16620
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16621
      try {
16622
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16623
      } catch (org.apache.thrift.TException te) {
16624
        throw new java.io.IOException(te);
16625
      }
16626
    }
16627
 
3385 varun.gupt 16628
  }
16629
 
4189 varun.gupt 16630
  public static class getItemDiscountMap_args implements org.apache.thrift.TBase<getItemDiscountMap_args, getItemDiscountMap_args._Fields>, java.io.Serializable, Cloneable   {
16631
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_args");
16632
 
16633
    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);
16634
 
16635
    private List<Long> itemIds; // required
16636
 
16637
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
16638
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
16639
      ITEM_IDS((short)1, "itemIds");
16640
 
16641
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16642
 
16643
      static {
16644
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16645
          byName.put(field.getFieldName(), field);
16646
        }
16647
      }
16648
 
16649
      /**
16650
       * Find the _Fields constant that matches fieldId, or null if its not found.
16651
       */
16652
      public static _Fields findByThriftId(int fieldId) {
16653
        switch(fieldId) {
16654
          case 1: // ITEM_IDS
16655
            return ITEM_IDS;
16656
          default:
16657
            return null;
16658
        }
16659
      }
16660
 
16661
      /**
16662
       * Find the _Fields constant that matches fieldId, throwing an exception
16663
       * if it is not found.
16664
       */
16665
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16666
        _Fields fields = findByThriftId(fieldId);
16667
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16668
        return fields;
16669
      }
16670
 
16671
      /**
16672
       * Find the _Fields constant that matches name, or null if its not found.
16673
       */
16674
      public static _Fields findByName(String name) {
16675
        return byName.get(name);
16676
      }
16677
 
16678
      private final short _thriftId;
16679
      private final String _fieldName;
16680
 
16681
      _Fields(short thriftId, String fieldName) {
16682
        _thriftId = thriftId;
16683
        _fieldName = fieldName;
16684
      }
16685
 
16686
      public short getThriftFieldId() {
16687
        return _thriftId;
16688
      }
16689
 
16690
      public String getFieldName() {
16691
        return _fieldName;
16692
      }
16693
    }
16694
 
16695
    // isset id assignments
16696
 
16697
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
16698
    static {
16699
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16700
      tmpMap.put(_Fields.ITEM_IDS, new org.apache.thrift.meta_data.FieldMetaData("itemIds", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16701
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
16702
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
16703
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16704
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_args.class, metaDataMap);
16705
    }
16706
 
16707
    public getItemDiscountMap_args() {
16708
    }
16709
 
16710
    public getItemDiscountMap_args(
16711
      List<Long> itemIds)
16712
    {
16713
      this();
16714
      this.itemIds = itemIds;
16715
    }
16716
 
16717
    /**
16718
     * Performs a deep copy on <i>other</i>.
16719
     */
16720
    public getItemDiscountMap_args(getItemDiscountMap_args other) {
16721
      if (other.isSetItemIds()) {
16722
        List<Long> __this__itemIds = new ArrayList<Long>();
16723
        for (Long other_element : other.itemIds) {
16724
          __this__itemIds.add(other_element);
16725
        }
16726
        this.itemIds = __this__itemIds;
16727
      }
16728
    }
16729
 
16730
    public getItemDiscountMap_args deepCopy() {
16731
      return new getItemDiscountMap_args(this);
16732
    }
16733
 
16734
    @Override
16735
    public void clear() {
16736
      this.itemIds = null;
16737
    }
16738
 
16739
    public int getItemIdsSize() {
16740
      return (this.itemIds == null) ? 0 : this.itemIds.size();
16741
    }
16742
 
16743
    public java.util.Iterator<Long> getItemIdsIterator() {
16744
      return (this.itemIds == null) ? null : this.itemIds.iterator();
16745
    }
16746
 
16747
    public void addToItemIds(long elem) {
16748
      if (this.itemIds == null) {
16749
        this.itemIds = new ArrayList<Long>();
16750
      }
16751
      this.itemIds.add(elem);
16752
    }
16753
 
16754
    public List<Long> getItemIds() {
16755
      return this.itemIds;
16756
    }
16757
 
16758
    public void setItemIds(List<Long> itemIds) {
16759
      this.itemIds = itemIds;
16760
    }
16761
 
16762
    public void unsetItemIds() {
16763
      this.itemIds = null;
16764
    }
16765
 
16766
    /** Returns true if field itemIds is set (has been assigned a value) and false otherwise */
16767
    public boolean isSetItemIds() {
16768
      return this.itemIds != null;
16769
    }
16770
 
16771
    public void setItemIdsIsSet(boolean value) {
16772
      if (!value) {
16773
        this.itemIds = null;
16774
      }
16775
    }
16776
 
16777
    public void setFieldValue(_Fields field, Object value) {
16778
      switch (field) {
16779
      case ITEM_IDS:
16780
        if (value == null) {
16781
          unsetItemIds();
16782
        } else {
16783
          setItemIds((List<Long>)value);
16784
        }
16785
        break;
16786
 
16787
      }
16788
    }
16789
 
16790
    public Object getFieldValue(_Fields field) {
16791
      switch (field) {
16792
      case ITEM_IDS:
16793
        return getItemIds();
16794
 
16795
      }
16796
      throw new IllegalStateException();
16797
    }
16798
 
16799
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16800
    public boolean isSet(_Fields field) {
16801
      if (field == null) {
16802
        throw new IllegalArgumentException();
16803
      }
16804
 
16805
      switch (field) {
16806
      case ITEM_IDS:
16807
        return isSetItemIds();
16808
      }
16809
      throw new IllegalStateException();
16810
    }
16811
 
16812
    @Override
16813
    public boolean equals(Object that) {
16814
      if (that == null)
16815
        return false;
16816
      if (that instanceof getItemDiscountMap_args)
16817
        return this.equals((getItemDiscountMap_args)that);
16818
      return false;
16819
    }
16820
 
16821
    public boolean equals(getItemDiscountMap_args that) {
16822
      if (that == null)
16823
        return false;
16824
 
16825
      boolean this_present_itemIds = true && this.isSetItemIds();
16826
      boolean that_present_itemIds = true && that.isSetItemIds();
16827
      if (this_present_itemIds || that_present_itemIds) {
16828
        if (!(this_present_itemIds && that_present_itemIds))
16829
          return false;
16830
        if (!this.itemIds.equals(that.itemIds))
16831
          return false;
16832
      }
16833
 
16834
      return true;
16835
    }
16836
 
16837
    @Override
16838
    public int hashCode() {
16839
      return 0;
16840
    }
16841
 
16842
    public int compareTo(getItemDiscountMap_args other) {
16843
      if (!getClass().equals(other.getClass())) {
16844
        return getClass().getName().compareTo(other.getClass().getName());
16845
      }
16846
 
16847
      int lastComparison = 0;
16848
      getItemDiscountMap_args typedOther = (getItemDiscountMap_args)other;
16849
 
16850
      lastComparison = Boolean.valueOf(isSetItemIds()).compareTo(typedOther.isSetItemIds());
16851
      if (lastComparison != 0) {
16852
        return lastComparison;
16853
      }
16854
      if (isSetItemIds()) {
16855
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemIds, typedOther.itemIds);
16856
        if (lastComparison != 0) {
16857
          return lastComparison;
16858
        }
16859
      }
16860
      return 0;
16861
    }
16862
 
16863
    public _Fields fieldForId(int fieldId) {
16864
      return _Fields.findByThriftId(fieldId);
16865
    }
16866
 
16867
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16868
      org.apache.thrift.protocol.TField field;
16869
      iprot.readStructBegin();
16870
      while (true)
16871
      {
16872
        field = iprot.readFieldBegin();
16873
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
16874
          break;
16875
        }
16876
        switch (field.id) {
16877
          case 1: // ITEM_IDS
16878
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
16879
              {
7092 amit.gupta 16880
                org.apache.thrift.protocol.TList _list38 = iprot.readListBegin();
16881
                this.itemIds = new ArrayList<Long>(_list38.size);
16882
                for (int _i39 = 0; _i39 < _list38.size; ++_i39)
4189 varun.gupt 16883
                {
7092 amit.gupta 16884
                  long _elem40; // required
16885
                  _elem40 = iprot.readI64();
16886
                  this.itemIds.add(_elem40);
4189 varun.gupt 16887
                }
16888
                iprot.readListEnd();
16889
              }
16890
            } else { 
16891
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16892
            }
16893
            break;
16894
          default:
16895
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16896
        }
16897
        iprot.readFieldEnd();
16898
      }
16899
      iprot.readStructEnd();
16900
      validate();
16901
    }
16902
 
16903
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
16904
      validate();
16905
 
16906
      oprot.writeStructBegin(STRUCT_DESC);
16907
      if (this.itemIds != null) {
16908
        oprot.writeFieldBegin(ITEM_IDS_FIELD_DESC);
16909
        {
16910
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.itemIds.size()));
7092 amit.gupta 16911
          for (long _iter41 : this.itemIds)
4189 varun.gupt 16912
          {
7092 amit.gupta 16913
            oprot.writeI64(_iter41);
4189 varun.gupt 16914
          }
16915
          oprot.writeListEnd();
16916
        }
16917
        oprot.writeFieldEnd();
16918
      }
16919
      oprot.writeFieldStop();
16920
      oprot.writeStructEnd();
16921
    }
16922
 
16923
    @Override
16924
    public String toString() {
16925
      StringBuilder sb = new StringBuilder("getItemDiscountMap_args(");
16926
      boolean first = true;
16927
 
16928
      sb.append("itemIds:");
16929
      if (this.itemIds == null) {
16930
        sb.append("null");
16931
      } else {
16932
        sb.append(this.itemIds);
16933
      }
16934
      first = false;
16935
      sb.append(")");
16936
      return sb.toString();
16937
    }
16938
 
16939
    public void validate() throws org.apache.thrift.TException {
16940
      // check for required fields
16941
    }
16942
 
16943
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16944
      try {
16945
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16946
      } catch (org.apache.thrift.TException te) {
16947
        throw new java.io.IOException(te);
16948
      }
16949
    }
16950
 
16951
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16952
      try {
16953
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16954
      } catch (org.apache.thrift.TException te) {
16955
        throw new java.io.IOException(te);
16956
      }
16957
    }
16958
 
16959
  }
16960
 
16961
  public static class getItemDiscountMap_result implements org.apache.thrift.TBase<getItemDiscountMap_result, getItemDiscountMap_result._Fields>, java.io.Serializable, Cloneable   {
16962
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_result");
16963
 
16964
    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);
16965
    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);
16966
 
16967
    private List<ItemCouponDiscount> success; // required
16968
    private PromotionException pex; // required
16969
 
16970
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
16971
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
16972
      SUCCESS((short)0, "success"),
16973
      PEX((short)1, "pex");
16974
 
16975
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16976
 
16977
      static {
16978
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16979
          byName.put(field.getFieldName(), field);
16980
        }
16981
      }
16982
 
16983
      /**
16984
       * Find the _Fields constant that matches fieldId, or null if its not found.
16985
       */
16986
      public static _Fields findByThriftId(int fieldId) {
16987
        switch(fieldId) {
16988
          case 0: // SUCCESS
16989
            return SUCCESS;
16990
          case 1: // PEX
16991
            return PEX;
16992
          default:
16993
            return null;
16994
        }
16995
      }
16996
 
16997
      /**
16998
       * Find the _Fields constant that matches fieldId, throwing an exception
16999
       * if it is not found.
17000
       */
17001
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17002
        _Fields fields = findByThriftId(fieldId);
17003
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17004
        return fields;
17005
      }
17006
 
17007
      /**
17008
       * Find the _Fields constant that matches name, or null if its not found.
17009
       */
17010
      public static _Fields findByName(String name) {
17011
        return byName.get(name);
17012
      }
17013
 
17014
      private final short _thriftId;
17015
      private final String _fieldName;
17016
 
17017
      _Fields(short thriftId, String fieldName) {
17018
        _thriftId = thriftId;
17019
        _fieldName = fieldName;
17020
      }
17021
 
17022
      public short getThriftFieldId() {
17023
        return _thriftId;
17024
      }
17025
 
17026
      public String getFieldName() {
17027
        return _fieldName;
17028
      }
17029
    }
17030
 
17031
    // isset id assignments
17032
 
17033
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
17034
    static {
17035
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
17036
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17037
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
17038
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ItemCouponDiscount.class))));
17039
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17040
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
17041
      metaDataMap = Collections.unmodifiableMap(tmpMap);
17042
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_result.class, metaDataMap);
17043
    }
17044
 
17045
    public getItemDiscountMap_result() {
17046
    }
17047
 
17048
    public getItemDiscountMap_result(
17049
      List<ItemCouponDiscount> success,
17050
      PromotionException pex)
17051
    {
17052
      this();
17053
      this.success = success;
17054
      this.pex = pex;
17055
    }
17056
 
17057
    /**
17058
     * Performs a deep copy on <i>other</i>.
17059
     */
17060
    public getItemDiscountMap_result(getItemDiscountMap_result other) {
17061
      if (other.isSetSuccess()) {
17062
        List<ItemCouponDiscount> __this__success = new ArrayList<ItemCouponDiscount>();
17063
        for (ItemCouponDiscount other_element : other.success) {
17064
          __this__success.add(new ItemCouponDiscount(other_element));
17065
        }
17066
        this.success = __this__success;
17067
      }
17068
      if (other.isSetPex()) {
17069
        this.pex = new PromotionException(other.pex);
17070
      }
17071
    }
17072
 
17073
    public getItemDiscountMap_result deepCopy() {
17074
      return new getItemDiscountMap_result(this);
17075
    }
17076
 
17077
    @Override
17078
    public void clear() {
17079
      this.success = null;
17080
      this.pex = null;
17081
    }
17082
 
17083
    public int getSuccessSize() {
17084
      return (this.success == null) ? 0 : this.success.size();
17085
    }
17086
 
17087
    public java.util.Iterator<ItemCouponDiscount> getSuccessIterator() {
17088
      return (this.success == null) ? null : this.success.iterator();
17089
    }
17090
 
17091
    public void addToSuccess(ItemCouponDiscount elem) {
17092
      if (this.success == null) {
17093
        this.success = new ArrayList<ItemCouponDiscount>();
17094
      }
17095
      this.success.add(elem);
17096
    }
17097
 
17098
    public List<ItemCouponDiscount> getSuccess() {
17099
      return this.success;
17100
    }
17101
 
17102
    public void setSuccess(List<ItemCouponDiscount> success) {
17103
      this.success = success;
17104
    }
17105
 
17106
    public void unsetSuccess() {
17107
      this.success = null;
17108
    }
17109
 
17110
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
17111
    public boolean isSetSuccess() {
17112
      return this.success != null;
17113
    }
17114
 
17115
    public void setSuccessIsSet(boolean value) {
17116
      if (!value) {
17117
        this.success = null;
17118
      }
17119
    }
17120
 
17121
    public PromotionException getPex() {
17122
      return this.pex;
17123
    }
17124
 
17125
    public void setPex(PromotionException pex) {
17126
      this.pex = pex;
17127
    }
17128
 
17129
    public void unsetPex() {
17130
      this.pex = null;
17131
    }
17132
 
17133
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
17134
    public boolean isSetPex() {
17135
      return this.pex != null;
17136
    }
17137
 
17138
    public void setPexIsSet(boolean value) {
17139
      if (!value) {
17140
        this.pex = null;
17141
      }
17142
    }
17143
 
17144
    public void setFieldValue(_Fields field, Object value) {
17145
      switch (field) {
17146
      case SUCCESS:
17147
        if (value == null) {
17148
          unsetSuccess();
17149
        } else {
17150
          setSuccess((List<ItemCouponDiscount>)value);
17151
        }
17152
        break;
17153
 
17154
      case PEX:
17155
        if (value == null) {
17156
          unsetPex();
17157
        } else {
17158
          setPex((PromotionException)value);
17159
        }
17160
        break;
17161
 
17162
      }
17163
    }
17164
 
17165
    public Object getFieldValue(_Fields field) {
17166
      switch (field) {
17167
      case SUCCESS:
17168
        return getSuccess();
17169
 
17170
      case PEX:
17171
        return getPex();
17172
 
17173
      }
17174
      throw new IllegalStateException();
17175
    }
17176
 
17177
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
17178
    public boolean isSet(_Fields field) {
17179
      if (field == null) {
17180
        throw new IllegalArgumentException();
17181
      }
17182
 
17183
      switch (field) {
17184
      case SUCCESS:
17185
        return isSetSuccess();
17186
      case PEX:
17187
        return isSetPex();
17188
      }
17189
      throw new IllegalStateException();
17190
    }
17191
 
17192
    @Override
17193
    public boolean equals(Object that) {
17194
      if (that == null)
17195
        return false;
17196
      if (that instanceof getItemDiscountMap_result)
17197
        return this.equals((getItemDiscountMap_result)that);
17198
      return false;
17199
    }
17200
 
17201
    public boolean equals(getItemDiscountMap_result that) {
17202
      if (that == null)
17203
        return false;
17204
 
17205
      boolean this_present_success = true && this.isSetSuccess();
17206
      boolean that_present_success = true && that.isSetSuccess();
17207
      if (this_present_success || that_present_success) {
17208
        if (!(this_present_success && that_present_success))
17209
          return false;
17210
        if (!this.success.equals(that.success))
17211
          return false;
17212
      }
17213
 
17214
      boolean this_present_pex = true && this.isSetPex();
17215
      boolean that_present_pex = true && that.isSetPex();
17216
      if (this_present_pex || that_present_pex) {
17217
        if (!(this_present_pex && that_present_pex))
17218
          return false;
17219
        if (!this.pex.equals(that.pex))
17220
          return false;
17221
      }
17222
 
17223
      return true;
17224
    }
17225
 
17226
    @Override
17227
    public int hashCode() {
17228
      return 0;
17229
    }
17230
 
17231
    public int compareTo(getItemDiscountMap_result other) {
17232
      if (!getClass().equals(other.getClass())) {
17233
        return getClass().getName().compareTo(other.getClass().getName());
17234
      }
17235
 
17236
      int lastComparison = 0;
17237
      getItemDiscountMap_result typedOther = (getItemDiscountMap_result)other;
17238
 
17239
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
17240
      if (lastComparison != 0) {
17241
        return lastComparison;
17242
      }
17243
      if (isSetSuccess()) {
17244
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
17245
        if (lastComparison != 0) {
17246
          return lastComparison;
17247
        }
17248
      }
17249
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
17250
      if (lastComparison != 0) {
17251
        return lastComparison;
17252
      }
17253
      if (isSetPex()) {
17254
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
17255
        if (lastComparison != 0) {
17256
          return lastComparison;
17257
        }
17258
      }
17259
      return 0;
17260
    }
17261
 
17262
    public _Fields fieldForId(int fieldId) {
17263
      return _Fields.findByThriftId(fieldId);
17264
    }
17265
 
17266
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17267
      org.apache.thrift.protocol.TField field;
17268
      iprot.readStructBegin();
17269
      while (true)
17270
      {
17271
        field = iprot.readFieldBegin();
17272
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17273
          break;
17274
        }
17275
        switch (field.id) {
17276
          case 0: // SUCCESS
17277
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
17278
              {
7092 amit.gupta 17279
                org.apache.thrift.protocol.TList _list42 = iprot.readListBegin();
17280
                this.success = new ArrayList<ItemCouponDiscount>(_list42.size);
17281
                for (int _i43 = 0; _i43 < _list42.size; ++_i43)
4189 varun.gupt 17282
                {
7092 amit.gupta 17283
                  ItemCouponDiscount _elem44; // required
17284
                  _elem44 = new ItemCouponDiscount();
17285
                  _elem44.read(iprot);
17286
                  this.success.add(_elem44);
4189 varun.gupt 17287
                }
17288
                iprot.readListEnd();
17289
              }
17290
            } else { 
17291
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17292
            }
17293
            break;
17294
          case 1: // PEX
17295
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
17296
              this.pex = new PromotionException();
17297
              this.pex.read(iprot);
17298
            } else { 
17299
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17300
            }
17301
            break;
17302
          default:
17303
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17304
        }
17305
        iprot.readFieldEnd();
17306
      }
17307
      iprot.readStructEnd();
17308
      validate();
17309
    }
17310
 
17311
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17312
      oprot.writeStructBegin(STRUCT_DESC);
17313
 
17314
      if (this.isSetSuccess()) {
17315
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
17316
        {
17317
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
7092 amit.gupta 17318
          for (ItemCouponDiscount _iter45 : this.success)
4189 varun.gupt 17319
          {
7092 amit.gupta 17320
            _iter45.write(oprot);
4189 varun.gupt 17321
          }
17322
          oprot.writeListEnd();
17323
        }
17324
        oprot.writeFieldEnd();
17325
      } else if (this.isSetPex()) {
17326
        oprot.writeFieldBegin(PEX_FIELD_DESC);
17327
        this.pex.write(oprot);
17328
        oprot.writeFieldEnd();
17329
      }
17330
      oprot.writeFieldStop();
17331
      oprot.writeStructEnd();
17332
    }
17333
 
17334
    @Override
17335
    public String toString() {
17336
      StringBuilder sb = new StringBuilder("getItemDiscountMap_result(");
17337
      boolean first = true;
17338
 
17339
      sb.append("success:");
17340
      if (this.success == null) {
17341
        sb.append("null");
17342
      } else {
17343
        sb.append(this.success);
17344
      }
17345
      first = false;
17346
      if (!first) sb.append(", ");
17347
      sb.append("pex:");
17348
      if (this.pex == null) {
17349
        sb.append("null");
17350
      } else {
17351
        sb.append(this.pex);
17352
      }
17353
      first = false;
17354
      sb.append(")");
17355
      return sb.toString();
17356
    }
17357
 
17358
    public void validate() throws org.apache.thrift.TException {
17359
      // check for required fields
17360
    }
17361
 
17362
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17363
      try {
17364
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17365
      } catch (org.apache.thrift.TException te) {
17366
        throw new java.io.IOException(te);
17367
      }
17368
    }
17369
 
17370
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
17371
      try {
17372
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
17373
      } catch (org.apache.thrift.TException te) {
17374
        throw new java.io.IOException(te);
17375
      }
17376
    }
17377
 
17378
  }
17379
 
4494 varun.gupt 17380
  public static class getDiscountsForEntity_args implements org.apache.thrift.TBase<getDiscountsForEntity_args, getDiscountsForEntity_args._Fields>, java.io.Serializable, Cloneable   {
17381
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_args");
17382
 
17383
    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);
17384
 
17385
    private long entityId; // required
17386
 
17387
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
17388
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
17389
      ENTITY_ID((short)1, "entityId");
17390
 
17391
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
17392
 
17393
      static {
17394
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
17395
          byName.put(field.getFieldName(), field);
17396
        }
17397
      }
17398
 
17399
      /**
17400
       * Find the _Fields constant that matches fieldId, or null if its not found.
17401
       */
17402
      public static _Fields findByThriftId(int fieldId) {
17403
        switch(fieldId) {
17404
          case 1: // ENTITY_ID
17405
            return ENTITY_ID;
17406
          default:
17407
            return null;
17408
        }
17409
      }
17410
 
17411
      /**
17412
       * Find the _Fields constant that matches fieldId, throwing an exception
17413
       * if it is not found.
17414
       */
17415
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17416
        _Fields fields = findByThriftId(fieldId);
17417
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17418
        return fields;
17419
      }
17420
 
17421
      /**
17422
       * Find the _Fields constant that matches name, or null if its not found.
17423
       */
17424
      public static _Fields findByName(String name) {
17425
        return byName.get(name);
17426
      }
17427
 
17428
      private final short _thriftId;
17429
      private final String _fieldName;
17430
 
17431
      _Fields(short thriftId, String fieldName) {
17432
        _thriftId = thriftId;
17433
        _fieldName = fieldName;
17434
      }
17435
 
17436
      public short getThriftFieldId() {
17437
        return _thriftId;
17438
      }
17439
 
17440
      public String getFieldName() {
17441
        return _fieldName;
17442
      }
17443
    }
17444
 
17445
    // isset id assignments
17446
    private static final int __ENTITYID_ISSET_ID = 0;
17447
    private BitSet __isset_bit_vector = new BitSet(1);
17448
 
17449
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
17450
    static {
17451
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
17452
      tmpMap.put(_Fields.ENTITY_ID, new org.apache.thrift.meta_data.FieldMetaData("entityId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17453
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
17454
      metaDataMap = Collections.unmodifiableMap(tmpMap);
17455
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_args.class, metaDataMap);
17456
    }
17457
 
17458
    public getDiscountsForEntity_args() {
17459
    }
17460
 
17461
    public getDiscountsForEntity_args(
17462
      long entityId)
17463
    {
17464
      this();
17465
      this.entityId = entityId;
17466
      setEntityIdIsSet(true);
17467
    }
17468
 
17469
    /**
17470
     * Performs a deep copy on <i>other</i>.
17471
     */
17472
    public getDiscountsForEntity_args(getDiscountsForEntity_args other) {
17473
      __isset_bit_vector.clear();
17474
      __isset_bit_vector.or(other.__isset_bit_vector);
17475
      this.entityId = other.entityId;
17476
    }
17477
 
17478
    public getDiscountsForEntity_args deepCopy() {
17479
      return new getDiscountsForEntity_args(this);
17480
    }
17481
 
17482
    @Override
17483
    public void clear() {
17484
      setEntityIdIsSet(false);
17485
      this.entityId = 0;
17486
    }
17487
 
17488
    public long getEntityId() {
17489
      return this.entityId;
17490
    }
17491
 
17492
    public void setEntityId(long entityId) {
17493
      this.entityId = entityId;
17494
      setEntityIdIsSet(true);
17495
    }
17496
 
17497
    public void unsetEntityId() {
17498
      __isset_bit_vector.clear(__ENTITYID_ISSET_ID);
17499
    }
17500
 
17501
    /** Returns true if field entityId is set (has been assigned a value) and false otherwise */
17502
    public boolean isSetEntityId() {
17503
      return __isset_bit_vector.get(__ENTITYID_ISSET_ID);
17504
    }
17505
 
17506
    public void setEntityIdIsSet(boolean value) {
17507
      __isset_bit_vector.set(__ENTITYID_ISSET_ID, value);
17508
    }
17509
 
17510
    public void setFieldValue(_Fields field, Object value) {
17511
      switch (field) {
17512
      case ENTITY_ID:
17513
        if (value == null) {
17514
          unsetEntityId();
17515
        } else {
17516
          setEntityId((Long)value);
17517
        }
17518
        break;
17519
 
17520
      }
17521
    }
17522
 
17523
    public Object getFieldValue(_Fields field) {
17524
      switch (field) {
17525
      case ENTITY_ID:
17526
        return Long.valueOf(getEntityId());
17527
 
17528
      }
17529
      throw new IllegalStateException();
17530
    }
17531
 
17532
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
17533
    public boolean isSet(_Fields field) {
17534
      if (field == null) {
17535
        throw new IllegalArgumentException();
17536
      }
17537
 
17538
      switch (field) {
17539
      case ENTITY_ID:
17540
        return isSetEntityId();
17541
      }
17542
      throw new IllegalStateException();
17543
    }
17544
 
17545
    @Override
17546
    public boolean equals(Object that) {
17547
      if (that == null)
17548
        return false;
17549
      if (that instanceof getDiscountsForEntity_args)
17550
        return this.equals((getDiscountsForEntity_args)that);
17551
      return false;
17552
    }
17553
 
17554
    public boolean equals(getDiscountsForEntity_args that) {
17555
      if (that == null)
17556
        return false;
17557
 
17558
      boolean this_present_entityId = true;
17559
      boolean that_present_entityId = true;
17560
      if (this_present_entityId || that_present_entityId) {
17561
        if (!(this_present_entityId && that_present_entityId))
17562
          return false;
17563
        if (this.entityId != that.entityId)
17564
          return false;
17565
      }
17566
 
17567
      return true;
17568
    }
17569
 
17570
    @Override
17571
    public int hashCode() {
17572
      return 0;
17573
    }
17574
 
17575
    public int compareTo(getDiscountsForEntity_args other) {
17576
      if (!getClass().equals(other.getClass())) {
17577
        return getClass().getName().compareTo(other.getClass().getName());
17578
      }
17579
 
17580
      int lastComparison = 0;
17581
      getDiscountsForEntity_args typedOther = (getDiscountsForEntity_args)other;
17582
 
17583
      lastComparison = Boolean.valueOf(isSetEntityId()).compareTo(typedOther.isSetEntityId());
17584
      if (lastComparison != 0) {
17585
        return lastComparison;
17586
      }
17587
      if (isSetEntityId()) {
17588
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityId, typedOther.entityId);
17589
        if (lastComparison != 0) {
17590
          return lastComparison;
17591
        }
17592
      }
17593
      return 0;
17594
    }
17595
 
17596
    public _Fields fieldForId(int fieldId) {
17597
      return _Fields.findByThriftId(fieldId);
17598
    }
17599
 
17600
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17601
      org.apache.thrift.protocol.TField field;
17602
      iprot.readStructBegin();
17603
      while (true)
17604
      {
17605
        field = iprot.readFieldBegin();
17606
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17607
          break;
17608
        }
17609
        switch (field.id) {
17610
          case 1: // ENTITY_ID
17611
            if (field.type == org.apache.thrift.protocol.TType.I64) {
17612
              this.entityId = iprot.readI64();
17613
              setEntityIdIsSet(true);
17614
            } else { 
17615
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17616
            }
17617
            break;
17618
          default:
17619
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17620
        }
17621
        iprot.readFieldEnd();
17622
      }
17623
      iprot.readStructEnd();
17624
      validate();
17625
    }
17626
 
17627
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17628
      validate();
17629
 
17630
      oprot.writeStructBegin(STRUCT_DESC);
17631
      oprot.writeFieldBegin(ENTITY_ID_FIELD_DESC);
17632
      oprot.writeI64(this.entityId);
17633
      oprot.writeFieldEnd();
17634
      oprot.writeFieldStop();
17635
      oprot.writeStructEnd();
17636
    }
17637
 
17638
    @Override
17639
    public String toString() {
17640
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_args(");
17641
      boolean first = true;
17642
 
17643
      sb.append("entityId:");
17644
      sb.append(this.entityId);
17645
      first = false;
17646
      sb.append(")");
17647
      return sb.toString();
17648
    }
17649
 
17650
    public void validate() throws org.apache.thrift.TException {
17651
      // check for required fields
17652
    }
17653
 
17654
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17655
      try {
17656
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17657
      } catch (org.apache.thrift.TException te) {
17658
        throw new java.io.IOException(te);
17659
      }
17660
    }
17661
 
17662
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
17663
      try {
17664
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
17665
        __isset_bit_vector = new BitSet(1);
17666
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
17667
      } catch (org.apache.thrift.TException te) {
17668
        throw new java.io.IOException(te);
17669
      }
17670
    }
17671
 
17672
  }
17673
 
17674
  public static class getDiscountsForEntity_result implements org.apache.thrift.TBase<getDiscountsForEntity_result, getDiscountsForEntity_result._Fields>, java.io.Serializable, Cloneable   {
17675
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_result");
17676
 
17677
    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);
17678
 
17679
    private Map<String,Double> success; // required
17680
 
17681
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
17682
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
17683
      SUCCESS((short)0, "success");
17684
 
17685
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
17686
 
17687
      static {
17688
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
17689
          byName.put(field.getFieldName(), field);
17690
        }
17691
      }
17692
 
17693
      /**
17694
       * Find the _Fields constant that matches fieldId, or null if its not found.
17695
       */
17696
      public static _Fields findByThriftId(int fieldId) {
17697
        switch(fieldId) {
17698
          case 0: // SUCCESS
17699
            return SUCCESS;
17700
          default:
17701
            return null;
17702
        }
17703
      }
17704
 
17705
      /**
17706
       * Find the _Fields constant that matches fieldId, throwing an exception
17707
       * if it is not found.
17708
       */
17709
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17710
        _Fields fields = findByThriftId(fieldId);
17711
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17712
        return fields;
17713
      }
17714
 
17715
      /**
17716
       * Find the _Fields constant that matches name, or null if its not found.
17717
       */
17718
      public static _Fields findByName(String name) {
17719
        return byName.get(name);
17720
      }
17721
 
17722
      private final short _thriftId;
17723
      private final String _fieldName;
17724
 
17725
      _Fields(short thriftId, String fieldName) {
17726
        _thriftId = thriftId;
17727
        _fieldName = fieldName;
17728
      }
17729
 
17730
      public short getThriftFieldId() {
17731
        return _thriftId;
17732
      }
17733
 
17734
      public String getFieldName() {
17735
        return _fieldName;
17736
      }
17737
    }
17738
 
17739
    // isset id assignments
17740
 
17741
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
17742
    static {
17743
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
17744
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17745
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
17746
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
17747
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
17748
      metaDataMap = Collections.unmodifiableMap(tmpMap);
17749
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_result.class, metaDataMap);
17750
    }
17751
 
17752
    public getDiscountsForEntity_result() {
17753
    }
17754
 
17755
    public getDiscountsForEntity_result(
17756
      Map<String,Double> success)
17757
    {
17758
      this();
17759
      this.success = success;
17760
    }
17761
 
17762
    /**
17763
     * Performs a deep copy on <i>other</i>.
17764
     */
17765
    public getDiscountsForEntity_result(getDiscountsForEntity_result other) {
17766
      if (other.isSetSuccess()) {
17767
        Map<String,Double> __this__success = new HashMap<String,Double>();
17768
        for (Map.Entry<String, Double> other_element : other.success.entrySet()) {
17769
 
17770
          String other_element_key = other_element.getKey();
17771
          Double other_element_value = other_element.getValue();
17772
 
17773
          String __this__success_copy_key = other_element_key;
17774
 
17775
          Double __this__success_copy_value = other_element_value;
17776
 
17777
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
17778
        }
17779
        this.success = __this__success;
17780
      }
17781
    }
17782
 
17783
    public getDiscountsForEntity_result deepCopy() {
17784
      return new getDiscountsForEntity_result(this);
17785
    }
17786
 
17787
    @Override
17788
    public void clear() {
17789
      this.success = null;
17790
    }
17791
 
17792
    public int getSuccessSize() {
17793
      return (this.success == null) ? 0 : this.success.size();
17794
    }
17795
 
17796
    public void putToSuccess(String key, double val) {
17797
      if (this.success == null) {
17798
        this.success = new HashMap<String,Double>();
17799
      }
17800
      this.success.put(key, val);
17801
    }
17802
 
17803
    public Map<String,Double> getSuccess() {
17804
      return this.success;
17805
    }
17806
 
17807
    public void setSuccess(Map<String,Double> success) {
17808
      this.success = success;
17809
    }
17810
 
17811
    public void unsetSuccess() {
17812
      this.success = null;
17813
    }
17814
 
17815
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
17816
    public boolean isSetSuccess() {
17817
      return this.success != null;
17818
    }
17819
 
17820
    public void setSuccessIsSet(boolean value) {
17821
      if (!value) {
17822
        this.success = null;
17823
      }
17824
    }
17825
 
17826
    public void setFieldValue(_Fields field, Object value) {
17827
      switch (field) {
17828
      case SUCCESS:
17829
        if (value == null) {
17830
          unsetSuccess();
17831
        } else {
17832
          setSuccess((Map<String,Double>)value);
17833
        }
17834
        break;
17835
 
17836
      }
17837
    }
17838
 
17839
    public Object getFieldValue(_Fields field) {
17840
      switch (field) {
17841
      case SUCCESS:
17842
        return getSuccess();
17843
 
17844
      }
17845
      throw new IllegalStateException();
17846
    }
17847
 
17848
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
17849
    public boolean isSet(_Fields field) {
17850
      if (field == null) {
17851
        throw new IllegalArgumentException();
17852
      }
17853
 
17854
      switch (field) {
17855
      case SUCCESS:
17856
        return isSetSuccess();
17857
      }
17858
      throw new IllegalStateException();
17859
    }
17860
 
17861
    @Override
17862
    public boolean equals(Object that) {
17863
      if (that == null)
17864
        return false;
17865
      if (that instanceof getDiscountsForEntity_result)
17866
        return this.equals((getDiscountsForEntity_result)that);
17867
      return false;
17868
    }
17869
 
17870
    public boolean equals(getDiscountsForEntity_result that) {
17871
      if (that == null)
17872
        return false;
17873
 
17874
      boolean this_present_success = true && this.isSetSuccess();
17875
      boolean that_present_success = true && that.isSetSuccess();
17876
      if (this_present_success || that_present_success) {
17877
        if (!(this_present_success && that_present_success))
17878
          return false;
17879
        if (!this.success.equals(that.success))
17880
          return false;
17881
      }
17882
 
17883
      return true;
17884
    }
17885
 
17886
    @Override
17887
    public int hashCode() {
17888
      return 0;
17889
    }
17890
 
17891
    public int compareTo(getDiscountsForEntity_result other) {
17892
      if (!getClass().equals(other.getClass())) {
17893
        return getClass().getName().compareTo(other.getClass().getName());
17894
      }
17895
 
17896
      int lastComparison = 0;
17897
      getDiscountsForEntity_result typedOther = (getDiscountsForEntity_result)other;
17898
 
17899
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
17900
      if (lastComparison != 0) {
17901
        return lastComparison;
17902
      }
17903
      if (isSetSuccess()) {
17904
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
17905
        if (lastComparison != 0) {
17906
          return lastComparison;
17907
        }
17908
      }
17909
      return 0;
17910
    }
17911
 
17912
    public _Fields fieldForId(int fieldId) {
17913
      return _Fields.findByThriftId(fieldId);
17914
    }
17915
 
17916
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17917
      org.apache.thrift.protocol.TField field;
17918
      iprot.readStructBegin();
17919
      while (true)
17920
      {
17921
        field = iprot.readFieldBegin();
17922
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17923
          break;
17924
        }
17925
        switch (field.id) {
17926
          case 0: // SUCCESS
17927
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
17928
              {
7092 amit.gupta 17929
                org.apache.thrift.protocol.TMap _map46 = iprot.readMapBegin();
17930
                this.success = new HashMap<String,Double>(2*_map46.size);
17931
                for (int _i47 = 0; _i47 < _map46.size; ++_i47)
4494 varun.gupt 17932
                {
7092 amit.gupta 17933
                  String _key48; // required
17934
                  double _val49; // required
17935
                  _key48 = iprot.readString();
17936
                  _val49 = iprot.readDouble();
17937
                  this.success.put(_key48, _val49);
4494 varun.gupt 17938
                }
17939
                iprot.readMapEnd();
17940
              }
17941
            } else { 
17942
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17943
            }
17944
            break;
17945
          default:
17946
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17947
        }
17948
        iprot.readFieldEnd();
17949
      }
17950
      iprot.readStructEnd();
17951
      validate();
17952
    }
17953
 
17954
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17955
      oprot.writeStructBegin(STRUCT_DESC);
17956
 
17957
      if (this.isSetSuccess()) {
17958
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
17959
        {
17960
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, this.success.size()));
7092 amit.gupta 17961
          for (Map.Entry<String, Double> _iter50 : this.success.entrySet())
4494 varun.gupt 17962
          {
7092 amit.gupta 17963
            oprot.writeString(_iter50.getKey());
17964
            oprot.writeDouble(_iter50.getValue());
4494 varun.gupt 17965
          }
17966
          oprot.writeMapEnd();
17967
        }
17968
        oprot.writeFieldEnd();
17969
      }
17970
      oprot.writeFieldStop();
17971
      oprot.writeStructEnd();
17972
    }
17973
 
17974
    @Override
17975
    public String toString() {
17976
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_result(");
17977
      boolean first = true;
17978
 
17979
      sb.append("success:");
17980
      if (this.success == null) {
17981
        sb.append("null");
17982
      } else {
17983
        sb.append(this.success);
17984
      }
17985
      first = false;
17986
      sb.append(")");
17987
      return sb.toString();
17988
    }
17989
 
17990
    public void validate() throws org.apache.thrift.TException {
17991
      // check for required fields
17992
    }
17993
 
17994
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17995
      try {
17996
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17997
      } catch (org.apache.thrift.TException te) {
17998
        throw new java.io.IOException(te);
17999
      }
18000
    }
18001
 
18002
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
18003
      try {
18004
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
18005
      } catch (org.apache.thrift.TException te) {
18006
        throw new java.io.IOException(te);
18007
      }
18008
    }
18009
 
18010
  }
18011
 
5469 rajveer 18012
  public static class addVoucher_args implements org.apache.thrift.TBase<addVoucher_args, addVoucher_args._Fields>, java.io.Serializable, Cloneable   {
18013
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_args");
18014
 
18015
    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);
18016
 
18017
    private Voucher voucher; // required
18018
 
18019
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
18020
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
18021
      VOUCHER((short)1, "voucher");
18022
 
18023
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
18024
 
18025
      static {
18026
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
18027
          byName.put(field.getFieldName(), field);
18028
        }
18029
      }
18030
 
18031
      /**
18032
       * Find the _Fields constant that matches fieldId, or null if its not found.
18033
       */
18034
      public static _Fields findByThriftId(int fieldId) {
18035
        switch(fieldId) {
18036
          case 1: // VOUCHER
18037
            return VOUCHER;
18038
          default:
18039
            return null;
18040
        }
18041
      }
18042
 
18043
      /**
18044
       * Find the _Fields constant that matches fieldId, throwing an exception
18045
       * if it is not found.
18046
       */
18047
      public static _Fields findByThriftIdOrThrow(int fieldId) {
18048
        _Fields fields = findByThriftId(fieldId);
18049
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
18050
        return fields;
18051
      }
18052
 
18053
      /**
18054
       * Find the _Fields constant that matches name, or null if its not found.
18055
       */
18056
      public static _Fields findByName(String name) {
18057
        return byName.get(name);
18058
      }
18059
 
18060
      private final short _thriftId;
18061
      private final String _fieldName;
18062
 
18063
      _Fields(short thriftId, String fieldName) {
18064
        _thriftId = thriftId;
18065
        _fieldName = fieldName;
18066
      }
18067
 
18068
      public short getThriftFieldId() {
18069
        return _thriftId;
18070
      }
18071
 
18072
      public String getFieldName() {
18073
        return _fieldName;
18074
      }
18075
    }
18076
 
18077
    // isset id assignments
18078
 
18079
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
18080
    static {
18081
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
18082
      tmpMap.put(_Fields.VOUCHER, new org.apache.thrift.meta_data.FieldMetaData("voucher", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18083
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
18084
      metaDataMap = Collections.unmodifiableMap(tmpMap);
18085
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_args.class, metaDataMap);
18086
    }
18087
 
18088
    public addVoucher_args() {
18089
    }
18090
 
18091
    public addVoucher_args(
18092
      Voucher voucher)
18093
    {
18094
      this();
18095
      this.voucher = voucher;
18096
    }
18097
 
18098
    /**
18099
     * Performs a deep copy on <i>other</i>.
18100
     */
18101
    public addVoucher_args(addVoucher_args other) {
18102
      if (other.isSetVoucher()) {
18103
        this.voucher = new Voucher(other.voucher);
18104
      }
18105
    }
18106
 
18107
    public addVoucher_args deepCopy() {
18108
      return new addVoucher_args(this);
18109
    }
18110
 
18111
    @Override
18112
    public void clear() {
18113
      this.voucher = null;
18114
    }
18115
 
18116
    public Voucher getVoucher() {
18117
      return this.voucher;
18118
    }
18119
 
18120
    public void setVoucher(Voucher voucher) {
18121
      this.voucher = voucher;
18122
    }
18123
 
18124
    public void unsetVoucher() {
18125
      this.voucher = null;
18126
    }
18127
 
18128
    /** Returns true if field voucher is set (has been assigned a value) and false otherwise */
18129
    public boolean isSetVoucher() {
18130
      return this.voucher != null;
18131
    }
18132
 
18133
    public void setVoucherIsSet(boolean value) {
18134
      if (!value) {
18135
        this.voucher = null;
18136
      }
18137
    }
18138
 
18139
    public void setFieldValue(_Fields field, Object value) {
18140
      switch (field) {
18141
      case VOUCHER:
18142
        if (value == null) {
18143
          unsetVoucher();
18144
        } else {
18145
          setVoucher((Voucher)value);
18146
        }
18147
        break;
18148
 
18149
      }
18150
    }
18151
 
18152
    public Object getFieldValue(_Fields field) {
18153
      switch (field) {
18154
      case VOUCHER:
18155
        return getVoucher();
18156
 
18157
      }
18158
      throw new IllegalStateException();
18159
    }
18160
 
18161
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
18162
    public boolean isSet(_Fields field) {
18163
      if (field == null) {
18164
        throw new IllegalArgumentException();
18165
      }
18166
 
18167
      switch (field) {
18168
      case VOUCHER:
18169
        return isSetVoucher();
18170
      }
18171
      throw new IllegalStateException();
18172
    }
18173
 
18174
    @Override
18175
    public boolean equals(Object that) {
18176
      if (that == null)
18177
        return false;
18178
      if (that instanceof addVoucher_args)
18179
        return this.equals((addVoucher_args)that);
18180
      return false;
18181
    }
18182
 
18183
    public boolean equals(addVoucher_args that) {
18184
      if (that == null)
18185
        return false;
18186
 
18187
      boolean this_present_voucher = true && this.isSetVoucher();
18188
      boolean that_present_voucher = true && that.isSetVoucher();
18189
      if (this_present_voucher || that_present_voucher) {
18190
        if (!(this_present_voucher && that_present_voucher))
18191
          return false;
18192
        if (!this.voucher.equals(that.voucher))
18193
          return false;
18194
      }
18195
 
18196
      return true;
18197
    }
18198
 
18199
    @Override
18200
    public int hashCode() {
18201
      return 0;
18202
    }
18203
 
18204
    public int compareTo(addVoucher_args other) {
18205
      if (!getClass().equals(other.getClass())) {
18206
        return getClass().getName().compareTo(other.getClass().getName());
18207
      }
18208
 
18209
      int lastComparison = 0;
18210
      addVoucher_args typedOther = (addVoucher_args)other;
18211
 
18212
      lastComparison = Boolean.valueOf(isSetVoucher()).compareTo(typedOther.isSetVoucher());
18213
      if (lastComparison != 0) {
18214
        return lastComparison;
18215
      }
18216
      if (isSetVoucher()) {
18217
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucher, typedOther.voucher);
18218
        if (lastComparison != 0) {
18219
          return lastComparison;
18220
        }
18221
      }
18222
      return 0;
18223
    }
18224
 
18225
    public _Fields fieldForId(int fieldId) {
18226
      return _Fields.findByThriftId(fieldId);
18227
    }
18228
 
18229
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
18230
      org.apache.thrift.protocol.TField field;
18231
      iprot.readStructBegin();
18232
      while (true)
18233
      {
18234
        field = iprot.readFieldBegin();
18235
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
18236
          break;
18237
        }
18238
        switch (field.id) {
18239
          case 1: // VOUCHER
18240
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
18241
              this.voucher = new Voucher();
18242
              this.voucher.read(iprot);
18243
            } else { 
18244
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18245
            }
18246
            break;
18247
          default:
18248
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18249
        }
18250
        iprot.readFieldEnd();
18251
      }
18252
      iprot.readStructEnd();
18253
      validate();
18254
    }
18255
 
18256
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
18257
      validate();
18258
 
18259
      oprot.writeStructBegin(STRUCT_DESC);
18260
      if (this.voucher != null) {
18261
        oprot.writeFieldBegin(VOUCHER_FIELD_DESC);
18262
        this.voucher.write(oprot);
18263
        oprot.writeFieldEnd();
18264
      }
18265
      oprot.writeFieldStop();
18266
      oprot.writeStructEnd();
18267
    }
18268
 
18269
    @Override
18270
    public String toString() {
18271
      StringBuilder sb = new StringBuilder("addVoucher_args(");
18272
      boolean first = true;
18273
 
18274
      sb.append("voucher:");
18275
      if (this.voucher == null) {
18276
        sb.append("null");
18277
      } else {
18278
        sb.append(this.voucher);
18279
      }
18280
      first = false;
18281
      sb.append(")");
18282
      return sb.toString();
18283
    }
18284
 
18285
    public void validate() throws org.apache.thrift.TException {
18286
      // check for required fields
18287
    }
18288
 
18289
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
18290
      try {
18291
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
18292
      } catch (org.apache.thrift.TException te) {
18293
        throw new java.io.IOException(te);
18294
      }
18295
    }
18296
 
18297
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
18298
      try {
18299
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
18300
      } catch (org.apache.thrift.TException te) {
18301
        throw new java.io.IOException(te);
18302
      }
18303
    }
18304
 
18305
  }
18306
 
18307
  public static class addVoucher_result implements org.apache.thrift.TBase<addVoucher_result, addVoucher_result._Fields>, java.io.Serializable, Cloneable   {
18308
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_result");
18309
 
18310
 
18311
 
18312
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
18313
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
18314
;
18315
 
18316
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
18317
 
18318
      static {
18319
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
18320
          byName.put(field.getFieldName(), field);
18321
        }
18322
      }
18323
 
18324
      /**
18325
       * Find the _Fields constant that matches fieldId, or null if its not found.
18326
       */
18327
      public static _Fields findByThriftId(int fieldId) {
18328
        switch(fieldId) {
18329
          default:
18330
            return null;
18331
        }
18332
      }
18333
 
18334
      /**
18335
       * Find the _Fields constant that matches fieldId, throwing an exception
18336
       * if it is not found.
18337
       */
18338
      public static _Fields findByThriftIdOrThrow(int fieldId) {
18339
        _Fields fields = findByThriftId(fieldId);
18340
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
18341
        return fields;
18342
      }
18343
 
18344
      /**
18345
       * Find the _Fields constant that matches name, or null if its not found.
18346
       */
18347
      public static _Fields findByName(String name) {
18348
        return byName.get(name);
18349
      }
18350
 
18351
      private final short _thriftId;
18352
      private final String _fieldName;
18353
 
18354
      _Fields(short thriftId, String fieldName) {
18355
        _thriftId = thriftId;
18356
        _fieldName = fieldName;
18357
      }
18358
 
18359
      public short getThriftFieldId() {
18360
        return _thriftId;
18361
      }
18362
 
18363
      public String getFieldName() {
18364
        return _fieldName;
18365
      }
18366
    }
18367
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
18368
    static {
18369
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
18370
      metaDataMap = Collections.unmodifiableMap(tmpMap);
18371
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_result.class, metaDataMap);
18372
    }
18373
 
18374
    public addVoucher_result() {
18375
    }
18376
 
18377
    /**
18378
     * Performs a deep copy on <i>other</i>.
18379
     */
18380
    public addVoucher_result(addVoucher_result other) {
18381
    }
18382
 
18383
    public addVoucher_result deepCopy() {
18384
      return new addVoucher_result(this);
18385
    }
18386
 
18387
    @Override
18388
    public void clear() {
18389
    }
18390
 
18391
    public void setFieldValue(_Fields field, Object value) {
18392
      switch (field) {
18393
      }
18394
    }
18395
 
18396
    public Object getFieldValue(_Fields field) {
18397
      switch (field) {
18398
      }
18399
      throw new IllegalStateException();
18400
    }
18401
 
18402
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
18403
    public boolean isSet(_Fields field) {
18404
      if (field == null) {
18405
        throw new IllegalArgumentException();
18406
      }
18407
 
18408
      switch (field) {
18409
      }
18410
      throw new IllegalStateException();
18411
    }
18412
 
18413
    @Override
18414
    public boolean equals(Object that) {
18415
      if (that == null)
18416
        return false;
18417
      if (that instanceof addVoucher_result)
18418
        return this.equals((addVoucher_result)that);
18419
      return false;
18420
    }
18421
 
18422
    public boolean equals(addVoucher_result that) {
18423
      if (that == null)
18424
        return false;
18425
 
18426
      return true;
18427
    }
18428
 
18429
    @Override
18430
    public int hashCode() {
18431
      return 0;
18432
    }
18433
 
18434
    public int compareTo(addVoucher_result other) {
18435
      if (!getClass().equals(other.getClass())) {
18436
        return getClass().getName().compareTo(other.getClass().getName());
18437
      }
18438
 
18439
      int lastComparison = 0;
18440
      addVoucher_result typedOther = (addVoucher_result)other;
18441
 
18442
      return 0;
18443
    }
18444
 
18445
    public _Fields fieldForId(int fieldId) {
18446
      return _Fields.findByThriftId(fieldId);
18447
    }
18448
 
18449
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
18450
      org.apache.thrift.protocol.TField field;
18451
      iprot.readStructBegin();
18452
      while (true)
18453
      {
18454
        field = iprot.readFieldBegin();
18455
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
18456
          break;
18457
        }
18458
        switch (field.id) {
18459
          default:
18460
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18461
        }
18462
        iprot.readFieldEnd();
18463
      }
18464
      iprot.readStructEnd();
18465
      validate();
18466
    }
18467
 
18468
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
18469
      oprot.writeStructBegin(STRUCT_DESC);
18470
 
18471
      oprot.writeFieldStop();
18472
      oprot.writeStructEnd();
18473
    }
18474
 
18475
    @Override
18476
    public String toString() {
18477
      StringBuilder sb = new StringBuilder("addVoucher_result(");
18478
      boolean first = true;
18479
 
18480
      sb.append(")");
18481
      return sb.toString();
18482
    }
18483
 
18484
    public void validate() throws org.apache.thrift.TException {
18485
      // check for required fields
18486
    }
18487
 
18488
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
18489
      try {
18490
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
18491
      } catch (org.apache.thrift.TException te) {
18492
        throw new java.io.IOException(te);
18493
      }
18494
    }
18495
 
18496
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
18497
      try {
18498
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
18499
      } catch (org.apache.thrift.TException te) {
18500
        throw new java.io.IOException(te);
18501
      }
18502
    }
18503
 
18504
  }
18505
 
18506
  public static class assignVoucher_args implements org.apache.thrift.TBase<assignVoucher_args, assignVoucher_args._Fields>, java.io.Serializable, Cloneable   {
18507
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_args");
18508
 
18509
    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);
18510
    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);
18511
    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);
18512
    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);
18513
 
18514
    private long userId; // required
18515
    private String userEmail; // required
18516
    private VoucherType voucherType; // required
18517
    private long amount; // required
18518
 
18519
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
18520
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
18521
      USER_ID((short)1, "userId"),
18522
      USER_EMAIL((short)2, "userEmail"),
18523
      /**
18524
       * 
18525
       * @see VoucherType
18526
       */
18527
      VOUCHER_TYPE((short)3, "voucherType"),
18528
      AMOUNT((short)4, "amount");
18529
 
18530
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
18531
 
18532
      static {
18533
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
18534
          byName.put(field.getFieldName(), field);
18535
        }
18536
      }
18537
 
18538
      /**
18539
       * Find the _Fields constant that matches fieldId, or null if its not found.
18540
       */
18541
      public static _Fields findByThriftId(int fieldId) {
18542
        switch(fieldId) {
18543
          case 1: // USER_ID
18544
            return USER_ID;
18545
          case 2: // USER_EMAIL
18546
            return USER_EMAIL;
18547
          case 3: // VOUCHER_TYPE
18548
            return VOUCHER_TYPE;
18549
          case 4: // AMOUNT
18550
            return AMOUNT;
18551
          default:
18552
            return null;
18553
        }
18554
      }
18555
 
18556
      /**
18557
       * Find the _Fields constant that matches fieldId, throwing an exception
18558
       * if it is not found.
18559
       */
18560
      public static _Fields findByThriftIdOrThrow(int fieldId) {
18561
        _Fields fields = findByThriftId(fieldId);
18562
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
18563
        return fields;
18564
      }
18565
 
18566
      /**
18567
       * Find the _Fields constant that matches name, or null if its not found.
18568
       */
18569
      public static _Fields findByName(String name) {
18570
        return byName.get(name);
18571
      }
18572
 
18573
      private final short _thriftId;
18574
      private final String _fieldName;
18575
 
18576
      _Fields(short thriftId, String fieldName) {
18577
        _thriftId = thriftId;
18578
        _fieldName = fieldName;
18579
      }
18580
 
18581
      public short getThriftFieldId() {
18582
        return _thriftId;
18583
      }
18584
 
18585
      public String getFieldName() {
18586
        return _fieldName;
18587
      }
18588
    }
18589
 
18590
    // isset id assignments
18591
    private static final int __USERID_ISSET_ID = 0;
18592
    private static final int __AMOUNT_ISSET_ID = 1;
18593
    private BitSet __isset_bit_vector = new BitSet(2);
18594
 
18595
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
18596
    static {
18597
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
18598
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18599
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
18600
      tmpMap.put(_Fields.USER_EMAIL, new org.apache.thrift.meta_data.FieldMetaData("userEmail", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18601
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
18602
      tmpMap.put(_Fields.VOUCHER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("voucherType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18603
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, VoucherType.class)));
18604
      tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18605
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
18606
      metaDataMap = Collections.unmodifiableMap(tmpMap);
18607
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_args.class, metaDataMap);
18608
    }
18609
 
18610
    public assignVoucher_args() {
18611
    }
18612
 
18613
    public assignVoucher_args(
18614
      long userId,
18615
      String userEmail,
18616
      VoucherType voucherType,
18617
      long amount)
18618
    {
18619
      this();
18620
      this.userId = userId;
18621
      setUserIdIsSet(true);
18622
      this.userEmail = userEmail;
18623
      this.voucherType = voucherType;
18624
      this.amount = amount;
18625
      setAmountIsSet(true);
18626
    }
18627
 
18628
    /**
18629
     * Performs a deep copy on <i>other</i>.
18630
     */
18631
    public assignVoucher_args(assignVoucher_args other) {
18632
      __isset_bit_vector.clear();
18633
      __isset_bit_vector.or(other.__isset_bit_vector);
18634
      this.userId = other.userId;
18635
      if (other.isSetUserEmail()) {
18636
        this.userEmail = other.userEmail;
18637
      }
18638
      if (other.isSetVoucherType()) {
18639
        this.voucherType = other.voucherType;
18640
      }
18641
      this.amount = other.amount;
18642
    }
18643
 
18644
    public assignVoucher_args deepCopy() {
18645
      return new assignVoucher_args(this);
18646
    }
18647
 
18648
    @Override
18649
    public void clear() {
18650
      setUserIdIsSet(false);
18651
      this.userId = 0;
18652
      this.userEmail = null;
18653
      this.voucherType = null;
18654
      setAmountIsSet(false);
18655
      this.amount = 0;
18656
    }
18657
 
18658
    public long getUserId() {
18659
      return this.userId;
18660
    }
18661
 
18662
    public void setUserId(long userId) {
18663
      this.userId = userId;
18664
      setUserIdIsSet(true);
18665
    }
18666
 
18667
    public void unsetUserId() {
18668
      __isset_bit_vector.clear(__USERID_ISSET_ID);
18669
    }
18670
 
18671
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
18672
    public boolean isSetUserId() {
18673
      return __isset_bit_vector.get(__USERID_ISSET_ID);
18674
    }
18675
 
18676
    public void setUserIdIsSet(boolean value) {
18677
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
18678
    }
18679
 
18680
    public String getUserEmail() {
18681
      return this.userEmail;
18682
    }
18683
 
18684
    public void setUserEmail(String userEmail) {
18685
      this.userEmail = userEmail;
18686
    }
18687
 
18688
    public void unsetUserEmail() {
18689
      this.userEmail = null;
18690
    }
18691
 
18692
    /** Returns true if field userEmail is set (has been assigned a value) and false otherwise */
18693
    public boolean isSetUserEmail() {
18694
      return this.userEmail != null;
18695
    }
18696
 
18697
    public void setUserEmailIsSet(boolean value) {
18698
      if (!value) {
18699
        this.userEmail = null;
18700
      }
18701
    }
18702
 
18703
    /**
18704
     * 
18705
     * @see VoucherType
18706
     */
18707
    public VoucherType getVoucherType() {
18708
      return this.voucherType;
18709
    }
18710
 
18711
    /**
18712
     * 
18713
     * @see VoucherType
18714
     */
18715
    public void setVoucherType(VoucherType voucherType) {
18716
      this.voucherType = voucherType;
18717
    }
18718
 
18719
    public void unsetVoucherType() {
18720
      this.voucherType = null;
18721
    }
18722
 
18723
    /** Returns true if field voucherType is set (has been assigned a value) and false otherwise */
18724
    public boolean isSetVoucherType() {
18725
      return this.voucherType != null;
18726
    }
18727
 
18728
    public void setVoucherTypeIsSet(boolean value) {
18729
      if (!value) {
18730
        this.voucherType = null;
18731
      }
18732
    }
18733
 
18734
    public long getAmount() {
18735
      return this.amount;
18736
    }
18737
 
18738
    public void setAmount(long amount) {
18739
      this.amount = amount;
18740
      setAmountIsSet(true);
18741
    }
18742
 
18743
    public void unsetAmount() {
18744
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
18745
    }
18746
 
18747
    /** Returns true if field amount is set (has been assigned a value) and false otherwise */
18748
    public boolean isSetAmount() {
18749
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
18750
    }
18751
 
18752
    public void setAmountIsSet(boolean value) {
18753
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
18754
    }
18755
 
18756
    public void setFieldValue(_Fields field, Object value) {
18757
      switch (field) {
18758
      case USER_ID:
18759
        if (value == null) {
18760
          unsetUserId();
18761
        } else {
18762
          setUserId((Long)value);
18763
        }
18764
        break;
18765
 
18766
      case USER_EMAIL:
18767
        if (value == null) {
18768
          unsetUserEmail();
18769
        } else {
18770
          setUserEmail((String)value);
18771
        }
18772
        break;
18773
 
18774
      case VOUCHER_TYPE:
18775
        if (value == null) {
18776
          unsetVoucherType();
18777
        } else {
18778
          setVoucherType((VoucherType)value);
18779
        }
18780
        break;
18781
 
18782
      case AMOUNT:
18783
        if (value == null) {
18784
          unsetAmount();
18785
        } else {
18786
          setAmount((Long)value);
18787
        }
18788
        break;
18789
 
18790
      }
18791
    }
18792
 
18793
    public Object getFieldValue(_Fields field) {
18794
      switch (field) {
18795
      case USER_ID:
18796
        return Long.valueOf(getUserId());
18797
 
18798
      case USER_EMAIL:
18799
        return getUserEmail();
18800
 
18801
      case VOUCHER_TYPE:
18802
        return getVoucherType();
18803
 
18804
      case AMOUNT:
18805
        return Long.valueOf(getAmount());
18806
 
18807
      }
18808
      throw new IllegalStateException();
18809
    }
18810
 
18811
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
18812
    public boolean isSet(_Fields field) {
18813
      if (field == null) {
18814
        throw new IllegalArgumentException();
18815
      }
18816
 
18817
      switch (field) {
18818
      case USER_ID:
18819
        return isSetUserId();
18820
      case USER_EMAIL:
18821
        return isSetUserEmail();
18822
      case VOUCHER_TYPE:
18823
        return isSetVoucherType();
18824
      case AMOUNT:
18825
        return isSetAmount();
18826
      }
18827
      throw new IllegalStateException();
18828
    }
18829
 
18830
    @Override
18831
    public boolean equals(Object that) {
18832
      if (that == null)
18833
        return false;
18834
      if (that instanceof assignVoucher_args)
18835
        return this.equals((assignVoucher_args)that);
18836
      return false;
18837
    }
18838
 
18839
    public boolean equals(assignVoucher_args that) {
18840
      if (that == null)
18841
        return false;
18842
 
18843
      boolean this_present_userId = true;
18844
      boolean that_present_userId = true;
18845
      if (this_present_userId || that_present_userId) {
18846
        if (!(this_present_userId && that_present_userId))
18847
          return false;
18848
        if (this.userId != that.userId)
18849
          return false;
18850
      }
18851
 
18852
      boolean this_present_userEmail = true && this.isSetUserEmail();
18853
      boolean that_present_userEmail = true && that.isSetUserEmail();
18854
      if (this_present_userEmail || that_present_userEmail) {
18855
        if (!(this_present_userEmail && that_present_userEmail))
18856
          return false;
18857
        if (!this.userEmail.equals(that.userEmail))
18858
          return false;
18859
      }
18860
 
18861
      boolean this_present_voucherType = true && this.isSetVoucherType();
18862
      boolean that_present_voucherType = true && that.isSetVoucherType();
18863
      if (this_present_voucherType || that_present_voucherType) {
18864
        if (!(this_present_voucherType && that_present_voucherType))
18865
          return false;
18866
        if (!this.voucherType.equals(that.voucherType))
18867
          return false;
18868
      }
18869
 
18870
      boolean this_present_amount = true;
18871
      boolean that_present_amount = true;
18872
      if (this_present_amount || that_present_amount) {
18873
        if (!(this_present_amount && that_present_amount))
18874
          return false;
18875
        if (this.amount != that.amount)
18876
          return false;
18877
      }
18878
 
18879
      return true;
18880
    }
18881
 
18882
    @Override
18883
    public int hashCode() {
18884
      return 0;
18885
    }
18886
 
18887
    public int compareTo(assignVoucher_args other) {
18888
      if (!getClass().equals(other.getClass())) {
18889
        return getClass().getName().compareTo(other.getClass().getName());
18890
      }
18891
 
18892
      int lastComparison = 0;
18893
      assignVoucher_args typedOther = (assignVoucher_args)other;
18894
 
18895
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
18896
      if (lastComparison != 0) {
18897
        return lastComparison;
18898
      }
18899
      if (isSetUserId()) {
18900
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
18901
        if (lastComparison != 0) {
18902
          return lastComparison;
18903
        }
18904
      }
18905
      lastComparison = Boolean.valueOf(isSetUserEmail()).compareTo(typedOther.isSetUserEmail());
18906
      if (lastComparison != 0) {
18907
        return lastComparison;
18908
      }
18909
      if (isSetUserEmail()) {
18910
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userEmail, typedOther.userEmail);
18911
        if (lastComparison != 0) {
18912
          return lastComparison;
18913
        }
18914
      }
18915
      lastComparison = Boolean.valueOf(isSetVoucherType()).compareTo(typedOther.isSetVoucherType());
18916
      if (lastComparison != 0) {
18917
        return lastComparison;
18918
      }
18919
      if (isSetVoucherType()) {
18920
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherType, typedOther.voucherType);
18921
        if (lastComparison != 0) {
18922
          return lastComparison;
18923
        }
18924
      }
18925
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
18926
      if (lastComparison != 0) {
18927
        return lastComparison;
18928
      }
18929
      if (isSetAmount()) {
18930
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
18931
        if (lastComparison != 0) {
18932
          return lastComparison;
18933
        }
18934
      }
18935
      return 0;
18936
    }
18937
 
18938
    public _Fields fieldForId(int fieldId) {
18939
      return _Fields.findByThriftId(fieldId);
18940
    }
18941
 
18942
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
18943
      org.apache.thrift.protocol.TField field;
18944
      iprot.readStructBegin();
18945
      while (true)
18946
      {
18947
        field = iprot.readFieldBegin();
18948
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
18949
          break;
18950
        }
18951
        switch (field.id) {
18952
          case 1: // USER_ID
18953
            if (field.type == org.apache.thrift.protocol.TType.I64) {
18954
              this.userId = iprot.readI64();
18955
              setUserIdIsSet(true);
18956
            } else { 
18957
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18958
            }
18959
            break;
18960
          case 2: // USER_EMAIL
18961
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
18962
              this.userEmail = iprot.readString();
18963
            } else { 
18964
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18965
            }
18966
            break;
18967
          case 3: // VOUCHER_TYPE
18968
            if (field.type == org.apache.thrift.protocol.TType.I32) {
18969
              this.voucherType = VoucherType.findByValue(iprot.readI32());
18970
            } else { 
18971
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18972
            }
18973
            break;
18974
          case 4: // AMOUNT
18975
            if (field.type == org.apache.thrift.protocol.TType.I64) {
18976
              this.amount = iprot.readI64();
18977
              setAmountIsSet(true);
18978
            } else { 
18979
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18980
            }
18981
            break;
18982
          default:
18983
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18984
        }
18985
        iprot.readFieldEnd();
18986
      }
18987
      iprot.readStructEnd();
18988
      validate();
18989
    }
18990
 
18991
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
18992
      validate();
18993
 
18994
      oprot.writeStructBegin(STRUCT_DESC);
18995
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
18996
      oprot.writeI64(this.userId);
18997
      oprot.writeFieldEnd();
18998
      if (this.userEmail != null) {
18999
        oprot.writeFieldBegin(USER_EMAIL_FIELD_DESC);
19000
        oprot.writeString(this.userEmail);
19001
        oprot.writeFieldEnd();
19002
      }
19003
      if (this.voucherType != null) {
19004
        oprot.writeFieldBegin(VOUCHER_TYPE_FIELD_DESC);
19005
        oprot.writeI32(this.voucherType.getValue());
19006
        oprot.writeFieldEnd();
19007
      }
19008
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
19009
      oprot.writeI64(this.amount);
19010
      oprot.writeFieldEnd();
19011
      oprot.writeFieldStop();
19012
      oprot.writeStructEnd();
19013
    }
19014
 
19015
    @Override
19016
    public String toString() {
19017
      StringBuilder sb = new StringBuilder("assignVoucher_args(");
19018
      boolean first = true;
19019
 
19020
      sb.append("userId:");
19021
      sb.append(this.userId);
19022
      first = false;
19023
      if (!first) sb.append(", ");
19024
      sb.append("userEmail:");
19025
      if (this.userEmail == null) {
19026
        sb.append("null");
19027
      } else {
19028
        sb.append(this.userEmail);
19029
      }
19030
      first = false;
19031
      if (!first) sb.append(", ");
19032
      sb.append("voucherType:");
19033
      if (this.voucherType == null) {
19034
        sb.append("null");
19035
      } else {
19036
        sb.append(this.voucherType);
19037
      }
19038
      first = false;
19039
      if (!first) sb.append(", ");
19040
      sb.append("amount:");
19041
      sb.append(this.amount);
19042
      first = false;
19043
      sb.append(")");
19044
      return sb.toString();
19045
    }
19046
 
19047
    public void validate() throws org.apache.thrift.TException {
19048
      // check for required fields
19049
    }
19050
 
19051
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
19052
      try {
19053
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
19054
      } catch (org.apache.thrift.TException te) {
19055
        throw new java.io.IOException(te);
19056
      }
19057
    }
19058
 
19059
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
19060
      try {
19061
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
19062
        __isset_bit_vector = new BitSet(1);
19063
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
19064
      } catch (org.apache.thrift.TException te) {
19065
        throw new java.io.IOException(te);
19066
      }
19067
    }
19068
 
19069
  }
19070
 
19071
  public static class assignVoucher_result implements org.apache.thrift.TBase<assignVoucher_result, assignVoucher_result._Fields>, java.io.Serializable, Cloneable   {
19072
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_result");
19073
 
19074
    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);
19075
 
19076
    private Voucher success; // required
19077
 
19078
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
19079
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
19080
      SUCCESS((short)0, "success");
19081
 
19082
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
19083
 
19084
      static {
19085
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
19086
          byName.put(field.getFieldName(), field);
19087
        }
19088
      }
19089
 
19090
      /**
19091
       * Find the _Fields constant that matches fieldId, or null if its not found.
19092
       */
19093
      public static _Fields findByThriftId(int fieldId) {
19094
        switch(fieldId) {
19095
          case 0: // SUCCESS
19096
            return SUCCESS;
19097
          default:
19098
            return null;
19099
        }
19100
      }
19101
 
19102
      /**
19103
       * Find the _Fields constant that matches fieldId, throwing an exception
19104
       * if it is not found.
19105
       */
19106
      public static _Fields findByThriftIdOrThrow(int fieldId) {
19107
        _Fields fields = findByThriftId(fieldId);
19108
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
19109
        return fields;
19110
      }
19111
 
19112
      /**
19113
       * Find the _Fields constant that matches name, or null if its not found.
19114
       */
19115
      public static _Fields findByName(String name) {
19116
        return byName.get(name);
19117
      }
19118
 
19119
      private final short _thriftId;
19120
      private final String _fieldName;
19121
 
19122
      _Fields(short thriftId, String fieldName) {
19123
        _thriftId = thriftId;
19124
        _fieldName = fieldName;
19125
      }
19126
 
19127
      public short getThriftFieldId() {
19128
        return _thriftId;
19129
      }
19130
 
19131
      public String getFieldName() {
19132
        return _fieldName;
19133
      }
19134
    }
19135
 
19136
    // isset id assignments
19137
 
19138
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
19139
    static {
19140
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
19141
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
19142
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
19143
      metaDataMap = Collections.unmodifiableMap(tmpMap);
19144
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_result.class, metaDataMap);
19145
    }
19146
 
19147
    public assignVoucher_result() {
19148
    }
19149
 
19150
    public assignVoucher_result(
19151
      Voucher success)
19152
    {
19153
      this();
19154
      this.success = success;
19155
    }
19156
 
19157
    /**
19158
     * Performs a deep copy on <i>other</i>.
19159
     */
19160
    public assignVoucher_result(assignVoucher_result other) {
19161
      if (other.isSetSuccess()) {
19162
        this.success = new Voucher(other.success);
19163
      }
19164
    }
19165
 
19166
    public assignVoucher_result deepCopy() {
19167
      return new assignVoucher_result(this);
19168
    }
19169
 
19170
    @Override
19171
    public void clear() {
19172
      this.success = null;
19173
    }
19174
 
19175
    public Voucher getSuccess() {
19176
      return this.success;
19177
    }
19178
 
19179
    public void setSuccess(Voucher success) {
19180
      this.success = success;
19181
    }
19182
 
19183
    public void unsetSuccess() {
19184
      this.success = null;
19185
    }
19186
 
19187
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
19188
    public boolean isSetSuccess() {
19189
      return this.success != null;
19190
    }
19191
 
19192
    public void setSuccessIsSet(boolean value) {
19193
      if (!value) {
19194
        this.success = null;
19195
      }
19196
    }
19197
 
19198
    public void setFieldValue(_Fields field, Object value) {
19199
      switch (field) {
19200
      case SUCCESS:
19201
        if (value == null) {
19202
          unsetSuccess();
19203
        } else {
19204
          setSuccess((Voucher)value);
19205
        }
19206
        break;
19207
 
19208
      }
19209
    }
19210
 
19211
    public Object getFieldValue(_Fields field) {
19212
      switch (field) {
19213
      case SUCCESS:
19214
        return getSuccess();
19215
 
19216
      }
19217
      throw new IllegalStateException();
19218
    }
19219
 
19220
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
19221
    public boolean isSet(_Fields field) {
19222
      if (field == null) {
19223
        throw new IllegalArgumentException();
19224
      }
19225
 
19226
      switch (field) {
19227
      case SUCCESS:
19228
        return isSetSuccess();
19229
      }
19230
      throw new IllegalStateException();
19231
    }
19232
 
19233
    @Override
19234
    public boolean equals(Object that) {
19235
      if (that == null)
19236
        return false;
19237
      if (that instanceof assignVoucher_result)
19238
        return this.equals((assignVoucher_result)that);
19239
      return false;
19240
    }
19241
 
19242
    public boolean equals(assignVoucher_result that) {
19243
      if (that == null)
19244
        return false;
19245
 
19246
      boolean this_present_success = true && this.isSetSuccess();
19247
      boolean that_present_success = true && that.isSetSuccess();
19248
      if (this_present_success || that_present_success) {
19249
        if (!(this_present_success && that_present_success))
19250
          return false;
19251
        if (!this.success.equals(that.success))
19252
          return false;
19253
      }
19254
 
19255
      return true;
19256
    }
19257
 
19258
    @Override
19259
    public int hashCode() {
19260
      return 0;
19261
    }
19262
 
19263
    public int compareTo(assignVoucher_result other) {
19264
      if (!getClass().equals(other.getClass())) {
19265
        return getClass().getName().compareTo(other.getClass().getName());
19266
      }
19267
 
19268
      int lastComparison = 0;
19269
      assignVoucher_result typedOther = (assignVoucher_result)other;
19270
 
19271
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
19272
      if (lastComparison != 0) {
19273
        return lastComparison;
19274
      }
19275
      if (isSetSuccess()) {
19276
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
19277
        if (lastComparison != 0) {
19278
          return lastComparison;
19279
        }
19280
      }
19281
      return 0;
19282
    }
19283
 
19284
    public _Fields fieldForId(int fieldId) {
19285
      return _Fields.findByThriftId(fieldId);
19286
    }
19287
 
19288
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
19289
      org.apache.thrift.protocol.TField field;
19290
      iprot.readStructBegin();
19291
      while (true)
19292
      {
19293
        field = iprot.readFieldBegin();
19294
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
19295
          break;
19296
        }
19297
        switch (field.id) {
19298
          case 0: // SUCCESS
19299
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
19300
              this.success = new Voucher();
19301
              this.success.read(iprot);
19302
            } else { 
19303
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19304
            }
19305
            break;
19306
          default:
19307
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19308
        }
19309
        iprot.readFieldEnd();
19310
      }
19311
      iprot.readStructEnd();
19312
      validate();
19313
    }
19314
 
19315
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
19316
      oprot.writeStructBegin(STRUCT_DESC);
19317
 
19318
      if (this.isSetSuccess()) {
19319
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
19320
        this.success.write(oprot);
19321
        oprot.writeFieldEnd();
19322
      }
19323
      oprot.writeFieldStop();
19324
      oprot.writeStructEnd();
19325
    }
19326
 
19327
    @Override
19328
    public String toString() {
19329
      StringBuilder sb = new StringBuilder("assignVoucher_result(");
19330
      boolean first = true;
19331
 
19332
      sb.append("success:");
19333
      if (this.success == null) {
19334
        sb.append("null");
19335
      } else {
19336
        sb.append(this.success);
19337
      }
19338
      first = false;
19339
      sb.append(")");
19340
      return sb.toString();
19341
    }
19342
 
19343
    public void validate() throws org.apache.thrift.TException {
19344
      // check for required fields
19345
    }
19346
 
19347
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
19348
      try {
19349
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
19350
      } catch (org.apache.thrift.TException te) {
19351
        throw new java.io.IOException(te);
19352
      }
19353
    }
19354
 
19355
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
19356
      try {
19357
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
19358
      } catch (org.apache.thrift.TException te) {
19359
        throw new java.io.IOException(te);
19360
      }
19361
    }
19362
 
19363
  }
19364
 
19365
  public static class markVoucherAsRedeemed_args implements org.apache.thrift.TBase<markVoucherAsRedeemed_args, markVoucherAsRedeemed_args._Fields>, java.io.Serializable, Cloneable   {
19366
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_args");
19367
 
19368
    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);
19369
    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);
19370
 
19371
    private String voucherCode; // required
19372
    private long redeemedOn; // required
19373
 
19374
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
19375
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
19376
      VOUCHER_CODE((short)1, "voucherCode"),
19377
      REDEEMED_ON((short)2, "redeemedOn");
19378
 
19379
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
19380
 
19381
      static {
19382
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
19383
          byName.put(field.getFieldName(), field);
19384
        }
19385
      }
19386
 
19387
      /**
19388
       * Find the _Fields constant that matches fieldId, or null if its not found.
19389
       */
19390
      public static _Fields findByThriftId(int fieldId) {
19391
        switch(fieldId) {
19392
          case 1: // VOUCHER_CODE
19393
            return VOUCHER_CODE;
19394
          case 2: // REDEEMED_ON
19395
            return REDEEMED_ON;
19396
          default:
19397
            return null;
19398
        }
19399
      }
19400
 
19401
      /**
19402
       * Find the _Fields constant that matches fieldId, throwing an exception
19403
       * if it is not found.
19404
       */
19405
      public static _Fields findByThriftIdOrThrow(int fieldId) {
19406
        _Fields fields = findByThriftId(fieldId);
19407
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
19408
        return fields;
19409
      }
19410
 
19411
      /**
19412
       * Find the _Fields constant that matches name, or null if its not found.
19413
       */
19414
      public static _Fields findByName(String name) {
19415
        return byName.get(name);
19416
      }
19417
 
19418
      private final short _thriftId;
19419
      private final String _fieldName;
19420
 
19421
      _Fields(short thriftId, String fieldName) {
19422
        _thriftId = thriftId;
19423
        _fieldName = fieldName;
19424
      }
19425
 
19426
      public short getThriftFieldId() {
19427
        return _thriftId;
19428
      }
19429
 
19430
      public String getFieldName() {
19431
        return _fieldName;
19432
      }
19433
    }
19434
 
19435
    // isset id assignments
19436
    private static final int __REDEEMEDON_ISSET_ID = 0;
19437
    private BitSet __isset_bit_vector = new BitSet(1);
19438
 
19439
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
19440
    static {
19441
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
19442
      tmpMap.put(_Fields.VOUCHER_CODE, new org.apache.thrift.meta_data.FieldMetaData("voucherCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
19443
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
19444
      tmpMap.put(_Fields.REDEEMED_ON, new org.apache.thrift.meta_data.FieldMetaData("redeemedOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
19445
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
19446
      metaDataMap = Collections.unmodifiableMap(tmpMap);
19447
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_args.class, metaDataMap);
19448
    }
19449
 
19450
    public markVoucherAsRedeemed_args() {
19451
    }
19452
 
19453
    public markVoucherAsRedeemed_args(
19454
      String voucherCode,
19455
      long redeemedOn)
19456
    {
19457
      this();
19458
      this.voucherCode = voucherCode;
19459
      this.redeemedOn = redeemedOn;
19460
      setRedeemedOnIsSet(true);
19461
    }
19462
 
19463
    /**
19464
     * Performs a deep copy on <i>other</i>.
19465
     */
19466
    public markVoucherAsRedeemed_args(markVoucherAsRedeemed_args other) {
19467
      __isset_bit_vector.clear();
19468
      __isset_bit_vector.or(other.__isset_bit_vector);
19469
      if (other.isSetVoucherCode()) {
19470
        this.voucherCode = other.voucherCode;
19471
      }
19472
      this.redeemedOn = other.redeemedOn;
19473
    }
19474
 
19475
    public markVoucherAsRedeemed_args deepCopy() {
19476
      return new markVoucherAsRedeemed_args(this);
19477
    }
19478
 
19479
    @Override
19480
    public void clear() {
19481
      this.voucherCode = null;
19482
      setRedeemedOnIsSet(false);
19483
      this.redeemedOn = 0;
19484
    }
19485
 
19486
    public String getVoucherCode() {
19487
      return this.voucherCode;
19488
    }
19489
 
19490
    public void setVoucherCode(String voucherCode) {
19491
      this.voucherCode = voucherCode;
19492
    }
19493
 
19494
    public void unsetVoucherCode() {
19495
      this.voucherCode = null;
19496
    }
19497
 
19498
    /** Returns true if field voucherCode is set (has been assigned a value) and false otherwise */
19499
    public boolean isSetVoucherCode() {
19500
      return this.voucherCode != null;
19501
    }
19502
 
19503
    public void setVoucherCodeIsSet(boolean value) {
19504
      if (!value) {
19505
        this.voucherCode = null;
19506
      }
19507
    }
19508
 
19509
    public long getRedeemedOn() {
19510
      return this.redeemedOn;
19511
    }
19512
 
19513
    public void setRedeemedOn(long redeemedOn) {
19514
      this.redeemedOn = redeemedOn;
19515
      setRedeemedOnIsSet(true);
19516
    }
19517
 
19518
    public void unsetRedeemedOn() {
19519
      __isset_bit_vector.clear(__REDEEMEDON_ISSET_ID);
19520
    }
19521
 
19522
    /** Returns true if field redeemedOn is set (has been assigned a value) and false otherwise */
19523
    public boolean isSetRedeemedOn() {
19524
      return __isset_bit_vector.get(__REDEEMEDON_ISSET_ID);
19525
    }
19526
 
19527
    public void setRedeemedOnIsSet(boolean value) {
19528
      __isset_bit_vector.set(__REDEEMEDON_ISSET_ID, value);
19529
    }
19530
 
19531
    public void setFieldValue(_Fields field, Object value) {
19532
      switch (field) {
19533
      case VOUCHER_CODE:
19534
        if (value == null) {
19535
          unsetVoucherCode();
19536
        } else {
19537
          setVoucherCode((String)value);
19538
        }
19539
        break;
19540
 
19541
      case REDEEMED_ON:
19542
        if (value == null) {
19543
          unsetRedeemedOn();
19544
        } else {
19545
          setRedeemedOn((Long)value);
19546
        }
19547
        break;
19548
 
19549
      }
19550
    }
19551
 
19552
    public Object getFieldValue(_Fields field) {
19553
      switch (field) {
19554
      case VOUCHER_CODE:
19555
        return getVoucherCode();
19556
 
19557
      case REDEEMED_ON:
19558
        return Long.valueOf(getRedeemedOn());
19559
 
19560
      }
19561
      throw new IllegalStateException();
19562
    }
19563
 
19564
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
19565
    public boolean isSet(_Fields field) {
19566
      if (field == null) {
19567
        throw new IllegalArgumentException();
19568
      }
19569
 
19570
      switch (field) {
19571
      case VOUCHER_CODE:
19572
        return isSetVoucherCode();
19573
      case REDEEMED_ON:
19574
        return isSetRedeemedOn();
19575
      }
19576
      throw new IllegalStateException();
19577
    }
19578
 
19579
    @Override
19580
    public boolean equals(Object that) {
19581
      if (that == null)
19582
        return false;
19583
      if (that instanceof markVoucherAsRedeemed_args)
19584
        return this.equals((markVoucherAsRedeemed_args)that);
19585
      return false;
19586
    }
19587
 
19588
    public boolean equals(markVoucherAsRedeemed_args that) {
19589
      if (that == null)
19590
        return false;
19591
 
19592
      boolean this_present_voucherCode = true && this.isSetVoucherCode();
19593
      boolean that_present_voucherCode = true && that.isSetVoucherCode();
19594
      if (this_present_voucherCode || that_present_voucherCode) {
19595
        if (!(this_present_voucherCode && that_present_voucherCode))
19596
          return false;
19597
        if (!this.voucherCode.equals(that.voucherCode))
19598
          return false;
19599
      }
19600
 
19601
      boolean this_present_redeemedOn = true;
19602
      boolean that_present_redeemedOn = true;
19603
      if (this_present_redeemedOn || that_present_redeemedOn) {
19604
        if (!(this_present_redeemedOn && that_present_redeemedOn))
19605
          return false;
19606
        if (this.redeemedOn != that.redeemedOn)
19607
          return false;
19608
      }
19609
 
19610
      return true;
19611
    }
19612
 
19613
    @Override
19614
    public int hashCode() {
19615
      return 0;
19616
    }
19617
 
19618
    public int compareTo(markVoucherAsRedeemed_args other) {
19619
      if (!getClass().equals(other.getClass())) {
19620
        return getClass().getName().compareTo(other.getClass().getName());
19621
      }
19622
 
19623
      int lastComparison = 0;
19624
      markVoucherAsRedeemed_args typedOther = (markVoucherAsRedeemed_args)other;
19625
 
19626
      lastComparison = Boolean.valueOf(isSetVoucherCode()).compareTo(typedOther.isSetVoucherCode());
19627
      if (lastComparison != 0) {
19628
        return lastComparison;
19629
      }
19630
      if (isSetVoucherCode()) {
19631
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherCode, typedOther.voucherCode);
19632
        if (lastComparison != 0) {
19633
          return lastComparison;
19634
        }
19635
      }
19636
      lastComparison = Boolean.valueOf(isSetRedeemedOn()).compareTo(typedOther.isSetRedeemedOn());
19637
      if (lastComparison != 0) {
19638
        return lastComparison;
19639
      }
19640
      if (isSetRedeemedOn()) {
19641
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.redeemedOn, typedOther.redeemedOn);
19642
        if (lastComparison != 0) {
19643
          return lastComparison;
19644
        }
19645
      }
19646
      return 0;
19647
    }
19648
 
19649
    public _Fields fieldForId(int fieldId) {
19650
      return _Fields.findByThriftId(fieldId);
19651
    }
19652
 
19653
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
19654
      org.apache.thrift.protocol.TField field;
19655
      iprot.readStructBegin();
19656
      while (true)
19657
      {
19658
        field = iprot.readFieldBegin();
19659
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
19660
          break;
19661
        }
19662
        switch (field.id) {
19663
          case 1: // VOUCHER_CODE
19664
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
19665
              this.voucherCode = iprot.readString();
19666
            } else { 
19667
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19668
            }
19669
            break;
19670
          case 2: // REDEEMED_ON
19671
            if (field.type == org.apache.thrift.protocol.TType.I64) {
19672
              this.redeemedOn = iprot.readI64();
19673
              setRedeemedOnIsSet(true);
19674
            } else { 
19675
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19676
            }
19677
            break;
19678
          default:
19679
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19680
        }
19681
        iprot.readFieldEnd();
19682
      }
19683
      iprot.readStructEnd();
19684
      validate();
19685
    }
19686
 
19687
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
19688
      validate();
19689
 
19690
      oprot.writeStructBegin(STRUCT_DESC);
19691
      if (this.voucherCode != null) {
19692
        oprot.writeFieldBegin(VOUCHER_CODE_FIELD_DESC);
19693
        oprot.writeString(this.voucherCode);
19694
        oprot.writeFieldEnd();
19695
      }
19696
      oprot.writeFieldBegin(REDEEMED_ON_FIELD_DESC);
19697
      oprot.writeI64(this.redeemedOn);
19698
      oprot.writeFieldEnd();
19699
      oprot.writeFieldStop();
19700
      oprot.writeStructEnd();
19701
    }
19702
 
19703
    @Override
19704
    public String toString() {
19705
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_args(");
19706
      boolean first = true;
19707
 
19708
      sb.append("voucherCode:");
19709
      if (this.voucherCode == null) {
19710
        sb.append("null");
19711
      } else {
19712
        sb.append(this.voucherCode);
19713
      }
19714
      first = false;
19715
      if (!first) sb.append(", ");
19716
      sb.append("redeemedOn:");
19717
      sb.append(this.redeemedOn);
19718
      first = false;
19719
      sb.append(")");
19720
      return sb.toString();
19721
    }
19722
 
19723
    public void validate() throws org.apache.thrift.TException {
19724
      // check for required fields
19725
    }
19726
 
19727
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
19728
      try {
19729
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
19730
      } catch (org.apache.thrift.TException te) {
19731
        throw new java.io.IOException(te);
19732
      }
19733
    }
19734
 
19735
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
19736
      try {
19737
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
19738
        __isset_bit_vector = new BitSet(1);
19739
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
19740
      } catch (org.apache.thrift.TException te) {
19741
        throw new java.io.IOException(te);
19742
      }
19743
    }
19744
 
19745
  }
19746
 
19747
  public static class markVoucherAsRedeemed_result implements org.apache.thrift.TBase<markVoucherAsRedeemed_result, markVoucherAsRedeemed_result._Fields>, java.io.Serializable, Cloneable   {
19748
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_result");
19749
 
19750
    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);
19751
 
19752
    private boolean success; // required
19753
 
19754
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
19755
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
19756
      SUCCESS((short)0, "success");
19757
 
19758
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
19759
 
19760
      static {
19761
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
19762
          byName.put(field.getFieldName(), field);
19763
        }
19764
      }
19765
 
19766
      /**
19767
       * Find the _Fields constant that matches fieldId, or null if its not found.
19768
       */
19769
      public static _Fields findByThriftId(int fieldId) {
19770
        switch(fieldId) {
19771
          case 0: // SUCCESS
19772
            return SUCCESS;
19773
          default:
19774
            return null;
19775
        }
19776
      }
19777
 
19778
      /**
19779
       * Find the _Fields constant that matches fieldId, throwing an exception
19780
       * if it is not found.
19781
       */
19782
      public static _Fields findByThriftIdOrThrow(int fieldId) {
19783
        _Fields fields = findByThriftId(fieldId);
19784
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
19785
        return fields;
19786
      }
19787
 
19788
      /**
19789
       * Find the _Fields constant that matches name, or null if its not found.
19790
       */
19791
      public static _Fields findByName(String name) {
19792
        return byName.get(name);
19793
      }
19794
 
19795
      private final short _thriftId;
19796
      private final String _fieldName;
19797
 
19798
      _Fields(short thriftId, String fieldName) {
19799
        _thriftId = thriftId;
19800
        _fieldName = fieldName;
19801
      }
19802
 
19803
      public short getThriftFieldId() {
19804
        return _thriftId;
19805
      }
19806
 
19807
      public String getFieldName() {
19808
        return _fieldName;
19809
      }
19810
    }
19811
 
19812
    // isset id assignments
19813
    private static final int __SUCCESS_ISSET_ID = 0;
19814
    private BitSet __isset_bit_vector = new BitSet(1);
19815
 
19816
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
19817
    static {
19818
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
19819
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
19820
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
19821
      metaDataMap = Collections.unmodifiableMap(tmpMap);
19822
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_result.class, metaDataMap);
19823
    }
19824
 
19825
    public markVoucherAsRedeemed_result() {
19826
    }
19827
 
19828
    public markVoucherAsRedeemed_result(
19829
      boolean success)
19830
    {
19831
      this();
19832
      this.success = success;
19833
      setSuccessIsSet(true);
19834
    }
19835
 
19836
    /**
19837
     * Performs a deep copy on <i>other</i>.
19838
     */
19839
    public markVoucherAsRedeemed_result(markVoucherAsRedeemed_result other) {
19840
      __isset_bit_vector.clear();
19841
      __isset_bit_vector.or(other.__isset_bit_vector);
19842
      this.success = other.success;
19843
    }
19844
 
19845
    public markVoucherAsRedeemed_result deepCopy() {
19846
      return new markVoucherAsRedeemed_result(this);
19847
    }
19848
 
19849
    @Override
19850
    public void clear() {
19851
      setSuccessIsSet(false);
19852
      this.success = false;
19853
    }
19854
 
19855
    public boolean isSuccess() {
19856
      return this.success;
19857
    }
19858
 
19859
    public void setSuccess(boolean success) {
19860
      this.success = success;
19861
      setSuccessIsSet(true);
19862
    }
19863
 
19864
    public void unsetSuccess() {
19865
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
19866
    }
19867
 
19868
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
19869
    public boolean isSetSuccess() {
19870
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
19871
    }
19872
 
19873
    public void setSuccessIsSet(boolean value) {
19874
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
19875
    }
19876
 
19877
    public void setFieldValue(_Fields field, Object value) {
19878
      switch (field) {
19879
      case SUCCESS:
19880
        if (value == null) {
19881
          unsetSuccess();
19882
        } else {
19883
          setSuccess((Boolean)value);
19884
        }
19885
        break;
19886
 
19887
      }
19888
    }
19889
 
19890
    public Object getFieldValue(_Fields field) {
19891
      switch (field) {
19892
      case SUCCESS:
19893
        return Boolean.valueOf(isSuccess());
19894
 
19895
      }
19896
      throw new IllegalStateException();
19897
    }
19898
 
19899
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
19900
    public boolean isSet(_Fields field) {
19901
      if (field == null) {
19902
        throw new IllegalArgumentException();
19903
      }
19904
 
19905
      switch (field) {
19906
      case SUCCESS:
19907
        return isSetSuccess();
19908
      }
19909
      throw new IllegalStateException();
19910
    }
19911
 
19912
    @Override
19913
    public boolean equals(Object that) {
19914
      if (that == null)
19915
        return false;
19916
      if (that instanceof markVoucherAsRedeemed_result)
19917
        return this.equals((markVoucherAsRedeemed_result)that);
19918
      return false;
19919
    }
19920
 
19921
    public boolean equals(markVoucherAsRedeemed_result that) {
19922
      if (that == null)
19923
        return false;
19924
 
19925
      boolean this_present_success = true;
19926
      boolean that_present_success = true;
19927
      if (this_present_success || that_present_success) {
19928
        if (!(this_present_success && that_present_success))
19929
          return false;
19930
        if (this.success != that.success)
19931
          return false;
19932
      }
19933
 
19934
      return true;
19935
    }
19936
 
19937
    @Override
19938
    public int hashCode() {
19939
      return 0;
19940
    }
19941
 
19942
    public int compareTo(markVoucherAsRedeemed_result other) {
19943
      if (!getClass().equals(other.getClass())) {
19944
        return getClass().getName().compareTo(other.getClass().getName());
19945
      }
19946
 
19947
      int lastComparison = 0;
19948
      markVoucherAsRedeemed_result typedOther = (markVoucherAsRedeemed_result)other;
19949
 
19950
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
19951
      if (lastComparison != 0) {
19952
        return lastComparison;
19953
      }
19954
      if (isSetSuccess()) {
19955
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
19956
        if (lastComparison != 0) {
19957
          return lastComparison;
19958
        }
19959
      }
19960
      return 0;
19961
    }
19962
 
19963
    public _Fields fieldForId(int fieldId) {
19964
      return _Fields.findByThriftId(fieldId);
19965
    }
19966
 
19967
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
19968
      org.apache.thrift.protocol.TField field;
19969
      iprot.readStructBegin();
19970
      while (true)
19971
      {
19972
        field = iprot.readFieldBegin();
19973
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
19974
          break;
19975
        }
19976
        switch (field.id) {
19977
          case 0: // SUCCESS
19978
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
19979
              this.success = iprot.readBool();
19980
              setSuccessIsSet(true);
19981
            } else { 
19982
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19983
            }
19984
            break;
19985
          default:
19986
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19987
        }
19988
        iprot.readFieldEnd();
19989
      }
19990
      iprot.readStructEnd();
19991
      validate();
19992
    }
19993
 
19994
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
19995
      oprot.writeStructBegin(STRUCT_DESC);
19996
 
19997
      if (this.isSetSuccess()) {
19998
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
19999
        oprot.writeBool(this.success);
20000
        oprot.writeFieldEnd();
20001
      }
20002
      oprot.writeFieldStop();
20003
      oprot.writeStructEnd();
20004
    }
20005
 
20006
    @Override
20007
    public String toString() {
20008
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_result(");
20009
      boolean first = true;
20010
 
20011
      sb.append("success:");
20012
      sb.append(this.success);
20013
      first = false;
20014
      sb.append(")");
20015
      return sb.toString();
20016
    }
20017
 
20018
    public void validate() throws org.apache.thrift.TException {
20019
      // check for required fields
20020
    }
20021
 
20022
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
20023
      try {
20024
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
20025
      } catch (org.apache.thrift.TException te) {
20026
        throw new java.io.IOException(te);
20027
      }
20028
    }
20029
 
20030
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
20031
      try {
20032
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
20033
      } catch (org.apache.thrift.TException te) {
20034
        throw new java.io.IOException(te);
20035
      }
20036
    }
20037
 
20038
  }
20039
 
1982 varun.gupt 20040
}