Subversion Repositories SmartDukaan

Rev

Rev 22359 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1982 varun.gupt 1
/**
3430 rajveer 2
 * Autogenerated by Thrift Compiler (0.7.0)
1982 varun.gupt 3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.model.v1.user;
7
 
8
import java.util.List;
9
import java.util.ArrayList;
10
import java.util.Map;
11
import java.util.HashMap;
12
import java.util.EnumMap;
13
import java.util.Set;
14
import java.util.HashSet;
15
import java.util.EnumSet;
16
import java.util.Collections;
17
import java.util.BitSet;
3430 rajveer 18
import java.nio.ByteBuffer;
1982 varun.gupt 19
import java.util.Arrays;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22
 
23
public class PromotionService {
24
 
25
  /**
26
   * Promotion Service
27
   */
3374 rajveer 28
  public interface Iface extends in.shop2020.generic.GenericService.Iface {
1982 varun.gupt 29
 
3430 rajveer 30
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 31
 
7746 amit.gupta 32
    public long removeAllCouponsByPromotionId(long promotionId) throws PromotionException, org.apache.thrift.TException;
33
 
6301 amit.gupta 34
    public Coupon getCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
35
 
36
    public boolean isGiftVoucher(String couponCode) throws PromotionException, org.apache.thrift.TException;
37
 
11819 amit.gupta 38
    public boolean isCodApplicable(Cart cart) throws PromotionException, org.apache.thrift.TException;
6356 amit.gupta 39
 
3430 rajveer 40
    public List<Promotion> getAllPromotions() throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 41
 
3430 rajveer 42
    public Promotion getPromotionById(long promotionId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 43
 
3430 rajveer 44
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 45
 
3430 rajveer 46
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 47
 
6736 amit.gupta 48
    public Map<Long,Double> getEmiDiscount(long cartId) throws PromotionException, org.apache.thrift.TException;
49
 
6433 anupam.sin 50
    public Map<Long,String> applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws PromotionException, org.apache.thrift.TException;
51
 
13521 amit.gupta 52
    public void trackCouponUsage(String couponCode, long transactionId, long userId, long amount, boolean isDigital) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 53
 
3430 rajveer 54
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 55
 
6497 amit.gupta 56
    public List<Coupon> getActiveCodes(long promotionId) throws PromotionException, org.apache.thrift.TException;
57
 
58
    public void deleteCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
59
 
7092 amit.gupta 60
    public List<Coupon> getAllCouponsByPromotionId(long promotionId) throws PromotionException, org.apache.thrift.TException;
61
 
3385 varun.gupt 62
    /**
63
     * Returns a list of active coupons
64
     */
3430 rajveer 65
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException;
3385 varun.gupt 66
 
67
    /**
6561 amit.gupta 68
     * Creates a coupon with prefix (optional, pass null)and returns couponcode if successfully created.
6250 amit.gupta 69
     * 
70
     * @param promotionId
8707 manish.sha 71
     * @param couponCategory
6730 anupam.sin 72
     * @param couponCode
6679 anupam.sin 73
     * @param arguments
6356 amit.gupta 74
     * @param isCod
6561 amit.gupta 75
     * @param prefix
6250 amit.gupta 76
     */
8707 manish.sha 77
    public String createCoupon(long promotionId, long couponCategory, String couponCode, String arguments, boolean isCod, String prefix) throws PromotionException, org.apache.thrift.TException;
6250 amit.gupta 78
 
79
    /**
3385 varun.gupt 80
     * Returns the count of successful payments done using a given coupon
81
     * 
82
     * @param couponCode
83
     */
3430 rajveer 84
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
3385 varun.gupt 85
 
86
    /**
87
     * Returns the doc string of the rule module
88
     * 
89
     * @param ruleName
90
     */
3430 rajveer 91
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException;
3385 varun.gupt 92
 
4189 varun.gupt 93
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException;
94
 
4494 varun.gupt 95
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException;
96
 
5469 rajveer 97
    public void addVoucher(Voucher voucher) throws org.apache.thrift.TException;
98
 
99
    public Voucher assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException;
100
 
101
    public boolean markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException;
102
 
1982 varun.gupt 103
  }
104
 
3430 rajveer 105
  public interface AsyncIface extends in.shop2020.generic.GenericService .AsyncIface {
1982 varun.gupt 106
 
3430 rajveer 107
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.createPromotion_call> resultHandler) throws org.apache.thrift.TException;
1982 varun.gupt 108
 
7746 amit.gupta 109
    public void removeAllCouponsByPromotionId(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.removeAllCouponsByPromotionId_call> resultHandler) throws org.apache.thrift.TException;
110
 
6301 amit.gupta 111
    public void getCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCoupon_call> resultHandler) throws org.apache.thrift.TException;
112
 
113
    public void isGiftVoucher(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.isGiftVoucher_call> resultHandler) throws org.apache.thrift.TException;
114
 
11819 amit.gupta 115
    public void isCodApplicable(Cart cart, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.isCodApplicable_call> resultHandler) throws org.apache.thrift.TException;
6356 amit.gupta 116
 
3430 rajveer 117
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllPromotions_call> resultHandler) throws org.apache.thrift.TException;
118
 
119
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPromotionById_call> resultHandler) throws org.apache.thrift.TException;
120
 
121
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException;
122
 
123
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyCoupon_call> resultHandler) throws org.apache.thrift.TException;
124
 
6736 amit.gupta 125
    public void getEmiDiscount(long cartId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getEmiDiscount_call> resultHandler) throws org.apache.thrift.TException;
126
 
6433 anupam.sin 127
    public void applyRechargeCoupon(String couponCode, long totalAmount, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyRechargeCoupon_call> resultHandler) throws org.apache.thrift.TException;
128
 
13521 amit.gupta 129
    public void trackCouponUsage(String couponCode, long transactionId, long userId, long amount, boolean isDigital, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException;
3430 rajveer 130
 
131
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException;
132
 
6497 amit.gupta 133
    public void getActiveCodes(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getActiveCodes_call> resultHandler) throws org.apache.thrift.TException;
134
 
135
    public void deleteCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.deleteCoupon_call> resultHandler) throws org.apache.thrift.TException;
136
 
7092 amit.gupta 137
    public void getAllCouponsByPromotionId(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllCouponsByPromotionId_call> resultHandler) throws org.apache.thrift.TException;
138
 
3430 rajveer 139
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException;
140
 
8707 manish.sha 141
    public void createCoupon(long promotionId, long couponCategory, String couponCode, String arguments, boolean isCod, String prefix, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.createCoupon_call> resultHandler) throws org.apache.thrift.TException;
6250 amit.gupta 142
 
3430 rajveer 143
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException;
144
 
145
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getRuleDocString_call> resultHandler) throws org.apache.thrift.TException;
146
 
4189 varun.gupt 147
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException;
148
 
4494 varun.gupt 149
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException;
150
 
5469 rajveer 151
    public void addVoucher(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.addVoucher_call> resultHandler) throws org.apache.thrift.TException;
152
 
153
    public void assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.assignVoucher_call> resultHandler) throws org.apache.thrift.TException;
154
 
155
    public void markVoucherAsRedeemed(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.markVoucherAsRedeemed_call> resultHandler) throws org.apache.thrift.TException;
156
 
3430 rajveer 157
  }
158
 
159
  public static class Client extends in.shop2020.generic.GenericService.Client implements Iface {
160
    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
161
      public Factory() {}
162
      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
163
        return new Client(prot);
164
      }
165
      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
166
        return new Client(iprot, oprot);
167
      }
1982 varun.gupt 168
    }
169
 
3430 rajveer 170
    public Client(org.apache.thrift.protocol.TProtocol prot)
1982 varun.gupt 171
    {
3430 rajveer 172
      super(prot, prot);
1982 varun.gupt 173
    }
174
 
3430 rajveer 175
    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
176
      super(iprot, oprot);
1982 varun.gupt 177
    }
178
 
3430 rajveer 179
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 180
    {
181
      send_createPromotion(name, ruleExecutionSrc, startOn, endOn);
182
      recv_createPromotion();
183
    }
184
 
3430 rajveer 185
    public void send_createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws org.apache.thrift.TException
1982 varun.gupt 186
    {
187
      createPromotion_args args = new createPromotion_args();
3430 rajveer 188
      args.setName(name);
189
      args.setRuleExecutionSrc(ruleExecutionSrc);
190
      args.setStartOn(startOn);
191
      args.setEndOn(endOn);
192
      sendBase("createPromotion", args);
1982 varun.gupt 193
    }
194
 
3430 rajveer 195
    public void recv_createPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 196
    {
197
      createPromotion_result result = new createPromotion_result();
3430 rajveer 198
      receiveBase(result, "createPromotion");
1982 varun.gupt 199
      if (result.pex != null) {
200
        throw result.pex;
201
      }
202
      return;
203
    }
204
 
7746 amit.gupta 205
    public long removeAllCouponsByPromotionId(long promotionId) throws PromotionException, org.apache.thrift.TException
206
    {
207
      send_removeAllCouponsByPromotionId(promotionId);
208
      return recv_removeAllCouponsByPromotionId();
209
    }
210
 
211
    public void send_removeAllCouponsByPromotionId(long promotionId) throws org.apache.thrift.TException
212
    {
213
      removeAllCouponsByPromotionId_args args = new removeAllCouponsByPromotionId_args();
214
      args.setPromotionId(promotionId);
215
      sendBase("removeAllCouponsByPromotionId", args);
216
    }
217
 
218
    public long recv_removeAllCouponsByPromotionId() throws PromotionException, org.apache.thrift.TException
219
    {
220
      removeAllCouponsByPromotionId_result result = new removeAllCouponsByPromotionId_result();
221
      receiveBase(result, "removeAllCouponsByPromotionId");
222
      if (result.isSetSuccess()) {
223
        return result.success;
224
      }
225
      if (result.pex != null) {
226
        throw result.pex;
227
      }
228
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "removeAllCouponsByPromotionId failed: unknown result");
229
    }
230
 
6301 amit.gupta 231
    public Coupon getCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
232
    {
233
      send_getCoupon(couponCode);
234
      return recv_getCoupon();
235
    }
236
 
237
    public void send_getCoupon(String couponCode) throws org.apache.thrift.TException
238
    {
239
      getCoupon_args args = new getCoupon_args();
240
      args.setCouponCode(couponCode);
241
      sendBase("getCoupon", args);
242
    }
243
 
244
    public Coupon recv_getCoupon() throws PromotionException, org.apache.thrift.TException
245
    {
246
      getCoupon_result result = new getCoupon_result();
247
      receiveBase(result, "getCoupon");
248
      if (result.isSetSuccess()) {
249
        return result.success;
250
      }
251
      if (result.pex != null) {
252
        throw result.pex;
253
      }
254
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCoupon failed: unknown result");
255
    }
256
 
257
    public boolean isGiftVoucher(String couponCode) throws PromotionException, org.apache.thrift.TException
258
    {
259
      send_isGiftVoucher(couponCode);
260
      return recv_isGiftVoucher();
261
    }
262
 
263
    public void send_isGiftVoucher(String couponCode) throws org.apache.thrift.TException
264
    {
265
      isGiftVoucher_args args = new isGiftVoucher_args();
266
      args.setCouponCode(couponCode);
267
      sendBase("isGiftVoucher", args);
268
    }
269
 
270
    public boolean recv_isGiftVoucher() throws PromotionException, org.apache.thrift.TException
271
    {
272
      isGiftVoucher_result result = new isGiftVoucher_result();
273
      receiveBase(result, "isGiftVoucher");
274
      if (result.isSetSuccess()) {
275
        return result.success;
276
      }
277
      if (result.pex != null) {
278
        throw result.pex;
279
      }
280
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isGiftVoucher failed: unknown result");
281
    }
282
 
11819 amit.gupta 283
    public boolean isCodApplicable(Cart cart) throws PromotionException, org.apache.thrift.TException
6356 amit.gupta 284
    {
11819 amit.gupta 285
      send_isCodApplicable(cart);
6356 amit.gupta 286
      return recv_isCodApplicable();
287
    }
288
 
11819 amit.gupta 289
    public void send_isCodApplicable(Cart cart) throws org.apache.thrift.TException
6356 amit.gupta 290
    {
291
      isCodApplicable_args args = new isCodApplicable_args();
11819 amit.gupta 292
      args.setCart(cart);
6356 amit.gupta 293
      sendBase("isCodApplicable", args);
294
    }
295
 
296
    public boolean recv_isCodApplicable() throws PromotionException, org.apache.thrift.TException
297
    {
298
      isCodApplicable_result result = new isCodApplicable_result();
299
      receiveBase(result, "isCodApplicable");
300
      if (result.isSetSuccess()) {
301
        return result.success;
302
      }
303
      if (result.pex != null) {
304
        throw result.pex;
305
      }
306
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isCodApplicable failed: unknown result");
307
    }
308
 
3430 rajveer 309
    public List<Promotion> getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 310
    {
311
      send_getAllPromotions();
312
      return recv_getAllPromotions();
313
    }
314
 
3430 rajveer 315
    public void send_getAllPromotions() throws org.apache.thrift.TException
1982 varun.gupt 316
    {
317
      getAllPromotions_args args = new getAllPromotions_args();
3430 rajveer 318
      sendBase("getAllPromotions", args);
1982 varun.gupt 319
    }
320
 
3430 rajveer 321
    public List<Promotion> recv_getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 322
    {
323
      getAllPromotions_result result = new getAllPromotions_result();
3430 rajveer 324
      receiveBase(result, "getAllPromotions");
1982 varun.gupt 325
      if (result.isSetSuccess()) {
326
        return result.success;
327
      }
328
      if (result.pex != null) {
329
        throw result.pex;
330
      }
3430 rajveer 331
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllPromotions failed: unknown result");
1982 varun.gupt 332
    }
333
 
3430 rajveer 334
    public Promotion getPromotionById(long promotionId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 335
    {
336
      send_getPromotionById(promotionId);
337
      return recv_getPromotionById();
338
    }
339
 
3430 rajveer 340
    public void send_getPromotionById(long promotionId) throws org.apache.thrift.TException
1982 varun.gupt 341
    {
342
      getPromotionById_args args = new getPromotionById_args();
3430 rajveer 343
      args.setPromotionId(promotionId);
344
      sendBase("getPromotionById", args);
1982 varun.gupt 345
    }
346
 
3430 rajveer 347
    public Promotion recv_getPromotionById() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 348
    {
349
      getPromotionById_result result = new getPromotionById_result();
3430 rajveer 350
      receiveBase(result, "getPromotionById");
1982 varun.gupt 351
      if (result.isSetSuccess()) {
352
        return result.success;
353
      }
354
      if (result.pex != null) {
355
        throw result.pex;
356
      }
3430 rajveer 357
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPromotionById failed: unknown result");
1982 varun.gupt 358
    }
359
 
3430 rajveer 360
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 361
    {
362
      send_generateCouponsForPromotion(promotionId, couponCode);
363
      recv_generateCouponsForPromotion();
364
    }
365
 
3430 rajveer 366
    public void send_generateCouponsForPromotion(long promotionId, String couponCode) throws org.apache.thrift.TException
1982 varun.gupt 367
    {
368
      generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
3430 rajveer 369
      args.setPromotionId(promotionId);
370
      args.setCouponCode(couponCode);
371
      sendBase("generateCouponsForPromotion", args);
1982 varun.gupt 372
    }
373
 
3430 rajveer 374
    public void recv_generateCouponsForPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 375
    {
376
      generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
3430 rajveer 377
      receiveBase(result, "generateCouponsForPromotion");
1982 varun.gupt 378
      if (result.pex != null) {
379
        throw result.pex;
380
      }
381
      return;
382
    }
383
 
3430 rajveer 384
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 385
    {
386
      send_applyCoupon(couponCode, cartId);
387
      return recv_applyCoupon();
388
    }
389
 
3430 rajveer 390
    public void send_applyCoupon(String couponCode, long cartId) throws org.apache.thrift.TException
1982 varun.gupt 391
    {
392
      applyCoupon_args args = new applyCoupon_args();
3430 rajveer 393
      args.setCouponCode(couponCode);
394
      args.setCartId(cartId);
395
      sendBase("applyCoupon", args);
1982 varun.gupt 396
    }
397
 
3430 rajveer 398
    public Cart recv_applyCoupon() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 399
    {
400
      applyCoupon_result result = new applyCoupon_result();
3430 rajveer 401
      receiveBase(result, "applyCoupon");
1982 varun.gupt 402
      if (result.isSetSuccess()) {
403
        return result.success;
404
      }
405
      if (result.pex != null) {
406
        throw result.pex;
407
      }
3430 rajveer 408
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "applyCoupon failed: unknown result");
1982 varun.gupt 409
    }
410
 
6736 amit.gupta 411
    public Map<Long,Double> getEmiDiscount(long cartId) throws PromotionException, org.apache.thrift.TException
412
    {
413
      send_getEmiDiscount(cartId);
414
      return recv_getEmiDiscount();
415
    }
416
 
417
    public void send_getEmiDiscount(long cartId) throws org.apache.thrift.TException
418
    {
419
      getEmiDiscount_args args = new getEmiDiscount_args();
420
      args.setCartId(cartId);
421
      sendBase("getEmiDiscount", args);
422
    }
423
 
424
    public Map<Long,Double> recv_getEmiDiscount() throws PromotionException, org.apache.thrift.TException
425
    {
426
      getEmiDiscount_result result = new getEmiDiscount_result();
427
      receiveBase(result, "getEmiDiscount");
428
      if (result.isSetSuccess()) {
429
        return result.success;
430
      }
431
      if (result.pex != null) {
432
        throw result.pex;
433
      }
434
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getEmiDiscount failed: unknown result");
435
    }
436
 
6433 anupam.sin 437
    public Map<Long,String> applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws PromotionException, org.apache.thrift.TException
438
    {
439
      send_applyRechargeCoupon(couponCode, totalAmount, userId);
440
      return recv_applyRechargeCoupon();
441
    }
442
 
443
    public void send_applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws org.apache.thrift.TException
444
    {
445
      applyRechargeCoupon_args args = new applyRechargeCoupon_args();
446
      args.setCouponCode(couponCode);
447
      args.setTotalAmount(totalAmount);
448
      args.setUserId(userId);
449
      sendBase("applyRechargeCoupon", args);
450
    }
451
 
452
    public Map<Long,String> recv_applyRechargeCoupon() throws PromotionException, org.apache.thrift.TException
453
    {
454
      applyRechargeCoupon_result result = new applyRechargeCoupon_result();
455
      receiveBase(result, "applyRechargeCoupon");
456
      if (result.isSetSuccess()) {
457
        return result.success;
458
      }
459
      if (result.pex != null) {
460
        throw result.pex;
461
      }
462
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "applyRechargeCoupon failed: unknown result");
463
    }
464
 
13521 amit.gupta 465
    public void trackCouponUsage(String couponCode, long transactionId, long userId, long amount, boolean isDigital) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 466
    {
13521 amit.gupta 467
      send_trackCouponUsage(couponCode, transactionId, userId, amount, isDigital);
1982 varun.gupt 468
      recv_trackCouponUsage();
469
    }
470
 
13521 amit.gupta 471
    public void send_trackCouponUsage(String couponCode, long transactionId, long userId, long amount, boolean isDigital) throws org.apache.thrift.TException
1982 varun.gupt 472
    {
473
      trackCouponUsage_args args = new trackCouponUsage_args();
3430 rajveer 474
      args.setCouponCode(couponCode);
475
      args.setTransactionId(transactionId);
476
      args.setUserId(userId);
13521 amit.gupta 477
      args.setAmount(amount);
478
      args.setIsDigital(isDigital);
3430 rajveer 479
      sendBase("trackCouponUsage", args);
1982 varun.gupt 480
    }
481
 
3430 rajveer 482
    public void recv_trackCouponUsage() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 483
    {
484
      trackCouponUsage_result result = new trackCouponUsage_result();
3430 rajveer 485
      receiveBase(result, "trackCouponUsage");
1982 varun.gupt 486
      if (result.pex != null) {
487
        throw result.pex;
488
      }
489
      return;
490
    }
491
 
3430 rajveer 492
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 493
    {
494
      send_getCouponUsageCountByUser(couponCode, userId);
495
      return recv_getCouponUsageCountByUser();
496
    }
497
 
3430 rajveer 498
    public void send_getCouponUsageCountByUser(String couponCode, long userId) throws org.apache.thrift.TException
1982 varun.gupt 499
    {
500
      getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
3430 rajveer 501
      args.setCouponCode(couponCode);
502
      args.setUserId(userId);
503
      sendBase("getCouponUsageCountByUser", args);
1982 varun.gupt 504
    }
505
 
3430 rajveer 506
    public long recv_getCouponUsageCountByUser() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 507
    {
508
      getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
3430 rajveer 509
      receiveBase(result, "getCouponUsageCountByUser");
1982 varun.gupt 510
      if (result.isSetSuccess()) {
511
        return result.success;
512
      }
513
      if (result.pex != null) {
514
        throw result.pex;
515
      }
3430 rajveer 516
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCouponUsageCountByUser failed: unknown result");
1982 varun.gupt 517
    }
518
 
6497 amit.gupta 519
    public List<Coupon> getActiveCodes(long promotionId) throws PromotionException, org.apache.thrift.TException
520
    {
521
      send_getActiveCodes(promotionId);
522
      return recv_getActiveCodes();
523
    }
524
 
525
    public void send_getActiveCodes(long promotionId) throws org.apache.thrift.TException
526
    {
527
      getActiveCodes_args args = new getActiveCodes_args();
528
      args.setPromotionId(promotionId);
529
      sendBase("getActiveCodes", args);
530
    }
531
 
532
    public List<Coupon> recv_getActiveCodes() throws PromotionException, org.apache.thrift.TException
533
    {
534
      getActiveCodes_result result = new getActiveCodes_result();
535
      receiveBase(result, "getActiveCodes");
536
      if (result.isSetSuccess()) {
537
        return result.success;
538
      }
539
      if (result.pex != null) {
540
        throw result.pex;
541
      }
542
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getActiveCodes failed: unknown result");
543
    }
544
 
545
    public void deleteCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
546
    {
547
      send_deleteCoupon(couponCode);
548
      recv_deleteCoupon();
549
    }
550
 
551
    public void send_deleteCoupon(String couponCode) throws org.apache.thrift.TException
552
    {
553
      deleteCoupon_args args = new deleteCoupon_args();
554
      args.setCouponCode(couponCode);
555
      sendBase("deleteCoupon", args);
556
    }
557
 
558
    public void recv_deleteCoupon() throws PromotionException, org.apache.thrift.TException
559
    {
560
      deleteCoupon_result result = new deleteCoupon_result();
561
      receiveBase(result, "deleteCoupon");
562
      if (result.pex != null) {
563
        throw result.pex;
564
      }
565
      return;
566
    }
567
 
7092 amit.gupta 568
    public List<Coupon> getAllCouponsByPromotionId(long promotionId) throws PromotionException, org.apache.thrift.TException
569
    {
570
      send_getAllCouponsByPromotionId(promotionId);
571
      return recv_getAllCouponsByPromotionId();
572
    }
573
 
574
    public void send_getAllCouponsByPromotionId(long promotionId) throws org.apache.thrift.TException
575
    {
576
      getAllCouponsByPromotionId_args args = new getAllCouponsByPromotionId_args();
577
      args.setPromotionId(promotionId);
578
      sendBase("getAllCouponsByPromotionId", args);
579
    }
580
 
581
    public List<Coupon> recv_getAllCouponsByPromotionId() throws PromotionException, org.apache.thrift.TException
582
    {
583
      getAllCouponsByPromotionId_result result = new getAllCouponsByPromotionId_result();
584
      receiveBase(result, "getAllCouponsByPromotionId");
585
      if (result.isSetSuccess()) {
586
        return result.success;
587
      }
588
      if (result.pex != null) {
589
        throw result.pex;
590
      }
591
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllCouponsByPromotionId failed: unknown result");
592
    }
593
 
3430 rajveer 594
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 595
    {
596
      send_getActiveCoupons();
597
      return recv_getActiveCoupons();
598
    }
599
 
3430 rajveer 600
    public void send_getActiveCoupons() throws org.apache.thrift.TException
3385 varun.gupt 601
    {
602
      getActiveCoupons_args args = new getActiveCoupons_args();
3430 rajveer 603
      sendBase("getActiveCoupons", args);
3385 varun.gupt 604
    }
605
 
3430 rajveer 606
    public List<Coupon> recv_getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 607
    {
608
      getActiveCoupons_result result = new getActiveCoupons_result();
3430 rajveer 609
      receiveBase(result, "getActiveCoupons");
3385 varun.gupt 610
      if (result.isSetSuccess()) {
611
        return result.success;
612
      }
613
      if (result.pex != null) {
614
        throw result.pex;
615
      }
3430 rajveer 616
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getActiveCoupons failed: unknown result");
3385 varun.gupt 617
    }
618
 
8707 manish.sha 619
    public String createCoupon(long promotionId, long couponCategory, String couponCode, String arguments, boolean isCod, String prefix) throws PromotionException, org.apache.thrift.TException
6250 amit.gupta 620
    {
8707 manish.sha 621
      send_createCoupon(promotionId, couponCategory, couponCode, arguments, isCod, prefix);
6250 amit.gupta 622
      return recv_createCoupon();
623
    }
624
 
8707 manish.sha 625
    public void send_createCoupon(long promotionId, long couponCategory, String couponCode, String arguments, boolean isCod, String prefix) throws org.apache.thrift.TException
6250 amit.gupta 626
    {
627
      createCoupon_args args = new createCoupon_args();
628
      args.setPromotionId(promotionId);
8707 manish.sha 629
      args.setCouponCategory(couponCategory);
6730 anupam.sin 630
      args.setCouponCode(couponCode);
6679 anupam.sin 631
      args.setArguments(arguments);
6356 amit.gupta 632
      args.setIsCod(isCod);
6561 amit.gupta 633
      args.setPrefix(prefix);
6250 amit.gupta 634
      sendBase("createCoupon", args);
635
    }
636
 
637
    public String recv_createCoupon() throws PromotionException, org.apache.thrift.TException
638
    {
639
      createCoupon_result result = new createCoupon_result();
640
      receiveBase(result, "createCoupon");
641
      if (result.isSetSuccess()) {
642
        return result.success;
643
      }
644
      if (result.pex != null) {
645
        throw result.pex;
646
      }
647
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createCoupon failed: unknown result");
648
    }
649
 
3430 rajveer 650
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 651
    {
652
      send_getSuccessfulPaymentCountForCoupon(couponCode);
653
      return recv_getSuccessfulPaymentCountForCoupon();
654
    }
655
 
3430 rajveer 656
    public void send_getSuccessfulPaymentCountForCoupon(String couponCode) throws org.apache.thrift.TException
3385 varun.gupt 657
    {
658
      getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
3430 rajveer 659
      args.setCouponCode(couponCode);
660
      sendBase("getSuccessfulPaymentCountForCoupon", args);
3385 varun.gupt 661
    }
662
 
3430 rajveer 663
    public long recv_getSuccessfulPaymentCountForCoupon() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 664
    {
665
      getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
3430 rajveer 666
      receiveBase(result, "getSuccessfulPaymentCountForCoupon");
3385 varun.gupt 667
      if (result.isSetSuccess()) {
668
        return result.success;
669
      }
670
      if (result.pex != null) {
671
        throw result.pex;
672
      }
3430 rajveer 673
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSuccessfulPaymentCountForCoupon failed: unknown result");
3385 varun.gupt 674
    }
675
 
3430 rajveer 676
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 677
    {
678
      send_getRuleDocString(ruleName);
679
      return recv_getRuleDocString();
680
    }
681
 
3430 rajveer 682
    public void send_getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 683
    {
684
      getRuleDocString_args args = new getRuleDocString_args();
3430 rajveer 685
      args.setRuleName(ruleName);
686
      sendBase("getRuleDocString", args);
3385 varun.gupt 687
    }
688
 
3430 rajveer 689
    public String recv_getRuleDocString() throws org.apache.thrift.TException
3385 varun.gupt 690
    {
691
      getRuleDocString_result result = new getRuleDocString_result();
3430 rajveer 692
      receiveBase(result, "getRuleDocString");
3385 varun.gupt 693
      if (result.isSetSuccess()) {
694
        return result.success;
695
      }
3430 rajveer 696
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRuleDocString failed: unknown result");
3385 varun.gupt 697
    }
698
 
4189 varun.gupt 699
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException
700
    {
701
      send_getItemDiscountMap(itemIds);
702
      return recv_getItemDiscountMap();
703
    }
704
 
705
    public void send_getItemDiscountMap(List<Long> itemIds) throws org.apache.thrift.TException
706
    {
707
      getItemDiscountMap_args args = new getItemDiscountMap_args();
708
      args.setItemIds(itemIds);
709
      sendBase("getItemDiscountMap", args);
710
    }
711
 
712
    public List<ItemCouponDiscount> recv_getItemDiscountMap() throws PromotionException, org.apache.thrift.TException
713
    {
714
      getItemDiscountMap_result result = new getItemDiscountMap_result();
715
      receiveBase(result, "getItemDiscountMap");
716
      if (result.isSetSuccess()) {
717
        return result.success;
718
      }
719
      if (result.pex != null) {
720
        throw result.pex;
721
      }
722
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemDiscountMap failed: unknown result");
723
    }
724
 
4494 varun.gupt 725
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
726
    {
727
      send_getDiscountsForEntity(entityId);
728
      return recv_getDiscountsForEntity();
729
    }
730
 
731
    public void send_getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
732
    {
733
      getDiscountsForEntity_args args = new getDiscountsForEntity_args();
734
      args.setEntityId(entityId);
735
      sendBase("getDiscountsForEntity", args);
736
    }
737
 
738
    public Map<String,Double> recv_getDiscountsForEntity() throws org.apache.thrift.TException
739
    {
740
      getDiscountsForEntity_result result = new getDiscountsForEntity_result();
741
      receiveBase(result, "getDiscountsForEntity");
742
      if (result.isSetSuccess()) {
743
        return result.success;
744
      }
745
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getDiscountsForEntity failed: unknown result");
746
    }
747
 
5469 rajveer 748
    public void addVoucher(Voucher voucher) throws org.apache.thrift.TException
749
    {
750
      send_addVoucher(voucher);
751
      recv_addVoucher();
752
    }
753
 
754
    public void send_addVoucher(Voucher voucher) throws org.apache.thrift.TException
755
    {
756
      addVoucher_args args = new addVoucher_args();
757
      args.setVoucher(voucher);
758
      sendBase("addVoucher", args);
759
    }
760
 
761
    public void recv_addVoucher() throws org.apache.thrift.TException
762
    {
763
      addVoucher_result result = new addVoucher_result();
764
      receiveBase(result, "addVoucher");
765
      return;
766
    }
767
 
768
    public Voucher assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException
769
    {
770
      send_assignVoucher(userId, userEmail, voucherType, amount);
771
      return recv_assignVoucher();
772
    }
773
 
774
    public void send_assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException
775
    {
776
      assignVoucher_args args = new assignVoucher_args();
777
      args.setUserId(userId);
778
      args.setUserEmail(userEmail);
779
      args.setVoucherType(voucherType);
780
      args.setAmount(amount);
781
      sendBase("assignVoucher", args);
782
    }
783
 
784
    public Voucher recv_assignVoucher() throws org.apache.thrift.TException
785
    {
786
      assignVoucher_result result = new assignVoucher_result();
787
      receiveBase(result, "assignVoucher");
788
      if (result.isSetSuccess()) {
789
        return result.success;
790
      }
791
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "assignVoucher failed: unknown result");
792
    }
793
 
794
    public boolean markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException
795
    {
796
      send_markVoucherAsRedeemed(voucherCode, redeemedOn);
797
      return recv_markVoucherAsRedeemed();
798
    }
799
 
800
    public void send_markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException
801
    {
802
      markVoucherAsRedeemed_args args = new markVoucherAsRedeemed_args();
803
      args.setVoucherCode(voucherCode);
804
      args.setRedeemedOn(redeemedOn);
805
      sendBase("markVoucherAsRedeemed", args);
806
    }
807
 
808
    public boolean recv_markVoucherAsRedeemed() throws org.apache.thrift.TException
809
    {
810
      markVoucherAsRedeemed_result result = new markVoucherAsRedeemed_result();
811
      receiveBase(result, "markVoucherAsRedeemed");
812
      if (result.isSetSuccess()) {
813
        return result.success;
814
      }
815
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "markVoucherAsRedeemed failed: unknown result");
816
    }
817
 
1982 varun.gupt 818
  }
3430 rajveer 819
  public static class AsyncClient extends in.shop2020.generic.GenericService.AsyncClient implements AsyncIface {
820
    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
821
      private org.apache.thrift.async.TAsyncClientManager clientManager;
822
      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
823
      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
824
        this.clientManager = clientManager;
825
        this.protocolFactory = protocolFactory;
826
      }
827
      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
828
        return new AsyncClient(protocolFactory, clientManager, transport);
829
      }
1982 varun.gupt 830
    }
831
 
3430 rajveer 832
    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
833
      super(protocolFactory, clientManager, transport);
834
    }
1982 varun.gupt 835
 
3430 rajveer 836
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn, org.apache.thrift.async.AsyncMethodCallback<createPromotion_call> resultHandler) throws org.apache.thrift.TException {
837
      checkReady();
838
      createPromotion_call method_call = new createPromotion_call(name, ruleExecutionSrc, startOn, endOn, resultHandler, this, ___protocolFactory, ___transport);
839
      this.___currentMethod = method_call;
840
      ___manager.call(method_call);
1982 varun.gupt 841
    }
842
 
3430 rajveer 843
    public static class createPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
844
      private String name;
845
      private String ruleExecutionSrc;
846
      private long startOn;
847
      private long endOn;
848
      public createPromotion_call(String name, String ruleExecutionSrc, long startOn, long endOn, org.apache.thrift.async.AsyncMethodCallback<createPromotion_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
849
        super(client, protocolFactory, transport, resultHandler, false);
850
        this.name = name;
851
        this.ruleExecutionSrc = ruleExecutionSrc;
852
        this.startOn = startOn;
853
        this.endOn = endOn;
1982 varun.gupt 854
      }
855
 
3430 rajveer 856
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
857
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
1982 varun.gupt 858
        createPromotion_args args = new createPromotion_args();
3430 rajveer 859
        args.setName(name);
860
        args.setRuleExecutionSrc(ruleExecutionSrc);
861
        args.setStartOn(startOn);
862
        args.setEndOn(endOn);
863
        args.write(prot);
864
        prot.writeMessageEnd();
1982 varun.gupt 865
      }
866
 
3430 rajveer 867
      public void getResult() throws PromotionException, org.apache.thrift.TException {
868
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
869
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 870
        }
3430 rajveer 871
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
872
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
873
        (new Client(prot)).recv_createPromotion();
1982 varun.gupt 874
      }
3430 rajveer 875
    }
1982 varun.gupt 876
 
7746 amit.gupta 877
    public void removeAllCouponsByPromotionId(long promotionId, org.apache.thrift.async.AsyncMethodCallback<removeAllCouponsByPromotionId_call> resultHandler) throws org.apache.thrift.TException {
878
      checkReady();
879
      removeAllCouponsByPromotionId_call method_call = new removeAllCouponsByPromotionId_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
880
      this.___currentMethod = method_call;
881
      ___manager.call(method_call);
882
    }
883
 
884
    public static class removeAllCouponsByPromotionId_call extends org.apache.thrift.async.TAsyncMethodCall {
885
      private long promotionId;
886
      public removeAllCouponsByPromotionId_call(long promotionId, org.apache.thrift.async.AsyncMethodCallback<removeAllCouponsByPromotionId_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
887
        super(client, protocolFactory, transport, resultHandler, false);
888
        this.promotionId = promotionId;
889
      }
890
 
891
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
892
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("removeAllCouponsByPromotionId", org.apache.thrift.protocol.TMessageType.CALL, 0));
893
        removeAllCouponsByPromotionId_args args = new removeAllCouponsByPromotionId_args();
894
        args.setPromotionId(promotionId);
895
        args.write(prot);
896
        prot.writeMessageEnd();
897
      }
898
 
899
      public long getResult() throws PromotionException, org.apache.thrift.TException {
900
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
901
          throw new IllegalStateException("Method call not finished!");
902
        }
903
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
904
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
905
        return (new Client(prot)).recv_removeAllCouponsByPromotionId();
906
      }
907
    }
908
 
6301 amit.gupta 909
    public void getCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getCoupon_call> resultHandler) throws org.apache.thrift.TException {
910
      checkReady();
911
      getCoupon_call method_call = new getCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
912
      this.___currentMethod = method_call;
913
      ___manager.call(method_call);
914
    }
915
 
916
    public static class getCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
917
      private String couponCode;
918
      public getCoupon_call(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getCoupon_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
919
        super(client, protocolFactory, transport, resultHandler, false);
920
        this.couponCode = couponCode;
921
      }
922
 
923
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
924
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
925
        getCoupon_args args = new getCoupon_args();
926
        args.setCouponCode(couponCode);
927
        args.write(prot);
928
        prot.writeMessageEnd();
929
      }
930
 
931
      public Coupon getResult() throws PromotionException, org.apache.thrift.TException {
932
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
933
          throw new IllegalStateException("Method call not finished!");
934
        }
935
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
936
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
937
        return (new Client(prot)).recv_getCoupon();
938
      }
939
    }
940
 
941
    public void isGiftVoucher(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isGiftVoucher_call> resultHandler) throws org.apache.thrift.TException {
942
      checkReady();
943
      isGiftVoucher_call method_call = new isGiftVoucher_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
944
      this.___currentMethod = method_call;
945
      ___manager.call(method_call);
946
    }
947
 
948
    public static class isGiftVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
949
      private String couponCode;
950
      public isGiftVoucher_call(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isGiftVoucher_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
951
        super(client, protocolFactory, transport, resultHandler, false);
952
        this.couponCode = couponCode;
953
      }
954
 
955
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
956
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isGiftVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
957
        isGiftVoucher_args args = new isGiftVoucher_args();
958
        args.setCouponCode(couponCode);
959
        args.write(prot);
960
        prot.writeMessageEnd();
961
      }
962
 
963
      public boolean getResult() throws PromotionException, org.apache.thrift.TException {
964
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
965
          throw new IllegalStateException("Method call not finished!");
966
        }
967
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
968
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
969
        return (new Client(prot)).recv_isGiftVoucher();
970
      }
971
    }
972
 
11819 amit.gupta 973
    public void isCodApplicable(Cart cart, org.apache.thrift.async.AsyncMethodCallback<isCodApplicable_call> resultHandler) throws org.apache.thrift.TException {
6356 amit.gupta 974
      checkReady();
11819 amit.gupta 975
      isCodApplicable_call method_call = new isCodApplicable_call(cart, resultHandler, this, ___protocolFactory, ___transport);
6356 amit.gupta 976
      this.___currentMethod = method_call;
977
      ___manager.call(method_call);
978
    }
979
 
980
    public static class isCodApplicable_call extends org.apache.thrift.async.TAsyncMethodCall {
11819 amit.gupta 981
      private Cart cart;
982
      public isCodApplicable_call(Cart cart, org.apache.thrift.async.AsyncMethodCallback<isCodApplicable_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
6356 amit.gupta 983
        super(client, protocolFactory, transport, resultHandler, false);
11819 amit.gupta 984
        this.cart = cart;
6356 amit.gupta 985
      }
986
 
987
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
988
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isCodApplicable", org.apache.thrift.protocol.TMessageType.CALL, 0));
989
        isCodApplicable_args args = new isCodApplicable_args();
11819 amit.gupta 990
        args.setCart(cart);
6356 amit.gupta 991
        args.write(prot);
992
        prot.writeMessageEnd();
993
      }
994
 
995
      public boolean getResult() throws PromotionException, org.apache.thrift.TException {
996
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
997
          throw new IllegalStateException("Method call not finished!");
998
        }
999
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1000
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1001
        return (new Client(prot)).recv_isCodApplicable();
1002
      }
1003
    }
1004
 
3430 rajveer 1005
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<getAllPromotions_call> resultHandler) throws org.apache.thrift.TException {
1006
      checkReady();
1007
      getAllPromotions_call method_call = new getAllPromotions_call(resultHandler, this, ___protocolFactory, ___transport);
1008
      this.___currentMethod = method_call;
1009
      ___manager.call(method_call);
1982 varun.gupt 1010
    }
1011
 
3430 rajveer 1012
    public static class getAllPromotions_call extends org.apache.thrift.async.TAsyncMethodCall {
1013
      public getAllPromotions_call(org.apache.thrift.async.AsyncMethodCallback<getAllPromotions_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1014
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 1015
      }
1016
 
3430 rajveer 1017
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1018
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllPromotions", org.apache.thrift.protocol.TMessageType.CALL, 0));
1019
        getAllPromotions_args args = new getAllPromotions_args();
1020
        args.write(prot);
1021
        prot.writeMessageEnd();
1022
      }
1982 varun.gupt 1023
 
3430 rajveer 1024
      public List<Promotion> getResult() throws PromotionException, org.apache.thrift.TException {
1025
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1026
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 1027
        }
3430 rajveer 1028
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1029
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1030
        return (new Client(prot)).recv_getAllPromotions();
1982 varun.gupt 1031
      }
3430 rajveer 1032
    }
1982 varun.gupt 1033
 
3430 rajveer 1034
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getPromotionById_call> resultHandler) throws org.apache.thrift.TException {
1035
      checkReady();
1036
      getPromotionById_call method_call = new getPromotionById_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
1037
      this.___currentMethod = method_call;
1038
      ___manager.call(method_call);
1982 varun.gupt 1039
    }
1040
 
3430 rajveer 1041
    public static class getPromotionById_call extends org.apache.thrift.async.TAsyncMethodCall {
1042
      private long promotionId;
1043
      public getPromotionById_call(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getPromotionById_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1044
        super(client, protocolFactory, transport, resultHandler, false);
1045
        this.promotionId = promotionId;
1982 varun.gupt 1046
      }
1047
 
3430 rajveer 1048
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1049
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPromotionById", org.apache.thrift.protocol.TMessageType.CALL, 0));
1050
        getPromotionById_args args = new getPromotionById_args();
1051
        args.setPromotionId(promotionId);
1052
        args.write(prot);
1053
        prot.writeMessageEnd();
1054
      }
1982 varun.gupt 1055
 
3430 rajveer 1056
      public Promotion getResult() throws PromotionException, org.apache.thrift.TException {
1057
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1058
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 1059
        }
3430 rajveer 1060
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1061
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1062
        return (new Client(prot)).recv_getPromotionById();
1982 varun.gupt 1063
      }
3430 rajveer 1064
    }
1982 varun.gupt 1065
 
3430 rajveer 1066
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException {
1067
      checkReady();
1068
      generateCouponsForPromotion_call method_call = new generateCouponsForPromotion_call(promotionId, couponCode, resultHandler, this, ___protocolFactory, ___transport);
1069
      this.___currentMethod = method_call;
1070
      ___manager.call(method_call);
1982 varun.gupt 1071
    }
1072
 
3430 rajveer 1073
    public static class generateCouponsForPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
1074
      private long promotionId;
1075
      private String couponCode;
1076
      public generateCouponsForPromotion_call(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<generateCouponsForPromotion_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1077
        super(client, protocolFactory, transport, resultHandler, false);
1078
        this.promotionId = promotionId;
1079
        this.couponCode = couponCode;
1982 varun.gupt 1080
      }
1081
 
3430 rajveer 1082
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1083
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("generateCouponsForPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
1084
        generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
1085
        args.setPromotionId(promotionId);
1086
        args.setCouponCode(couponCode);
1087
        args.write(prot);
1088
        prot.writeMessageEnd();
3385 varun.gupt 1089
      }
1090
 
3430 rajveer 1091
      public void getResult() throws PromotionException, org.apache.thrift.TException {
1092
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1093
          throw new IllegalStateException("Method call not finished!");
3385 varun.gupt 1094
        }
3430 rajveer 1095
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1096
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1097
        (new Client(prot)).recv_generateCouponsForPromotion();
3385 varun.gupt 1098
      }
1099
    }
1100
 
3430 rajveer 1101
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<applyCoupon_call> resultHandler) throws org.apache.thrift.TException {
1102
      checkReady();
1103
      applyCoupon_call method_call = new applyCoupon_call(couponCode, cartId, resultHandler, this, ___protocolFactory, ___transport);
1104
      this.___currentMethod = method_call;
1105
      ___manager.call(method_call);
3385 varun.gupt 1106
    }
1107
 
3430 rajveer 1108
    public static class applyCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1109
      private String couponCode;
1110
      private long cartId;
1111
      public applyCoupon_call(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<applyCoupon_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1112
        super(client, protocolFactory, transport, resultHandler, false);
1113
        this.couponCode = couponCode;
1114
        this.cartId = cartId;
1982 varun.gupt 1115
      }
1116
 
3430 rajveer 1117
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1118
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("applyCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1119
        applyCoupon_args args = new applyCoupon_args();
1120
        args.setCouponCode(couponCode);
1121
        args.setCartId(cartId);
1122
        args.write(prot);
1123
        prot.writeMessageEnd();
1982 varun.gupt 1124
      }
1125
 
3430 rajveer 1126
      public Cart getResult() throws PromotionException, org.apache.thrift.TException {
1127
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1128
          throw new IllegalStateException("Method call not finished!");
1129
        }
1130
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1131
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1132
        return (new Client(prot)).recv_applyCoupon();
1982 varun.gupt 1133
      }
3430 rajveer 1134
    }
1982 varun.gupt 1135
 
6736 amit.gupta 1136
    public void getEmiDiscount(long cartId, org.apache.thrift.async.AsyncMethodCallback<getEmiDiscount_call> resultHandler) throws org.apache.thrift.TException {
1137
      checkReady();
1138
      getEmiDiscount_call method_call = new getEmiDiscount_call(cartId, resultHandler, this, ___protocolFactory, ___transport);
1139
      this.___currentMethod = method_call;
1140
      ___manager.call(method_call);
1141
    }
1142
 
1143
    public static class getEmiDiscount_call extends org.apache.thrift.async.TAsyncMethodCall {
1144
      private long cartId;
1145
      public getEmiDiscount_call(long cartId, org.apache.thrift.async.AsyncMethodCallback<getEmiDiscount_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1146
        super(client, protocolFactory, transport, resultHandler, false);
1147
        this.cartId = cartId;
1148
      }
1149
 
1150
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1151
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getEmiDiscount", org.apache.thrift.protocol.TMessageType.CALL, 0));
1152
        getEmiDiscount_args args = new getEmiDiscount_args();
1153
        args.setCartId(cartId);
1154
        args.write(prot);
1155
        prot.writeMessageEnd();
1156
      }
1157
 
1158
      public Map<Long,Double> getResult() throws PromotionException, org.apache.thrift.TException {
1159
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1160
          throw new IllegalStateException("Method call not finished!");
1161
        }
1162
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1163
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1164
        return (new Client(prot)).recv_getEmiDiscount();
1165
      }
1166
    }
1167
 
6433 anupam.sin 1168
    public void applyRechargeCoupon(String couponCode, long totalAmount, long userId, org.apache.thrift.async.AsyncMethodCallback<applyRechargeCoupon_call> resultHandler) throws org.apache.thrift.TException {
1169
      checkReady();
1170
      applyRechargeCoupon_call method_call = new applyRechargeCoupon_call(couponCode, totalAmount, userId, resultHandler, this, ___protocolFactory, ___transport);
1171
      this.___currentMethod = method_call;
1172
      ___manager.call(method_call);
1173
    }
1174
 
1175
    public static class applyRechargeCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1176
      private String couponCode;
1177
      private long totalAmount;
1178
      private long userId;
1179
      public applyRechargeCoupon_call(String couponCode, long totalAmount, long userId, org.apache.thrift.async.AsyncMethodCallback<applyRechargeCoupon_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1180
        super(client, protocolFactory, transport, resultHandler, false);
1181
        this.couponCode = couponCode;
1182
        this.totalAmount = totalAmount;
1183
        this.userId = userId;
1184
      }
1185
 
1186
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1187
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("applyRechargeCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1188
        applyRechargeCoupon_args args = new applyRechargeCoupon_args();
1189
        args.setCouponCode(couponCode);
1190
        args.setTotalAmount(totalAmount);
1191
        args.setUserId(userId);
1192
        args.write(prot);
1193
        prot.writeMessageEnd();
1194
      }
1195
 
1196
      public Map<Long,String> getResult() throws PromotionException, org.apache.thrift.TException {
1197
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1198
          throw new IllegalStateException("Method call not finished!");
1199
        }
1200
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1201
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1202
        return (new Client(prot)).recv_applyRechargeCoupon();
1203
      }
1204
    }
1205
 
13521 amit.gupta 1206
    public void trackCouponUsage(String couponCode, long transactionId, long userId, long amount, boolean isDigital, org.apache.thrift.async.AsyncMethodCallback<trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException {
3430 rajveer 1207
      checkReady();
13521 amit.gupta 1208
      trackCouponUsage_call method_call = new trackCouponUsage_call(couponCode, transactionId, userId, amount, isDigital, resultHandler, this, ___protocolFactory, ___transport);
3430 rajveer 1209
      this.___currentMethod = method_call;
1210
      ___manager.call(method_call);
1211
    }
1982 varun.gupt 1212
 
3430 rajveer 1213
    public static class trackCouponUsage_call extends org.apache.thrift.async.TAsyncMethodCall {
1214
      private String couponCode;
1215
      private long transactionId;
1216
      private long userId;
13521 amit.gupta 1217
      private long amount;
1218
      private boolean isDigital;
1219
      public trackCouponUsage_call(String couponCode, long transactionId, long userId, long amount, boolean isDigital, org.apache.thrift.async.AsyncMethodCallback<trackCouponUsage_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
3430 rajveer 1220
        super(client, protocolFactory, transport, resultHandler, false);
1221
        this.couponCode = couponCode;
1222
        this.transactionId = transactionId;
1223
        this.userId = userId;
13521 amit.gupta 1224
        this.amount = amount;
1225
        this.isDigital = isDigital;
1982 varun.gupt 1226
      }
1227
 
3430 rajveer 1228
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1229
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("trackCouponUsage", org.apache.thrift.protocol.TMessageType.CALL, 0));
1230
        trackCouponUsage_args args = new trackCouponUsage_args();
1231
        args.setCouponCode(couponCode);
1232
        args.setTransactionId(transactionId);
1233
        args.setUserId(userId);
13521 amit.gupta 1234
        args.setAmount(amount);
1235
        args.setIsDigital(isDigital);
3430 rajveer 1236
        args.write(prot);
1237
        prot.writeMessageEnd();
1982 varun.gupt 1238
      }
1239
 
3430 rajveer 1240
      public void getResult() throws PromotionException, org.apache.thrift.TException {
1241
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1242
          throw new IllegalStateException("Method call not finished!");
1243
        }
1244
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1245
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1246
        (new Client(prot)).recv_trackCouponUsage();
1982 varun.gupt 1247
      }
1248
    }
1249
 
3430 rajveer 1250
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException {
1251
      checkReady();
1252
      getCouponUsageCountByUser_call method_call = new getCouponUsageCountByUser_call(couponCode, userId, resultHandler, this, ___protocolFactory, ___transport);
1253
      this.___currentMethod = method_call;
1254
      ___manager.call(method_call);
1982 varun.gupt 1255
    }
1256
 
3430 rajveer 1257
    public static class getCouponUsageCountByUser_call extends org.apache.thrift.async.TAsyncMethodCall {
1258
      private String couponCode;
1259
      private long userId;
1260
      public getCouponUsageCountByUser_call(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<getCouponUsageCountByUser_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1261
        super(client, protocolFactory, transport, resultHandler, false);
1262
        this.couponCode = couponCode;
1263
        this.userId = userId;
1264
      }
1982 varun.gupt 1265
 
3430 rajveer 1266
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1267
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCouponUsageCountByUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
1268
        getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
1269
        args.setCouponCode(couponCode);
1270
        args.setUserId(userId);
1271
        args.write(prot);
1272
        prot.writeMessageEnd();
1273
      }
1982 varun.gupt 1274
 
3430 rajveer 1275
      public long getResult() throws PromotionException, org.apache.thrift.TException {
1276
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1277
          throw new IllegalStateException("Method call not finished!");
1278
        }
1279
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1280
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1281
        return (new Client(prot)).recv_getCouponUsageCountByUser();
1282
      }
1982 varun.gupt 1283
    }
1284
 
6497 amit.gupta 1285
    public void getActiveCodes(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getActiveCodes_call> resultHandler) throws org.apache.thrift.TException {
1286
      checkReady();
1287
      getActiveCodes_call method_call = new getActiveCodes_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
1288
      this.___currentMethod = method_call;
1289
      ___manager.call(method_call);
1290
    }
1291
 
1292
    public static class getActiveCodes_call extends org.apache.thrift.async.TAsyncMethodCall {
1293
      private long promotionId;
1294
      public getActiveCodes_call(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getActiveCodes_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1295
        super(client, protocolFactory, transport, resultHandler, false);
1296
        this.promotionId = promotionId;
1297
      }
1298
 
1299
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1300
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getActiveCodes", org.apache.thrift.protocol.TMessageType.CALL, 0));
1301
        getActiveCodes_args args = new getActiveCodes_args();
1302
        args.setPromotionId(promotionId);
1303
        args.write(prot);
1304
        prot.writeMessageEnd();
1305
      }
1306
 
1307
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
1308
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1309
          throw new IllegalStateException("Method call not finished!");
1310
        }
1311
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1312
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1313
        return (new Client(prot)).recv_getActiveCodes();
1314
      }
1315
    }
1316
 
1317
    public void deleteCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<deleteCoupon_call> resultHandler) throws org.apache.thrift.TException {
1318
      checkReady();
1319
      deleteCoupon_call method_call = new deleteCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
1320
      this.___currentMethod = method_call;
1321
      ___manager.call(method_call);
1322
    }
1323
 
1324
    public static class deleteCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1325
      private String couponCode;
1326
      public deleteCoupon_call(String couponCode, org.apache.thrift.async.AsyncMethodCallback<deleteCoupon_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1327
        super(client, protocolFactory, transport, resultHandler, false);
1328
        this.couponCode = couponCode;
1329
      }
1330
 
1331
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1332
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1333
        deleteCoupon_args args = new deleteCoupon_args();
1334
        args.setCouponCode(couponCode);
1335
        args.write(prot);
1336
        prot.writeMessageEnd();
1337
      }
1338
 
1339
      public void getResult() throws PromotionException, org.apache.thrift.TException {
1340
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1341
          throw new IllegalStateException("Method call not finished!");
1342
        }
1343
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1344
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1345
        (new Client(prot)).recv_deleteCoupon();
1346
      }
1347
    }
1348
 
7092 amit.gupta 1349
    public void getAllCouponsByPromotionId(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getAllCouponsByPromotionId_call> resultHandler) throws org.apache.thrift.TException {
1350
      checkReady();
1351
      getAllCouponsByPromotionId_call method_call = new getAllCouponsByPromotionId_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
1352
      this.___currentMethod = method_call;
1353
      ___manager.call(method_call);
1354
    }
1355
 
1356
    public static class getAllCouponsByPromotionId_call extends org.apache.thrift.async.TAsyncMethodCall {
1357
      private long promotionId;
1358
      public getAllCouponsByPromotionId_call(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getAllCouponsByPromotionId_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1359
        super(client, protocolFactory, transport, resultHandler, false);
1360
        this.promotionId = promotionId;
1361
      }
1362
 
1363
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1364
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllCouponsByPromotionId", org.apache.thrift.protocol.TMessageType.CALL, 0));
1365
        getAllCouponsByPromotionId_args args = new getAllCouponsByPromotionId_args();
1366
        args.setPromotionId(promotionId);
1367
        args.write(prot);
1368
        prot.writeMessageEnd();
1369
      }
1370
 
1371
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
1372
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1373
          throw new IllegalStateException("Method call not finished!");
1374
        }
1375
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1376
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1377
        return (new Client(prot)).recv_getAllCouponsByPromotionId();
1378
      }
1379
    }
1380
 
3430 rajveer 1381
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException {
1382
      checkReady();
1383
      getActiveCoupons_call method_call = new getActiveCoupons_call(resultHandler, this, ___protocolFactory, ___transport);
1384
      this.___currentMethod = method_call;
1385
      ___manager.call(method_call);
1982 varun.gupt 1386
    }
1387
 
3430 rajveer 1388
    public static class getActiveCoupons_call extends org.apache.thrift.async.TAsyncMethodCall {
1389
      public getActiveCoupons_call(org.apache.thrift.async.AsyncMethodCallback<getActiveCoupons_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1390
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 1391
      }
1392
 
3430 rajveer 1393
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1394
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getActiveCoupons", org.apache.thrift.protocol.TMessageType.CALL, 0));
1395
        getActiveCoupons_args args = new getActiveCoupons_args();
1396
        args.write(prot);
1397
        prot.writeMessageEnd();
1398
      }
1982 varun.gupt 1399
 
3430 rajveer 1400
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
1401
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1402
          throw new IllegalStateException("Method call not finished!");
1403
        }
1404
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1405
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1406
        return (new Client(prot)).recv_getActiveCoupons();
1982 varun.gupt 1407
      }
1408
    }
1409
 
8707 manish.sha 1410
    public void createCoupon(long promotionId, long couponCategory, String couponCode, String arguments, boolean isCod, String prefix, org.apache.thrift.async.AsyncMethodCallback<createCoupon_call> resultHandler) throws org.apache.thrift.TException {
6250 amit.gupta 1411
      checkReady();
8707 manish.sha 1412
      createCoupon_call method_call = new createCoupon_call(promotionId, couponCategory, couponCode, arguments, isCod, prefix, resultHandler, this, ___protocolFactory, ___transport);
6250 amit.gupta 1413
      this.___currentMethod = method_call;
1414
      ___manager.call(method_call);
1415
    }
1416
 
1417
    public static class createCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1418
      private long promotionId;
8707 manish.sha 1419
      private long couponCategory;
6730 anupam.sin 1420
      private String couponCode;
6679 anupam.sin 1421
      private String arguments;
6356 amit.gupta 1422
      private boolean isCod;
6561 amit.gupta 1423
      private String prefix;
8707 manish.sha 1424
      public createCoupon_call(long promotionId, long couponCategory, String couponCode, String arguments, boolean isCod, String prefix, org.apache.thrift.async.AsyncMethodCallback<createCoupon_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
6250 amit.gupta 1425
        super(client, protocolFactory, transport, resultHandler, false);
1426
        this.promotionId = promotionId;
8707 manish.sha 1427
        this.couponCategory = couponCategory;
6730 anupam.sin 1428
        this.couponCode = couponCode;
6679 anupam.sin 1429
        this.arguments = arguments;
6356 amit.gupta 1430
        this.isCod = isCod;
6561 amit.gupta 1431
        this.prefix = prefix;
6250 amit.gupta 1432
      }
1433
 
1434
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1435
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1436
        createCoupon_args args = new createCoupon_args();
1437
        args.setPromotionId(promotionId);
8707 manish.sha 1438
        args.setCouponCategory(couponCategory);
6730 anupam.sin 1439
        args.setCouponCode(couponCode);
6679 anupam.sin 1440
        args.setArguments(arguments);
6356 amit.gupta 1441
        args.setIsCod(isCod);
6561 amit.gupta 1442
        args.setPrefix(prefix);
6250 amit.gupta 1443
        args.write(prot);
1444
        prot.writeMessageEnd();
1445
      }
1446
 
1447
      public String getResult() throws PromotionException, org.apache.thrift.TException {
1448
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1449
          throw new IllegalStateException("Method call not finished!");
1450
        }
1451
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1452
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1453
        return (new Client(prot)).recv_createCoupon();
1454
      }
1455
    }
1456
 
3430 rajveer 1457
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException {
1458
      checkReady();
1459
      getSuccessfulPaymentCountForCoupon_call method_call = new getSuccessfulPaymentCountForCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
1460
      this.___currentMethod = method_call;
1461
      ___manager.call(method_call);
1982 varun.gupt 1462
    }
1463
 
3430 rajveer 1464
    public static class getSuccessfulPaymentCountForCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1465
      private String couponCode;
1466
      public getSuccessfulPaymentCountForCoupon_call(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getSuccessfulPaymentCountForCoupon_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1467
        super(client, protocolFactory, transport, resultHandler, false);
1468
        this.couponCode = couponCode;
1982 varun.gupt 1469
      }
1470
 
3430 rajveer 1471
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1472
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSuccessfulPaymentCountForCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1473
        getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
1474
        args.setCouponCode(couponCode);
1475
        args.write(prot);
1476
        prot.writeMessageEnd();
1477
      }
1982 varun.gupt 1478
 
3430 rajveer 1479
      public long getResult() throws PromotionException, org.apache.thrift.TException {
1480
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1481
          throw new IllegalStateException("Method call not finished!");
1482
        }
1483
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1484
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1485
        return (new Client(prot)).recv_getSuccessfulPaymentCountForCoupon();
1486
      }
1982 varun.gupt 1487
    }
1488
 
3430 rajveer 1489
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<getRuleDocString_call> resultHandler) throws org.apache.thrift.TException {
1490
      checkReady();
1491
      getRuleDocString_call method_call = new getRuleDocString_call(ruleName, resultHandler, this, ___protocolFactory, ___transport);
1492
      this.___currentMethod = method_call;
1493
      ___manager.call(method_call);
1982 varun.gupt 1494
    }
1495
 
3430 rajveer 1496
    public static class getRuleDocString_call extends org.apache.thrift.async.TAsyncMethodCall {
1497
      private String ruleName;
1498
      public getRuleDocString_call(String ruleName, org.apache.thrift.async.AsyncMethodCallback<getRuleDocString_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1499
        super(client, protocolFactory, transport, resultHandler, false);
1500
        this.ruleName = ruleName;
1501
      }
1982 varun.gupt 1502
 
3430 rajveer 1503
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1504
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRuleDocString", org.apache.thrift.protocol.TMessageType.CALL, 0));
1505
        getRuleDocString_args args = new getRuleDocString_args();
1506
        args.setRuleName(ruleName);
1507
        args.write(prot);
1508
        prot.writeMessageEnd();
1982 varun.gupt 1509
      }
1510
 
3430 rajveer 1511
      public String getResult() throws org.apache.thrift.TException {
1512
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1513
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 1514
        }
3430 rajveer 1515
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1516
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1517
        return (new Client(prot)).recv_getRuleDocString();
1982 varun.gupt 1518
      }
1519
    }
1520
 
4189 varun.gupt 1521
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException {
1522
      checkReady();
1523
      getItemDiscountMap_call method_call = new getItemDiscountMap_call(itemIds, resultHandler, this, ___protocolFactory, ___transport);
1524
      this.___currentMethod = method_call;
1525
      ___manager.call(method_call);
1526
    }
1527
 
1528
    public static class getItemDiscountMap_call extends org.apache.thrift.async.TAsyncMethodCall {
1529
      private List<Long> itemIds;
1530
      public getItemDiscountMap_call(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<getItemDiscountMap_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1531
        super(client, protocolFactory, transport, resultHandler, false);
1532
        this.itemIds = itemIds;
1533
      }
1534
 
1535
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1536
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getItemDiscountMap", org.apache.thrift.protocol.TMessageType.CALL, 0));
1537
        getItemDiscountMap_args args = new getItemDiscountMap_args();
1538
        args.setItemIds(itemIds);
1539
        args.write(prot);
1540
        prot.writeMessageEnd();
1541
      }
1542
 
1543
      public List<ItemCouponDiscount> getResult() throws PromotionException, org.apache.thrift.TException {
1544
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1545
          throw new IllegalStateException("Method call not finished!");
1546
        }
1547
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1548
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1549
        return (new Client(prot)).recv_getItemDiscountMap();
1550
      }
1551
    }
1552
 
4494 varun.gupt 1553
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException {
1554
      checkReady();
1555
      getDiscountsForEntity_call method_call = new getDiscountsForEntity_call(entityId, resultHandler, this, ___protocolFactory, ___transport);
1556
      this.___currentMethod = method_call;
1557
      ___manager.call(method_call);
1558
    }
1559
 
1560
    public static class getDiscountsForEntity_call extends org.apache.thrift.async.TAsyncMethodCall {
1561
      private long entityId;
1562
      public getDiscountsForEntity_call(long entityId, org.apache.thrift.async.AsyncMethodCallback<getDiscountsForEntity_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1563
        super(client, protocolFactory, transport, resultHandler, false);
1564
        this.entityId = entityId;
1565
      }
1566
 
1567
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1568
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getDiscountsForEntity", org.apache.thrift.protocol.TMessageType.CALL, 0));
1569
        getDiscountsForEntity_args args = new getDiscountsForEntity_args();
1570
        args.setEntityId(entityId);
1571
        args.write(prot);
1572
        prot.writeMessageEnd();
1573
      }
1574
 
1575
      public Map<String,Double> getResult() throws org.apache.thrift.TException {
1576
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1577
          throw new IllegalStateException("Method call not finished!");
1578
        }
1579
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1580
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1581
        return (new Client(prot)).recv_getDiscountsForEntity();
1582
      }
1583
    }
1584
 
5469 rajveer 1585
    public void addVoucher(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<addVoucher_call> resultHandler) throws org.apache.thrift.TException {
1586
      checkReady();
1587
      addVoucher_call method_call = new addVoucher_call(voucher, resultHandler, this, ___protocolFactory, ___transport);
1588
      this.___currentMethod = method_call;
1589
      ___manager.call(method_call);
1590
    }
1591
 
1592
    public static class addVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
1593
      private Voucher voucher;
1594
      public addVoucher_call(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<addVoucher_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1595
        super(client, protocolFactory, transport, resultHandler, false);
1596
        this.voucher = voucher;
1597
      }
1598
 
1599
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1600
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
1601
        addVoucher_args args = new addVoucher_args();
1602
        args.setVoucher(voucher);
1603
        args.write(prot);
1604
        prot.writeMessageEnd();
1605
      }
1606
 
1607
      public void getResult() throws org.apache.thrift.TException {
1608
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1609
          throw new IllegalStateException("Method call not finished!");
1610
        }
1611
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1612
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1613
        (new Client(prot)).recv_addVoucher();
1614
      }
1615
    }
1616
 
1617
    public void assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount, org.apache.thrift.async.AsyncMethodCallback<assignVoucher_call> resultHandler) throws org.apache.thrift.TException {
1618
      checkReady();
1619
      assignVoucher_call method_call = new assignVoucher_call(userId, userEmail, voucherType, amount, resultHandler, this, ___protocolFactory, ___transport);
1620
      this.___currentMethod = method_call;
1621
      ___manager.call(method_call);
1622
    }
1623
 
1624
    public static class assignVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
1625
      private long userId;
1626
      private String userEmail;
1627
      private VoucherType voucherType;
1628
      private long amount;
1629
      public assignVoucher_call(long userId, String userEmail, VoucherType voucherType, long amount, org.apache.thrift.async.AsyncMethodCallback<assignVoucher_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1630
        super(client, protocolFactory, transport, resultHandler, false);
1631
        this.userId = userId;
1632
        this.userEmail = userEmail;
1633
        this.voucherType = voucherType;
1634
        this.amount = amount;
1635
      }
1636
 
1637
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1638
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("assignVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
1639
        assignVoucher_args args = new assignVoucher_args();
1640
        args.setUserId(userId);
1641
        args.setUserEmail(userEmail);
1642
        args.setVoucherType(voucherType);
1643
        args.setAmount(amount);
1644
        args.write(prot);
1645
        prot.writeMessageEnd();
1646
      }
1647
 
1648
      public Voucher getResult() throws org.apache.thrift.TException {
1649
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1650
          throw new IllegalStateException("Method call not finished!");
1651
        }
1652
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1653
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1654
        return (new Client(prot)).recv_assignVoucher();
1655
      }
1656
    }
1657
 
1658
    public void markVoucherAsRedeemed(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<markVoucherAsRedeemed_call> resultHandler) throws org.apache.thrift.TException {
1659
      checkReady();
1660
      markVoucherAsRedeemed_call method_call = new markVoucherAsRedeemed_call(voucherCode, redeemedOn, resultHandler, this, ___protocolFactory, ___transport);
1661
      this.___currentMethod = method_call;
1662
      ___manager.call(method_call);
1663
    }
1664
 
1665
    public static class markVoucherAsRedeemed_call extends org.apache.thrift.async.TAsyncMethodCall {
1666
      private String voucherCode;
1667
      private long redeemedOn;
1668
      public markVoucherAsRedeemed_call(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<markVoucherAsRedeemed_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1669
        super(client, protocolFactory, transport, resultHandler, false);
1670
        this.voucherCode = voucherCode;
1671
        this.redeemedOn = redeemedOn;
1672
      }
1673
 
1674
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1675
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("markVoucherAsRedeemed", org.apache.thrift.protocol.TMessageType.CALL, 0));
1676
        markVoucherAsRedeemed_args args = new markVoucherAsRedeemed_args();
1677
        args.setVoucherCode(voucherCode);
1678
        args.setRedeemedOn(redeemedOn);
1679
        args.write(prot);
1680
        prot.writeMessageEnd();
1681
      }
1682
 
1683
      public boolean getResult() throws org.apache.thrift.TException {
1684
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1685
          throw new IllegalStateException("Method call not finished!");
1686
        }
1687
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1688
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1689
        return (new Client(prot)).recv_markVoucherAsRedeemed();
1690
      }
1691
    }
1692
 
3430 rajveer 1693
  }
1982 varun.gupt 1694
 
3430 rajveer 1695
  public static class Processor<I extends Iface> extends in.shop2020.generic.GenericService.Processor implements org.apache.thrift.TProcessor {
1696
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
1697
    public Processor(I iface) {
1698
      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
1982 varun.gupt 1699
    }
1700
 
3430 rajveer 1701
    protected Processor(I iface, Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
1702
      super(iface, getProcessMap(processMap));
1982 varun.gupt 1703
    }
1704
 
3430 rajveer 1705
    private static <I extends Iface> Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> getProcessMap(Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
1706
      processMap.put("createPromotion", new createPromotion());
7746 amit.gupta 1707
      processMap.put("removeAllCouponsByPromotionId", new removeAllCouponsByPromotionId());
6301 amit.gupta 1708
      processMap.put("getCoupon", new getCoupon());
1709
      processMap.put("isGiftVoucher", new isGiftVoucher());
6356 amit.gupta 1710
      processMap.put("isCodApplicable", new isCodApplicable());
3430 rajveer 1711
      processMap.put("getAllPromotions", new getAllPromotions());
1712
      processMap.put("getPromotionById", new getPromotionById());
1713
      processMap.put("generateCouponsForPromotion", new generateCouponsForPromotion());
1714
      processMap.put("applyCoupon", new applyCoupon());
6736 amit.gupta 1715
      processMap.put("getEmiDiscount", new getEmiDiscount());
6433 anupam.sin 1716
      processMap.put("applyRechargeCoupon", new applyRechargeCoupon());
3430 rajveer 1717
      processMap.put("trackCouponUsage", new trackCouponUsage());
1718
      processMap.put("getCouponUsageCountByUser", new getCouponUsageCountByUser());
6497 amit.gupta 1719
      processMap.put("getActiveCodes", new getActiveCodes());
1720
      processMap.put("deleteCoupon", new deleteCoupon());
7092 amit.gupta 1721
      processMap.put("getAllCouponsByPromotionId", new getAllCouponsByPromotionId());
3430 rajveer 1722
      processMap.put("getActiveCoupons", new getActiveCoupons());
6250 amit.gupta 1723
      processMap.put("createCoupon", new createCoupon());
3430 rajveer 1724
      processMap.put("getSuccessfulPaymentCountForCoupon", new getSuccessfulPaymentCountForCoupon());
1725
      processMap.put("getRuleDocString", new getRuleDocString());
4189 varun.gupt 1726
      processMap.put("getItemDiscountMap", new getItemDiscountMap());
4494 varun.gupt 1727
      processMap.put("getDiscountsForEntity", new getDiscountsForEntity());
5469 rajveer 1728
      processMap.put("addVoucher", new addVoucher());
1729
      processMap.put("assignVoucher", new assignVoucher());
1730
      processMap.put("markVoucherAsRedeemed", new markVoucherAsRedeemed());
3430 rajveer 1731
      return processMap;
1982 varun.gupt 1732
    }
1733
 
3430 rajveer 1734
    private static class createPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createPromotion_args> {
1735
      public createPromotion() {
1736
        super("createPromotion");
1737
      }
1982 varun.gupt 1738
 
3430 rajveer 1739
      protected createPromotion_args getEmptyArgsInstance() {
1740
        return new createPromotion_args();
1741
      }
1982 varun.gupt 1742
 
3430 rajveer 1743
      protected createPromotion_result getResult(I iface, createPromotion_args args) throws org.apache.thrift.TException {
1744
        createPromotion_result result = new createPromotion_result();
1745
        try {
1746
          iface.createPromotion(args.name, args.ruleExecutionSrc, args.startOn, args.endOn);
1747
        } catch (PromotionException pex) {
1748
          result.pex = pex;
1982 varun.gupt 1749
        }
3430 rajveer 1750
        return result;
1982 varun.gupt 1751
      }
3430 rajveer 1752
    }
1982 varun.gupt 1753
 
7746 amit.gupta 1754
    private static class removeAllCouponsByPromotionId<I extends Iface> extends org.apache.thrift.ProcessFunction<I, removeAllCouponsByPromotionId_args> {
1755
      public removeAllCouponsByPromotionId() {
1756
        super("removeAllCouponsByPromotionId");
1757
      }
1758
 
1759
      protected removeAllCouponsByPromotionId_args getEmptyArgsInstance() {
1760
        return new removeAllCouponsByPromotionId_args();
1761
      }
1762
 
1763
      protected removeAllCouponsByPromotionId_result getResult(I iface, removeAllCouponsByPromotionId_args args) throws org.apache.thrift.TException {
1764
        removeAllCouponsByPromotionId_result result = new removeAllCouponsByPromotionId_result();
1765
        try {
1766
          result.success = iface.removeAllCouponsByPromotionId(args.promotionId);
1767
          result.setSuccessIsSet(true);
1768
        } catch (PromotionException pex) {
1769
          result.pex = pex;
1770
        }
1771
        return result;
1772
      }
1773
    }
1774
 
6301 amit.gupta 1775
    private static class getCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCoupon_args> {
1776
      public getCoupon() {
1777
        super("getCoupon");
1778
      }
1779
 
1780
      protected getCoupon_args getEmptyArgsInstance() {
1781
        return new getCoupon_args();
1782
      }
1783
 
1784
      protected getCoupon_result getResult(I iface, getCoupon_args args) throws org.apache.thrift.TException {
1785
        getCoupon_result result = new getCoupon_result();
1786
        try {
1787
          result.success = iface.getCoupon(args.couponCode);
1788
        } catch (PromotionException pex) {
1789
          result.pex = pex;
1790
        }
1791
        return result;
1792
      }
1793
    }
1794
 
1795
    private static class isGiftVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isGiftVoucher_args> {
1796
      public isGiftVoucher() {
1797
        super("isGiftVoucher");
1798
      }
1799
 
1800
      protected isGiftVoucher_args getEmptyArgsInstance() {
1801
        return new isGiftVoucher_args();
1802
      }
1803
 
1804
      protected isGiftVoucher_result getResult(I iface, isGiftVoucher_args args) throws org.apache.thrift.TException {
1805
        isGiftVoucher_result result = new isGiftVoucher_result();
1806
        try {
1807
          result.success = iface.isGiftVoucher(args.couponCode);
1808
          result.setSuccessIsSet(true);
1809
        } catch (PromotionException pex) {
1810
          result.pex = pex;
1811
        }
1812
        return result;
1813
      }
1814
    }
1815
 
6356 amit.gupta 1816
    private static class isCodApplicable<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isCodApplicable_args> {
1817
      public isCodApplicable() {
1818
        super("isCodApplicable");
1819
      }
1820
 
1821
      protected isCodApplicable_args getEmptyArgsInstance() {
1822
        return new isCodApplicable_args();
1823
      }
1824
 
1825
      protected isCodApplicable_result getResult(I iface, isCodApplicable_args args) throws org.apache.thrift.TException {
1826
        isCodApplicable_result result = new isCodApplicable_result();
1827
        try {
11819 amit.gupta 1828
          result.success = iface.isCodApplicable(args.cart);
6356 amit.gupta 1829
          result.setSuccessIsSet(true);
1830
        } catch (PromotionException pex) {
1831
          result.pex = pex;
1832
        }
1833
        return result;
1834
      }
1835
    }
1836
 
3430 rajveer 1837
    private static class getAllPromotions<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllPromotions_args> {
1838
      public getAllPromotions() {
1839
        super("getAllPromotions");
1982 varun.gupt 1840
      }
1841
 
3430 rajveer 1842
      protected getAllPromotions_args getEmptyArgsInstance() {
1843
        return new getAllPromotions_args();
1982 varun.gupt 1844
      }
1845
 
3430 rajveer 1846
      protected getAllPromotions_result getResult(I iface, getAllPromotions_args args) throws org.apache.thrift.TException {
1847
        getAllPromotions_result result = new getAllPromotions_result();
1848
        try {
1849
          result.success = iface.getAllPromotions();
1850
        } catch (PromotionException pex) {
1851
          result.pex = pex;
1852
        }
1853
        return result;
1982 varun.gupt 1854
      }
3430 rajveer 1855
    }
1982 varun.gupt 1856
 
3430 rajveer 1857
    private static class getPromotionById<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPromotionById_args> {
1858
      public getPromotionById() {
1859
        super("getPromotionById");
1982 varun.gupt 1860
      }
1861
 
3430 rajveer 1862
      protected getPromotionById_args getEmptyArgsInstance() {
1863
        return new getPromotionById_args();
1982 varun.gupt 1864
      }
1865
 
3430 rajveer 1866
      protected getPromotionById_result getResult(I iface, getPromotionById_args args) throws org.apache.thrift.TException {
1867
        getPromotionById_result result = new getPromotionById_result();
1868
        try {
1869
          result.success = iface.getPromotionById(args.promotionId);
1870
        } catch (PromotionException pex) {
1871
          result.pex = pex;
1872
        }
1873
        return result;
1982 varun.gupt 1874
      }
1875
    }
1876
 
3430 rajveer 1877
    private static class generateCouponsForPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, generateCouponsForPromotion_args> {
1878
      public generateCouponsForPromotion() {
1879
        super("generateCouponsForPromotion");
1880
      }
1982 varun.gupt 1881
 
3430 rajveer 1882
      protected generateCouponsForPromotion_args getEmptyArgsInstance() {
1883
        return new generateCouponsForPromotion_args();
1884
      }
1982 varun.gupt 1885
 
3430 rajveer 1886
      protected generateCouponsForPromotion_result getResult(I iface, generateCouponsForPromotion_args args) throws org.apache.thrift.TException {
1887
        generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
1888
        try {
1889
          iface.generateCouponsForPromotion(args.promotionId, args.couponCode);
1890
        } catch (PromotionException pex) {
1891
          result.pex = pex;
1892
        }
1893
        return result;
1894
      }
1982 varun.gupt 1895
    }
1896
 
3430 rajveer 1897
    private static class applyCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, applyCoupon_args> {
1898
      public applyCoupon() {
1899
        super("applyCoupon");
1900
      }
1982 varun.gupt 1901
 
3430 rajveer 1902
      protected applyCoupon_args getEmptyArgsInstance() {
1903
        return new applyCoupon_args();
1904
      }
1982 varun.gupt 1905
 
3430 rajveer 1906
      protected applyCoupon_result getResult(I iface, applyCoupon_args args) throws org.apache.thrift.TException {
1907
        applyCoupon_result result = new applyCoupon_result();
1908
        try {
1909
          result.success = iface.applyCoupon(args.couponCode, args.cartId);
1910
        } catch (PromotionException pex) {
1911
          result.pex = pex;
1912
        }
1913
        return result;
1982 varun.gupt 1914
      }
1915
    }
1916
 
6736 amit.gupta 1917
    private static class getEmiDiscount<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getEmiDiscount_args> {
1918
      public getEmiDiscount() {
1919
        super("getEmiDiscount");
1920
      }
1921
 
1922
      protected getEmiDiscount_args getEmptyArgsInstance() {
1923
        return new getEmiDiscount_args();
1924
      }
1925
 
1926
      protected getEmiDiscount_result getResult(I iface, getEmiDiscount_args args) throws org.apache.thrift.TException {
1927
        getEmiDiscount_result result = new getEmiDiscount_result();
1928
        try {
1929
          result.success = iface.getEmiDiscount(args.cartId);
1930
        } catch (PromotionException pex) {
1931
          result.pex = pex;
1932
        }
1933
        return result;
1934
      }
1935
    }
1936
 
6433 anupam.sin 1937
    private static class applyRechargeCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, applyRechargeCoupon_args> {
1938
      public applyRechargeCoupon() {
1939
        super("applyRechargeCoupon");
1940
      }
1941
 
1942
      protected applyRechargeCoupon_args getEmptyArgsInstance() {
1943
        return new applyRechargeCoupon_args();
1944
      }
1945
 
1946
      protected applyRechargeCoupon_result getResult(I iface, applyRechargeCoupon_args args) throws org.apache.thrift.TException {
1947
        applyRechargeCoupon_result result = new applyRechargeCoupon_result();
1948
        try {
1949
          result.success = iface.applyRechargeCoupon(args.couponCode, args.totalAmount, args.userId);
1950
        } catch (PromotionException pex) {
1951
          result.pex = pex;
1952
        }
1953
        return result;
1954
      }
1955
    }
1956
 
3430 rajveer 1957
    private static class trackCouponUsage<I extends Iface> extends org.apache.thrift.ProcessFunction<I, trackCouponUsage_args> {
1958
      public trackCouponUsage() {
1959
        super("trackCouponUsage");
1960
      }
1982 varun.gupt 1961
 
3430 rajveer 1962
      protected trackCouponUsage_args getEmptyArgsInstance() {
1963
        return new trackCouponUsage_args();
1982 varun.gupt 1964
      }
1965
 
3430 rajveer 1966
      protected trackCouponUsage_result getResult(I iface, trackCouponUsage_args args) throws org.apache.thrift.TException {
1967
        trackCouponUsage_result result = new trackCouponUsage_result();
1968
        try {
13521 amit.gupta 1969
          iface.trackCouponUsage(args.couponCode, args.transactionId, args.userId, args.amount, args.isDigital);
3430 rajveer 1970
        } catch (PromotionException pex) {
1971
          result.pex = pex;
1972
        }
1973
        return result;
1974
      }
1982 varun.gupt 1975
    }
1976
 
3430 rajveer 1977
    private static class getCouponUsageCountByUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCouponUsageCountByUser_args> {
1978
      public getCouponUsageCountByUser() {
1979
        super("getCouponUsageCountByUser");
1982 varun.gupt 1980
      }
1981
 
3430 rajveer 1982
      protected getCouponUsageCountByUser_args getEmptyArgsInstance() {
1983
        return new getCouponUsageCountByUser_args();
1984
      }
1982 varun.gupt 1985
 
3430 rajveer 1986
      protected getCouponUsageCountByUser_result getResult(I iface, getCouponUsageCountByUser_args args) throws org.apache.thrift.TException {
1987
        getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
1988
        try {
1989
          result.success = iface.getCouponUsageCountByUser(args.couponCode, args.userId);
1990
          result.setSuccessIsSet(true);
1991
        } catch (PromotionException pex) {
1992
          result.pex = pex;
1993
        }
1994
        return result;
1995
      }
1982 varun.gupt 1996
    }
1997
 
6497 amit.gupta 1998
    private static class getActiveCodes<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getActiveCodes_args> {
1999
      public getActiveCodes() {
2000
        super("getActiveCodes");
2001
      }
2002
 
2003
      protected getActiveCodes_args getEmptyArgsInstance() {
2004
        return new getActiveCodes_args();
2005
      }
2006
 
2007
      protected getActiveCodes_result getResult(I iface, getActiveCodes_args args) throws org.apache.thrift.TException {
2008
        getActiveCodes_result result = new getActiveCodes_result();
2009
        try {
2010
          result.success = iface.getActiveCodes(args.promotionId);
2011
        } catch (PromotionException pex) {
2012
          result.pex = pex;
2013
        }
2014
        return result;
2015
      }
2016
    }
2017
 
2018
    private static class deleteCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, deleteCoupon_args> {
2019
      public deleteCoupon() {
2020
        super("deleteCoupon");
2021
      }
2022
 
2023
      protected deleteCoupon_args getEmptyArgsInstance() {
2024
        return new deleteCoupon_args();
2025
      }
2026
 
2027
      protected deleteCoupon_result getResult(I iface, deleteCoupon_args args) throws org.apache.thrift.TException {
2028
        deleteCoupon_result result = new deleteCoupon_result();
2029
        try {
2030
          iface.deleteCoupon(args.couponCode);
2031
        } catch (PromotionException pex) {
2032
          result.pex = pex;
2033
        }
2034
        return result;
2035
      }
2036
    }
2037
 
7092 amit.gupta 2038
    private static class getAllCouponsByPromotionId<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllCouponsByPromotionId_args> {
2039
      public getAllCouponsByPromotionId() {
2040
        super("getAllCouponsByPromotionId");
2041
      }
2042
 
2043
      protected getAllCouponsByPromotionId_args getEmptyArgsInstance() {
2044
        return new getAllCouponsByPromotionId_args();
2045
      }
2046
 
2047
      protected getAllCouponsByPromotionId_result getResult(I iface, getAllCouponsByPromotionId_args args) throws org.apache.thrift.TException {
2048
        getAllCouponsByPromotionId_result result = new getAllCouponsByPromotionId_result();
2049
        try {
2050
          result.success = iface.getAllCouponsByPromotionId(args.promotionId);
2051
        } catch (PromotionException pex) {
2052
          result.pex = pex;
2053
        }
2054
        return result;
2055
      }
2056
    }
2057
 
3430 rajveer 2058
    private static class getActiveCoupons<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getActiveCoupons_args> {
2059
      public getActiveCoupons() {
2060
        super("getActiveCoupons");
2061
      }
1982 varun.gupt 2062
 
3430 rajveer 2063
      protected getActiveCoupons_args getEmptyArgsInstance() {
2064
        return new getActiveCoupons_args();
2065
      }
1982 varun.gupt 2066
 
3430 rajveer 2067
      protected getActiveCoupons_result getResult(I iface, getActiveCoupons_args args) throws org.apache.thrift.TException {
2068
        getActiveCoupons_result result = new getActiveCoupons_result();
2069
        try {
2070
          result.success = iface.getActiveCoupons();
2071
        } catch (PromotionException pex) {
2072
          result.pex = pex;
2073
        }
2074
        return result;
2075
      }
1982 varun.gupt 2076
    }
2077
 
6250 amit.gupta 2078
    private static class createCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createCoupon_args> {
2079
      public createCoupon() {
2080
        super("createCoupon");
2081
      }
2082
 
2083
      protected createCoupon_args getEmptyArgsInstance() {
2084
        return new createCoupon_args();
2085
      }
2086
 
2087
      protected createCoupon_result getResult(I iface, createCoupon_args args) throws org.apache.thrift.TException {
2088
        createCoupon_result result = new createCoupon_result();
2089
        try {
8707 manish.sha 2090
          result.success = iface.createCoupon(args.promotionId, args.couponCategory, args.couponCode, args.arguments, args.isCod, args.prefix);
6250 amit.gupta 2091
        } catch (PromotionException pex) {
2092
          result.pex = pex;
2093
        }
2094
        return result;
2095
      }
2096
    }
2097
 
3430 rajveer 2098
    private static class getSuccessfulPaymentCountForCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSuccessfulPaymentCountForCoupon_args> {
2099
      public getSuccessfulPaymentCountForCoupon() {
2100
        super("getSuccessfulPaymentCountForCoupon");
1982 varun.gupt 2101
      }
2102
 
3430 rajveer 2103
      protected getSuccessfulPaymentCountForCoupon_args getEmptyArgsInstance() {
2104
        return new getSuccessfulPaymentCountForCoupon_args();
2105
      }
1982 varun.gupt 2106
 
3430 rajveer 2107
      protected getSuccessfulPaymentCountForCoupon_result getResult(I iface, getSuccessfulPaymentCountForCoupon_args args) throws org.apache.thrift.TException {
2108
        getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
2109
        try {
2110
          result.success = iface.getSuccessfulPaymentCountForCoupon(args.couponCode);
2111
          result.setSuccessIsSet(true);
2112
        } catch (PromotionException pex) {
2113
          result.pex = pex;
1982 varun.gupt 2114
        }
3430 rajveer 2115
        return result;
1982 varun.gupt 2116
      }
2117
    }
2118
 
3430 rajveer 2119
    private static class getRuleDocString<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getRuleDocString_args> {
2120
      public getRuleDocString() {
2121
        super("getRuleDocString");
2122
      }
1982 varun.gupt 2123
 
3430 rajveer 2124
      protected getRuleDocString_args getEmptyArgsInstance() {
2125
        return new getRuleDocString_args();
2126
      }
1982 varun.gupt 2127
 
3430 rajveer 2128
      protected getRuleDocString_result getResult(I iface, getRuleDocString_args args) throws org.apache.thrift.TException {
2129
        getRuleDocString_result result = new getRuleDocString_result();
2130
        result.success = iface.getRuleDocString(args.ruleName);
2131
        return result;
2132
      }
1982 varun.gupt 2133
    }
2134
 
4189 varun.gupt 2135
    private static class getItemDiscountMap<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getItemDiscountMap_args> {
2136
      public getItemDiscountMap() {
2137
        super("getItemDiscountMap");
2138
      }
2139
 
2140
      protected getItemDiscountMap_args getEmptyArgsInstance() {
2141
        return new getItemDiscountMap_args();
2142
      }
2143
 
2144
      protected getItemDiscountMap_result getResult(I iface, getItemDiscountMap_args args) throws org.apache.thrift.TException {
2145
        getItemDiscountMap_result result = new getItemDiscountMap_result();
2146
        try {
2147
          result.success = iface.getItemDiscountMap(args.itemIds);
2148
        } catch (PromotionException pex) {
2149
          result.pex = pex;
2150
        }
2151
        return result;
2152
      }
2153
    }
2154
 
4494 varun.gupt 2155
    private static class getDiscountsForEntity<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getDiscountsForEntity_args> {
2156
      public getDiscountsForEntity() {
2157
        super("getDiscountsForEntity");
2158
      }
2159
 
2160
      protected getDiscountsForEntity_args getEmptyArgsInstance() {
2161
        return new getDiscountsForEntity_args();
2162
      }
2163
 
2164
      protected getDiscountsForEntity_result getResult(I iface, getDiscountsForEntity_args args) throws org.apache.thrift.TException {
2165
        getDiscountsForEntity_result result = new getDiscountsForEntity_result();
2166
        result.success = iface.getDiscountsForEntity(args.entityId);
2167
        return result;
2168
      }
2169
    }
2170
 
5469 rajveer 2171
    private static class addVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addVoucher_args> {
2172
      public addVoucher() {
2173
        super("addVoucher");
2174
      }
2175
 
2176
      protected addVoucher_args getEmptyArgsInstance() {
2177
        return new addVoucher_args();
2178
      }
2179
 
2180
      protected addVoucher_result getResult(I iface, addVoucher_args args) throws org.apache.thrift.TException {
2181
        addVoucher_result result = new addVoucher_result();
2182
        iface.addVoucher(args.voucher);
2183
        return result;
2184
      }
2185
    }
2186
 
2187
    private static class assignVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, assignVoucher_args> {
2188
      public assignVoucher() {
2189
        super("assignVoucher");
2190
      }
2191
 
2192
      protected assignVoucher_args getEmptyArgsInstance() {
2193
        return new assignVoucher_args();
2194
      }
2195
 
2196
      protected assignVoucher_result getResult(I iface, assignVoucher_args args) throws org.apache.thrift.TException {
2197
        assignVoucher_result result = new assignVoucher_result();
2198
        result.success = iface.assignVoucher(args.userId, args.userEmail, args.voucherType, args.amount);
2199
        return result;
2200
      }
2201
    }
2202
 
2203
    private static class markVoucherAsRedeemed<I extends Iface> extends org.apache.thrift.ProcessFunction<I, markVoucherAsRedeemed_args> {
2204
      public markVoucherAsRedeemed() {
2205
        super("markVoucherAsRedeemed");
2206
      }
2207
 
2208
      protected markVoucherAsRedeemed_args getEmptyArgsInstance() {
2209
        return new markVoucherAsRedeemed_args();
2210
      }
2211
 
2212
      protected markVoucherAsRedeemed_result getResult(I iface, markVoucherAsRedeemed_args args) throws org.apache.thrift.TException {
2213
        markVoucherAsRedeemed_result result = new markVoucherAsRedeemed_result();
2214
        result.success = iface.markVoucherAsRedeemed(args.voucherCode, args.redeemedOn);
2215
        result.setSuccessIsSet(true);
2216
        return result;
2217
      }
2218
    }
2219
 
1982 varun.gupt 2220
  }
2221
 
3430 rajveer 2222
  public static class createPromotion_args implements org.apache.thrift.TBase<createPromotion_args, createPromotion_args._Fields>, java.io.Serializable, Cloneable   {
2223
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_args");
1982 varun.gupt 2224
 
3430 rajveer 2225
    private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1);
2226
    private static final org.apache.thrift.protocol.TField RULE_EXECUTION_SRC_FIELD_DESC = new org.apache.thrift.protocol.TField("ruleExecutionSrc", org.apache.thrift.protocol.TType.STRING, (short)2);
2227
    private static final org.apache.thrift.protocol.TField START_ON_FIELD_DESC = new org.apache.thrift.protocol.TField("startOn", org.apache.thrift.protocol.TType.I64, (short)3);
2228
    private static final org.apache.thrift.protocol.TField END_ON_FIELD_DESC = new org.apache.thrift.protocol.TField("endOn", org.apache.thrift.protocol.TType.I64, (short)4);
1982 varun.gupt 2229
 
3430 rajveer 2230
    private String name; // required
2231
    private String ruleExecutionSrc; // required
2232
    private long startOn; // required
2233
    private long endOn; // required
1982 varun.gupt 2234
 
2235
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2236
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2237
      NAME((short)1, "name"),
2238
      RULE_EXECUTION_SRC((short)2, "ruleExecutionSrc"),
2239
      START_ON((short)3, "startOn"),
2240
      END_ON((short)4, "endOn");
2241
 
2242
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2243
 
2244
      static {
2245
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2246
          byName.put(field.getFieldName(), field);
2247
        }
2248
      }
2249
 
2250
      /**
2251
       * Find the _Fields constant that matches fieldId, or null if its not found.
2252
       */
2253
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2254
        switch(fieldId) {
2255
          case 1: // NAME
2256
            return NAME;
2257
          case 2: // RULE_EXECUTION_SRC
2258
            return RULE_EXECUTION_SRC;
2259
          case 3: // START_ON
2260
            return START_ON;
2261
          case 4: // END_ON
2262
            return END_ON;
2263
          default:
2264
            return null;
2265
        }
1982 varun.gupt 2266
      }
2267
 
2268
      /**
2269
       * Find the _Fields constant that matches fieldId, throwing an exception
2270
       * if it is not found.
2271
       */
2272
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2273
        _Fields fields = findByThriftId(fieldId);
2274
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2275
        return fields;
2276
      }
2277
 
2278
      /**
2279
       * Find the _Fields constant that matches name, or null if its not found.
2280
       */
2281
      public static _Fields findByName(String name) {
2282
        return byName.get(name);
2283
      }
2284
 
2285
      private final short _thriftId;
2286
      private final String _fieldName;
2287
 
2288
      _Fields(short thriftId, String fieldName) {
2289
        _thriftId = thriftId;
2290
        _fieldName = fieldName;
2291
      }
2292
 
2293
      public short getThriftFieldId() {
2294
        return _thriftId;
2295
      }
2296
 
2297
      public String getFieldName() {
2298
        return _fieldName;
2299
      }
2300
    }
2301
 
2302
    // isset id assignments
2303
    private static final int __STARTON_ISSET_ID = 0;
2304
    private static final int __ENDON_ISSET_ID = 1;
2305
    private BitSet __isset_bit_vector = new BitSet(2);
2306
 
3430 rajveer 2307
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2308
    static {
3430 rajveer 2309
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2310
      tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2311
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
2312
      tmpMap.put(_Fields.RULE_EXECUTION_SRC, new org.apache.thrift.meta_data.FieldMetaData("ruleExecutionSrc", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2313
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
2314
      tmpMap.put(_Fields.START_ON, new org.apache.thrift.meta_data.FieldMetaData("startOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2315
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
2316
      tmpMap.put(_Fields.END_ON, new org.apache.thrift.meta_data.FieldMetaData("endOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2317
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
2318
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2319
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_args.class, metaDataMap);
1982 varun.gupt 2320
    }
2321
 
2322
    public createPromotion_args() {
2323
    }
2324
 
2325
    public createPromotion_args(
2326
      String name,
2327
      String ruleExecutionSrc,
2328
      long startOn,
2329
      long endOn)
2330
    {
2331
      this();
2332
      this.name = name;
2333
      this.ruleExecutionSrc = ruleExecutionSrc;
2334
      this.startOn = startOn;
2335
      setStartOnIsSet(true);
2336
      this.endOn = endOn;
2337
      setEndOnIsSet(true);
2338
    }
2339
 
2340
    /**
2341
     * Performs a deep copy on <i>other</i>.
2342
     */
2343
    public createPromotion_args(createPromotion_args other) {
2344
      __isset_bit_vector.clear();
2345
      __isset_bit_vector.or(other.__isset_bit_vector);
2346
      if (other.isSetName()) {
2347
        this.name = other.name;
2348
      }
2349
      if (other.isSetRuleExecutionSrc()) {
2350
        this.ruleExecutionSrc = other.ruleExecutionSrc;
2351
      }
2352
      this.startOn = other.startOn;
2353
      this.endOn = other.endOn;
2354
    }
2355
 
2356
    public createPromotion_args deepCopy() {
2357
      return new createPromotion_args(this);
2358
    }
2359
 
3430 rajveer 2360
    @Override
2361
    public void clear() {
2362
      this.name = null;
2363
      this.ruleExecutionSrc = null;
2364
      setStartOnIsSet(false);
2365
      this.startOn = 0;
2366
      setEndOnIsSet(false);
2367
      this.endOn = 0;
1982 varun.gupt 2368
    }
2369
 
2370
    public String getName() {
2371
      return this.name;
2372
    }
2373
 
3430 rajveer 2374
    public void setName(String name) {
1982 varun.gupt 2375
      this.name = name;
2376
    }
2377
 
2378
    public void unsetName() {
2379
      this.name = null;
2380
    }
2381
 
3430 rajveer 2382
    /** Returns true if field name is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2383
    public boolean isSetName() {
2384
      return this.name != null;
2385
    }
2386
 
2387
    public void setNameIsSet(boolean value) {
2388
      if (!value) {
2389
        this.name = null;
2390
      }
2391
    }
2392
 
2393
    public String getRuleExecutionSrc() {
2394
      return this.ruleExecutionSrc;
2395
    }
2396
 
3430 rajveer 2397
    public void setRuleExecutionSrc(String ruleExecutionSrc) {
1982 varun.gupt 2398
      this.ruleExecutionSrc = ruleExecutionSrc;
2399
    }
2400
 
2401
    public void unsetRuleExecutionSrc() {
2402
      this.ruleExecutionSrc = null;
2403
    }
2404
 
3430 rajveer 2405
    /** Returns true if field ruleExecutionSrc is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2406
    public boolean isSetRuleExecutionSrc() {
2407
      return this.ruleExecutionSrc != null;
2408
    }
2409
 
2410
    public void setRuleExecutionSrcIsSet(boolean value) {
2411
      if (!value) {
2412
        this.ruleExecutionSrc = null;
2413
      }
2414
    }
2415
 
2416
    public long getStartOn() {
2417
      return this.startOn;
2418
    }
2419
 
3430 rajveer 2420
    public void setStartOn(long startOn) {
1982 varun.gupt 2421
      this.startOn = startOn;
2422
      setStartOnIsSet(true);
2423
    }
2424
 
2425
    public void unsetStartOn() {
2426
      __isset_bit_vector.clear(__STARTON_ISSET_ID);
2427
    }
2428
 
3430 rajveer 2429
    /** Returns true if field startOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2430
    public boolean isSetStartOn() {
2431
      return __isset_bit_vector.get(__STARTON_ISSET_ID);
2432
    }
2433
 
2434
    public void setStartOnIsSet(boolean value) {
2435
      __isset_bit_vector.set(__STARTON_ISSET_ID, value);
2436
    }
2437
 
2438
    public long getEndOn() {
2439
      return this.endOn;
2440
    }
2441
 
3430 rajveer 2442
    public void setEndOn(long endOn) {
1982 varun.gupt 2443
      this.endOn = endOn;
2444
      setEndOnIsSet(true);
2445
    }
2446
 
2447
    public void unsetEndOn() {
2448
      __isset_bit_vector.clear(__ENDON_ISSET_ID);
2449
    }
2450
 
3430 rajveer 2451
    /** Returns true if field endOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2452
    public boolean isSetEndOn() {
2453
      return __isset_bit_vector.get(__ENDON_ISSET_ID);
2454
    }
2455
 
2456
    public void setEndOnIsSet(boolean value) {
2457
      __isset_bit_vector.set(__ENDON_ISSET_ID, value);
2458
    }
2459
 
2460
    public void setFieldValue(_Fields field, Object value) {
2461
      switch (field) {
2462
      case NAME:
2463
        if (value == null) {
2464
          unsetName();
2465
        } else {
2466
          setName((String)value);
2467
        }
2468
        break;
2469
 
2470
      case RULE_EXECUTION_SRC:
2471
        if (value == null) {
2472
          unsetRuleExecutionSrc();
2473
        } else {
2474
          setRuleExecutionSrc((String)value);
2475
        }
2476
        break;
2477
 
2478
      case START_ON:
2479
        if (value == null) {
2480
          unsetStartOn();
2481
        } else {
2482
          setStartOn((Long)value);
2483
        }
2484
        break;
2485
 
2486
      case END_ON:
2487
        if (value == null) {
2488
          unsetEndOn();
2489
        } else {
2490
          setEndOn((Long)value);
2491
        }
2492
        break;
2493
 
2494
      }
2495
    }
2496
 
2497
    public Object getFieldValue(_Fields field) {
2498
      switch (field) {
2499
      case NAME:
2500
        return getName();
2501
 
2502
      case RULE_EXECUTION_SRC:
2503
        return getRuleExecutionSrc();
2504
 
2505
      case START_ON:
3430 rajveer 2506
        return Long.valueOf(getStartOn());
1982 varun.gupt 2507
 
2508
      case END_ON:
3430 rajveer 2509
        return Long.valueOf(getEndOn());
1982 varun.gupt 2510
 
2511
      }
2512
      throw new IllegalStateException();
2513
    }
2514
 
3430 rajveer 2515
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2516
    public boolean isSet(_Fields field) {
2517
      if (field == null) {
2518
        throw new IllegalArgumentException();
2519
      }
1982 varun.gupt 2520
 
2521
      switch (field) {
2522
      case NAME:
2523
        return isSetName();
2524
      case RULE_EXECUTION_SRC:
2525
        return isSetRuleExecutionSrc();
2526
      case START_ON:
2527
        return isSetStartOn();
2528
      case END_ON:
2529
        return isSetEndOn();
2530
      }
2531
      throw new IllegalStateException();
2532
    }
2533
 
2534
    @Override
2535
    public boolean equals(Object that) {
2536
      if (that == null)
2537
        return false;
2538
      if (that instanceof createPromotion_args)
2539
        return this.equals((createPromotion_args)that);
2540
      return false;
2541
    }
2542
 
2543
    public boolean equals(createPromotion_args that) {
2544
      if (that == null)
2545
        return false;
2546
 
2547
      boolean this_present_name = true && this.isSetName();
2548
      boolean that_present_name = true && that.isSetName();
2549
      if (this_present_name || that_present_name) {
2550
        if (!(this_present_name && that_present_name))
2551
          return false;
2552
        if (!this.name.equals(that.name))
2553
          return false;
2554
      }
2555
 
2556
      boolean this_present_ruleExecutionSrc = true && this.isSetRuleExecutionSrc();
2557
      boolean that_present_ruleExecutionSrc = true && that.isSetRuleExecutionSrc();
2558
      if (this_present_ruleExecutionSrc || that_present_ruleExecutionSrc) {
2559
        if (!(this_present_ruleExecutionSrc && that_present_ruleExecutionSrc))
2560
          return false;
2561
        if (!this.ruleExecutionSrc.equals(that.ruleExecutionSrc))
2562
          return false;
2563
      }
2564
 
2565
      boolean this_present_startOn = true;
2566
      boolean that_present_startOn = true;
2567
      if (this_present_startOn || that_present_startOn) {
2568
        if (!(this_present_startOn && that_present_startOn))
2569
          return false;
2570
        if (this.startOn != that.startOn)
2571
          return false;
2572
      }
2573
 
2574
      boolean this_present_endOn = true;
2575
      boolean that_present_endOn = true;
2576
      if (this_present_endOn || that_present_endOn) {
2577
        if (!(this_present_endOn && that_present_endOn))
2578
          return false;
2579
        if (this.endOn != that.endOn)
2580
          return false;
2581
      }
2582
 
2583
      return true;
2584
    }
2585
 
2586
    @Override
2587
    public int hashCode() {
2588
      return 0;
2589
    }
2590
 
2591
    public int compareTo(createPromotion_args other) {
2592
      if (!getClass().equals(other.getClass())) {
2593
        return getClass().getName().compareTo(other.getClass().getName());
2594
      }
2595
 
2596
      int lastComparison = 0;
2597
      createPromotion_args typedOther = (createPromotion_args)other;
2598
 
3430 rajveer 2599
      lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
1982 varun.gupt 2600
      if (lastComparison != 0) {
2601
        return lastComparison;
2602
      }
3430 rajveer 2603
      if (isSetName()) {
2604
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
2605
        if (lastComparison != 0) {
2606
          return lastComparison;
2607
        }
1982 varun.gupt 2608
      }
3430 rajveer 2609
      lastComparison = Boolean.valueOf(isSetRuleExecutionSrc()).compareTo(typedOther.isSetRuleExecutionSrc());
1982 varun.gupt 2610
      if (lastComparison != 0) {
2611
        return lastComparison;
2612
      }
3430 rajveer 2613
      if (isSetRuleExecutionSrc()) {
2614
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleExecutionSrc, typedOther.ruleExecutionSrc);
2615
        if (lastComparison != 0) {
2616
          return lastComparison;
2617
        }
1982 varun.gupt 2618
      }
3430 rajveer 2619
      lastComparison = Boolean.valueOf(isSetStartOn()).compareTo(typedOther.isSetStartOn());
1982 varun.gupt 2620
      if (lastComparison != 0) {
2621
        return lastComparison;
2622
      }
3430 rajveer 2623
      if (isSetStartOn()) {
2624
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startOn, typedOther.startOn);
2625
        if (lastComparison != 0) {
2626
          return lastComparison;
2627
        }
1982 varun.gupt 2628
      }
3430 rajveer 2629
      lastComparison = Boolean.valueOf(isSetEndOn()).compareTo(typedOther.isSetEndOn());
1982 varun.gupt 2630
      if (lastComparison != 0) {
2631
        return lastComparison;
2632
      }
3430 rajveer 2633
      if (isSetEndOn()) {
2634
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endOn, typedOther.endOn);
2635
        if (lastComparison != 0) {
2636
          return lastComparison;
2637
        }
1982 varun.gupt 2638
      }
2639
      return 0;
2640
    }
2641
 
3430 rajveer 2642
    public _Fields fieldForId(int fieldId) {
2643
      return _Fields.findByThriftId(fieldId);
2644
    }
2645
 
2646
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2647
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2648
      iprot.readStructBegin();
2649
      while (true)
2650
      {
2651
        field = iprot.readFieldBegin();
3430 rajveer 2652
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2653
          break;
2654
        }
3430 rajveer 2655
        switch (field.id) {
2656
          case 1: // NAME
2657
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
2658
              this.name = iprot.readString();
2659
            } else { 
2660
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2661
            }
2662
            break;
2663
          case 2: // RULE_EXECUTION_SRC
2664
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
2665
              this.ruleExecutionSrc = iprot.readString();
2666
            } else { 
2667
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2668
            }
2669
            break;
2670
          case 3: // START_ON
2671
            if (field.type == org.apache.thrift.protocol.TType.I64) {
2672
              this.startOn = iprot.readI64();
2673
              setStartOnIsSet(true);
2674
            } else { 
2675
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2676
            }
2677
            break;
2678
          case 4: // END_ON
2679
            if (field.type == org.apache.thrift.protocol.TType.I64) {
2680
              this.endOn = iprot.readI64();
2681
              setEndOnIsSet(true);
2682
            } else { 
2683
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2684
            }
2685
            break;
2686
          default:
2687
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2688
        }
3430 rajveer 2689
        iprot.readFieldEnd();
1982 varun.gupt 2690
      }
2691
      iprot.readStructEnd();
2692
      validate();
2693
    }
2694
 
3430 rajveer 2695
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2696
      validate();
2697
 
2698
      oprot.writeStructBegin(STRUCT_DESC);
2699
      if (this.name != null) {
2700
        oprot.writeFieldBegin(NAME_FIELD_DESC);
2701
        oprot.writeString(this.name);
2702
        oprot.writeFieldEnd();
2703
      }
2704
      if (this.ruleExecutionSrc != null) {
2705
        oprot.writeFieldBegin(RULE_EXECUTION_SRC_FIELD_DESC);
2706
        oprot.writeString(this.ruleExecutionSrc);
2707
        oprot.writeFieldEnd();
2708
      }
2709
      oprot.writeFieldBegin(START_ON_FIELD_DESC);
2710
      oprot.writeI64(this.startOn);
2711
      oprot.writeFieldEnd();
2712
      oprot.writeFieldBegin(END_ON_FIELD_DESC);
2713
      oprot.writeI64(this.endOn);
2714
      oprot.writeFieldEnd();
2715
      oprot.writeFieldStop();
2716
      oprot.writeStructEnd();
2717
    }
2718
 
2719
    @Override
2720
    public String toString() {
2721
      StringBuilder sb = new StringBuilder("createPromotion_args(");
2722
      boolean first = true;
2723
 
2724
      sb.append("name:");
2725
      if (this.name == null) {
2726
        sb.append("null");
2727
      } else {
2728
        sb.append(this.name);
2729
      }
2730
      first = false;
2731
      if (!first) sb.append(", ");
2732
      sb.append("ruleExecutionSrc:");
2733
      if (this.ruleExecutionSrc == null) {
2734
        sb.append("null");
2735
      } else {
2736
        sb.append(this.ruleExecutionSrc);
2737
      }
2738
      first = false;
2739
      if (!first) sb.append(", ");
2740
      sb.append("startOn:");
2741
      sb.append(this.startOn);
2742
      first = false;
2743
      if (!first) sb.append(", ");
2744
      sb.append("endOn:");
2745
      sb.append(this.endOn);
2746
      first = false;
2747
      sb.append(")");
2748
      return sb.toString();
2749
    }
2750
 
3430 rajveer 2751
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2752
      // check for required fields
2753
    }
2754
 
3430 rajveer 2755
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2756
      try {
2757
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2758
      } catch (org.apache.thrift.TException te) {
2759
        throw new java.io.IOException(te);
2760
      }
2761
    }
2762
 
2763
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2764
      try {
2765
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
2766
        __isset_bit_vector = new BitSet(1);
2767
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2768
      } catch (org.apache.thrift.TException te) {
2769
        throw new java.io.IOException(te);
2770
      }
2771
    }
2772
 
1982 varun.gupt 2773
  }
2774
 
3430 rajveer 2775
  public static class createPromotion_result implements org.apache.thrift.TBase<createPromotion_result, createPromotion_result._Fields>, java.io.Serializable, Cloneable   {
2776
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_result");
1982 varun.gupt 2777
 
3430 rajveer 2778
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
1982 varun.gupt 2779
 
3430 rajveer 2780
    private PromotionException pex; // required
1982 varun.gupt 2781
 
2782
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2783
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2784
      PEX((short)1, "pex");
2785
 
2786
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2787
 
2788
      static {
2789
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2790
          byName.put(field.getFieldName(), field);
2791
        }
2792
      }
2793
 
2794
      /**
2795
       * Find the _Fields constant that matches fieldId, or null if its not found.
2796
       */
2797
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2798
        switch(fieldId) {
2799
          case 1: // PEX
2800
            return PEX;
2801
          default:
2802
            return null;
2803
        }
1982 varun.gupt 2804
      }
2805
 
2806
      /**
2807
       * Find the _Fields constant that matches fieldId, throwing an exception
2808
       * if it is not found.
2809
       */
2810
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2811
        _Fields fields = findByThriftId(fieldId);
2812
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2813
        return fields;
2814
      }
2815
 
2816
      /**
2817
       * Find the _Fields constant that matches name, or null if its not found.
2818
       */
2819
      public static _Fields findByName(String name) {
2820
        return byName.get(name);
2821
      }
2822
 
2823
      private final short _thriftId;
2824
      private final String _fieldName;
2825
 
2826
      _Fields(short thriftId, String fieldName) {
2827
        _thriftId = thriftId;
2828
        _fieldName = fieldName;
2829
      }
2830
 
2831
      public short getThriftFieldId() {
2832
        return _thriftId;
2833
      }
2834
 
2835
      public String getFieldName() {
2836
        return _fieldName;
2837
      }
2838
    }
2839
 
2840
    // isset id assignments
2841
 
3430 rajveer 2842
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2843
    static {
3430 rajveer 2844
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2845
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2846
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
2847
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2848
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_result.class, metaDataMap);
1982 varun.gupt 2849
    }
2850
 
2851
    public createPromotion_result() {
2852
    }
2853
 
2854
    public createPromotion_result(
2855
      PromotionException pex)
2856
    {
2857
      this();
2858
      this.pex = pex;
2859
    }
2860
 
2861
    /**
2862
     * Performs a deep copy on <i>other</i>.
2863
     */
2864
    public createPromotion_result(createPromotion_result other) {
2865
      if (other.isSetPex()) {
2866
        this.pex = new PromotionException(other.pex);
2867
      }
2868
    }
2869
 
2870
    public createPromotion_result deepCopy() {
2871
      return new createPromotion_result(this);
2872
    }
2873
 
3430 rajveer 2874
    @Override
2875
    public void clear() {
2876
      this.pex = null;
1982 varun.gupt 2877
    }
2878
 
2879
    public PromotionException getPex() {
2880
      return this.pex;
2881
    }
2882
 
3430 rajveer 2883
    public void setPex(PromotionException pex) {
1982 varun.gupt 2884
      this.pex = pex;
2885
    }
2886
 
2887
    public void unsetPex() {
2888
      this.pex = null;
2889
    }
2890
 
3430 rajveer 2891
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2892
    public boolean isSetPex() {
2893
      return this.pex != null;
2894
    }
2895
 
2896
    public void setPexIsSet(boolean value) {
2897
      if (!value) {
2898
        this.pex = null;
2899
      }
2900
    }
2901
 
2902
    public void setFieldValue(_Fields field, Object value) {
2903
      switch (field) {
2904
      case PEX:
2905
        if (value == null) {
2906
          unsetPex();
2907
        } else {
2908
          setPex((PromotionException)value);
2909
        }
2910
        break;
2911
 
2912
      }
2913
    }
2914
 
2915
    public Object getFieldValue(_Fields field) {
2916
      switch (field) {
2917
      case PEX:
2918
        return getPex();
2919
 
2920
      }
2921
      throw new IllegalStateException();
2922
    }
2923
 
3430 rajveer 2924
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2925
    public boolean isSet(_Fields field) {
2926
      if (field == null) {
2927
        throw new IllegalArgumentException();
2928
      }
1982 varun.gupt 2929
 
2930
      switch (field) {
2931
      case PEX:
2932
        return isSetPex();
2933
      }
2934
      throw new IllegalStateException();
2935
    }
2936
 
2937
    @Override
2938
    public boolean equals(Object that) {
2939
      if (that == null)
2940
        return false;
2941
      if (that instanceof createPromotion_result)
2942
        return this.equals((createPromotion_result)that);
2943
      return false;
2944
    }
2945
 
2946
    public boolean equals(createPromotion_result that) {
2947
      if (that == null)
2948
        return false;
2949
 
2950
      boolean this_present_pex = true && this.isSetPex();
2951
      boolean that_present_pex = true && that.isSetPex();
2952
      if (this_present_pex || that_present_pex) {
2953
        if (!(this_present_pex && that_present_pex))
2954
          return false;
2955
        if (!this.pex.equals(that.pex))
2956
          return false;
2957
      }
2958
 
2959
      return true;
2960
    }
2961
 
2962
    @Override
2963
    public int hashCode() {
2964
      return 0;
2965
    }
2966
 
2967
    public int compareTo(createPromotion_result other) {
2968
      if (!getClass().equals(other.getClass())) {
2969
        return getClass().getName().compareTo(other.getClass().getName());
2970
      }
2971
 
2972
      int lastComparison = 0;
2973
      createPromotion_result typedOther = (createPromotion_result)other;
2974
 
3430 rajveer 2975
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 2976
      if (lastComparison != 0) {
2977
        return lastComparison;
2978
      }
3430 rajveer 2979
      if (isSetPex()) {
2980
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
2981
        if (lastComparison != 0) {
2982
          return lastComparison;
2983
        }
1982 varun.gupt 2984
      }
2985
      return 0;
2986
    }
2987
 
3430 rajveer 2988
    public _Fields fieldForId(int fieldId) {
2989
      return _Fields.findByThriftId(fieldId);
2990
    }
2991
 
2992
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2993
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2994
      iprot.readStructBegin();
2995
      while (true)
2996
      {
2997
        field = iprot.readFieldBegin();
3430 rajveer 2998
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2999
          break;
3000
        }
3430 rajveer 3001
        switch (field.id) {
3002
          case 1: // PEX
3003
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3004
              this.pex = new PromotionException();
3005
              this.pex.read(iprot);
3006
            } else { 
3007
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3008
            }
3009
            break;
3010
          default:
3011
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 3012
        }
3430 rajveer 3013
        iprot.readFieldEnd();
1982 varun.gupt 3014
      }
3015
      iprot.readStructEnd();
3016
      validate();
3017
    }
3018
 
3430 rajveer 3019
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 3020
      oprot.writeStructBegin(STRUCT_DESC);
3021
 
3022
      if (this.isSetPex()) {
3023
        oprot.writeFieldBegin(PEX_FIELD_DESC);
3024
        this.pex.write(oprot);
3025
        oprot.writeFieldEnd();
3026
      }
3027
      oprot.writeFieldStop();
3028
      oprot.writeStructEnd();
3029
    }
3030
 
3031
    @Override
3032
    public String toString() {
3033
      StringBuilder sb = new StringBuilder("createPromotion_result(");
3034
      boolean first = true;
3035
 
3036
      sb.append("pex:");
3037
      if (this.pex == null) {
3038
        sb.append("null");
3039
      } else {
3040
        sb.append(this.pex);
3041
      }
3042
      first = false;
3043
      sb.append(")");
3044
      return sb.toString();
3045
    }
3046
 
3430 rajveer 3047
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 3048
      // check for required fields
3049
    }
3050
 
3430 rajveer 3051
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3052
      try {
3053
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3054
      } catch (org.apache.thrift.TException te) {
3055
        throw new java.io.IOException(te);
3056
      }
3057
    }
3058
 
3059
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3060
      try {
3061
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3062
      } catch (org.apache.thrift.TException te) {
3063
        throw new java.io.IOException(te);
3064
      }
3065
    }
3066
 
1982 varun.gupt 3067
  }
3068
 
7746 amit.gupta 3069
  public static class removeAllCouponsByPromotionId_args implements org.apache.thrift.TBase<removeAllCouponsByPromotionId_args, removeAllCouponsByPromotionId_args._Fields>, java.io.Serializable, Cloneable   {
3070
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("removeAllCouponsByPromotionId_args");
3071
 
3072
    private static final org.apache.thrift.protocol.TField PROMOTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("promotionId", org.apache.thrift.protocol.TType.I64, (short)1);
3073
 
3074
    private long promotionId; // required
3075
 
3076
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3077
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3078
      PROMOTION_ID((short)1, "promotionId");
3079
 
3080
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3081
 
3082
      static {
3083
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3084
          byName.put(field.getFieldName(), field);
3085
        }
3086
      }
3087
 
3088
      /**
3089
       * Find the _Fields constant that matches fieldId, or null if its not found.
3090
       */
3091
      public static _Fields findByThriftId(int fieldId) {
3092
        switch(fieldId) {
3093
          case 1: // PROMOTION_ID
3094
            return PROMOTION_ID;
3095
          default:
3096
            return null;
3097
        }
3098
      }
3099
 
3100
      /**
3101
       * Find the _Fields constant that matches fieldId, throwing an exception
3102
       * if it is not found.
3103
       */
3104
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3105
        _Fields fields = findByThriftId(fieldId);
3106
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3107
        return fields;
3108
      }
3109
 
3110
      /**
3111
       * Find the _Fields constant that matches name, or null if its not found.
3112
       */
3113
      public static _Fields findByName(String name) {
3114
        return byName.get(name);
3115
      }
3116
 
3117
      private final short _thriftId;
3118
      private final String _fieldName;
3119
 
3120
      _Fields(short thriftId, String fieldName) {
3121
        _thriftId = thriftId;
3122
        _fieldName = fieldName;
3123
      }
3124
 
3125
      public short getThriftFieldId() {
3126
        return _thriftId;
3127
      }
3128
 
3129
      public String getFieldName() {
3130
        return _fieldName;
3131
      }
3132
    }
3133
 
3134
    // isset id assignments
3135
    private static final int __PROMOTIONID_ISSET_ID = 0;
3136
    private BitSet __isset_bit_vector = new BitSet(1);
3137
 
3138
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3139
    static {
3140
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3141
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3142
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
3143
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3144
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(removeAllCouponsByPromotionId_args.class, metaDataMap);
3145
    }
3146
 
3147
    public removeAllCouponsByPromotionId_args() {
3148
    }
3149
 
3150
    public removeAllCouponsByPromotionId_args(
3151
      long promotionId)
3152
    {
3153
      this();
3154
      this.promotionId = promotionId;
3155
      setPromotionIdIsSet(true);
3156
    }
3157
 
3158
    /**
3159
     * Performs a deep copy on <i>other</i>.
3160
     */
3161
    public removeAllCouponsByPromotionId_args(removeAllCouponsByPromotionId_args other) {
3162
      __isset_bit_vector.clear();
3163
      __isset_bit_vector.or(other.__isset_bit_vector);
3164
      this.promotionId = other.promotionId;
3165
    }
3166
 
3167
    public removeAllCouponsByPromotionId_args deepCopy() {
3168
      return new removeAllCouponsByPromotionId_args(this);
3169
    }
3170
 
3171
    @Override
3172
    public void clear() {
3173
      setPromotionIdIsSet(false);
3174
      this.promotionId = 0;
3175
    }
3176
 
3177
    public long getPromotionId() {
3178
      return this.promotionId;
3179
    }
3180
 
3181
    public void setPromotionId(long promotionId) {
3182
      this.promotionId = promotionId;
3183
      setPromotionIdIsSet(true);
3184
    }
3185
 
3186
    public void unsetPromotionId() {
3187
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
3188
    }
3189
 
3190
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
3191
    public boolean isSetPromotionId() {
3192
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
3193
    }
3194
 
3195
    public void setPromotionIdIsSet(boolean value) {
3196
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
3197
    }
3198
 
3199
    public void setFieldValue(_Fields field, Object value) {
3200
      switch (field) {
3201
      case PROMOTION_ID:
3202
        if (value == null) {
3203
          unsetPromotionId();
3204
        } else {
3205
          setPromotionId((Long)value);
3206
        }
3207
        break;
3208
 
3209
      }
3210
    }
3211
 
3212
    public Object getFieldValue(_Fields field) {
3213
      switch (field) {
3214
      case PROMOTION_ID:
3215
        return Long.valueOf(getPromotionId());
3216
 
3217
      }
3218
      throw new IllegalStateException();
3219
    }
3220
 
3221
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3222
    public boolean isSet(_Fields field) {
3223
      if (field == null) {
3224
        throw new IllegalArgumentException();
3225
      }
3226
 
3227
      switch (field) {
3228
      case PROMOTION_ID:
3229
        return isSetPromotionId();
3230
      }
3231
      throw new IllegalStateException();
3232
    }
3233
 
3234
    @Override
3235
    public boolean equals(Object that) {
3236
      if (that == null)
3237
        return false;
3238
      if (that instanceof removeAllCouponsByPromotionId_args)
3239
        return this.equals((removeAllCouponsByPromotionId_args)that);
3240
      return false;
3241
    }
3242
 
3243
    public boolean equals(removeAllCouponsByPromotionId_args that) {
3244
      if (that == null)
3245
        return false;
3246
 
3247
      boolean this_present_promotionId = true;
3248
      boolean that_present_promotionId = true;
3249
      if (this_present_promotionId || that_present_promotionId) {
3250
        if (!(this_present_promotionId && that_present_promotionId))
3251
          return false;
3252
        if (this.promotionId != that.promotionId)
3253
          return false;
3254
      }
3255
 
3256
      return true;
3257
    }
3258
 
3259
    @Override
3260
    public int hashCode() {
3261
      return 0;
3262
    }
3263
 
3264
    public int compareTo(removeAllCouponsByPromotionId_args other) {
3265
      if (!getClass().equals(other.getClass())) {
3266
        return getClass().getName().compareTo(other.getClass().getName());
3267
      }
3268
 
3269
      int lastComparison = 0;
3270
      removeAllCouponsByPromotionId_args typedOther = (removeAllCouponsByPromotionId_args)other;
3271
 
3272
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
3273
      if (lastComparison != 0) {
3274
        return lastComparison;
3275
      }
3276
      if (isSetPromotionId()) {
3277
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
3278
        if (lastComparison != 0) {
3279
          return lastComparison;
3280
        }
3281
      }
3282
      return 0;
3283
    }
3284
 
3285
    public _Fields fieldForId(int fieldId) {
3286
      return _Fields.findByThriftId(fieldId);
3287
    }
3288
 
3289
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3290
      org.apache.thrift.protocol.TField field;
3291
      iprot.readStructBegin();
3292
      while (true)
3293
      {
3294
        field = iprot.readFieldBegin();
3295
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3296
          break;
3297
        }
3298
        switch (field.id) {
3299
          case 1: // PROMOTION_ID
3300
            if (field.type == org.apache.thrift.protocol.TType.I64) {
3301
              this.promotionId = iprot.readI64();
3302
              setPromotionIdIsSet(true);
3303
            } else { 
3304
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3305
            }
3306
            break;
3307
          default:
3308
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3309
        }
3310
        iprot.readFieldEnd();
3311
      }
3312
      iprot.readStructEnd();
3313
      validate();
3314
    }
3315
 
3316
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3317
      validate();
3318
 
3319
      oprot.writeStructBegin(STRUCT_DESC);
3320
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
3321
      oprot.writeI64(this.promotionId);
3322
      oprot.writeFieldEnd();
3323
      oprot.writeFieldStop();
3324
      oprot.writeStructEnd();
3325
    }
3326
 
3327
    @Override
3328
    public String toString() {
3329
      StringBuilder sb = new StringBuilder("removeAllCouponsByPromotionId_args(");
3330
      boolean first = true;
3331
 
3332
      sb.append("promotionId:");
3333
      sb.append(this.promotionId);
3334
      first = false;
3335
      sb.append(")");
3336
      return sb.toString();
3337
    }
3338
 
3339
    public void validate() throws org.apache.thrift.TException {
3340
      // check for required fields
3341
    }
3342
 
3343
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3344
      try {
3345
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3346
      } catch (org.apache.thrift.TException te) {
3347
        throw new java.io.IOException(te);
3348
      }
3349
    }
3350
 
3351
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3352
      try {
3353
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
3354
        __isset_bit_vector = new BitSet(1);
3355
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3356
      } catch (org.apache.thrift.TException te) {
3357
        throw new java.io.IOException(te);
3358
      }
3359
    }
3360
 
3361
  }
3362
 
3363
  public static class removeAllCouponsByPromotionId_result implements org.apache.thrift.TBase<removeAllCouponsByPromotionId_result, removeAllCouponsByPromotionId_result._Fields>, java.io.Serializable, Cloneable   {
3364
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("removeAllCouponsByPromotionId_result");
3365
 
3366
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0);
3367
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
3368
 
3369
    private long success; // required
3370
    private PromotionException pex; // required
3371
 
3372
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3373
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3374
      SUCCESS((short)0, "success"),
3375
      PEX((short)1, "pex");
3376
 
3377
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3378
 
3379
      static {
3380
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3381
          byName.put(field.getFieldName(), field);
3382
        }
3383
      }
3384
 
3385
      /**
3386
       * Find the _Fields constant that matches fieldId, or null if its not found.
3387
       */
3388
      public static _Fields findByThriftId(int fieldId) {
3389
        switch(fieldId) {
3390
          case 0: // SUCCESS
3391
            return SUCCESS;
3392
          case 1: // PEX
3393
            return PEX;
3394
          default:
3395
            return null;
3396
        }
3397
      }
3398
 
3399
      /**
3400
       * Find the _Fields constant that matches fieldId, throwing an exception
3401
       * if it is not found.
3402
       */
3403
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3404
        _Fields fields = findByThriftId(fieldId);
3405
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3406
        return fields;
3407
      }
3408
 
3409
      /**
3410
       * Find the _Fields constant that matches name, or null if its not found.
3411
       */
3412
      public static _Fields findByName(String name) {
3413
        return byName.get(name);
3414
      }
3415
 
3416
      private final short _thriftId;
3417
      private final String _fieldName;
3418
 
3419
      _Fields(short thriftId, String fieldName) {
3420
        _thriftId = thriftId;
3421
        _fieldName = fieldName;
3422
      }
3423
 
3424
      public short getThriftFieldId() {
3425
        return _thriftId;
3426
      }
3427
 
3428
      public String getFieldName() {
3429
        return _fieldName;
3430
      }
3431
    }
3432
 
3433
    // isset id assignments
3434
    private static final int __SUCCESS_ISSET_ID = 0;
3435
    private BitSet __isset_bit_vector = new BitSet(1);
3436
 
3437
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3438
    static {
3439
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3440
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3441
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
3442
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3443
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
3444
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3445
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(removeAllCouponsByPromotionId_result.class, metaDataMap);
3446
    }
3447
 
3448
    public removeAllCouponsByPromotionId_result() {
3449
    }
3450
 
3451
    public removeAllCouponsByPromotionId_result(
3452
      long success,
3453
      PromotionException pex)
3454
    {
3455
      this();
3456
      this.success = success;
3457
      setSuccessIsSet(true);
3458
      this.pex = pex;
3459
    }
3460
 
3461
    /**
3462
     * Performs a deep copy on <i>other</i>.
3463
     */
3464
    public removeAllCouponsByPromotionId_result(removeAllCouponsByPromotionId_result other) {
3465
      __isset_bit_vector.clear();
3466
      __isset_bit_vector.or(other.__isset_bit_vector);
3467
      this.success = other.success;
3468
      if (other.isSetPex()) {
3469
        this.pex = new PromotionException(other.pex);
3470
      }
3471
    }
3472
 
3473
    public removeAllCouponsByPromotionId_result deepCopy() {
3474
      return new removeAllCouponsByPromotionId_result(this);
3475
    }
3476
 
3477
    @Override
3478
    public void clear() {
3479
      setSuccessIsSet(false);
3480
      this.success = 0;
3481
      this.pex = null;
3482
    }
3483
 
3484
    public long getSuccess() {
3485
      return this.success;
3486
    }
3487
 
3488
    public void setSuccess(long success) {
3489
      this.success = success;
3490
      setSuccessIsSet(true);
3491
    }
3492
 
3493
    public void unsetSuccess() {
3494
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
3495
    }
3496
 
3497
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3498
    public boolean isSetSuccess() {
3499
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
3500
    }
3501
 
3502
    public void setSuccessIsSet(boolean value) {
3503
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
3504
    }
3505
 
3506
    public PromotionException getPex() {
3507
      return this.pex;
3508
    }
3509
 
3510
    public void setPex(PromotionException pex) {
3511
      this.pex = pex;
3512
    }
3513
 
3514
    public void unsetPex() {
3515
      this.pex = null;
3516
    }
3517
 
3518
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3519
    public boolean isSetPex() {
3520
      return this.pex != null;
3521
    }
3522
 
3523
    public void setPexIsSet(boolean value) {
3524
      if (!value) {
3525
        this.pex = null;
3526
      }
3527
    }
3528
 
3529
    public void setFieldValue(_Fields field, Object value) {
3530
      switch (field) {
3531
      case SUCCESS:
3532
        if (value == null) {
3533
          unsetSuccess();
3534
        } else {
3535
          setSuccess((Long)value);
3536
        }
3537
        break;
3538
 
3539
      case PEX:
3540
        if (value == null) {
3541
          unsetPex();
3542
        } else {
3543
          setPex((PromotionException)value);
3544
        }
3545
        break;
3546
 
3547
      }
3548
    }
3549
 
3550
    public Object getFieldValue(_Fields field) {
3551
      switch (field) {
3552
      case SUCCESS:
3553
        return Long.valueOf(getSuccess());
3554
 
3555
      case PEX:
3556
        return getPex();
3557
 
3558
      }
3559
      throw new IllegalStateException();
3560
    }
3561
 
3562
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3563
    public boolean isSet(_Fields field) {
3564
      if (field == null) {
3565
        throw new IllegalArgumentException();
3566
      }
3567
 
3568
      switch (field) {
3569
      case SUCCESS:
3570
        return isSetSuccess();
3571
      case PEX:
3572
        return isSetPex();
3573
      }
3574
      throw new IllegalStateException();
3575
    }
3576
 
3577
    @Override
3578
    public boolean equals(Object that) {
3579
      if (that == null)
3580
        return false;
3581
      if (that instanceof removeAllCouponsByPromotionId_result)
3582
        return this.equals((removeAllCouponsByPromotionId_result)that);
3583
      return false;
3584
    }
3585
 
3586
    public boolean equals(removeAllCouponsByPromotionId_result that) {
3587
      if (that == null)
3588
        return false;
3589
 
3590
      boolean this_present_success = true;
3591
      boolean that_present_success = true;
3592
      if (this_present_success || that_present_success) {
3593
        if (!(this_present_success && that_present_success))
3594
          return false;
3595
        if (this.success != that.success)
3596
          return false;
3597
      }
3598
 
3599
      boolean this_present_pex = true && this.isSetPex();
3600
      boolean that_present_pex = true && that.isSetPex();
3601
      if (this_present_pex || that_present_pex) {
3602
        if (!(this_present_pex && that_present_pex))
3603
          return false;
3604
        if (!this.pex.equals(that.pex))
3605
          return false;
3606
      }
3607
 
3608
      return true;
3609
    }
3610
 
3611
    @Override
3612
    public int hashCode() {
3613
      return 0;
3614
    }
3615
 
3616
    public int compareTo(removeAllCouponsByPromotionId_result other) {
3617
      if (!getClass().equals(other.getClass())) {
3618
        return getClass().getName().compareTo(other.getClass().getName());
3619
      }
3620
 
3621
      int lastComparison = 0;
3622
      removeAllCouponsByPromotionId_result typedOther = (removeAllCouponsByPromotionId_result)other;
3623
 
3624
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3625
      if (lastComparison != 0) {
3626
        return lastComparison;
3627
      }
3628
      if (isSetSuccess()) {
3629
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
3630
        if (lastComparison != 0) {
3631
          return lastComparison;
3632
        }
3633
      }
3634
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3635
      if (lastComparison != 0) {
3636
        return lastComparison;
3637
      }
3638
      if (isSetPex()) {
3639
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
3640
        if (lastComparison != 0) {
3641
          return lastComparison;
3642
        }
3643
      }
3644
      return 0;
3645
    }
3646
 
3647
    public _Fields fieldForId(int fieldId) {
3648
      return _Fields.findByThriftId(fieldId);
3649
    }
3650
 
3651
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3652
      org.apache.thrift.protocol.TField field;
3653
      iprot.readStructBegin();
3654
      while (true)
3655
      {
3656
        field = iprot.readFieldBegin();
3657
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3658
          break;
3659
        }
3660
        switch (field.id) {
3661
          case 0: // SUCCESS
3662
            if (field.type == org.apache.thrift.protocol.TType.I64) {
3663
              this.success = iprot.readI64();
3664
              setSuccessIsSet(true);
3665
            } else { 
3666
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3667
            }
3668
            break;
3669
          case 1: // PEX
3670
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3671
              this.pex = new PromotionException();
3672
              this.pex.read(iprot);
3673
            } else { 
3674
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3675
            }
3676
            break;
3677
          default:
3678
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3679
        }
3680
        iprot.readFieldEnd();
3681
      }
3682
      iprot.readStructEnd();
3683
      validate();
3684
    }
3685
 
3686
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3687
      oprot.writeStructBegin(STRUCT_DESC);
3688
 
3689
      if (this.isSetSuccess()) {
3690
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
3691
        oprot.writeI64(this.success);
3692
        oprot.writeFieldEnd();
3693
      } else if (this.isSetPex()) {
3694
        oprot.writeFieldBegin(PEX_FIELD_DESC);
3695
        this.pex.write(oprot);
3696
        oprot.writeFieldEnd();
3697
      }
3698
      oprot.writeFieldStop();
3699
      oprot.writeStructEnd();
3700
    }
3701
 
3702
    @Override
3703
    public String toString() {
3704
      StringBuilder sb = new StringBuilder("removeAllCouponsByPromotionId_result(");
3705
      boolean first = true;
3706
 
3707
      sb.append("success:");
3708
      sb.append(this.success);
3709
      first = false;
3710
      if (!first) sb.append(", ");
3711
      sb.append("pex:");
3712
      if (this.pex == null) {
3713
        sb.append("null");
3714
      } else {
3715
        sb.append(this.pex);
3716
      }
3717
      first = false;
3718
      sb.append(")");
3719
      return sb.toString();
3720
    }
3721
 
3722
    public void validate() throws org.apache.thrift.TException {
3723
      // check for required fields
3724
    }
3725
 
3726
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3727
      try {
3728
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3729
      } catch (org.apache.thrift.TException te) {
3730
        throw new java.io.IOException(te);
3731
      }
3732
    }
3733
 
3734
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3735
      try {
3736
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3737
      } catch (org.apache.thrift.TException te) {
3738
        throw new java.io.IOException(te);
3739
      }
3740
    }
3741
 
3742
  }
3743
 
6301 amit.gupta 3744
  public static class getCoupon_args implements org.apache.thrift.TBase<getCoupon_args, getCoupon_args._Fields>, java.io.Serializable, Cloneable   {
3745
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCoupon_args");
3746
 
3747
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)1);
3748
 
3749
    private String couponCode; // required
3750
 
3751
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3752
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3753
      COUPON_CODE((short)1, "couponCode");
3754
 
3755
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3756
 
3757
      static {
3758
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3759
          byName.put(field.getFieldName(), field);
3760
        }
3761
      }
3762
 
3763
      /**
3764
       * Find the _Fields constant that matches fieldId, or null if its not found.
3765
       */
3766
      public static _Fields findByThriftId(int fieldId) {
3767
        switch(fieldId) {
3768
          case 1: // COUPON_CODE
3769
            return COUPON_CODE;
3770
          default:
3771
            return null;
3772
        }
3773
      }
3774
 
3775
      /**
3776
       * Find the _Fields constant that matches fieldId, throwing an exception
3777
       * if it is not found.
3778
       */
3779
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3780
        _Fields fields = findByThriftId(fieldId);
3781
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3782
        return fields;
3783
      }
3784
 
3785
      /**
3786
       * Find the _Fields constant that matches name, or null if its not found.
3787
       */
3788
      public static _Fields findByName(String name) {
3789
        return byName.get(name);
3790
      }
3791
 
3792
      private final short _thriftId;
3793
      private final String _fieldName;
3794
 
3795
      _Fields(short thriftId, String fieldName) {
3796
        _thriftId = thriftId;
3797
        _fieldName = fieldName;
3798
      }
3799
 
3800
      public short getThriftFieldId() {
3801
        return _thriftId;
3802
      }
3803
 
3804
      public String getFieldName() {
3805
        return _fieldName;
3806
      }
3807
    }
3808
 
3809
    // isset id assignments
3810
 
3811
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3812
    static {
3813
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3814
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3815
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
3816
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3817
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCoupon_args.class, metaDataMap);
3818
    }
3819
 
3820
    public getCoupon_args() {
3821
    }
3822
 
3823
    public getCoupon_args(
3824
      String couponCode)
3825
    {
3826
      this();
3827
      this.couponCode = couponCode;
3828
    }
3829
 
3830
    /**
3831
     * Performs a deep copy on <i>other</i>.
3832
     */
3833
    public getCoupon_args(getCoupon_args other) {
3834
      if (other.isSetCouponCode()) {
3835
        this.couponCode = other.couponCode;
3836
      }
3837
    }
3838
 
3839
    public getCoupon_args deepCopy() {
3840
      return new getCoupon_args(this);
3841
    }
3842
 
3843
    @Override
3844
    public void clear() {
3845
      this.couponCode = null;
3846
    }
3847
 
3848
    public String getCouponCode() {
3849
      return this.couponCode;
3850
    }
3851
 
3852
    public void setCouponCode(String couponCode) {
3853
      this.couponCode = couponCode;
3854
    }
3855
 
3856
    public void unsetCouponCode() {
3857
      this.couponCode = null;
3858
    }
3859
 
3860
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3861
    public boolean isSetCouponCode() {
3862
      return this.couponCode != null;
3863
    }
3864
 
3865
    public void setCouponCodeIsSet(boolean value) {
3866
      if (!value) {
3867
        this.couponCode = null;
3868
      }
3869
    }
3870
 
3871
    public void setFieldValue(_Fields field, Object value) {
3872
      switch (field) {
3873
      case COUPON_CODE:
3874
        if (value == null) {
3875
          unsetCouponCode();
3876
        } else {
3877
          setCouponCode((String)value);
3878
        }
3879
        break;
3880
 
3881
      }
3882
    }
3883
 
3884
    public Object getFieldValue(_Fields field) {
3885
      switch (field) {
3886
      case COUPON_CODE:
3887
        return getCouponCode();
3888
 
3889
      }
3890
      throw new IllegalStateException();
3891
    }
3892
 
3893
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3894
    public boolean isSet(_Fields field) {
3895
      if (field == null) {
3896
        throw new IllegalArgumentException();
3897
      }
3898
 
3899
      switch (field) {
3900
      case COUPON_CODE:
3901
        return isSetCouponCode();
3902
      }
3903
      throw new IllegalStateException();
3904
    }
3905
 
3906
    @Override
3907
    public boolean equals(Object that) {
3908
      if (that == null)
3909
        return false;
3910
      if (that instanceof getCoupon_args)
3911
        return this.equals((getCoupon_args)that);
3912
      return false;
3913
    }
3914
 
3915
    public boolean equals(getCoupon_args that) {
3916
      if (that == null)
3917
        return false;
3918
 
3919
      boolean this_present_couponCode = true && this.isSetCouponCode();
3920
      boolean that_present_couponCode = true && that.isSetCouponCode();
3921
      if (this_present_couponCode || that_present_couponCode) {
3922
        if (!(this_present_couponCode && that_present_couponCode))
3923
          return false;
3924
        if (!this.couponCode.equals(that.couponCode))
3925
          return false;
3926
      }
3927
 
3928
      return true;
3929
    }
3930
 
3931
    @Override
3932
    public int hashCode() {
3933
      return 0;
3934
    }
3935
 
3936
    public int compareTo(getCoupon_args other) {
3937
      if (!getClass().equals(other.getClass())) {
3938
        return getClass().getName().compareTo(other.getClass().getName());
3939
      }
3940
 
3941
      int lastComparison = 0;
3942
      getCoupon_args typedOther = (getCoupon_args)other;
3943
 
3944
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3945
      if (lastComparison != 0) {
3946
        return lastComparison;
3947
      }
3948
      if (isSetCouponCode()) {
3949
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
3950
        if (lastComparison != 0) {
3951
          return lastComparison;
3952
        }
3953
      }
3954
      return 0;
3955
    }
3956
 
3957
    public _Fields fieldForId(int fieldId) {
3958
      return _Fields.findByThriftId(fieldId);
3959
    }
3960
 
3961
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3962
      org.apache.thrift.protocol.TField field;
3963
      iprot.readStructBegin();
3964
      while (true)
3965
      {
3966
        field = iprot.readFieldBegin();
3967
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3968
          break;
3969
        }
3970
        switch (field.id) {
3971
          case 1: // COUPON_CODE
3972
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
3973
              this.couponCode = iprot.readString();
3974
            } else { 
3975
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3976
            }
3977
            break;
3978
          default:
3979
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3980
        }
3981
        iprot.readFieldEnd();
3982
      }
3983
      iprot.readStructEnd();
3984
      validate();
3985
    }
3986
 
3987
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3988
      validate();
3989
 
3990
      oprot.writeStructBegin(STRUCT_DESC);
3991
      if (this.couponCode != null) {
3992
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
3993
        oprot.writeString(this.couponCode);
3994
        oprot.writeFieldEnd();
3995
      }
3996
      oprot.writeFieldStop();
3997
      oprot.writeStructEnd();
3998
    }
3999
 
4000
    @Override
4001
    public String toString() {
4002
      StringBuilder sb = new StringBuilder("getCoupon_args(");
4003
      boolean first = true;
4004
 
4005
      sb.append("couponCode:");
4006
      if (this.couponCode == null) {
4007
        sb.append("null");
4008
      } else {
4009
        sb.append(this.couponCode);
4010
      }
4011
      first = false;
4012
      sb.append(")");
4013
      return sb.toString();
4014
    }
4015
 
4016
    public void validate() throws org.apache.thrift.TException {
4017
      // check for required fields
4018
    }
4019
 
4020
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4021
      try {
4022
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4023
      } catch (org.apache.thrift.TException te) {
4024
        throw new java.io.IOException(te);
4025
      }
4026
    }
4027
 
4028
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4029
      try {
4030
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4031
      } catch (org.apache.thrift.TException te) {
4032
        throw new java.io.IOException(te);
4033
      }
4034
    }
4035
 
4036
  }
4037
 
4038
  public static class getCoupon_result implements org.apache.thrift.TBase<getCoupon_result, getCoupon_result._Fields>, java.io.Serializable, Cloneable   {
4039
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCoupon_result");
4040
 
4041
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
4042
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
4043
 
4044
    private Coupon success; // required
4045
    private PromotionException pex; // required
4046
 
4047
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4048
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4049
      SUCCESS((short)0, "success"),
4050
      PEX((short)1, "pex");
4051
 
4052
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4053
 
4054
      static {
4055
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4056
          byName.put(field.getFieldName(), field);
4057
        }
4058
      }
4059
 
4060
      /**
4061
       * Find the _Fields constant that matches fieldId, or null if its not found.
4062
       */
4063
      public static _Fields findByThriftId(int fieldId) {
4064
        switch(fieldId) {
4065
          case 0: // SUCCESS
4066
            return SUCCESS;
4067
          case 1: // PEX
4068
            return PEX;
4069
          default:
4070
            return null;
4071
        }
4072
      }
4073
 
4074
      /**
4075
       * Find the _Fields constant that matches fieldId, throwing an exception
4076
       * if it is not found.
4077
       */
4078
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4079
        _Fields fields = findByThriftId(fieldId);
4080
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4081
        return fields;
4082
      }
4083
 
4084
      /**
4085
       * Find the _Fields constant that matches name, or null if its not found.
4086
       */
4087
      public static _Fields findByName(String name) {
4088
        return byName.get(name);
4089
      }
4090
 
4091
      private final short _thriftId;
4092
      private final String _fieldName;
4093
 
4094
      _Fields(short thriftId, String fieldName) {
4095
        _thriftId = thriftId;
4096
        _fieldName = fieldName;
4097
      }
4098
 
4099
      public short getThriftFieldId() {
4100
        return _thriftId;
4101
      }
4102
 
4103
      public String getFieldName() {
4104
        return _fieldName;
4105
      }
4106
    }
4107
 
4108
    // isset id assignments
4109
 
4110
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4111
    static {
4112
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4113
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4114
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class)));
4115
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4116
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4117
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4118
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCoupon_result.class, metaDataMap);
4119
    }
4120
 
4121
    public getCoupon_result() {
4122
    }
4123
 
4124
    public getCoupon_result(
4125
      Coupon success,
4126
      PromotionException pex)
4127
    {
4128
      this();
4129
      this.success = success;
4130
      this.pex = pex;
4131
    }
4132
 
4133
    /**
4134
     * Performs a deep copy on <i>other</i>.
4135
     */
4136
    public getCoupon_result(getCoupon_result other) {
4137
      if (other.isSetSuccess()) {
4138
        this.success = new Coupon(other.success);
4139
      }
4140
      if (other.isSetPex()) {
4141
        this.pex = new PromotionException(other.pex);
4142
      }
4143
    }
4144
 
4145
    public getCoupon_result deepCopy() {
4146
      return new getCoupon_result(this);
4147
    }
4148
 
4149
    @Override
4150
    public void clear() {
4151
      this.success = null;
4152
      this.pex = null;
4153
    }
4154
 
4155
    public Coupon getSuccess() {
4156
      return this.success;
4157
    }
4158
 
4159
    public void setSuccess(Coupon success) {
4160
      this.success = success;
4161
    }
4162
 
4163
    public void unsetSuccess() {
4164
      this.success = null;
4165
    }
4166
 
4167
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
4168
    public boolean isSetSuccess() {
4169
      return this.success != null;
4170
    }
4171
 
4172
    public void setSuccessIsSet(boolean value) {
4173
      if (!value) {
4174
        this.success = null;
4175
      }
4176
    }
4177
 
4178
    public PromotionException getPex() {
4179
      return this.pex;
4180
    }
4181
 
4182
    public void setPex(PromotionException pex) {
4183
      this.pex = pex;
4184
    }
4185
 
4186
    public void unsetPex() {
4187
      this.pex = null;
4188
    }
4189
 
4190
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
4191
    public boolean isSetPex() {
4192
      return this.pex != null;
4193
    }
4194
 
4195
    public void setPexIsSet(boolean value) {
4196
      if (!value) {
4197
        this.pex = null;
4198
      }
4199
    }
4200
 
4201
    public void setFieldValue(_Fields field, Object value) {
4202
      switch (field) {
4203
      case SUCCESS:
4204
        if (value == null) {
4205
          unsetSuccess();
4206
        } else {
4207
          setSuccess((Coupon)value);
4208
        }
4209
        break;
4210
 
4211
      case PEX:
4212
        if (value == null) {
4213
          unsetPex();
4214
        } else {
4215
          setPex((PromotionException)value);
4216
        }
4217
        break;
4218
 
4219
      }
4220
    }
4221
 
4222
    public Object getFieldValue(_Fields field) {
4223
      switch (field) {
4224
      case SUCCESS:
4225
        return getSuccess();
4226
 
4227
      case PEX:
4228
        return getPex();
4229
 
4230
      }
4231
      throw new IllegalStateException();
4232
    }
4233
 
4234
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4235
    public boolean isSet(_Fields field) {
4236
      if (field == null) {
4237
        throw new IllegalArgumentException();
4238
      }
4239
 
4240
      switch (field) {
4241
      case SUCCESS:
4242
        return isSetSuccess();
4243
      case PEX:
4244
        return isSetPex();
4245
      }
4246
      throw new IllegalStateException();
4247
    }
4248
 
4249
    @Override
4250
    public boolean equals(Object that) {
4251
      if (that == null)
4252
        return false;
4253
      if (that instanceof getCoupon_result)
4254
        return this.equals((getCoupon_result)that);
4255
      return false;
4256
    }
4257
 
4258
    public boolean equals(getCoupon_result that) {
4259
      if (that == null)
4260
        return false;
4261
 
4262
      boolean this_present_success = true && this.isSetSuccess();
4263
      boolean that_present_success = true && that.isSetSuccess();
4264
      if (this_present_success || that_present_success) {
4265
        if (!(this_present_success && that_present_success))
4266
          return false;
4267
        if (!this.success.equals(that.success))
4268
          return false;
4269
      }
4270
 
4271
      boolean this_present_pex = true && this.isSetPex();
4272
      boolean that_present_pex = true && that.isSetPex();
4273
      if (this_present_pex || that_present_pex) {
4274
        if (!(this_present_pex && that_present_pex))
4275
          return false;
4276
        if (!this.pex.equals(that.pex))
4277
          return false;
4278
      }
4279
 
4280
      return true;
4281
    }
4282
 
4283
    @Override
4284
    public int hashCode() {
4285
      return 0;
4286
    }
4287
 
4288
    public int compareTo(getCoupon_result other) {
4289
      if (!getClass().equals(other.getClass())) {
4290
        return getClass().getName().compareTo(other.getClass().getName());
4291
      }
4292
 
4293
      int lastComparison = 0;
4294
      getCoupon_result typedOther = (getCoupon_result)other;
4295
 
4296
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
4297
      if (lastComparison != 0) {
4298
        return lastComparison;
4299
      }
4300
      if (isSetSuccess()) {
4301
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4302
        if (lastComparison != 0) {
4303
          return lastComparison;
4304
        }
4305
      }
4306
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
4307
      if (lastComparison != 0) {
4308
        return lastComparison;
4309
      }
4310
      if (isSetPex()) {
4311
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
4312
        if (lastComparison != 0) {
4313
          return lastComparison;
4314
        }
4315
      }
4316
      return 0;
4317
    }
4318
 
4319
    public _Fields fieldForId(int fieldId) {
4320
      return _Fields.findByThriftId(fieldId);
4321
    }
4322
 
4323
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4324
      org.apache.thrift.protocol.TField field;
4325
      iprot.readStructBegin();
4326
      while (true)
4327
      {
4328
        field = iprot.readFieldBegin();
4329
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4330
          break;
4331
        }
4332
        switch (field.id) {
4333
          case 0: // SUCCESS
4334
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4335
              this.success = new Coupon();
4336
              this.success.read(iprot);
4337
            } else { 
4338
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4339
            }
4340
            break;
4341
          case 1: // PEX
4342
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4343
              this.pex = new PromotionException();
4344
              this.pex.read(iprot);
4345
            } else { 
4346
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4347
            }
4348
            break;
4349
          default:
4350
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4351
        }
4352
        iprot.readFieldEnd();
4353
      }
4354
      iprot.readStructEnd();
4355
      validate();
4356
    }
4357
 
4358
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4359
      oprot.writeStructBegin(STRUCT_DESC);
4360
 
4361
      if (this.isSetSuccess()) {
4362
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4363
        this.success.write(oprot);
4364
        oprot.writeFieldEnd();
4365
      } else if (this.isSetPex()) {
4366
        oprot.writeFieldBegin(PEX_FIELD_DESC);
4367
        this.pex.write(oprot);
4368
        oprot.writeFieldEnd();
4369
      }
4370
      oprot.writeFieldStop();
4371
      oprot.writeStructEnd();
4372
    }
4373
 
4374
    @Override
4375
    public String toString() {
4376
      StringBuilder sb = new StringBuilder("getCoupon_result(");
4377
      boolean first = true;
4378
 
4379
      sb.append("success:");
4380
      if (this.success == null) {
4381
        sb.append("null");
4382
      } else {
4383
        sb.append(this.success);
4384
      }
4385
      first = false;
4386
      if (!first) sb.append(", ");
4387
      sb.append("pex:");
4388
      if (this.pex == null) {
4389
        sb.append("null");
4390
      } else {
4391
        sb.append(this.pex);
4392
      }
4393
      first = false;
4394
      sb.append(")");
4395
      return sb.toString();
4396
    }
4397
 
4398
    public void validate() throws org.apache.thrift.TException {
4399
      // check for required fields
4400
    }
4401
 
4402
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4403
      try {
4404
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4405
      } catch (org.apache.thrift.TException te) {
4406
        throw new java.io.IOException(te);
4407
      }
4408
    }
4409
 
4410
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4411
      try {
4412
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4413
      } catch (org.apache.thrift.TException te) {
4414
        throw new java.io.IOException(te);
4415
      }
4416
    }
4417
 
4418
  }
4419
 
4420
  public static class isGiftVoucher_args implements org.apache.thrift.TBase<isGiftVoucher_args, isGiftVoucher_args._Fields>, java.io.Serializable, Cloneable   {
4421
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isGiftVoucher_args");
4422
 
4423
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)1);
4424
 
4425
    private String couponCode; // required
4426
 
4427
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4428
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4429
      COUPON_CODE((short)1, "couponCode");
4430
 
4431
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4432
 
4433
      static {
4434
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4435
          byName.put(field.getFieldName(), field);
4436
        }
4437
      }
4438
 
4439
      /**
4440
       * Find the _Fields constant that matches fieldId, or null if its not found.
4441
       */
4442
      public static _Fields findByThriftId(int fieldId) {
4443
        switch(fieldId) {
4444
          case 1: // COUPON_CODE
4445
            return COUPON_CODE;
4446
          default:
4447
            return null;
4448
        }
4449
      }
4450
 
4451
      /**
4452
       * Find the _Fields constant that matches fieldId, throwing an exception
4453
       * if it is not found.
4454
       */
4455
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4456
        _Fields fields = findByThriftId(fieldId);
4457
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4458
        return fields;
4459
      }
4460
 
4461
      /**
4462
       * Find the _Fields constant that matches name, or null if its not found.
4463
       */
4464
      public static _Fields findByName(String name) {
4465
        return byName.get(name);
4466
      }
4467
 
4468
      private final short _thriftId;
4469
      private final String _fieldName;
4470
 
4471
      _Fields(short thriftId, String fieldName) {
4472
        _thriftId = thriftId;
4473
        _fieldName = fieldName;
4474
      }
4475
 
4476
      public short getThriftFieldId() {
4477
        return _thriftId;
4478
      }
4479
 
4480
      public String getFieldName() {
4481
        return _fieldName;
4482
      }
4483
    }
4484
 
4485
    // isset id assignments
4486
 
4487
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4488
    static {
4489
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4490
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4491
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
4492
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4493
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isGiftVoucher_args.class, metaDataMap);
4494
    }
4495
 
4496
    public isGiftVoucher_args() {
4497
    }
4498
 
4499
    public isGiftVoucher_args(
4500
      String couponCode)
4501
    {
4502
      this();
4503
      this.couponCode = couponCode;
4504
    }
4505
 
4506
    /**
4507
     * Performs a deep copy on <i>other</i>.
4508
     */
4509
    public isGiftVoucher_args(isGiftVoucher_args other) {
4510
      if (other.isSetCouponCode()) {
4511
        this.couponCode = other.couponCode;
4512
      }
4513
    }
4514
 
4515
    public isGiftVoucher_args deepCopy() {
4516
      return new isGiftVoucher_args(this);
4517
    }
4518
 
4519
    @Override
4520
    public void clear() {
4521
      this.couponCode = null;
4522
    }
4523
 
4524
    public String getCouponCode() {
4525
      return this.couponCode;
4526
    }
4527
 
4528
    public void setCouponCode(String couponCode) {
4529
      this.couponCode = couponCode;
4530
    }
4531
 
4532
    public void unsetCouponCode() {
4533
      this.couponCode = null;
4534
    }
4535
 
4536
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
4537
    public boolean isSetCouponCode() {
4538
      return this.couponCode != null;
4539
    }
4540
 
4541
    public void setCouponCodeIsSet(boolean value) {
4542
      if (!value) {
4543
        this.couponCode = null;
4544
      }
4545
    }
4546
 
4547
    public void setFieldValue(_Fields field, Object value) {
4548
      switch (field) {
4549
      case COUPON_CODE:
4550
        if (value == null) {
4551
          unsetCouponCode();
4552
        } else {
4553
          setCouponCode((String)value);
4554
        }
4555
        break;
4556
 
4557
      }
4558
    }
4559
 
4560
    public Object getFieldValue(_Fields field) {
4561
      switch (field) {
4562
      case COUPON_CODE:
4563
        return getCouponCode();
4564
 
4565
      }
4566
      throw new IllegalStateException();
4567
    }
4568
 
4569
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4570
    public boolean isSet(_Fields field) {
4571
      if (field == null) {
4572
        throw new IllegalArgumentException();
4573
      }
4574
 
4575
      switch (field) {
4576
      case COUPON_CODE:
4577
        return isSetCouponCode();
4578
      }
4579
      throw new IllegalStateException();
4580
    }
4581
 
4582
    @Override
4583
    public boolean equals(Object that) {
4584
      if (that == null)
4585
        return false;
4586
      if (that instanceof isGiftVoucher_args)
4587
        return this.equals((isGiftVoucher_args)that);
4588
      return false;
4589
    }
4590
 
4591
    public boolean equals(isGiftVoucher_args that) {
4592
      if (that == null)
4593
        return false;
4594
 
4595
      boolean this_present_couponCode = true && this.isSetCouponCode();
4596
      boolean that_present_couponCode = true && that.isSetCouponCode();
4597
      if (this_present_couponCode || that_present_couponCode) {
4598
        if (!(this_present_couponCode && that_present_couponCode))
4599
          return false;
4600
        if (!this.couponCode.equals(that.couponCode))
4601
          return false;
4602
      }
4603
 
4604
      return true;
4605
    }
4606
 
4607
    @Override
4608
    public int hashCode() {
4609
      return 0;
4610
    }
4611
 
4612
    public int compareTo(isGiftVoucher_args other) {
4613
      if (!getClass().equals(other.getClass())) {
4614
        return getClass().getName().compareTo(other.getClass().getName());
4615
      }
4616
 
4617
      int lastComparison = 0;
4618
      isGiftVoucher_args typedOther = (isGiftVoucher_args)other;
4619
 
4620
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
4621
      if (lastComparison != 0) {
4622
        return lastComparison;
4623
      }
4624
      if (isSetCouponCode()) {
4625
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
4626
        if (lastComparison != 0) {
4627
          return lastComparison;
4628
        }
4629
      }
4630
      return 0;
4631
    }
4632
 
4633
    public _Fields fieldForId(int fieldId) {
4634
      return _Fields.findByThriftId(fieldId);
4635
    }
4636
 
4637
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4638
      org.apache.thrift.protocol.TField field;
4639
      iprot.readStructBegin();
4640
      while (true)
4641
      {
4642
        field = iprot.readFieldBegin();
4643
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4644
          break;
4645
        }
4646
        switch (field.id) {
4647
          case 1: // COUPON_CODE
4648
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
4649
              this.couponCode = iprot.readString();
4650
            } else { 
4651
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4652
            }
4653
            break;
4654
          default:
4655
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4656
        }
4657
        iprot.readFieldEnd();
4658
      }
4659
      iprot.readStructEnd();
4660
      validate();
4661
    }
4662
 
4663
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4664
      validate();
4665
 
4666
      oprot.writeStructBegin(STRUCT_DESC);
4667
      if (this.couponCode != null) {
4668
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
4669
        oprot.writeString(this.couponCode);
4670
        oprot.writeFieldEnd();
4671
      }
4672
      oprot.writeFieldStop();
4673
      oprot.writeStructEnd();
4674
    }
4675
 
4676
    @Override
4677
    public String toString() {
4678
      StringBuilder sb = new StringBuilder("isGiftVoucher_args(");
4679
      boolean first = true;
4680
 
4681
      sb.append("couponCode:");
4682
      if (this.couponCode == null) {
4683
        sb.append("null");
4684
      } else {
4685
        sb.append(this.couponCode);
4686
      }
4687
      first = false;
4688
      sb.append(")");
4689
      return sb.toString();
4690
    }
4691
 
4692
    public void validate() throws org.apache.thrift.TException {
4693
      // check for required fields
4694
    }
4695
 
4696
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4697
      try {
4698
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4699
      } catch (org.apache.thrift.TException te) {
4700
        throw new java.io.IOException(te);
4701
      }
4702
    }
4703
 
4704
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4705
      try {
4706
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4707
      } catch (org.apache.thrift.TException te) {
4708
        throw new java.io.IOException(te);
4709
      }
4710
    }
4711
 
4712
  }
4713
 
4714
  public static class isGiftVoucher_result implements org.apache.thrift.TBase<isGiftVoucher_result, isGiftVoucher_result._Fields>, java.io.Serializable, Cloneable   {
4715
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isGiftVoucher_result");
4716
 
4717
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
4718
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
4719
 
4720
    private boolean success; // required
4721
    private PromotionException pex; // required
4722
 
4723
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4724
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4725
      SUCCESS((short)0, "success"),
4726
      PEX((short)1, "pex");
4727
 
4728
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4729
 
4730
      static {
4731
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4732
          byName.put(field.getFieldName(), field);
4733
        }
4734
      }
4735
 
4736
      /**
4737
       * Find the _Fields constant that matches fieldId, or null if its not found.
4738
       */
4739
      public static _Fields findByThriftId(int fieldId) {
4740
        switch(fieldId) {
4741
          case 0: // SUCCESS
4742
            return SUCCESS;
4743
          case 1: // PEX
4744
            return PEX;
4745
          default:
4746
            return null;
4747
        }
4748
      }
4749
 
4750
      /**
4751
       * Find the _Fields constant that matches fieldId, throwing an exception
4752
       * if it is not found.
4753
       */
4754
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4755
        _Fields fields = findByThriftId(fieldId);
4756
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4757
        return fields;
4758
      }
4759
 
4760
      /**
4761
       * Find the _Fields constant that matches name, or null if its not found.
4762
       */
4763
      public static _Fields findByName(String name) {
4764
        return byName.get(name);
4765
      }
4766
 
4767
      private final short _thriftId;
4768
      private final String _fieldName;
4769
 
4770
      _Fields(short thriftId, String fieldName) {
4771
        _thriftId = thriftId;
4772
        _fieldName = fieldName;
4773
      }
4774
 
4775
      public short getThriftFieldId() {
4776
        return _thriftId;
4777
      }
4778
 
4779
      public String getFieldName() {
4780
        return _fieldName;
4781
      }
4782
    }
4783
 
4784
    // isset id assignments
4785
    private static final int __SUCCESS_ISSET_ID = 0;
4786
    private BitSet __isset_bit_vector = new BitSet(1);
4787
 
4788
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4789
    static {
4790
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4791
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4792
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
4793
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4794
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4795
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4796
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isGiftVoucher_result.class, metaDataMap);
4797
    }
4798
 
4799
    public isGiftVoucher_result() {
4800
    }
4801
 
4802
    public isGiftVoucher_result(
4803
      boolean success,
4804
      PromotionException pex)
4805
    {
4806
      this();
4807
      this.success = success;
4808
      setSuccessIsSet(true);
4809
      this.pex = pex;
4810
    }
4811
 
4812
    /**
4813
     * Performs a deep copy on <i>other</i>.
4814
     */
4815
    public isGiftVoucher_result(isGiftVoucher_result other) {
4816
      __isset_bit_vector.clear();
4817
      __isset_bit_vector.or(other.__isset_bit_vector);
4818
      this.success = other.success;
4819
      if (other.isSetPex()) {
4820
        this.pex = new PromotionException(other.pex);
4821
      }
4822
    }
4823
 
4824
    public isGiftVoucher_result deepCopy() {
4825
      return new isGiftVoucher_result(this);
4826
    }
4827
 
4828
    @Override
4829
    public void clear() {
4830
      setSuccessIsSet(false);
4831
      this.success = false;
4832
      this.pex = null;
4833
    }
4834
 
4835
    public boolean isSuccess() {
4836
      return this.success;
4837
    }
4838
 
4839
    public void setSuccess(boolean success) {
4840
      this.success = success;
4841
      setSuccessIsSet(true);
4842
    }
4843
 
4844
    public void unsetSuccess() {
4845
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
4846
    }
4847
 
4848
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
4849
    public boolean isSetSuccess() {
4850
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
4851
    }
4852
 
4853
    public void setSuccessIsSet(boolean value) {
4854
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
4855
    }
4856
 
4857
    public PromotionException getPex() {
4858
      return this.pex;
4859
    }
4860
 
4861
    public void setPex(PromotionException pex) {
4862
      this.pex = pex;
4863
    }
4864
 
4865
    public void unsetPex() {
4866
      this.pex = null;
4867
    }
4868
 
4869
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
4870
    public boolean isSetPex() {
4871
      return this.pex != null;
4872
    }
4873
 
4874
    public void setPexIsSet(boolean value) {
4875
      if (!value) {
4876
        this.pex = null;
4877
      }
4878
    }
4879
 
4880
    public void setFieldValue(_Fields field, Object value) {
4881
      switch (field) {
4882
      case SUCCESS:
4883
        if (value == null) {
4884
          unsetSuccess();
4885
        } else {
4886
          setSuccess((Boolean)value);
4887
        }
4888
        break;
4889
 
4890
      case PEX:
4891
        if (value == null) {
4892
          unsetPex();
4893
        } else {
4894
          setPex((PromotionException)value);
4895
        }
4896
        break;
4897
 
4898
      }
4899
    }
4900
 
4901
    public Object getFieldValue(_Fields field) {
4902
      switch (field) {
4903
      case SUCCESS:
4904
        return Boolean.valueOf(isSuccess());
4905
 
4906
      case PEX:
4907
        return getPex();
4908
 
4909
      }
4910
      throw new IllegalStateException();
4911
    }
4912
 
4913
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4914
    public boolean isSet(_Fields field) {
4915
      if (field == null) {
4916
        throw new IllegalArgumentException();
4917
      }
4918
 
4919
      switch (field) {
4920
      case SUCCESS:
4921
        return isSetSuccess();
4922
      case PEX:
4923
        return isSetPex();
4924
      }
4925
      throw new IllegalStateException();
4926
    }
4927
 
4928
    @Override
4929
    public boolean equals(Object that) {
4930
      if (that == null)
4931
        return false;
4932
      if (that instanceof isGiftVoucher_result)
4933
        return this.equals((isGiftVoucher_result)that);
4934
      return false;
4935
    }
4936
 
4937
    public boolean equals(isGiftVoucher_result that) {
4938
      if (that == null)
4939
        return false;
4940
 
4941
      boolean this_present_success = true;
4942
      boolean that_present_success = true;
4943
      if (this_present_success || that_present_success) {
4944
        if (!(this_present_success && that_present_success))
4945
          return false;
4946
        if (this.success != that.success)
4947
          return false;
4948
      }
4949
 
4950
      boolean this_present_pex = true && this.isSetPex();
4951
      boolean that_present_pex = true && that.isSetPex();
4952
      if (this_present_pex || that_present_pex) {
4953
        if (!(this_present_pex && that_present_pex))
4954
          return false;
4955
        if (!this.pex.equals(that.pex))
4956
          return false;
4957
      }
4958
 
4959
      return true;
4960
    }
4961
 
4962
    @Override
4963
    public int hashCode() {
4964
      return 0;
4965
    }
4966
 
4967
    public int compareTo(isGiftVoucher_result other) {
4968
      if (!getClass().equals(other.getClass())) {
4969
        return getClass().getName().compareTo(other.getClass().getName());
4970
      }
4971
 
4972
      int lastComparison = 0;
4973
      isGiftVoucher_result typedOther = (isGiftVoucher_result)other;
4974
 
4975
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
4976
      if (lastComparison != 0) {
4977
        return lastComparison;
4978
      }
4979
      if (isSetSuccess()) {
4980
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4981
        if (lastComparison != 0) {
4982
          return lastComparison;
4983
        }
4984
      }
4985
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
4986
      if (lastComparison != 0) {
4987
        return lastComparison;
4988
      }
4989
      if (isSetPex()) {
4990
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
4991
        if (lastComparison != 0) {
4992
          return lastComparison;
4993
        }
4994
      }
4995
      return 0;
4996
    }
4997
 
4998
    public _Fields fieldForId(int fieldId) {
4999
      return _Fields.findByThriftId(fieldId);
5000
    }
5001
 
5002
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5003
      org.apache.thrift.protocol.TField field;
5004
      iprot.readStructBegin();
5005
      while (true)
5006
      {
5007
        field = iprot.readFieldBegin();
5008
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
5009
          break;
5010
        }
5011
        switch (field.id) {
5012
          case 0: // SUCCESS
5013
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
5014
              this.success = iprot.readBool();
5015
              setSuccessIsSet(true);
5016
            } else { 
5017
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5018
            }
5019
            break;
5020
          case 1: // PEX
5021
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5022
              this.pex = new PromotionException();
5023
              this.pex.read(iprot);
5024
            } else { 
5025
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5026
            }
5027
            break;
5028
          default:
5029
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5030
        }
5031
        iprot.readFieldEnd();
5032
      }
5033
      iprot.readStructEnd();
5034
      validate();
5035
    }
5036
 
5037
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
5038
      oprot.writeStructBegin(STRUCT_DESC);
5039
 
5040
      if (this.isSetSuccess()) {
5041
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
5042
        oprot.writeBool(this.success);
5043
        oprot.writeFieldEnd();
5044
      } else if (this.isSetPex()) {
5045
        oprot.writeFieldBegin(PEX_FIELD_DESC);
5046
        this.pex.write(oprot);
5047
        oprot.writeFieldEnd();
5048
      }
5049
      oprot.writeFieldStop();
5050
      oprot.writeStructEnd();
5051
    }
5052
 
5053
    @Override
5054
    public String toString() {
5055
      StringBuilder sb = new StringBuilder("isGiftVoucher_result(");
5056
      boolean first = true;
5057
 
5058
      sb.append("success:");
5059
      sb.append(this.success);
5060
      first = false;
5061
      if (!first) sb.append(", ");
5062
      sb.append("pex:");
5063
      if (this.pex == null) {
5064
        sb.append("null");
5065
      } else {
5066
        sb.append(this.pex);
5067
      }
5068
      first = false;
5069
      sb.append(")");
5070
      return sb.toString();
5071
    }
5072
 
5073
    public void validate() throws org.apache.thrift.TException {
5074
      // check for required fields
5075
    }
5076
 
5077
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5078
      try {
5079
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5080
      } catch (org.apache.thrift.TException te) {
5081
        throw new java.io.IOException(te);
5082
      }
5083
    }
5084
 
5085
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5086
      try {
5087
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5088
      } catch (org.apache.thrift.TException te) {
5089
        throw new java.io.IOException(te);
5090
      }
5091
    }
5092
 
5093
  }
5094
 
6356 amit.gupta 5095
  public static class isCodApplicable_args implements org.apache.thrift.TBase<isCodApplicable_args, isCodApplicable_args._Fields>, java.io.Serializable, Cloneable   {
5096
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isCodApplicable_args");
5097
 
11819 amit.gupta 5098
    private static final org.apache.thrift.protocol.TField CART_FIELD_DESC = new org.apache.thrift.protocol.TField("cart", org.apache.thrift.protocol.TType.STRUCT, (short)1);
6356 amit.gupta 5099
 
11819 amit.gupta 5100
    private Cart cart; // required
6356 amit.gupta 5101
 
5102
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
5103
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11819 amit.gupta 5104
      CART((short)1, "cart");
6356 amit.gupta 5105
 
5106
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5107
 
5108
      static {
5109
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5110
          byName.put(field.getFieldName(), field);
5111
        }
5112
      }
5113
 
5114
      /**
5115
       * Find the _Fields constant that matches fieldId, or null if its not found.
5116
       */
5117
      public static _Fields findByThriftId(int fieldId) {
5118
        switch(fieldId) {
11819 amit.gupta 5119
          case 1: // CART
5120
            return CART;
6356 amit.gupta 5121
          default:
5122
            return null;
5123
        }
5124
      }
5125
 
5126
      /**
5127
       * Find the _Fields constant that matches fieldId, throwing an exception
5128
       * if it is not found.
5129
       */
5130
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5131
        _Fields fields = findByThriftId(fieldId);
5132
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5133
        return fields;
5134
      }
5135
 
5136
      /**
5137
       * Find the _Fields constant that matches name, or null if its not found.
5138
       */
5139
      public static _Fields findByName(String name) {
5140
        return byName.get(name);
5141
      }
5142
 
5143
      private final short _thriftId;
5144
      private final String _fieldName;
5145
 
5146
      _Fields(short thriftId, String fieldName) {
5147
        _thriftId = thriftId;
5148
        _fieldName = fieldName;
5149
      }
5150
 
5151
      public short getThriftFieldId() {
5152
        return _thriftId;
5153
      }
5154
 
5155
      public String getFieldName() {
5156
        return _fieldName;
5157
      }
5158
    }
5159
 
5160
    // isset id assignments
5161
 
5162
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
5163
    static {
5164
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11819 amit.gupta 5165
      tmpMap.put(_Fields.CART, new org.apache.thrift.meta_data.FieldMetaData("cart", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5166
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Cart.class)));
6356 amit.gupta 5167
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5168
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isCodApplicable_args.class, metaDataMap);
5169
    }
5170
 
5171
    public isCodApplicable_args() {
5172
    }
5173
 
5174
    public isCodApplicable_args(
11819 amit.gupta 5175
      Cart cart)
6356 amit.gupta 5176
    {
5177
      this();
11819 amit.gupta 5178
      this.cart = cart;
6356 amit.gupta 5179
    }
5180
 
5181
    /**
5182
     * Performs a deep copy on <i>other</i>.
5183
     */
5184
    public isCodApplicable_args(isCodApplicable_args other) {
11819 amit.gupta 5185
      if (other.isSetCart()) {
5186
        this.cart = new Cart(other.cart);
6356 amit.gupta 5187
      }
5188
    }
5189
 
5190
    public isCodApplicable_args deepCopy() {
5191
      return new isCodApplicable_args(this);
5192
    }
5193
 
5194
    @Override
5195
    public void clear() {
11819 amit.gupta 5196
      this.cart = null;
6356 amit.gupta 5197
    }
5198
 
11819 amit.gupta 5199
    public Cart getCart() {
5200
      return this.cart;
6356 amit.gupta 5201
    }
5202
 
11819 amit.gupta 5203
    public void setCart(Cart cart) {
5204
      this.cart = cart;
6356 amit.gupta 5205
    }
5206
 
11819 amit.gupta 5207
    public void unsetCart() {
5208
      this.cart = null;
6356 amit.gupta 5209
    }
5210
 
11819 amit.gupta 5211
    /** Returns true if field cart is set (has been assigned a value) and false otherwise */
5212
    public boolean isSetCart() {
5213
      return this.cart != null;
6356 amit.gupta 5214
    }
5215
 
11819 amit.gupta 5216
    public void setCartIsSet(boolean value) {
6356 amit.gupta 5217
      if (!value) {
11819 amit.gupta 5218
        this.cart = null;
6356 amit.gupta 5219
      }
5220
    }
5221
 
5222
    public void setFieldValue(_Fields field, Object value) {
5223
      switch (field) {
11819 amit.gupta 5224
      case CART:
6356 amit.gupta 5225
        if (value == null) {
11819 amit.gupta 5226
          unsetCart();
6356 amit.gupta 5227
        } else {
11819 amit.gupta 5228
          setCart((Cart)value);
6356 amit.gupta 5229
        }
5230
        break;
5231
 
5232
      }
5233
    }
5234
 
5235
    public Object getFieldValue(_Fields field) {
5236
      switch (field) {
11819 amit.gupta 5237
      case CART:
5238
        return getCart();
6356 amit.gupta 5239
 
5240
      }
5241
      throw new IllegalStateException();
5242
    }
5243
 
5244
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5245
    public boolean isSet(_Fields field) {
5246
      if (field == null) {
5247
        throw new IllegalArgumentException();
5248
      }
5249
 
5250
      switch (field) {
11819 amit.gupta 5251
      case CART:
5252
        return isSetCart();
6356 amit.gupta 5253
      }
5254
      throw new IllegalStateException();
5255
    }
5256
 
5257
    @Override
5258
    public boolean equals(Object that) {
5259
      if (that == null)
5260
        return false;
5261
      if (that instanceof isCodApplicable_args)
5262
        return this.equals((isCodApplicable_args)that);
5263
      return false;
5264
    }
5265
 
5266
    public boolean equals(isCodApplicable_args that) {
5267
      if (that == null)
5268
        return false;
5269
 
11819 amit.gupta 5270
      boolean this_present_cart = true && this.isSetCart();
5271
      boolean that_present_cart = true && that.isSetCart();
5272
      if (this_present_cart || that_present_cart) {
5273
        if (!(this_present_cart && that_present_cart))
6356 amit.gupta 5274
          return false;
11819 amit.gupta 5275
        if (!this.cart.equals(that.cart))
6356 amit.gupta 5276
          return false;
5277
      }
5278
 
5279
      return true;
5280
    }
5281
 
5282
    @Override
5283
    public int hashCode() {
5284
      return 0;
5285
    }
5286
 
5287
    public int compareTo(isCodApplicable_args other) {
5288
      if (!getClass().equals(other.getClass())) {
5289
        return getClass().getName().compareTo(other.getClass().getName());
5290
      }
5291
 
5292
      int lastComparison = 0;
5293
      isCodApplicable_args typedOther = (isCodApplicable_args)other;
5294
 
11819 amit.gupta 5295
      lastComparison = Boolean.valueOf(isSetCart()).compareTo(typedOther.isSetCart());
6356 amit.gupta 5296
      if (lastComparison != 0) {
5297
        return lastComparison;
5298
      }
11819 amit.gupta 5299
      if (isSetCart()) {
5300
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cart, typedOther.cart);
6356 amit.gupta 5301
        if (lastComparison != 0) {
5302
          return lastComparison;
5303
        }
5304
      }
5305
      return 0;
5306
    }
5307
 
5308
    public _Fields fieldForId(int fieldId) {
5309
      return _Fields.findByThriftId(fieldId);
5310
    }
5311
 
5312
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5313
      org.apache.thrift.protocol.TField field;
5314
      iprot.readStructBegin();
5315
      while (true)
5316
      {
5317
        field = iprot.readFieldBegin();
5318
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
5319
          break;
5320
        }
5321
        switch (field.id) {
11819 amit.gupta 5322
          case 1: // CART
5323
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5324
              this.cart = new Cart();
5325
              this.cart.read(iprot);
6356 amit.gupta 5326
            } else { 
5327
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5328
            }
5329
            break;
5330
          default:
5331
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5332
        }
5333
        iprot.readFieldEnd();
5334
      }
5335
      iprot.readStructEnd();
5336
      validate();
5337
    }
5338
 
5339
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
5340
      validate();
5341
 
5342
      oprot.writeStructBegin(STRUCT_DESC);
11819 amit.gupta 5343
      if (this.cart != null) {
5344
        oprot.writeFieldBegin(CART_FIELD_DESC);
5345
        this.cart.write(oprot);
6356 amit.gupta 5346
        oprot.writeFieldEnd();
5347
      }
5348
      oprot.writeFieldStop();
5349
      oprot.writeStructEnd();
5350
    }
5351
 
5352
    @Override
5353
    public String toString() {
5354
      StringBuilder sb = new StringBuilder("isCodApplicable_args(");
5355
      boolean first = true;
5356
 
11819 amit.gupta 5357
      sb.append("cart:");
5358
      if (this.cart == null) {
6356 amit.gupta 5359
        sb.append("null");
5360
      } else {
11819 amit.gupta 5361
        sb.append(this.cart);
6356 amit.gupta 5362
      }
5363
      first = false;
5364
      sb.append(")");
5365
      return sb.toString();
5366
    }
5367
 
5368
    public void validate() throws org.apache.thrift.TException {
5369
      // check for required fields
5370
    }
5371
 
5372
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5373
      try {
5374
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5375
      } catch (org.apache.thrift.TException te) {
5376
        throw new java.io.IOException(te);
5377
      }
5378
    }
5379
 
5380
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5381
      try {
5382
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5383
      } catch (org.apache.thrift.TException te) {
5384
        throw new java.io.IOException(te);
5385
      }
5386
    }
5387
 
5388
  }
5389
 
5390
  public static class isCodApplicable_result implements org.apache.thrift.TBase<isCodApplicable_result, isCodApplicable_result._Fields>, java.io.Serializable, Cloneable   {
5391
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isCodApplicable_result");
5392
 
5393
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
5394
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
5395
 
5396
    private boolean success; // required
5397
    private PromotionException pex; // required
5398
 
5399
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
5400
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
5401
      SUCCESS((short)0, "success"),
5402
      PEX((short)1, "pex");
5403
 
5404
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5405
 
5406
      static {
5407
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5408
          byName.put(field.getFieldName(), field);
5409
        }
5410
      }
5411
 
5412
      /**
5413
       * Find the _Fields constant that matches fieldId, or null if its not found.
5414
       */
5415
      public static _Fields findByThriftId(int fieldId) {
5416
        switch(fieldId) {
5417
          case 0: // SUCCESS
5418
            return SUCCESS;
5419
          case 1: // PEX
5420
            return PEX;
5421
          default:
5422
            return null;
5423
        }
5424
      }
5425
 
5426
      /**
5427
       * Find the _Fields constant that matches fieldId, throwing an exception
5428
       * if it is not found.
5429
       */
5430
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5431
        _Fields fields = findByThriftId(fieldId);
5432
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5433
        return fields;
5434
      }
5435
 
5436
      /**
5437
       * Find the _Fields constant that matches name, or null if its not found.
5438
       */
5439
      public static _Fields findByName(String name) {
5440
        return byName.get(name);
5441
      }
5442
 
5443
      private final short _thriftId;
5444
      private final String _fieldName;
5445
 
5446
      _Fields(short thriftId, String fieldName) {
5447
        _thriftId = thriftId;
5448
        _fieldName = fieldName;
5449
      }
5450
 
5451
      public short getThriftFieldId() {
5452
        return _thriftId;
5453
      }
5454
 
5455
      public String getFieldName() {
5456
        return _fieldName;
5457
      }
5458
    }
5459
 
5460
    // isset id assignments
5461
    private static final int __SUCCESS_ISSET_ID = 0;
5462
    private BitSet __isset_bit_vector = new BitSet(1);
5463
 
5464
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
5465
    static {
5466
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5467
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5468
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
5469
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5470
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
5471
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5472
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isCodApplicable_result.class, metaDataMap);
5473
    }
5474
 
5475
    public isCodApplicable_result() {
5476
    }
5477
 
5478
    public isCodApplicable_result(
5479
      boolean success,
5480
      PromotionException pex)
5481
    {
5482
      this();
5483
      this.success = success;
5484
      setSuccessIsSet(true);
5485
      this.pex = pex;
5486
    }
5487
 
5488
    /**
5489
     * Performs a deep copy on <i>other</i>.
5490
     */
5491
    public isCodApplicable_result(isCodApplicable_result other) {
5492
      __isset_bit_vector.clear();
5493
      __isset_bit_vector.or(other.__isset_bit_vector);
5494
      this.success = other.success;
5495
      if (other.isSetPex()) {
5496
        this.pex = new PromotionException(other.pex);
5497
      }
5498
    }
5499
 
5500
    public isCodApplicable_result deepCopy() {
5501
      return new isCodApplicable_result(this);
5502
    }
5503
 
5504
    @Override
5505
    public void clear() {
5506
      setSuccessIsSet(false);
5507
      this.success = false;
5508
      this.pex = null;
5509
    }
5510
 
5511
    public boolean isSuccess() {
5512
      return this.success;
5513
    }
5514
 
5515
    public void setSuccess(boolean success) {
5516
      this.success = success;
5517
      setSuccessIsSet(true);
5518
    }
5519
 
5520
    public void unsetSuccess() {
5521
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
5522
    }
5523
 
5524
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
5525
    public boolean isSetSuccess() {
5526
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
5527
    }
5528
 
5529
    public void setSuccessIsSet(boolean value) {
5530
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
5531
    }
5532
 
5533
    public PromotionException getPex() {
5534
      return this.pex;
5535
    }
5536
 
5537
    public void setPex(PromotionException pex) {
5538
      this.pex = pex;
5539
    }
5540
 
5541
    public void unsetPex() {
5542
      this.pex = null;
5543
    }
5544
 
5545
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
5546
    public boolean isSetPex() {
5547
      return this.pex != null;
5548
    }
5549
 
5550
    public void setPexIsSet(boolean value) {
5551
      if (!value) {
5552
        this.pex = null;
5553
      }
5554
    }
5555
 
5556
    public void setFieldValue(_Fields field, Object value) {
5557
      switch (field) {
5558
      case SUCCESS:
5559
        if (value == null) {
5560
          unsetSuccess();
5561
        } else {
5562
          setSuccess((Boolean)value);
5563
        }
5564
        break;
5565
 
5566
      case PEX:
5567
        if (value == null) {
5568
          unsetPex();
5569
        } else {
5570
          setPex((PromotionException)value);
5571
        }
5572
        break;
5573
 
5574
      }
5575
    }
5576
 
5577
    public Object getFieldValue(_Fields field) {
5578
      switch (field) {
5579
      case SUCCESS:
5580
        return Boolean.valueOf(isSuccess());
5581
 
5582
      case PEX:
5583
        return getPex();
5584
 
5585
      }
5586
      throw new IllegalStateException();
5587
    }
5588
 
5589
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5590
    public boolean isSet(_Fields field) {
5591
      if (field == null) {
5592
        throw new IllegalArgumentException();
5593
      }
5594
 
5595
      switch (field) {
5596
      case SUCCESS:
5597
        return isSetSuccess();
5598
      case PEX:
5599
        return isSetPex();
5600
      }
5601
      throw new IllegalStateException();
5602
    }
5603
 
5604
    @Override
5605
    public boolean equals(Object that) {
5606
      if (that == null)
5607
        return false;
5608
      if (that instanceof isCodApplicable_result)
5609
        return this.equals((isCodApplicable_result)that);
5610
      return false;
5611
    }
5612
 
5613
    public boolean equals(isCodApplicable_result that) {
5614
      if (that == null)
5615
        return false;
5616
 
5617
      boolean this_present_success = true;
5618
      boolean that_present_success = true;
5619
      if (this_present_success || that_present_success) {
5620
        if (!(this_present_success && that_present_success))
5621
          return false;
5622
        if (this.success != that.success)
5623
          return false;
5624
      }
5625
 
5626
      boolean this_present_pex = true && this.isSetPex();
5627
      boolean that_present_pex = true && that.isSetPex();
5628
      if (this_present_pex || that_present_pex) {
5629
        if (!(this_present_pex && that_present_pex))
5630
          return false;
5631
        if (!this.pex.equals(that.pex))
5632
          return false;
5633
      }
5634
 
5635
      return true;
5636
    }
5637
 
5638
    @Override
5639
    public int hashCode() {
5640
      return 0;
5641
    }
5642
 
5643
    public int compareTo(isCodApplicable_result other) {
5644
      if (!getClass().equals(other.getClass())) {
5645
        return getClass().getName().compareTo(other.getClass().getName());
5646
      }
5647
 
5648
      int lastComparison = 0;
5649
      isCodApplicable_result typedOther = (isCodApplicable_result)other;
5650
 
5651
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
5652
      if (lastComparison != 0) {
5653
        return lastComparison;
5654
      }
5655
      if (isSetSuccess()) {
5656
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
5657
        if (lastComparison != 0) {
5658
          return lastComparison;
5659
        }
5660
      }
5661
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
5662
      if (lastComparison != 0) {
5663
        return lastComparison;
5664
      }
5665
      if (isSetPex()) {
5666
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
5667
        if (lastComparison != 0) {
5668
          return lastComparison;
5669
        }
5670
      }
5671
      return 0;
5672
    }
5673
 
5674
    public _Fields fieldForId(int fieldId) {
5675
      return _Fields.findByThriftId(fieldId);
5676
    }
5677
 
5678
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5679
      org.apache.thrift.protocol.TField field;
5680
      iprot.readStructBegin();
5681
      while (true)
5682
      {
5683
        field = iprot.readFieldBegin();
5684
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
5685
          break;
5686
        }
5687
        switch (field.id) {
5688
          case 0: // SUCCESS
5689
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
5690
              this.success = iprot.readBool();
5691
              setSuccessIsSet(true);
5692
            } else { 
5693
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5694
            }
5695
            break;
5696
          case 1: // PEX
5697
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5698
              this.pex = new PromotionException();
5699
              this.pex.read(iprot);
5700
            } else { 
5701
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5702
            }
5703
            break;
5704
          default:
5705
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5706
        }
5707
        iprot.readFieldEnd();
5708
      }
5709
      iprot.readStructEnd();
5710
      validate();
5711
    }
5712
 
5713
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
5714
      oprot.writeStructBegin(STRUCT_DESC);
5715
 
5716
      if (this.isSetSuccess()) {
5717
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
5718
        oprot.writeBool(this.success);
5719
        oprot.writeFieldEnd();
5720
      } else if (this.isSetPex()) {
5721
        oprot.writeFieldBegin(PEX_FIELD_DESC);
5722
        this.pex.write(oprot);
5723
        oprot.writeFieldEnd();
5724
      }
5725
      oprot.writeFieldStop();
5726
      oprot.writeStructEnd();
5727
    }
5728
 
5729
    @Override
5730
    public String toString() {
5731
      StringBuilder sb = new StringBuilder("isCodApplicable_result(");
5732
      boolean first = true;
5733
 
5734
      sb.append("success:");
5735
      sb.append(this.success);
5736
      first = false;
5737
      if (!first) sb.append(", ");
5738
      sb.append("pex:");
5739
      if (this.pex == null) {
5740
        sb.append("null");
5741
      } else {
5742
        sb.append(this.pex);
5743
      }
5744
      first = false;
5745
      sb.append(")");
5746
      return sb.toString();
5747
    }
5748
 
5749
    public void validate() throws org.apache.thrift.TException {
5750
      // check for required fields
5751
    }
5752
 
5753
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5754
      try {
5755
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5756
      } catch (org.apache.thrift.TException te) {
5757
        throw new java.io.IOException(te);
5758
      }
5759
    }
5760
 
5761
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5762
      try {
5763
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5764
      } catch (org.apache.thrift.TException te) {
5765
        throw new java.io.IOException(te);
5766
      }
5767
    }
5768
 
5769
  }
5770
 
3430 rajveer 5771
  public static class getAllPromotions_args implements org.apache.thrift.TBase<getAllPromotions_args, getAllPromotions_args._Fields>, java.io.Serializable, Cloneable   {
5772
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_args");
1982 varun.gupt 5773
 
5774
 
5775
 
5776
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5777
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5778
;
5779
 
5780
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5781
 
5782
      static {
5783
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5784
          byName.put(field.getFieldName(), field);
5785
        }
5786
      }
5787
 
5788
      /**
5789
       * Find the _Fields constant that matches fieldId, or null if its not found.
5790
       */
5791
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5792
        switch(fieldId) {
5793
          default:
5794
            return null;
5795
        }
1982 varun.gupt 5796
      }
5797
 
5798
      /**
5799
       * Find the _Fields constant that matches fieldId, throwing an exception
5800
       * if it is not found.
5801
       */
5802
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5803
        _Fields fields = findByThriftId(fieldId);
5804
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5805
        return fields;
5806
      }
5807
 
5808
      /**
5809
       * Find the _Fields constant that matches name, or null if its not found.
5810
       */
5811
      public static _Fields findByName(String name) {
5812
        return byName.get(name);
5813
      }
5814
 
5815
      private final short _thriftId;
5816
      private final String _fieldName;
5817
 
5818
      _Fields(short thriftId, String fieldName) {
5819
        _thriftId = thriftId;
5820
        _fieldName = fieldName;
5821
      }
5822
 
5823
      public short getThriftFieldId() {
5824
        return _thriftId;
5825
      }
5826
 
5827
      public String getFieldName() {
5828
        return _fieldName;
5829
      }
5830
    }
3430 rajveer 5831
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5832
    static {
3430 rajveer 5833
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5834
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5835
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_args.class, metaDataMap);
1982 varun.gupt 5836
    }
5837
 
5838
    public getAllPromotions_args() {
5839
    }
5840
 
5841
    /**
5842
     * Performs a deep copy on <i>other</i>.
5843
     */
5844
    public getAllPromotions_args(getAllPromotions_args other) {
5845
    }
5846
 
5847
    public getAllPromotions_args deepCopy() {
5848
      return new getAllPromotions_args(this);
5849
    }
5850
 
3430 rajveer 5851
    @Override
5852
    public void clear() {
1982 varun.gupt 5853
    }
5854
 
5855
    public void setFieldValue(_Fields field, Object value) {
5856
      switch (field) {
5857
      }
5858
    }
5859
 
5860
    public Object getFieldValue(_Fields field) {
5861
      switch (field) {
5862
      }
5863
      throw new IllegalStateException();
5864
    }
5865
 
3430 rajveer 5866
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5867
    public boolean isSet(_Fields field) {
5868
      if (field == null) {
5869
        throw new IllegalArgumentException();
5870
      }
1982 varun.gupt 5871
 
5872
      switch (field) {
5873
      }
5874
      throw new IllegalStateException();
5875
    }
5876
 
5877
    @Override
5878
    public boolean equals(Object that) {
5879
      if (that == null)
5880
        return false;
5881
      if (that instanceof getAllPromotions_args)
5882
        return this.equals((getAllPromotions_args)that);
5883
      return false;
5884
    }
5885
 
5886
    public boolean equals(getAllPromotions_args that) {
5887
      if (that == null)
5888
        return false;
5889
 
5890
      return true;
5891
    }
5892
 
5893
    @Override
5894
    public int hashCode() {
5895
      return 0;
5896
    }
5897
 
5898
    public int compareTo(getAllPromotions_args other) {
5899
      if (!getClass().equals(other.getClass())) {
5900
        return getClass().getName().compareTo(other.getClass().getName());
5901
      }
5902
 
5903
      int lastComparison = 0;
5904
      getAllPromotions_args typedOther = (getAllPromotions_args)other;
5905
 
5906
      return 0;
5907
    }
5908
 
3430 rajveer 5909
    public _Fields fieldForId(int fieldId) {
5910
      return _Fields.findByThriftId(fieldId);
5911
    }
5912
 
5913
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5914
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5915
      iprot.readStructBegin();
5916
      while (true)
5917
      {
5918
        field = iprot.readFieldBegin();
3430 rajveer 5919
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5920
          break;
5921
        }
3430 rajveer 5922
        switch (field.id) {
5923
          default:
5924
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5925
        }
3430 rajveer 5926
        iprot.readFieldEnd();
1982 varun.gupt 5927
      }
5928
      iprot.readStructEnd();
5929
      validate();
5930
    }
5931
 
3430 rajveer 5932
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5933
      validate();
5934
 
5935
      oprot.writeStructBegin(STRUCT_DESC);
5936
      oprot.writeFieldStop();
5937
      oprot.writeStructEnd();
5938
    }
5939
 
5940
    @Override
5941
    public String toString() {
5942
      StringBuilder sb = new StringBuilder("getAllPromotions_args(");
5943
      boolean first = true;
5944
 
5945
      sb.append(")");
5946
      return sb.toString();
5947
    }
5948
 
3430 rajveer 5949
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5950
      // check for required fields
5951
    }
5952
 
3430 rajveer 5953
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5954
      try {
5955
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5956
      } catch (org.apache.thrift.TException te) {
5957
        throw new java.io.IOException(te);
5958
      }
5959
    }
5960
 
5961
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5962
      try {
5963
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5964
      } catch (org.apache.thrift.TException te) {
5965
        throw new java.io.IOException(te);
5966
      }
5967
    }
5968
 
1982 varun.gupt 5969
  }
5970
 
3430 rajveer 5971
  public static class getAllPromotions_result implements org.apache.thrift.TBase<getAllPromotions_result, getAllPromotions_result._Fields>, java.io.Serializable, Cloneable   {
5972
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_result");
1982 varun.gupt 5973
 
3430 rajveer 5974
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
5975
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
1982 varun.gupt 5976
 
3430 rajveer 5977
    private List<Promotion> success; // required
5978
    private PromotionException pex; // required
1982 varun.gupt 5979
 
5980
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5981
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5982
      SUCCESS((short)0, "success"),
5983
      PEX((short)1, "pex");
5984
 
5985
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5986
 
5987
      static {
5988
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5989
          byName.put(field.getFieldName(), field);
5990
        }
5991
      }
5992
 
5993
      /**
5994
       * Find the _Fields constant that matches fieldId, or null if its not found.
5995
       */
5996
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5997
        switch(fieldId) {
5998
          case 0: // SUCCESS
5999
            return SUCCESS;
6000
          case 1: // PEX
6001
            return PEX;
6002
          default:
6003
            return null;
6004
        }
1982 varun.gupt 6005
      }
6006
 
6007
      /**
6008
       * Find the _Fields constant that matches fieldId, throwing an exception
6009
       * if it is not found.
6010
       */
6011
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6012
        _Fields fields = findByThriftId(fieldId);
6013
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6014
        return fields;
6015
      }
6016
 
6017
      /**
6018
       * Find the _Fields constant that matches name, or null if its not found.
6019
       */
6020
      public static _Fields findByName(String name) {
6021
        return byName.get(name);
6022
      }
6023
 
6024
      private final short _thriftId;
6025
      private final String _fieldName;
6026
 
6027
      _Fields(short thriftId, String fieldName) {
6028
        _thriftId = thriftId;
6029
        _fieldName = fieldName;
6030
      }
6031
 
6032
      public short getThriftFieldId() {
6033
        return _thriftId;
6034
      }
6035
 
6036
      public String getFieldName() {
6037
        return _fieldName;
6038
      }
6039
    }
6040
 
6041
    // isset id assignments
6042
 
3430 rajveer 6043
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6044
    static {
3430 rajveer 6045
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6046
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6047
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
6048
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class))));
6049
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6050
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
6051
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6052
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_result.class, metaDataMap);
1982 varun.gupt 6053
    }
6054
 
6055
    public getAllPromotions_result() {
6056
    }
6057
 
6058
    public getAllPromotions_result(
6059
      List<Promotion> success,
6060
      PromotionException pex)
6061
    {
6062
      this();
6063
      this.success = success;
6064
      this.pex = pex;
6065
    }
6066
 
6067
    /**
6068
     * Performs a deep copy on <i>other</i>.
6069
     */
6070
    public getAllPromotions_result(getAllPromotions_result other) {
6071
      if (other.isSetSuccess()) {
6072
        List<Promotion> __this__success = new ArrayList<Promotion>();
6073
        for (Promotion other_element : other.success) {
6074
          __this__success.add(new Promotion(other_element));
6075
        }
6076
        this.success = __this__success;
6077
      }
6078
      if (other.isSetPex()) {
6079
        this.pex = new PromotionException(other.pex);
6080
      }
6081
    }
6082
 
6083
    public getAllPromotions_result deepCopy() {
6084
      return new getAllPromotions_result(this);
6085
    }
6086
 
3430 rajveer 6087
    @Override
6088
    public void clear() {
6089
      this.success = null;
6090
      this.pex = null;
1982 varun.gupt 6091
    }
6092
 
6093
    public int getSuccessSize() {
6094
      return (this.success == null) ? 0 : this.success.size();
6095
    }
6096
 
6097
    public java.util.Iterator<Promotion> getSuccessIterator() {
6098
      return (this.success == null) ? null : this.success.iterator();
6099
    }
6100
 
6101
    public void addToSuccess(Promotion elem) {
6102
      if (this.success == null) {
6103
        this.success = new ArrayList<Promotion>();
6104
      }
6105
      this.success.add(elem);
6106
    }
6107
 
6108
    public List<Promotion> getSuccess() {
6109
      return this.success;
6110
    }
6111
 
3430 rajveer 6112
    public void setSuccess(List<Promotion> success) {
1982 varun.gupt 6113
      this.success = success;
6114
    }
6115
 
6116
    public void unsetSuccess() {
6117
      this.success = null;
6118
    }
6119
 
3430 rajveer 6120
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6121
    public boolean isSetSuccess() {
6122
      return this.success != null;
6123
    }
6124
 
6125
    public void setSuccessIsSet(boolean value) {
6126
      if (!value) {
6127
        this.success = null;
6128
      }
6129
    }
6130
 
6131
    public PromotionException getPex() {
6132
      return this.pex;
6133
    }
6134
 
3430 rajveer 6135
    public void setPex(PromotionException pex) {
1982 varun.gupt 6136
      this.pex = pex;
6137
    }
6138
 
6139
    public void unsetPex() {
6140
      this.pex = null;
6141
    }
6142
 
3430 rajveer 6143
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6144
    public boolean isSetPex() {
6145
      return this.pex != null;
6146
    }
6147
 
6148
    public void setPexIsSet(boolean value) {
6149
      if (!value) {
6150
        this.pex = null;
6151
      }
6152
    }
6153
 
6154
    public void setFieldValue(_Fields field, Object value) {
6155
      switch (field) {
6156
      case SUCCESS:
6157
        if (value == null) {
6158
          unsetSuccess();
6159
        } else {
6160
          setSuccess((List<Promotion>)value);
6161
        }
6162
        break;
6163
 
6164
      case PEX:
6165
        if (value == null) {
6166
          unsetPex();
6167
        } else {
6168
          setPex((PromotionException)value);
6169
        }
6170
        break;
6171
 
6172
      }
6173
    }
6174
 
6175
    public Object getFieldValue(_Fields field) {
6176
      switch (field) {
6177
      case SUCCESS:
6178
        return getSuccess();
6179
 
6180
      case PEX:
6181
        return getPex();
6182
 
6183
      }
6184
      throw new IllegalStateException();
6185
    }
6186
 
3430 rajveer 6187
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6188
    public boolean isSet(_Fields field) {
6189
      if (field == null) {
6190
        throw new IllegalArgumentException();
6191
      }
1982 varun.gupt 6192
 
6193
      switch (field) {
6194
      case SUCCESS:
6195
        return isSetSuccess();
6196
      case PEX:
6197
        return isSetPex();
6198
      }
6199
      throw new IllegalStateException();
6200
    }
6201
 
6202
    @Override
6203
    public boolean equals(Object that) {
6204
      if (that == null)
6205
        return false;
6206
      if (that instanceof getAllPromotions_result)
6207
        return this.equals((getAllPromotions_result)that);
6208
      return false;
6209
    }
6210
 
6211
    public boolean equals(getAllPromotions_result that) {
6212
      if (that == null)
6213
        return false;
6214
 
6215
      boolean this_present_success = true && this.isSetSuccess();
6216
      boolean that_present_success = true && that.isSetSuccess();
6217
      if (this_present_success || that_present_success) {
6218
        if (!(this_present_success && that_present_success))
6219
          return false;
6220
        if (!this.success.equals(that.success))
6221
          return false;
6222
      }
6223
 
6224
      boolean this_present_pex = true && this.isSetPex();
6225
      boolean that_present_pex = true && that.isSetPex();
6226
      if (this_present_pex || that_present_pex) {
6227
        if (!(this_present_pex && that_present_pex))
6228
          return false;
6229
        if (!this.pex.equals(that.pex))
6230
          return false;
6231
      }
6232
 
6233
      return true;
6234
    }
6235
 
6236
    @Override
6237
    public int hashCode() {
6238
      return 0;
6239
    }
6240
 
6241
    public int compareTo(getAllPromotions_result other) {
6242
      if (!getClass().equals(other.getClass())) {
6243
        return getClass().getName().compareTo(other.getClass().getName());
6244
      }
6245
 
6246
      int lastComparison = 0;
6247
      getAllPromotions_result typedOther = (getAllPromotions_result)other;
6248
 
3430 rajveer 6249
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 6250
      if (lastComparison != 0) {
6251
        return lastComparison;
6252
      }
3430 rajveer 6253
      if (isSetSuccess()) {
6254
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
6255
        if (lastComparison != 0) {
6256
          return lastComparison;
6257
        }
1982 varun.gupt 6258
      }
3430 rajveer 6259
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 6260
      if (lastComparison != 0) {
6261
        return lastComparison;
6262
      }
3430 rajveer 6263
      if (isSetPex()) {
6264
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
6265
        if (lastComparison != 0) {
6266
          return lastComparison;
6267
        }
1982 varun.gupt 6268
      }
6269
      return 0;
6270
    }
6271
 
3430 rajveer 6272
    public _Fields fieldForId(int fieldId) {
6273
      return _Fields.findByThriftId(fieldId);
6274
    }
6275
 
6276
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6277
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6278
      iprot.readStructBegin();
6279
      while (true)
6280
      {
6281
        field = iprot.readFieldBegin();
3430 rajveer 6282
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6283
          break;
6284
        }
3430 rajveer 6285
        switch (field.id) {
6286
          case 0: // SUCCESS
6287
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
6288
              {
11592 amit.gupta 6289
                org.apache.thrift.protocol.TList _list16 = iprot.readListBegin();
6290
                this.success = new ArrayList<Promotion>(_list16.size);
6291
                for (int _i17 = 0; _i17 < _list16.size; ++_i17)
1982 varun.gupt 6292
                {
11592 amit.gupta 6293
                  Promotion _elem18; // required
6294
                  _elem18 = new Promotion();
6295
                  _elem18.read(iprot);
6296
                  this.success.add(_elem18);
1982 varun.gupt 6297
                }
3430 rajveer 6298
                iprot.readListEnd();
1982 varun.gupt 6299
              }
3430 rajveer 6300
            } else { 
6301
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6302
            }
6303
            break;
6304
          case 1: // PEX
6305
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6306
              this.pex = new PromotionException();
6307
              this.pex.read(iprot);
6308
            } else { 
6309
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6310
            }
6311
            break;
6312
          default:
6313
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6314
        }
3430 rajveer 6315
        iprot.readFieldEnd();
1982 varun.gupt 6316
      }
6317
      iprot.readStructEnd();
6318
      validate();
6319
    }
6320
 
3430 rajveer 6321
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6322
      oprot.writeStructBegin(STRUCT_DESC);
6323
 
6324
      if (this.isSetSuccess()) {
6325
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
6326
        {
3430 rajveer 6327
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
11592 amit.gupta 6328
          for (Promotion _iter19 : this.success)
1982 varun.gupt 6329
          {
11592 amit.gupta 6330
            _iter19.write(oprot);
1982 varun.gupt 6331
          }
6332
          oprot.writeListEnd();
6333
        }
6334
        oprot.writeFieldEnd();
6335
      } else if (this.isSetPex()) {
6336
        oprot.writeFieldBegin(PEX_FIELD_DESC);
6337
        this.pex.write(oprot);
6338
        oprot.writeFieldEnd();
6339
      }
6340
      oprot.writeFieldStop();
6341
      oprot.writeStructEnd();
6342
    }
6343
 
6344
    @Override
6345
    public String toString() {
6346
      StringBuilder sb = new StringBuilder("getAllPromotions_result(");
6347
      boolean first = true;
6348
 
6349
      sb.append("success:");
6350
      if (this.success == null) {
6351
        sb.append("null");
6352
      } else {
6353
        sb.append(this.success);
6354
      }
6355
      first = false;
6356
      if (!first) sb.append(", ");
6357
      sb.append("pex:");
6358
      if (this.pex == null) {
6359
        sb.append("null");
6360
      } else {
6361
        sb.append(this.pex);
6362
      }
6363
      first = false;
6364
      sb.append(")");
6365
      return sb.toString();
6366
    }
6367
 
3430 rajveer 6368
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6369
      // check for required fields
6370
    }
6371
 
3430 rajveer 6372
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6373
      try {
6374
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6375
      } catch (org.apache.thrift.TException te) {
6376
        throw new java.io.IOException(te);
6377
      }
6378
    }
6379
 
6380
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6381
      try {
6382
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6383
      } catch (org.apache.thrift.TException te) {
6384
        throw new java.io.IOException(te);
6385
      }
6386
    }
6387
 
1982 varun.gupt 6388
  }
6389
 
3430 rajveer 6390
  public static class getPromotionById_args implements org.apache.thrift.TBase<getPromotionById_args, getPromotionById_args._Fields>, java.io.Serializable, Cloneable   {
6391
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_args");
1982 varun.gupt 6392
 
3430 rajveer 6393
    private static final org.apache.thrift.protocol.TField PROMOTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("promotionId", org.apache.thrift.protocol.TType.I64, (short)1);
1982 varun.gupt 6394
 
3430 rajveer 6395
    private long promotionId; // required
1982 varun.gupt 6396
 
6397
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6398
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6399
      PROMOTION_ID((short)1, "promotionId");
6400
 
6401
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6402
 
6403
      static {
6404
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6405
          byName.put(field.getFieldName(), field);
6406
        }
6407
      }
6408
 
6409
      /**
6410
       * Find the _Fields constant that matches fieldId, or null if its not found.
6411
       */
6412
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6413
        switch(fieldId) {
6414
          case 1: // PROMOTION_ID
6415
            return PROMOTION_ID;
6416
          default:
6417
            return null;
6418
        }
1982 varun.gupt 6419
      }
6420
 
6421
      /**
6422
       * Find the _Fields constant that matches fieldId, throwing an exception
6423
       * if it is not found.
6424
       */
6425
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6426
        _Fields fields = findByThriftId(fieldId);
6427
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6428
        return fields;
6429
      }
6430
 
6431
      /**
6432
       * Find the _Fields constant that matches name, or null if its not found.
6433
       */
6434
      public static _Fields findByName(String name) {
6435
        return byName.get(name);
6436
      }
6437
 
6438
      private final short _thriftId;
6439
      private final String _fieldName;
6440
 
6441
      _Fields(short thriftId, String fieldName) {
6442
        _thriftId = thriftId;
6443
        _fieldName = fieldName;
6444
      }
6445
 
6446
      public short getThriftFieldId() {
6447
        return _thriftId;
6448
      }
6449
 
6450
      public String getFieldName() {
6451
        return _fieldName;
6452
      }
6453
    }
6454
 
6455
    // isset id assignments
6456
    private static final int __PROMOTIONID_ISSET_ID = 0;
6457
    private BitSet __isset_bit_vector = new BitSet(1);
6458
 
3430 rajveer 6459
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6460
    static {
3430 rajveer 6461
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6462
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6463
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6464
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6465
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_args.class, metaDataMap);
1982 varun.gupt 6466
    }
6467
 
6468
    public getPromotionById_args() {
6469
    }
6470
 
6471
    public getPromotionById_args(
6472
      long promotionId)
6473
    {
6474
      this();
6475
      this.promotionId = promotionId;
6476
      setPromotionIdIsSet(true);
6477
    }
6478
 
6479
    /**
6480
     * Performs a deep copy on <i>other</i>.
6481
     */
6482
    public getPromotionById_args(getPromotionById_args other) {
6483
      __isset_bit_vector.clear();
6484
      __isset_bit_vector.or(other.__isset_bit_vector);
6485
      this.promotionId = other.promotionId;
6486
    }
6487
 
6488
    public getPromotionById_args deepCopy() {
6489
      return new getPromotionById_args(this);
6490
    }
6491
 
3430 rajveer 6492
    @Override
6493
    public void clear() {
6494
      setPromotionIdIsSet(false);
6495
      this.promotionId = 0;
1982 varun.gupt 6496
    }
6497
 
6498
    public long getPromotionId() {
6499
      return this.promotionId;
6500
    }
6501
 
3430 rajveer 6502
    public void setPromotionId(long promotionId) {
1982 varun.gupt 6503
      this.promotionId = promotionId;
6504
      setPromotionIdIsSet(true);
6505
    }
6506
 
6507
    public void unsetPromotionId() {
6508
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
6509
    }
6510
 
3430 rajveer 6511
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6512
    public boolean isSetPromotionId() {
6513
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
6514
    }
6515
 
6516
    public void setPromotionIdIsSet(boolean value) {
6517
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
6518
    }
6519
 
6520
    public void setFieldValue(_Fields field, Object value) {
6521
      switch (field) {
6522
      case PROMOTION_ID:
6523
        if (value == null) {
6524
          unsetPromotionId();
6525
        } else {
6526
          setPromotionId((Long)value);
6527
        }
6528
        break;
6529
 
6530
      }
6531
    }
6532
 
6533
    public Object getFieldValue(_Fields field) {
6534
      switch (field) {
6535
      case PROMOTION_ID:
3430 rajveer 6536
        return Long.valueOf(getPromotionId());
1982 varun.gupt 6537
 
6538
      }
6539
      throw new IllegalStateException();
6540
    }
6541
 
3430 rajveer 6542
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6543
    public boolean isSet(_Fields field) {
6544
      if (field == null) {
6545
        throw new IllegalArgumentException();
6546
      }
1982 varun.gupt 6547
 
6548
      switch (field) {
6549
      case PROMOTION_ID:
6550
        return isSetPromotionId();
6551
      }
6552
      throw new IllegalStateException();
6553
    }
6554
 
6555
    @Override
6556
    public boolean equals(Object that) {
6557
      if (that == null)
6558
        return false;
6559
      if (that instanceof getPromotionById_args)
6560
        return this.equals((getPromotionById_args)that);
6561
      return false;
6562
    }
6563
 
6564
    public boolean equals(getPromotionById_args that) {
6565
      if (that == null)
6566
        return false;
6567
 
6568
      boolean this_present_promotionId = true;
6569
      boolean that_present_promotionId = true;
6570
      if (this_present_promotionId || that_present_promotionId) {
6571
        if (!(this_present_promotionId && that_present_promotionId))
6572
          return false;
6573
        if (this.promotionId != that.promotionId)
6574
          return false;
6575
      }
6576
 
6577
      return true;
6578
    }
6579
 
6580
    @Override
6581
    public int hashCode() {
6582
      return 0;
6583
    }
6584
 
6585
    public int compareTo(getPromotionById_args other) {
6586
      if (!getClass().equals(other.getClass())) {
6587
        return getClass().getName().compareTo(other.getClass().getName());
6588
      }
6589
 
6590
      int lastComparison = 0;
6591
      getPromotionById_args typedOther = (getPromotionById_args)other;
6592
 
3430 rajveer 6593
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 6594
      if (lastComparison != 0) {
6595
        return lastComparison;
6596
      }
3430 rajveer 6597
      if (isSetPromotionId()) {
6598
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
6599
        if (lastComparison != 0) {
6600
          return lastComparison;
6601
        }
1982 varun.gupt 6602
      }
6603
      return 0;
6604
    }
6605
 
3430 rajveer 6606
    public _Fields fieldForId(int fieldId) {
6607
      return _Fields.findByThriftId(fieldId);
6608
    }
6609
 
6610
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6611
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6612
      iprot.readStructBegin();
6613
      while (true)
6614
      {
6615
        field = iprot.readFieldBegin();
3430 rajveer 6616
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6617
          break;
6618
        }
3430 rajveer 6619
        switch (field.id) {
6620
          case 1: // PROMOTION_ID
6621
            if (field.type == org.apache.thrift.protocol.TType.I64) {
6622
              this.promotionId = iprot.readI64();
6623
              setPromotionIdIsSet(true);
6624
            } else { 
6625
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6626
            }
6627
            break;
6628
          default:
6629
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6630
        }
3430 rajveer 6631
        iprot.readFieldEnd();
1982 varun.gupt 6632
      }
6633
      iprot.readStructEnd();
6634
      validate();
6635
    }
6636
 
3430 rajveer 6637
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6638
      validate();
6639
 
6640
      oprot.writeStructBegin(STRUCT_DESC);
6641
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
6642
      oprot.writeI64(this.promotionId);
6643
      oprot.writeFieldEnd();
6644
      oprot.writeFieldStop();
6645
      oprot.writeStructEnd();
6646
    }
6647
 
6648
    @Override
6649
    public String toString() {
6650
      StringBuilder sb = new StringBuilder("getPromotionById_args(");
6651
      boolean first = true;
6652
 
6653
      sb.append("promotionId:");
6654
      sb.append(this.promotionId);
6655
      first = false;
6656
      sb.append(")");
6657
      return sb.toString();
6658
    }
6659
 
3430 rajveer 6660
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6661
      // check for required fields
6662
    }
6663
 
3430 rajveer 6664
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6665
      try {
6666
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6667
      } catch (org.apache.thrift.TException te) {
6668
        throw new java.io.IOException(te);
6669
      }
6670
    }
6671
 
6672
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6673
      try {
6674
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
6675
        __isset_bit_vector = new BitSet(1);
6676
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6677
      } catch (org.apache.thrift.TException te) {
6678
        throw new java.io.IOException(te);
6679
      }
6680
    }
6681
 
1982 varun.gupt 6682
  }
6683
 
3430 rajveer 6684
  public static class getPromotionById_result implements org.apache.thrift.TBase<getPromotionById_result, getPromotionById_result._Fields>, java.io.Serializable, Cloneable   {
6685
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_result");
1982 varun.gupt 6686
 
3430 rajveer 6687
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
6688
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
1982 varun.gupt 6689
 
3430 rajveer 6690
    private Promotion success; // required
6691
    private PromotionException pex; // required
1982 varun.gupt 6692
 
6693
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6694
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6695
      SUCCESS((short)0, "success"),
6696
      PEX((short)1, "pex");
6697
 
6698
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6699
 
6700
      static {
6701
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6702
          byName.put(field.getFieldName(), field);
6703
        }
6704
      }
6705
 
6706
      /**
6707
       * Find the _Fields constant that matches fieldId, or null if its not found.
6708
       */
6709
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6710
        switch(fieldId) {
6711
          case 0: // SUCCESS
6712
            return SUCCESS;
6713
          case 1: // PEX
6714
            return PEX;
6715
          default:
6716
            return null;
6717
        }
1982 varun.gupt 6718
      }
6719
 
6720
      /**
6721
       * Find the _Fields constant that matches fieldId, throwing an exception
6722
       * if it is not found.
6723
       */
6724
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6725
        _Fields fields = findByThriftId(fieldId);
6726
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6727
        return fields;
6728
      }
6729
 
6730
      /**
6731
       * Find the _Fields constant that matches name, or null if its not found.
6732
       */
6733
      public static _Fields findByName(String name) {
6734
        return byName.get(name);
6735
      }
6736
 
6737
      private final short _thriftId;
6738
      private final String _fieldName;
6739
 
6740
      _Fields(short thriftId, String fieldName) {
6741
        _thriftId = thriftId;
6742
        _fieldName = fieldName;
6743
      }
6744
 
6745
      public short getThriftFieldId() {
6746
        return _thriftId;
6747
      }
6748
 
6749
      public String getFieldName() {
6750
        return _fieldName;
6751
      }
6752
    }
6753
 
6754
    // isset id assignments
6755
 
3430 rajveer 6756
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6757
    static {
3430 rajveer 6758
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6759
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6760
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class)));
6761
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6762
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
6763
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6764
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_result.class, metaDataMap);
1982 varun.gupt 6765
    }
6766
 
6767
    public getPromotionById_result() {
6768
    }
6769
 
6770
    public getPromotionById_result(
6771
      Promotion success,
6772
      PromotionException pex)
6773
    {
6774
      this();
6775
      this.success = success;
6776
      this.pex = pex;
6777
    }
6778
 
6779
    /**
6780
     * Performs a deep copy on <i>other</i>.
6781
     */
6782
    public getPromotionById_result(getPromotionById_result other) {
6783
      if (other.isSetSuccess()) {
6784
        this.success = new Promotion(other.success);
6785
      }
6786
      if (other.isSetPex()) {
6787
        this.pex = new PromotionException(other.pex);
6788
      }
6789
    }
6790
 
6791
    public getPromotionById_result deepCopy() {
6792
      return new getPromotionById_result(this);
6793
    }
6794
 
3430 rajveer 6795
    @Override
6796
    public void clear() {
6797
      this.success = null;
6798
      this.pex = null;
1982 varun.gupt 6799
    }
6800
 
6801
    public Promotion getSuccess() {
6802
      return this.success;
6803
    }
6804
 
3430 rajveer 6805
    public void setSuccess(Promotion success) {
1982 varun.gupt 6806
      this.success = success;
6807
    }
6808
 
6809
    public void unsetSuccess() {
6810
      this.success = null;
6811
    }
6812
 
3430 rajveer 6813
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6814
    public boolean isSetSuccess() {
6815
      return this.success != null;
6816
    }
6817
 
6818
    public void setSuccessIsSet(boolean value) {
6819
      if (!value) {
6820
        this.success = null;
6821
      }
6822
    }
6823
 
6824
    public PromotionException getPex() {
6825
      return this.pex;
6826
    }
6827
 
3430 rajveer 6828
    public void setPex(PromotionException pex) {
1982 varun.gupt 6829
      this.pex = pex;
6830
    }
6831
 
6832
    public void unsetPex() {
6833
      this.pex = null;
6834
    }
6835
 
3430 rajveer 6836
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6837
    public boolean isSetPex() {
6838
      return this.pex != null;
6839
    }
6840
 
6841
    public void setPexIsSet(boolean value) {
6842
      if (!value) {
6843
        this.pex = null;
6844
      }
6845
    }
6846
 
6847
    public void setFieldValue(_Fields field, Object value) {
6848
      switch (field) {
6849
      case SUCCESS:
6850
        if (value == null) {
6851
          unsetSuccess();
6852
        } else {
6853
          setSuccess((Promotion)value);
6854
        }
6855
        break;
6856
 
6857
      case PEX:
6858
        if (value == null) {
6859
          unsetPex();
6860
        } else {
6861
          setPex((PromotionException)value);
6862
        }
6863
        break;
6864
 
6865
      }
6866
    }
6867
 
6868
    public Object getFieldValue(_Fields field) {
6869
      switch (field) {
6870
      case SUCCESS:
6871
        return getSuccess();
6872
 
6873
      case PEX:
6874
        return getPex();
6875
 
6876
      }
6877
      throw new IllegalStateException();
6878
    }
6879
 
3430 rajveer 6880
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6881
    public boolean isSet(_Fields field) {
6882
      if (field == null) {
6883
        throw new IllegalArgumentException();
6884
      }
1982 varun.gupt 6885
 
6886
      switch (field) {
6887
      case SUCCESS:
6888
        return isSetSuccess();
6889
      case PEX:
6890
        return isSetPex();
6891
      }
6892
      throw new IllegalStateException();
6893
    }
6894
 
6895
    @Override
6896
    public boolean equals(Object that) {
6897
      if (that == null)
6898
        return false;
6899
      if (that instanceof getPromotionById_result)
6900
        return this.equals((getPromotionById_result)that);
6901
      return false;
6902
    }
6903
 
6904
    public boolean equals(getPromotionById_result that) {
6905
      if (that == null)
6906
        return false;
6907
 
6908
      boolean this_present_success = true && this.isSetSuccess();
6909
      boolean that_present_success = true && that.isSetSuccess();
6910
      if (this_present_success || that_present_success) {
6911
        if (!(this_present_success && that_present_success))
6912
          return false;
6913
        if (!this.success.equals(that.success))
6914
          return false;
6915
      }
6916
 
6917
      boolean this_present_pex = true && this.isSetPex();
6918
      boolean that_present_pex = true && that.isSetPex();
6919
      if (this_present_pex || that_present_pex) {
6920
        if (!(this_present_pex && that_present_pex))
6921
          return false;
6922
        if (!this.pex.equals(that.pex))
6923
          return false;
6924
      }
6925
 
6926
      return true;
6927
    }
6928
 
6929
    @Override
6930
    public int hashCode() {
6931
      return 0;
6932
    }
6933
 
6934
    public int compareTo(getPromotionById_result other) {
6935
      if (!getClass().equals(other.getClass())) {
6936
        return getClass().getName().compareTo(other.getClass().getName());
6937
      }
6938
 
6939
      int lastComparison = 0;
6940
      getPromotionById_result typedOther = (getPromotionById_result)other;
6941
 
3430 rajveer 6942
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 6943
      if (lastComparison != 0) {
6944
        return lastComparison;
6945
      }
3430 rajveer 6946
      if (isSetSuccess()) {
6947
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
6948
        if (lastComparison != 0) {
6949
          return lastComparison;
6950
        }
1982 varun.gupt 6951
      }
3430 rajveer 6952
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 6953
      if (lastComparison != 0) {
6954
        return lastComparison;
6955
      }
3430 rajveer 6956
      if (isSetPex()) {
6957
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
6958
        if (lastComparison != 0) {
6959
          return lastComparison;
6960
        }
1982 varun.gupt 6961
      }
6962
      return 0;
6963
    }
6964
 
3430 rajveer 6965
    public _Fields fieldForId(int fieldId) {
6966
      return _Fields.findByThriftId(fieldId);
6967
    }
6968
 
6969
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6970
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6971
      iprot.readStructBegin();
6972
      while (true)
6973
      {
6974
        field = iprot.readFieldBegin();
3430 rajveer 6975
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6976
          break;
6977
        }
3430 rajveer 6978
        switch (field.id) {
6979
          case 0: // SUCCESS
6980
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6981
              this.success = new Promotion();
6982
              this.success.read(iprot);
6983
            } else { 
6984
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6985
            }
6986
            break;
6987
          case 1: // PEX
6988
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6989
              this.pex = new PromotionException();
6990
              this.pex.read(iprot);
6991
            } else { 
6992
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6993
            }
6994
            break;
6995
          default:
6996
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6997
        }
3430 rajveer 6998
        iprot.readFieldEnd();
1982 varun.gupt 6999
      }
7000
      iprot.readStructEnd();
7001
      validate();
7002
    }
7003
 
3430 rajveer 7004
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 7005
      oprot.writeStructBegin(STRUCT_DESC);
7006
 
7007
      if (this.isSetSuccess()) {
7008
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
7009
        this.success.write(oprot);
7010
        oprot.writeFieldEnd();
7011
      } else if (this.isSetPex()) {
7012
        oprot.writeFieldBegin(PEX_FIELD_DESC);
7013
        this.pex.write(oprot);
7014
        oprot.writeFieldEnd();
7015
      }
7016
      oprot.writeFieldStop();
7017
      oprot.writeStructEnd();
7018
    }
7019
 
7020
    @Override
7021
    public String toString() {
7022
      StringBuilder sb = new StringBuilder("getPromotionById_result(");
7023
      boolean first = true;
7024
 
7025
      sb.append("success:");
7026
      if (this.success == null) {
7027
        sb.append("null");
7028
      } else {
7029
        sb.append(this.success);
7030
      }
7031
      first = false;
7032
      if (!first) sb.append(", ");
7033
      sb.append("pex:");
7034
      if (this.pex == null) {
7035
        sb.append("null");
7036
      } else {
7037
        sb.append(this.pex);
7038
      }
7039
      first = false;
7040
      sb.append(")");
7041
      return sb.toString();
7042
    }
7043
 
3430 rajveer 7044
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7045
      // check for required fields
7046
    }
7047
 
3430 rajveer 7048
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7049
      try {
7050
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7051
      } catch (org.apache.thrift.TException te) {
7052
        throw new java.io.IOException(te);
7053
      }
7054
    }
7055
 
7056
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7057
      try {
7058
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7059
      } catch (org.apache.thrift.TException te) {
7060
        throw new java.io.IOException(te);
7061
      }
7062
    }
7063
 
1982 varun.gupt 7064
  }
7065
 
3430 rajveer 7066
  public static class generateCouponsForPromotion_args implements org.apache.thrift.TBase<generateCouponsForPromotion_args, generateCouponsForPromotion_args._Fields>, java.io.Serializable, Cloneable   {
7067
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_args");
1982 varun.gupt 7068
 
3430 rajveer 7069
    private static final org.apache.thrift.protocol.TField PROMOTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("promotionId", org.apache.thrift.protocol.TType.I64, (short)1);
7070
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)2);
1982 varun.gupt 7071
 
3430 rajveer 7072
    private long promotionId; // required
7073
    private String couponCode; // required
1982 varun.gupt 7074
 
7075
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7076
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 7077
      PROMOTION_ID((short)1, "promotionId"),
7078
      COUPON_CODE((short)2, "couponCode");
7079
 
7080
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7081
 
7082
      static {
7083
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7084
          byName.put(field.getFieldName(), field);
7085
        }
7086
      }
7087
 
7088
      /**
7089
       * Find the _Fields constant that matches fieldId, or null if its not found.
7090
       */
7091
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7092
        switch(fieldId) {
7093
          case 1: // PROMOTION_ID
7094
            return PROMOTION_ID;
7095
          case 2: // COUPON_CODE
7096
            return COUPON_CODE;
7097
          default:
7098
            return null;
7099
        }
1982 varun.gupt 7100
      }
7101
 
7102
      /**
7103
       * Find the _Fields constant that matches fieldId, throwing an exception
7104
       * if it is not found.
7105
       */
7106
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7107
        _Fields fields = findByThriftId(fieldId);
7108
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7109
        return fields;
7110
      }
7111
 
7112
      /**
7113
       * Find the _Fields constant that matches name, or null if its not found.
7114
       */
7115
      public static _Fields findByName(String name) {
7116
        return byName.get(name);
7117
      }
7118
 
7119
      private final short _thriftId;
7120
      private final String _fieldName;
7121
 
7122
      _Fields(short thriftId, String fieldName) {
7123
        _thriftId = thriftId;
7124
        _fieldName = fieldName;
7125
      }
7126
 
7127
      public short getThriftFieldId() {
7128
        return _thriftId;
7129
      }
7130
 
7131
      public String getFieldName() {
7132
        return _fieldName;
7133
      }
7134
    }
7135
 
7136
    // isset id assignments
7137
    private static final int __PROMOTIONID_ISSET_ID = 0;
7138
    private BitSet __isset_bit_vector = new BitSet(1);
7139
 
3430 rajveer 7140
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 7141
    static {
3430 rajveer 7142
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7143
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7144
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7145
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7146
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
7147
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7148
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_args.class, metaDataMap);
1982 varun.gupt 7149
    }
7150
 
7151
    public generateCouponsForPromotion_args() {
7152
    }
7153
 
7154
    public generateCouponsForPromotion_args(
7155
      long promotionId,
7156
      String couponCode)
7157
    {
7158
      this();
7159
      this.promotionId = promotionId;
7160
      setPromotionIdIsSet(true);
7161
      this.couponCode = couponCode;
7162
    }
7163
 
7164
    /**
7165
     * Performs a deep copy on <i>other</i>.
7166
     */
7167
    public generateCouponsForPromotion_args(generateCouponsForPromotion_args other) {
7168
      __isset_bit_vector.clear();
7169
      __isset_bit_vector.or(other.__isset_bit_vector);
7170
      this.promotionId = other.promotionId;
7171
      if (other.isSetCouponCode()) {
7172
        this.couponCode = other.couponCode;
7173
      }
7174
    }
7175
 
7176
    public generateCouponsForPromotion_args deepCopy() {
7177
      return new generateCouponsForPromotion_args(this);
7178
    }
7179
 
3430 rajveer 7180
    @Override
7181
    public void clear() {
7182
      setPromotionIdIsSet(false);
7183
      this.promotionId = 0;
7184
      this.couponCode = null;
1982 varun.gupt 7185
    }
7186
 
7187
    public long getPromotionId() {
7188
      return this.promotionId;
7189
    }
7190
 
3430 rajveer 7191
    public void setPromotionId(long promotionId) {
1982 varun.gupt 7192
      this.promotionId = promotionId;
7193
      setPromotionIdIsSet(true);
7194
    }
7195
 
7196
    public void unsetPromotionId() {
7197
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
7198
    }
7199
 
3430 rajveer 7200
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7201
    public boolean isSetPromotionId() {
7202
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
7203
    }
7204
 
7205
    public void setPromotionIdIsSet(boolean value) {
7206
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
7207
    }
7208
 
7209
    public String getCouponCode() {
7210
      return this.couponCode;
7211
    }
7212
 
3430 rajveer 7213
    public void setCouponCode(String couponCode) {
1982 varun.gupt 7214
      this.couponCode = couponCode;
7215
    }
7216
 
7217
    public void unsetCouponCode() {
7218
      this.couponCode = null;
7219
    }
7220
 
3430 rajveer 7221
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7222
    public boolean isSetCouponCode() {
7223
      return this.couponCode != null;
7224
    }
7225
 
7226
    public void setCouponCodeIsSet(boolean value) {
7227
      if (!value) {
7228
        this.couponCode = null;
7229
      }
7230
    }
7231
 
7232
    public void setFieldValue(_Fields field, Object value) {
7233
      switch (field) {
7234
      case PROMOTION_ID:
7235
        if (value == null) {
7236
          unsetPromotionId();
7237
        } else {
7238
          setPromotionId((Long)value);
7239
        }
7240
        break;
7241
 
7242
      case COUPON_CODE:
7243
        if (value == null) {
7244
          unsetCouponCode();
7245
        } else {
7246
          setCouponCode((String)value);
7247
        }
7248
        break;
7249
 
7250
      }
7251
    }
7252
 
7253
    public Object getFieldValue(_Fields field) {
7254
      switch (field) {
7255
      case PROMOTION_ID:
3430 rajveer 7256
        return Long.valueOf(getPromotionId());
1982 varun.gupt 7257
 
7258
      case COUPON_CODE:
7259
        return getCouponCode();
7260
 
7261
      }
7262
      throw new IllegalStateException();
7263
    }
7264
 
3430 rajveer 7265
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7266
    public boolean isSet(_Fields field) {
7267
      if (field == null) {
7268
        throw new IllegalArgumentException();
7269
      }
1982 varun.gupt 7270
 
7271
      switch (field) {
7272
      case PROMOTION_ID:
7273
        return isSetPromotionId();
7274
      case COUPON_CODE:
7275
        return isSetCouponCode();
7276
      }
7277
      throw new IllegalStateException();
7278
    }
7279
 
7280
    @Override
7281
    public boolean equals(Object that) {
7282
      if (that == null)
7283
        return false;
7284
      if (that instanceof generateCouponsForPromotion_args)
7285
        return this.equals((generateCouponsForPromotion_args)that);
7286
      return false;
7287
    }
7288
 
7289
    public boolean equals(generateCouponsForPromotion_args that) {
7290
      if (that == null)
7291
        return false;
7292
 
7293
      boolean this_present_promotionId = true;
7294
      boolean that_present_promotionId = true;
7295
      if (this_present_promotionId || that_present_promotionId) {
7296
        if (!(this_present_promotionId && that_present_promotionId))
7297
          return false;
7298
        if (this.promotionId != that.promotionId)
7299
          return false;
7300
      }
7301
 
7302
      boolean this_present_couponCode = true && this.isSetCouponCode();
7303
      boolean that_present_couponCode = true && that.isSetCouponCode();
7304
      if (this_present_couponCode || that_present_couponCode) {
7305
        if (!(this_present_couponCode && that_present_couponCode))
7306
          return false;
7307
        if (!this.couponCode.equals(that.couponCode))
7308
          return false;
7309
      }
7310
 
7311
      return true;
7312
    }
7313
 
7314
    @Override
7315
    public int hashCode() {
7316
      return 0;
7317
    }
7318
 
7319
    public int compareTo(generateCouponsForPromotion_args other) {
7320
      if (!getClass().equals(other.getClass())) {
7321
        return getClass().getName().compareTo(other.getClass().getName());
7322
      }
7323
 
7324
      int lastComparison = 0;
7325
      generateCouponsForPromotion_args typedOther = (generateCouponsForPromotion_args)other;
7326
 
3430 rajveer 7327
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 7328
      if (lastComparison != 0) {
7329
        return lastComparison;
7330
      }
3430 rajveer 7331
      if (isSetPromotionId()) {
7332
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
7333
        if (lastComparison != 0) {
7334
          return lastComparison;
7335
        }
1982 varun.gupt 7336
      }
3430 rajveer 7337
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 7338
      if (lastComparison != 0) {
7339
        return lastComparison;
7340
      }
3430 rajveer 7341
      if (isSetCouponCode()) {
7342
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
7343
        if (lastComparison != 0) {
7344
          return lastComparison;
7345
        }
1982 varun.gupt 7346
      }
7347
      return 0;
7348
    }
7349
 
3430 rajveer 7350
    public _Fields fieldForId(int fieldId) {
7351
      return _Fields.findByThriftId(fieldId);
7352
    }
7353
 
7354
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7355
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 7356
      iprot.readStructBegin();
7357
      while (true)
7358
      {
7359
        field = iprot.readFieldBegin();
3430 rajveer 7360
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 7361
          break;
7362
        }
3430 rajveer 7363
        switch (field.id) {
7364
          case 1: // PROMOTION_ID
7365
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7366
              this.promotionId = iprot.readI64();
7367
              setPromotionIdIsSet(true);
7368
            } else { 
7369
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7370
            }
7371
            break;
7372
          case 2: // COUPON_CODE
7373
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
7374
              this.couponCode = iprot.readString();
7375
            } else { 
7376
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7377
            }
7378
            break;
7379
          default:
7380
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 7381
        }
3430 rajveer 7382
        iprot.readFieldEnd();
1982 varun.gupt 7383
      }
7384
      iprot.readStructEnd();
7385
      validate();
7386
    }
7387
 
3430 rajveer 7388
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 7389
      validate();
7390
 
7391
      oprot.writeStructBegin(STRUCT_DESC);
7392
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
7393
      oprot.writeI64(this.promotionId);
7394
      oprot.writeFieldEnd();
7395
      if (this.couponCode != null) {
7396
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
7397
        oprot.writeString(this.couponCode);
7398
        oprot.writeFieldEnd();
7399
      }
7400
      oprot.writeFieldStop();
7401
      oprot.writeStructEnd();
7402
    }
7403
 
7404
    @Override
7405
    public String toString() {
7406
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_args(");
7407
      boolean first = true;
7408
 
7409
      sb.append("promotionId:");
7410
      sb.append(this.promotionId);
7411
      first = false;
7412
      if (!first) sb.append(", ");
7413
      sb.append("couponCode:");
7414
      if (this.couponCode == null) {
7415
        sb.append("null");
7416
      } else {
7417
        sb.append(this.couponCode);
7418
      }
7419
      first = false;
7420
      sb.append(")");
7421
      return sb.toString();
7422
    }
7423
 
3430 rajveer 7424
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7425
      // check for required fields
7426
    }
7427
 
3430 rajveer 7428
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7429
      try {
7430
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7431
      } catch (org.apache.thrift.TException te) {
7432
        throw new java.io.IOException(te);
7433
      }
7434
    }
7435
 
7436
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7437
      try {
7438
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
7439
        __isset_bit_vector = new BitSet(1);
7440
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7441
      } catch (org.apache.thrift.TException te) {
7442
        throw new java.io.IOException(te);
7443
      }
7444
    }
7445
 
1982 varun.gupt 7446
  }
7447
 
3430 rajveer 7448
  public static class generateCouponsForPromotion_result implements org.apache.thrift.TBase<generateCouponsForPromotion_result, generateCouponsForPromotion_result._Fields>, java.io.Serializable, Cloneable   {
7449
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_result");
1982 varun.gupt 7450
 
3430 rajveer 7451
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
1982 varun.gupt 7452
 
3430 rajveer 7453
    private PromotionException pex; // required
1982 varun.gupt 7454
 
7455
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7456
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 7457
      PEX((short)1, "pex");
7458
 
7459
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7460
 
7461
      static {
7462
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7463
          byName.put(field.getFieldName(), field);
7464
        }
7465
      }
7466
 
7467
      /**
7468
       * Find the _Fields constant that matches fieldId, or null if its not found.
7469
       */
7470
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7471
        switch(fieldId) {
7472
          case 1: // PEX
7473
            return PEX;
7474
          default:
7475
            return null;
7476
        }
1982 varun.gupt 7477
      }
7478
 
7479
      /**
7480
       * Find the _Fields constant that matches fieldId, throwing an exception
7481
       * if it is not found.
7482
       */
7483
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7484
        _Fields fields = findByThriftId(fieldId);
7485
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7486
        return fields;
7487
      }
7488
 
7489
      /**
7490
       * Find the _Fields constant that matches name, or null if its not found.
7491
       */
7492
      public static _Fields findByName(String name) {
7493
        return byName.get(name);
7494
      }
7495
 
7496
      private final short _thriftId;
7497
      private final String _fieldName;
7498
 
7499
      _Fields(short thriftId, String fieldName) {
7500
        _thriftId = thriftId;
7501
        _fieldName = fieldName;
7502
      }
7503
 
7504
      public short getThriftFieldId() {
7505
        return _thriftId;
7506
      }
7507
 
7508
      public String getFieldName() {
7509
        return _fieldName;
7510
      }
7511
    }
7512
 
7513
    // isset id assignments
7514
 
3430 rajveer 7515
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 7516
    static {
3430 rajveer 7517
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7518
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7519
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
7520
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7521
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_result.class, metaDataMap);
1982 varun.gupt 7522
    }
7523
 
7524
    public generateCouponsForPromotion_result() {
7525
    }
7526
 
7527
    public generateCouponsForPromotion_result(
7528
      PromotionException pex)
7529
    {
7530
      this();
7531
      this.pex = pex;
7532
    }
7533
 
7534
    /**
7535
     * Performs a deep copy on <i>other</i>.
7536
     */
7537
    public generateCouponsForPromotion_result(generateCouponsForPromotion_result other) {
7538
      if (other.isSetPex()) {
7539
        this.pex = new PromotionException(other.pex);
7540
      }
7541
    }
7542
 
7543
    public generateCouponsForPromotion_result deepCopy() {
7544
      return new generateCouponsForPromotion_result(this);
7545
    }
7546
 
3430 rajveer 7547
    @Override
7548
    public void clear() {
7549
      this.pex = null;
1982 varun.gupt 7550
    }
7551
 
7552
    public PromotionException getPex() {
7553
      return this.pex;
7554
    }
7555
 
3430 rajveer 7556
    public void setPex(PromotionException pex) {
1982 varun.gupt 7557
      this.pex = pex;
7558
    }
7559
 
7560
    public void unsetPex() {
7561
      this.pex = null;
7562
    }
7563
 
3430 rajveer 7564
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7565
    public boolean isSetPex() {
7566
      return this.pex != null;
7567
    }
7568
 
7569
    public void setPexIsSet(boolean value) {
7570
      if (!value) {
7571
        this.pex = null;
7572
      }
7573
    }
7574
 
7575
    public void setFieldValue(_Fields field, Object value) {
7576
      switch (field) {
7577
      case PEX:
7578
        if (value == null) {
7579
          unsetPex();
7580
        } else {
7581
          setPex((PromotionException)value);
7582
        }
7583
        break;
7584
 
7585
      }
7586
    }
7587
 
7588
    public Object getFieldValue(_Fields field) {
7589
      switch (field) {
7590
      case PEX:
7591
        return getPex();
7592
 
7593
      }
7594
      throw new IllegalStateException();
7595
    }
7596
 
3430 rajveer 7597
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7598
    public boolean isSet(_Fields field) {
7599
      if (field == null) {
7600
        throw new IllegalArgumentException();
7601
      }
1982 varun.gupt 7602
 
7603
      switch (field) {
7604
      case PEX:
7605
        return isSetPex();
7606
      }
7607
      throw new IllegalStateException();
7608
    }
7609
 
7610
    @Override
7611
    public boolean equals(Object that) {
7612
      if (that == null)
7613
        return false;
7614
      if (that instanceof generateCouponsForPromotion_result)
7615
        return this.equals((generateCouponsForPromotion_result)that);
7616
      return false;
7617
    }
7618
 
7619
    public boolean equals(generateCouponsForPromotion_result that) {
7620
      if (that == null)
7621
        return false;
7622
 
7623
      boolean this_present_pex = true && this.isSetPex();
7624
      boolean that_present_pex = true && that.isSetPex();
7625
      if (this_present_pex || that_present_pex) {
7626
        if (!(this_present_pex && that_present_pex))
7627
          return false;
7628
        if (!this.pex.equals(that.pex))
7629
          return false;
7630
      }
7631
 
7632
      return true;
7633
    }
7634
 
7635
    @Override
7636
    public int hashCode() {
7637
      return 0;
7638
    }
7639
 
7640
    public int compareTo(generateCouponsForPromotion_result other) {
7641
      if (!getClass().equals(other.getClass())) {
7642
        return getClass().getName().compareTo(other.getClass().getName());
7643
      }
7644
 
7645
      int lastComparison = 0;
7646
      generateCouponsForPromotion_result typedOther = (generateCouponsForPromotion_result)other;
7647
 
3430 rajveer 7648
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 7649
      if (lastComparison != 0) {
7650
        return lastComparison;
7651
      }
3430 rajveer 7652
      if (isSetPex()) {
7653
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
7654
        if (lastComparison != 0) {
7655
          return lastComparison;
7656
        }
1982 varun.gupt 7657
      }
7658
      return 0;
7659
    }
7660
 
3430 rajveer 7661
    public _Fields fieldForId(int fieldId) {
7662
      return _Fields.findByThriftId(fieldId);
7663
    }
7664
 
7665
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7666
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 7667
      iprot.readStructBegin();
7668
      while (true)
7669
      {
7670
        field = iprot.readFieldBegin();
3430 rajveer 7671
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 7672
          break;
7673
        }
3430 rajveer 7674
        switch (field.id) {
7675
          case 1: // PEX
7676
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
7677
              this.pex = new PromotionException();
7678
              this.pex.read(iprot);
7679
            } else { 
7680
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7681
            }
7682
            break;
7683
          default:
7684
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 7685
        }
3430 rajveer 7686
        iprot.readFieldEnd();
1982 varun.gupt 7687
      }
7688
      iprot.readStructEnd();
7689
      validate();
7690
    }
7691
 
3430 rajveer 7692
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 7693
      oprot.writeStructBegin(STRUCT_DESC);
7694
 
7695
      if (this.isSetPex()) {
7696
        oprot.writeFieldBegin(PEX_FIELD_DESC);
7697
        this.pex.write(oprot);
7698
        oprot.writeFieldEnd();
7699
      }
7700
      oprot.writeFieldStop();
7701
      oprot.writeStructEnd();
7702
    }
7703
 
7704
    @Override
7705
    public String toString() {
7706
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_result(");
7707
      boolean first = true;
7708
 
7709
      sb.append("pex:");
7710
      if (this.pex == null) {
7711
        sb.append("null");
7712
      } else {
7713
        sb.append(this.pex);
7714
      }
7715
      first = false;
7716
      sb.append(")");
7717
      return sb.toString();
7718
    }
7719
 
3430 rajveer 7720
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7721
      // check for required fields
7722
    }
7723
 
3430 rajveer 7724
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7725
      try {
7726
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7727
      } catch (org.apache.thrift.TException te) {
7728
        throw new java.io.IOException(te);
7729
      }
7730
    }
7731
 
7732
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7733
      try {
7734
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7735
      } catch (org.apache.thrift.TException te) {
7736
        throw new java.io.IOException(te);
7737
      }
7738
    }
7739
 
1982 varun.gupt 7740
  }
7741
 
3430 rajveer 7742
  public static class applyCoupon_args implements org.apache.thrift.TBase<applyCoupon_args, applyCoupon_args._Fields>, java.io.Serializable, Cloneable   {
7743
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_args");
1982 varun.gupt 7744
 
3430 rajveer 7745
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)1);
7746
    private static final org.apache.thrift.protocol.TField CART_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("cartId", org.apache.thrift.protocol.TType.I64, (short)2);
1982 varun.gupt 7747
 
3430 rajveer 7748
    private String couponCode; // required
7749
    private long cartId; // required
1982 varun.gupt 7750
 
7751
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7752
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 7753
      COUPON_CODE((short)1, "couponCode"),
7754
      CART_ID((short)2, "cartId");
7755
 
7756
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7757
 
7758
      static {
7759
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7760
          byName.put(field.getFieldName(), field);
7761
        }
7762
      }
7763
 
7764
      /**
7765
       * Find the _Fields constant that matches fieldId, or null if its not found.
7766
       */
7767
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7768
        switch(fieldId) {
7769
          case 1: // COUPON_CODE
7770
            return COUPON_CODE;
7771
          case 2: // CART_ID
7772
            return CART_ID;
7773
          default:
7774
            return null;
7775
        }
1982 varun.gupt 7776
      }
7777
 
7778
      /**
7779
       * Find the _Fields constant that matches fieldId, throwing an exception
7780
       * if it is not found.
7781
       */
7782
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7783
        _Fields fields = findByThriftId(fieldId);
7784
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7785
        return fields;
7786
      }
7787
 
7788
      /**
7789
       * Find the _Fields constant that matches name, or null if its not found.
7790
       */
7791
      public static _Fields findByName(String name) {
7792
        return byName.get(name);
7793
      }
7794
 
7795
      private final short _thriftId;
7796
      private final String _fieldName;
7797
 
7798
      _Fields(short thriftId, String fieldName) {
7799
        _thriftId = thriftId;
7800
        _fieldName = fieldName;
7801
      }
7802
 
7803
      public short getThriftFieldId() {
7804
        return _thriftId;
7805
      }
7806
 
7807
      public String getFieldName() {
7808
        return _fieldName;
7809
      }
7810
    }
7811
 
7812
    // isset id assignments
7813
    private static final int __CARTID_ISSET_ID = 0;
7814
    private BitSet __isset_bit_vector = new BitSet(1);
7815
 
3430 rajveer 7816
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 7817
    static {
3430 rajveer 7818
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7819
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7820
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
7821
      tmpMap.put(_Fields.CART_ID, new org.apache.thrift.meta_data.FieldMetaData("cartId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7822
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7823
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7824
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_args.class, metaDataMap);
1982 varun.gupt 7825
    }
7826
 
7827
    public applyCoupon_args() {
7828
    }
7829
 
7830
    public applyCoupon_args(
7831
      String couponCode,
7832
      long cartId)
7833
    {
7834
      this();
7835
      this.couponCode = couponCode;
7836
      this.cartId = cartId;
7837
      setCartIdIsSet(true);
7838
    }
7839
 
7840
    /**
7841
     * Performs a deep copy on <i>other</i>.
7842
     */
7843
    public applyCoupon_args(applyCoupon_args other) {
7844
      __isset_bit_vector.clear();
7845
      __isset_bit_vector.or(other.__isset_bit_vector);
7846
      if (other.isSetCouponCode()) {
7847
        this.couponCode = other.couponCode;
7848
      }
7849
      this.cartId = other.cartId;
7850
    }
7851
 
7852
    public applyCoupon_args deepCopy() {
7853
      return new applyCoupon_args(this);
7854
    }
7855
 
3430 rajveer 7856
    @Override
7857
    public void clear() {
7858
      this.couponCode = null;
7859
      setCartIdIsSet(false);
7860
      this.cartId = 0;
1982 varun.gupt 7861
    }
7862
 
7863
    public String getCouponCode() {
7864
      return this.couponCode;
7865
    }
7866
 
3430 rajveer 7867
    public void setCouponCode(String couponCode) {
1982 varun.gupt 7868
      this.couponCode = couponCode;
7869
    }
7870
 
7871
    public void unsetCouponCode() {
7872
      this.couponCode = null;
7873
    }
7874
 
3430 rajveer 7875
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7876
    public boolean isSetCouponCode() {
7877
      return this.couponCode != null;
7878
    }
7879
 
7880
    public void setCouponCodeIsSet(boolean value) {
7881
      if (!value) {
7882
        this.couponCode = null;
7883
      }
7884
    }
7885
 
7886
    public long getCartId() {
7887
      return this.cartId;
7888
    }
7889
 
3430 rajveer 7890
    public void setCartId(long cartId) {
1982 varun.gupt 7891
      this.cartId = cartId;
7892
      setCartIdIsSet(true);
7893
    }
7894
 
7895
    public void unsetCartId() {
7896
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
7897
    }
7898
 
3430 rajveer 7899
    /** Returns true if field cartId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7900
    public boolean isSetCartId() {
7901
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
7902
    }
7903
 
7904
    public void setCartIdIsSet(boolean value) {
7905
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
7906
    }
7907
 
7908
    public void setFieldValue(_Fields field, Object value) {
7909
      switch (field) {
7910
      case COUPON_CODE:
7911
        if (value == null) {
7912
          unsetCouponCode();
7913
        } else {
7914
          setCouponCode((String)value);
7915
        }
7916
        break;
7917
 
7918
      case CART_ID:
7919
        if (value == null) {
7920
          unsetCartId();
7921
        } else {
7922
          setCartId((Long)value);
7923
        }
7924
        break;
7925
 
7926
      }
7927
    }
7928
 
7929
    public Object getFieldValue(_Fields field) {
7930
      switch (field) {
7931
      case COUPON_CODE:
7932
        return getCouponCode();
7933
 
7934
      case CART_ID:
3430 rajveer 7935
        return Long.valueOf(getCartId());
1982 varun.gupt 7936
 
7937
      }
7938
      throw new IllegalStateException();
7939
    }
7940
 
3430 rajveer 7941
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7942
    public boolean isSet(_Fields field) {
7943
      if (field == null) {
7944
        throw new IllegalArgumentException();
7945
      }
1982 varun.gupt 7946
 
7947
      switch (field) {
7948
      case COUPON_CODE:
7949
        return isSetCouponCode();
7950
      case CART_ID:
7951
        return isSetCartId();
7952
      }
7953
      throw new IllegalStateException();
7954
    }
7955
 
7956
    @Override
7957
    public boolean equals(Object that) {
7958
      if (that == null)
7959
        return false;
7960
      if (that instanceof applyCoupon_args)
7961
        return this.equals((applyCoupon_args)that);
7962
      return false;
7963
    }
7964
 
7965
    public boolean equals(applyCoupon_args that) {
7966
      if (that == null)
7967
        return false;
7968
 
7969
      boolean this_present_couponCode = true && this.isSetCouponCode();
7970
      boolean that_present_couponCode = true && that.isSetCouponCode();
7971
      if (this_present_couponCode || that_present_couponCode) {
7972
        if (!(this_present_couponCode && that_present_couponCode))
7973
          return false;
7974
        if (!this.couponCode.equals(that.couponCode))
7975
          return false;
7976
      }
7977
 
7978
      boolean this_present_cartId = true;
7979
      boolean that_present_cartId = true;
7980
      if (this_present_cartId || that_present_cartId) {
7981
        if (!(this_present_cartId && that_present_cartId))
7982
          return false;
7983
        if (this.cartId != that.cartId)
7984
          return false;
7985
      }
7986
 
7987
      return true;
7988
    }
7989
 
7990
    @Override
7991
    public int hashCode() {
7992
      return 0;
7993
    }
7994
 
7995
    public int compareTo(applyCoupon_args other) {
7996
      if (!getClass().equals(other.getClass())) {
7997
        return getClass().getName().compareTo(other.getClass().getName());
7998
      }
7999
 
8000
      int lastComparison = 0;
8001
      applyCoupon_args typedOther = (applyCoupon_args)other;
8002
 
3430 rajveer 8003
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 8004
      if (lastComparison != 0) {
8005
        return lastComparison;
8006
      }
3430 rajveer 8007
      if (isSetCouponCode()) {
8008
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
8009
        if (lastComparison != 0) {
8010
          return lastComparison;
8011
        }
1982 varun.gupt 8012
      }
3430 rajveer 8013
      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(typedOther.isSetCartId());
1982 varun.gupt 8014
      if (lastComparison != 0) {
8015
        return lastComparison;
8016
      }
3430 rajveer 8017
      if (isSetCartId()) {
8018
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cartId, typedOther.cartId);
8019
        if (lastComparison != 0) {
8020
          return lastComparison;
8021
        }
1982 varun.gupt 8022
      }
8023
      return 0;
8024
    }
8025
 
3430 rajveer 8026
    public _Fields fieldForId(int fieldId) {
8027
      return _Fields.findByThriftId(fieldId);
8028
    }
8029
 
8030
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8031
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 8032
      iprot.readStructBegin();
8033
      while (true)
8034
      {
8035
        field = iprot.readFieldBegin();
3430 rajveer 8036
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 8037
          break;
8038
        }
3430 rajveer 8039
        switch (field.id) {
8040
          case 1: // COUPON_CODE
8041
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
8042
              this.couponCode = iprot.readString();
8043
            } else { 
8044
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8045
            }
8046
            break;
8047
          case 2: // CART_ID
8048
            if (field.type == org.apache.thrift.protocol.TType.I64) {
8049
              this.cartId = iprot.readI64();
8050
              setCartIdIsSet(true);
8051
            } else { 
8052
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8053
            }
8054
            break;
8055
          default:
8056
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 8057
        }
3430 rajveer 8058
        iprot.readFieldEnd();
1982 varun.gupt 8059
      }
8060
      iprot.readStructEnd();
8061
      validate();
8062
    }
8063
 
3430 rajveer 8064
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 8065
      validate();
8066
 
8067
      oprot.writeStructBegin(STRUCT_DESC);
8068
      if (this.couponCode != null) {
8069
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
8070
        oprot.writeString(this.couponCode);
8071
        oprot.writeFieldEnd();
8072
      }
8073
      oprot.writeFieldBegin(CART_ID_FIELD_DESC);
8074
      oprot.writeI64(this.cartId);
8075
      oprot.writeFieldEnd();
8076
      oprot.writeFieldStop();
8077
      oprot.writeStructEnd();
8078
    }
8079
 
8080
    @Override
8081
    public String toString() {
8082
      StringBuilder sb = new StringBuilder("applyCoupon_args(");
8083
      boolean first = true;
8084
 
8085
      sb.append("couponCode:");
8086
      if (this.couponCode == null) {
8087
        sb.append("null");
8088
      } else {
8089
        sb.append(this.couponCode);
8090
      }
8091
      first = false;
8092
      if (!first) sb.append(", ");
8093
      sb.append("cartId:");
8094
      sb.append(this.cartId);
8095
      first = false;
8096
      sb.append(")");
8097
      return sb.toString();
8098
    }
8099
 
3430 rajveer 8100
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 8101
      // check for required fields
8102
    }
8103
 
3430 rajveer 8104
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8105
      try {
8106
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8107
      } catch (org.apache.thrift.TException te) {
8108
        throw new java.io.IOException(te);
8109
      }
8110
    }
8111
 
8112
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8113
      try {
8114
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
8115
        __isset_bit_vector = new BitSet(1);
8116
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8117
      } catch (org.apache.thrift.TException te) {
8118
        throw new java.io.IOException(te);
8119
      }
8120
    }
8121
 
1982 varun.gupt 8122
  }
8123
 
3430 rajveer 8124
  public static class applyCoupon_result implements org.apache.thrift.TBase<applyCoupon_result, applyCoupon_result._Fields>, java.io.Serializable, Cloneable   {
8125
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_result");
1982 varun.gupt 8126
 
3430 rajveer 8127
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
8128
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
1982 varun.gupt 8129
 
3430 rajveer 8130
    private Cart success; // required
8131
    private PromotionException pex; // required
1982 varun.gupt 8132
 
8133
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 8134
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 8135
      SUCCESS((short)0, "success"),
8136
      PEX((short)1, "pex");
8137
 
8138
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8139
 
8140
      static {
8141
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8142
          byName.put(field.getFieldName(), field);
8143
        }
8144
      }
8145
 
8146
      /**
8147
       * Find the _Fields constant that matches fieldId, or null if its not found.
8148
       */
8149
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 8150
        switch(fieldId) {
8151
          case 0: // SUCCESS
8152
            return SUCCESS;
8153
          case 1: // PEX
8154
            return PEX;
8155
          default:
8156
            return null;
8157
        }
1982 varun.gupt 8158
      }
8159
 
8160
      /**
8161
       * Find the _Fields constant that matches fieldId, throwing an exception
8162
       * if it is not found.
8163
       */
8164
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8165
        _Fields fields = findByThriftId(fieldId);
8166
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8167
        return fields;
8168
      }
8169
 
8170
      /**
8171
       * Find the _Fields constant that matches name, or null if its not found.
8172
       */
8173
      public static _Fields findByName(String name) {
8174
        return byName.get(name);
8175
      }
8176
 
8177
      private final short _thriftId;
8178
      private final String _fieldName;
8179
 
8180
      _Fields(short thriftId, String fieldName) {
8181
        _thriftId = thriftId;
8182
        _fieldName = fieldName;
8183
      }
8184
 
8185
      public short getThriftFieldId() {
8186
        return _thriftId;
8187
      }
8188
 
8189
      public String getFieldName() {
8190
        return _fieldName;
8191
      }
8192
    }
8193
 
8194
    // isset id assignments
8195
 
3430 rajveer 8196
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 8197
    static {
3430 rajveer 8198
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8199
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8200
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Cart.class)));
8201
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8202
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
8203
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8204
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_result.class, metaDataMap);
1982 varun.gupt 8205
    }
8206
 
8207
    public applyCoupon_result() {
8208
    }
8209
 
8210
    public applyCoupon_result(
8211
      Cart success,
8212
      PromotionException pex)
8213
    {
8214
      this();
8215
      this.success = success;
8216
      this.pex = pex;
8217
    }
8218
 
8219
    /**
8220
     * Performs a deep copy on <i>other</i>.
8221
     */
8222
    public applyCoupon_result(applyCoupon_result other) {
8223
      if (other.isSetSuccess()) {
8224
        this.success = new Cart(other.success);
8225
      }
8226
      if (other.isSetPex()) {
8227
        this.pex = new PromotionException(other.pex);
8228
      }
8229
    }
8230
 
8231
    public applyCoupon_result deepCopy() {
8232
      return new applyCoupon_result(this);
8233
    }
8234
 
3430 rajveer 8235
    @Override
8236
    public void clear() {
8237
      this.success = null;
8238
      this.pex = null;
1982 varun.gupt 8239
    }
8240
 
8241
    public Cart getSuccess() {
8242
      return this.success;
8243
    }
8244
 
3430 rajveer 8245
    public void setSuccess(Cart success) {
1982 varun.gupt 8246
      this.success = success;
8247
    }
8248
 
8249
    public void unsetSuccess() {
8250
      this.success = null;
8251
    }
8252
 
3430 rajveer 8253
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 8254
    public boolean isSetSuccess() {
8255
      return this.success != null;
8256
    }
8257
 
8258
    public void setSuccessIsSet(boolean value) {
8259
      if (!value) {
8260
        this.success = null;
8261
      }
8262
    }
8263
 
8264
    public PromotionException getPex() {
8265
      return this.pex;
8266
    }
8267
 
3430 rajveer 8268
    public void setPex(PromotionException pex) {
1982 varun.gupt 8269
      this.pex = pex;
8270
    }
8271
 
8272
    public void unsetPex() {
8273
      this.pex = null;
8274
    }
8275
 
3430 rajveer 8276
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 8277
    public boolean isSetPex() {
8278
      return this.pex != null;
8279
    }
8280
 
8281
    public void setPexIsSet(boolean value) {
8282
      if (!value) {
8283
        this.pex = null;
8284
      }
8285
    }
8286
 
8287
    public void setFieldValue(_Fields field, Object value) {
8288
      switch (field) {
8289
      case SUCCESS:
8290
        if (value == null) {
8291
          unsetSuccess();
8292
        } else {
8293
          setSuccess((Cart)value);
8294
        }
8295
        break;
8296
 
8297
      case PEX:
8298
        if (value == null) {
8299
          unsetPex();
8300
        } else {
8301
          setPex((PromotionException)value);
8302
        }
8303
        break;
8304
 
8305
      }
8306
    }
8307
 
8308
    public Object getFieldValue(_Fields field) {
8309
      switch (field) {
8310
      case SUCCESS:
8311
        return getSuccess();
8312
 
8313
      case PEX:
8314
        return getPex();
8315
 
8316
      }
8317
      throw new IllegalStateException();
8318
    }
8319
 
3430 rajveer 8320
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8321
    public boolean isSet(_Fields field) {
8322
      if (field == null) {
8323
        throw new IllegalArgumentException();
8324
      }
1982 varun.gupt 8325
 
8326
      switch (field) {
8327
      case SUCCESS:
8328
        return isSetSuccess();
8329
      case PEX:
8330
        return isSetPex();
8331
      }
8332
      throw new IllegalStateException();
8333
    }
8334
 
8335
    @Override
8336
    public boolean equals(Object that) {
8337
      if (that == null)
8338
        return false;
8339
      if (that instanceof applyCoupon_result)
8340
        return this.equals((applyCoupon_result)that);
8341
      return false;
8342
    }
8343
 
8344
    public boolean equals(applyCoupon_result that) {
8345
      if (that == null)
8346
        return false;
8347
 
8348
      boolean this_present_success = true && this.isSetSuccess();
8349
      boolean that_present_success = true && that.isSetSuccess();
8350
      if (this_present_success || that_present_success) {
8351
        if (!(this_present_success && that_present_success))
8352
          return false;
8353
        if (!this.success.equals(that.success))
8354
          return false;
8355
      }
8356
 
8357
      boolean this_present_pex = true && this.isSetPex();
8358
      boolean that_present_pex = true && that.isSetPex();
8359
      if (this_present_pex || that_present_pex) {
8360
        if (!(this_present_pex && that_present_pex))
8361
          return false;
8362
        if (!this.pex.equals(that.pex))
8363
          return false;
8364
      }
8365
 
8366
      return true;
8367
    }
8368
 
8369
    @Override
8370
    public int hashCode() {
8371
      return 0;
8372
    }
8373
 
8374
    public int compareTo(applyCoupon_result other) {
8375
      if (!getClass().equals(other.getClass())) {
8376
        return getClass().getName().compareTo(other.getClass().getName());
8377
      }
8378
 
8379
      int lastComparison = 0;
8380
      applyCoupon_result typedOther = (applyCoupon_result)other;
8381
 
3430 rajveer 8382
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 8383
      if (lastComparison != 0) {
8384
        return lastComparison;
8385
      }
3430 rajveer 8386
      if (isSetSuccess()) {
8387
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
8388
        if (lastComparison != 0) {
8389
          return lastComparison;
8390
        }
1982 varun.gupt 8391
      }
3430 rajveer 8392
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 8393
      if (lastComparison != 0) {
8394
        return lastComparison;
8395
      }
3430 rajveer 8396
      if (isSetPex()) {
8397
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
8398
        if (lastComparison != 0) {
8399
          return lastComparison;
8400
        }
1982 varun.gupt 8401
      }
8402
      return 0;
8403
    }
8404
 
3430 rajveer 8405
    public _Fields fieldForId(int fieldId) {
8406
      return _Fields.findByThriftId(fieldId);
8407
    }
8408
 
8409
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8410
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 8411
      iprot.readStructBegin();
8412
      while (true)
8413
      {
8414
        field = iprot.readFieldBegin();
3430 rajveer 8415
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 8416
          break;
8417
        }
3430 rajveer 8418
        switch (field.id) {
8419
          case 0: // SUCCESS
8420
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
8421
              this.success = new Cart();
8422
              this.success.read(iprot);
8423
            } else { 
8424
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8425
            }
8426
            break;
8427
          case 1: // PEX
8428
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
8429
              this.pex = new PromotionException();
8430
              this.pex.read(iprot);
8431
            } else { 
8432
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8433
            }
8434
            break;
8435
          default:
8436
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 8437
        }
3430 rajveer 8438
        iprot.readFieldEnd();
1982 varun.gupt 8439
      }
8440
      iprot.readStructEnd();
8441
      validate();
8442
    }
8443
 
3430 rajveer 8444
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 8445
      oprot.writeStructBegin(STRUCT_DESC);
8446
 
8447
      if (this.isSetSuccess()) {
8448
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
8449
        this.success.write(oprot);
8450
        oprot.writeFieldEnd();
8451
      } else if (this.isSetPex()) {
8452
        oprot.writeFieldBegin(PEX_FIELD_DESC);
8453
        this.pex.write(oprot);
8454
        oprot.writeFieldEnd();
8455
      }
8456
      oprot.writeFieldStop();
8457
      oprot.writeStructEnd();
8458
    }
8459
 
8460
    @Override
8461
    public String toString() {
8462
      StringBuilder sb = new StringBuilder("applyCoupon_result(");
8463
      boolean first = true;
8464
 
8465
      sb.append("success:");
8466
      if (this.success == null) {
8467
        sb.append("null");
8468
      } else {
8469
        sb.append(this.success);
8470
      }
8471
      first = false;
8472
      if (!first) sb.append(", ");
8473
      sb.append("pex:");
8474
      if (this.pex == null) {
8475
        sb.append("null");
8476
      } else {
8477
        sb.append(this.pex);
8478
      }
8479
      first = false;
8480
      sb.append(")");
8481
      return sb.toString();
8482
    }
8483
 
3430 rajveer 8484
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 8485
      // check for required fields
8486
    }
8487
 
3430 rajveer 8488
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8489
      try {
8490
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8491
      } catch (org.apache.thrift.TException te) {
8492
        throw new java.io.IOException(te);
8493
      }
8494
    }
8495
 
8496
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8497
      try {
8498
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8499
      } catch (org.apache.thrift.TException te) {
8500
        throw new java.io.IOException(te);
8501
      }
8502
    }
8503
 
1982 varun.gupt 8504
  }
8505
 
6736 amit.gupta 8506
  public static class getEmiDiscount_args implements org.apache.thrift.TBase<getEmiDiscount_args, getEmiDiscount_args._Fields>, java.io.Serializable, Cloneable   {
8507
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getEmiDiscount_args");
8508
 
8509
    private static final org.apache.thrift.protocol.TField CART_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("cartId", org.apache.thrift.protocol.TType.I64, (short)1);
8510
 
8511
    private long cartId; // required
8512
 
8513
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8514
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
8515
      CART_ID((short)1, "cartId");
8516
 
8517
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8518
 
8519
      static {
8520
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8521
          byName.put(field.getFieldName(), field);
8522
        }
8523
      }
8524
 
8525
      /**
8526
       * Find the _Fields constant that matches fieldId, or null if its not found.
8527
       */
8528
      public static _Fields findByThriftId(int fieldId) {
8529
        switch(fieldId) {
8530
          case 1: // CART_ID
8531
            return CART_ID;
8532
          default:
8533
            return null;
8534
        }
8535
      }
8536
 
8537
      /**
8538
       * Find the _Fields constant that matches fieldId, throwing an exception
8539
       * if it is not found.
8540
       */
8541
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8542
        _Fields fields = findByThriftId(fieldId);
8543
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8544
        return fields;
8545
      }
8546
 
8547
      /**
8548
       * Find the _Fields constant that matches name, or null if its not found.
8549
       */
8550
      public static _Fields findByName(String name) {
8551
        return byName.get(name);
8552
      }
8553
 
8554
      private final short _thriftId;
8555
      private final String _fieldName;
8556
 
8557
      _Fields(short thriftId, String fieldName) {
8558
        _thriftId = thriftId;
8559
        _fieldName = fieldName;
8560
      }
8561
 
8562
      public short getThriftFieldId() {
8563
        return _thriftId;
8564
      }
8565
 
8566
      public String getFieldName() {
8567
        return _fieldName;
8568
      }
8569
    }
8570
 
8571
    // isset id assignments
8572
    private static final int __CARTID_ISSET_ID = 0;
8573
    private BitSet __isset_bit_vector = new BitSet(1);
8574
 
8575
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
8576
    static {
8577
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8578
      tmpMap.put(_Fields.CART_ID, new org.apache.thrift.meta_data.FieldMetaData("cartId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8579
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8580
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8581
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getEmiDiscount_args.class, metaDataMap);
8582
    }
8583
 
8584
    public getEmiDiscount_args() {
8585
    }
8586
 
8587
    public getEmiDiscount_args(
8588
      long cartId)
8589
    {
8590
      this();
8591
      this.cartId = cartId;
8592
      setCartIdIsSet(true);
8593
    }
8594
 
8595
    /**
8596
     * Performs a deep copy on <i>other</i>.
8597
     */
8598
    public getEmiDiscount_args(getEmiDiscount_args other) {
8599
      __isset_bit_vector.clear();
8600
      __isset_bit_vector.or(other.__isset_bit_vector);
8601
      this.cartId = other.cartId;
8602
    }
8603
 
8604
    public getEmiDiscount_args deepCopy() {
8605
      return new getEmiDiscount_args(this);
8606
    }
8607
 
8608
    @Override
8609
    public void clear() {
8610
      setCartIdIsSet(false);
8611
      this.cartId = 0;
8612
    }
8613
 
8614
    public long getCartId() {
8615
      return this.cartId;
8616
    }
8617
 
8618
    public void setCartId(long cartId) {
8619
      this.cartId = cartId;
8620
      setCartIdIsSet(true);
8621
    }
8622
 
8623
    public void unsetCartId() {
8624
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
8625
    }
8626
 
8627
    /** Returns true if field cartId is set (has been assigned a value) and false otherwise */
8628
    public boolean isSetCartId() {
8629
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
8630
    }
8631
 
8632
    public void setCartIdIsSet(boolean value) {
8633
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
8634
    }
8635
 
8636
    public void setFieldValue(_Fields field, Object value) {
8637
      switch (field) {
8638
      case CART_ID:
8639
        if (value == null) {
8640
          unsetCartId();
8641
        } else {
8642
          setCartId((Long)value);
8643
        }
8644
        break;
8645
 
8646
      }
8647
    }
8648
 
8649
    public Object getFieldValue(_Fields field) {
8650
      switch (field) {
8651
      case CART_ID:
8652
        return Long.valueOf(getCartId());
8653
 
8654
      }
8655
      throw new IllegalStateException();
8656
    }
8657
 
8658
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8659
    public boolean isSet(_Fields field) {
8660
      if (field == null) {
8661
        throw new IllegalArgumentException();
8662
      }
8663
 
8664
      switch (field) {
8665
      case CART_ID:
8666
        return isSetCartId();
8667
      }
8668
      throw new IllegalStateException();
8669
    }
8670
 
8671
    @Override
8672
    public boolean equals(Object that) {
8673
      if (that == null)
8674
        return false;
8675
      if (that instanceof getEmiDiscount_args)
8676
        return this.equals((getEmiDiscount_args)that);
8677
      return false;
8678
    }
8679
 
8680
    public boolean equals(getEmiDiscount_args that) {
8681
      if (that == null)
8682
        return false;
8683
 
8684
      boolean this_present_cartId = true;
8685
      boolean that_present_cartId = true;
8686
      if (this_present_cartId || that_present_cartId) {
8687
        if (!(this_present_cartId && that_present_cartId))
8688
          return false;
8689
        if (this.cartId != that.cartId)
8690
          return false;
8691
      }
8692
 
8693
      return true;
8694
    }
8695
 
8696
    @Override
8697
    public int hashCode() {
8698
      return 0;
8699
    }
8700
 
8701
    public int compareTo(getEmiDiscount_args other) {
8702
      if (!getClass().equals(other.getClass())) {
8703
        return getClass().getName().compareTo(other.getClass().getName());
8704
      }
8705
 
8706
      int lastComparison = 0;
8707
      getEmiDiscount_args typedOther = (getEmiDiscount_args)other;
8708
 
8709
      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(typedOther.isSetCartId());
8710
      if (lastComparison != 0) {
8711
        return lastComparison;
8712
      }
8713
      if (isSetCartId()) {
8714
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cartId, typedOther.cartId);
8715
        if (lastComparison != 0) {
8716
          return lastComparison;
8717
        }
8718
      }
8719
      return 0;
8720
    }
8721
 
8722
    public _Fields fieldForId(int fieldId) {
8723
      return _Fields.findByThriftId(fieldId);
8724
    }
8725
 
8726
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8727
      org.apache.thrift.protocol.TField field;
8728
      iprot.readStructBegin();
8729
      while (true)
8730
      {
8731
        field = iprot.readFieldBegin();
8732
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
8733
          break;
8734
        }
8735
        switch (field.id) {
8736
          case 1: // CART_ID
8737
            if (field.type == org.apache.thrift.protocol.TType.I64) {
8738
              this.cartId = iprot.readI64();
8739
              setCartIdIsSet(true);
8740
            } else { 
8741
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8742
            }
8743
            break;
8744
          default:
8745
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8746
        }
8747
        iprot.readFieldEnd();
8748
      }
8749
      iprot.readStructEnd();
8750
      validate();
8751
    }
8752
 
8753
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
8754
      validate();
8755
 
8756
      oprot.writeStructBegin(STRUCT_DESC);
8757
      oprot.writeFieldBegin(CART_ID_FIELD_DESC);
8758
      oprot.writeI64(this.cartId);
8759
      oprot.writeFieldEnd();
8760
      oprot.writeFieldStop();
8761
      oprot.writeStructEnd();
8762
    }
8763
 
8764
    @Override
8765
    public String toString() {
8766
      StringBuilder sb = new StringBuilder("getEmiDiscount_args(");
8767
      boolean first = true;
8768
 
8769
      sb.append("cartId:");
8770
      sb.append(this.cartId);
8771
      first = false;
8772
      sb.append(")");
8773
      return sb.toString();
8774
    }
8775
 
8776
    public void validate() throws org.apache.thrift.TException {
8777
      // check for required fields
8778
    }
8779
 
8780
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8781
      try {
8782
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8783
      } catch (org.apache.thrift.TException te) {
8784
        throw new java.io.IOException(te);
8785
      }
8786
    }
8787
 
8788
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8789
      try {
8790
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
8791
        __isset_bit_vector = new BitSet(1);
8792
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8793
      } catch (org.apache.thrift.TException te) {
8794
        throw new java.io.IOException(te);
8795
      }
8796
    }
8797
 
8798
  }
8799
 
8800
  public static class getEmiDiscount_result implements org.apache.thrift.TBase<getEmiDiscount_result, getEmiDiscount_result._Fields>, java.io.Serializable, Cloneable   {
8801
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getEmiDiscount_result");
8802
 
8803
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0);
8804
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
8805
 
8806
    private Map<Long,Double> success; // required
8807
    private PromotionException pex; // required
8808
 
8809
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8810
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
8811
      SUCCESS((short)0, "success"),
8812
      PEX((short)1, "pex");
8813
 
8814
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8815
 
8816
      static {
8817
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8818
          byName.put(field.getFieldName(), field);
8819
        }
8820
      }
8821
 
8822
      /**
8823
       * Find the _Fields constant that matches fieldId, or null if its not found.
8824
       */
8825
      public static _Fields findByThriftId(int fieldId) {
8826
        switch(fieldId) {
8827
          case 0: // SUCCESS
8828
            return SUCCESS;
8829
          case 1: // PEX
8830
            return PEX;
8831
          default:
8832
            return null;
8833
        }
8834
      }
8835
 
8836
      /**
8837
       * Find the _Fields constant that matches fieldId, throwing an exception
8838
       * if it is not found.
8839
       */
8840
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8841
        _Fields fields = findByThriftId(fieldId);
8842
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8843
        return fields;
8844
      }
8845
 
8846
      /**
8847
       * Find the _Fields constant that matches name, or null if its not found.
8848
       */
8849
      public static _Fields findByName(String name) {
8850
        return byName.get(name);
8851
      }
8852
 
8853
      private final short _thriftId;
8854
      private final String _fieldName;
8855
 
8856
      _Fields(short thriftId, String fieldName) {
8857
        _thriftId = thriftId;
8858
        _fieldName = fieldName;
8859
      }
8860
 
8861
      public short getThriftFieldId() {
8862
        return _thriftId;
8863
      }
8864
 
8865
      public String getFieldName() {
8866
        return _fieldName;
8867
      }
8868
    }
8869
 
8870
    // isset id assignments
8871
 
8872
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
8873
    static {
8874
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8875
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8876
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
8877
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), 
8878
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
8879
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8880
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
8881
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8882
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getEmiDiscount_result.class, metaDataMap);
8883
    }
8884
 
8885
    public getEmiDiscount_result() {
8886
    }
8887
 
8888
    public getEmiDiscount_result(
8889
      Map<Long,Double> success,
8890
      PromotionException pex)
8891
    {
8892
      this();
8893
      this.success = success;
8894
      this.pex = pex;
8895
    }
8896
 
8897
    /**
8898
     * Performs a deep copy on <i>other</i>.
8899
     */
8900
    public getEmiDiscount_result(getEmiDiscount_result other) {
8901
      if (other.isSetSuccess()) {
8902
        Map<Long,Double> __this__success = new HashMap<Long,Double>();
8903
        for (Map.Entry<Long, Double> other_element : other.success.entrySet()) {
8904
 
8905
          Long other_element_key = other_element.getKey();
8906
          Double other_element_value = other_element.getValue();
8907
 
8908
          Long __this__success_copy_key = other_element_key;
8909
 
8910
          Double __this__success_copy_value = other_element_value;
8911
 
8912
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
8913
        }
8914
        this.success = __this__success;
8915
      }
8916
      if (other.isSetPex()) {
8917
        this.pex = new PromotionException(other.pex);
8918
      }
8919
    }
8920
 
8921
    public getEmiDiscount_result deepCopy() {
8922
      return new getEmiDiscount_result(this);
8923
    }
8924
 
8925
    @Override
8926
    public void clear() {
8927
      this.success = null;
8928
      this.pex = null;
8929
    }
8930
 
8931
    public int getSuccessSize() {
8932
      return (this.success == null) ? 0 : this.success.size();
8933
    }
8934
 
8935
    public void putToSuccess(long key, double val) {
8936
      if (this.success == null) {
8937
        this.success = new HashMap<Long,Double>();
8938
      }
8939
      this.success.put(key, val);
8940
    }
8941
 
8942
    public Map<Long,Double> getSuccess() {
8943
      return this.success;
8944
    }
8945
 
8946
    public void setSuccess(Map<Long,Double> success) {
8947
      this.success = success;
8948
    }
8949
 
8950
    public void unsetSuccess() {
8951
      this.success = null;
8952
    }
8953
 
8954
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
8955
    public boolean isSetSuccess() {
8956
      return this.success != null;
8957
    }
8958
 
8959
    public void setSuccessIsSet(boolean value) {
8960
      if (!value) {
8961
        this.success = null;
8962
      }
8963
    }
8964
 
8965
    public PromotionException getPex() {
8966
      return this.pex;
8967
    }
8968
 
8969
    public void setPex(PromotionException pex) {
8970
      this.pex = pex;
8971
    }
8972
 
8973
    public void unsetPex() {
8974
      this.pex = null;
8975
    }
8976
 
8977
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
8978
    public boolean isSetPex() {
8979
      return this.pex != null;
8980
    }
8981
 
8982
    public void setPexIsSet(boolean value) {
8983
      if (!value) {
8984
        this.pex = null;
8985
      }
8986
    }
8987
 
8988
    public void setFieldValue(_Fields field, Object value) {
8989
      switch (field) {
8990
      case SUCCESS:
8991
        if (value == null) {
8992
          unsetSuccess();
8993
        } else {
8994
          setSuccess((Map<Long,Double>)value);
8995
        }
8996
        break;
8997
 
8998
      case PEX:
8999
        if (value == null) {
9000
          unsetPex();
9001
        } else {
9002
          setPex((PromotionException)value);
9003
        }
9004
        break;
9005
 
9006
      }
9007
    }
9008
 
9009
    public Object getFieldValue(_Fields field) {
9010
      switch (field) {
9011
      case SUCCESS:
9012
        return getSuccess();
9013
 
9014
      case PEX:
9015
        return getPex();
9016
 
9017
      }
9018
      throw new IllegalStateException();
9019
    }
9020
 
9021
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9022
    public boolean isSet(_Fields field) {
9023
      if (field == null) {
9024
        throw new IllegalArgumentException();
9025
      }
9026
 
9027
      switch (field) {
9028
      case SUCCESS:
9029
        return isSetSuccess();
9030
      case PEX:
9031
        return isSetPex();
9032
      }
9033
      throw new IllegalStateException();
9034
    }
9035
 
9036
    @Override
9037
    public boolean equals(Object that) {
9038
      if (that == null)
9039
        return false;
9040
      if (that instanceof getEmiDiscount_result)
9041
        return this.equals((getEmiDiscount_result)that);
9042
      return false;
9043
    }
9044
 
9045
    public boolean equals(getEmiDiscount_result that) {
9046
      if (that == null)
9047
        return false;
9048
 
9049
      boolean this_present_success = true && this.isSetSuccess();
9050
      boolean that_present_success = true && that.isSetSuccess();
9051
      if (this_present_success || that_present_success) {
9052
        if (!(this_present_success && that_present_success))
9053
          return false;
9054
        if (!this.success.equals(that.success))
9055
          return false;
9056
      }
9057
 
9058
      boolean this_present_pex = true && this.isSetPex();
9059
      boolean that_present_pex = true && that.isSetPex();
9060
      if (this_present_pex || that_present_pex) {
9061
        if (!(this_present_pex && that_present_pex))
9062
          return false;
9063
        if (!this.pex.equals(that.pex))
9064
          return false;
9065
      }
9066
 
9067
      return true;
9068
    }
9069
 
9070
    @Override
9071
    public int hashCode() {
9072
      return 0;
9073
    }
9074
 
9075
    public int compareTo(getEmiDiscount_result other) {
9076
      if (!getClass().equals(other.getClass())) {
9077
        return getClass().getName().compareTo(other.getClass().getName());
9078
      }
9079
 
9080
      int lastComparison = 0;
9081
      getEmiDiscount_result typedOther = (getEmiDiscount_result)other;
9082
 
9083
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
9084
      if (lastComparison != 0) {
9085
        return lastComparison;
9086
      }
9087
      if (isSetSuccess()) {
9088
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
9089
        if (lastComparison != 0) {
9090
          return lastComparison;
9091
        }
9092
      }
9093
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
9094
      if (lastComparison != 0) {
9095
        return lastComparison;
9096
      }
9097
      if (isSetPex()) {
9098
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
9099
        if (lastComparison != 0) {
9100
          return lastComparison;
9101
        }
9102
      }
9103
      return 0;
9104
    }
9105
 
9106
    public _Fields fieldForId(int fieldId) {
9107
      return _Fields.findByThriftId(fieldId);
9108
    }
9109
 
9110
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9111
      org.apache.thrift.protocol.TField field;
9112
      iprot.readStructBegin();
9113
      while (true)
9114
      {
9115
        field = iprot.readFieldBegin();
9116
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
9117
          break;
9118
        }
9119
        switch (field.id) {
9120
          case 0: // SUCCESS
9121
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
9122
              {
11592 amit.gupta 9123
                org.apache.thrift.protocol.TMap _map20 = iprot.readMapBegin();
9124
                this.success = new HashMap<Long,Double>(2*_map20.size);
9125
                for (int _i21 = 0; _i21 < _map20.size; ++_i21)
6736 amit.gupta 9126
                {
11592 amit.gupta 9127
                  long _key22; // required
9128
                  double _val23; // required
9129
                  _key22 = iprot.readI64();
9130
                  _val23 = iprot.readDouble();
9131
                  this.success.put(_key22, _val23);
6736 amit.gupta 9132
                }
9133
                iprot.readMapEnd();
9134
              }
9135
            } else { 
9136
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9137
            }
9138
            break;
9139
          case 1: // PEX
9140
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
9141
              this.pex = new PromotionException();
9142
              this.pex.read(iprot);
9143
            } else { 
9144
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9145
            }
9146
            break;
9147
          default:
9148
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9149
        }
9150
        iprot.readFieldEnd();
9151
      }
9152
      iprot.readStructEnd();
9153
      validate();
9154
    }
9155
 
9156
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
9157
      oprot.writeStructBegin(STRUCT_DESC);
9158
 
9159
      if (this.isSetSuccess()) {
9160
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
9161
        {
9162
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.DOUBLE, this.success.size()));
11592 amit.gupta 9163
          for (Map.Entry<Long, Double> _iter24 : this.success.entrySet())
6736 amit.gupta 9164
          {
11592 amit.gupta 9165
            oprot.writeI64(_iter24.getKey());
9166
            oprot.writeDouble(_iter24.getValue());
6736 amit.gupta 9167
          }
9168
          oprot.writeMapEnd();
9169
        }
9170
        oprot.writeFieldEnd();
9171
      } else if (this.isSetPex()) {
9172
        oprot.writeFieldBegin(PEX_FIELD_DESC);
9173
        this.pex.write(oprot);
9174
        oprot.writeFieldEnd();
9175
      }
9176
      oprot.writeFieldStop();
9177
      oprot.writeStructEnd();
9178
    }
9179
 
9180
    @Override
9181
    public String toString() {
9182
      StringBuilder sb = new StringBuilder("getEmiDiscount_result(");
9183
      boolean first = true;
9184
 
9185
      sb.append("success:");
9186
      if (this.success == null) {
9187
        sb.append("null");
9188
      } else {
9189
        sb.append(this.success);
9190
      }
9191
      first = false;
9192
      if (!first) sb.append(", ");
9193
      sb.append("pex:");
9194
      if (this.pex == null) {
9195
        sb.append("null");
9196
      } else {
9197
        sb.append(this.pex);
9198
      }
9199
      first = false;
9200
      sb.append(")");
9201
      return sb.toString();
9202
    }
9203
 
9204
    public void validate() throws org.apache.thrift.TException {
9205
      // check for required fields
9206
    }
9207
 
9208
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9209
      try {
9210
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9211
      } catch (org.apache.thrift.TException te) {
9212
        throw new java.io.IOException(te);
9213
      }
9214
    }
9215
 
9216
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9217
      try {
9218
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9219
      } catch (org.apache.thrift.TException te) {
9220
        throw new java.io.IOException(te);
9221
      }
9222
    }
9223
 
9224
  }
9225
 
6433 anupam.sin 9226
  public static class applyRechargeCoupon_args implements org.apache.thrift.TBase<applyRechargeCoupon_args, applyRechargeCoupon_args._Fields>, java.io.Serializable, Cloneable   {
9227
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyRechargeCoupon_args");
9228
 
9229
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)1);
9230
    private static final org.apache.thrift.protocol.TField TOTAL_AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("totalAmount", org.apache.thrift.protocol.TType.I64, (short)2);
9231
    private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.I64, (short)3);
9232
 
9233
    private String couponCode; // required
9234
    private long totalAmount; // required
9235
    private long userId; // required
9236
 
9237
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9238
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
9239
      COUPON_CODE((short)1, "couponCode"),
9240
      TOTAL_AMOUNT((short)2, "totalAmount"),
9241
      USER_ID((short)3, "userId");
9242
 
9243
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9244
 
9245
      static {
9246
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9247
          byName.put(field.getFieldName(), field);
9248
        }
9249
      }
9250
 
9251
      /**
9252
       * Find the _Fields constant that matches fieldId, or null if its not found.
9253
       */
9254
      public static _Fields findByThriftId(int fieldId) {
9255
        switch(fieldId) {
9256
          case 1: // COUPON_CODE
9257
            return COUPON_CODE;
9258
          case 2: // TOTAL_AMOUNT
9259
            return TOTAL_AMOUNT;
9260
          case 3: // USER_ID
9261
            return USER_ID;
9262
          default:
9263
            return null;
9264
        }
9265
      }
9266
 
9267
      /**
9268
       * Find the _Fields constant that matches fieldId, throwing an exception
9269
       * if it is not found.
9270
       */
9271
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9272
        _Fields fields = findByThriftId(fieldId);
9273
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9274
        return fields;
9275
      }
9276
 
9277
      /**
9278
       * Find the _Fields constant that matches name, or null if its not found.
9279
       */
9280
      public static _Fields findByName(String name) {
9281
        return byName.get(name);
9282
      }
9283
 
9284
      private final short _thriftId;
9285
      private final String _fieldName;
9286
 
9287
      _Fields(short thriftId, String fieldName) {
9288
        _thriftId = thriftId;
9289
        _fieldName = fieldName;
9290
      }
9291
 
9292
      public short getThriftFieldId() {
9293
        return _thriftId;
9294
      }
9295
 
9296
      public String getFieldName() {
9297
        return _fieldName;
9298
      }
9299
    }
9300
 
9301
    // isset id assignments
9302
    private static final int __TOTALAMOUNT_ISSET_ID = 0;
9303
    private static final int __USERID_ISSET_ID = 1;
9304
    private BitSet __isset_bit_vector = new BitSet(2);
9305
 
9306
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
9307
    static {
9308
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9309
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9310
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
9311
      tmpMap.put(_Fields.TOTAL_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("totalAmount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9312
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9313
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9314
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9315
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9316
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyRechargeCoupon_args.class, metaDataMap);
9317
    }
9318
 
9319
    public applyRechargeCoupon_args() {
9320
    }
9321
 
9322
    public applyRechargeCoupon_args(
9323
      String couponCode,
9324
      long totalAmount,
9325
      long userId)
9326
    {
9327
      this();
9328
      this.couponCode = couponCode;
9329
      this.totalAmount = totalAmount;
9330
      setTotalAmountIsSet(true);
9331
      this.userId = userId;
9332
      setUserIdIsSet(true);
9333
    }
9334
 
9335
    /**
9336
     * Performs a deep copy on <i>other</i>.
9337
     */
9338
    public applyRechargeCoupon_args(applyRechargeCoupon_args other) {
9339
      __isset_bit_vector.clear();
9340
      __isset_bit_vector.or(other.__isset_bit_vector);
9341
      if (other.isSetCouponCode()) {
9342
        this.couponCode = other.couponCode;
9343
      }
9344
      this.totalAmount = other.totalAmount;
9345
      this.userId = other.userId;
9346
    }
9347
 
9348
    public applyRechargeCoupon_args deepCopy() {
9349
      return new applyRechargeCoupon_args(this);
9350
    }
9351
 
9352
    @Override
9353
    public void clear() {
9354
      this.couponCode = null;
9355
      setTotalAmountIsSet(false);
9356
      this.totalAmount = 0;
9357
      setUserIdIsSet(false);
9358
      this.userId = 0;
9359
    }
9360
 
9361
    public String getCouponCode() {
9362
      return this.couponCode;
9363
    }
9364
 
9365
    public void setCouponCode(String couponCode) {
9366
      this.couponCode = couponCode;
9367
    }
9368
 
9369
    public void unsetCouponCode() {
9370
      this.couponCode = null;
9371
    }
9372
 
9373
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
9374
    public boolean isSetCouponCode() {
9375
      return this.couponCode != null;
9376
    }
9377
 
9378
    public void setCouponCodeIsSet(boolean value) {
9379
      if (!value) {
9380
        this.couponCode = null;
9381
      }
9382
    }
9383
 
9384
    public long getTotalAmount() {
9385
      return this.totalAmount;
9386
    }
9387
 
9388
    public void setTotalAmount(long totalAmount) {
9389
      this.totalAmount = totalAmount;
9390
      setTotalAmountIsSet(true);
9391
    }
9392
 
9393
    public void unsetTotalAmount() {
9394
      __isset_bit_vector.clear(__TOTALAMOUNT_ISSET_ID);
9395
    }
9396
 
9397
    /** Returns true if field totalAmount is set (has been assigned a value) and false otherwise */
9398
    public boolean isSetTotalAmount() {
9399
      return __isset_bit_vector.get(__TOTALAMOUNT_ISSET_ID);
9400
    }
9401
 
9402
    public void setTotalAmountIsSet(boolean value) {
9403
      __isset_bit_vector.set(__TOTALAMOUNT_ISSET_ID, value);
9404
    }
9405
 
9406
    public long getUserId() {
9407
      return this.userId;
9408
    }
9409
 
9410
    public void setUserId(long userId) {
9411
      this.userId = userId;
9412
      setUserIdIsSet(true);
9413
    }
9414
 
9415
    public void unsetUserId() {
9416
      __isset_bit_vector.clear(__USERID_ISSET_ID);
9417
    }
9418
 
9419
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
9420
    public boolean isSetUserId() {
9421
      return __isset_bit_vector.get(__USERID_ISSET_ID);
9422
    }
9423
 
9424
    public void setUserIdIsSet(boolean value) {
9425
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
9426
    }
9427
 
9428
    public void setFieldValue(_Fields field, Object value) {
9429
      switch (field) {
9430
      case COUPON_CODE:
9431
        if (value == null) {
9432
          unsetCouponCode();
9433
        } else {
9434
          setCouponCode((String)value);
9435
        }
9436
        break;
9437
 
9438
      case TOTAL_AMOUNT:
9439
        if (value == null) {
9440
          unsetTotalAmount();
9441
        } else {
9442
          setTotalAmount((Long)value);
9443
        }
9444
        break;
9445
 
9446
      case USER_ID:
9447
        if (value == null) {
9448
          unsetUserId();
9449
        } else {
9450
          setUserId((Long)value);
9451
        }
9452
        break;
9453
 
9454
      }
9455
    }
9456
 
9457
    public Object getFieldValue(_Fields field) {
9458
      switch (field) {
9459
      case COUPON_CODE:
9460
        return getCouponCode();
9461
 
9462
      case TOTAL_AMOUNT:
9463
        return Long.valueOf(getTotalAmount());
9464
 
9465
      case USER_ID:
9466
        return Long.valueOf(getUserId());
9467
 
9468
      }
9469
      throw new IllegalStateException();
9470
    }
9471
 
9472
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9473
    public boolean isSet(_Fields field) {
9474
      if (field == null) {
9475
        throw new IllegalArgumentException();
9476
      }
9477
 
9478
      switch (field) {
9479
      case COUPON_CODE:
9480
        return isSetCouponCode();
9481
      case TOTAL_AMOUNT:
9482
        return isSetTotalAmount();
9483
      case USER_ID:
9484
        return isSetUserId();
9485
      }
9486
      throw new IllegalStateException();
9487
    }
9488
 
9489
    @Override
9490
    public boolean equals(Object that) {
9491
      if (that == null)
9492
        return false;
9493
      if (that instanceof applyRechargeCoupon_args)
9494
        return this.equals((applyRechargeCoupon_args)that);
9495
      return false;
9496
    }
9497
 
9498
    public boolean equals(applyRechargeCoupon_args that) {
9499
      if (that == null)
9500
        return false;
9501
 
9502
      boolean this_present_couponCode = true && this.isSetCouponCode();
9503
      boolean that_present_couponCode = true && that.isSetCouponCode();
9504
      if (this_present_couponCode || that_present_couponCode) {
9505
        if (!(this_present_couponCode && that_present_couponCode))
9506
          return false;
9507
        if (!this.couponCode.equals(that.couponCode))
9508
          return false;
9509
      }
9510
 
9511
      boolean this_present_totalAmount = true;
9512
      boolean that_present_totalAmount = true;
9513
      if (this_present_totalAmount || that_present_totalAmount) {
9514
        if (!(this_present_totalAmount && that_present_totalAmount))
9515
          return false;
9516
        if (this.totalAmount != that.totalAmount)
9517
          return false;
9518
      }
9519
 
9520
      boolean this_present_userId = true;
9521
      boolean that_present_userId = true;
9522
      if (this_present_userId || that_present_userId) {
9523
        if (!(this_present_userId && that_present_userId))
9524
          return false;
9525
        if (this.userId != that.userId)
9526
          return false;
9527
      }
9528
 
9529
      return true;
9530
    }
9531
 
9532
    @Override
9533
    public int hashCode() {
9534
      return 0;
9535
    }
9536
 
9537
    public int compareTo(applyRechargeCoupon_args other) {
9538
      if (!getClass().equals(other.getClass())) {
9539
        return getClass().getName().compareTo(other.getClass().getName());
9540
      }
9541
 
9542
      int lastComparison = 0;
9543
      applyRechargeCoupon_args typedOther = (applyRechargeCoupon_args)other;
9544
 
9545
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
9546
      if (lastComparison != 0) {
9547
        return lastComparison;
9548
      }
9549
      if (isSetCouponCode()) {
9550
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
9551
        if (lastComparison != 0) {
9552
          return lastComparison;
9553
        }
9554
      }
9555
      lastComparison = Boolean.valueOf(isSetTotalAmount()).compareTo(typedOther.isSetTotalAmount());
9556
      if (lastComparison != 0) {
9557
        return lastComparison;
9558
      }
9559
      if (isSetTotalAmount()) {
9560
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.totalAmount, typedOther.totalAmount);
9561
        if (lastComparison != 0) {
9562
          return lastComparison;
9563
        }
9564
      }
9565
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
9566
      if (lastComparison != 0) {
9567
        return lastComparison;
9568
      }
9569
      if (isSetUserId()) {
9570
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
9571
        if (lastComparison != 0) {
9572
          return lastComparison;
9573
        }
9574
      }
9575
      return 0;
9576
    }
9577
 
9578
    public _Fields fieldForId(int fieldId) {
9579
      return _Fields.findByThriftId(fieldId);
9580
    }
9581
 
9582
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9583
      org.apache.thrift.protocol.TField field;
9584
      iprot.readStructBegin();
9585
      while (true)
9586
      {
9587
        field = iprot.readFieldBegin();
9588
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
9589
          break;
9590
        }
9591
        switch (field.id) {
9592
          case 1: // COUPON_CODE
9593
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
9594
              this.couponCode = iprot.readString();
9595
            } else { 
9596
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9597
            }
9598
            break;
9599
          case 2: // TOTAL_AMOUNT
9600
            if (field.type == org.apache.thrift.protocol.TType.I64) {
9601
              this.totalAmount = iprot.readI64();
9602
              setTotalAmountIsSet(true);
9603
            } else { 
9604
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9605
            }
9606
            break;
9607
          case 3: // USER_ID
9608
            if (field.type == org.apache.thrift.protocol.TType.I64) {
9609
              this.userId = iprot.readI64();
9610
              setUserIdIsSet(true);
9611
            } else { 
9612
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9613
            }
9614
            break;
9615
          default:
9616
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9617
        }
9618
        iprot.readFieldEnd();
9619
      }
9620
      iprot.readStructEnd();
9621
      validate();
9622
    }
9623
 
9624
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
9625
      validate();
9626
 
9627
      oprot.writeStructBegin(STRUCT_DESC);
9628
      if (this.couponCode != null) {
9629
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
9630
        oprot.writeString(this.couponCode);
9631
        oprot.writeFieldEnd();
9632
      }
9633
      oprot.writeFieldBegin(TOTAL_AMOUNT_FIELD_DESC);
9634
      oprot.writeI64(this.totalAmount);
9635
      oprot.writeFieldEnd();
9636
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
9637
      oprot.writeI64(this.userId);
9638
      oprot.writeFieldEnd();
9639
      oprot.writeFieldStop();
9640
      oprot.writeStructEnd();
9641
    }
9642
 
9643
    @Override
9644
    public String toString() {
9645
      StringBuilder sb = new StringBuilder("applyRechargeCoupon_args(");
9646
      boolean first = true;
9647
 
9648
      sb.append("couponCode:");
9649
      if (this.couponCode == null) {
9650
        sb.append("null");
9651
      } else {
9652
        sb.append(this.couponCode);
9653
      }
9654
      first = false;
9655
      if (!first) sb.append(", ");
9656
      sb.append("totalAmount:");
9657
      sb.append(this.totalAmount);
9658
      first = false;
9659
      if (!first) sb.append(", ");
9660
      sb.append("userId:");
9661
      sb.append(this.userId);
9662
      first = false;
9663
      sb.append(")");
9664
      return sb.toString();
9665
    }
9666
 
9667
    public void validate() throws org.apache.thrift.TException {
9668
      // check for required fields
9669
    }
9670
 
9671
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9672
      try {
9673
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9674
      } catch (org.apache.thrift.TException te) {
9675
        throw new java.io.IOException(te);
9676
      }
9677
    }
9678
 
9679
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9680
      try {
9681
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
9682
        __isset_bit_vector = new BitSet(1);
9683
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9684
      } catch (org.apache.thrift.TException te) {
9685
        throw new java.io.IOException(te);
9686
      }
9687
    }
9688
 
9689
  }
9690
 
9691
  public static class applyRechargeCoupon_result implements org.apache.thrift.TBase<applyRechargeCoupon_result, applyRechargeCoupon_result._Fields>, java.io.Serializable, Cloneable   {
9692
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyRechargeCoupon_result");
9693
 
9694
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0);
9695
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
9696
 
9697
    private Map<Long,String> success; // required
9698
    private PromotionException pex; // required
9699
 
9700
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9701
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
9702
      SUCCESS((short)0, "success"),
9703
      PEX((short)1, "pex");
9704
 
9705
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9706
 
9707
      static {
9708
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9709
          byName.put(field.getFieldName(), field);
9710
        }
9711
      }
9712
 
9713
      /**
9714
       * Find the _Fields constant that matches fieldId, or null if its not found.
9715
       */
9716
      public static _Fields findByThriftId(int fieldId) {
9717
        switch(fieldId) {
9718
          case 0: // SUCCESS
9719
            return SUCCESS;
9720
          case 1: // PEX
9721
            return PEX;
9722
          default:
9723
            return null;
9724
        }
9725
      }
9726
 
9727
      /**
9728
       * Find the _Fields constant that matches fieldId, throwing an exception
9729
       * if it is not found.
9730
       */
9731
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9732
        _Fields fields = findByThriftId(fieldId);
9733
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9734
        return fields;
9735
      }
9736
 
9737
      /**
9738
       * Find the _Fields constant that matches name, or null if its not found.
9739
       */
9740
      public static _Fields findByName(String name) {
9741
        return byName.get(name);
9742
      }
9743
 
9744
      private final short _thriftId;
9745
      private final String _fieldName;
9746
 
9747
      _Fields(short thriftId, String fieldName) {
9748
        _thriftId = thriftId;
9749
        _fieldName = fieldName;
9750
      }
9751
 
9752
      public short getThriftFieldId() {
9753
        return _thriftId;
9754
      }
9755
 
9756
      public String getFieldName() {
9757
        return _fieldName;
9758
      }
9759
    }
9760
 
9761
    // isset id assignments
9762
 
9763
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
9764
    static {
9765
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9766
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9767
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
9768
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), 
9769
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
9770
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9771
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
9772
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9773
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyRechargeCoupon_result.class, metaDataMap);
9774
    }
9775
 
9776
    public applyRechargeCoupon_result() {
9777
    }
9778
 
9779
    public applyRechargeCoupon_result(
9780
      Map<Long,String> success,
9781
      PromotionException pex)
9782
    {
9783
      this();
9784
      this.success = success;
9785
      this.pex = pex;
9786
    }
9787
 
9788
    /**
9789
     * Performs a deep copy on <i>other</i>.
9790
     */
9791
    public applyRechargeCoupon_result(applyRechargeCoupon_result other) {
9792
      if (other.isSetSuccess()) {
9793
        Map<Long,String> __this__success = new HashMap<Long,String>();
9794
        for (Map.Entry<Long, String> other_element : other.success.entrySet()) {
9795
 
9796
          Long other_element_key = other_element.getKey();
9797
          String other_element_value = other_element.getValue();
9798
 
9799
          Long __this__success_copy_key = other_element_key;
9800
 
9801
          String __this__success_copy_value = other_element_value;
9802
 
9803
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
9804
        }
9805
        this.success = __this__success;
9806
      }
9807
      if (other.isSetPex()) {
9808
        this.pex = new PromotionException(other.pex);
9809
      }
9810
    }
9811
 
9812
    public applyRechargeCoupon_result deepCopy() {
9813
      return new applyRechargeCoupon_result(this);
9814
    }
9815
 
9816
    @Override
9817
    public void clear() {
9818
      this.success = null;
9819
      this.pex = null;
9820
    }
9821
 
9822
    public int getSuccessSize() {
9823
      return (this.success == null) ? 0 : this.success.size();
9824
    }
9825
 
9826
    public void putToSuccess(long key, String val) {
9827
      if (this.success == null) {
9828
        this.success = new HashMap<Long,String>();
9829
      }
9830
      this.success.put(key, val);
9831
    }
9832
 
9833
    public Map<Long,String> getSuccess() {
9834
      return this.success;
9835
    }
9836
 
9837
    public void setSuccess(Map<Long,String> success) {
9838
      this.success = success;
9839
    }
9840
 
9841
    public void unsetSuccess() {
9842
      this.success = null;
9843
    }
9844
 
9845
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
9846
    public boolean isSetSuccess() {
9847
      return this.success != null;
9848
    }
9849
 
9850
    public void setSuccessIsSet(boolean value) {
9851
      if (!value) {
9852
        this.success = null;
9853
      }
9854
    }
9855
 
9856
    public PromotionException getPex() {
9857
      return this.pex;
9858
    }
9859
 
9860
    public void setPex(PromotionException pex) {
9861
      this.pex = pex;
9862
    }
9863
 
9864
    public void unsetPex() {
9865
      this.pex = null;
9866
    }
9867
 
9868
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
9869
    public boolean isSetPex() {
9870
      return this.pex != null;
9871
    }
9872
 
9873
    public void setPexIsSet(boolean value) {
9874
      if (!value) {
9875
        this.pex = null;
9876
      }
9877
    }
9878
 
9879
    public void setFieldValue(_Fields field, Object value) {
9880
      switch (field) {
9881
      case SUCCESS:
9882
        if (value == null) {
9883
          unsetSuccess();
9884
        } else {
9885
          setSuccess((Map<Long,String>)value);
9886
        }
9887
        break;
9888
 
9889
      case PEX:
9890
        if (value == null) {
9891
          unsetPex();
9892
        } else {
9893
          setPex((PromotionException)value);
9894
        }
9895
        break;
9896
 
9897
      }
9898
    }
9899
 
9900
    public Object getFieldValue(_Fields field) {
9901
      switch (field) {
9902
      case SUCCESS:
9903
        return getSuccess();
9904
 
9905
      case PEX:
9906
        return getPex();
9907
 
9908
      }
9909
      throw new IllegalStateException();
9910
    }
9911
 
9912
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9913
    public boolean isSet(_Fields field) {
9914
      if (field == null) {
9915
        throw new IllegalArgumentException();
9916
      }
9917
 
9918
      switch (field) {
9919
      case SUCCESS:
9920
        return isSetSuccess();
9921
      case PEX:
9922
        return isSetPex();
9923
      }
9924
      throw new IllegalStateException();
9925
    }
9926
 
9927
    @Override
9928
    public boolean equals(Object that) {
9929
      if (that == null)
9930
        return false;
9931
      if (that instanceof applyRechargeCoupon_result)
9932
        return this.equals((applyRechargeCoupon_result)that);
9933
      return false;
9934
    }
9935
 
9936
    public boolean equals(applyRechargeCoupon_result that) {
9937
      if (that == null)
9938
        return false;
9939
 
9940
      boolean this_present_success = true && this.isSetSuccess();
9941
      boolean that_present_success = true && that.isSetSuccess();
9942
      if (this_present_success || that_present_success) {
9943
        if (!(this_present_success && that_present_success))
9944
          return false;
9945
        if (!this.success.equals(that.success))
9946
          return false;
9947
      }
9948
 
9949
      boolean this_present_pex = true && this.isSetPex();
9950
      boolean that_present_pex = true && that.isSetPex();
9951
      if (this_present_pex || that_present_pex) {
9952
        if (!(this_present_pex && that_present_pex))
9953
          return false;
9954
        if (!this.pex.equals(that.pex))
9955
          return false;
9956
      }
9957
 
9958
      return true;
9959
    }
9960
 
9961
    @Override
9962
    public int hashCode() {
9963
      return 0;
9964
    }
9965
 
9966
    public int compareTo(applyRechargeCoupon_result other) {
9967
      if (!getClass().equals(other.getClass())) {
9968
        return getClass().getName().compareTo(other.getClass().getName());
9969
      }
9970
 
9971
      int lastComparison = 0;
9972
      applyRechargeCoupon_result typedOther = (applyRechargeCoupon_result)other;
9973
 
9974
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
9975
      if (lastComparison != 0) {
9976
        return lastComparison;
9977
      }
9978
      if (isSetSuccess()) {
9979
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
9980
        if (lastComparison != 0) {
9981
          return lastComparison;
9982
        }
9983
      }
9984
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
9985
      if (lastComparison != 0) {
9986
        return lastComparison;
9987
      }
9988
      if (isSetPex()) {
9989
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
9990
        if (lastComparison != 0) {
9991
          return lastComparison;
9992
        }
9993
      }
9994
      return 0;
9995
    }
9996
 
9997
    public _Fields fieldForId(int fieldId) {
9998
      return _Fields.findByThriftId(fieldId);
9999
    }
10000
 
10001
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10002
      org.apache.thrift.protocol.TField field;
10003
      iprot.readStructBegin();
10004
      while (true)
10005
      {
10006
        field = iprot.readFieldBegin();
10007
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
10008
          break;
10009
        }
10010
        switch (field.id) {
10011
          case 0: // SUCCESS
10012
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
10013
              {
11592 amit.gupta 10014
                org.apache.thrift.protocol.TMap _map25 = iprot.readMapBegin();
10015
                this.success = new HashMap<Long,String>(2*_map25.size);
10016
                for (int _i26 = 0; _i26 < _map25.size; ++_i26)
6433 anupam.sin 10017
                {
11592 amit.gupta 10018
                  long _key27; // required
10019
                  String _val28; // required
10020
                  _key27 = iprot.readI64();
10021
                  _val28 = iprot.readString();
10022
                  this.success.put(_key27, _val28);
6433 anupam.sin 10023
                }
10024
                iprot.readMapEnd();
10025
              }
10026
            } else { 
10027
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10028
            }
10029
            break;
10030
          case 1: // PEX
10031
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
10032
              this.pex = new PromotionException();
10033
              this.pex.read(iprot);
10034
            } else { 
10035
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10036
            }
10037
            break;
10038
          default:
10039
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10040
        }
10041
        iprot.readFieldEnd();
10042
      }
10043
      iprot.readStructEnd();
10044
      validate();
10045
    }
10046
 
10047
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
10048
      oprot.writeStructBegin(STRUCT_DESC);
10049
 
10050
      if (this.isSetSuccess()) {
10051
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
10052
        {
10053
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.STRING, this.success.size()));
11592 amit.gupta 10054
          for (Map.Entry<Long, String> _iter29 : this.success.entrySet())
6433 anupam.sin 10055
          {
11592 amit.gupta 10056
            oprot.writeI64(_iter29.getKey());
10057
            oprot.writeString(_iter29.getValue());
6433 anupam.sin 10058
          }
10059
          oprot.writeMapEnd();
10060
        }
10061
        oprot.writeFieldEnd();
10062
      } else if (this.isSetPex()) {
10063
        oprot.writeFieldBegin(PEX_FIELD_DESC);
10064
        this.pex.write(oprot);
10065
        oprot.writeFieldEnd();
10066
      }
10067
      oprot.writeFieldStop();
10068
      oprot.writeStructEnd();
10069
    }
10070
 
10071
    @Override
10072
    public String toString() {
10073
      StringBuilder sb = new StringBuilder("applyRechargeCoupon_result(");
10074
      boolean first = true;
10075
 
10076
      sb.append("success:");
10077
      if (this.success == null) {
10078
        sb.append("null");
10079
      } else {
10080
        sb.append(this.success);
10081
      }
10082
      first = false;
10083
      if (!first) sb.append(", ");
10084
      sb.append("pex:");
10085
      if (this.pex == null) {
10086
        sb.append("null");
10087
      } else {
10088
        sb.append(this.pex);
10089
      }
10090
      first = false;
10091
      sb.append(")");
10092
      return sb.toString();
10093
    }
10094
 
10095
    public void validate() throws org.apache.thrift.TException {
10096
      // check for required fields
10097
    }
10098
 
10099
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10100
      try {
10101
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10102
      } catch (org.apache.thrift.TException te) {
10103
        throw new java.io.IOException(te);
10104
      }
10105
    }
10106
 
10107
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10108
      try {
10109
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10110
      } catch (org.apache.thrift.TException te) {
10111
        throw new java.io.IOException(te);
10112
      }
10113
    }
10114
 
10115
  }
10116
 
3430 rajveer 10117
  public static class trackCouponUsage_args implements org.apache.thrift.TBase<trackCouponUsage_args, trackCouponUsage_args._Fields>, java.io.Serializable, Cloneable   {
10118
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_args");
1982 varun.gupt 10119
 
3430 rajveer 10120
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)1);
10121
    private static final org.apache.thrift.protocol.TField TRANSACTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("transactionId", org.apache.thrift.protocol.TType.I64, (short)2);
10122
    private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.I64, (short)3);
13521 amit.gupta 10123
    private static final org.apache.thrift.protocol.TField AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("amount", org.apache.thrift.protocol.TType.I64, (short)4);
10124
    private static final org.apache.thrift.protocol.TField IS_DIGITAL_FIELD_DESC = new org.apache.thrift.protocol.TField("isDigital", org.apache.thrift.protocol.TType.BOOL, (short)5);
1982 varun.gupt 10125
 
3430 rajveer 10126
    private String couponCode; // required
10127
    private long transactionId; // required
10128
    private long userId; // required
13521 amit.gupta 10129
    private long amount; // required
10130
    private boolean isDigital; // required
1982 varun.gupt 10131
 
10132
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 10133
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 10134
      COUPON_CODE((short)1, "couponCode"),
10135
      TRANSACTION_ID((short)2, "transactionId"),
13521 amit.gupta 10136
      USER_ID((short)3, "userId"),
10137
      AMOUNT((short)4, "amount"),
10138
      IS_DIGITAL((short)5, "isDigital");
1982 varun.gupt 10139
 
10140
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10141
 
10142
      static {
10143
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10144
          byName.put(field.getFieldName(), field);
10145
        }
10146
      }
10147
 
10148
      /**
10149
       * Find the _Fields constant that matches fieldId, or null if its not found.
10150
       */
10151
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 10152
        switch(fieldId) {
10153
          case 1: // COUPON_CODE
10154
            return COUPON_CODE;
10155
          case 2: // TRANSACTION_ID
10156
            return TRANSACTION_ID;
10157
          case 3: // USER_ID
10158
            return USER_ID;
13521 amit.gupta 10159
          case 4: // AMOUNT
10160
            return AMOUNT;
10161
          case 5: // IS_DIGITAL
10162
            return IS_DIGITAL;
3430 rajveer 10163
          default:
10164
            return null;
10165
        }
1982 varun.gupt 10166
      }
10167
 
10168
      /**
10169
       * Find the _Fields constant that matches fieldId, throwing an exception
10170
       * if it is not found.
10171
       */
10172
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10173
        _Fields fields = findByThriftId(fieldId);
10174
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10175
        return fields;
10176
      }
10177
 
10178
      /**
10179
       * Find the _Fields constant that matches name, or null if its not found.
10180
       */
10181
      public static _Fields findByName(String name) {
10182
        return byName.get(name);
10183
      }
10184
 
10185
      private final short _thriftId;
10186
      private final String _fieldName;
10187
 
10188
      _Fields(short thriftId, String fieldName) {
10189
        _thriftId = thriftId;
10190
        _fieldName = fieldName;
10191
      }
10192
 
10193
      public short getThriftFieldId() {
10194
        return _thriftId;
10195
      }
10196
 
10197
      public String getFieldName() {
10198
        return _fieldName;
10199
      }
10200
    }
10201
 
10202
    // isset id assignments
10203
    private static final int __TRANSACTIONID_ISSET_ID = 0;
10204
    private static final int __USERID_ISSET_ID = 1;
13521 amit.gupta 10205
    private static final int __AMOUNT_ISSET_ID = 2;
10206
    private static final int __ISDIGITAL_ISSET_ID = 3;
10207
    private BitSet __isset_bit_vector = new BitSet(4);
1982 varun.gupt 10208
 
3430 rajveer 10209
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 10210
    static {
3430 rajveer 10211
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10212
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10213
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
10214
      tmpMap.put(_Fields.TRANSACTION_ID, new org.apache.thrift.meta_data.FieldMetaData("transactionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10215
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
10216
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10217
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
13521 amit.gupta 10218
      tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10219
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
10220
      tmpMap.put(_Fields.IS_DIGITAL, new org.apache.thrift.meta_data.FieldMetaData("isDigital", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10221
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
3430 rajveer 10222
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10223
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_args.class, metaDataMap);
1982 varun.gupt 10224
    }
10225
 
10226
    public trackCouponUsage_args() {
10227
    }
10228
 
10229
    public trackCouponUsage_args(
10230
      String couponCode,
10231
      long transactionId,
13521 amit.gupta 10232
      long userId,
10233
      long amount,
10234
      boolean isDigital)
1982 varun.gupt 10235
    {
10236
      this();
10237
      this.couponCode = couponCode;
10238
      this.transactionId = transactionId;
10239
      setTransactionIdIsSet(true);
10240
      this.userId = userId;
10241
      setUserIdIsSet(true);
13521 amit.gupta 10242
      this.amount = amount;
10243
      setAmountIsSet(true);
10244
      this.isDigital = isDigital;
10245
      setIsDigitalIsSet(true);
1982 varun.gupt 10246
    }
10247
 
10248
    /**
10249
     * Performs a deep copy on <i>other</i>.
10250
     */
10251
    public trackCouponUsage_args(trackCouponUsage_args other) {
10252
      __isset_bit_vector.clear();
10253
      __isset_bit_vector.or(other.__isset_bit_vector);
10254
      if (other.isSetCouponCode()) {
10255
        this.couponCode = other.couponCode;
10256
      }
10257
      this.transactionId = other.transactionId;
10258
      this.userId = other.userId;
13521 amit.gupta 10259
      this.amount = other.amount;
10260
      this.isDigital = other.isDigital;
1982 varun.gupt 10261
    }
10262
 
10263
    public trackCouponUsage_args deepCopy() {
10264
      return new trackCouponUsage_args(this);
10265
    }
10266
 
3430 rajveer 10267
    @Override
10268
    public void clear() {
10269
      this.couponCode = null;
10270
      setTransactionIdIsSet(false);
10271
      this.transactionId = 0;
10272
      setUserIdIsSet(false);
10273
      this.userId = 0;
13521 amit.gupta 10274
      setAmountIsSet(false);
10275
      this.amount = 0;
10276
      setIsDigitalIsSet(false);
10277
      this.isDigital = false;
1982 varun.gupt 10278
    }
10279
 
10280
    public String getCouponCode() {
10281
      return this.couponCode;
10282
    }
10283
 
3430 rajveer 10284
    public void setCouponCode(String couponCode) {
1982 varun.gupt 10285
      this.couponCode = couponCode;
10286
    }
10287
 
10288
    public void unsetCouponCode() {
10289
      this.couponCode = null;
10290
    }
10291
 
3430 rajveer 10292
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 10293
    public boolean isSetCouponCode() {
10294
      return this.couponCode != null;
10295
    }
10296
 
10297
    public void setCouponCodeIsSet(boolean value) {
10298
      if (!value) {
10299
        this.couponCode = null;
10300
      }
10301
    }
10302
 
10303
    public long getTransactionId() {
10304
      return this.transactionId;
10305
    }
10306
 
3430 rajveer 10307
    public void setTransactionId(long transactionId) {
1982 varun.gupt 10308
      this.transactionId = transactionId;
10309
      setTransactionIdIsSet(true);
10310
    }
10311
 
10312
    public void unsetTransactionId() {
10313
      __isset_bit_vector.clear(__TRANSACTIONID_ISSET_ID);
10314
    }
10315
 
3430 rajveer 10316
    /** Returns true if field transactionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 10317
    public boolean isSetTransactionId() {
10318
      return __isset_bit_vector.get(__TRANSACTIONID_ISSET_ID);
10319
    }
10320
 
10321
    public void setTransactionIdIsSet(boolean value) {
10322
      __isset_bit_vector.set(__TRANSACTIONID_ISSET_ID, value);
10323
    }
10324
 
10325
    public long getUserId() {
10326
      return this.userId;
10327
    }
10328
 
3430 rajveer 10329
    public void setUserId(long userId) {
1982 varun.gupt 10330
      this.userId = userId;
10331
      setUserIdIsSet(true);
10332
    }
10333
 
10334
    public void unsetUserId() {
10335
      __isset_bit_vector.clear(__USERID_ISSET_ID);
10336
    }
10337
 
3430 rajveer 10338
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 10339
    public boolean isSetUserId() {
10340
      return __isset_bit_vector.get(__USERID_ISSET_ID);
10341
    }
10342
 
10343
    public void setUserIdIsSet(boolean value) {
10344
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
10345
    }
10346
 
13521 amit.gupta 10347
    public long getAmount() {
10348
      return this.amount;
10349
    }
10350
 
10351
    public void setAmount(long amount) {
10352
      this.amount = amount;
10353
      setAmountIsSet(true);
10354
    }
10355
 
10356
    public void unsetAmount() {
10357
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
10358
    }
10359
 
10360
    /** Returns true if field amount is set (has been assigned a value) and false otherwise */
10361
    public boolean isSetAmount() {
10362
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
10363
    }
10364
 
10365
    public void setAmountIsSet(boolean value) {
10366
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
10367
    }
10368
 
10369
    public boolean isIsDigital() {
10370
      return this.isDigital;
10371
    }
10372
 
10373
    public void setIsDigital(boolean isDigital) {
10374
      this.isDigital = isDigital;
10375
      setIsDigitalIsSet(true);
10376
    }
10377
 
10378
    public void unsetIsDigital() {
10379
      __isset_bit_vector.clear(__ISDIGITAL_ISSET_ID);
10380
    }
10381
 
10382
    /** Returns true if field isDigital is set (has been assigned a value) and false otherwise */
10383
    public boolean isSetIsDigital() {
10384
      return __isset_bit_vector.get(__ISDIGITAL_ISSET_ID);
10385
    }
10386
 
10387
    public void setIsDigitalIsSet(boolean value) {
10388
      __isset_bit_vector.set(__ISDIGITAL_ISSET_ID, value);
10389
    }
10390
 
1982 varun.gupt 10391
    public void setFieldValue(_Fields field, Object value) {
10392
      switch (field) {
10393
      case COUPON_CODE:
10394
        if (value == null) {
10395
          unsetCouponCode();
10396
        } else {
10397
          setCouponCode((String)value);
10398
        }
10399
        break;
10400
 
10401
      case TRANSACTION_ID:
10402
        if (value == null) {
10403
          unsetTransactionId();
10404
        } else {
10405
          setTransactionId((Long)value);
10406
        }
10407
        break;
10408
 
10409
      case USER_ID:
10410
        if (value == null) {
10411
          unsetUserId();
10412
        } else {
10413
          setUserId((Long)value);
10414
        }
10415
        break;
10416
 
13521 amit.gupta 10417
      case AMOUNT:
10418
        if (value == null) {
10419
          unsetAmount();
10420
        } else {
10421
          setAmount((Long)value);
10422
        }
10423
        break;
10424
 
10425
      case IS_DIGITAL:
10426
        if (value == null) {
10427
          unsetIsDigital();
10428
        } else {
10429
          setIsDigital((Boolean)value);
10430
        }
10431
        break;
10432
 
1982 varun.gupt 10433
      }
10434
    }
10435
 
10436
    public Object getFieldValue(_Fields field) {
10437
      switch (field) {
10438
      case COUPON_CODE:
10439
        return getCouponCode();
10440
 
10441
      case TRANSACTION_ID:
3430 rajveer 10442
        return Long.valueOf(getTransactionId());
1982 varun.gupt 10443
 
10444
      case USER_ID:
3430 rajveer 10445
        return Long.valueOf(getUserId());
1982 varun.gupt 10446
 
13521 amit.gupta 10447
      case AMOUNT:
10448
        return Long.valueOf(getAmount());
10449
 
10450
      case IS_DIGITAL:
10451
        return Boolean.valueOf(isIsDigital());
10452
 
1982 varun.gupt 10453
      }
10454
      throw new IllegalStateException();
10455
    }
10456
 
3430 rajveer 10457
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10458
    public boolean isSet(_Fields field) {
10459
      if (field == null) {
10460
        throw new IllegalArgumentException();
10461
      }
1982 varun.gupt 10462
 
10463
      switch (field) {
10464
      case COUPON_CODE:
10465
        return isSetCouponCode();
10466
      case TRANSACTION_ID:
10467
        return isSetTransactionId();
10468
      case USER_ID:
10469
        return isSetUserId();
13521 amit.gupta 10470
      case AMOUNT:
10471
        return isSetAmount();
10472
      case IS_DIGITAL:
10473
        return isSetIsDigital();
1982 varun.gupt 10474
      }
10475
      throw new IllegalStateException();
10476
    }
10477
 
10478
    @Override
10479
    public boolean equals(Object that) {
10480
      if (that == null)
10481
        return false;
10482
      if (that instanceof trackCouponUsage_args)
10483
        return this.equals((trackCouponUsage_args)that);
10484
      return false;
10485
    }
10486
 
10487
    public boolean equals(trackCouponUsage_args that) {
10488
      if (that == null)
10489
        return false;
10490
 
10491
      boolean this_present_couponCode = true && this.isSetCouponCode();
10492
      boolean that_present_couponCode = true && that.isSetCouponCode();
10493
      if (this_present_couponCode || that_present_couponCode) {
10494
        if (!(this_present_couponCode && that_present_couponCode))
10495
          return false;
10496
        if (!this.couponCode.equals(that.couponCode))
10497
          return false;
10498
      }
10499
 
10500
      boolean this_present_transactionId = true;
10501
      boolean that_present_transactionId = true;
10502
      if (this_present_transactionId || that_present_transactionId) {
10503
        if (!(this_present_transactionId && that_present_transactionId))
10504
          return false;
10505
        if (this.transactionId != that.transactionId)
10506
          return false;
10507
      }
10508
 
10509
      boolean this_present_userId = true;
10510
      boolean that_present_userId = true;
10511
      if (this_present_userId || that_present_userId) {
10512
        if (!(this_present_userId && that_present_userId))
10513
          return false;
10514
        if (this.userId != that.userId)
10515
          return false;
10516
      }
10517
 
13521 amit.gupta 10518
      boolean this_present_amount = true;
10519
      boolean that_present_amount = true;
10520
      if (this_present_amount || that_present_amount) {
10521
        if (!(this_present_amount && that_present_amount))
10522
          return false;
10523
        if (this.amount != that.amount)
10524
          return false;
10525
      }
10526
 
10527
      boolean this_present_isDigital = true;
10528
      boolean that_present_isDigital = true;
10529
      if (this_present_isDigital || that_present_isDigital) {
10530
        if (!(this_present_isDigital && that_present_isDigital))
10531
          return false;
10532
        if (this.isDigital != that.isDigital)
10533
          return false;
10534
      }
10535
 
1982 varun.gupt 10536
      return true;
10537
    }
10538
 
10539
    @Override
10540
    public int hashCode() {
10541
      return 0;
10542
    }
10543
 
10544
    public int compareTo(trackCouponUsage_args other) {
10545
      if (!getClass().equals(other.getClass())) {
10546
        return getClass().getName().compareTo(other.getClass().getName());
10547
      }
10548
 
10549
      int lastComparison = 0;
10550
      trackCouponUsage_args typedOther = (trackCouponUsage_args)other;
10551
 
3430 rajveer 10552
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 10553
      if (lastComparison != 0) {
10554
        return lastComparison;
10555
      }
3430 rajveer 10556
      if (isSetCouponCode()) {
10557
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
10558
        if (lastComparison != 0) {
10559
          return lastComparison;
10560
        }
1982 varun.gupt 10561
      }
3430 rajveer 10562
      lastComparison = Boolean.valueOf(isSetTransactionId()).compareTo(typedOther.isSetTransactionId());
1982 varun.gupt 10563
      if (lastComparison != 0) {
10564
        return lastComparison;
10565
      }
3430 rajveer 10566
      if (isSetTransactionId()) {
10567
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transactionId, typedOther.transactionId);
10568
        if (lastComparison != 0) {
10569
          return lastComparison;
10570
        }
1982 varun.gupt 10571
      }
3430 rajveer 10572
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 10573
      if (lastComparison != 0) {
10574
        return lastComparison;
10575
      }
3430 rajveer 10576
      if (isSetUserId()) {
10577
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
10578
        if (lastComparison != 0) {
10579
          return lastComparison;
10580
        }
1982 varun.gupt 10581
      }
13521 amit.gupta 10582
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
10583
      if (lastComparison != 0) {
10584
        return lastComparison;
10585
      }
10586
      if (isSetAmount()) {
10587
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
10588
        if (lastComparison != 0) {
10589
          return lastComparison;
10590
        }
10591
      }
10592
      lastComparison = Boolean.valueOf(isSetIsDigital()).compareTo(typedOther.isSetIsDigital());
10593
      if (lastComparison != 0) {
10594
        return lastComparison;
10595
      }
10596
      if (isSetIsDigital()) {
10597
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isDigital, typedOther.isDigital);
10598
        if (lastComparison != 0) {
10599
          return lastComparison;
10600
        }
10601
      }
1982 varun.gupt 10602
      return 0;
10603
    }
10604
 
3430 rajveer 10605
    public _Fields fieldForId(int fieldId) {
10606
      return _Fields.findByThriftId(fieldId);
10607
    }
10608
 
10609
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10610
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 10611
      iprot.readStructBegin();
10612
      while (true)
10613
      {
10614
        field = iprot.readFieldBegin();
3430 rajveer 10615
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 10616
          break;
10617
        }
3430 rajveer 10618
        switch (field.id) {
10619
          case 1: // COUPON_CODE
10620
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
10621
              this.couponCode = iprot.readString();
10622
            } else { 
10623
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10624
            }
10625
            break;
10626
          case 2: // TRANSACTION_ID
10627
            if (field.type == org.apache.thrift.protocol.TType.I64) {
10628
              this.transactionId = iprot.readI64();
10629
              setTransactionIdIsSet(true);
10630
            } else { 
10631
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10632
            }
10633
            break;
10634
          case 3: // USER_ID
10635
            if (field.type == org.apache.thrift.protocol.TType.I64) {
10636
              this.userId = iprot.readI64();
10637
              setUserIdIsSet(true);
10638
            } else { 
10639
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10640
            }
10641
            break;
13521 amit.gupta 10642
          case 4: // AMOUNT
10643
            if (field.type == org.apache.thrift.protocol.TType.I64) {
10644
              this.amount = iprot.readI64();
10645
              setAmountIsSet(true);
10646
            } else { 
10647
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10648
            }
10649
            break;
10650
          case 5: // IS_DIGITAL
10651
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
10652
              this.isDigital = iprot.readBool();
10653
              setIsDigitalIsSet(true);
10654
            } else { 
10655
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10656
            }
10657
            break;
3430 rajveer 10658
          default:
10659
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 10660
        }
3430 rajveer 10661
        iprot.readFieldEnd();
1982 varun.gupt 10662
      }
10663
      iprot.readStructEnd();
10664
      validate();
10665
    }
10666
 
3430 rajveer 10667
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 10668
      validate();
10669
 
10670
      oprot.writeStructBegin(STRUCT_DESC);
10671
      if (this.couponCode != null) {
10672
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
10673
        oprot.writeString(this.couponCode);
10674
        oprot.writeFieldEnd();
10675
      }
10676
      oprot.writeFieldBegin(TRANSACTION_ID_FIELD_DESC);
10677
      oprot.writeI64(this.transactionId);
10678
      oprot.writeFieldEnd();
10679
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
10680
      oprot.writeI64(this.userId);
10681
      oprot.writeFieldEnd();
13521 amit.gupta 10682
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
10683
      oprot.writeI64(this.amount);
10684
      oprot.writeFieldEnd();
10685
      oprot.writeFieldBegin(IS_DIGITAL_FIELD_DESC);
10686
      oprot.writeBool(this.isDigital);
10687
      oprot.writeFieldEnd();
1982 varun.gupt 10688
      oprot.writeFieldStop();
10689
      oprot.writeStructEnd();
10690
    }
10691
 
10692
    @Override
10693
    public String toString() {
10694
      StringBuilder sb = new StringBuilder("trackCouponUsage_args(");
10695
      boolean first = true;
10696
 
10697
      sb.append("couponCode:");
10698
      if (this.couponCode == null) {
10699
        sb.append("null");
10700
      } else {
10701
        sb.append(this.couponCode);
10702
      }
10703
      first = false;
10704
      if (!first) sb.append(", ");
10705
      sb.append("transactionId:");
10706
      sb.append(this.transactionId);
10707
      first = false;
10708
      if (!first) sb.append(", ");
10709
      sb.append("userId:");
10710
      sb.append(this.userId);
10711
      first = false;
13521 amit.gupta 10712
      if (!first) sb.append(", ");
10713
      sb.append("amount:");
10714
      sb.append(this.amount);
10715
      first = false;
10716
      if (!first) sb.append(", ");
10717
      sb.append("isDigital:");
10718
      sb.append(this.isDigital);
10719
      first = false;
1982 varun.gupt 10720
      sb.append(")");
10721
      return sb.toString();
10722
    }
10723
 
3430 rajveer 10724
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 10725
      // check for required fields
10726
    }
10727
 
3430 rajveer 10728
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10729
      try {
10730
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10731
      } catch (org.apache.thrift.TException te) {
10732
        throw new java.io.IOException(te);
10733
      }
10734
    }
10735
 
10736
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10737
      try {
10738
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
10739
        __isset_bit_vector = new BitSet(1);
10740
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10741
      } catch (org.apache.thrift.TException te) {
10742
        throw new java.io.IOException(te);
10743
      }
10744
    }
10745
 
1982 varun.gupt 10746
  }
10747
 
3430 rajveer 10748
  public static class trackCouponUsage_result implements org.apache.thrift.TBase<trackCouponUsage_result, trackCouponUsage_result._Fields>, java.io.Serializable, Cloneable   {
10749
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_result");
1982 varun.gupt 10750
 
3430 rajveer 10751
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
1982 varun.gupt 10752
 
3430 rajveer 10753
    private PromotionException pex; // required
1982 varun.gupt 10754
 
10755
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 10756
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 10757
      PEX((short)1, "pex");
10758
 
10759
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10760
 
10761
      static {
10762
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10763
          byName.put(field.getFieldName(), field);
10764
        }
10765
      }
10766
 
10767
      /**
10768
       * Find the _Fields constant that matches fieldId, or null if its not found.
10769
       */
10770
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 10771
        switch(fieldId) {
10772
          case 1: // PEX
10773
            return PEX;
10774
          default:
10775
            return null;
10776
        }
1982 varun.gupt 10777
      }
10778
 
10779
      /**
10780
       * Find the _Fields constant that matches fieldId, throwing an exception
10781
       * if it is not found.
10782
       */
10783
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10784
        _Fields fields = findByThriftId(fieldId);
10785
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10786
        return fields;
10787
      }
10788
 
10789
      /**
10790
       * Find the _Fields constant that matches name, or null if its not found.
10791
       */
10792
      public static _Fields findByName(String name) {
10793
        return byName.get(name);
10794
      }
10795
 
10796
      private final short _thriftId;
10797
      private final String _fieldName;
10798
 
10799
      _Fields(short thriftId, String fieldName) {
10800
        _thriftId = thriftId;
10801
        _fieldName = fieldName;
10802
      }
10803
 
10804
      public short getThriftFieldId() {
10805
        return _thriftId;
10806
      }
10807
 
10808
      public String getFieldName() {
10809
        return _fieldName;
10810
      }
10811
    }
10812
 
10813
    // isset id assignments
10814
 
3430 rajveer 10815
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 10816
    static {
3430 rajveer 10817
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10818
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10819
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
10820
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10821
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_result.class, metaDataMap);
1982 varun.gupt 10822
    }
10823
 
10824
    public trackCouponUsage_result() {
10825
    }
10826
 
10827
    public trackCouponUsage_result(
10828
      PromotionException pex)
10829
    {
10830
      this();
10831
      this.pex = pex;
10832
    }
10833
 
10834
    /**
10835
     * Performs a deep copy on <i>other</i>.
10836
     */
10837
    public trackCouponUsage_result(trackCouponUsage_result other) {
10838
      if (other.isSetPex()) {
10839
        this.pex = new PromotionException(other.pex);
10840
      }
10841
    }
10842
 
10843
    public trackCouponUsage_result deepCopy() {
10844
      return new trackCouponUsage_result(this);
10845
    }
10846
 
3430 rajveer 10847
    @Override
10848
    public void clear() {
10849
      this.pex = null;
1982 varun.gupt 10850
    }
10851
 
10852
    public PromotionException getPex() {
10853
      return this.pex;
10854
    }
10855
 
3430 rajveer 10856
    public void setPex(PromotionException pex) {
1982 varun.gupt 10857
      this.pex = pex;
10858
    }
10859
 
10860
    public void unsetPex() {
10861
      this.pex = null;
10862
    }
10863
 
3430 rajveer 10864
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 10865
    public boolean isSetPex() {
10866
      return this.pex != null;
10867
    }
10868
 
10869
    public void setPexIsSet(boolean value) {
10870
      if (!value) {
10871
        this.pex = null;
10872
      }
10873
    }
10874
 
10875
    public void setFieldValue(_Fields field, Object value) {
10876
      switch (field) {
10877
      case PEX:
10878
        if (value == null) {
10879
          unsetPex();
10880
        } else {
10881
          setPex((PromotionException)value);
10882
        }
10883
        break;
10884
 
10885
      }
10886
    }
10887
 
10888
    public Object getFieldValue(_Fields field) {
10889
      switch (field) {
10890
      case PEX:
10891
        return getPex();
10892
 
10893
      }
10894
      throw new IllegalStateException();
10895
    }
10896
 
3430 rajveer 10897
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10898
    public boolean isSet(_Fields field) {
10899
      if (field == null) {
10900
        throw new IllegalArgumentException();
10901
      }
1982 varun.gupt 10902
 
10903
      switch (field) {
10904
      case PEX:
10905
        return isSetPex();
10906
      }
10907
      throw new IllegalStateException();
10908
    }
10909
 
10910
    @Override
10911
    public boolean equals(Object that) {
10912
      if (that == null)
10913
        return false;
10914
      if (that instanceof trackCouponUsage_result)
10915
        return this.equals((trackCouponUsage_result)that);
10916
      return false;
10917
    }
10918
 
10919
    public boolean equals(trackCouponUsage_result that) {
10920
      if (that == null)
10921
        return false;
10922
 
10923
      boolean this_present_pex = true && this.isSetPex();
10924
      boolean that_present_pex = true && that.isSetPex();
10925
      if (this_present_pex || that_present_pex) {
10926
        if (!(this_present_pex && that_present_pex))
10927
          return false;
10928
        if (!this.pex.equals(that.pex))
10929
          return false;
10930
      }
10931
 
10932
      return true;
10933
    }
10934
 
10935
    @Override
10936
    public int hashCode() {
10937
      return 0;
10938
    }
10939
 
10940
    public int compareTo(trackCouponUsage_result other) {
10941
      if (!getClass().equals(other.getClass())) {
10942
        return getClass().getName().compareTo(other.getClass().getName());
10943
      }
10944
 
10945
      int lastComparison = 0;
10946
      trackCouponUsage_result typedOther = (trackCouponUsage_result)other;
10947
 
3430 rajveer 10948
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 10949
      if (lastComparison != 0) {
10950
        return lastComparison;
10951
      }
3430 rajveer 10952
      if (isSetPex()) {
10953
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
10954
        if (lastComparison != 0) {
10955
          return lastComparison;
10956
        }
1982 varun.gupt 10957
      }
10958
      return 0;
10959
    }
10960
 
3430 rajveer 10961
    public _Fields fieldForId(int fieldId) {
10962
      return _Fields.findByThriftId(fieldId);
10963
    }
10964
 
10965
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10966
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 10967
      iprot.readStructBegin();
10968
      while (true)
10969
      {
10970
        field = iprot.readFieldBegin();
3430 rajveer 10971
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 10972
          break;
10973
        }
3430 rajveer 10974
        switch (field.id) {
10975
          case 1: // PEX
10976
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
10977
              this.pex = new PromotionException();
10978
              this.pex.read(iprot);
10979
            } else { 
10980
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10981
            }
10982
            break;
10983
          default:
10984
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 10985
        }
3430 rajveer 10986
        iprot.readFieldEnd();
1982 varun.gupt 10987
      }
10988
      iprot.readStructEnd();
10989
      validate();
10990
    }
10991
 
3430 rajveer 10992
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 10993
      oprot.writeStructBegin(STRUCT_DESC);
10994
 
10995
      if (this.isSetPex()) {
10996
        oprot.writeFieldBegin(PEX_FIELD_DESC);
10997
        this.pex.write(oprot);
10998
        oprot.writeFieldEnd();
10999
      }
11000
      oprot.writeFieldStop();
11001
      oprot.writeStructEnd();
11002
    }
11003
 
11004
    @Override
11005
    public String toString() {
11006
      StringBuilder sb = new StringBuilder("trackCouponUsage_result(");
11007
      boolean first = true;
11008
 
11009
      sb.append("pex:");
11010
      if (this.pex == null) {
11011
        sb.append("null");
11012
      } else {
11013
        sb.append(this.pex);
11014
      }
11015
      first = false;
11016
      sb.append(")");
11017
      return sb.toString();
11018
    }
11019
 
3430 rajveer 11020
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 11021
      // check for required fields
11022
    }
11023
 
3430 rajveer 11024
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11025
      try {
11026
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11027
      } catch (org.apache.thrift.TException te) {
11028
        throw new java.io.IOException(te);
11029
      }
11030
    }
11031
 
11032
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11033
      try {
11034
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11035
      } catch (org.apache.thrift.TException te) {
11036
        throw new java.io.IOException(te);
11037
      }
11038
    }
11039
 
1982 varun.gupt 11040
  }
11041
 
3430 rajveer 11042
  public static class getCouponUsageCountByUser_args implements org.apache.thrift.TBase<getCouponUsageCountByUser_args, getCouponUsageCountByUser_args._Fields>, java.io.Serializable, Cloneable   {
11043
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_args");
1982 varun.gupt 11044
 
3430 rajveer 11045
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)1);
11046
    private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.I64, (short)2);
1982 varun.gupt 11047
 
3430 rajveer 11048
    private String couponCode; // required
11049
    private long userId; // required
1982 varun.gupt 11050
 
11051
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 11052
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 11053
      COUPON_CODE((short)1, "couponCode"),
11054
      USER_ID((short)2, "userId");
11055
 
11056
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11057
 
11058
      static {
11059
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11060
          byName.put(field.getFieldName(), field);
11061
        }
11062
      }
11063
 
11064
      /**
11065
       * Find the _Fields constant that matches fieldId, or null if its not found.
11066
       */
11067
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 11068
        switch(fieldId) {
11069
          case 1: // COUPON_CODE
11070
            return COUPON_CODE;
11071
          case 2: // USER_ID
11072
            return USER_ID;
11073
          default:
11074
            return null;
11075
        }
1982 varun.gupt 11076
      }
11077
 
11078
      /**
11079
       * Find the _Fields constant that matches fieldId, throwing an exception
11080
       * if it is not found.
11081
       */
11082
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11083
        _Fields fields = findByThriftId(fieldId);
11084
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11085
        return fields;
11086
      }
11087
 
11088
      /**
11089
       * Find the _Fields constant that matches name, or null if its not found.
11090
       */
11091
      public static _Fields findByName(String name) {
11092
        return byName.get(name);
11093
      }
11094
 
11095
      private final short _thriftId;
11096
      private final String _fieldName;
11097
 
11098
      _Fields(short thriftId, String fieldName) {
11099
        _thriftId = thriftId;
11100
        _fieldName = fieldName;
11101
      }
11102
 
11103
      public short getThriftFieldId() {
11104
        return _thriftId;
11105
      }
11106
 
11107
      public String getFieldName() {
11108
        return _fieldName;
11109
      }
11110
    }
11111
 
11112
    // isset id assignments
11113
    private static final int __USERID_ISSET_ID = 0;
11114
    private BitSet __isset_bit_vector = new BitSet(1);
11115
 
3430 rajveer 11116
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 11117
    static {
3430 rajveer 11118
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11119
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11120
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
11121
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11122
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
11123
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11124
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_args.class, metaDataMap);
1982 varun.gupt 11125
    }
11126
 
11127
    public getCouponUsageCountByUser_args() {
11128
    }
11129
 
11130
    public getCouponUsageCountByUser_args(
11131
      String couponCode,
11132
      long userId)
11133
    {
11134
      this();
11135
      this.couponCode = couponCode;
11136
      this.userId = userId;
11137
      setUserIdIsSet(true);
11138
    }
11139
 
11140
    /**
11141
     * Performs a deep copy on <i>other</i>.
11142
     */
11143
    public getCouponUsageCountByUser_args(getCouponUsageCountByUser_args other) {
11144
      __isset_bit_vector.clear();
11145
      __isset_bit_vector.or(other.__isset_bit_vector);
11146
      if (other.isSetCouponCode()) {
11147
        this.couponCode = other.couponCode;
11148
      }
11149
      this.userId = other.userId;
11150
    }
11151
 
11152
    public getCouponUsageCountByUser_args deepCopy() {
11153
      return new getCouponUsageCountByUser_args(this);
11154
    }
11155
 
3430 rajveer 11156
    @Override
11157
    public void clear() {
11158
      this.couponCode = null;
11159
      setUserIdIsSet(false);
11160
      this.userId = 0;
1982 varun.gupt 11161
    }
11162
 
11163
    public String getCouponCode() {
11164
      return this.couponCode;
11165
    }
11166
 
3430 rajveer 11167
    public void setCouponCode(String couponCode) {
1982 varun.gupt 11168
      this.couponCode = couponCode;
11169
    }
11170
 
11171
    public void unsetCouponCode() {
11172
      this.couponCode = null;
11173
    }
11174
 
3430 rajveer 11175
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 11176
    public boolean isSetCouponCode() {
11177
      return this.couponCode != null;
11178
    }
11179
 
11180
    public void setCouponCodeIsSet(boolean value) {
11181
      if (!value) {
11182
        this.couponCode = null;
11183
      }
11184
    }
11185
 
11186
    public long getUserId() {
11187
      return this.userId;
11188
    }
11189
 
3430 rajveer 11190
    public void setUserId(long userId) {
1982 varun.gupt 11191
      this.userId = userId;
11192
      setUserIdIsSet(true);
11193
    }
11194
 
11195
    public void unsetUserId() {
11196
      __isset_bit_vector.clear(__USERID_ISSET_ID);
11197
    }
11198
 
3430 rajveer 11199
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 11200
    public boolean isSetUserId() {
11201
      return __isset_bit_vector.get(__USERID_ISSET_ID);
11202
    }
11203
 
11204
    public void setUserIdIsSet(boolean value) {
11205
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
11206
    }
11207
 
11208
    public void setFieldValue(_Fields field, Object value) {
11209
      switch (field) {
11210
      case COUPON_CODE:
11211
        if (value == null) {
11212
          unsetCouponCode();
11213
        } else {
11214
          setCouponCode((String)value);
11215
        }
11216
        break;
11217
 
11218
      case USER_ID:
11219
        if (value == null) {
11220
          unsetUserId();
11221
        } else {
11222
          setUserId((Long)value);
11223
        }
11224
        break;
11225
 
11226
      }
11227
    }
11228
 
11229
    public Object getFieldValue(_Fields field) {
11230
      switch (field) {
11231
      case COUPON_CODE:
11232
        return getCouponCode();
11233
 
11234
      case USER_ID:
3430 rajveer 11235
        return Long.valueOf(getUserId());
1982 varun.gupt 11236
 
11237
      }
11238
      throw new IllegalStateException();
11239
    }
11240
 
3430 rajveer 11241
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11242
    public boolean isSet(_Fields field) {
11243
      if (field == null) {
11244
        throw new IllegalArgumentException();
11245
      }
1982 varun.gupt 11246
 
11247
      switch (field) {
11248
      case COUPON_CODE:
11249
        return isSetCouponCode();
11250
      case USER_ID:
11251
        return isSetUserId();
11252
      }
11253
      throw new IllegalStateException();
11254
    }
11255
 
11256
    @Override
11257
    public boolean equals(Object that) {
11258
      if (that == null)
11259
        return false;
11260
      if (that instanceof getCouponUsageCountByUser_args)
11261
        return this.equals((getCouponUsageCountByUser_args)that);
11262
      return false;
11263
    }
11264
 
11265
    public boolean equals(getCouponUsageCountByUser_args that) {
11266
      if (that == null)
11267
        return false;
11268
 
11269
      boolean this_present_couponCode = true && this.isSetCouponCode();
11270
      boolean that_present_couponCode = true && that.isSetCouponCode();
11271
      if (this_present_couponCode || that_present_couponCode) {
11272
        if (!(this_present_couponCode && that_present_couponCode))
11273
          return false;
11274
        if (!this.couponCode.equals(that.couponCode))
11275
          return false;
11276
      }
11277
 
11278
      boolean this_present_userId = true;
11279
      boolean that_present_userId = true;
11280
      if (this_present_userId || that_present_userId) {
11281
        if (!(this_present_userId && that_present_userId))
11282
          return false;
11283
        if (this.userId != that.userId)
11284
          return false;
11285
      }
11286
 
11287
      return true;
11288
    }
11289
 
11290
    @Override
11291
    public int hashCode() {
11292
      return 0;
11293
    }
11294
 
11295
    public int compareTo(getCouponUsageCountByUser_args other) {
11296
      if (!getClass().equals(other.getClass())) {
11297
        return getClass().getName().compareTo(other.getClass().getName());
11298
      }
11299
 
11300
      int lastComparison = 0;
11301
      getCouponUsageCountByUser_args typedOther = (getCouponUsageCountByUser_args)other;
11302
 
3430 rajveer 11303
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 11304
      if (lastComparison != 0) {
11305
        return lastComparison;
11306
      }
3430 rajveer 11307
      if (isSetCouponCode()) {
11308
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
11309
        if (lastComparison != 0) {
11310
          return lastComparison;
11311
        }
1982 varun.gupt 11312
      }
3430 rajveer 11313
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 11314
      if (lastComparison != 0) {
11315
        return lastComparison;
11316
      }
3430 rajveer 11317
      if (isSetUserId()) {
11318
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
11319
        if (lastComparison != 0) {
11320
          return lastComparison;
11321
        }
1982 varun.gupt 11322
      }
11323
      return 0;
11324
    }
11325
 
3430 rajveer 11326
    public _Fields fieldForId(int fieldId) {
11327
      return _Fields.findByThriftId(fieldId);
11328
    }
11329
 
11330
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11331
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 11332
      iprot.readStructBegin();
11333
      while (true)
11334
      {
11335
        field = iprot.readFieldBegin();
3430 rajveer 11336
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 11337
          break;
11338
        }
3430 rajveer 11339
        switch (field.id) {
11340
          case 1: // COUPON_CODE
11341
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
11342
              this.couponCode = iprot.readString();
11343
            } else { 
11344
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11345
            }
11346
            break;
11347
          case 2: // USER_ID
11348
            if (field.type == org.apache.thrift.protocol.TType.I64) {
11349
              this.userId = iprot.readI64();
11350
              setUserIdIsSet(true);
11351
            } else { 
11352
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11353
            }
11354
            break;
11355
          default:
11356
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 11357
        }
3430 rajveer 11358
        iprot.readFieldEnd();
1982 varun.gupt 11359
      }
11360
      iprot.readStructEnd();
11361
      validate();
11362
    }
11363
 
3430 rajveer 11364
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 11365
      validate();
11366
 
11367
      oprot.writeStructBegin(STRUCT_DESC);
11368
      if (this.couponCode != null) {
11369
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
11370
        oprot.writeString(this.couponCode);
11371
        oprot.writeFieldEnd();
11372
      }
11373
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
11374
      oprot.writeI64(this.userId);
11375
      oprot.writeFieldEnd();
11376
      oprot.writeFieldStop();
11377
      oprot.writeStructEnd();
11378
    }
11379
 
11380
    @Override
11381
    public String toString() {
11382
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_args(");
11383
      boolean first = true;
11384
 
11385
      sb.append("couponCode:");
11386
      if (this.couponCode == null) {
11387
        sb.append("null");
11388
      } else {
11389
        sb.append(this.couponCode);
11390
      }
11391
      first = false;
11392
      if (!first) sb.append(", ");
11393
      sb.append("userId:");
11394
      sb.append(this.userId);
11395
      first = false;
11396
      sb.append(")");
11397
      return sb.toString();
11398
    }
11399
 
3430 rajveer 11400
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 11401
      // check for required fields
11402
    }
11403
 
3430 rajveer 11404
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11405
      try {
11406
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11407
      } catch (org.apache.thrift.TException te) {
11408
        throw new java.io.IOException(te);
11409
      }
11410
    }
11411
 
11412
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11413
      try {
11414
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
11415
        __isset_bit_vector = new BitSet(1);
11416
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11417
      } catch (org.apache.thrift.TException te) {
11418
        throw new java.io.IOException(te);
11419
      }
11420
    }
11421
 
1982 varun.gupt 11422
  }
11423
 
3430 rajveer 11424
  public static class getCouponUsageCountByUser_result implements org.apache.thrift.TBase<getCouponUsageCountByUser_result, getCouponUsageCountByUser_result._Fields>, java.io.Serializable, Cloneable   {
11425
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_result");
1982 varun.gupt 11426
 
3430 rajveer 11427
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0);
11428
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
1982 varun.gupt 11429
 
3430 rajveer 11430
    private long success; // required
11431
    private PromotionException pex; // required
1982 varun.gupt 11432
 
11433
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 11434
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 11435
      SUCCESS((short)0, "success"),
11436
      PEX((short)1, "pex");
11437
 
11438
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11439
 
11440
      static {
11441
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11442
          byName.put(field.getFieldName(), field);
11443
        }
11444
      }
11445
 
11446
      /**
11447
       * Find the _Fields constant that matches fieldId, or null if its not found.
11448
       */
11449
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 11450
        switch(fieldId) {
11451
          case 0: // SUCCESS
11452
            return SUCCESS;
11453
          case 1: // PEX
11454
            return PEX;
11455
          default:
11456
            return null;
11457
        }
1982 varun.gupt 11458
      }
11459
 
11460
      /**
11461
       * Find the _Fields constant that matches fieldId, throwing an exception
11462
       * if it is not found.
11463
       */
11464
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11465
        _Fields fields = findByThriftId(fieldId);
11466
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11467
        return fields;
11468
      }
11469
 
11470
      /**
11471
       * Find the _Fields constant that matches name, or null if its not found.
11472
       */
11473
      public static _Fields findByName(String name) {
11474
        return byName.get(name);
11475
      }
11476
 
11477
      private final short _thriftId;
11478
      private final String _fieldName;
11479
 
11480
      _Fields(short thriftId, String fieldName) {
11481
        _thriftId = thriftId;
11482
        _fieldName = fieldName;
11483
      }
11484
 
11485
      public short getThriftFieldId() {
11486
        return _thriftId;
11487
      }
11488
 
11489
      public String getFieldName() {
11490
        return _fieldName;
11491
      }
11492
    }
11493
 
11494
    // isset id assignments
11495
    private static final int __SUCCESS_ISSET_ID = 0;
11496
    private BitSet __isset_bit_vector = new BitSet(1);
11497
 
3430 rajveer 11498
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 11499
    static {
3430 rajveer 11500
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11501
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11502
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
11503
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11504
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
11505
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11506
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_result.class, metaDataMap);
1982 varun.gupt 11507
    }
11508
 
11509
    public getCouponUsageCountByUser_result() {
11510
    }
11511
 
11512
    public getCouponUsageCountByUser_result(
11513
      long success,
11514
      PromotionException pex)
11515
    {
11516
      this();
11517
      this.success = success;
11518
      setSuccessIsSet(true);
11519
      this.pex = pex;
11520
    }
11521
 
11522
    /**
11523
     * Performs a deep copy on <i>other</i>.
11524
     */
11525
    public getCouponUsageCountByUser_result(getCouponUsageCountByUser_result other) {
11526
      __isset_bit_vector.clear();
11527
      __isset_bit_vector.or(other.__isset_bit_vector);
11528
      this.success = other.success;
11529
      if (other.isSetPex()) {
11530
        this.pex = new PromotionException(other.pex);
11531
      }
11532
    }
11533
 
11534
    public getCouponUsageCountByUser_result deepCopy() {
11535
      return new getCouponUsageCountByUser_result(this);
11536
    }
11537
 
3430 rajveer 11538
    @Override
11539
    public void clear() {
11540
      setSuccessIsSet(false);
11541
      this.success = 0;
11542
      this.pex = null;
1982 varun.gupt 11543
    }
11544
 
11545
    public long getSuccess() {
11546
      return this.success;
11547
    }
11548
 
3430 rajveer 11549
    public void setSuccess(long success) {
1982 varun.gupt 11550
      this.success = success;
11551
      setSuccessIsSet(true);
11552
    }
11553
 
11554
    public void unsetSuccess() {
11555
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
11556
    }
11557
 
3430 rajveer 11558
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 11559
    public boolean isSetSuccess() {
11560
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
11561
    }
11562
 
11563
    public void setSuccessIsSet(boolean value) {
11564
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
11565
    }
11566
 
11567
    public PromotionException getPex() {
11568
      return this.pex;
11569
    }
11570
 
3430 rajveer 11571
    public void setPex(PromotionException pex) {
1982 varun.gupt 11572
      this.pex = pex;
11573
    }
11574
 
11575
    public void unsetPex() {
11576
      this.pex = null;
11577
    }
11578
 
3430 rajveer 11579
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 11580
    public boolean isSetPex() {
11581
      return this.pex != null;
11582
    }
11583
 
11584
    public void setPexIsSet(boolean value) {
11585
      if (!value) {
11586
        this.pex = null;
11587
      }
11588
    }
11589
 
11590
    public void setFieldValue(_Fields field, Object value) {
11591
      switch (field) {
11592
      case SUCCESS:
11593
        if (value == null) {
11594
          unsetSuccess();
11595
        } else {
11596
          setSuccess((Long)value);
11597
        }
11598
        break;
11599
 
11600
      case PEX:
11601
        if (value == null) {
11602
          unsetPex();
11603
        } else {
11604
          setPex((PromotionException)value);
11605
        }
11606
        break;
11607
 
11608
      }
11609
    }
11610
 
11611
    public Object getFieldValue(_Fields field) {
11612
      switch (field) {
11613
      case SUCCESS:
3430 rajveer 11614
        return Long.valueOf(getSuccess());
1982 varun.gupt 11615
 
11616
      case PEX:
11617
        return getPex();
11618
 
11619
      }
11620
      throw new IllegalStateException();
11621
    }
11622
 
3430 rajveer 11623
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11624
    public boolean isSet(_Fields field) {
11625
      if (field == null) {
11626
        throw new IllegalArgumentException();
11627
      }
1982 varun.gupt 11628
 
11629
      switch (field) {
11630
      case SUCCESS:
11631
        return isSetSuccess();
11632
      case PEX:
11633
        return isSetPex();
11634
      }
11635
      throw new IllegalStateException();
11636
    }
11637
 
11638
    @Override
11639
    public boolean equals(Object that) {
11640
      if (that == null)
11641
        return false;
11642
      if (that instanceof getCouponUsageCountByUser_result)
11643
        return this.equals((getCouponUsageCountByUser_result)that);
11644
      return false;
11645
    }
11646
 
11647
    public boolean equals(getCouponUsageCountByUser_result that) {
11648
      if (that == null)
11649
        return false;
11650
 
11651
      boolean this_present_success = true;
11652
      boolean that_present_success = true;
11653
      if (this_present_success || that_present_success) {
11654
        if (!(this_present_success && that_present_success))
11655
          return false;
11656
        if (this.success != that.success)
11657
          return false;
11658
      }
11659
 
11660
      boolean this_present_pex = true && this.isSetPex();
11661
      boolean that_present_pex = true && that.isSetPex();
11662
      if (this_present_pex || that_present_pex) {
11663
        if (!(this_present_pex && that_present_pex))
11664
          return false;
11665
        if (!this.pex.equals(that.pex))
11666
          return false;
11667
      }
11668
 
11669
      return true;
11670
    }
11671
 
11672
    @Override
11673
    public int hashCode() {
11674
      return 0;
11675
    }
11676
 
11677
    public int compareTo(getCouponUsageCountByUser_result other) {
11678
      if (!getClass().equals(other.getClass())) {
11679
        return getClass().getName().compareTo(other.getClass().getName());
11680
      }
11681
 
11682
      int lastComparison = 0;
11683
      getCouponUsageCountByUser_result typedOther = (getCouponUsageCountByUser_result)other;
11684
 
3430 rajveer 11685
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 11686
      if (lastComparison != 0) {
11687
        return lastComparison;
11688
      }
3430 rajveer 11689
      if (isSetSuccess()) {
11690
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
11691
        if (lastComparison != 0) {
11692
          return lastComparison;
11693
        }
1982 varun.gupt 11694
      }
3430 rajveer 11695
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 11696
      if (lastComparison != 0) {
11697
        return lastComparison;
11698
      }
3430 rajveer 11699
      if (isSetPex()) {
11700
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
11701
        if (lastComparison != 0) {
11702
          return lastComparison;
11703
        }
1982 varun.gupt 11704
      }
11705
      return 0;
11706
    }
11707
 
3430 rajveer 11708
    public _Fields fieldForId(int fieldId) {
11709
      return _Fields.findByThriftId(fieldId);
11710
    }
11711
 
11712
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11713
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 11714
      iprot.readStructBegin();
11715
      while (true)
11716
      {
11717
        field = iprot.readFieldBegin();
3430 rajveer 11718
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 11719
          break;
11720
        }
3430 rajveer 11721
        switch (field.id) {
11722
          case 0: // SUCCESS
11723
            if (field.type == org.apache.thrift.protocol.TType.I64) {
11724
              this.success = iprot.readI64();
11725
              setSuccessIsSet(true);
11726
            } else { 
11727
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11728
            }
11729
            break;
11730
          case 1: // PEX
11731
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
11732
              this.pex = new PromotionException();
11733
              this.pex.read(iprot);
11734
            } else { 
11735
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11736
            }
11737
            break;
11738
          default:
11739
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 11740
        }
3430 rajveer 11741
        iprot.readFieldEnd();
1982 varun.gupt 11742
      }
11743
      iprot.readStructEnd();
11744
      validate();
11745
    }
11746
 
3430 rajveer 11747
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 11748
      oprot.writeStructBegin(STRUCT_DESC);
11749
 
11750
      if (this.isSetSuccess()) {
11751
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
11752
        oprot.writeI64(this.success);
11753
        oprot.writeFieldEnd();
11754
      } else if (this.isSetPex()) {
11755
        oprot.writeFieldBegin(PEX_FIELD_DESC);
11756
        this.pex.write(oprot);
11757
        oprot.writeFieldEnd();
11758
      }
11759
      oprot.writeFieldStop();
11760
      oprot.writeStructEnd();
11761
    }
11762
 
11763
    @Override
11764
    public String toString() {
11765
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_result(");
11766
      boolean first = true;
11767
 
11768
      sb.append("success:");
11769
      sb.append(this.success);
11770
      first = false;
11771
      if (!first) sb.append(", ");
11772
      sb.append("pex:");
11773
      if (this.pex == null) {
11774
        sb.append("null");
11775
      } else {
11776
        sb.append(this.pex);
11777
      }
11778
      first = false;
11779
      sb.append(")");
11780
      return sb.toString();
11781
    }
11782
 
3430 rajveer 11783
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 11784
      // check for required fields
11785
    }
11786
 
3430 rajveer 11787
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11788
      try {
11789
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11790
      } catch (org.apache.thrift.TException te) {
11791
        throw new java.io.IOException(te);
11792
      }
11793
    }
11794
 
11795
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11796
      try {
11797
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11798
      } catch (org.apache.thrift.TException te) {
11799
        throw new java.io.IOException(te);
11800
      }
11801
    }
11802
 
1982 varun.gupt 11803
  }
11804
 
6497 amit.gupta 11805
  public static class getActiveCodes_args implements org.apache.thrift.TBase<getActiveCodes_args, getActiveCodes_args._Fields>, java.io.Serializable, Cloneable   {
11806
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCodes_args");
11807
 
11808
    private static final org.apache.thrift.protocol.TField PROMOTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("promotionId", org.apache.thrift.protocol.TType.I64, (short)1);
11809
 
11810
    private long promotionId; // required
11811
 
11812
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11813
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11814
      PROMOTION_ID((short)1, "promotionId");
11815
 
11816
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11817
 
11818
      static {
11819
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11820
          byName.put(field.getFieldName(), field);
11821
        }
11822
      }
11823
 
11824
      /**
11825
       * Find the _Fields constant that matches fieldId, or null if its not found.
11826
       */
11827
      public static _Fields findByThriftId(int fieldId) {
11828
        switch(fieldId) {
11829
          case 1: // PROMOTION_ID
11830
            return PROMOTION_ID;
11831
          default:
11832
            return null;
11833
        }
11834
      }
11835
 
11836
      /**
11837
       * Find the _Fields constant that matches fieldId, throwing an exception
11838
       * if it is not found.
11839
       */
11840
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11841
        _Fields fields = findByThriftId(fieldId);
11842
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11843
        return fields;
11844
      }
11845
 
11846
      /**
11847
       * Find the _Fields constant that matches name, or null if its not found.
11848
       */
11849
      public static _Fields findByName(String name) {
11850
        return byName.get(name);
11851
      }
11852
 
11853
      private final short _thriftId;
11854
      private final String _fieldName;
11855
 
11856
      _Fields(short thriftId, String fieldName) {
11857
        _thriftId = thriftId;
11858
        _fieldName = fieldName;
11859
      }
11860
 
11861
      public short getThriftFieldId() {
11862
        return _thriftId;
11863
      }
11864
 
11865
      public String getFieldName() {
11866
        return _fieldName;
11867
      }
11868
    }
11869
 
11870
    // isset id assignments
11871
    private static final int __PROMOTIONID_ISSET_ID = 0;
11872
    private BitSet __isset_bit_vector = new BitSet(1);
11873
 
11874
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
11875
    static {
11876
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11877
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11878
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
11879
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11880
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCodes_args.class, metaDataMap);
11881
    }
11882
 
11883
    public getActiveCodes_args() {
11884
    }
11885
 
11886
    public getActiveCodes_args(
11887
      long promotionId)
11888
    {
11889
      this();
11890
      this.promotionId = promotionId;
11891
      setPromotionIdIsSet(true);
11892
    }
11893
 
11894
    /**
11895
     * Performs a deep copy on <i>other</i>.
11896
     */
11897
    public getActiveCodes_args(getActiveCodes_args other) {
11898
      __isset_bit_vector.clear();
11899
      __isset_bit_vector.or(other.__isset_bit_vector);
11900
      this.promotionId = other.promotionId;
11901
    }
11902
 
11903
    public getActiveCodes_args deepCopy() {
11904
      return new getActiveCodes_args(this);
11905
    }
11906
 
11907
    @Override
11908
    public void clear() {
11909
      setPromotionIdIsSet(false);
11910
      this.promotionId = 0;
11911
    }
11912
 
11913
    public long getPromotionId() {
11914
      return this.promotionId;
11915
    }
11916
 
11917
    public void setPromotionId(long promotionId) {
11918
      this.promotionId = promotionId;
11919
      setPromotionIdIsSet(true);
11920
    }
11921
 
11922
    public void unsetPromotionId() {
11923
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
11924
    }
11925
 
11926
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
11927
    public boolean isSetPromotionId() {
11928
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
11929
    }
11930
 
11931
    public void setPromotionIdIsSet(boolean value) {
11932
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
11933
    }
11934
 
11935
    public void setFieldValue(_Fields field, Object value) {
11936
      switch (field) {
11937
      case PROMOTION_ID:
11938
        if (value == null) {
11939
          unsetPromotionId();
11940
        } else {
11941
          setPromotionId((Long)value);
11942
        }
11943
        break;
11944
 
11945
      }
11946
    }
11947
 
11948
    public Object getFieldValue(_Fields field) {
11949
      switch (field) {
11950
      case PROMOTION_ID:
11951
        return Long.valueOf(getPromotionId());
11952
 
11953
      }
11954
      throw new IllegalStateException();
11955
    }
11956
 
11957
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11958
    public boolean isSet(_Fields field) {
11959
      if (field == null) {
11960
        throw new IllegalArgumentException();
11961
      }
11962
 
11963
      switch (field) {
11964
      case PROMOTION_ID:
11965
        return isSetPromotionId();
11966
      }
11967
      throw new IllegalStateException();
11968
    }
11969
 
11970
    @Override
11971
    public boolean equals(Object that) {
11972
      if (that == null)
11973
        return false;
11974
      if (that instanceof getActiveCodes_args)
11975
        return this.equals((getActiveCodes_args)that);
11976
      return false;
11977
    }
11978
 
11979
    public boolean equals(getActiveCodes_args that) {
11980
      if (that == null)
11981
        return false;
11982
 
11983
      boolean this_present_promotionId = true;
11984
      boolean that_present_promotionId = true;
11985
      if (this_present_promotionId || that_present_promotionId) {
11986
        if (!(this_present_promotionId && that_present_promotionId))
11987
          return false;
11988
        if (this.promotionId != that.promotionId)
11989
          return false;
11990
      }
11991
 
11992
      return true;
11993
    }
11994
 
11995
    @Override
11996
    public int hashCode() {
11997
      return 0;
11998
    }
11999
 
12000
    public int compareTo(getActiveCodes_args other) {
12001
      if (!getClass().equals(other.getClass())) {
12002
        return getClass().getName().compareTo(other.getClass().getName());
12003
      }
12004
 
12005
      int lastComparison = 0;
12006
      getActiveCodes_args typedOther = (getActiveCodes_args)other;
12007
 
12008
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
12009
      if (lastComparison != 0) {
12010
        return lastComparison;
12011
      }
12012
      if (isSetPromotionId()) {
12013
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
12014
        if (lastComparison != 0) {
12015
          return lastComparison;
12016
        }
12017
      }
12018
      return 0;
12019
    }
12020
 
12021
    public _Fields fieldForId(int fieldId) {
12022
      return _Fields.findByThriftId(fieldId);
12023
    }
12024
 
12025
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12026
      org.apache.thrift.protocol.TField field;
12027
      iprot.readStructBegin();
12028
      while (true)
12029
      {
12030
        field = iprot.readFieldBegin();
12031
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12032
          break;
12033
        }
12034
        switch (field.id) {
12035
          case 1: // PROMOTION_ID
12036
            if (field.type == org.apache.thrift.protocol.TType.I64) {
12037
              this.promotionId = iprot.readI64();
12038
              setPromotionIdIsSet(true);
12039
            } else { 
12040
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12041
            }
12042
            break;
12043
          default:
12044
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12045
        }
12046
        iprot.readFieldEnd();
12047
      }
12048
      iprot.readStructEnd();
12049
      validate();
12050
    }
12051
 
12052
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12053
      validate();
12054
 
12055
      oprot.writeStructBegin(STRUCT_DESC);
12056
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
12057
      oprot.writeI64(this.promotionId);
12058
      oprot.writeFieldEnd();
12059
      oprot.writeFieldStop();
12060
      oprot.writeStructEnd();
12061
    }
12062
 
12063
    @Override
12064
    public String toString() {
12065
      StringBuilder sb = new StringBuilder("getActiveCodes_args(");
12066
      boolean first = true;
12067
 
12068
      sb.append("promotionId:");
12069
      sb.append(this.promotionId);
12070
      first = false;
12071
      sb.append(")");
12072
      return sb.toString();
12073
    }
12074
 
12075
    public void validate() throws org.apache.thrift.TException {
12076
      // check for required fields
12077
    }
12078
 
12079
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12080
      try {
12081
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12082
      } catch (org.apache.thrift.TException te) {
12083
        throw new java.io.IOException(te);
12084
      }
12085
    }
12086
 
12087
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12088
      try {
12089
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
12090
        __isset_bit_vector = new BitSet(1);
12091
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12092
      } catch (org.apache.thrift.TException te) {
12093
        throw new java.io.IOException(te);
12094
      }
12095
    }
12096
 
12097
  }
12098
 
12099
  public static class getActiveCodes_result implements org.apache.thrift.TBase<getActiveCodes_result, getActiveCodes_result._Fields>, java.io.Serializable, Cloneable   {
12100
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCodes_result");
12101
 
12102
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
12103
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
12104
 
12105
    private List<Coupon> success; // required
12106
    private PromotionException pex; // required
12107
 
12108
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12109
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12110
      SUCCESS((short)0, "success"),
12111
      PEX((short)1, "pex");
12112
 
12113
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12114
 
12115
      static {
12116
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12117
          byName.put(field.getFieldName(), field);
12118
        }
12119
      }
12120
 
12121
      /**
12122
       * Find the _Fields constant that matches fieldId, or null if its not found.
12123
       */
12124
      public static _Fields findByThriftId(int fieldId) {
12125
        switch(fieldId) {
12126
          case 0: // SUCCESS
12127
            return SUCCESS;
12128
          case 1: // PEX
12129
            return PEX;
12130
          default:
12131
            return null;
12132
        }
12133
      }
12134
 
12135
      /**
12136
       * Find the _Fields constant that matches fieldId, throwing an exception
12137
       * if it is not found.
12138
       */
12139
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12140
        _Fields fields = findByThriftId(fieldId);
12141
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12142
        return fields;
12143
      }
12144
 
12145
      /**
12146
       * Find the _Fields constant that matches name, or null if its not found.
12147
       */
12148
      public static _Fields findByName(String name) {
12149
        return byName.get(name);
12150
      }
12151
 
12152
      private final short _thriftId;
12153
      private final String _fieldName;
12154
 
12155
      _Fields(short thriftId, String fieldName) {
12156
        _thriftId = thriftId;
12157
        _fieldName = fieldName;
12158
      }
12159
 
12160
      public short getThriftFieldId() {
12161
        return _thriftId;
12162
      }
12163
 
12164
      public String getFieldName() {
12165
        return _fieldName;
12166
      }
12167
    }
12168
 
12169
    // isset id assignments
12170
 
12171
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12172
    static {
12173
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12174
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12175
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
12176
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
12177
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12178
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
12179
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12180
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCodes_result.class, metaDataMap);
12181
    }
12182
 
12183
    public getActiveCodes_result() {
12184
    }
12185
 
12186
    public getActiveCodes_result(
12187
      List<Coupon> success,
12188
      PromotionException pex)
12189
    {
12190
      this();
12191
      this.success = success;
12192
      this.pex = pex;
12193
    }
12194
 
12195
    /**
12196
     * Performs a deep copy on <i>other</i>.
12197
     */
12198
    public getActiveCodes_result(getActiveCodes_result other) {
12199
      if (other.isSetSuccess()) {
12200
        List<Coupon> __this__success = new ArrayList<Coupon>();
12201
        for (Coupon other_element : other.success) {
12202
          __this__success.add(new Coupon(other_element));
12203
        }
12204
        this.success = __this__success;
12205
      }
12206
      if (other.isSetPex()) {
12207
        this.pex = new PromotionException(other.pex);
12208
      }
12209
    }
12210
 
12211
    public getActiveCodes_result deepCopy() {
12212
      return new getActiveCodes_result(this);
12213
    }
12214
 
12215
    @Override
12216
    public void clear() {
12217
      this.success = null;
12218
      this.pex = null;
12219
    }
12220
 
12221
    public int getSuccessSize() {
12222
      return (this.success == null) ? 0 : this.success.size();
12223
    }
12224
 
12225
    public java.util.Iterator<Coupon> getSuccessIterator() {
12226
      return (this.success == null) ? null : this.success.iterator();
12227
    }
12228
 
12229
    public void addToSuccess(Coupon elem) {
12230
      if (this.success == null) {
12231
        this.success = new ArrayList<Coupon>();
12232
      }
12233
      this.success.add(elem);
12234
    }
12235
 
12236
    public List<Coupon> getSuccess() {
12237
      return this.success;
12238
    }
12239
 
12240
    public void setSuccess(List<Coupon> success) {
12241
      this.success = success;
12242
    }
12243
 
12244
    public void unsetSuccess() {
12245
      this.success = null;
12246
    }
12247
 
12248
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
12249
    public boolean isSetSuccess() {
12250
      return this.success != null;
12251
    }
12252
 
12253
    public void setSuccessIsSet(boolean value) {
12254
      if (!value) {
12255
        this.success = null;
12256
      }
12257
    }
12258
 
12259
    public PromotionException getPex() {
12260
      return this.pex;
12261
    }
12262
 
12263
    public void setPex(PromotionException pex) {
12264
      this.pex = pex;
12265
    }
12266
 
12267
    public void unsetPex() {
12268
      this.pex = null;
12269
    }
12270
 
12271
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
12272
    public boolean isSetPex() {
12273
      return this.pex != null;
12274
    }
12275
 
12276
    public void setPexIsSet(boolean value) {
12277
      if (!value) {
12278
        this.pex = null;
12279
      }
12280
    }
12281
 
12282
    public void setFieldValue(_Fields field, Object value) {
12283
      switch (field) {
12284
      case SUCCESS:
12285
        if (value == null) {
12286
          unsetSuccess();
12287
        } else {
12288
          setSuccess((List<Coupon>)value);
12289
        }
12290
        break;
12291
 
12292
      case PEX:
12293
        if (value == null) {
12294
          unsetPex();
12295
        } else {
12296
          setPex((PromotionException)value);
12297
        }
12298
        break;
12299
 
12300
      }
12301
    }
12302
 
12303
    public Object getFieldValue(_Fields field) {
12304
      switch (field) {
12305
      case SUCCESS:
12306
        return getSuccess();
12307
 
12308
      case PEX:
12309
        return getPex();
12310
 
12311
      }
12312
      throw new IllegalStateException();
12313
    }
12314
 
12315
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12316
    public boolean isSet(_Fields field) {
12317
      if (field == null) {
12318
        throw new IllegalArgumentException();
12319
      }
12320
 
12321
      switch (field) {
12322
      case SUCCESS:
12323
        return isSetSuccess();
12324
      case PEX:
12325
        return isSetPex();
12326
      }
12327
      throw new IllegalStateException();
12328
    }
12329
 
12330
    @Override
12331
    public boolean equals(Object that) {
12332
      if (that == null)
12333
        return false;
12334
      if (that instanceof getActiveCodes_result)
12335
        return this.equals((getActiveCodes_result)that);
12336
      return false;
12337
    }
12338
 
12339
    public boolean equals(getActiveCodes_result that) {
12340
      if (that == null)
12341
        return false;
12342
 
12343
      boolean this_present_success = true && this.isSetSuccess();
12344
      boolean that_present_success = true && that.isSetSuccess();
12345
      if (this_present_success || that_present_success) {
12346
        if (!(this_present_success && that_present_success))
12347
          return false;
12348
        if (!this.success.equals(that.success))
12349
          return false;
12350
      }
12351
 
12352
      boolean this_present_pex = true && this.isSetPex();
12353
      boolean that_present_pex = true && that.isSetPex();
12354
      if (this_present_pex || that_present_pex) {
12355
        if (!(this_present_pex && that_present_pex))
12356
          return false;
12357
        if (!this.pex.equals(that.pex))
12358
          return false;
12359
      }
12360
 
12361
      return true;
12362
    }
12363
 
12364
    @Override
12365
    public int hashCode() {
12366
      return 0;
12367
    }
12368
 
12369
    public int compareTo(getActiveCodes_result other) {
12370
      if (!getClass().equals(other.getClass())) {
12371
        return getClass().getName().compareTo(other.getClass().getName());
12372
      }
12373
 
12374
      int lastComparison = 0;
12375
      getActiveCodes_result typedOther = (getActiveCodes_result)other;
12376
 
12377
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
12378
      if (lastComparison != 0) {
12379
        return lastComparison;
12380
      }
12381
      if (isSetSuccess()) {
12382
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
12383
        if (lastComparison != 0) {
12384
          return lastComparison;
12385
        }
12386
      }
12387
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
12388
      if (lastComparison != 0) {
12389
        return lastComparison;
12390
      }
12391
      if (isSetPex()) {
12392
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
12393
        if (lastComparison != 0) {
12394
          return lastComparison;
12395
        }
12396
      }
12397
      return 0;
12398
    }
12399
 
12400
    public _Fields fieldForId(int fieldId) {
12401
      return _Fields.findByThriftId(fieldId);
12402
    }
12403
 
12404
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12405
      org.apache.thrift.protocol.TField field;
12406
      iprot.readStructBegin();
12407
      while (true)
12408
      {
12409
        field = iprot.readFieldBegin();
12410
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12411
          break;
12412
        }
12413
        switch (field.id) {
12414
          case 0: // SUCCESS
12415
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
12416
              {
11592 amit.gupta 12417
                org.apache.thrift.protocol.TList _list30 = iprot.readListBegin();
12418
                this.success = new ArrayList<Coupon>(_list30.size);
12419
                for (int _i31 = 0; _i31 < _list30.size; ++_i31)
6497 amit.gupta 12420
                {
11592 amit.gupta 12421
                  Coupon _elem32; // required
12422
                  _elem32 = new Coupon();
12423
                  _elem32.read(iprot);
12424
                  this.success.add(_elem32);
6497 amit.gupta 12425
                }
12426
                iprot.readListEnd();
12427
              }
12428
            } else { 
12429
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12430
            }
12431
            break;
12432
          case 1: // PEX
12433
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
12434
              this.pex = new PromotionException();
12435
              this.pex.read(iprot);
12436
            } else { 
12437
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12438
            }
12439
            break;
12440
          default:
12441
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12442
        }
12443
        iprot.readFieldEnd();
12444
      }
12445
      iprot.readStructEnd();
12446
      validate();
12447
    }
12448
 
12449
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12450
      oprot.writeStructBegin(STRUCT_DESC);
12451
 
12452
      if (this.isSetSuccess()) {
12453
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
12454
        {
12455
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
11592 amit.gupta 12456
          for (Coupon _iter33 : this.success)
6497 amit.gupta 12457
          {
11592 amit.gupta 12458
            _iter33.write(oprot);
6497 amit.gupta 12459
          }
12460
          oprot.writeListEnd();
12461
        }
12462
        oprot.writeFieldEnd();
12463
      } else if (this.isSetPex()) {
12464
        oprot.writeFieldBegin(PEX_FIELD_DESC);
12465
        this.pex.write(oprot);
12466
        oprot.writeFieldEnd();
12467
      }
12468
      oprot.writeFieldStop();
12469
      oprot.writeStructEnd();
12470
    }
12471
 
12472
    @Override
12473
    public String toString() {
12474
      StringBuilder sb = new StringBuilder("getActiveCodes_result(");
12475
      boolean first = true;
12476
 
12477
      sb.append("success:");
12478
      if (this.success == null) {
12479
        sb.append("null");
12480
      } else {
12481
        sb.append(this.success);
12482
      }
12483
      first = false;
12484
      if (!first) sb.append(", ");
12485
      sb.append("pex:");
12486
      if (this.pex == null) {
12487
        sb.append("null");
12488
      } else {
12489
        sb.append(this.pex);
12490
      }
12491
      first = false;
12492
      sb.append(")");
12493
      return sb.toString();
12494
    }
12495
 
12496
    public void validate() throws org.apache.thrift.TException {
12497
      // check for required fields
12498
    }
12499
 
12500
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12501
      try {
12502
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12503
      } catch (org.apache.thrift.TException te) {
12504
        throw new java.io.IOException(te);
12505
      }
12506
    }
12507
 
12508
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12509
      try {
12510
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12511
      } catch (org.apache.thrift.TException te) {
12512
        throw new java.io.IOException(te);
12513
      }
12514
    }
12515
 
12516
  }
12517
 
12518
  public static class deleteCoupon_args implements org.apache.thrift.TBase<deleteCoupon_args, deleteCoupon_args._Fields>, java.io.Serializable, Cloneable   {
12519
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteCoupon_args");
12520
 
12521
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)1);
12522
 
12523
    private String couponCode; // required
12524
 
12525
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12526
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12527
      COUPON_CODE((short)1, "couponCode");
12528
 
12529
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12530
 
12531
      static {
12532
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12533
          byName.put(field.getFieldName(), field);
12534
        }
12535
      }
12536
 
12537
      /**
12538
       * Find the _Fields constant that matches fieldId, or null if its not found.
12539
       */
12540
      public static _Fields findByThriftId(int fieldId) {
12541
        switch(fieldId) {
12542
          case 1: // COUPON_CODE
12543
            return COUPON_CODE;
12544
          default:
12545
            return null;
12546
        }
12547
      }
12548
 
12549
      /**
12550
       * Find the _Fields constant that matches fieldId, throwing an exception
12551
       * if it is not found.
12552
       */
12553
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12554
        _Fields fields = findByThriftId(fieldId);
12555
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12556
        return fields;
12557
      }
12558
 
12559
      /**
12560
       * Find the _Fields constant that matches name, or null if its not found.
12561
       */
12562
      public static _Fields findByName(String name) {
12563
        return byName.get(name);
12564
      }
12565
 
12566
      private final short _thriftId;
12567
      private final String _fieldName;
12568
 
12569
      _Fields(short thriftId, String fieldName) {
12570
        _thriftId = thriftId;
12571
        _fieldName = fieldName;
12572
      }
12573
 
12574
      public short getThriftFieldId() {
12575
        return _thriftId;
12576
      }
12577
 
12578
      public String getFieldName() {
12579
        return _fieldName;
12580
      }
12581
    }
12582
 
12583
    // isset id assignments
12584
 
12585
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12586
    static {
12587
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12588
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12589
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
12590
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12591
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteCoupon_args.class, metaDataMap);
12592
    }
12593
 
12594
    public deleteCoupon_args() {
12595
    }
12596
 
12597
    public deleteCoupon_args(
12598
      String couponCode)
12599
    {
12600
      this();
12601
      this.couponCode = couponCode;
12602
    }
12603
 
12604
    /**
12605
     * Performs a deep copy on <i>other</i>.
12606
     */
12607
    public deleteCoupon_args(deleteCoupon_args other) {
12608
      if (other.isSetCouponCode()) {
12609
        this.couponCode = other.couponCode;
12610
      }
12611
    }
12612
 
12613
    public deleteCoupon_args deepCopy() {
12614
      return new deleteCoupon_args(this);
12615
    }
12616
 
12617
    @Override
12618
    public void clear() {
12619
      this.couponCode = null;
12620
    }
12621
 
12622
    public String getCouponCode() {
12623
      return this.couponCode;
12624
    }
12625
 
12626
    public void setCouponCode(String couponCode) {
12627
      this.couponCode = couponCode;
12628
    }
12629
 
12630
    public void unsetCouponCode() {
12631
      this.couponCode = null;
12632
    }
12633
 
12634
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
12635
    public boolean isSetCouponCode() {
12636
      return this.couponCode != null;
12637
    }
12638
 
12639
    public void setCouponCodeIsSet(boolean value) {
12640
      if (!value) {
12641
        this.couponCode = null;
12642
      }
12643
    }
12644
 
12645
    public void setFieldValue(_Fields field, Object value) {
12646
      switch (field) {
12647
      case COUPON_CODE:
12648
        if (value == null) {
12649
          unsetCouponCode();
12650
        } else {
12651
          setCouponCode((String)value);
12652
        }
12653
        break;
12654
 
12655
      }
12656
    }
12657
 
12658
    public Object getFieldValue(_Fields field) {
12659
      switch (field) {
12660
      case COUPON_CODE:
12661
        return getCouponCode();
12662
 
12663
      }
12664
      throw new IllegalStateException();
12665
    }
12666
 
12667
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12668
    public boolean isSet(_Fields field) {
12669
      if (field == null) {
12670
        throw new IllegalArgumentException();
12671
      }
12672
 
12673
      switch (field) {
12674
      case COUPON_CODE:
12675
        return isSetCouponCode();
12676
      }
12677
      throw new IllegalStateException();
12678
    }
12679
 
12680
    @Override
12681
    public boolean equals(Object that) {
12682
      if (that == null)
12683
        return false;
12684
      if (that instanceof deleteCoupon_args)
12685
        return this.equals((deleteCoupon_args)that);
12686
      return false;
12687
    }
12688
 
12689
    public boolean equals(deleteCoupon_args that) {
12690
      if (that == null)
12691
        return false;
12692
 
12693
      boolean this_present_couponCode = true && this.isSetCouponCode();
12694
      boolean that_present_couponCode = true && that.isSetCouponCode();
12695
      if (this_present_couponCode || that_present_couponCode) {
12696
        if (!(this_present_couponCode && that_present_couponCode))
12697
          return false;
12698
        if (!this.couponCode.equals(that.couponCode))
12699
          return false;
12700
      }
12701
 
12702
      return true;
12703
    }
12704
 
12705
    @Override
12706
    public int hashCode() {
12707
      return 0;
12708
    }
12709
 
12710
    public int compareTo(deleteCoupon_args other) {
12711
      if (!getClass().equals(other.getClass())) {
12712
        return getClass().getName().compareTo(other.getClass().getName());
12713
      }
12714
 
12715
      int lastComparison = 0;
12716
      deleteCoupon_args typedOther = (deleteCoupon_args)other;
12717
 
12718
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
12719
      if (lastComparison != 0) {
12720
        return lastComparison;
12721
      }
12722
      if (isSetCouponCode()) {
12723
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
12724
        if (lastComparison != 0) {
12725
          return lastComparison;
12726
        }
12727
      }
12728
      return 0;
12729
    }
12730
 
12731
    public _Fields fieldForId(int fieldId) {
12732
      return _Fields.findByThriftId(fieldId);
12733
    }
12734
 
12735
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12736
      org.apache.thrift.protocol.TField field;
12737
      iprot.readStructBegin();
12738
      while (true)
12739
      {
12740
        field = iprot.readFieldBegin();
12741
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12742
          break;
12743
        }
12744
        switch (field.id) {
12745
          case 1: // COUPON_CODE
12746
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
12747
              this.couponCode = iprot.readString();
12748
            } else { 
12749
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12750
            }
12751
            break;
12752
          default:
12753
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12754
        }
12755
        iprot.readFieldEnd();
12756
      }
12757
      iprot.readStructEnd();
12758
      validate();
12759
    }
12760
 
12761
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12762
      validate();
12763
 
12764
      oprot.writeStructBegin(STRUCT_DESC);
12765
      if (this.couponCode != null) {
12766
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
12767
        oprot.writeString(this.couponCode);
12768
        oprot.writeFieldEnd();
12769
      }
12770
      oprot.writeFieldStop();
12771
      oprot.writeStructEnd();
12772
    }
12773
 
12774
    @Override
12775
    public String toString() {
12776
      StringBuilder sb = new StringBuilder("deleteCoupon_args(");
12777
      boolean first = true;
12778
 
12779
      sb.append("couponCode:");
12780
      if (this.couponCode == null) {
12781
        sb.append("null");
12782
      } else {
12783
        sb.append(this.couponCode);
12784
      }
12785
      first = false;
12786
      sb.append(")");
12787
      return sb.toString();
12788
    }
12789
 
12790
    public void validate() throws org.apache.thrift.TException {
12791
      // check for required fields
12792
    }
12793
 
12794
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12795
      try {
12796
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12797
      } catch (org.apache.thrift.TException te) {
12798
        throw new java.io.IOException(te);
12799
      }
12800
    }
12801
 
12802
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12803
      try {
12804
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12805
      } catch (org.apache.thrift.TException te) {
12806
        throw new java.io.IOException(te);
12807
      }
12808
    }
12809
 
12810
  }
12811
 
12812
  public static class deleteCoupon_result implements org.apache.thrift.TBase<deleteCoupon_result, deleteCoupon_result._Fields>, java.io.Serializable, Cloneable   {
12813
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteCoupon_result");
12814
 
12815
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
12816
 
12817
    private PromotionException pex; // required
12818
 
12819
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12820
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12821
      PEX((short)1, "pex");
12822
 
12823
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12824
 
12825
      static {
12826
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12827
          byName.put(field.getFieldName(), field);
12828
        }
12829
      }
12830
 
12831
      /**
12832
       * Find the _Fields constant that matches fieldId, or null if its not found.
12833
       */
12834
      public static _Fields findByThriftId(int fieldId) {
12835
        switch(fieldId) {
12836
          case 1: // PEX
12837
            return PEX;
12838
          default:
12839
            return null;
12840
        }
12841
      }
12842
 
12843
      /**
12844
       * Find the _Fields constant that matches fieldId, throwing an exception
12845
       * if it is not found.
12846
       */
12847
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12848
        _Fields fields = findByThriftId(fieldId);
12849
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12850
        return fields;
12851
      }
12852
 
12853
      /**
12854
       * Find the _Fields constant that matches name, or null if its not found.
12855
       */
12856
      public static _Fields findByName(String name) {
12857
        return byName.get(name);
12858
      }
12859
 
12860
      private final short _thriftId;
12861
      private final String _fieldName;
12862
 
12863
      _Fields(short thriftId, String fieldName) {
12864
        _thriftId = thriftId;
12865
        _fieldName = fieldName;
12866
      }
12867
 
12868
      public short getThriftFieldId() {
12869
        return _thriftId;
12870
      }
12871
 
12872
      public String getFieldName() {
12873
        return _fieldName;
12874
      }
12875
    }
12876
 
12877
    // isset id assignments
12878
 
12879
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12880
    static {
12881
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12882
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12883
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
12884
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12885
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteCoupon_result.class, metaDataMap);
12886
    }
12887
 
12888
    public deleteCoupon_result() {
12889
    }
12890
 
12891
    public deleteCoupon_result(
12892
      PromotionException pex)
12893
    {
12894
      this();
12895
      this.pex = pex;
12896
    }
12897
 
12898
    /**
12899
     * Performs a deep copy on <i>other</i>.
12900
     */
12901
    public deleteCoupon_result(deleteCoupon_result other) {
12902
      if (other.isSetPex()) {
12903
        this.pex = new PromotionException(other.pex);
12904
      }
12905
    }
12906
 
12907
    public deleteCoupon_result deepCopy() {
12908
      return new deleteCoupon_result(this);
12909
    }
12910
 
12911
    @Override
12912
    public void clear() {
12913
      this.pex = null;
12914
    }
12915
 
12916
    public PromotionException getPex() {
12917
      return this.pex;
12918
    }
12919
 
12920
    public void setPex(PromotionException pex) {
12921
      this.pex = pex;
12922
    }
12923
 
12924
    public void unsetPex() {
12925
      this.pex = null;
12926
    }
12927
 
12928
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
12929
    public boolean isSetPex() {
12930
      return this.pex != null;
12931
    }
12932
 
12933
    public void setPexIsSet(boolean value) {
12934
      if (!value) {
12935
        this.pex = null;
12936
      }
12937
    }
12938
 
12939
    public void setFieldValue(_Fields field, Object value) {
12940
      switch (field) {
12941
      case PEX:
12942
        if (value == null) {
12943
          unsetPex();
12944
        } else {
12945
          setPex((PromotionException)value);
12946
        }
12947
        break;
12948
 
12949
      }
12950
    }
12951
 
12952
    public Object getFieldValue(_Fields field) {
12953
      switch (field) {
12954
      case PEX:
12955
        return getPex();
12956
 
12957
      }
12958
      throw new IllegalStateException();
12959
    }
12960
 
12961
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12962
    public boolean isSet(_Fields field) {
12963
      if (field == null) {
12964
        throw new IllegalArgumentException();
12965
      }
12966
 
12967
      switch (field) {
12968
      case PEX:
12969
        return isSetPex();
12970
      }
12971
      throw new IllegalStateException();
12972
    }
12973
 
12974
    @Override
12975
    public boolean equals(Object that) {
12976
      if (that == null)
12977
        return false;
12978
      if (that instanceof deleteCoupon_result)
12979
        return this.equals((deleteCoupon_result)that);
12980
      return false;
12981
    }
12982
 
12983
    public boolean equals(deleteCoupon_result that) {
12984
      if (that == null)
12985
        return false;
12986
 
12987
      boolean this_present_pex = true && this.isSetPex();
12988
      boolean that_present_pex = true && that.isSetPex();
12989
      if (this_present_pex || that_present_pex) {
12990
        if (!(this_present_pex && that_present_pex))
12991
          return false;
12992
        if (!this.pex.equals(that.pex))
12993
          return false;
12994
      }
12995
 
12996
      return true;
12997
    }
12998
 
12999
    @Override
13000
    public int hashCode() {
13001
      return 0;
13002
    }
13003
 
13004
    public int compareTo(deleteCoupon_result other) {
13005
      if (!getClass().equals(other.getClass())) {
13006
        return getClass().getName().compareTo(other.getClass().getName());
13007
      }
13008
 
13009
      int lastComparison = 0;
13010
      deleteCoupon_result typedOther = (deleteCoupon_result)other;
13011
 
13012
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
13013
      if (lastComparison != 0) {
13014
        return lastComparison;
13015
      }
13016
      if (isSetPex()) {
13017
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
13018
        if (lastComparison != 0) {
13019
          return lastComparison;
13020
        }
13021
      }
13022
      return 0;
13023
    }
13024
 
13025
    public _Fields fieldForId(int fieldId) {
13026
      return _Fields.findByThriftId(fieldId);
13027
    }
13028
 
13029
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13030
      org.apache.thrift.protocol.TField field;
13031
      iprot.readStructBegin();
13032
      while (true)
13033
      {
13034
        field = iprot.readFieldBegin();
13035
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
13036
          break;
13037
        }
13038
        switch (field.id) {
13039
          case 1: // PEX
13040
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
13041
              this.pex = new PromotionException();
13042
              this.pex.read(iprot);
13043
            } else { 
13044
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13045
            }
13046
            break;
13047
          default:
13048
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13049
        }
13050
        iprot.readFieldEnd();
13051
      }
13052
      iprot.readStructEnd();
13053
      validate();
13054
    }
13055
 
13056
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
13057
      oprot.writeStructBegin(STRUCT_DESC);
13058
 
13059
      if (this.isSetPex()) {
13060
        oprot.writeFieldBegin(PEX_FIELD_DESC);
13061
        this.pex.write(oprot);
13062
        oprot.writeFieldEnd();
13063
      }
13064
      oprot.writeFieldStop();
13065
      oprot.writeStructEnd();
13066
    }
13067
 
13068
    @Override
13069
    public String toString() {
13070
      StringBuilder sb = new StringBuilder("deleteCoupon_result(");
13071
      boolean first = true;
13072
 
13073
      sb.append("pex:");
13074
      if (this.pex == null) {
13075
        sb.append("null");
13076
      } else {
13077
        sb.append(this.pex);
13078
      }
13079
      first = false;
13080
      sb.append(")");
13081
      return sb.toString();
13082
    }
13083
 
13084
    public void validate() throws org.apache.thrift.TException {
13085
      // check for required fields
13086
    }
13087
 
13088
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13089
      try {
13090
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13091
      } catch (org.apache.thrift.TException te) {
13092
        throw new java.io.IOException(te);
13093
      }
13094
    }
13095
 
13096
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13097
      try {
13098
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13099
      } catch (org.apache.thrift.TException te) {
13100
        throw new java.io.IOException(te);
13101
      }
13102
    }
13103
 
13104
  }
13105
 
7092 amit.gupta 13106
  public static class getAllCouponsByPromotionId_args implements org.apache.thrift.TBase<getAllCouponsByPromotionId_args, getAllCouponsByPromotionId_args._Fields>, java.io.Serializable, Cloneable   {
13107
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllCouponsByPromotionId_args");
13108
 
13109
    private static final org.apache.thrift.protocol.TField PROMOTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("promotionId", org.apache.thrift.protocol.TType.I64, (short)1);
13110
 
13111
    private long promotionId; // required
13112
 
13113
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
13114
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
13115
      PROMOTION_ID((short)1, "promotionId");
13116
 
13117
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13118
 
13119
      static {
13120
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13121
          byName.put(field.getFieldName(), field);
13122
        }
13123
      }
13124
 
13125
      /**
13126
       * Find the _Fields constant that matches fieldId, or null if its not found.
13127
       */
13128
      public static _Fields findByThriftId(int fieldId) {
13129
        switch(fieldId) {
13130
          case 1: // PROMOTION_ID
13131
            return PROMOTION_ID;
13132
          default:
13133
            return null;
13134
        }
13135
      }
13136
 
13137
      /**
13138
       * Find the _Fields constant that matches fieldId, throwing an exception
13139
       * if it is not found.
13140
       */
13141
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13142
        _Fields fields = findByThriftId(fieldId);
13143
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13144
        return fields;
13145
      }
13146
 
13147
      /**
13148
       * Find the _Fields constant that matches name, or null if its not found.
13149
       */
13150
      public static _Fields findByName(String name) {
13151
        return byName.get(name);
13152
      }
13153
 
13154
      private final short _thriftId;
13155
      private final String _fieldName;
13156
 
13157
      _Fields(short thriftId, String fieldName) {
13158
        _thriftId = thriftId;
13159
        _fieldName = fieldName;
13160
      }
13161
 
13162
      public short getThriftFieldId() {
13163
        return _thriftId;
13164
      }
13165
 
13166
      public String getFieldName() {
13167
        return _fieldName;
13168
      }
13169
    }
13170
 
13171
    // isset id assignments
13172
    private static final int __PROMOTIONID_ISSET_ID = 0;
13173
    private BitSet __isset_bit_vector = new BitSet(1);
13174
 
13175
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
13176
    static {
13177
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13178
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13179
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
13180
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13181
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllCouponsByPromotionId_args.class, metaDataMap);
13182
    }
13183
 
13184
    public getAllCouponsByPromotionId_args() {
13185
    }
13186
 
13187
    public getAllCouponsByPromotionId_args(
13188
      long promotionId)
13189
    {
13190
      this();
13191
      this.promotionId = promotionId;
13192
      setPromotionIdIsSet(true);
13193
    }
13194
 
13195
    /**
13196
     * Performs a deep copy on <i>other</i>.
13197
     */
13198
    public getAllCouponsByPromotionId_args(getAllCouponsByPromotionId_args other) {
13199
      __isset_bit_vector.clear();
13200
      __isset_bit_vector.or(other.__isset_bit_vector);
13201
      this.promotionId = other.promotionId;
13202
    }
13203
 
13204
    public getAllCouponsByPromotionId_args deepCopy() {
13205
      return new getAllCouponsByPromotionId_args(this);
13206
    }
13207
 
13208
    @Override
13209
    public void clear() {
13210
      setPromotionIdIsSet(false);
13211
      this.promotionId = 0;
13212
    }
13213
 
13214
    public long getPromotionId() {
13215
      return this.promotionId;
13216
    }
13217
 
13218
    public void setPromotionId(long promotionId) {
13219
      this.promotionId = promotionId;
13220
      setPromotionIdIsSet(true);
13221
    }
13222
 
13223
    public void unsetPromotionId() {
13224
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
13225
    }
13226
 
13227
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
13228
    public boolean isSetPromotionId() {
13229
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
13230
    }
13231
 
13232
    public void setPromotionIdIsSet(boolean value) {
13233
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
13234
    }
13235
 
13236
    public void setFieldValue(_Fields field, Object value) {
13237
      switch (field) {
13238
      case PROMOTION_ID:
13239
        if (value == null) {
13240
          unsetPromotionId();
13241
        } else {
13242
          setPromotionId((Long)value);
13243
        }
13244
        break;
13245
 
13246
      }
13247
    }
13248
 
13249
    public Object getFieldValue(_Fields field) {
13250
      switch (field) {
13251
      case PROMOTION_ID:
13252
        return Long.valueOf(getPromotionId());
13253
 
13254
      }
13255
      throw new IllegalStateException();
13256
    }
13257
 
13258
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13259
    public boolean isSet(_Fields field) {
13260
      if (field == null) {
13261
        throw new IllegalArgumentException();
13262
      }
13263
 
13264
      switch (field) {
13265
      case PROMOTION_ID:
13266
        return isSetPromotionId();
13267
      }
13268
      throw new IllegalStateException();
13269
    }
13270
 
13271
    @Override
13272
    public boolean equals(Object that) {
13273
      if (that == null)
13274
        return false;
13275
      if (that instanceof getAllCouponsByPromotionId_args)
13276
        return this.equals((getAllCouponsByPromotionId_args)that);
13277
      return false;
13278
    }
13279
 
13280
    public boolean equals(getAllCouponsByPromotionId_args that) {
13281
      if (that == null)
13282
        return false;
13283
 
13284
      boolean this_present_promotionId = true;
13285
      boolean that_present_promotionId = true;
13286
      if (this_present_promotionId || that_present_promotionId) {
13287
        if (!(this_present_promotionId && that_present_promotionId))
13288
          return false;
13289
        if (this.promotionId != that.promotionId)
13290
          return false;
13291
      }
13292
 
13293
      return true;
13294
    }
13295
 
13296
    @Override
13297
    public int hashCode() {
13298
      return 0;
13299
    }
13300
 
13301
    public int compareTo(getAllCouponsByPromotionId_args other) {
13302
      if (!getClass().equals(other.getClass())) {
13303
        return getClass().getName().compareTo(other.getClass().getName());
13304
      }
13305
 
13306
      int lastComparison = 0;
13307
      getAllCouponsByPromotionId_args typedOther = (getAllCouponsByPromotionId_args)other;
13308
 
13309
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
13310
      if (lastComparison != 0) {
13311
        return lastComparison;
13312
      }
13313
      if (isSetPromotionId()) {
13314
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
13315
        if (lastComparison != 0) {
13316
          return lastComparison;
13317
        }
13318
      }
13319
      return 0;
13320
    }
13321
 
13322
    public _Fields fieldForId(int fieldId) {
13323
      return _Fields.findByThriftId(fieldId);
13324
    }
13325
 
13326
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13327
      org.apache.thrift.protocol.TField field;
13328
      iprot.readStructBegin();
13329
      while (true)
13330
      {
13331
        field = iprot.readFieldBegin();
13332
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
13333
          break;
13334
        }
13335
        switch (field.id) {
13336
          case 1: // PROMOTION_ID
13337
            if (field.type == org.apache.thrift.protocol.TType.I64) {
13338
              this.promotionId = iprot.readI64();
13339
              setPromotionIdIsSet(true);
13340
            } else { 
13341
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13342
            }
13343
            break;
13344
          default:
13345
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13346
        }
13347
        iprot.readFieldEnd();
13348
      }
13349
      iprot.readStructEnd();
13350
      validate();
13351
    }
13352
 
13353
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
13354
      validate();
13355
 
13356
      oprot.writeStructBegin(STRUCT_DESC);
13357
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
13358
      oprot.writeI64(this.promotionId);
13359
      oprot.writeFieldEnd();
13360
      oprot.writeFieldStop();
13361
      oprot.writeStructEnd();
13362
    }
13363
 
13364
    @Override
13365
    public String toString() {
13366
      StringBuilder sb = new StringBuilder("getAllCouponsByPromotionId_args(");
13367
      boolean first = true;
13368
 
13369
      sb.append("promotionId:");
13370
      sb.append(this.promotionId);
13371
      first = false;
13372
      sb.append(")");
13373
      return sb.toString();
13374
    }
13375
 
13376
    public void validate() throws org.apache.thrift.TException {
13377
      // check for required fields
13378
    }
13379
 
13380
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13381
      try {
13382
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13383
      } catch (org.apache.thrift.TException te) {
13384
        throw new java.io.IOException(te);
13385
      }
13386
    }
13387
 
13388
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13389
      try {
13390
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
13391
        __isset_bit_vector = new BitSet(1);
13392
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13393
      } catch (org.apache.thrift.TException te) {
13394
        throw new java.io.IOException(te);
13395
      }
13396
    }
13397
 
13398
  }
13399
 
13400
  public static class getAllCouponsByPromotionId_result implements org.apache.thrift.TBase<getAllCouponsByPromotionId_result, getAllCouponsByPromotionId_result._Fields>, java.io.Serializable, Cloneable   {
13401
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllCouponsByPromotionId_result");
13402
 
13403
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
13404
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
13405
 
13406
    private List<Coupon> success; // required
13407
    private PromotionException pex; // required
13408
 
13409
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
13410
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
13411
      SUCCESS((short)0, "success"),
13412
      PEX((short)1, "pex");
13413
 
13414
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13415
 
13416
      static {
13417
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13418
          byName.put(field.getFieldName(), field);
13419
        }
13420
      }
13421
 
13422
      /**
13423
       * Find the _Fields constant that matches fieldId, or null if its not found.
13424
       */
13425
      public static _Fields findByThriftId(int fieldId) {
13426
        switch(fieldId) {
13427
          case 0: // SUCCESS
13428
            return SUCCESS;
13429
          case 1: // PEX
13430
            return PEX;
13431
          default:
13432
            return null;
13433
        }
13434
      }
13435
 
13436
      /**
13437
       * Find the _Fields constant that matches fieldId, throwing an exception
13438
       * if it is not found.
13439
       */
13440
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13441
        _Fields fields = findByThriftId(fieldId);
13442
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13443
        return fields;
13444
      }
13445
 
13446
      /**
13447
       * Find the _Fields constant that matches name, or null if its not found.
13448
       */
13449
      public static _Fields findByName(String name) {
13450
        return byName.get(name);
13451
      }
13452
 
13453
      private final short _thriftId;
13454
      private final String _fieldName;
13455
 
13456
      _Fields(short thriftId, String fieldName) {
13457
        _thriftId = thriftId;
13458
        _fieldName = fieldName;
13459
      }
13460
 
13461
      public short getThriftFieldId() {
13462
        return _thriftId;
13463
      }
13464
 
13465
      public String getFieldName() {
13466
        return _fieldName;
13467
      }
13468
    }
13469
 
13470
    // isset id assignments
13471
 
13472
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
13473
    static {
13474
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13475
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13476
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
13477
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
13478
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13479
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
13480
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13481
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllCouponsByPromotionId_result.class, metaDataMap);
13482
    }
13483
 
13484
    public getAllCouponsByPromotionId_result() {
13485
    }
13486
 
13487
    public getAllCouponsByPromotionId_result(
13488
      List<Coupon> success,
13489
      PromotionException pex)
13490
    {
13491
      this();
13492
      this.success = success;
13493
      this.pex = pex;
13494
    }
13495
 
13496
    /**
13497
     * Performs a deep copy on <i>other</i>.
13498
     */
13499
    public getAllCouponsByPromotionId_result(getAllCouponsByPromotionId_result other) {
13500
      if (other.isSetSuccess()) {
13501
        List<Coupon> __this__success = new ArrayList<Coupon>();
13502
        for (Coupon other_element : other.success) {
13503
          __this__success.add(new Coupon(other_element));
13504
        }
13505
        this.success = __this__success;
13506
      }
13507
      if (other.isSetPex()) {
13508
        this.pex = new PromotionException(other.pex);
13509
      }
13510
    }
13511
 
13512
    public getAllCouponsByPromotionId_result deepCopy() {
13513
      return new getAllCouponsByPromotionId_result(this);
13514
    }
13515
 
13516
    @Override
13517
    public void clear() {
13518
      this.success = null;
13519
      this.pex = null;
13520
    }
13521
 
13522
    public int getSuccessSize() {
13523
      return (this.success == null) ? 0 : this.success.size();
13524
    }
13525
 
13526
    public java.util.Iterator<Coupon> getSuccessIterator() {
13527
      return (this.success == null) ? null : this.success.iterator();
13528
    }
13529
 
13530
    public void addToSuccess(Coupon elem) {
13531
      if (this.success == null) {
13532
        this.success = new ArrayList<Coupon>();
13533
      }
13534
      this.success.add(elem);
13535
    }
13536
 
13537
    public List<Coupon> getSuccess() {
13538
      return this.success;
13539
    }
13540
 
13541
    public void setSuccess(List<Coupon> success) {
13542
      this.success = success;
13543
    }
13544
 
13545
    public void unsetSuccess() {
13546
      this.success = null;
13547
    }
13548
 
13549
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
13550
    public boolean isSetSuccess() {
13551
      return this.success != null;
13552
    }
13553
 
13554
    public void setSuccessIsSet(boolean value) {
13555
      if (!value) {
13556
        this.success = null;
13557
      }
13558
    }
13559
 
13560
    public PromotionException getPex() {
13561
      return this.pex;
13562
    }
13563
 
13564
    public void setPex(PromotionException pex) {
13565
      this.pex = pex;
13566
    }
13567
 
13568
    public void unsetPex() {
13569
      this.pex = null;
13570
    }
13571
 
13572
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
13573
    public boolean isSetPex() {
13574
      return this.pex != null;
13575
    }
13576
 
13577
    public void setPexIsSet(boolean value) {
13578
      if (!value) {
13579
        this.pex = null;
13580
      }
13581
    }
13582
 
13583
    public void setFieldValue(_Fields field, Object value) {
13584
      switch (field) {
13585
      case SUCCESS:
13586
        if (value == null) {
13587
          unsetSuccess();
13588
        } else {
13589
          setSuccess((List<Coupon>)value);
13590
        }
13591
        break;
13592
 
13593
      case PEX:
13594
        if (value == null) {
13595
          unsetPex();
13596
        } else {
13597
          setPex((PromotionException)value);
13598
        }
13599
        break;
13600
 
13601
      }
13602
    }
13603
 
13604
    public Object getFieldValue(_Fields field) {
13605
      switch (field) {
13606
      case SUCCESS:
13607
        return getSuccess();
13608
 
13609
      case PEX:
13610
        return getPex();
13611
 
13612
      }
13613
      throw new IllegalStateException();
13614
    }
13615
 
13616
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13617
    public boolean isSet(_Fields field) {
13618
      if (field == null) {
13619
        throw new IllegalArgumentException();
13620
      }
13621
 
13622
      switch (field) {
13623
      case SUCCESS:
13624
        return isSetSuccess();
13625
      case PEX:
13626
        return isSetPex();
13627
      }
13628
      throw new IllegalStateException();
13629
    }
13630
 
13631
    @Override
13632
    public boolean equals(Object that) {
13633
      if (that == null)
13634
        return false;
13635
      if (that instanceof getAllCouponsByPromotionId_result)
13636
        return this.equals((getAllCouponsByPromotionId_result)that);
13637
      return false;
13638
    }
13639
 
13640
    public boolean equals(getAllCouponsByPromotionId_result that) {
13641
      if (that == null)
13642
        return false;
13643
 
13644
      boolean this_present_success = true && this.isSetSuccess();
13645
      boolean that_present_success = true && that.isSetSuccess();
13646
      if (this_present_success || that_present_success) {
13647
        if (!(this_present_success && that_present_success))
13648
          return false;
13649
        if (!this.success.equals(that.success))
13650
          return false;
13651
      }
13652
 
13653
      boolean this_present_pex = true && this.isSetPex();
13654
      boolean that_present_pex = true && that.isSetPex();
13655
      if (this_present_pex || that_present_pex) {
13656
        if (!(this_present_pex && that_present_pex))
13657
          return false;
13658
        if (!this.pex.equals(that.pex))
13659
          return false;
13660
      }
13661
 
13662
      return true;
13663
    }
13664
 
13665
    @Override
13666
    public int hashCode() {
13667
      return 0;
13668
    }
13669
 
13670
    public int compareTo(getAllCouponsByPromotionId_result other) {
13671
      if (!getClass().equals(other.getClass())) {
13672
        return getClass().getName().compareTo(other.getClass().getName());
13673
      }
13674
 
13675
      int lastComparison = 0;
13676
      getAllCouponsByPromotionId_result typedOther = (getAllCouponsByPromotionId_result)other;
13677
 
13678
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
13679
      if (lastComparison != 0) {
13680
        return lastComparison;
13681
      }
13682
      if (isSetSuccess()) {
13683
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
13684
        if (lastComparison != 0) {
13685
          return lastComparison;
13686
        }
13687
      }
13688
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
13689
      if (lastComparison != 0) {
13690
        return lastComparison;
13691
      }
13692
      if (isSetPex()) {
13693
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
13694
        if (lastComparison != 0) {
13695
          return lastComparison;
13696
        }
13697
      }
13698
      return 0;
13699
    }
13700
 
13701
    public _Fields fieldForId(int fieldId) {
13702
      return _Fields.findByThriftId(fieldId);
13703
    }
13704
 
13705
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13706
      org.apache.thrift.protocol.TField field;
13707
      iprot.readStructBegin();
13708
      while (true)
13709
      {
13710
        field = iprot.readFieldBegin();
13711
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
13712
          break;
13713
        }
13714
        switch (field.id) {
13715
          case 0: // SUCCESS
13716
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
13717
              {
11592 amit.gupta 13718
                org.apache.thrift.protocol.TList _list34 = iprot.readListBegin();
13719
                this.success = new ArrayList<Coupon>(_list34.size);
13720
                for (int _i35 = 0; _i35 < _list34.size; ++_i35)
7092 amit.gupta 13721
                {
11592 amit.gupta 13722
                  Coupon _elem36; // required
13723
                  _elem36 = new Coupon();
13724
                  _elem36.read(iprot);
13725
                  this.success.add(_elem36);
7092 amit.gupta 13726
                }
13727
                iprot.readListEnd();
13728
              }
13729
            } else { 
13730
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13731
            }
13732
            break;
13733
          case 1: // PEX
13734
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
13735
              this.pex = new PromotionException();
13736
              this.pex.read(iprot);
13737
            } else { 
13738
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13739
            }
13740
            break;
13741
          default:
13742
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13743
        }
13744
        iprot.readFieldEnd();
13745
      }
13746
      iprot.readStructEnd();
13747
      validate();
13748
    }
13749
 
13750
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
13751
      oprot.writeStructBegin(STRUCT_DESC);
13752
 
13753
      if (this.isSetSuccess()) {
13754
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
13755
        {
13756
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
11592 amit.gupta 13757
          for (Coupon _iter37 : this.success)
7092 amit.gupta 13758
          {
11592 amit.gupta 13759
            _iter37.write(oprot);
7092 amit.gupta 13760
          }
13761
          oprot.writeListEnd();
13762
        }
13763
        oprot.writeFieldEnd();
13764
      } else if (this.isSetPex()) {
13765
        oprot.writeFieldBegin(PEX_FIELD_DESC);
13766
        this.pex.write(oprot);
13767
        oprot.writeFieldEnd();
13768
      }
13769
      oprot.writeFieldStop();
13770
      oprot.writeStructEnd();
13771
    }
13772
 
13773
    @Override
13774
    public String toString() {
13775
      StringBuilder sb = new StringBuilder("getAllCouponsByPromotionId_result(");
13776
      boolean first = true;
13777
 
13778
      sb.append("success:");
13779
      if (this.success == null) {
13780
        sb.append("null");
13781
      } else {
13782
        sb.append(this.success);
13783
      }
13784
      first = false;
13785
      if (!first) sb.append(", ");
13786
      sb.append("pex:");
13787
      if (this.pex == null) {
13788
        sb.append("null");
13789
      } else {
13790
        sb.append(this.pex);
13791
      }
13792
      first = false;
13793
      sb.append(")");
13794
      return sb.toString();
13795
    }
13796
 
13797
    public void validate() throws org.apache.thrift.TException {
13798
      // check for required fields
13799
    }
13800
 
13801
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13802
      try {
13803
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13804
      } catch (org.apache.thrift.TException te) {
13805
        throw new java.io.IOException(te);
13806
      }
13807
    }
13808
 
13809
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13810
      try {
13811
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13812
      } catch (org.apache.thrift.TException te) {
13813
        throw new java.io.IOException(te);
13814
      }
13815
    }
13816
 
13817
  }
13818
 
3430 rajveer 13819
  public static class getActiveCoupons_args implements org.apache.thrift.TBase<getActiveCoupons_args, getActiveCoupons_args._Fields>, java.io.Serializable, Cloneable   {
13820
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_args");
3385 varun.gupt 13821
 
13822
 
13823
 
13824
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 13825
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 13826
;
13827
 
13828
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13829
 
13830
      static {
13831
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13832
          byName.put(field.getFieldName(), field);
13833
        }
13834
      }
13835
 
13836
      /**
13837
       * Find the _Fields constant that matches fieldId, or null if its not found.
13838
       */
13839
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 13840
        switch(fieldId) {
13841
          default:
13842
            return null;
13843
        }
3385 varun.gupt 13844
      }
13845
 
13846
      /**
13847
       * Find the _Fields constant that matches fieldId, throwing an exception
13848
       * if it is not found.
13849
       */
13850
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13851
        _Fields fields = findByThriftId(fieldId);
13852
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13853
        return fields;
13854
      }
13855
 
13856
      /**
13857
       * Find the _Fields constant that matches name, or null if its not found.
13858
       */
13859
      public static _Fields findByName(String name) {
13860
        return byName.get(name);
13861
      }
13862
 
13863
      private final short _thriftId;
13864
      private final String _fieldName;
13865
 
13866
      _Fields(short thriftId, String fieldName) {
13867
        _thriftId = thriftId;
13868
        _fieldName = fieldName;
13869
      }
13870
 
13871
      public short getThriftFieldId() {
13872
        return _thriftId;
13873
      }
13874
 
13875
      public String getFieldName() {
13876
        return _fieldName;
13877
      }
13878
    }
3430 rajveer 13879
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 13880
    static {
3430 rajveer 13881
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13882
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13883
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_args.class, metaDataMap);
3385 varun.gupt 13884
    }
13885
 
13886
    public getActiveCoupons_args() {
13887
    }
13888
 
13889
    /**
13890
     * Performs a deep copy on <i>other</i>.
13891
     */
13892
    public getActiveCoupons_args(getActiveCoupons_args other) {
13893
    }
13894
 
13895
    public getActiveCoupons_args deepCopy() {
13896
      return new getActiveCoupons_args(this);
13897
    }
13898
 
3430 rajveer 13899
    @Override
13900
    public void clear() {
3385 varun.gupt 13901
    }
13902
 
13903
    public void setFieldValue(_Fields field, Object value) {
13904
      switch (field) {
13905
      }
13906
    }
13907
 
13908
    public Object getFieldValue(_Fields field) {
13909
      switch (field) {
13910
      }
13911
      throw new IllegalStateException();
13912
    }
13913
 
3430 rajveer 13914
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13915
    public boolean isSet(_Fields field) {
13916
      if (field == null) {
13917
        throw new IllegalArgumentException();
13918
      }
3385 varun.gupt 13919
 
13920
      switch (field) {
13921
      }
13922
      throw new IllegalStateException();
13923
    }
13924
 
13925
    @Override
13926
    public boolean equals(Object that) {
13927
      if (that == null)
13928
        return false;
13929
      if (that instanceof getActiveCoupons_args)
13930
        return this.equals((getActiveCoupons_args)that);
13931
      return false;
13932
    }
13933
 
13934
    public boolean equals(getActiveCoupons_args that) {
13935
      if (that == null)
13936
        return false;
13937
 
13938
      return true;
13939
    }
13940
 
13941
    @Override
13942
    public int hashCode() {
13943
      return 0;
13944
    }
13945
 
13946
    public int compareTo(getActiveCoupons_args other) {
13947
      if (!getClass().equals(other.getClass())) {
13948
        return getClass().getName().compareTo(other.getClass().getName());
13949
      }
13950
 
13951
      int lastComparison = 0;
13952
      getActiveCoupons_args typedOther = (getActiveCoupons_args)other;
13953
 
13954
      return 0;
13955
    }
13956
 
3430 rajveer 13957
    public _Fields fieldForId(int fieldId) {
13958
      return _Fields.findByThriftId(fieldId);
13959
    }
13960
 
13961
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13962
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 13963
      iprot.readStructBegin();
13964
      while (true)
13965
      {
13966
        field = iprot.readFieldBegin();
3430 rajveer 13967
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 13968
          break;
13969
        }
3430 rajveer 13970
        switch (field.id) {
13971
          default:
13972
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 13973
        }
3430 rajveer 13974
        iprot.readFieldEnd();
3385 varun.gupt 13975
      }
13976
      iprot.readStructEnd();
13977
      validate();
13978
    }
13979
 
3430 rajveer 13980
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 13981
      validate();
13982
 
13983
      oprot.writeStructBegin(STRUCT_DESC);
13984
      oprot.writeFieldStop();
13985
      oprot.writeStructEnd();
13986
    }
13987
 
13988
    @Override
13989
    public String toString() {
13990
      StringBuilder sb = new StringBuilder("getActiveCoupons_args(");
13991
      boolean first = true;
13992
 
13993
      sb.append(")");
13994
      return sb.toString();
13995
    }
13996
 
3430 rajveer 13997
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 13998
      // check for required fields
13999
    }
14000
 
3430 rajveer 14001
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14002
      try {
14003
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14004
      } catch (org.apache.thrift.TException te) {
14005
        throw new java.io.IOException(te);
14006
      }
14007
    }
14008
 
14009
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14010
      try {
14011
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14012
      } catch (org.apache.thrift.TException te) {
14013
        throw new java.io.IOException(te);
14014
      }
14015
    }
14016
 
3385 varun.gupt 14017
  }
14018
 
3430 rajveer 14019
  public static class getActiveCoupons_result implements org.apache.thrift.TBase<getActiveCoupons_result, getActiveCoupons_result._Fields>, java.io.Serializable, Cloneable   {
14020
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_result");
3385 varun.gupt 14021
 
3430 rajveer 14022
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
14023
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
3385 varun.gupt 14024
 
3430 rajveer 14025
    private List<Coupon> success; // required
14026
    private PromotionException pex; // required
3385 varun.gupt 14027
 
14028
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 14029
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 14030
      SUCCESS((short)0, "success"),
14031
      PEX((short)1, "pex");
14032
 
14033
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14034
 
14035
      static {
14036
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14037
          byName.put(field.getFieldName(), field);
14038
        }
14039
      }
14040
 
14041
      /**
14042
       * Find the _Fields constant that matches fieldId, or null if its not found.
14043
       */
14044
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 14045
        switch(fieldId) {
14046
          case 0: // SUCCESS
14047
            return SUCCESS;
14048
          case 1: // PEX
14049
            return PEX;
14050
          default:
14051
            return null;
14052
        }
3385 varun.gupt 14053
      }
14054
 
14055
      /**
14056
       * Find the _Fields constant that matches fieldId, throwing an exception
14057
       * if it is not found.
14058
       */
14059
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14060
        _Fields fields = findByThriftId(fieldId);
14061
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14062
        return fields;
14063
      }
14064
 
14065
      /**
14066
       * Find the _Fields constant that matches name, or null if its not found.
14067
       */
14068
      public static _Fields findByName(String name) {
14069
        return byName.get(name);
14070
      }
14071
 
14072
      private final short _thriftId;
14073
      private final String _fieldName;
14074
 
14075
      _Fields(short thriftId, String fieldName) {
14076
        _thriftId = thriftId;
14077
        _fieldName = fieldName;
14078
      }
14079
 
14080
      public short getThriftFieldId() {
14081
        return _thriftId;
14082
      }
14083
 
14084
      public String getFieldName() {
14085
        return _fieldName;
14086
      }
14087
    }
14088
 
14089
    // isset id assignments
14090
 
3430 rajveer 14091
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 14092
    static {
3430 rajveer 14093
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
14094
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14095
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
14096
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
14097
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14098
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
14099
      metaDataMap = Collections.unmodifiableMap(tmpMap);
14100
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_result.class, metaDataMap);
3385 varun.gupt 14101
    }
14102
 
14103
    public getActiveCoupons_result() {
14104
    }
14105
 
14106
    public getActiveCoupons_result(
14107
      List<Coupon> success,
14108
      PromotionException pex)
14109
    {
14110
      this();
14111
      this.success = success;
14112
      this.pex = pex;
14113
    }
14114
 
14115
    /**
14116
     * Performs a deep copy on <i>other</i>.
14117
     */
14118
    public getActiveCoupons_result(getActiveCoupons_result other) {
14119
      if (other.isSetSuccess()) {
14120
        List<Coupon> __this__success = new ArrayList<Coupon>();
14121
        for (Coupon other_element : other.success) {
14122
          __this__success.add(new Coupon(other_element));
14123
        }
14124
        this.success = __this__success;
14125
      }
14126
      if (other.isSetPex()) {
14127
        this.pex = new PromotionException(other.pex);
14128
      }
14129
    }
14130
 
14131
    public getActiveCoupons_result deepCopy() {
14132
      return new getActiveCoupons_result(this);
14133
    }
14134
 
3430 rajveer 14135
    @Override
14136
    public void clear() {
14137
      this.success = null;
14138
      this.pex = null;
3385 varun.gupt 14139
    }
14140
 
14141
    public int getSuccessSize() {
14142
      return (this.success == null) ? 0 : this.success.size();
14143
    }
14144
 
14145
    public java.util.Iterator<Coupon> getSuccessIterator() {
14146
      return (this.success == null) ? null : this.success.iterator();
14147
    }
14148
 
14149
    public void addToSuccess(Coupon elem) {
14150
      if (this.success == null) {
14151
        this.success = new ArrayList<Coupon>();
14152
      }
14153
      this.success.add(elem);
14154
    }
14155
 
14156
    public List<Coupon> getSuccess() {
14157
      return this.success;
14158
    }
14159
 
3430 rajveer 14160
    public void setSuccess(List<Coupon> success) {
3385 varun.gupt 14161
      this.success = success;
14162
    }
14163
 
14164
    public void unsetSuccess() {
14165
      this.success = null;
14166
    }
14167
 
3430 rajveer 14168
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 14169
    public boolean isSetSuccess() {
14170
      return this.success != null;
14171
    }
14172
 
14173
    public void setSuccessIsSet(boolean value) {
14174
      if (!value) {
14175
        this.success = null;
14176
      }
14177
    }
14178
 
14179
    public PromotionException getPex() {
14180
      return this.pex;
14181
    }
14182
 
3430 rajveer 14183
    public void setPex(PromotionException pex) {
3385 varun.gupt 14184
      this.pex = pex;
14185
    }
14186
 
14187
    public void unsetPex() {
14188
      this.pex = null;
14189
    }
14190
 
3430 rajveer 14191
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 14192
    public boolean isSetPex() {
14193
      return this.pex != null;
14194
    }
14195
 
14196
    public void setPexIsSet(boolean value) {
14197
      if (!value) {
14198
        this.pex = null;
14199
      }
14200
    }
14201
 
14202
    public void setFieldValue(_Fields field, Object value) {
14203
      switch (field) {
14204
      case SUCCESS:
14205
        if (value == null) {
14206
          unsetSuccess();
14207
        } else {
14208
          setSuccess((List<Coupon>)value);
14209
        }
14210
        break;
14211
 
14212
      case PEX:
14213
        if (value == null) {
14214
          unsetPex();
14215
        } else {
14216
          setPex((PromotionException)value);
14217
        }
14218
        break;
14219
 
14220
      }
14221
    }
14222
 
14223
    public Object getFieldValue(_Fields field) {
14224
      switch (field) {
14225
      case SUCCESS:
14226
        return getSuccess();
14227
 
14228
      case PEX:
14229
        return getPex();
14230
 
14231
      }
14232
      throw new IllegalStateException();
14233
    }
14234
 
3430 rajveer 14235
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14236
    public boolean isSet(_Fields field) {
14237
      if (field == null) {
14238
        throw new IllegalArgumentException();
14239
      }
3385 varun.gupt 14240
 
14241
      switch (field) {
14242
      case SUCCESS:
14243
        return isSetSuccess();
14244
      case PEX:
14245
        return isSetPex();
14246
      }
14247
      throw new IllegalStateException();
14248
    }
14249
 
14250
    @Override
14251
    public boolean equals(Object that) {
14252
      if (that == null)
14253
        return false;
14254
      if (that instanceof getActiveCoupons_result)
14255
        return this.equals((getActiveCoupons_result)that);
14256
      return false;
14257
    }
14258
 
14259
    public boolean equals(getActiveCoupons_result that) {
14260
      if (that == null)
14261
        return false;
14262
 
14263
      boolean this_present_success = true && this.isSetSuccess();
14264
      boolean that_present_success = true && that.isSetSuccess();
14265
      if (this_present_success || that_present_success) {
14266
        if (!(this_present_success && that_present_success))
14267
          return false;
14268
        if (!this.success.equals(that.success))
14269
          return false;
14270
      }
14271
 
14272
      boolean this_present_pex = true && this.isSetPex();
14273
      boolean that_present_pex = true && that.isSetPex();
14274
      if (this_present_pex || that_present_pex) {
14275
        if (!(this_present_pex && that_present_pex))
14276
          return false;
14277
        if (!this.pex.equals(that.pex))
14278
          return false;
14279
      }
14280
 
14281
      return true;
14282
    }
14283
 
14284
    @Override
14285
    public int hashCode() {
14286
      return 0;
14287
    }
14288
 
14289
    public int compareTo(getActiveCoupons_result other) {
14290
      if (!getClass().equals(other.getClass())) {
14291
        return getClass().getName().compareTo(other.getClass().getName());
14292
      }
14293
 
14294
      int lastComparison = 0;
14295
      getActiveCoupons_result typedOther = (getActiveCoupons_result)other;
14296
 
3430 rajveer 14297
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 14298
      if (lastComparison != 0) {
14299
        return lastComparison;
14300
      }
3430 rajveer 14301
      if (isSetSuccess()) {
14302
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
14303
        if (lastComparison != 0) {
14304
          return lastComparison;
14305
        }
3385 varun.gupt 14306
      }
3430 rajveer 14307
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 14308
      if (lastComparison != 0) {
14309
        return lastComparison;
14310
      }
3430 rajveer 14311
      if (isSetPex()) {
14312
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
14313
        if (lastComparison != 0) {
14314
          return lastComparison;
14315
        }
3385 varun.gupt 14316
      }
14317
      return 0;
14318
    }
14319
 
3430 rajveer 14320
    public _Fields fieldForId(int fieldId) {
14321
      return _Fields.findByThriftId(fieldId);
14322
    }
14323
 
14324
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14325
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 14326
      iprot.readStructBegin();
14327
      while (true)
14328
      {
14329
        field = iprot.readFieldBegin();
3430 rajveer 14330
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 14331
          break;
14332
        }
3430 rajveer 14333
        switch (field.id) {
14334
          case 0: // SUCCESS
14335
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
14336
              {
11592 amit.gupta 14337
                org.apache.thrift.protocol.TList _list38 = iprot.readListBegin();
14338
                this.success = new ArrayList<Coupon>(_list38.size);
14339
                for (int _i39 = 0; _i39 < _list38.size; ++_i39)
3385 varun.gupt 14340
                {
11592 amit.gupta 14341
                  Coupon _elem40; // required
14342
                  _elem40 = new Coupon();
14343
                  _elem40.read(iprot);
14344
                  this.success.add(_elem40);
3385 varun.gupt 14345
                }
3430 rajveer 14346
                iprot.readListEnd();
3385 varun.gupt 14347
              }
3430 rajveer 14348
            } else { 
14349
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14350
            }
14351
            break;
14352
          case 1: // PEX
14353
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
14354
              this.pex = new PromotionException();
14355
              this.pex.read(iprot);
14356
            } else { 
14357
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14358
            }
14359
            break;
14360
          default:
14361
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 14362
        }
3430 rajveer 14363
        iprot.readFieldEnd();
3385 varun.gupt 14364
      }
14365
      iprot.readStructEnd();
14366
      validate();
14367
    }
14368
 
3430 rajveer 14369
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 14370
      oprot.writeStructBegin(STRUCT_DESC);
14371
 
14372
      if (this.isSetSuccess()) {
14373
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
14374
        {
3430 rajveer 14375
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
11592 amit.gupta 14376
          for (Coupon _iter41 : this.success)
3385 varun.gupt 14377
          {
11592 amit.gupta 14378
            _iter41.write(oprot);
3385 varun.gupt 14379
          }
14380
          oprot.writeListEnd();
14381
        }
14382
        oprot.writeFieldEnd();
14383
      } else if (this.isSetPex()) {
14384
        oprot.writeFieldBegin(PEX_FIELD_DESC);
14385
        this.pex.write(oprot);
14386
        oprot.writeFieldEnd();
14387
      }
14388
      oprot.writeFieldStop();
14389
      oprot.writeStructEnd();
14390
    }
14391
 
14392
    @Override
14393
    public String toString() {
14394
      StringBuilder sb = new StringBuilder("getActiveCoupons_result(");
14395
      boolean first = true;
14396
 
14397
      sb.append("success:");
14398
      if (this.success == null) {
14399
        sb.append("null");
14400
      } else {
14401
        sb.append(this.success);
14402
      }
14403
      first = false;
14404
      if (!first) sb.append(", ");
14405
      sb.append("pex:");
14406
      if (this.pex == null) {
14407
        sb.append("null");
14408
      } else {
14409
        sb.append(this.pex);
14410
      }
14411
      first = false;
14412
      sb.append(")");
14413
      return sb.toString();
14414
    }
14415
 
3430 rajveer 14416
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 14417
      // check for required fields
14418
    }
14419
 
3430 rajveer 14420
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14421
      try {
14422
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14423
      } catch (org.apache.thrift.TException te) {
14424
        throw new java.io.IOException(te);
14425
      }
14426
    }
14427
 
14428
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14429
      try {
14430
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14431
      } catch (org.apache.thrift.TException te) {
14432
        throw new java.io.IOException(te);
14433
      }
14434
    }
14435
 
3385 varun.gupt 14436
  }
14437
 
6250 amit.gupta 14438
  public static class createCoupon_args implements org.apache.thrift.TBase<createCoupon_args, createCoupon_args._Fields>, java.io.Serializable, Cloneable   {
14439
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_args");
14440
 
14441
    private static final org.apache.thrift.protocol.TField PROMOTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("promotionId", org.apache.thrift.protocol.TType.I64, (short)1);
8707 manish.sha 14442
    private static final org.apache.thrift.protocol.TField COUPON_CATEGORY_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCategory", org.apache.thrift.protocol.TType.I64, (short)2);
14443
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)3);
14444
    private static final org.apache.thrift.protocol.TField ARGUMENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("arguments", org.apache.thrift.protocol.TType.STRING, (short)4);
14445
    private static final org.apache.thrift.protocol.TField IS_COD_FIELD_DESC = new org.apache.thrift.protocol.TField("isCod", org.apache.thrift.protocol.TType.BOOL, (short)5);
14446
    private static final org.apache.thrift.protocol.TField PREFIX_FIELD_DESC = new org.apache.thrift.protocol.TField("prefix", org.apache.thrift.protocol.TType.STRING, (short)6);
6250 amit.gupta 14447
 
14448
    private long promotionId; // required
8707 manish.sha 14449
    private long couponCategory; // required
6730 anupam.sin 14450
    private String couponCode; // required
6679 anupam.sin 14451
    private String arguments; // required
6356 amit.gupta 14452
    private boolean isCod; // required
6561 amit.gupta 14453
    private String prefix; // required
6250 amit.gupta 14454
 
14455
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14456
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
14457
      PROMOTION_ID((short)1, "promotionId"),
8707 manish.sha 14458
      COUPON_CATEGORY((short)2, "couponCategory"),
14459
      COUPON_CODE((short)3, "couponCode"),
14460
      ARGUMENTS((short)4, "arguments"),
14461
      IS_COD((short)5, "isCod"),
14462
      PREFIX((short)6, "prefix");
6250 amit.gupta 14463
 
14464
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14465
 
14466
      static {
14467
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14468
          byName.put(field.getFieldName(), field);
14469
        }
14470
      }
14471
 
14472
      /**
14473
       * Find the _Fields constant that matches fieldId, or null if its not found.
14474
       */
14475
      public static _Fields findByThriftId(int fieldId) {
14476
        switch(fieldId) {
14477
          case 1: // PROMOTION_ID
14478
            return PROMOTION_ID;
8707 manish.sha 14479
          case 2: // COUPON_CATEGORY
14480
            return COUPON_CATEGORY;
14481
          case 3: // COUPON_CODE
6730 anupam.sin 14482
            return COUPON_CODE;
8707 manish.sha 14483
          case 4: // ARGUMENTS
6679 anupam.sin 14484
            return ARGUMENTS;
8707 manish.sha 14485
          case 5: // IS_COD
6356 amit.gupta 14486
            return IS_COD;
8707 manish.sha 14487
          case 6: // PREFIX
6561 amit.gupta 14488
            return PREFIX;
6250 amit.gupta 14489
          default:
14490
            return null;
14491
        }
14492
      }
14493
 
14494
      /**
14495
       * Find the _Fields constant that matches fieldId, throwing an exception
14496
       * if it is not found.
14497
       */
14498
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14499
        _Fields fields = findByThriftId(fieldId);
14500
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14501
        return fields;
14502
      }
14503
 
14504
      /**
14505
       * Find the _Fields constant that matches name, or null if its not found.
14506
       */
14507
      public static _Fields findByName(String name) {
14508
        return byName.get(name);
14509
      }
14510
 
14511
      private final short _thriftId;
14512
      private final String _fieldName;
14513
 
14514
      _Fields(short thriftId, String fieldName) {
14515
        _thriftId = thriftId;
14516
        _fieldName = fieldName;
14517
      }
14518
 
14519
      public short getThriftFieldId() {
14520
        return _thriftId;
14521
      }
14522
 
14523
      public String getFieldName() {
14524
        return _fieldName;
14525
      }
14526
    }
14527
 
14528
    // isset id assignments
14529
    private static final int __PROMOTIONID_ISSET_ID = 0;
8707 manish.sha 14530
    private static final int __COUPONCATEGORY_ISSET_ID = 1;
14531
    private static final int __ISCOD_ISSET_ID = 2;
14532
    private BitSet __isset_bit_vector = new BitSet(3);
6250 amit.gupta 14533
 
14534
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
14535
    static {
14536
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
14537
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14538
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8707 manish.sha 14539
      tmpMap.put(_Fields.COUPON_CATEGORY, new org.apache.thrift.meta_data.FieldMetaData("couponCategory", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14540
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6730 anupam.sin 14541
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14542
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6679 anupam.sin 14543
      tmpMap.put(_Fields.ARGUMENTS, new org.apache.thrift.meta_data.FieldMetaData("arguments", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6250 amit.gupta 14544
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6356 amit.gupta 14545
      tmpMap.put(_Fields.IS_COD, new org.apache.thrift.meta_data.FieldMetaData("isCod", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14546
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
6561 amit.gupta 14547
      tmpMap.put(_Fields.PREFIX, new org.apache.thrift.meta_data.FieldMetaData("prefix", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14548
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6250 amit.gupta 14549
      metaDataMap = Collections.unmodifiableMap(tmpMap);
14550
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_args.class, metaDataMap);
14551
    }
14552
 
14553
    public createCoupon_args() {
14554
    }
14555
 
14556
    public createCoupon_args(
14557
      long promotionId,
8707 manish.sha 14558
      long couponCategory,
6730 anupam.sin 14559
      String couponCode,
6679 anupam.sin 14560
      String arguments,
6356 amit.gupta 14561
      boolean isCod,
6561 amit.gupta 14562
      String prefix)
6250 amit.gupta 14563
    {
14564
      this();
14565
      this.promotionId = promotionId;
14566
      setPromotionIdIsSet(true);
8707 manish.sha 14567
      this.couponCategory = couponCategory;
14568
      setCouponCategoryIsSet(true);
6730 anupam.sin 14569
      this.couponCode = couponCode;
6679 anupam.sin 14570
      this.arguments = arguments;
6356 amit.gupta 14571
      this.isCod = isCod;
14572
      setIsCodIsSet(true);
6561 amit.gupta 14573
      this.prefix = prefix;
6250 amit.gupta 14574
    }
14575
 
14576
    /**
14577
     * Performs a deep copy on <i>other</i>.
14578
     */
14579
    public createCoupon_args(createCoupon_args other) {
14580
      __isset_bit_vector.clear();
14581
      __isset_bit_vector.or(other.__isset_bit_vector);
14582
      this.promotionId = other.promotionId;
8707 manish.sha 14583
      this.couponCategory = other.couponCategory;
6730 anupam.sin 14584
      if (other.isSetCouponCode()) {
14585
        this.couponCode = other.couponCode;
14586
      }
6679 anupam.sin 14587
      if (other.isSetArguments()) {
14588
        this.arguments = other.arguments;
6250 amit.gupta 14589
      }
6356 amit.gupta 14590
      this.isCod = other.isCod;
6561 amit.gupta 14591
      if (other.isSetPrefix()) {
14592
        this.prefix = other.prefix;
14593
      }
6250 amit.gupta 14594
    }
14595
 
14596
    public createCoupon_args deepCopy() {
14597
      return new createCoupon_args(this);
14598
    }
14599
 
14600
    @Override
14601
    public void clear() {
14602
      setPromotionIdIsSet(false);
14603
      this.promotionId = 0;
8707 manish.sha 14604
      setCouponCategoryIsSet(false);
14605
      this.couponCategory = 0;
6730 anupam.sin 14606
      this.couponCode = null;
6679 anupam.sin 14607
      this.arguments = null;
6356 amit.gupta 14608
      setIsCodIsSet(false);
14609
      this.isCod = false;
6561 amit.gupta 14610
      this.prefix = null;
6250 amit.gupta 14611
    }
14612
 
14613
    public long getPromotionId() {
14614
      return this.promotionId;
14615
    }
14616
 
14617
    public void setPromotionId(long promotionId) {
14618
      this.promotionId = promotionId;
14619
      setPromotionIdIsSet(true);
14620
    }
14621
 
14622
    public void unsetPromotionId() {
14623
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
14624
    }
14625
 
14626
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
14627
    public boolean isSetPromotionId() {
14628
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
14629
    }
14630
 
14631
    public void setPromotionIdIsSet(boolean value) {
14632
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
14633
    }
14634
 
8707 manish.sha 14635
    public long getCouponCategory() {
14636
      return this.couponCategory;
14637
    }
14638
 
14639
    public void setCouponCategory(long couponCategory) {
14640
      this.couponCategory = couponCategory;
14641
      setCouponCategoryIsSet(true);
14642
    }
14643
 
14644
    public void unsetCouponCategory() {
14645
      __isset_bit_vector.clear(__COUPONCATEGORY_ISSET_ID);
14646
    }
14647
 
14648
    /** Returns true if field couponCategory is set (has been assigned a value) and false otherwise */
14649
    public boolean isSetCouponCategory() {
14650
      return __isset_bit_vector.get(__COUPONCATEGORY_ISSET_ID);
14651
    }
14652
 
14653
    public void setCouponCategoryIsSet(boolean value) {
14654
      __isset_bit_vector.set(__COUPONCATEGORY_ISSET_ID, value);
14655
    }
14656
 
6730 anupam.sin 14657
    public String getCouponCode() {
14658
      return this.couponCode;
14659
    }
14660
 
14661
    public void setCouponCode(String couponCode) {
14662
      this.couponCode = couponCode;
14663
    }
14664
 
14665
    public void unsetCouponCode() {
14666
      this.couponCode = null;
14667
    }
14668
 
14669
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
14670
    public boolean isSetCouponCode() {
14671
      return this.couponCode != null;
14672
    }
14673
 
14674
    public void setCouponCodeIsSet(boolean value) {
14675
      if (!value) {
14676
        this.couponCode = null;
14677
      }
14678
    }
14679
 
6679 anupam.sin 14680
    public String getArguments() {
14681
      return this.arguments;
6250 amit.gupta 14682
    }
14683
 
6679 anupam.sin 14684
    public void setArguments(String arguments) {
14685
      this.arguments = arguments;
6250 amit.gupta 14686
    }
14687
 
6679 anupam.sin 14688
    public void unsetArguments() {
14689
      this.arguments = null;
6250 amit.gupta 14690
    }
14691
 
6679 anupam.sin 14692
    /** Returns true if field arguments is set (has been assigned a value) and false otherwise */
14693
    public boolean isSetArguments() {
14694
      return this.arguments != null;
6250 amit.gupta 14695
    }
14696
 
6679 anupam.sin 14697
    public void setArgumentsIsSet(boolean value) {
6250 amit.gupta 14698
      if (!value) {
6679 anupam.sin 14699
        this.arguments = null;
6250 amit.gupta 14700
      }
14701
    }
14702
 
6356 amit.gupta 14703
    public boolean isIsCod() {
14704
      return this.isCod;
14705
    }
14706
 
14707
    public void setIsCod(boolean isCod) {
14708
      this.isCod = isCod;
14709
      setIsCodIsSet(true);
14710
    }
14711
 
14712
    public void unsetIsCod() {
14713
      __isset_bit_vector.clear(__ISCOD_ISSET_ID);
14714
    }
14715
 
14716
    /** Returns true if field isCod is set (has been assigned a value) and false otherwise */
14717
    public boolean isSetIsCod() {
14718
      return __isset_bit_vector.get(__ISCOD_ISSET_ID);
14719
    }
14720
 
14721
    public void setIsCodIsSet(boolean value) {
14722
      __isset_bit_vector.set(__ISCOD_ISSET_ID, value);
14723
    }
14724
 
6561 amit.gupta 14725
    public String getPrefix() {
14726
      return this.prefix;
14727
    }
14728
 
14729
    public void setPrefix(String prefix) {
14730
      this.prefix = prefix;
14731
    }
14732
 
14733
    public void unsetPrefix() {
14734
      this.prefix = null;
14735
    }
14736
 
14737
    /** Returns true if field prefix is set (has been assigned a value) and false otherwise */
14738
    public boolean isSetPrefix() {
14739
      return this.prefix != null;
14740
    }
14741
 
14742
    public void setPrefixIsSet(boolean value) {
14743
      if (!value) {
14744
        this.prefix = null;
14745
      }
14746
    }
14747
 
6250 amit.gupta 14748
    public void setFieldValue(_Fields field, Object value) {
14749
      switch (field) {
14750
      case PROMOTION_ID:
14751
        if (value == null) {
14752
          unsetPromotionId();
14753
        } else {
14754
          setPromotionId((Long)value);
14755
        }
14756
        break;
14757
 
8707 manish.sha 14758
      case COUPON_CATEGORY:
14759
        if (value == null) {
14760
          unsetCouponCategory();
14761
        } else {
14762
          setCouponCategory((Long)value);
14763
        }
14764
        break;
14765
 
6730 anupam.sin 14766
      case COUPON_CODE:
14767
        if (value == null) {
14768
          unsetCouponCode();
14769
        } else {
14770
          setCouponCode((String)value);
14771
        }
14772
        break;
14773
 
6679 anupam.sin 14774
      case ARGUMENTS:
6250 amit.gupta 14775
        if (value == null) {
6679 anupam.sin 14776
          unsetArguments();
6250 amit.gupta 14777
        } else {
6679 anupam.sin 14778
          setArguments((String)value);
6250 amit.gupta 14779
        }
14780
        break;
14781
 
6356 amit.gupta 14782
      case IS_COD:
14783
        if (value == null) {
14784
          unsetIsCod();
14785
        } else {
14786
          setIsCod((Boolean)value);
14787
        }
14788
        break;
14789
 
6561 amit.gupta 14790
      case PREFIX:
14791
        if (value == null) {
14792
          unsetPrefix();
14793
        } else {
14794
          setPrefix((String)value);
14795
        }
14796
        break;
14797
 
6250 amit.gupta 14798
      }
14799
    }
14800
 
14801
    public Object getFieldValue(_Fields field) {
14802
      switch (field) {
14803
      case PROMOTION_ID:
14804
        return Long.valueOf(getPromotionId());
14805
 
8707 manish.sha 14806
      case COUPON_CATEGORY:
14807
        return Long.valueOf(getCouponCategory());
14808
 
6730 anupam.sin 14809
      case COUPON_CODE:
14810
        return getCouponCode();
14811
 
6679 anupam.sin 14812
      case ARGUMENTS:
14813
        return getArguments();
6250 amit.gupta 14814
 
6356 amit.gupta 14815
      case IS_COD:
14816
        return Boolean.valueOf(isIsCod());
14817
 
6561 amit.gupta 14818
      case PREFIX:
14819
        return getPrefix();
14820
 
6250 amit.gupta 14821
      }
14822
      throw new IllegalStateException();
14823
    }
14824
 
14825
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14826
    public boolean isSet(_Fields field) {
14827
      if (field == null) {
14828
        throw new IllegalArgumentException();
14829
      }
14830
 
14831
      switch (field) {
14832
      case PROMOTION_ID:
14833
        return isSetPromotionId();
8707 manish.sha 14834
      case COUPON_CATEGORY:
14835
        return isSetCouponCategory();
6730 anupam.sin 14836
      case COUPON_CODE:
14837
        return isSetCouponCode();
6679 anupam.sin 14838
      case ARGUMENTS:
14839
        return isSetArguments();
6356 amit.gupta 14840
      case IS_COD:
14841
        return isSetIsCod();
6561 amit.gupta 14842
      case PREFIX:
14843
        return isSetPrefix();
6250 amit.gupta 14844
      }
14845
      throw new IllegalStateException();
14846
    }
14847
 
14848
    @Override
14849
    public boolean equals(Object that) {
14850
      if (that == null)
14851
        return false;
14852
      if (that instanceof createCoupon_args)
14853
        return this.equals((createCoupon_args)that);
14854
      return false;
14855
    }
14856
 
14857
    public boolean equals(createCoupon_args that) {
14858
      if (that == null)
14859
        return false;
14860
 
14861
      boolean this_present_promotionId = true;
14862
      boolean that_present_promotionId = true;
14863
      if (this_present_promotionId || that_present_promotionId) {
14864
        if (!(this_present_promotionId && that_present_promotionId))
14865
          return false;
14866
        if (this.promotionId != that.promotionId)
14867
          return false;
14868
      }
14869
 
8707 manish.sha 14870
      boolean this_present_couponCategory = true;
14871
      boolean that_present_couponCategory = true;
14872
      if (this_present_couponCategory || that_present_couponCategory) {
14873
        if (!(this_present_couponCategory && that_present_couponCategory))
14874
          return false;
14875
        if (this.couponCategory != that.couponCategory)
14876
          return false;
14877
      }
14878
 
6730 anupam.sin 14879
      boolean this_present_couponCode = true && this.isSetCouponCode();
14880
      boolean that_present_couponCode = true && that.isSetCouponCode();
14881
      if (this_present_couponCode || that_present_couponCode) {
14882
        if (!(this_present_couponCode && that_present_couponCode))
14883
          return false;
14884
        if (!this.couponCode.equals(that.couponCode))
14885
          return false;
14886
      }
14887
 
6679 anupam.sin 14888
      boolean this_present_arguments = true && this.isSetArguments();
14889
      boolean that_present_arguments = true && that.isSetArguments();
14890
      if (this_present_arguments || that_present_arguments) {
14891
        if (!(this_present_arguments && that_present_arguments))
6250 amit.gupta 14892
          return false;
6679 anupam.sin 14893
        if (!this.arguments.equals(that.arguments))
6250 amit.gupta 14894
          return false;
14895
      }
14896
 
6356 amit.gupta 14897
      boolean this_present_isCod = true;
14898
      boolean that_present_isCod = true;
14899
      if (this_present_isCod || that_present_isCod) {
14900
        if (!(this_present_isCod && that_present_isCod))
14901
          return false;
14902
        if (this.isCod != that.isCod)
14903
          return false;
14904
      }
14905
 
6561 amit.gupta 14906
      boolean this_present_prefix = true && this.isSetPrefix();
14907
      boolean that_present_prefix = true && that.isSetPrefix();
14908
      if (this_present_prefix || that_present_prefix) {
14909
        if (!(this_present_prefix && that_present_prefix))
14910
          return false;
14911
        if (!this.prefix.equals(that.prefix))
14912
          return false;
14913
      }
14914
 
6250 amit.gupta 14915
      return true;
14916
    }
14917
 
14918
    @Override
14919
    public int hashCode() {
14920
      return 0;
14921
    }
14922
 
14923
    public int compareTo(createCoupon_args other) {
14924
      if (!getClass().equals(other.getClass())) {
14925
        return getClass().getName().compareTo(other.getClass().getName());
14926
      }
14927
 
14928
      int lastComparison = 0;
14929
      createCoupon_args typedOther = (createCoupon_args)other;
14930
 
14931
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
14932
      if (lastComparison != 0) {
14933
        return lastComparison;
14934
      }
14935
      if (isSetPromotionId()) {
14936
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
14937
        if (lastComparison != 0) {
14938
          return lastComparison;
14939
        }
14940
      }
8707 manish.sha 14941
      lastComparison = Boolean.valueOf(isSetCouponCategory()).compareTo(typedOther.isSetCouponCategory());
14942
      if (lastComparison != 0) {
14943
        return lastComparison;
14944
      }
14945
      if (isSetCouponCategory()) {
14946
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCategory, typedOther.couponCategory);
14947
        if (lastComparison != 0) {
14948
          return lastComparison;
14949
        }
14950
      }
6730 anupam.sin 14951
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
14952
      if (lastComparison != 0) {
14953
        return lastComparison;
14954
      }
14955
      if (isSetCouponCode()) {
14956
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
14957
        if (lastComparison != 0) {
14958
          return lastComparison;
14959
        }
14960
      }
6679 anupam.sin 14961
      lastComparison = Boolean.valueOf(isSetArguments()).compareTo(typedOther.isSetArguments());
6250 amit.gupta 14962
      if (lastComparison != 0) {
14963
        return lastComparison;
14964
      }
6679 anupam.sin 14965
      if (isSetArguments()) {
14966
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.arguments, typedOther.arguments);
6250 amit.gupta 14967
        if (lastComparison != 0) {
14968
          return lastComparison;
14969
        }
14970
      }
6356 amit.gupta 14971
      lastComparison = Boolean.valueOf(isSetIsCod()).compareTo(typedOther.isSetIsCod());
14972
      if (lastComparison != 0) {
14973
        return lastComparison;
14974
      }
14975
      if (isSetIsCod()) {
14976
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isCod, typedOther.isCod);
14977
        if (lastComparison != 0) {
14978
          return lastComparison;
14979
        }
14980
      }
6561 amit.gupta 14981
      lastComparison = Boolean.valueOf(isSetPrefix()).compareTo(typedOther.isSetPrefix());
14982
      if (lastComparison != 0) {
14983
        return lastComparison;
14984
      }
14985
      if (isSetPrefix()) {
14986
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.prefix, typedOther.prefix);
14987
        if (lastComparison != 0) {
14988
          return lastComparison;
14989
        }
14990
      }
6250 amit.gupta 14991
      return 0;
14992
    }
14993
 
14994
    public _Fields fieldForId(int fieldId) {
14995
      return _Fields.findByThriftId(fieldId);
14996
    }
14997
 
14998
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14999
      org.apache.thrift.protocol.TField field;
15000
      iprot.readStructBegin();
15001
      while (true)
15002
      {
15003
        field = iprot.readFieldBegin();
15004
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
15005
          break;
15006
        }
15007
        switch (field.id) {
15008
          case 1: // PROMOTION_ID
15009
            if (field.type == org.apache.thrift.protocol.TType.I64) {
15010
              this.promotionId = iprot.readI64();
15011
              setPromotionIdIsSet(true);
15012
            } else { 
15013
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15014
            }
15015
            break;
8707 manish.sha 15016
          case 2: // COUPON_CATEGORY
15017
            if (field.type == org.apache.thrift.protocol.TType.I64) {
15018
              this.couponCategory = iprot.readI64();
15019
              setCouponCategoryIsSet(true);
15020
            } else { 
15021
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15022
            }
15023
            break;
15024
          case 3: // COUPON_CODE
6250 amit.gupta 15025
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
6730 anupam.sin 15026
              this.couponCode = iprot.readString();
15027
            } else { 
15028
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15029
            }
15030
            break;
8707 manish.sha 15031
          case 4: // ARGUMENTS
6730 anupam.sin 15032
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
6679 anupam.sin 15033
              this.arguments = iprot.readString();
6250 amit.gupta 15034
            } else { 
15035
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15036
            }
15037
            break;
8707 manish.sha 15038
          case 5: // IS_COD
6356 amit.gupta 15039
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
15040
              this.isCod = iprot.readBool();
15041
              setIsCodIsSet(true);
15042
            } else { 
15043
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15044
            }
15045
            break;
8707 manish.sha 15046
          case 6: // PREFIX
6561 amit.gupta 15047
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
15048
              this.prefix = iprot.readString();
15049
            } else { 
15050
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15051
            }
15052
            break;
6250 amit.gupta 15053
          default:
15054
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15055
        }
15056
        iprot.readFieldEnd();
15057
      }
15058
      iprot.readStructEnd();
15059
      validate();
15060
    }
15061
 
15062
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
15063
      validate();
15064
 
15065
      oprot.writeStructBegin(STRUCT_DESC);
15066
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
15067
      oprot.writeI64(this.promotionId);
15068
      oprot.writeFieldEnd();
8707 manish.sha 15069
      oprot.writeFieldBegin(COUPON_CATEGORY_FIELD_DESC);
15070
      oprot.writeI64(this.couponCategory);
15071
      oprot.writeFieldEnd();
6730 anupam.sin 15072
      if (this.couponCode != null) {
15073
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
15074
        oprot.writeString(this.couponCode);
15075
        oprot.writeFieldEnd();
15076
      }
6679 anupam.sin 15077
      if (this.arguments != null) {
15078
        oprot.writeFieldBegin(ARGUMENTS_FIELD_DESC);
15079
        oprot.writeString(this.arguments);
6250 amit.gupta 15080
        oprot.writeFieldEnd();
15081
      }
6356 amit.gupta 15082
      oprot.writeFieldBegin(IS_COD_FIELD_DESC);
15083
      oprot.writeBool(this.isCod);
15084
      oprot.writeFieldEnd();
6561 amit.gupta 15085
      if (this.prefix != null) {
15086
        oprot.writeFieldBegin(PREFIX_FIELD_DESC);
15087
        oprot.writeString(this.prefix);
15088
        oprot.writeFieldEnd();
15089
      }
6250 amit.gupta 15090
      oprot.writeFieldStop();
15091
      oprot.writeStructEnd();
15092
    }
15093
 
15094
    @Override
15095
    public String toString() {
15096
      StringBuilder sb = new StringBuilder("createCoupon_args(");
15097
      boolean first = true;
15098
 
15099
      sb.append("promotionId:");
15100
      sb.append(this.promotionId);
15101
      first = false;
15102
      if (!first) sb.append(", ");
8707 manish.sha 15103
      sb.append("couponCategory:");
15104
      sb.append(this.couponCategory);
15105
      first = false;
15106
      if (!first) sb.append(", ");
6730 anupam.sin 15107
      sb.append("couponCode:");
15108
      if (this.couponCode == null) {
15109
        sb.append("null");
15110
      } else {
15111
        sb.append(this.couponCode);
15112
      }
15113
      first = false;
15114
      if (!first) sb.append(", ");
6679 anupam.sin 15115
      sb.append("arguments:");
15116
      if (this.arguments == null) {
6250 amit.gupta 15117
        sb.append("null");
15118
      } else {
6679 anupam.sin 15119
        sb.append(this.arguments);
6250 amit.gupta 15120
      }
15121
      first = false;
15122
      if (!first) sb.append(", ");
6356 amit.gupta 15123
      sb.append("isCod:");
15124
      sb.append(this.isCod);
15125
      first = false;
15126
      if (!first) sb.append(", ");
6561 amit.gupta 15127
      sb.append("prefix:");
15128
      if (this.prefix == null) {
15129
        sb.append("null");
15130
      } else {
15131
        sb.append(this.prefix);
15132
      }
15133
      first = false;
6250 amit.gupta 15134
      sb.append(")");
15135
      return sb.toString();
15136
    }
15137
 
15138
    public void validate() throws org.apache.thrift.TException {
15139
      // check for required fields
15140
    }
15141
 
15142
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15143
      try {
15144
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15145
      } catch (org.apache.thrift.TException te) {
15146
        throw new java.io.IOException(te);
15147
      }
15148
    }
15149
 
15150
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15151
      try {
15152
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15153
      } catch (org.apache.thrift.TException te) {
15154
        throw new java.io.IOException(te);
15155
      }
15156
    }
15157
 
15158
  }
15159
 
15160
  public static class createCoupon_result implements org.apache.thrift.TBase<createCoupon_result, createCoupon_result._Fields>, java.io.Serializable, Cloneable   {
15161
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_result");
15162
 
15163
    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);
15164
    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);
15165
 
15166
    private String success; // required
15167
    private PromotionException pex; // required
15168
 
15169
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
15170
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
15171
      SUCCESS((short)0, "success"),
15172
      PEX((short)1, "pex");
15173
 
15174
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15175
 
15176
      static {
15177
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15178
          byName.put(field.getFieldName(), field);
15179
        }
15180
      }
15181
 
15182
      /**
15183
       * Find the _Fields constant that matches fieldId, or null if its not found.
15184
       */
15185
      public static _Fields findByThriftId(int fieldId) {
15186
        switch(fieldId) {
15187
          case 0: // SUCCESS
15188
            return SUCCESS;
15189
          case 1: // PEX
15190
            return PEX;
15191
          default:
15192
            return null;
15193
        }
15194
      }
15195
 
15196
      /**
15197
       * Find the _Fields constant that matches fieldId, throwing an exception
15198
       * if it is not found.
15199
       */
15200
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15201
        _Fields fields = findByThriftId(fieldId);
15202
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15203
        return fields;
15204
      }
15205
 
15206
      /**
15207
       * Find the _Fields constant that matches name, or null if its not found.
15208
       */
15209
      public static _Fields findByName(String name) {
15210
        return byName.get(name);
15211
      }
15212
 
15213
      private final short _thriftId;
15214
      private final String _fieldName;
15215
 
15216
      _Fields(short thriftId, String fieldName) {
15217
        _thriftId = thriftId;
15218
        _fieldName = fieldName;
15219
      }
15220
 
15221
      public short getThriftFieldId() {
15222
        return _thriftId;
15223
      }
15224
 
15225
      public String getFieldName() {
15226
        return _fieldName;
15227
      }
15228
    }
15229
 
15230
    // isset id assignments
15231
 
15232
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
15233
    static {
15234
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15235
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15236
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
15237
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15238
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
15239
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15240
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_result.class, metaDataMap);
15241
    }
15242
 
15243
    public createCoupon_result() {
15244
    }
15245
 
15246
    public createCoupon_result(
15247
      String success,
15248
      PromotionException pex)
15249
    {
15250
      this();
15251
      this.success = success;
15252
      this.pex = pex;
15253
    }
15254
 
15255
    /**
15256
     * Performs a deep copy on <i>other</i>.
15257
     */
15258
    public createCoupon_result(createCoupon_result other) {
15259
      if (other.isSetSuccess()) {
15260
        this.success = other.success;
15261
      }
15262
      if (other.isSetPex()) {
15263
        this.pex = new PromotionException(other.pex);
15264
      }
15265
    }
15266
 
15267
    public createCoupon_result deepCopy() {
15268
      return new createCoupon_result(this);
15269
    }
15270
 
15271
    @Override
15272
    public void clear() {
15273
      this.success = null;
15274
      this.pex = null;
15275
    }
15276
 
15277
    public String getSuccess() {
15278
      return this.success;
15279
    }
15280
 
15281
    public void setSuccess(String success) {
15282
      this.success = success;
15283
    }
15284
 
15285
    public void unsetSuccess() {
15286
      this.success = null;
15287
    }
15288
 
15289
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
15290
    public boolean isSetSuccess() {
15291
      return this.success != null;
15292
    }
15293
 
15294
    public void setSuccessIsSet(boolean value) {
15295
      if (!value) {
15296
        this.success = null;
15297
      }
15298
    }
15299
 
15300
    public PromotionException getPex() {
15301
      return this.pex;
15302
    }
15303
 
15304
    public void setPex(PromotionException pex) {
15305
      this.pex = pex;
15306
    }
15307
 
15308
    public void unsetPex() {
15309
      this.pex = null;
15310
    }
15311
 
15312
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
15313
    public boolean isSetPex() {
15314
      return this.pex != null;
15315
    }
15316
 
15317
    public void setPexIsSet(boolean value) {
15318
      if (!value) {
15319
        this.pex = null;
15320
      }
15321
    }
15322
 
15323
    public void setFieldValue(_Fields field, Object value) {
15324
      switch (field) {
15325
      case SUCCESS:
15326
        if (value == null) {
15327
          unsetSuccess();
15328
        } else {
15329
          setSuccess((String)value);
15330
        }
15331
        break;
15332
 
15333
      case PEX:
15334
        if (value == null) {
15335
          unsetPex();
15336
        } else {
15337
          setPex((PromotionException)value);
15338
        }
15339
        break;
15340
 
15341
      }
15342
    }
15343
 
15344
    public Object getFieldValue(_Fields field) {
15345
      switch (field) {
15346
      case SUCCESS:
15347
        return getSuccess();
15348
 
15349
      case PEX:
15350
        return getPex();
15351
 
15352
      }
15353
      throw new IllegalStateException();
15354
    }
15355
 
15356
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15357
    public boolean isSet(_Fields field) {
15358
      if (field == null) {
15359
        throw new IllegalArgumentException();
15360
      }
15361
 
15362
      switch (field) {
15363
      case SUCCESS:
15364
        return isSetSuccess();
15365
      case PEX:
15366
        return isSetPex();
15367
      }
15368
      throw new IllegalStateException();
15369
    }
15370
 
15371
    @Override
15372
    public boolean equals(Object that) {
15373
      if (that == null)
15374
        return false;
15375
      if (that instanceof createCoupon_result)
15376
        return this.equals((createCoupon_result)that);
15377
      return false;
15378
    }
15379
 
15380
    public boolean equals(createCoupon_result that) {
15381
      if (that == null)
15382
        return false;
15383
 
15384
      boolean this_present_success = true && this.isSetSuccess();
15385
      boolean that_present_success = true && that.isSetSuccess();
15386
      if (this_present_success || that_present_success) {
15387
        if (!(this_present_success && that_present_success))
15388
          return false;
15389
        if (!this.success.equals(that.success))
15390
          return false;
15391
      }
15392
 
15393
      boolean this_present_pex = true && this.isSetPex();
15394
      boolean that_present_pex = true && that.isSetPex();
15395
      if (this_present_pex || that_present_pex) {
15396
        if (!(this_present_pex && that_present_pex))
15397
          return false;
15398
        if (!this.pex.equals(that.pex))
15399
          return false;
15400
      }
15401
 
15402
      return true;
15403
    }
15404
 
15405
    @Override
15406
    public int hashCode() {
15407
      return 0;
15408
    }
15409
 
15410
    public int compareTo(createCoupon_result other) {
15411
      if (!getClass().equals(other.getClass())) {
15412
        return getClass().getName().compareTo(other.getClass().getName());
15413
      }
15414
 
15415
      int lastComparison = 0;
15416
      createCoupon_result typedOther = (createCoupon_result)other;
15417
 
15418
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
15419
      if (lastComparison != 0) {
15420
        return lastComparison;
15421
      }
15422
      if (isSetSuccess()) {
15423
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
15424
        if (lastComparison != 0) {
15425
          return lastComparison;
15426
        }
15427
      }
15428
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
15429
      if (lastComparison != 0) {
15430
        return lastComparison;
15431
      }
15432
      if (isSetPex()) {
15433
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
15434
        if (lastComparison != 0) {
15435
          return lastComparison;
15436
        }
15437
      }
15438
      return 0;
15439
    }
15440
 
15441
    public _Fields fieldForId(int fieldId) {
15442
      return _Fields.findByThriftId(fieldId);
15443
    }
15444
 
15445
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15446
      org.apache.thrift.protocol.TField field;
15447
      iprot.readStructBegin();
15448
      while (true)
15449
      {
15450
        field = iprot.readFieldBegin();
15451
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
15452
          break;
15453
        }
15454
        switch (field.id) {
15455
          case 0: // SUCCESS
15456
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
15457
              this.success = iprot.readString();
15458
            } else { 
15459
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15460
            }
15461
            break;
15462
          case 1: // PEX
15463
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
15464
              this.pex = new PromotionException();
15465
              this.pex.read(iprot);
15466
            } else { 
15467
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15468
            }
15469
            break;
15470
          default:
15471
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15472
        }
15473
        iprot.readFieldEnd();
15474
      }
15475
      iprot.readStructEnd();
15476
      validate();
15477
    }
15478
 
15479
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
15480
      oprot.writeStructBegin(STRUCT_DESC);
15481
 
15482
      if (this.isSetSuccess()) {
15483
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
15484
        oprot.writeString(this.success);
15485
        oprot.writeFieldEnd();
15486
      } else if (this.isSetPex()) {
15487
        oprot.writeFieldBegin(PEX_FIELD_DESC);
15488
        this.pex.write(oprot);
15489
        oprot.writeFieldEnd();
15490
      }
15491
      oprot.writeFieldStop();
15492
      oprot.writeStructEnd();
15493
    }
15494
 
15495
    @Override
15496
    public String toString() {
15497
      StringBuilder sb = new StringBuilder("createCoupon_result(");
15498
      boolean first = true;
15499
 
15500
      sb.append("success:");
15501
      if (this.success == null) {
15502
        sb.append("null");
15503
      } else {
15504
        sb.append(this.success);
15505
      }
15506
      first = false;
15507
      if (!first) sb.append(", ");
15508
      sb.append("pex:");
15509
      if (this.pex == null) {
15510
        sb.append("null");
15511
      } else {
15512
        sb.append(this.pex);
15513
      }
15514
      first = false;
15515
      sb.append(")");
15516
      return sb.toString();
15517
    }
15518
 
15519
    public void validate() throws org.apache.thrift.TException {
15520
      // check for required fields
15521
    }
15522
 
15523
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15524
      try {
15525
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15526
      } catch (org.apache.thrift.TException te) {
15527
        throw new java.io.IOException(te);
15528
      }
15529
    }
15530
 
15531
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15532
      try {
15533
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15534
      } catch (org.apache.thrift.TException te) {
15535
        throw new java.io.IOException(te);
15536
      }
15537
    }
15538
 
15539
  }
15540
 
3430 rajveer 15541
  public static class getSuccessfulPaymentCountForCoupon_args implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_args, getSuccessfulPaymentCountForCoupon_args._Fields>, java.io.Serializable, Cloneable   {
15542
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_args");
3385 varun.gupt 15543
 
3430 rajveer 15544
    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 15545
 
3430 rajveer 15546
    private String couponCode; // required
3385 varun.gupt 15547
 
15548
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 15549
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 15550
      COUPON_CODE((short)1, "couponCode");
15551
 
15552
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15553
 
15554
      static {
15555
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15556
          byName.put(field.getFieldName(), field);
15557
        }
15558
      }
15559
 
15560
      /**
15561
       * Find the _Fields constant that matches fieldId, or null if its not found.
15562
       */
15563
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 15564
        switch(fieldId) {
15565
          case 1: // COUPON_CODE
15566
            return COUPON_CODE;
15567
          default:
15568
            return null;
15569
        }
3385 varun.gupt 15570
      }
15571
 
15572
      /**
15573
       * Find the _Fields constant that matches fieldId, throwing an exception
15574
       * if it is not found.
15575
       */
15576
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15577
        _Fields fields = findByThriftId(fieldId);
15578
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15579
        return fields;
15580
      }
15581
 
15582
      /**
15583
       * Find the _Fields constant that matches name, or null if its not found.
15584
       */
15585
      public static _Fields findByName(String name) {
15586
        return byName.get(name);
15587
      }
15588
 
15589
      private final short _thriftId;
15590
      private final String _fieldName;
15591
 
15592
      _Fields(short thriftId, String fieldName) {
15593
        _thriftId = thriftId;
15594
        _fieldName = fieldName;
15595
      }
15596
 
15597
      public short getThriftFieldId() {
15598
        return _thriftId;
15599
      }
15600
 
15601
      public String getFieldName() {
15602
        return _fieldName;
15603
      }
15604
    }
15605
 
15606
    // isset id assignments
15607
 
3430 rajveer 15608
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 15609
    static {
3430 rajveer 15610
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15611
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15612
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
15613
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15614
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_args.class, metaDataMap);
3385 varun.gupt 15615
    }
15616
 
15617
    public getSuccessfulPaymentCountForCoupon_args() {
15618
    }
15619
 
15620
    public getSuccessfulPaymentCountForCoupon_args(
15621
      String couponCode)
15622
    {
15623
      this();
15624
      this.couponCode = couponCode;
15625
    }
15626
 
15627
    /**
15628
     * Performs a deep copy on <i>other</i>.
15629
     */
15630
    public getSuccessfulPaymentCountForCoupon_args(getSuccessfulPaymentCountForCoupon_args other) {
15631
      if (other.isSetCouponCode()) {
15632
        this.couponCode = other.couponCode;
15633
      }
15634
    }
15635
 
15636
    public getSuccessfulPaymentCountForCoupon_args deepCopy() {
15637
      return new getSuccessfulPaymentCountForCoupon_args(this);
15638
    }
15639
 
3430 rajveer 15640
    @Override
15641
    public void clear() {
15642
      this.couponCode = null;
3385 varun.gupt 15643
    }
15644
 
15645
    public String getCouponCode() {
15646
      return this.couponCode;
15647
    }
15648
 
3430 rajveer 15649
    public void setCouponCode(String couponCode) {
3385 varun.gupt 15650
      this.couponCode = couponCode;
15651
    }
15652
 
15653
    public void unsetCouponCode() {
15654
      this.couponCode = null;
15655
    }
15656
 
3430 rajveer 15657
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3385 varun.gupt 15658
    public boolean isSetCouponCode() {
15659
      return this.couponCode != null;
15660
    }
15661
 
15662
    public void setCouponCodeIsSet(boolean value) {
15663
      if (!value) {
15664
        this.couponCode = null;
15665
      }
15666
    }
15667
 
15668
    public void setFieldValue(_Fields field, Object value) {
15669
      switch (field) {
15670
      case COUPON_CODE:
15671
        if (value == null) {
15672
          unsetCouponCode();
15673
        } else {
15674
          setCouponCode((String)value);
15675
        }
15676
        break;
15677
 
15678
      }
15679
    }
15680
 
15681
    public Object getFieldValue(_Fields field) {
15682
      switch (field) {
15683
      case COUPON_CODE:
15684
        return getCouponCode();
15685
 
15686
      }
15687
      throw new IllegalStateException();
15688
    }
15689
 
3430 rajveer 15690
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15691
    public boolean isSet(_Fields field) {
15692
      if (field == null) {
15693
        throw new IllegalArgumentException();
15694
      }
3385 varun.gupt 15695
 
15696
      switch (field) {
15697
      case COUPON_CODE:
15698
        return isSetCouponCode();
15699
      }
15700
      throw new IllegalStateException();
15701
    }
15702
 
15703
    @Override
15704
    public boolean equals(Object that) {
15705
      if (that == null)
15706
        return false;
15707
      if (that instanceof getSuccessfulPaymentCountForCoupon_args)
15708
        return this.equals((getSuccessfulPaymentCountForCoupon_args)that);
15709
      return false;
15710
    }
15711
 
15712
    public boolean equals(getSuccessfulPaymentCountForCoupon_args that) {
15713
      if (that == null)
15714
        return false;
15715
 
15716
      boolean this_present_couponCode = true && this.isSetCouponCode();
15717
      boolean that_present_couponCode = true && that.isSetCouponCode();
15718
      if (this_present_couponCode || that_present_couponCode) {
15719
        if (!(this_present_couponCode && that_present_couponCode))
15720
          return false;
15721
        if (!this.couponCode.equals(that.couponCode))
15722
          return false;
15723
      }
15724
 
15725
      return true;
15726
    }
15727
 
15728
    @Override
15729
    public int hashCode() {
15730
      return 0;
15731
    }
15732
 
15733
    public int compareTo(getSuccessfulPaymentCountForCoupon_args other) {
15734
      if (!getClass().equals(other.getClass())) {
15735
        return getClass().getName().compareTo(other.getClass().getName());
15736
      }
15737
 
15738
      int lastComparison = 0;
15739
      getSuccessfulPaymentCountForCoupon_args typedOther = (getSuccessfulPaymentCountForCoupon_args)other;
15740
 
3430 rajveer 15741
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3385 varun.gupt 15742
      if (lastComparison != 0) {
15743
        return lastComparison;
15744
      }
3430 rajveer 15745
      if (isSetCouponCode()) {
15746
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
15747
        if (lastComparison != 0) {
15748
          return lastComparison;
15749
        }
3385 varun.gupt 15750
      }
15751
      return 0;
15752
    }
15753
 
3430 rajveer 15754
    public _Fields fieldForId(int fieldId) {
15755
      return _Fields.findByThriftId(fieldId);
15756
    }
15757
 
15758
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15759
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 15760
      iprot.readStructBegin();
15761
      while (true)
15762
      {
15763
        field = iprot.readFieldBegin();
3430 rajveer 15764
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 15765
          break;
15766
        }
3430 rajveer 15767
        switch (field.id) {
15768
          case 1: // COUPON_CODE
15769
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
15770
              this.couponCode = iprot.readString();
15771
            } else { 
15772
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15773
            }
15774
            break;
15775
          default:
15776
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 15777
        }
3430 rajveer 15778
        iprot.readFieldEnd();
3385 varun.gupt 15779
      }
15780
      iprot.readStructEnd();
15781
      validate();
15782
    }
15783
 
3430 rajveer 15784
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 15785
      validate();
15786
 
15787
      oprot.writeStructBegin(STRUCT_DESC);
15788
      if (this.couponCode != null) {
15789
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
15790
        oprot.writeString(this.couponCode);
15791
        oprot.writeFieldEnd();
15792
      }
15793
      oprot.writeFieldStop();
15794
      oprot.writeStructEnd();
15795
    }
15796
 
15797
    @Override
15798
    public String toString() {
15799
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_args(");
15800
      boolean first = true;
15801
 
15802
      sb.append("couponCode:");
15803
      if (this.couponCode == null) {
15804
        sb.append("null");
15805
      } else {
15806
        sb.append(this.couponCode);
15807
      }
15808
      first = false;
15809
      sb.append(")");
15810
      return sb.toString();
15811
    }
15812
 
3430 rajveer 15813
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 15814
      // check for required fields
15815
    }
15816
 
3430 rajveer 15817
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15818
      try {
15819
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15820
      } catch (org.apache.thrift.TException te) {
15821
        throw new java.io.IOException(te);
15822
      }
15823
    }
15824
 
15825
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15826
      try {
15827
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15828
      } catch (org.apache.thrift.TException te) {
15829
        throw new java.io.IOException(te);
15830
      }
15831
    }
15832
 
3385 varun.gupt 15833
  }
15834
 
3430 rajveer 15835
  public static class getSuccessfulPaymentCountForCoupon_result implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_result, getSuccessfulPaymentCountForCoupon_result._Fields>, java.io.Serializable, Cloneable   {
15836
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_result");
3385 varun.gupt 15837
 
3430 rajveer 15838
    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);
15839
    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 15840
 
3430 rajveer 15841
    private long success; // required
15842
    private PromotionException pex; // required
3385 varun.gupt 15843
 
15844
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 15845
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 15846
      SUCCESS((short)0, "success"),
15847
      PEX((short)1, "pex");
15848
 
15849
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15850
 
15851
      static {
15852
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15853
          byName.put(field.getFieldName(), field);
15854
        }
15855
      }
15856
 
15857
      /**
15858
       * Find the _Fields constant that matches fieldId, or null if its not found.
15859
       */
15860
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 15861
        switch(fieldId) {
15862
          case 0: // SUCCESS
15863
            return SUCCESS;
15864
          case 1: // PEX
15865
            return PEX;
15866
          default:
15867
            return null;
15868
        }
3385 varun.gupt 15869
      }
15870
 
15871
      /**
15872
       * Find the _Fields constant that matches fieldId, throwing an exception
15873
       * if it is not found.
15874
       */
15875
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15876
        _Fields fields = findByThriftId(fieldId);
15877
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15878
        return fields;
15879
      }
15880
 
15881
      /**
15882
       * Find the _Fields constant that matches name, or null if its not found.
15883
       */
15884
      public static _Fields findByName(String name) {
15885
        return byName.get(name);
15886
      }
15887
 
15888
      private final short _thriftId;
15889
      private final String _fieldName;
15890
 
15891
      _Fields(short thriftId, String fieldName) {
15892
        _thriftId = thriftId;
15893
        _fieldName = fieldName;
15894
      }
15895
 
15896
      public short getThriftFieldId() {
15897
        return _thriftId;
15898
      }
15899
 
15900
      public String getFieldName() {
15901
        return _fieldName;
15902
      }
15903
    }
15904
 
15905
    // isset id assignments
15906
    private static final int __SUCCESS_ISSET_ID = 0;
15907
    private BitSet __isset_bit_vector = new BitSet(1);
15908
 
3430 rajveer 15909
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 15910
    static {
3430 rajveer 15911
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15912
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15913
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
15914
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15915
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
15916
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15917
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_result.class, metaDataMap);
3385 varun.gupt 15918
    }
15919
 
15920
    public getSuccessfulPaymentCountForCoupon_result() {
15921
    }
15922
 
15923
    public getSuccessfulPaymentCountForCoupon_result(
15924
      long success,
15925
      PromotionException pex)
15926
    {
15927
      this();
15928
      this.success = success;
15929
      setSuccessIsSet(true);
15930
      this.pex = pex;
15931
    }
15932
 
15933
    /**
15934
     * Performs a deep copy on <i>other</i>.
15935
     */
15936
    public getSuccessfulPaymentCountForCoupon_result(getSuccessfulPaymentCountForCoupon_result other) {
15937
      __isset_bit_vector.clear();
15938
      __isset_bit_vector.or(other.__isset_bit_vector);
15939
      this.success = other.success;
15940
      if (other.isSetPex()) {
15941
        this.pex = new PromotionException(other.pex);
15942
      }
15943
    }
15944
 
15945
    public getSuccessfulPaymentCountForCoupon_result deepCopy() {
15946
      return new getSuccessfulPaymentCountForCoupon_result(this);
15947
    }
15948
 
3430 rajveer 15949
    @Override
15950
    public void clear() {
15951
      setSuccessIsSet(false);
15952
      this.success = 0;
15953
      this.pex = null;
3385 varun.gupt 15954
    }
15955
 
15956
    public long getSuccess() {
15957
      return this.success;
15958
    }
15959
 
3430 rajveer 15960
    public void setSuccess(long success) {
3385 varun.gupt 15961
      this.success = success;
15962
      setSuccessIsSet(true);
15963
    }
15964
 
15965
    public void unsetSuccess() {
15966
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
15967
    }
15968
 
3430 rajveer 15969
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 15970
    public boolean isSetSuccess() {
15971
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
15972
    }
15973
 
15974
    public void setSuccessIsSet(boolean value) {
15975
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
15976
    }
15977
 
15978
    public PromotionException getPex() {
15979
      return this.pex;
15980
    }
15981
 
3430 rajveer 15982
    public void setPex(PromotionException pex) {
3385 varun.gupt 15983
      this.pex = pex;
15984
    }
15985
 
15986
    public void unsetPex() {
15987
      this.pex = null;
15988
    }
15989
 
3430 rajveer 15990
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 15991
    public boolean isSetPex() {
15992
      return this.pex != null;
15993
    }
15994
 
15995
    public void setPexIsSet(boolean value) {
15996
      if (!value) {
15997
        this.pex = null;
15998
      }
15999
    }
16000
 
16001
    public void setFieldValue(_Fields field, Object value) {
16002
      switch (field) {
16003
      case SUCCESS:
16004
        if (value == null) {
16005
          unsetSuccess();
16006
        } else {
16007
          setSuccess((Long)value);
16008
        }
16009
        break;
16010
 
16011
      case PEX:
16012
        if (value == null) {
16013
          unsetPex();
16014
        } else {
16015
          setPex((PromotionException)value);
16016
        }
16017
        break;
16018
 
16019
      }
16020
    }
16021
 
16022
    public Object getFieldValue(_Fields field) {
16023
      switch (field) {
16024
      case SUCCESS:
3430 rajveer 16025
        return Long.valueOf(getSuccess());
3385 varun.gupt 16026
 
16027
      case PEX:
16028
        return getPex();
16029
 
16030
      }
16031
      throw new IllegalStateException();
16032
    }
16033
 
3430 rajveer 16034
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16035
    public boolean isSet(_Fields field) {
16036
      if (field == null) {
16037
        throw new IllegalArgumentException();
16038
      }
3385 varun.gupt 16039
 
16040
      switch (field) {
16041
      case SUCCESS:
16042
        return isSetSuccess();
16043
      case PEX:
16044
        return isSetPex();
16045
      }
16046
      throw new IllegalStateException();
16047
    }
16048
 
16049
    @Override
16050
    public boolean equals(Object that) {
16051
      if (that == null)
16052
        return false;
16053
      if (that instanceof getSuccessfulPaymentCountForCoupon_result)
16054
        return this.equals((getSuccessfulPaymentCountForCoupon_result)that);
16055
      return false;
16056
    }
16057
 
16058
    public boolean equals(getSuccessfulPaymentCountForCoupon_result that) {
16059
      if (that == null)
16060
        return false;
16061
 
16062
      boolean this_present_success = true;
16063
      boolean that_present_success = true;
16064
      if (this_present_success || that_present_success) {
16065
        if (!(this_present_success && that_present_success))
16066
          return false;
16067
        if (this.success != that.success)
16068
          return false;
16069
      }
16070
 
16071
      boolean this_present_pex = true && this.isSetPex();
16072
      boolean that_present_pex = true && that.isSetPex();
16073
      if (this_present_pex || that_present_pex) {
16074
        if (!(this_present_pex && that_present_pex))
16075
          return false;
16076
        if (!this.pex.equals(that.pex))
16077
          return false;
16078
      }
16079
 
16080
      return true;
16081
    }
16082
 
16083
    @Override
16084
    public int hashCode() {
16085
      return 0;
16086
    }
16087
 
16088
    public int compareTo(getSuccessfulPaymentCountForCoupon_result other) {
16089
      if (!getClass().equals(other.getClass())) {
16090
        return getClass().getName().compareTo(other.getClass().getName());
16091
      }
16092
 
16093
      int lastComparison = 0;
16094
      getSuccessfulPaymentCountForCoupon_result typedOther = (getSuccessfulPaymentCountForCoupon_result)other;
16095
 
3430 rajveer 16096
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 16097
      if (lastComparison != 0) {
16098
        return lastComparison;
16099
      }
3430 rajveer 16100
      if (isSetSuccess()) {
16101
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
16102
        if (lastComparison != 0) {
16103
          return lastComparison;
16104
        }
3385 varun.gupt 16105
      }
3430 rajveer 16106
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 16107
      if (lastComparison != 0) {
16108
        return lastComparison;
16109
      }
3430 rajveer 16110
      if (isSetPex()) {
16111
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
16112
        if (lastComparison != 0) {
16113
          return lastComparison;
16114
        }
3385 varun.gupt 16115
      }
16116
      return 0;
16117
    }
16118
 
3430 rajveer 16119
    public _Fields fieldForId(int fieldId) {
16120
      return _Fields.findByThriftId(fieldId);
16121
    }
16122
 
16123
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16124
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 16125
      iprot.readStructBegin();
16126
      while (true)
16127
      {
16128
        field = iprot.readFieldBegin();
3430 rajveer 16129
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 16130
          break;
16131
        }
3430 rajveer 16132
        switch (field.id) {
16133
          case 0: // SUCCESS
16134
            if (field.type == org.apache.thrift.protocol.TType.I64) {
16135
              this.success = iprot.readI64();
16136
              setSuccessIsSet(true);
16137
            } else { 
16138
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16139
            }
16140
            break;
16141
          case 1: // PEX
16142
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
16143
              this.pex = new PromotionException();
16144
              this.pex.read(iprot);
16145
            } else { 
16146
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16147
            }
16148
            break;
16149
          default:
16150
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 16151
        }
3430 rajveer 16152
        iprot.readFieldEnd();
3385 varun.gupt 16153
      }
16154
      iprot.readStructEnd();
16155
      validate();
16156
    }
16157
 
3430 rajveer 16158
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 16159
      oprot.writeStructBegin(STRUCT_DESC);
16160
 
16161
      if (this.isSetSuccess()) {
16162
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
16163
        oprot.writeI64(this.success);
16164
        oprot.writeFieldEnd();
16165
      } else if (this.isSetPex()) {
16166
        oprot.writeFieldBegin(PEX_FIELD_DESC);
16167
        this.pex.write(oprot);
16168
        oprot.writeFieldEnd();
16169
      }
16170
      oprot.writeFieldStop();
16171
      oprot.writeStructEnd();
16172
    }
16173
 
16174
    @Override
16175
    public String toString() {
16176
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_result(");
16177
      boolean first = true;
16178
 
16179
      sb.append("success:");
16180
      sb.append(this.success);
16181
      first = false;
16182
      if (!first) sb.append(", ");
16183
      sb.append("pex:");
16184
      if (this.pex == null) {
16185
        sb.append("null");
16186
      } else {
16187
        sb.append(this.pex);
16188
      }
16189
      first = false;
16190
      sb.append(")");
16191
      return sb.toString();
16192
    }
16193
 
3430 rajveer 16194
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 16195
      // check for required fields
16196
    }
16197
 
3430 rajveer 16198
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16199
      try {
16200
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16201
      } catch (org.apache.thrift.TException te) {
16202
        throw new java.io.IOException(te);
16203
      }
16204
    }
16205
 
16206
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16207
      try {
16208
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16209
      } catch (org.apache.thrift.TException te) {
16210
        throw new java.io.IOException(te);
16211
      }
16212
    }
16213
 
3385 varun.gupt 16214
  }
16215
 
3430 rajveer 16216
  public static class getRuleDocString_args implements org.apache.thrift.TBase<getRuleDocString_args, getRuleDocString_args._Fields>, java.io.Serializable, Cloneable   {
16217
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_args");
3385 varun.gupt 16218
 
3430 rajveer 16219
    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 16220
 
3430 rajveer 16221
    private String ruleName; // required
3385 varun.gupt 16222
 
16223
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 16224
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 16225
      RULE_NAME((short)1, "ruleName");
16226
 
16227
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16228
 
16229
      static {
16230
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16231
          byName.put(field.getFieldName(), field);
16232
        }
16233
      }
16234
 
16235
      /**
16236
       * Find the _Fields constant that matches fieldId, or null if its not found.
16237
       */
16238
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 16239
        switch(fieldId) {
16240
          case 1: // RULE_NAME
16241
            return RULE_NAME;
16242
          default:
16243
            return null;
16244
        }
3385 varun.gupt 16245
      }
16246
 
16247
      /**
16248
       * Find the _Fields constant that matches fieldId, throwing an exception
16249
       * if it is not found.
16250
       */
16251
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16252
        _Fields fields = findByThriftId(fieldId);
16253
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16254
        return fields;
16255
      }
16256
 
16257
      /**
16258
       * Find the _Fields constant that matches name, or null if its not found.
16259
       */
16260
      public static _Fields findByName(String name) {
16261
        return byName.get(name);
16262
      }
16263
 
16264
      private final short _thriftId;
16265
      private final String _fieldName;
16266
 
16267
      _Fields(short thriftId, String fieldName) {
16268
        _thriftId = thriftId;
16269
        _fieldName = fieldName;
16270
      }
16271
 
16272
      public short getThriftFieldId() {
16273
        return _thriftId;
16274
      }
16275
 
16276
      public String getFieldName() {
16277
        return _fieldName;
16278
      }
16279
    }
16280
 
16281
    // isset id assignments
16282
 
3430 rajveer 16283
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 16284
    static {
3430 rajveer 16285
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16286
      tmpMap.put(_Fields.RULE_NAME, new org.apache.thrift.meta_data.FieldMetaData("ruleName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16287
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
16288
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16289
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_args.class, metaDataMap);
3385 varun.gupt 16290
    }
16291
 
16292
    public getRuleDocString_args() {
16293
    }
16294
 
16295
    public getRuleDocString_args(
16296
      String ruleName)
16297
    {
16298
      this();
16299
      this.ruleName = ruleName;
16300
    }
16301
 
16302
    /**
16303
     * Performs a deep copy on <i>other</i>.
16304
     */
16305
    public getRuleDocString_args(getRuleDocString_args other) {
16306
      if (other.isSetRuleName()) {
16307
        this.ruleName = other.ruleName;
16308
      }
16309
    }
16310
 
16311
    public getRuleDocString_args deepCopy() {
16312
      return new getRuleDocString_args(this);
16313
    }
16314
 
3430 rajveer 16315
    @Override
16316
    public void clear() {
16317
      this.ruleName = null;
3385 varun.gupt 16318
    }
16319
 
16320
    public String getRuleName() {
16321
      return this.ruleName;
16322
    }
16323
 
3430 rajveer 16324
    public void setRuleName(String ruleName) {
3385 varun.gupt 16325
      this.ruleName = ruleName;
16326
    }
16327
 
16328
    public void unsetRuleName() {
16329
      this.ruleName = null;
16330
    }
16331
 
3430 rajveer 16332
    /** Returns true if field ruleName is set (has been assigned a value) and false otherwise */
3385 varun.gupt 16333
    public boolean isSetRuleName() {
16334
      return this.ruleName != null;
16335
    }
16336
 
16337
    public void setRuleNameIsSet(boolean value) {
16338
      if (!value) {
16339
        this.ruleName = null;
16340
      }
16341
    }
16342
 
16343
    public void setFieldValue(_Fields field, Object value) {
16344
      switch (field) {
16345
      case RULE_NAME:
16346
        if (value == null) {
16347
          unsetRuleName();
16348
        } else {
16349
          setRuleName((String)value);
16350
        }
16351
        break;
16352
 
16353
      }
16354
    }
16355
 
16356
    public Object getFieldValue(_Fields field) {
16357
      switch (field) {
16358
      case RULE_NAME:
16359
        return getRuleName();
16360
 
16361
      }
16362
      throw new IllegalStateException();
16363
    }
16364
 
3430 rajveer 16365
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16366
    public boolean isSet(_Fields field) {
16367
      if (field == null) {
16368
        throw new IllegalArgumentException();
16369
      }
3385 varun.gupt 16370
 
16371
      switch (field) {
16372
      case RULE_NAME:
16373
        return isSetRuleName();
16374
      }
16375
      throw new IllegalStateException();
16376
    }
16377
 
16378
    @Override
16379
    public boolean equals(Object that) {
16380
      if (that == null)
16381
        return false;
16382
      if (that instanceof getRuleDocString_args)
16383
        return this.equals((getRuleDocString_args)that);
16384
      return false;
16385
    }
16386
 
16387
    public boolean equals(getRuleDocString_args that) {
16388
      if (that == null)
16389
        return false;
16390
 
16391
      boolean this_present_ruleName = true && this.isSetRuleName();
16392
      boolean that_present_ruleName = true && that.isSetRuleName();
16393
      if (this_present_ruleName || that_present_ruleName) {
16394
        if (!(this_present_ruleName && that_present_ruleName))
16395
          return false;
16396
        if (!this.ruleName.equals(that.ruleName))
16397
          return false;
16398
      }
16399
 
16400
      return true;
16401
    }
16402
 
16403
    @Override
16404
    public int hashCode() {
16405
      return 0;
16406
    }
16407
 
16408
    public int compareTo(getRuleDocString_args other) {
16409
      if (!getClass().equals(other.getClass())) {
16410
        return getClass().getName().compareTo(other.getClass().getName());
16411
      }
16412
 
16413
      int lastComparison = 0;
16414
      getRuleDocString_args typedOther = (getRuleDocString_args)other;
16415
 
3430 rajveer 16416
      lastComparison = Boolean.valueOf(isSetRuleName()).compareTo(typedOther.isSetRuleName());
3385 varun.gupt 16417
      if (lastComparison != 0) {
16418
        return lastComparison;
16419
      }
3430 rajveer 16420
      if (isSetRuleName()) {
16421
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleName, typedOther.ruleName);
16422
        if (lastComparison != 0) {
16423
          return lastComparison;
16424
        }
3385 varun.gupt 16425
      }
16426
      return 0;
16427
    }
16428
 
3430 rajveer 16429
    public _Fields fieldForId(int fieldId) {
16430
      return _Fields.findByThriftId(fieldId);
16431
    }
16432
 
16433
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16434
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 16435
      iprot.readStructBegin();
16436
      while (true)
16437
      {
16438
        field = iprot.readFieldBegin();
3430 rajveer 16439
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 16440
          break;
16441
        }
3430 rajveer 16442
        switch (field.id) {
16443
          case 1: // RULE_NAME
16444
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
16445
              this.ruleName = iprot.readString();
16446
            } else { 
16447
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16448
            }
16449
            break;
16450
          default:
16451
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 16452
        }
3430 rajveer 16453
        iprot.readFieldEnd();
3385 varun.gupt 16454
      }
16455
      iprot.readStructEnd();
16456
      validate();
16457
    }
16458
 
3430 rajveer 16459
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 16460
      validate();
16461
 
16462
      oprot.writeStructBegin(STRUCT_DESC);
16463
      if (this.ruleName != null) {
16464
        oprot.writeFieldBegin(RULE_NAME_FIELD_DESC);
16465
        oprot.writeString(this.ruleName);
16466
        oprot.writeFieldEnd();
16467
      }
16468
      oprot.writeFieldStop();
16469
      oprot.writeStructEnd();
16470
    }
16471
 
16472
    @Override
16473
    public String toString() {
16474
      StringBuilder sb = new StringBuilder("getRuleDocString_args(");
16475
      boolean first = true;
16476
 
16477
      sb.append("ruleName:");
16478
      if (this.ruleName == null) {
16479
        sb.append("null");
16480
      } else {
16481
        sb.append(this.ruleName);
16482
      }
16483
      first = false;
16484
      sb.append(")");
16485
      return sb.toString();
16486
    }
16487
 
3430 rajveer 16488
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 16489
      // check for required fields
16490
    }
16491
 
3430 rajveer 16492
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16493
      try {
16494
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16495
      } catch (org.apache.thrift.TException te) {
16496
        throw new java.io.IOException(te);
16497
      }
16498
    }
16499
 
16500
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16501
      try {
16502
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16503
      } catch (org.apache.thrift.TException te) {
16504
        throw new java.io.IOException(te);
16505
      }
16506
    }
16507
 
3385 varun.gupt 16508
  }
16509
 
3430 rajveer 16510
  public static class getRuleDocString_result implements org.apache.thrift.TBase<getRuleDocString_result, getRuleDocString_result._Fields>, java.io.Serializable, Cloneable   {
16511
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_result");
3385 varun.gupt 16512
 
3430 rajveer 16513
    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 16514
 
3430 rajveer 16515
    private String success; // required
3385 varun.gupt 16516
 
16517
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 16518
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 16519
      SUCCESS((short)0, "success");
16520
 
16521
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16522
 
16523
      static {
16524
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16525
          byName.put(field.getFieldName(), field);
16526
        }
16527
      }
16528
 
16529
      /**
16530
       * Find the _Fields constant that matches fieldId, or null if its not found.
16531
       */
16532
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 16533
        switch(fieldId) {
16534
          case 0: // SUCCESS
16535
            return SUCCESS;
16536
          default:
16537
            return null;
16538
        }
3385 varun.gupt 16539
      }
16540
 
16541
      /**
16542
       * Find the _Fields constant that matches fieldId, throwing an exception
16543
       * if it is not found.
16544
       */
16545
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16546
        _Fields fields = findByThriftId(fieldId);
16547
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16548
        return fields;
16549
      }
16550
 
16551
      /**
16552
       * Find the _Fields constant that matches name, or null if its not found.
16553
       */
16554
      public static _Fields findByName(String name) {
16555
        return byName.get(name);
16556
      }
16557
 
16558
      private final short _thriftId;
16559
      private final String _fieldName;
16560
 
16561
      _Fields(short thriftId, String fieldName) {
16562
        _thriftId = thriftId;
16563
        _fieldName = fieldName;
16564
      }
16565
 
16566
      public short getThriftFieldId() {
16567
        return _thriftId;
16568
      }
16569
 
16570
      public String getFieldName() {
16571
        return _fieldName;
16572
      }
16573
    }
16574
 
16575
    // isset id assignments
16576
 
3430 rajveer 16577
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 16578
    static {
3430 rajveer 16579
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16580
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16581
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
16582
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16583
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_result.class, metaDataMap);
3385 varun.gupt 16584
    }
16585
 
16586
    public getRuleDocString_result() {
16587
    }
16588
 
16589
    public getRuleDocString_result(
16590
      String success)
16591
    {
16592
      this();
16593
      this.success = success;
16594
    }
16595
 
16596
    /**
16597
     * Performs a deep copy on <i>other</i>.
16598
     */
16599
    public getRuleDocString_result(getRuleDocString_result other) {
16600
      if (other.isSetSuccess()) {
16601
        this.success = other.success;
16602
      }
16603
    }
16604
 
16605
    public getRuleDocString_result deepCopy() {
16606
      return new getRuleDocString_result(this);
16607
    }
16608
 
3430 rajveer 16609
    @Override
16610
    public void clear() {
16611
      this.success = null;
3385 varun.gupt 16612
    }
16613
 
16614
    public String getSuccess() {
16615
      return this.success;
16616
    }
16617
 
3430 rajveer 16618
    public void setSuccess(String success) {
3385 varun.gupt 16619
      this.success = success;
16620
    }
16621
 
16622
    public void unsetSuccess() {
16623
      this.success = null;
16624
    }
16625
 
3430 rajveer 16626
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 16627
    public boolean isSetSuccess() {
16628
      return this.success != null;
16629
    }
16630
 
16631
    public void setSuccessIsSet(boolean value) {
16632
      if (!value) {
16633
        this.success = null;
16634
      }
16635
    }
16636
 
16637
    public void setFieldValue(_Fields field, Object value) {
16638
      switch (field) {
16639
      case SUCCESS:
16640
        if (value == null) {
16641
          unsetSuccess();
16642
        } else {
16643
          setSuccess((String)value);
16644
        }
16645
        break;
16646
 
16647
      }
16648
    }
16649
 
16650
    public Object getFieldValue(_Fields field) {
16651
      switch (field) {
16652
      case SUCCESS:
16653
        return getSuccess();
16654
 
16655
      }
16656
      throw new IllegalStateException();
16657
    }
16658
 
3430 rajveer 16659
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16660
    public boolean isSet(_Fields field) {
16661
      if (field == null) {
16662
        throw new IllegalArgumentException();
16663
      }
3385 varun.gupt 16664
 
16665
      switch (field) {
16666
      case SUCCESS:
16667
        return isSetSuccess();
16668
      }
16669
      throw new IllegalStateException();
16670
    }
16671
 
16672
    @Override
16673
    public boolean equals(Object that) {
16674
      if (that == null)
16675
        return false;
16676
      if (that instanceof getRuleDocString_result)
16677
        return this.equals((getRuleDocString_result)that);
16678
      return false;
16679
    }
16680
 
16681
    public boolean equals(getRuleDocString_result that) {
16682
      if (that == null)
16683
        return false;
16684
 
16685
      boolean this_present_success = true && this.isSetSuccess();
16686
      boolean that_present_success = true && that.isSetSuccess();
16687
      if (this_present_success || that_present_success) {
16688
        if (!(this_present_success && that_present_success))
16689
          return false;
16690
        if (!this.success.equals(that.success))
16691
          return false;
16692
      }
16693
 
16694
      return true;
16695
    }
16696
 
16697
    @Override
16698
    public int hashCode() {
16699
      return 0;
16700
    }
16701
 
16702
    public int compareTo(getRuleDocString_result other) {
16703
      if (!getClass().equals(other.getClass())) {
16704
        return getClass().getName().compareTo(other.getClass().getName());
16705
      }
16706
 
16707
      int lastComparison = 0;
16708
      getRuleDocString_result typedOther = (getRuleDocString_result)other;
16709
 
3430 rajveer 16710
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 16711
      if (lastComparison != 0) {
16712
        return lastComparison;
16713
      }
3430 rajveer 16714
      if (isSetSuccess()) {
16715
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
16716
        if (lastComparison != 0) {
16717
          return lastComparison;
16718
        }
3385 varun.gupt 16719
      }
16720
      return 0;
16721
    }
16722
 
3430 rajveer 16723
    public _Fields fieldForId(int fieldId) {
16724
      return _Fields.findByThriftId(fieldId);
16725
    }
16726
 
16727
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16728
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 16729
      iprot.readStructBegin();
16730
      while (true)
16731
      {
16732
        field = iprot.readFieldBegin();
3430 rajveer 16733
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 16734
          break;
16735
        }
3430 rajveer 16736
        switch (field.id) {
16737
          case 0: // SUCCESS
16738
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
16739
              this.success = iprot.readString();
16740
            } else { 
16741
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16742
            }
16743
            break;
16744
          default:
16745
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 16746
        }
3430 rajveer 16747
        iprot.readFieldEnd();
3385 varun.gupt 16748
      }
16749
      iprot.readStructEnd();
16750
      validate();
16751
    }
16752
 
3430 rajveer 16753
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 16754
      oprot.writeStructBegin(STRUCT_DESC);
16755
 
16756
      if (this.isSetSuccess()) {
16757
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
16758
        oprot.writeString(this.success);
16759
        oprot.writeFieldEnd();
16760
      }
16761
      oprot.writeFieldStop();
16762
      oprot.writeStructEnd();
16763
    }
16764
 
16765
    @Override
16766
    public String toString() {
16767
      StringBuilder sb = new StringBuilder("getRuleDocString_result(");
16768
      boolean first = true;
16769
 
16770
      sb.append("success:");
16771
      if (this.success == null) {
16772
        sb.append("null");
16773
      } else {
16774
        sb.append(this.success);
16775
      }
16776
      first = false;
16777
      sb.append(")");
16778
      return sb.toString();
16779
    }
16780
 
3430 rajveer 16781
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 16782
      // check for required fields
16783
    }
16784
 
3430 rajveer 16785
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16786
      try {
16787
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16788
      } catch (org.apache.thrift.TException te) {
16789
        throw new java.io.IOException(te);
16790
      }
16791
    }
16792
 
16793
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16794
      try {
16795
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16796
      } catch (org.apache.thrift.TException te) {
16797
        throw new java.io.IOException(te);
16798
      }
16799
    }
16800
 
3385 varun.gupt 16801
  }
16802
 
4189 varun.gupt 16803
  public static class getItemDiscountMap_args implements org.apache.thrift.TBase<getItemDiscountMap_args, getItemDiscountMap_args._Fields>, java.io.Serializable, Cloneable   {
16804
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_args");
16805
 
16806
    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);
16807
 
16808
    private List<Long> itemIds; // required
16809
 
16810
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
16811
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
16812
      ITEM_IDS((short)1, "itemIds");
16813
 
16814
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16815
 
16816
      static {
16817
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16818
          byName.put(field.getFieldName(), field);
16819
        }
16820
      }
16821
 
16822
      /**
16823
       * Find the _Fields constant that matches fieldId, or null if its not found.
16824
       */
16825
      public static _Fields findByThriftId(int fieldId) {
16826
        switch(fieldId) {
16827
          case 1: // ITEM_IDS
16828
            return ITEM_IDS;
16829
          default:
16830
            return null;
16831
        }
16832
      }
16833
 
16834
      /**
16835
       * Find the _Fields constant that matches fieldId, throwing an exception
16836
       * if it is not found.
16837
       */
16838
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16839
        _Fields fields = findByThriftId(fieldId);
16840
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16841
        return fields;
16842
      }
16843
 
16844
      /**
16845
       * Find the _Fields constant that matches name, or null if its not found.
16846
       */
16847
      public static _Fields findByName(String name) {
16848
        return byName.get(name);
16849
      }
16850
 
16851
      private final short _thriftId;
16852
      private final String _fieldName;
16853
 
16854
      _Fields(short thriftId, String fieldName) {
16855
        _thriftId = thriftId;
16856
        _fieldName = fieldName;
16857
      }
16858
 
16859
      public short getThriftFieldId() {
16860
        return _thriftId;
16861
      }
16862
 
16863
      public String getFieldName() {
16864
        return _fieldName;
16865
      }
16866
    }
16867
 
16868
    // isset id assignments
16869
 
16870
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
16871
    static {
16872
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16873
      tmpMap.put(_Fields.ITEM_IDS, new org.apache.thrift.meta_data.FieldMetaData("itemIds", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16874
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
16875
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
16876
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16877
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_args.class, metaDataMap);
16878
    }
16879
 
16880
    public getItemDiscountMap_args() {
16881
    }
16882
 
16883
    public getItemDiscountMap_args(
16884
      List<Long> itemIds)
16885
    {
16886
      this();
16887
      this.itemIds = itemIds;
16888
    }
16889
 
16890
    /**
16891
     * Performs a deep copy on <i>other</i>.
16892
     */
16893
    public getItemDiscountMap_args(getItemDiscountMap_args other) {
16894
      if (other.isSetItemIds()) {
16895
        List<Long> __this__itemIds = new ArrayList<Long>();
16896
        for (Long other_element : other.itemIds) {
16897
          __this__itemIds.add(other_element);
16898
        }
16899
        this.itemIds = __this__itemIds;
16900
      }
16901
    }
16902
 
16903
    public getItemDiscountMap_args deepCopy() {
16904
      return new getItemDiscountMap_args(this);
16905
    }
16906
 
16907
    @Override
16908
    public void clear() {
16909
      this.itemIds = null;
16910
    }
16911
 
16912
    public int getItemIdsSize() {
16913
      return (this.itemIds == null) ? 0 : this.itemIds.size();
16914
    }
16915
 
16916
    public java.util.Iterator<Long> getItemIdsIterator() {
16917
      return (this.itemIds == null) ? null : this.itemIds.iterator();
16918
    }
16919
 
16920
    public void addToItemIds(long elem) {
16921
      if (this.itemIds == null) {
16922
        this.itemIds = new ArrayList<Long>();
16923
      }
16924
      this.itemIds.add(elem);
16925
    }
16926
 
16927
    public List<Long> getItemIds() {
16928
      return this.itemIds;
16929
    }
16930
 
16931
    public void setItemIds(List<Long> itemIds) {
16932
      this.itemIds = itemIds;
16933
    }
16934
 
16935
    public void unsetItemIds() {
16936
      this.itemIds = null;
16937
    }
16938
 
16939
    /** Returns true if field itemIds is set (has been assigned a value) and false otherwise */
16940
    public boolean isSetItemIds() {
16941
      return this.itemIds != null;
16942
    }
16943
 
16944
    public void setItemIdsIsSet(boolean value) {
16945
      if (!value) {
16946
        this.itemIds = null;
16947
      }
16948
    }
16949
 
16950
    public void setFieldValue(_Fields field, Object value) {
16951
      switch (field) {
16952
      case ITEM_IDS:
16953
        if (value == null) {
16954
          unsetItemIds();
16955
        } else {
16956
          setItemIds((List<Long>)value);
16957
        }
16958
        break;
16959
 
16960
      }
16961
    }
16962
 
16963
    public Object getFieldValue(_Fields field) {
16964
      switch (field) {
16965
      case ITEM_IDS:
16966
        return getItemIds();
16967
 
16968
      }
16969
      throw new IllegalStateException();
16970
    }
16971
 
16972
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16973
    public boolean isSet(_Fields field) {
16974
      if (field == null) {
16975
        throw new IllegalArgumentException();
16976
      }
16977
 
16978
      switch (field) {
16979
      case ITEM_IDS:
16980
        return isSetItemIds();
16981
      }
16982
      throw new IllegalStateException();
16983
    }
16984
 
16985
    @Override
16986
    public boolean equals(Object that) {
16987
      if (that == null)
16988
        return false;
16989
      if (that instanceof getItemDiscountMap_args)
16990
        return this.equals((getItemDiscountMap_args)that);
16991
      return false;
16992
    }
16993
 
16994
    public boolean equals(getItemDiscountMap_args that) {
16995
      if (that == null)
16996
        return false;
16997
 
16998
      boolean this_present_itemIds = true && this.isSetItemIds();
16999
      boolean that_present_itemIds = true && that.isSetItemIds();
17000
      if (this_present_itemIds || that_present_itemIds) {
17001
        if (!(this_present_itemIds && that_present_itemIds))
17002
          return false;
17003
        if (!this.itemIds.equals(that.itemIds))
17004
          return false;
17005
      }
17006
 
17007
      return true;
17008
    }
17009
 
17010
    @Override
17011
    public int hashCode() {
17012
      return 0;
17013
    }
17014
 
17015
    public int compareTo(getItemDiscountMap_args other) {
17016
      if (!getClass().equals(other.getClass())) {
17017
        return getClass().getName().compareTo(other.getClass().getName());
17018
      }
17019
 
17020
      int lastComparison = 0;
17021
      getItemDiscountMap_args typedOther = (getItemDiscountMap_args)other;
17022
 
17023
      lastComparison = Boolean.valueOf(isSetItemIds()).compareTo(typedOther.isSetItemIds());
17024
      if (lastComparison != 0) {
17025
        return lastComparison;
17026
      }
17027
      if (isSetItemIds()) {
17028
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemIds, typedOther.itemIds);
17029
        if (lastComparison != 0) {
17030
          return lastComparison;
17031
        }
17032
      }
17033
      return 0;
17034
    }
17035
 
17036
    public _Fields fieldForId(int fieldId) {
17037
      return _Fields.findByThriftId(fieldId);
17038
    }
17039
 
17040
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17041
      org.apache.thrift.protocol.TField field;
17042
      iprot.readStructBegin();
17043
      while (true)
17044
      {
17045
        field = iprot.readFieldBegin();
17046
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17047
          break;
17048
        }
17049
        switch (field.id) {
17050
          case 1: // ITEM_IDS
17051
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
17052
              {
11592 amit.gupta 17053
                org.apache.thrift.protocol.TList _list42 = iprot.readListBegin();
17054
                this.itemIds = new ArrayList<Long>(_list42.size);
17055
                for (int _i43 = 0; _i43 < _list42.size; ++_i43)
4189 varun.gupt 17056
                {
11592 amit.gupta 17057
                  long _elem44; // required
17058
                  _elem44 = iprot.readI64();
17059
                  this.itemIds.add(_elem44);
4189 varun.gupt 17060
                }
17061
                iprot.readListEnd();
17062
              }
17063
            } else { 
17064
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17065
            }
17066
            break;
17067
          default:
17068
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17069
        }
17070
        iprot.readFieldEnd();
17071
      }
17072
      iprot.readStructEnd();
17073
      validate();
17074
    }
17075
 
17076
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17077
      validate();
17078
 
17079
      oprot.writeStructBegin(STRUCT_DESC);
17080
      if (this.itemIds != null) {
17081
        oprot.writeFieldBegin(ITEM_IDS_FIELD_DESC);
17082
        {
17083
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.itemIds.size()));
11592 amit.gupta 17084
          for (long _iter45 : this.itemIds)
4189 varun.gupt 17085
          {
11592 amit.gupta 17086
            oprot.writeI64(_iter45);
4189 varun.gupt 17087
          }
17088
          oprot.writeListEnd();
17089
        }
17090
        oprot.writeFieldEnd();
17091
      }
17092
      oprot.writeFieldStop();
17093
      oprot.writeStructEnd();
17094
    }
17095
 
17096
    @Override
17097
    public String toString() {
17098
      StringBuilder sb = new StringBuilder("getItemDiscountMap_args(");
17099
      boolean first = true;
17100
 
17101
      sb.append("itemIds:");
17102
      if (this.itemIds == null) {
17103
        sb.append("null");
17104
      } else {
17105
        sb.append(this.itemIds);
17106
      }
17107
      first = false;
17108
      sb.append(")");
17109
      return sb.toString();
17110
    }
17111
 
17112
    public void validate() throws org.apache.thrift.TException {
17113
      // check for required fields
17114
    }
17115
 
17116
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17117
      try {
17118
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17119
      } catch (org.apache.thrift.TException te) {
17120
        throw new java.io.IOException(te);
17121
      }
17122
    }
17123
 
17124
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
17125
      try {
17126
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
17127
      } catch (org.apache.thrift.TException te) {
17128
        throw new java.io.IOException(te);
17129
      }
17130
    }
17131
 
17132
  }
17133
 
17134
  public static class getItemDiscountMap_result implements org.apache.thrift.TBase<getItemDiscountMap_result, getItemDiscountMap_result._Fields>, java.io.Serializable, Cloneable   {
17135
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_result");
17136
 
17137
    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);
17138
    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);
17139
 
17140
    private List<ItemCouponDiscount> success; // required
17141
    private PromotionException pex; // required
17142
 
17143
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
17144
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
17145
      SUCCESS((short)0, "success"),
17146
      PEX((short)1, "pex");
17147
 
17148
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
17149
 
17150
      static {
17151
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
17152
          byName.put(field.getFieldName(), field);
17153
        }
17154
      }
17155
 
17156
      /**
17157
       * Find the _Fields constant that matches fieldId, or null if its not found.
17158
       */
17159
      public static _Fields findByThriftId(int fieldId) {
17160
        switch(fieldId) {
17161
          case 0: // SUCCESS
17162
            return SUCCESS;
17163
          case 1: // PEX
17164
            return PEX;
17165
          default:
17166
            return null;
17167
        }
17168
      }
17169
 
17170
      /**
17171
       * Find the _Fields constant that matches fieldId, throwing an exception
17172
       * if it is not found.
17173
       */
17174
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17175
        _Fields fields = findByThriftId(fieldId);
17176
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17177
        return fields;
17178
      }
17179
 
17180
      /**
17181
       * Find the _Fields constant that matches name, or null if its not found.
17182
       */
17183
      public static _Fields findByName(String name) {
17184
        return byName.get(name);
17185
      }
17186
 
17187
      private final short _thriftId;
17188
      private final String _fieldName;
17189
 
17190
      _Fields(short thriftId, String fieldName) {
17191
        _thriftId = thriftId;
17192
        _fieldName = fieldName;
17193
      }
17194
 
17195
      public short getThriftFieldId() {
17196
        return _thriftId;
17197
      }
17198
 
17199
      public String getFieldName() {
17200
        return _fieldName;
17201
      }
17202
    }
17203
 
17204
    // isset id assignments
17205
 
17206
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
17207
    static {
17208
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
17209
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17210
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
17211
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ItemCouponDiscount.class))));
17212
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17213
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
17214
      metaDataMap = Collections.unmodifiableMap(tmpMap);
17215
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_result.class, metaDataMap);
17216
    }
17217
 
17218
    public getItemDiscountMap_result() {
17219
    }
17220
 
17221
    public getItemDiscountMap_result(
17222
      List<ItemCouponDiscount> success,
17223
      PromotionException pex)
17224
    {
17225
      this();
17226
      this.success = success;
17227
      this.pex = pex;
17228
    }
17229
 
17230
    /**
17231
     * Performs a deep copy on <i>other</i>.
17232
     */
17233
    public getItemDiscountMap_result(getItemDiscountMap_result other) {
17234
      if (other.isSetSuccess()) {
17235
        List<ItemCouponDiscount> __this__success = new ArrayList<ItemCouponDiscount>();
17236
        for (ItemCouponDiscount other_element : other.success) {
17237
          __this__success.add(new ItemCouponDiscount(other_element));
17238
        }
17239
        this.success = __this__success;
17240
      }
17241
      if (other.isSetPex()) {
17242
        this.pex = new PromotionException(other.pex);
17243
      }
17244
    }
17245
 
17246
    public getItemDiscountMap_result deepCopy() {
17247
      return new getItemDiscountMap_result(this);
17248
    }
17249
 
17250
    @Override
17251
    public void clear() {
17252
      this.success = null;
17253
      this.pex = null;
17254
    }
17255
 
17256
    public int getSuccessSize() {
17257
      return (this.success == null) ? 0 : this.success.size();
17258
    }
17259
 
17260
    public java.util.Iterator<ItemCouponDiscount> getSuccessIterator() {
17261
      return (this.success == null) ? null : this.success.iterator();
17262
    }
17263
 
17264
    public void addToSuccess(ItemCouponDiscount elem) {
17265
      if (this.success == null) {
17266
        this.success = new ArrayList<ItemCouponDiscount>();
17267
      }
17268
      this.success.add(elem);
17269
    }
17270
 
17271
    public List<ItemCouponDiscount> getSuccess() {
17272
      return this.success;
17273
    }
17274
 
17275
    public void setSuccess(List<ItemCouponDiscount> success) {
17276
      this.success = success;
17277
    }
17278
 
17279
    public void unsetSuccess() {
17280
      this.success = null;
17281
    }
17282
 
17283
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
17284
    public boolean isSetSuccess() {
17285
      return this.success != null;
17286
    }
17287
 
17288
    public void setSuccessIsSet(boolean value) {
17289
      if (!value) {
17290
        this.success = null;
17291
      }
17292
    }
17293
 
17294
    public PromotionException getPex() {
17295
      return this.pex;
17296
    }
17297
 
17298
    public void setPex(PromotionException pex) {
17299
      this.pex = pex;
17300
    }
17301
 
17302
    public void unsetPex() {
17303
      this.pex = null;
17304
    }
17305
 
17306
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
17307
    public boolean isSetPex() {
17308
      return this.pex != null;
17309
    }
17310
 
17311
    public void setPexIsSet(boolean value) {
17312
      if (!value) {
17313
        this.pex = null;
17314
      }
17315
    }
17316
 
17317
    public void setFieldValue(_Fields field, Object value) {
17318
      switch (field) {
17319
      case SUCCESS:
17320
        if (value == null) {
17321
          unsetSuccess();
17322
        } else {
17323
          setSuccess((List<ItemCouponDiscount>)value);
17324
        }
17325
        break;
17326
 
17327
      case PEX:
17328
        if (value == null) {
17329
          unsetPex();
17330
        } else {
17331
          setPex((PromotionException)value);
17332
        }
17333
        break;
17334
 
17335
      }
17336
    }
17337
 
17338
    public Object getFieldValue(_Fields field) {
17339
      switch (field) {
17340
      case SUCCESS:
17341
        return getSuccess();
17342
 
17343
      case PEX:
17344
        return getPex();
17345
 
17346
      }
17347
      throw new IllegalStateException();
17348
    }
17349
 
17350
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
17351
    public boolean isSet(_Fields field) {
17352
      if (field == null) {
17353
        throw new IllegalArgumentException();
17354
      }
17355
 
17356
      switch (field) {
17357
      case SUCCESS:
17358
        return isSetSuccess();
17359
      case PEX:
17360
        return isSetPex();
17361
      }
17362
      throw new IllegalStateException();
17363
    }
17364
 
17365
    @Override
17366
    public boolean equals(Object that) {
17367
      if (that == null)
17368
        return false;
17369
      if (that instanceof getItemDiscountMap_result)
17370
        return this.equals((getItemDiscountMap_result)that);
17371
      return false;
17372
    }
17373
 
17374
    public boolean equals(getItemDiscountMap_result that) {
17375
      if (that == null)
17376
        return false;
17377
 
17378
      boolean this_present_success = true && this.isSetSuccess();
17379
      boolean that_present_success = true && that.isSetSuccess();
17380
      if (this_present_success || that_present_success) {
17381
        if (!(this_present_success && that_present_success))
17382
          return false;
17383
        if (!this.success.equals(that.success))
17384
          return false;
17385
      }
17386
 
17387
      boolean this_present_pex = true && this.isSetPex();
17388
      boolean that_present_pex = true && that.isSetPex();
17389
      if (this_present_pex || that_present_pex) {
17390
        if (!(this_present_pex && that_present_pex))
17391
          return false;
17392
        if (!this.pex.equals(that.pex))
17393
          return false;
17394
      }
17395
 
17396
      return true;
17397
    }
17398
 
17399
    @Override
17400
    public int hashCode() {
17401
      return 0;
17402
    }
17403
 
17404
    public int compareTo(getItemDiscountMap_result other) {
17405
      if (!getClass().equals(other.getClass())) {
17406
        return getClass().getName().compareTo(other.getClass().getName());
17407
      }
17408
 
17409
      int lastComparison = 0;
17410
      getItemDiscountMap_result typedOther = (getItemDiscountMap_result)other;
17411
 
17412
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
17413
      if (lastComparison != 0) {
17414
        return lastComparison;
17415
      }
17416
      if (isSetSuccess()) {
17417
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
17418
        if (lastComparison != 0) {
17419
          return lastComparison;
17420
        }
17421
      }
17422
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
17423
      if (lastComparison != 0) {
17424
        return lastComparison;
17425
      }
17426
      if (isSetPex()) {
17427
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
17428
        if (lastComparison != 0) {
17429
          return lastComparison;
17430
        }
17431
      }
17432
      return 0;
17433
    }
17434
 
17435
    public _Fields fieldForId(int fieldId) {
17436
      return _Fields.findByThriftId(fieldId);
17437
    }
17438
 
17439
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17440
      org.apache.thrift.protocol.TField field;
17441
      iprot.readStructBegin();
17442
      while (true)
17443
      {
17444
        field = iprot.readFieldBegin();
17445
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17446
          break;
17447
        }
17448
        switch (field.id) {
17449
          case 0: // SUCCESS
17450
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
17451
              {
11592 amit.gupta 17452
                org.apache.thrift.protocol.TList _list46 = iprot.readListBegin();
17453
                this.success = new ArrayList<ItemCouponDiscount>(_list46.size);
17454
                for (int _i47 = 0; _i47 < _list46.size; ++_i47)
4189 varun.gupt 17455
                {
11592 amit.gupta 17456
                  ItemCouponDiscount _elem48; // required
17457
                  _elem48 = new ItemCouponDiscount();
17458
                  _elem48.read(iprot);
17459
                  this.success.add(_elem48);
4189 varun.gupt 17460
                }
17461
                iprot.readListEnd();
17462
              }
17463
            } else { 
17464
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17465
            }
17466
            break;
17467
          case 1: // PEX
17468
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
17469
              this.pex = new PromotionException();
17470
              this.pex.read(iprot);
17471
            } else { 
17472
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17473
            }
17474
            break;
17475
          default:
17476
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17477
        }
17478
        iprot.readFieldEnd();
17479
      }
17480
      iprot.readStructEnd();
17481
      validate();
17482
    }
17483
 
17484
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17485
      oprot.writeStructBegin(STRUCT_DESC);
17486
 
17487
      if (this.isSetSuccess()) {
17488
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
17489
        {
17490
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
11592 amit.gupta 17491
          for (ItemCouponDiscount _iter49 : this.success)
4189 varun.gupt 17492
          {
11592 amit.gupta 17493
            _iter49.write(oprot);
4189 varun.gupt 17494
          }
17495
          oprot.writeListEnd();
17496
        }
17497
        oprot.writeFieldEnd();
17498
      } else if (this.isSetPex()) {
17499
        oprot.writeFieldBegin(PEX_FIELD_DESC);
17500
        this.pex.write(oprot);
17501
        oprot.writeFieldEnd();
17502
      }
17503
      oprot.writeFieldStop();
17504
      oprot.writeStructEnd();
17505
    }
17506
 
17507
    @Override
17508
    public String toString() {
17509
      StringBuilder sb = new StringBuilder("getItemDiscountMap_result(");
17510
      boolean first = true;
17511
 
17512
      sb.append("success:");
17513
      if (this.success == null) {
17514
        sb.append("null");
17515
      } else {
17516
        sb.append(this.success);
17517
      }
17518
      first = false;
17519
      if (!first) sb.append(", ");
17520
      sb.append("pex:");
17521
      if (this.pex == null) {
17522
        sb.append("null");
17523
      } else {
17524
        sb.append(this.pex);
17525
      }
17526
      first = false;
17527
      sb.append(")");
17528
      return sb.toString();
17529
    }
17530
 
17531
    public void validate() throws org.apache.thrift.TException {
17532
      // check for required fields
17533
    }
17534
 
17535
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17536
      try {
17537
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17538
      } catch (org.apache.thrift.TException te) {
17539
        throw new java.io.IOException(te);
17540
      }
17541
    }
17542
 
17543
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
17544
      try {
17545
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
17546
      } catch (org.apache.thrift.TException te) {
17547
        throw new java.io.IOException(te);
17548
      }
17549
    }
17550
 
17551
  }
17552
 
4494 varun.gupt 17553
  public static class getDiscountsForEntity_args implements org.apache.thrift.TBase<getDiscountsForEntity_args, getDiscountsForEntity_args._Fields>, java.io.Serializable, Cloneable   {
17554
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_args");
17555
 
17556
    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);
17557
 
17558
    private long entityId; // required
17559
 
17560
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
17561
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
17562
      ENTITY_ID((short)1, "entityId");
17563
 
17564
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
17565
 
17566
      static {
17567
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
17568
          byName.put(field.getFieldName(), field);
17569
        }
17570
      }
17571
 
17572
      /**
17573
       * Find the _Fields constant that matches fieldId, or null if its not found.
17574
       */
17575
      public static _Fields findByThriftId(int fieldId) {
17576
        switch(fieldId) {
17577
          case 1: // ENTITY_ID
17578
            return ENTITY_ID;
17579
          default:
17580
            return null;
17581
        }
17582
      }
17583
 
17584
      /**
17585
       * Find the _Fields constant that matches fieldId, throwing an exception
17586
       * if it is not found.
17587
       */
17588
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17589
        _Fields fields = findByThriftId(fieldId);
17590
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17591
        return fields;
17592
      }
17593
 
17594
      /**
17595
       * Find the _Fields constant that matches name, or null if its not found.
17596
       */
17597
      public static _Fields findByName(String name) {
17598
        return byName.get(name);
17599
      }
17600
 
17601
      private final short _thriftId;
17602
      private final String _fieldName;
17603
 
17604
      _Fields(short thriftId, String fieldName) {
17605
        _thriftId = thriftId;
17606
        _fieldName = fieldName;
17607
      }
17608
 
17609
      public short getThriftFieldId() {
17610
        return _thriftId;
17611
      }
17612
 
17613
      public String getFieldName() {
17614
        return _fieldName;
17615
      }
17616
    }
17617
 
17618
    // isset id assignments
17619
    private static final int __ENTITYID_ISSET_ID = 0;
17620
    private BitSet __isset_bit_vector = new BitSet(1);
17621
 
17622
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
17623
    static {
17624
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
17625
      tmpMap.put(_Fields.ENTITY_ID, new org.apache.thrift.meta_data.FieldMetaData("entityId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17626
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
17627
      metaDataMap = Collections.unmodifiableMap(tmpMap);
17628
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_args.class, metaDataMap);
17629
    }
17630
 
17631
    public getDiscountsForEntity_args() {
17632
    }
17633
 
17634
    public getDiscountsForEntity_args(
17635
      long entityId)
17636
    {
17637
      this();
17638
      this.entityId = entityId;
17639
      setEntityIdIsSet(true);
17640
    }
17641
 
17642
    /**
17643
     * Performs a deep copy on <i>other</i>.
17644
     */
17645
    public getDiscountsForEntity_args(getDiscountsForEntity_args other) {
17646
      __isset_bit_vector.clear();
17647
      __isset_bit_vector.or(other.__isset_bit_vector);
17648
      this.entityId = other.entityId;
17649
    }
17650
 
17651
    public getDiscountsForEntity_args deepCopy() {
17652
      return new getDiscountsForEntity_args(this);
17653
    }
17654
 
17655
    @Override
17656
    public void clear() {
17657
      setEntityIdIsSet(false);
17658
      this.entityId = 0;
17659
    }
17660
 
17661
    public long getEntityId() {
17662
      return this.entityId;
17663
    }
17664
 
17665
    public void setEntityId(long entityId) {
17666
      this.entityId = entityId;
17667
      setEntityIdIsSet(true);
17668
    }
17669
 
17670
    public void unsetEntityId() {
17671
      __isset_bit_vector.clear(__ENTITYID_ISSET_ID);
17672
    }
17673
 
17674
    /** Returns true if field entityId is set (has been assigned a value) and false otherwise */
17675
    public boolean isSetEntityId() {
17676
      return __isset_bit_vector.get(__ENTITYID_ISSET_ID);
17677
    }
17678
 
17679
    public void setEntityIdIsSet(boolean value) {
17680
      __isset_bit_vector.set(__ENTITYID_ISSET_ID, value);
17681
    }
17682
 
17683
    public void setFieldValue(_Fields field, Object value) {
17684
      switch (field) {
17685
      case ENTITY_ID:
17686
        if (value == null) {
17687
          unsetEntityId();
17688
        } else {
17689
          setEntityId((Long)value);
17690
        }
17691
        break;
17692
 
17693
      }
17694
    }
17695
 
17696
    public Object getFieldValue(_Fields field) {
17697
      switch (field) {
17698
      case ENTITY_ID:
17699
        return Long.valueOf(getEntityId());
17700
 
17701
      }
17702
      throw new IllegalStateException();
17703
    }
17704
 
17705
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
17706
    public boolean isSet(_Fields field) {
17707
      if (field == null) {
17708
        throw new IllegalArgumentException();
17709
      }
17710
 
17711
      switch (field) {
17712
      case ENTITY_ID:
17713
        return isSetEntityId();
17714
      }
17715
      throw new IllegalStateException();
17716
    }
17717
 
17718
    @Override
17719
    public boolean equals(Object that) {
17720
      if (that == null)
17721
        return false;
17722
      if (that instanceof getDiscountsForEntity_args)
17723
        return this.equals((getDiscountsForEntity_args)that);
17724
      return false;
17725
    }
17726
 
17727
    public boolean equals(getDiscountsForEntity_args that) {
17728
      if (that == null)
17729
        return false;
17730
 
17731
      boolean this_present_entityId = true;
17732
      boolean that_present_entityId = true;
17733
      if (this_present_entityId || that_present_entityId) {
17734
        if (!(this_present_entityId && that_present_entityId))
17735
          return false;
17736
        if (this.entityId != that.entityId)
17737
          return false;
17738
      }
17739
 
17740
      return true;
17741
    }
17742
 
17743
    @Override
17744
    public int hashCode() {
17745
      return 0;
17746
    }
17747
 
17748
    public int compareTo(getDiscountsForEntity_args other) {
17749
      if (!getClass().equals(other.getClass())) {
17750
        return getClass().getName().compareTo(other.getClass().getName());
17751
      }
17752
 
17753
      int lastComparison = 0;
17754
      getDiscountsForEntity_args typedOther = (getDiscountsForEntity_args)other;
17755
 
17756
      lastComparison = Boolean.valueOf(isSetEntityId()).compareTo(typedOther.isSetEntityId());
17757
      if (lastComparison != 0) {
17758
        return lastComparison;
17759
      }
17760
      if (isSetEntityId()) {
17761
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityId, typedOther.entityId);
17762
        if (lastComparison != 0) {
17763
          return lastComparison;
17764
        }
17765
      }
17766
      return 0;
17767
    }
17768
 
17769
    public _Fields fieldForId(int fieldId) {
17770
      return _Fields.findByThriftId(fieldId);
17771
    }
17772
 
17773
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17774
      org.apache.thrift.protocol.TField field;
17775
      iprot.readStructBegin();
17776
      while (true)
17777
      {
17778
        field = iprot.readFieldBegin();
17779
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17780
          break;
17781
        }
17782
        switch (field.id) {
17783
          case 1: // ENTITY_ID
17784
            if (field.type == org.apache.thrift.protocol.TType.I64) {
17785
              this.entityId = iprot.readI64();
17786
              setEntityIdIsSet(true);
17787
            } else { 
17788
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17789
            }
17790
            break;
17791
          default:
17792
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17793
        }
17794
        iprot.readFieldEnd();
17795
      }
17796
      iprot.readStructEnd();
17797
      validate();
17798
    }
17799
 
17800
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17801
      validate();
17802
 
17803
      oprot.writeStructBegin(STRUCT_DESC);
17804
      oprot.writeFieldBegin(ENTITY_ID_FIELD_DESC);
17805
      oprot.writeI64(this.entityId);
17806
      oprot.writeFieldEnd();
17807
      oprot.writeFieldStop();
17808
      oprot.writeStructEnd();
17809
    }
17810
 
17811
    @Override
17812
    public String toString() {
17813
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_args(");
17814
      boolean first = true;
17815
 
17816
      sb.append("entityId:");
17817
      sb.append(this.entityId);
17818
      first = false;
17819
      sb.append(")");
17820
      return sb.toString();
17821
    }
17822
 
17823
    public void validate() throws org.apache.thrift.TException {
17824
      // check for required fields
17825
    }
17826
 
17827
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17828
      try {
17829
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17830
      } catch (org.apache.thrift.TException te) {
17831
        throw new java.io.IOException(te);
17832
      }
17833
    }
17834
 
17835
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
17836
      try {
17837
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
17838
        __isset_bit_vector = new BitSet(1);
17839
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
17840
      } catch (org.apache.thrift.TException te) {
17841
        throw new java.io.IOException(te);
17842
      }
17843
    }
17844
 
17845
  }
17846
 
17847
  public static class getDiscountsForEntity_result implements org.apache.thrift.TBase<getDiscountsForEntity_result, getDiscountsForEntity_result._Fields>, java.io.Serializable, Cloneable   {
17848
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_result");
17849
 
17850
    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);
17851
 
17852
    private Map<String,Double> success; // required
17853
 
17854
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
17855
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
17856
      SUCCESS((short)0, "success");
17857
 
17858
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
17859
 
17860
      static {
17861
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
17862
          byName.put(field.getFieldName(), field);
17863
        }
17864
      }
17865
 
17866
      /**
17867
       * Find the _Fields constant that matches fieldId, or null if its not found.
17868
       */
17869
      public static _Fields findByThriftId(int fieldId) {
17870
        switch(fieldId) {
17871
          case 0: // SUCCESS
17872
            return SUCCESS;
17873
          default:
17874
            return null;
17875
        }
17876
      }
17877
 
17878
      /**
17879
       * Find the _Fields constant that matches fieldId, throwing an exception
17880
       * if it is not found.
17881
       */
17882
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17883
        _Fields fields = findByThriftId(fieldId);
17884
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17885
        return fields;
17886
      }
17887
 
17888
      /**
17889
       * Find the _Fields constant that matches name, or null if its not found.
17890
       */
17891
      public static _Fields findByName(String name) {
17892
        return byName.get(name);
17893
      }
17894
 
17895
      private final short _thriftId;
17896
      private final String _fieldName;
17897
 
17898
      _Fields(short thriftId, String fieldName) {
17899
        _thriftId = thriftId;
17900
        _fieldName = fieldName;
17901
      }
17902
 
17903
      public short getThriftFieldId() {
17904
        return _thriftId;
17905
      }
17906
 
17907
      public String getFieldName() {
17908
        return _fieldName;
17909
      }
17910
    }
17911
 
17912
    // isset id assignments
17913
 
17914
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
17915
    static {
17916
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
17917
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17918
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
17919
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
17920
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
17921
      metaDataMap = Collections.unmodifiableMap(tmpMap);
17922
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_result.class, metaDataMap);
17923
    }
17924
 
17925
    public getDiscountsForEntity_result() {
17926
    }
17927
 
17928
    public getDiscountsForEntity_result(
17929
      Map<String,Double> success)
17930
    {
17931
      this();
17932
      this.success = success;
17933
    }
17934
 
17935
    /**
17936
     * Performs a deep copy on <i>other</i>.
17937
     */
17938
    public getDiscountsForEntity_result(getDiscountsForEntity_result other) {
17939
      if (other.isSetSuccess()) {
17940
        Map<String,Double> __this__success = new HashMap<String,Double>();
17941
        for (Map.Entry<String, Double> other_element : other.success.entrySet()) {
17942
 
17943
          String other_element_key = other_element.getKey();
17944
          Double other_element_value = other_element.getValue();
17945
 
17946
          String __this__success_copy_key = other_element_key;
17947
 
17948
          Double __this__success_copy_value = other_element_value;
17949
 
17950
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
17951
        }
17952
        this.success = __this__success;
17953
      }
17954
    }
17955
 
17956
    public getDiscountsForEntity_result deepCopy() {
17957
      return new getDiscountsForEntity_result(this);
17958
    }
17959
 
17960
    @Override
17961
    public void clear() {
17962
      this.success = null;
17963
    }
17964
 
17965
    public int getSuccessSize() {
17966
      return (this.success == null) ? 0 : this.success.size();
17967
    }
17968
 
17969
    public void putToSuccess(String key, double val) {
17970
      if (this.success == null) {
17971
        this.success = new HashMap<String,Double>();
17972
      }
17973
      this.success.put(key, val);
17974
    }
17975
 
17976
    public Map<String,Double> getSuccess() {
17977
      return this.success;
17978
    }
17979
 
17980
    public void setSuccess(Map<String,Double> success) {
17981
      this.success = success;
17982
    }
17983
 
17984
    public void unsetSuccess() {
17985
      this.success = null;
17986
    }
17987
 
17988
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
17989
    public boolean isSetSuccess() {
17990
      return this.success != null;
17991
    }
17992
 
17993
    public void setSuccessIsSet(boolean value) {
17994
      if (!value) {
17995
        this.success = null;
17996
      }
17997
    }
17998
 
17999
    public void setFieldValue(_Fields field, Object value) {
18000
      switch (field) {
18001
      case SUCCESS:
18002
        if (value == null) {
18003
          unsetSuccess();
18004
        } else {
18005
          setSuccess((Map<String,Double>)value);
18006
        }
18007
        break;
18008
 
18009
      }
18010
    }
18011
 
18012
    public Object getFieldValue(_Fields field) {
18013
      switch (field) {
18014
      case SUCCESS:
18015
        return getSuccess();
18016
 
18017
      }
18018
      throw new IllegalStateException();
18019
    }
18020
 
18021
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
18022
    public boolean isSet(_Fields field) {
18023
      if (field == null) {
18024
        throw new IllegalArgumentException();
18025
      }
18026
 
18027
      switch (field) {
18028
      case SUCCESS:
18029
        return isSetSuccess();
18030
      }
18031
      throw new IllegalStateException();
18032
    }
18033
 
18034
    @Override
18035
    public boolean equals(Object that) {
18036
      if (that == null)
18037
        return false;
18038
      if (that instanceof getDiscountsForEntity_result)
18039
        return this.equals((getDiscountsForEntity_result)that);
18040
      return false;
18041
    }
18042
 
18043
    public boolean equals(getDiscountsForEntity_result that) {
18044
      if (that == null)
18045
        return false;
18046
 
18047
      boolean this_present_success = true && this.isSetSuccess();
18048
      boolean that_present_success = true && that.isSetSuccess();
18049
      if (this_present_success || that_present_success) {
18050
        if (!(this_present_success && that_present_success))
18051
          return false;
18052
        if (!this.success.equals(that.success))
18053
          return false;
18054
      }
18055
 
18056
      return true;
18057
    }
18058
 
18059
    @Override
18060
    public int hashCode() {
18061
      return 0;
18062
    }
18063
 
18064
    public int compareTo(getDiscountsForEntity_result other) {
18065
      if (!getClass().equals(other.getClass())) {
18066
        return getClass().getName().compareTo(other.getClass().getName());
18067
      }
18068
 
18069
      int lastComparison = 0;
18070
      getDiscountsForEntity_result typedOther = (getDiscountsForEntity_result)other;
18071
 
18072
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
18073
      if (lastComparison != 0) {
18074
        return lastComparison;
18075
      }
18076
      if (isSetSuccess()) {
18077
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
18078
        if (lastComparison != 0) {
18079
          return lastComparison;
18080
        }
18081
      }
18082
      return 0;
18083
    }
18084
 
18085
    public _Fields fieldForId(int fieldId) {
18086
      return _Fields.findByThriftId(fieldId);
18087
    }
18088
 
18089
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
18090
      org.apache.thrift.protocol.TField field;
18091
      iprot.readStructBegin();
18092
      while (true)
18093
      {
18094
        field = iprot.readFieldBegin();
18095
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
18096
          break;
18097
        }
18098
        switch (field.id) {
18099
          case 0: // SUCCESS
18100
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
18101
              {
11592 amit.gupta 18102
                org.apache.thrift.protocol.TMap _map50 = iprot.readMapBegin();
18103
                this.success = new HashMap<String,Double>(2*_map50.size);
18104
                for (int _i51 = 0; _i51 < _map50.size; ++_i51)
4494 varun.gupt 18105
                {
11592 amit.gupta 18106
                  String _key52; // required
18107
                  double _val53; // required
18108
                  _key52 = iprot.readString();
18109
                  _val53 = iprot.readDouble();
18110
                  this.success.put(_key52, _val53);
4494 varun.gupt 18111
                }
18112
                iprot.readMapEnd();
18113
              }
18114
            } else { 
18115
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18116
            }
18117
            break;
18118
          default:
18119
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18120
        }
18121
        iprot.readFieldEnd();
18122
      }
18123
      iprot.readStructEnd();
18124
      validate();
18125
    }
18126
 
18127
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
18128
      oprot.writeStructBegin(STRUCT_DESC);
18129
 
18130
      if (this.isSetSuccess()) {
18131
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
18132
        {
18133
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, this.success.size()));
11592 amit.gupta 18134
          for (Map.Entry<String, Double> _iter54 : this.success.entrySet())
4494 varun.gupt 18135
          {
11592 amit.gupta 18136
            oprot.writeString(_iter54.getKey());
18137
            oprot.writeDouble(_iter54.getValue());
4494 varun.gupt 18138
          }
18139
          oprot.writeMapEnd();
18140
        }
18141
        oprot.writeFieldEnd();
18142
      }
18143
      oprot.writeFieldStop();
18144
      oprot.writeStructEnd();
18145
    }
18146
 
18147
    @Override
18148
    public String toString() {
18149
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_result(");
18150
      boolean first = true;
18151
 
18152
      sb.append("success:");
18153
      if (this.success == null) {
18154
        sb.append("null");
18155
      } else {
18156
        sb.append(this.success);
18157
      }
18158
      first = false;
18159
      sb.append(")");
18160
      return sb.toString();
18161
    }
18162
 
18163
    public void validate() throws org.apache.thrift.TException {
18164
      // check for required fields
18165
    }
18166
 
18167
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
18168
      try {
18169
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
18170
      } catch (org.apache.thrift.TException te) {
18171
        throw new java.io.IOException(te);
18172
      }
18173
    }
18174
 
18175
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
18176
      try {
18177
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
18178
      } catch (org.apache.thrift.TException te) {
18179
        throw new java.io.IOException(te);
18180
      }
18181
    }
18182
 
18183
  }
18184
 
5469 rajveer 18185
  public static class addVoucher_args implements org.apache.thrift.TBase<addVoucher_args, addVoucher_args._Fields>, java.io.Serializable, Cloneable   {
18186
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_args");
18187
 
18188
    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);
18189
 
18190
    private Voucher voucher; // required
18191
 
18192
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
18193
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
18194
      VOUCHER((short)1, "voucher");
18195
 
18196
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
18197
 
18198
      static {
18199
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
18200
          byName.put(field.getFieldName(), field);
18201
        }
18202
      }
18203
 
18204
      /**
18205
       * Find the _Fields constant that matches fieldId, or null if its not found.
18206
       */
18207
      public static _Fields findByThriftId(int fieldId) {
18208
        switch(fieldId) {
18209
          case 1: // VOUCHER
18210
            return VOUCHER;
18211
          default:
18212
            return null;
18213
        }
18214
      }
18215
 
18216
      /**
18217
       * Find the _Fields constant that matches fieldId, throwing an exception
18218
       * if it is not found.
18219
       */
18220
      public static _Fields findByThriftIdOrThrow(int fieldId) {
18221
        _Fields fields = findByThriftId(fieldId);
18222
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
18223
        return fields;
18224
      }
18225
 
18226
      /**
18227
       * Find the _Fields constant that matches name, or null if its not found.
18228
       */
18229
      public static _Fields findByName(String name) {
18230
        return byName.get(name);
18231
      }
18232
 
18233
      private final short _thriftId;
18234
      private final String _fieldName;
18235
 
18236
      _Fields(short thriftId, String fieldName) {
18237
        _thriftId = thriftId;
18238
        _fieldName = fieldName;
18239
      }
18240
 
18241
      public short getThriftFieldId() {
18242
        return _thriftId;
18243
      }
18244
 
18245
      public String getFieldName() {
18246
        return _fieldName;
18247
      }
18248
    }
18249
 
18250
    // isset id assignments
18251
 
18252
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
18253
    static {
18254
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
18255
      tmpMap.put(_Fields.VOUCHER, new org.apache.thrift.meta_data.FieldMetaData("voucher", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18256
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
18257
      metaDataMap = Collections.unmodifiableMap(tmpMap);
18258
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_args.class, metaDataMap);
18259
    }
18260
 
18261
    public addVoucher_args() {
18262
    }
18263
 
18264
    public addVoucher_args(
18265
      Voucher voucher)
18266
    {
18267
      this();
18268
      this.voucher = voucher;
18269
    }
18270
 
18271
    /**
18272
     * Performs a deep copy on <i>other</i>.
18273
     */
18274
    public addVoucher_args(addVoucher_args other) {
18275
      if (other.isSetVoucher()) {
18276
        this.voucher = new Voucher(other.voucher);
18277
      }
18278
    }
18279
 
18280
    public addVoucher_args deepCopy() {
18281
      return new addVoucher_args(this);
18282
    }
18283
 
18284
    @Override
18285
    public void clear() {
18286
      this.voucher = null;
18287
    }
18288
 
18289
    public Voucher getVoucher() {
18290
      return this.voucher;
18291
    }
18292
 
18293
    public void setVoucher(Voucher voucher) {
18294
      this.voucher = voucher;
18295
    }
18296
 
18297
    public void unsetVoucher() {
18298
      this.voucher = null;
18299
    }
18300
 
18301
    /** Returns true if field voucher is set (has been assigned a value) and false otherwise */
18302
    public boolean isSetVoucher() {
18303
      return this.voucher != null;
18304
    }
18305
 
18306
    public void setVoucherIsSet(boolean value) {
18307
      if (!value) {
18308
        this.voucher = null;
18309
      }
18310
    }
18311
 
18312
    public void setFieldValue(_Fields field, Object value) {
18313
      switch (field) {
18314
      case VOUCHER:
18315
        if (value == null) {
18316
          unsetVoucher();
18317
        } else {
18318
          setVoucher((Voucher)value);
18319
        }
18320
        break;
18321
 
18322
      }
18323
    }
18324
 
18325
    public Object getFieldValue(_Fields field) {
18326
      switch (field) {
18327
      case VOUCHER:
18328
        return getVoucher();
18329
 
18330
      }
18331
      throw new IllegalStateException();
18332
    }
18333
 
18334
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
18335
    public boolean isSet(_Fields field) {
18336
      if (field == null) {
18337
        throw new IllegalArgumentException();
18338
      }
18339
 
18340
      switch (field) {
18341
      case VOUCHER:
18342
        return isSetVoucher();
18343
      }
18344
      throw new IllegalStateException();
18345
    }
18346
 
18347
    @Override
18348
    public boolean equals(Object that) {
18349
      if (that == null)
18350
        return false;
18351
      if (that instanceof addVoucher_args)
18352
        return this.equals((addVoucher_args)that);
18353
      return false;
18354
    }
18355
 
18356
    public boolean equals(addVoucher_args that) {
18357
      if (that == null)
18358
        return false;
18359
 
18360
      boolean this_present_voucher = true && this.isSetVoucher();
18361
      boolean that_present_voucher = true && that.isSetVoucher();
18362
      if (this_present_voucher || that_present_voucher) {
18363
        if (!(this_present_voucher && that_present_voucher))
18364
          return false;
18365
        if (!this.voucher.equals(that.voucher))
18366
          return false;
18367
      }
18368
 
18369
      return true;
18370
    }
18371
 
18372
    @Override
18373
    public int hashCode() {
18374
      return 0;
18375
    }
18376
 
18377
    public int compareTo(addVoucher_args other) {
18378
      if (!getClass().equals(other.getClass())) {
18379
        return getClass().getName().compareTo(other.getClass().getName());
18380
      }
18381
 
18382
      int lastComparison = 0;
18383
      addVoucher_args typedOther = (addVoucher_args)other;
18384
 
18385
      lastComparison = Boolean.valueOf(isSetVoucher()).compareTo(typedOther.isSetVoucher());
18386
      if (lastComparison != 0) {
18387
        return lastComparison;
18388
      }
18389
      if (isSetVoucher()) {
18390
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucher, typedOther.voucher);
18391
        if (lastComparison != 0) {
18392
          return lastComparison;
18393
        }
18394
      }
18395
      return 0;
18396
    }
18397
 
18398
    public _Fields fieldForId(int fieldId) {
18399
      return _Fields.findByThriftId(fieldId);
18400
    }
18401
 
18402
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
18403
      org.apache.thrift.protocol.TField field;
18404
      iprot.readStructBegin();
18405
      while (true)
18406
      {
18407
        field = iprot.readFieldBegin();
18408
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
18409
          break;
18410
        }
18411
        switch (field.id) {
18412
          case 1: // VOUCHER
18413
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
18414
              this.voucher = new Voucher();
18415
              this.voucher.read(iprot);
18416
            } else { 
18417
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18418
            }
18419
            break;
18420
          default:
18421
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18422
        }
18423
        iprot.readFieldEnd();
18424
      }
18425
      iprot.readStructEnd();
18426
      validate();
18427
    }
18428
 
18429
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
18430
      validate();
18431
 
18432
      oprot.writeStructBegin(STRUCT_DESC);
18433
      if (this.voucher != null) {
18434
        oprot.writeFieldBegin(VOUCHER_FIELD_DESC);
18435
        this.voucher.write(oprot);
18436
        oprot.writeFieldEnd();
18437
      }
18438
      oprot.writeFieldStop();
18439
      oprot.writeStructEnd();
18440
    }
18441
 
18442
    @Override
18443
    public String toString() {
18444
      StringBuilder sb = new StringBuilder("addVoucher_args(");
18445
      boolean first = true;
18446
 
18447
      sb.append("voucher:");
18448
      if (this.voucher == null) {
18449
        sb.append("null");
18450
      } else {
18451
        sb.append(this.voucher);
18452
      }
18453
      first = false;
18454
      sb.append(")");
18455
      return sb.toString();
18456
    }
18457
 
18458
    public void validate() throws org.apache.thrift.TException {
18459
      // check for required fields
18460
    }
18461
 
18462
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
18463
      try {
18464
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
18465
      } catch (org.apache.thrift.TException te) {
18466
        throw new java.io.IOException(te);
18467
      }
18468
    }
18469
 
18470
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
18471
      try {
18472
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
18473
      } catch (org.apache.thrift.TException te) {
18474
        throw new java.io.IOException(te);
18475
      }
18476
    }
18477
 
18478
  }
18479
 
18480
  public static class addVoucher_result implements org.apache.thrift.TBase<addVoucher_result, addVoucher_result._Fields>, java.io.Serializable, Cloneable   {
18481
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_result");
18482
 
18483
 
18484
 
18485
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
18486
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
18487
;
18488
 
18489
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
18490
 
18491
      static {
18492
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
18493
          byName.put(field.getFieldName(), field);
18494
        }
18495
      }
18496
 
18497
      /**
18498
       * Find the _Fields constant that matches fieldId, or null if its not found.
18499
       */
18500
      public static _Fields findByThriftId(int fieldId) {
18501
        switch(fieldId) {
18502
          default:
18503
            return null;
18504
        }
18505
      }
18506
 
18507
      /**
18508
       * Find the _Fields constant that matches fieldId, throwing an exception
18509
       * if it is not found.
18510
       */
18511
      public static _Fields findByThriftIdOrThrow(int fieldId) {
18512
        _Fields fields = findByThriftId(fieldId);
18513
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
18514
        return fields;
18515
      }
18516
 
18517
      /**
18518
       * Find the _Fields constant that matches name, or null if its not found.
18519
       */
18520
      public static _Fields findByName(String name) {
18521
        return byName.get(name);
18522
      }
18523
 
18524
      private final short _thriftId;
18525
      private final String _fieldName;
18526
 
18527
      _Fields(short thriftId, String fieldName) {
18528
        _thriftId = thriftId;
18529
        _fieldName = fieldName;
18530
      }
18531
 
18532
      public short getThriftFieldId() {
18533
        return _thriftId;
18534
      }
18535
 
18536
      public String getFieldName() {
18537
        return _fieldName;
18538
      }
18539
    }
18540
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
18541
    static {
18542
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
18543
      metaDataMap = Collections.unmodifiableMap(tmpMap);
18544
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_result.class, metaDataMap);
18545
    }
18546
 
18547
    public addVoucher_result() {
18548
    }
18549
 
18550
    /**
18551
     * Performs a deep copy on <i>other</i>.
18552
     */
18553
    public addVoucher_result(addVoucher_result other) {
18554
    }
18555
 
18556
    public addVoucher_result deepCopy() {
18557
      return new addVoucher_result(this);
18558
    }
18559
 
18560
    @Override
18561
    public void clear() {
18562
    }
18563
 
18564
    public void setFieldValue(_Fields field, Object value) {
18565
      switch (field) {
18566
      }
18567
    }
18568
 
18569
    public Object getFieldValue(_Fields field) {
18570
      switch (field) {
18571
      }
18572
      throw new IllegalStateException();
18573
    }
18574
 
18575
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
18576
    public boolean isSet(_Fields field) {
18577
      if (field == null) {
18578
        throw new IllegalArgumentException();
18579
      }
18580
 
18581
      switch (field) {
18582
      }
18583
      throw new IllegalStateException();
18584
    }
18585
 
18586
    @Override
18587
    public boolean equals(Object that) {
18588
      if (that == null)
18589
        return false;
18590
      if (that instanceof addVoucher_result)
18591
        return this.equals((addVoucher_result)that);
18592
      return false;
18593
    }
18594
 
18595
    public boolean equals(addVoucher_result that) {
18596
      if (that == null)
18597
        return false;
18598
 
18599
      return true;
18600
    }
18601
 
18602
    @Override
18603
    public int hashCode() {
18604
      return 0;
18605
    }
18606
 
18607
    public int compareTo(addVoucher_result other) {
18608
      if (!getClass().equals(other.getClass())) {
18609
        return getClass().getName().compareTo(other.getClass().getName());
18610
      }
18611
 
18612
      int lastComparison = 0;
18613
      addVoucher_result typedOther = (addVoucher_result)other;
18614
 
18615
      return 0;
18616
    }
18617
 
18618
    public _Fields fieldForId(int fieldId) {
18619
      return _Fields.findByThriftId(fieldId);
18620
    }
18621
 
18622
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
18623
      org.apache.thrift.protocol.TField field;
18624
      iprot.readStructBegin();
18625
      while (true)
18626
      {
18627
        field = iprot.readFieldBegin();
18628
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
18629
          break;
18630
        }
18631
        switch (field.id) {
18632
          default:
18633
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18634
        }
18635
        iprot.readFieldEnd();
18636
      }
18637
      iprot.readStructEnd();
18638
      validate();
18639
    }
18640
 
18641
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
18642
      oprot.writeStructBegin(STRUCT_DESC);
18643
 
18644
      oprot.writeFieldStop();
18645
      oprot.writeStructEnd();
18646
    }
18647
 
18648
    @Override
18649
    public String toString() {
18650
      StringBuilder sb = new StringBuilder("addVoucher_result(");
18651
      boolean first = true;
18652
 
18653
      sb.append(")");
18654
      return sb.toString();
18655
    }
18656
 
18657
    public void validate() throws org.apache.thrift.TException {
18658
      // check for required fields
18659
    }
18660
 
18661
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
18662
      try {
18663
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
18664
      } catch (org.apache.thrift.TException te) {
18665
        throw new java.io.IOException(te);
18666
      }
18667
    }
18668
 
18669
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
18670
      try {
18671
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
18672
      } catch (org.apache.thrift.TException te) {
18673
        throw new java.io.IOException(te);
18674
      }
18675
    }
18676
 
18677
  }
18678
 
18679
  public static class assignVoucher_args implements org.apache.thrift.TBase<assignVoucher_args, assignVoucher_args._Fields>, java.io.Serializable, Cloneable   {
18680
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_args");
18681
 
18682
    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);
18683
    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);
18684
    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);
18685
    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);
18686
 
18687
    private long userId; // required
18688
    private String userEmail; // required
18689
    private VoucherType voucherType; // required
18690
    private long amount; // required
18691
 
18692
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
18693
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
18694
      USER_ID((short)1, "userId"),
18695
      USER_EMAIL((short)2, "userEmail"),
18696
      /**
18697
       * 
18698
       * @see VoucherType
18699
       */
18700
      VOUCHER_TYPE((short)3, "voucherType"),
18701
      AMOUNT((short)4, "amount");
18702
 
18703
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
18704
 
18705
      static {
18706
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
18707
          byName.put(field.getFieldName(), field);
18708
        }
18709
      }
18710
 
18711
      /**
18712
       * Find the _Fields constant that matches fieldId, or null if its not found.
18713
       */
18714
      public static _Fields findByThriftId(int fieldId) {
18715
        switch(fieldId) {
18716
          case 1: // USER_ID
18717
            return USER_ID;
18718
          case 2: // USER_EMAIL
18719
            return USER_EMAIL;
18720
          case 3: // VOUCHER_TYPE
18721
            return VOUCHER_TYPE;
18722
          case 4: // AMOUNT
18723
            return AMOUNT;
18724
          default:
18725
            return null;
18726
        }
18727
      }
18728
 
18729
      /**
18730
       * Find the _Fields constant that matches fieldId, throwing an exception
18731
       * if it is not found.
18732
       */
18733
      public static _Fields findByThriftIdOrThrow(int fieldId) {
18734
        _Fields fields = findByThriftId(fieldId);
18735
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
18736
        return fields;
18737
      }
18738
 
18739
      /**
18740
       * Find the _Fields constant that matches name, or null if its not found.
18741
       */
18742
      public static _Fields findByName(String name) {
18743
        return byName.get(name);
18744
      }
18745
 
18746
      private final short _thriftId;
18747
      private final String _fieldName;
18748
 
18749
      _Fields(short thriftId, String fieldName) {
18750
        _thriftId = thriftId;
18751
        _fieldName = fieldName;
18752
      }
18753
 
18754
      public short getThriftFieldId() {
18755
        return _thriftId;
18756
      }
18757
 
18758
      public String getFieldName() {
18759
        return _fieldName;
18760
      }
18761
    }
18762
 
18763
    // isset id assignments
18764
    private static final int __USERID_ISSET_ID = 0;
18765
    private static final int __AMOUNT_ISSET_ID = 1;
18766
    private BitSet __isset_bit_vector = new BitSet(2);
18767
 
18768
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
18769
    static {
18770
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
18771
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18772
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
18773
      tmpMap.put(_Fields.USER_EMAIL, new org.apache.thrift.meta_data.FieldMetaData("userEmail", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18774
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
18775
      tmpMap.put(_Fields.VOUCHER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("voucherType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18776
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, VoucherType.class)));
18777
      tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18778
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
18779
      metaDataMap = Collections.unmodifiableMap(tmpMap);
18780
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_args.class, metaDataMap);
18781
    }
18782
 
18783
    public assignVoucher_args() {
18784
    }
18785
 
18786
    public assignVoucher_args(
18787
      long userId,
18788
      String userEmail,
18789
      VoucherType voucherType,
18790
      long amount)
18791
    {
18792
      this();
18793
      this.userId = userId;
18794
      setUserIdIsSet(true);
18795
      this.userEmail = userEmail;
18796
      this.voucherType = voucherType;
18797
      this.amount = amount;
18798
      setAmountIsSet(true);
18799
    }
18800
 
18801
    /**
18802
     * Performs a deep copy on <i>other</i>.
18803
     */
18804
    public assignVoucher_args(assignVoucher_args other) {
18805
      __isset_bit_vector.clear();
18806
      __isset_bit_vector.or(other.__isset_bit_vector);
18807
      this.userId = other.userId;
18808
      if (other.isSetUserEmail()) {
18809
        this.userEmail = other.userEmail;
18810
      }
18811
      if (other.isSetVoucherType()) {
18812
        this.voucherType = other.voucherType;
18813
      }
18814
      this.amount = other.amount;
18815
    }
18816
 
18817
    public assignVoucher_args deepCopy() {
18818
      return new assignVoucher_args(this);
18819
    }
18820
 
18821
    @Override
18822
    public void clear() {
18823
      setUserIdIsSet(false);
18824
      this.userId = 0;
18825
      this.userEmail = null;
18826
      this.voucherType = null;
18827
      setAmountIsSet(false);
18828
      this.amount = 0;
18829
    }
18830
 
18831
    public long getUserId() {
18832
      return this.userId;
18833
    }
18834
 
18835
    public void setUserId(long userId) {
18836
      this.userId = userId;
18837
      setUserIdIsSet(true);
18838
    }
18839
 
18840
    public void unsetUserId() {
18841
      __isset_bit_vector.clear(__USERID_ISSET_ID);
18842
    }
18843
 
18844
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
18845
    public boolean isSetUserId() {
18846
      return __isset_bit_vector.get(__USERID_ISSET_ID);
18847
    }
18848
 
18849
    public void setUserIdIsSet(boolean value) {
18850
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
18851
    }
18852
 
18853
    public String getUserEmail() {
18854
      return this.userEmail;
18855
    }
18856
 
18857
    public void setUserEmail(String userEmail) {
18858
      this.userEmail = userEmail;
18859
    }
18860
 
18861
    public void unsetUserEmail() {
18862
      this.userEmail = null;
18863
    }
18864
 
18865
    /** Returns true if field userEmail is set (has been assigned a value) and false otherwise */
18866
    public boolean isSetUserEmail() {
18867
      return this.userEmail != null;
18868
    }
18869
 
18870
    public void setUserEmailIsSet(boolean value) {
18871
      if (!value) {
18872
        this.userEmail = null;
18873
      }
18874
    }
18875
 
18876
    /**
18877
     * 
18878
     * @see VoucherType
18879
     */
18880
    public VoucherType getVoucherType() {
18881
      return this.voucherType;
18882
    }
18883
 
18884
    /**
18885
     * 
18886
     * @see VoucherType
18887
     */
18888
    public void setVoucherType(VoucherType voucherType) {
18889
      this.voucherType = voucherType;
18890
    }
18891
 
18892
    public void unsetVoucherType() {
18893
      this.voucherType = null;
18894
    }
18895
 
18896
    /** Returns true if field voucherType is set (has been assigned a value) and false otherwise */
18897
    public boolean isSetVoucherType() {
18898
      return this.voucherType != null;
18899
    }
18900
 
18901
    public void setVoucherTypeIsSet(boolean value) {
18902
      if (!value) {
18903
        this.voucherType = null;
18904
      }
18905
    }
18906
 
18907
    public long getAmount() {
18908
      return this.amount;
18909
    }
18910
 
18911
    public void setAmount(long amount) {
18912
      this.amount = amount;
18913
      setAmountIsSet(true);
18914
    }
18915
 
18916
    public void unsetAmount() {
18917
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
18918
    }
18919
 
18920
    /** Returns true if field amount is set (has been assigned a value) and false otherwise */
18921
    public boolean isSetAmount() {
18922
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
18923
    }
18924
 
18925
    public void setAmountIsSet(boolean value) {
18926
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
18927
    }
18928
 
18929
    public void setFieldValue(_Fields field, Object value) {
18930
      switch (field) {
18931
      case USER_ID:
18932
        if (value == null) {
18933
          unsetUserId();
18934
        } else {
18935
          setUserId((Long)value);
18936
        }
18937
        break;
18938
 
18939
      case USER_EMAIL:
18940
        if (value == null) {
18941
          unsetUserEmail();
18942
        } else {
18943
          setUserEmail((String)value);
18944
        }
18945
        break;
18946
 
18947
      case VOUCHER_TYPE:
18948
        if (value == null) {
18949
          unsetVoucherType();
18950
        } else {
18951
          setVoucherType((VoucherType)value);
18952
        }
18953
        break;
18954
 
18955
      case AMOUNT:
18956
        if (value == null) {
18957
          unsetAmount();
18958
        } else {
18959
          setAmount((Long)value);
18960
        }
18961
        break;
18962
 
18963
      }
18964
    }
18965
 
18966
    public Object getFieldValue(_Fields field) {
18967
      switch (field) {
18968
      case USER_ID:
18969
        return Long.valueOf(getUserId());
18970
 
18971
      case USER_EMAIL:
18972
        return getUserEmail();
18973
 
18974
      case VOUCHER_TYPE:
18975
        return getVoucherType();
18976
 
18977
      case AMOUNT:
18978
        return Long.valueOf(getAmount());
18979
 
18980
      }
18981
      throw new IllegalStateException();
18982
    }
18983
 
18984
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
18985
    public boolean isSet(_Fields field) {
18986
      if (field == null) {
18987
        throw new IllegalArgumentException();
18988
      }
18989
 
18990
      switch (field) {
18991
      case USER_ID:
18992
        return isSetUserId();
18993
      case USER_EMAIL:
18994
        return isSetUserEmail();
18995
      case VOUCHER_TYPE:
18996
        return isSetVoucherType();
18997
      case AMOUNT:
18998
        return isSetAmount();
18999
      }
19000
      throw new IllegalStateException();
19001
    }
19002
 
19003
    @Override
19004
    public boolean equals(Object that) {
19005
      if (that == null)
19006
        return false;
19007
      if (that instanceof assignVoucher_args)
19008
        return this.equals((assignVoucher_args)that);
19009
      return false;
19010
    }
19011
 
19012
    public boolean equals(assignVoucher_args that) {
19013
      if (that == null)
19014
        return false;
19015
 
19016
      boolean this_present_userId = true;
19017
      boolean that_present_userId = true;
19018
      if (this_present_userId || that_present_userId) {
19019
        if (!(this_present_userId && that_present_userId))
19020
          return false;
19021
        if (this.userId != that.userId)
19022
          return false;
19023
      }
19024
 
19025
      boolean this_present_userEmail = true && this.isSetUserEmail();
19026
      boolean that_present_userEmail = true && that.isSetUserEmail();
19027
      if (this_present_userEmail || that_present_userEmail) {
19028
        if (!(this_present_userEmail && that_present_userEmail))
19029
          return false;
19030
        if (!this.userEmail.equals(that.userEmail))
19031
          return false;
19032
      }
19033
 
19034
      boolean this_present_voucherType = true && this.isSetVoucherType();
19035
      boolean that_present_voucherType = true && that.isSetVoucherType();
19036
      if (this_present_voucherType || that_present_voucherType) {
19037
        if (!(this_present_voucherType && that_present_voucherType))
19038
          return false;
19039
        if (!this.voucherType.equals(that.voucherType))
19040
          return false;
19041
      }
19042
 
19043
      boolean this_present_amount = true;
19044
      boolean that_present_amount = true;
19045
      if (this_present_amount || that_present_amount) {
19046
        if (!(this_present_amount && that_present_amount))
19047
          return false;
19048
        if (this.amount != that.amount)
19049
          return false;
19050
      }
19051
 
19052
      return true;
19053
    }
19054
 
19055
    @Override
19056
    public int hashCode() {
19057
      return 0;
19058
    }
19059
 
19060
    public int compareTo(assignVoucher_args other) {
19061
      if (!getClass().equals(other.getClass())) {
19062
        return getClass().getName().compareTo(other.getClass().getName());
19063
      }
19064
 
19065
      int lastComparison = 0;
19066
      assignVoucher_args typedOther = (assignVoucher_args)other;
19067
 
19068
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
19069
      if (lastComparison != 0) {
19070
        return lastComparison;
19071
      }
19072
      if (isSetUserId()) {
19073
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
19074
        if (lastComparison != 0) {
19075
          return lastComparison;
19076
        }
19077
      }
19078
      lastComparison = Boolean.valueOf(isSetUserEmail()).compareTo(typedOther.isSetUserEmail());
19079
      if (lastComparison != 0) {
19080
        return lastComparison;
19081
      }
19082
      if (isSetUserEmail()) {
19083
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userEmail, typedOther.userEmail);
19084
        if (lastComparison != 0) {
19085
          return lastComparison;
19086
        }
19087
      }
19088
      lastComparison = Boolean.valueOf(isSetVoucherType()).compareTo(typedOther.isSetVoucherType());
19089
      if (lastComparison != 0) {
19090
        return lastComparison;
19091
      }
19092
      if (isSetVoucherType()) {
19093
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherType, typedOther.voucherType);
19094
        if (lastComparison != 0) {
19095
          return lastComparison;
19096
        }
19097
      }
19098
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
19099
      if (lastComparison != 0) {
19100
        return lastComparison;
19101
      }
19102
      if (isSetAmount()) {
19103
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
19104
        if (lastComparison != 0) {
19105
          return lastComparison;
19106
        }
19107
      }
19108
      return 0;
19109
    }
19110
 
19111
    public _Fields fieldForId(int fieldId) {
19112
      return _Fields.findByThriftId(fieldId);
19113
    }
19114
 
19115
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
19116
      org.apache.thrift.protocol.TField field;
19117
      iprot.readStructBegin();
19118
      while (true)
19119
      {
19120
        field = iprot.readFieldBegin();
19121
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
19122
          break;
19123
        }
19124
        switch (field.id) {
19125
          case 1: // USER_ID
19126
            if (field.type == org.apache.thrift.protocol.TType.I64) {
19127
              this.userId = iprot.readI64();
19128
              setUserIdIsSet(true);
19129
            } else { 
19130
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19131
            }
19132
            break;
19133
          case 2: // USER_EMAIL
19134
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
19135
              this.userEmail = iprot.readString();
19136
            } else { 
19137
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19138
            }
19139
            break;
19140
          case 3: // VOUCHER_TYPE
19141
            if (field.type == org.apache.thrift.protocol.TType.I32) {
19142
              this.voucherType = VoucherType.findByValue(iprot.readI32());
19143
            } else { 
19144
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19145
            }
19146
            break;
19147
          case 4: // AMOUNT
19148
            if (field.type == org.apache.thrift.protocol.TType.I64) {
19149
              this.amount = iprot.readI64();
19150
              setAmountIsSet(true);
19151
            } else { 
19152
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19153
            }
19154
            break;
19155
          default:
19156
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19157
        }
19158
        iprot.readFieldEnd();
19159
      }
19160
      iprot.readStructEnd();
19161
      validate();
19162
    }
19163
 
19164
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
19165
      validate();
19166
 
19167
      oprot.writeStructBegin(STRUCT_DESC);
19168
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
19169
      oprot.writeI64(this.userId);
19170
      oprot.writeFieldEnd();
19171
      if (this.userEmail != null) {
19172
        oprot.writeFieldBegin(USER_EMAIL_FIELD_DESC);
19173
        oprot.writeString(this.userEmail);
19174
        oprot.writeFieldEnd();
19175
      }
19176
      if (this.voucherType != null) {
19177
        oprot.writeFieldBegin(VOUCHER_TYPE_FIELD_DESC);
19178
        oprot.writeI32(this.voucherType.getValue());
19179
        oprot.writeFieldEnd();
19180
      }
19181
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
19182
      oprot.writeI64(this.amount);
19183
      oprot.writeFieldEnd();
19184
      oprot.writeFieldStop();
19185
      oprot.writeStructEnd();
19186
    }
19187
 
19188
    @Override
19189
    public String toString() {
19190
      StringBuilder sb = new StringBuilder("assignVoucher_args(");
19191
      boolean first = true;
19192
 
19193
      sb.append("userId:");
19194
      sb.append(this.userId);
19195
      first = false;
19196
      if (!first) sb.append(", ");
19197
      sb.append("userEmail:");
19198
      if (this.userEmail == null) {
19199
        sb.append("null");
19200
      } else {
19201
        sb.append(this.userEmail);
19202
      }
19203
      first = false;
19204
      if (!first) sb.append(", ");
19205
      sb.append("voucherType:");
19206
      if (this.voucherType == null) {
19207
        sb.append("null");
19208
      } else {
19209
        sb.append(this.voucherType);
19210
      }
19211
      first = false;
19212
      if (!first) sb.append(", ");
19213
      sb.append("amount:");
19214
      sb.append(this.amount);
19215
      first = false;
19216
      sb.append(")");
19217
      return sb.toString();
19218
    }
19219
 
19220
    public void validate() throws org.apache.thrift.TException {
19221
      // check for required fields
19222
    }
19223
 
19224
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
19225
      try {
19226
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
19227
      } catch (org.apache.thrift.TException te) {
19228
        throw new java.io.IOException(te);
19229
      }
19230
    }
19231
 
19232
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
19233
      try {
19234
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
19235
        __isset_bit_vector = new BitSet(1);
19236
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
19237
      } catch (org.apache.thrift.TException te) {
19238
        throw new java.io.IOException(te);
19239
      }
19240
    }
19241
 
19242
  }
19243
 
19244
  public static class assignVoucher_result implements org.apache.thrift.TBase<assignVoucher_result, assignVoucher_result._Fields>, java.io.Serializable, Cloneable   {
19245
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_result");
19246
 
19247
    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);
19248
 
19249
    private Voucher success; // required
19250
 
19251
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
19252
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
19253
      SUCCESS((short)0, "success");
19254
 
19255
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
19256
 
19257
      static {
19258
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
19259
          byName.put(field.getFieldName(), field);
19260
        }
19261
      }
19262
 
19263
      /**
19264
       * Find the _Fields constant that matches fieldId, or null if its not found.
19265
       */
19266
      public static _Fields findByThriftId(int fieldId) {
19267
        switch(fieldId) {
19268
          case 0: // SUCCESS
19269
            return SUCCESS;
19270
          default:
19271
            return null;
19272
        }
19273
      }
19274
 
19275
      /**
19276
       * Find the _Fields constant that matches fieldId, throwing an exception
19277
       * if it is not found.
19278
       */
19279
      public static _Fields findByThriftIdOrThrow(int fieldId) {
19280
        _Fields fields = findByThriftId(fieldId);
19281
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
19282
        return fields;
19283
      }
19284
 
19285
      /**
19286
       * Find the _Fields constant that matches name, or null if its not found.
19287
       */
19288
      public static _Fields findByName(String name) {
19289
        return byName.get(name);
19290
      }
19291
 
19292
      private final short _thriftId;
19293
      private final String _fieldName;
19294
 
19295
      _Fields(short thriftId, String fieldName) {
19296
        _thriftId = thriftId;
19297
        _fieldName = fieldName;
19298
      }
19299
 
19300
      public short getThriftFieldId() {
19301
        return _thriftId;
19302
      }
19303
 
19304
      public String getFieldName() {
19305
        return _fieldName;
19306
      }
19307
    }
19308
 
19309
    // isset id assignments
19310
 
19311
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
19312
    static {
19313
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
19314
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
19315
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
19316
      metaDataMap = Collections.unmodifiableMap(tmpMap);
19317
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_result.class, metaDataMap);
19318
    }
19319
 
19320
    public assignVoucher_result() {
19321
    }
19322
 
19323
    public assignVoucher_result(
19324
      Voucher success)
19325
    {
19326
      this();
19327
      this.success = success;
19328
    }
19329
 
19330
    /**
19331
     * Performs a deep copy on <i>other</i>.
19332
     */
19333
    public assignVoucher_result(assignVoucher_result other) {
19334
      if (other.isSetSuccess()) {
19335
        this.success = new Voucher(other.success);
19336
      }
19337
    }
19338
 
19339
    public assignVoucher_result deepCopy() {
19340
      return new assignVoucher_result(this);
19341
    }
19342
 
19343
    @Override
19344
    public void clear() {
19345
      this.success = null;
19346
    }
19347
 
19348
    public Voucher getSuccess() {
19349
      return this.success;
19350
    }
19351
 
19352
    public void setSuccess(Voucher success) {
19353
      this.success = success;
19354
    }
19355
 
19356
    public void unsetSuccess() {
19357
      this.success = null;
19358
    }
19359
 
19360
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
19361
    public boolean isSetSuccess() {
19362
      return this.success != null;
19363
    }
19364
 
19365
    public void setSuccessIsSet(boolean value) {
19366
      if (!value) {
19367
        this.success = null;
19368
      }
19369
    }
19370
 
19371
    public void setFieldValue(_Fields field, Object value) {
19372
      switch (field) {
19373
      case SUCCESS:
19374
        if (value == null) {
19375
          unsetSuccess();
19376
        } else {
19377
          setSuccess((Voucher)value);
19378
        }
19379
        break;
19380
 
19381
      }
19382
    }
19383
 
19384
    public Object getFieldValue(_Fields field) {
19385
      switch (field) {
19386
      case SUCCESS:
19387
        return getSuccess();
19388
 
19389
      }
19390
      throw new IllegalStateException();
19391
    }
19392
 
19393
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
19394
    public boolean isSet(_Fields field) {
19395
      if (field == null) {
19396
        throw new IllegalArgumentException();
19397
      }
19398
 
19399
      switch (field) {
19400
      case SUCCESS:
19401
        return isSetSuccess();
19402
      }
19403
      throw new IllegalStateException();
19404
    }
19405
 
19406
    @Override
19407
    public boolean equals(Object that) {
19408
      if (that == null)
19409
        return false;
19410
      if (that instanceof assignVoucher_result)
19411
        return this.equals((assignVoucher_result)that);
19412
      return false;
19413
    }
19414
 
19415
    public boolean equals(assignVoucher_result that) {
19416
      if (that == null)
19417
        return false;
19418
 
19419
      boolean this_present_success = true && this.isSetSuccess();
19420
      boolean that_present_success = true && that.isSetSuccess();
19421
      if (this_present_success || that_present_success) {
19422
        if (!(this_present_success && that_present_success))
19423
          return false;
19424
        if (!this.success.equals(that.success))
19425
          return false;
19426
      }
19427
 
19428
      return true;
19429
    }
19430
 
19431
    @Override
19432
    public int hashCode() {
19433
      return 0;
19434
    }
19435
 
19436
    public int compareTo(assignVoucher_result other) {
19437
      if (!getClass().equals(other.getClass())) {
19438
        return getClass().getName().compareTo(other.getClass().getName());
19439
      }
19440
 
19441
      int lastComparison = 0;
19442
      assignVoucher_result typedOther = (assignVoucher_result)other;
19443
 
19444
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
19445
      if (lastComparison != 0) {
19446
        return lastComparison;
19447
      }
19448
      if (isSetSuccess()) {
19449
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
19450
        if (lastComparison != 0) {
19451
          return lastComparison;
19452
        }
19453
      }
19454
      return 0;
19455
    }
19456
 
19457
    public _Fields fieldForId(int fieldId) {
19458
      return _Fields.findByThriftId(fieldId);
19459
    }
19460
 
19461
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
19462
      org.apache.thrift.protocol.TField field;
19463
      iprot.readStructBegin();
19464
      while (true)
19465
      {
19466
        field = iprot.readFieldBegin();
19467
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
19468
          break;
19469
        }
19470
        switch (field.id) {
19471
          case 0: // SUCCESS
19472
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
19473
              this.success = new Voucher();
19474
              this.success.read(iprot);
19475
            } else { 
19476
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19477
            }
19478
            break;
19479
          default:
19480
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19481
        }
19482
        iprot.readFieldEnd();
19483
      }
19484
      iprot.readStructEnd();
19485
      validate();
19486
    }
19487
 
19488
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
19489
      oprot.writeStructBegin(STRUCT_DESC);
19490
 
19491
      if (this.isSetSuccess()) {
19492
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
19493
        this.success.write(oprot);
19494
        oprot.writeFieldEnd();
19495
      }
19496
      oprot.writeFieldStop();
19497
      oprot.writeStructEnd();
19498
    }
19499
 
19500
    @Override
19501
    public String toString() {
19502
      StringBuilder sb = new StringBuilder("assignVoucher_result(");
19503
      boolean first = true;
19504
 
19505
      sb.append("success:");
19506
      if (this.success == null) {
19507
        sb.append("null");
19508
      } else {
19509
        sb.append(this.success);
19510
      }
19511
      first = false;
19512
      sb.append(")");
19513
      return sb.toString();
19514
    }
19515
 
19516
    public void validate() throws org.apache.thrift.TException {
19517
      // check for required fields
19518
    }
19519
 
19520
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
19521
      try {
19522
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
19523
      } catch (org.apache.thrift.TException te) {
19524
        throw new java.io.IOException(te);
19525
      }
19526
    }
19527
 
19528
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
19529
      try {
19530
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
19531
      } catch (org.apache.thrift.TException te) {
19532
        throw new java.io.IOException(te);
19533
      }
19534
    }
19535
 
19536
  }
19537
 
19538
  public static class markVoucherAsRedeemed_args implements org.apache.thrift.TBase<markVoucherAsRedeemed_args, markVoucherAsRedeemed_args._Fields>, java.io.Serializable, Cloneable   {
19539
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_args");
19540
 
19541
    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);
19542
    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);
19543
 
19544
    private String voucherCode; // required
19545
    private long redeemedOn; // required
19546
 
19547
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
19548
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
19549
      VOUCHER_CODE((short)1, "voucherCode"),
19550
      REDEEMED_ON((short)2, "redeemedOn");
19551
 
19552
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
19553
 
19554
      static {
19555
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
19556
          byName.put(field.getFieldName(), field);
19557
        }
19558
      }
19559
 
19560
      /**
19561
       * Find the _Fields constant that matches fieldId, or null if its not found.
19562
       */
19563
      public static _Fields findByThriftId(int fieldId) {
19564
        switch(fieldId) {
19565
          case 1: // VOUCHER_CODE
19566
            return VOUCHER_CODE;
19567
          case 2: // REDEEMED_ON
19568
            return REDEEMED_ON;
19569
          default:
19570
            return null;
19571
        }
19572
      }
19573
 
19574
      /**
19575
       * Find the _Fields constant that matches fieldId, throwing an exception
19576
       * if it is not found.
19577
       */
19578
      public static _Fields findByThriftIdOrThrow(int fieldId) {
19579
        _Fields fields = findByThriftId(fieldId);
19580
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
19581
        return fields;
19582
      }
19583
 
19584
      /**
19585
       * Find the _Fields constant that matches name, or null if its not found.
19586
       */
19587
      public static _Fields findByName(String name) {
19588
        return byName.get(name);
19589
      }
19590
 
19591
      private final short _thriftId;
19592
      private final String _fieldName;
19593
 
19594
      _Fields(short thriftId, String fieldName) {
19595
        _thriftId = thriftId;
19596
        _fieldName = fieldName;
19597
      }
19598
 
19599
      public short getThriftFieldId() {
19600
        return _thriftId;
19601
      }
19602
 
19603
      public String getFieldName() {
19604
        return _fieldName;
19605
      }
19606
    }
19607
 
19608
    // isset id assignments
19609
    private static final int __REDEEMEDON_ISSET_ID = 0;
19610
    private BitSet __isset_bit_vector = new BitSet(1);
19611
 
19612
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
19613
    static {
19614
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
19615
      tmpMap.put(_Fields.VOUCHER_CODE, new org.apache.thrift.meta_data.FieldMetaData("voucherCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
19616
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
19617
      tmpMap.put(_Fields.REDEEMED_ON, new org.apache.thrift.meta_data.FieldMetaData("redeemedOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
19618
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
19619
      metaDataMap = Collections.unmodifiableMap(tmpMap);
19620
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_args.class, metaDataMap);
19621
    }
19622
 
19623
    public markVoucherAsRedeemed_args() {
19624
    }
19625
 
19626
    public markVoucherAsRedeemed_args(
19627
      String voucherCode,
19628
      long redeemedOn)
19629
    {
19630
      this();
19631
      this.voucherCode = voucherCode;
19632
      this.redeemedOn = redeemedOn;
19633
      setRedeemedOnIsSet(true);
19634
    }
19635
 
19636
    /**
19637
     * Performs a deep copy on <i>other</i>.
19638
     */
19639
    public markVoucherAsRedeemed_args(markVoucherAsRedeemed_args other) {
19640
      __isset_bit_vector.clear();
19641
      __isset_bit_vector.or(other.__isset_bit_vector);
19642
      if (other.isSetVoucherCode()) {
19643
        this.voucherCode = other.voucherCode;
19644
      }
19645
      this.redeemedOn = other.redeemedOn;
19646
    }
19647
 
19648
    public markVoucherAsRedeemed_args deepCopy() {
19649
      return new markVoucherAsRedeemed_args(this);
19650
    }
19651
 
19652
    @Override
19653
    public void clear() {
19654
      this.voucherCode = null;
19655
      setRedeemedOnIsSet(false);
19656
      this.redeemedOn = 0;
19657
    }
19658
 
19659
    public String getVoucherCode() {
19660
      return this.voucherCode;
19661
    }
19662
 
19663
    public void setVoucherCode(String voucherCode) {
19664
      this.voucherCode = voucherCode;
19665
    }
19666
 
19667
    public void unsetVoucherCode() {
19668
      this.voucherCode = null;
19669
    }
19670
 
19671
    /** Returns true if field voucherCode is set (has been assigned a value) and false otherwise */
19672
    public boolean isSetVoucherCode() {
19673
      return this.voucherCode != null;
19674
    }
19675
 
19676
    public void setVoucherCodeIsSet(boolean value) {
19677
      if (!value) {
19678
        this.voucherCode = null;
19679
      }
19680
    }
19681
 
19682
    public long getRedeemedOn() {
19683
      return this.redeemedOn;
19684
    }
19685
 
19686
    public void setRedeemedOn(long redeemedOn) {
19687
      this.redeemedOn = redeemedOn;
19688
      setRedeemedOnIsSet(true);
19689
    }
19690
 
19691
    public void unsetRedeemedOn() {
19692
      __isset_bit_vector.clear(__REDEEMEDON_ISSET_ID);
19693
    }
19694
 
19695
    /** Returns true if field redeemedOn is set (has been assigned a value) and false otherwise */
19696
    public boolean isSetRedeemedOn() {
19697
      return __isset_bit_vector.get(__REDEEMEDON_ISSET_ID);
19698
    }
19699
 
19700
    public void setRedeemedOnIsSet(boolean value) {
19701
      __isset_bit_vector.set(__REDEEMEDON_ISSET_ID, value);
19702
    }
19703
 
19704
    public void setFieldValue(_Fields field, Object value) {
19705
      switch (field) {
19706
      case VOUCHER_CODE:
19707
        if (value == null) {
19708
          unsetVoucherCode();
19709
        } else {
19710
          setVoucherCode((String)value);
19711
        }
19712
        break;
19713
 
19714
      case REDEEMED_ON:
19715
        if (value == null) {
19716
          unsetRedeemedOn();
19717
        } else {
19718
          setRedeemedOn((Long)value);
19719
        }
19720
        break;
19721
 
19722
      }
19723
    }
19724
 
19725
    public Object getFieldValue(_Fields field) {
19726
      switch (field) {
19727
      case VOUCHER_CODE:
19728
        return getVoucherCode();
19729
 
19730
      case REDEEMED_ON:
19731
        return Long.valueOf(getRedeemedOn());
19732
 
19733
      }
19734
      throw new IllegalStateException();
19735
    }
19736
 
19737
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
19738
    public boolean isSet(_Fields field) {
19739
      if (field == null) {
19740
        throw new IllegalArgumentException();
19741
      }
19742
 
19743
      switch (field) {
19744
      case VOUCHER_CODE:
19745
        return isSetVoucherCode();
19746
      case REDEEMED_ON:
19747
        return isSetRedeemedOn();
19748
      }
19749
      throw new IllegalStateException();
19750
    }
19751
 
19752
    @Override
19753
    public boolean equals(Object that) {
19754
      if (that == null)
19755
        return false;
19756
      if (that instanceof markVoucherAsRedeemed_args)
19757
        return this.equals((markVoucherAsRedeemed_args)that);
19758
      return false;
19759
    }
19760
 
19761
    public boolean equals(markVoucherAsRedeemed_args that) {
19762
      if (that == null)
19763
        return false;
19764
 
19765
      boolean this_present_voucherCode = true && this.isSetVoucherCode();
19766
      boolean that_present_voucherCode = true && that.isSetVoucherCode();
19767
      if (this_present_voucherCode || that_present_voucherCode) {
19768
        if (!(this_present_voucherCode && that_present_voucherCode))
19769
          return false;
19770
        if (!this.voucherCode.equals(that.voucherCode))
19771
          return false;
19772
      }
19773
 
19774
      boolean this_present_redeemedOn = true;
19775
      boolean that_present_redeemedOn = true;
19776
      if (this_present_redeemedOn || that_present_redeemedOn) {
19777
        if (!(this_present_redeemedOn && that_present_redeemedOn))
19778
          return false;
19779
        if (this.redeemedOn != that.redeemedOn)
19780
          return false;
19781
      }
19782
 
19783
      return true;
19784
    }
19785
 
19786
    @Override
19787
    public int hashCode() {
19788
      return 0;
19789
    }
19790
 
19791
    public int compareTo(markVoucherAsRedeemed_args other) {
19792
      if (!getClass().equals(other.getClass())) {
19793
        return getClass().getName().compareTo(other.getClass().getName());
19794
      }
19795
 
19796
      int lastComparison = 0;
19797
      markVoucherAsRedeemed_args typedOther = (markVoucherAsRedeemed_args)other;
19798
 
19799
      lastComparison = Boolean.valueOf(isSetVoucherCode()).compareTo(typedOther.isSetVoucherCode());
19800
      if (lastComparison != 0) {
19801
        return lastComparison;
19802
      }
19803
      if (isSetVoucherCode()) {
19804
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherCode, typedOther.voucherCode);
19805
        if (lastComparison != 0) {
19806
          return lastComparison;
19807
        }
19808
      }
19809
      lastComparison = Boolean.valueOf(isSetRedeemedOn()).compareTo(typedOther.isSetRedeemedOn());
19810
      if (lastComparison != 0) {
19811
        return lastComparison;
19812
      }
19813
      if (isSetRedeemedOn()) {
19814
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.redeemedOn, typedOther.redeemedOn);
19815
        if (lastComparison != 0) {
19816
          return lastComparison;
19817
        }
19818
      }
19819
      return 0;
19820
    }
19821
 
19822
    public _Fields fieldForId(int fieldId) {
19823
      return _Fields.findByThriftId(fieldId);
19824
    }
19825
 
19826
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
19827
      org.apache.thrift.protocol.TField field;
19828
      iprot.readStructBegin();
19829
      while (true)
19830
      {
19831
        field = iprot.readFieldBegin();
19832
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
19833
          break;
19834
        }
19835
        switch (field.id) {
19836
          case 1: // VOUCHER_CODE
19837
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
19838
              this.voucherCode = iprot.readString();
19839
            } else { 
19840
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19841
            }
19842
            break;
19843
          case 2: // REDEEMED_ON
19844
            if (field.type == org.apache.thrift.protocol.TType.I64) {
19845
              this.redeemedOn = iprot.readI64();
19846
              setRedeemedOnIsSet(true);
19847
            } else { 
19848
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19849
            }
19850
            break;
19851
          default:
19852
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19853
        }
19854
        iprot.readFieldEnd();
19855
      }
19856
      iprot.readStructEnd();
19857
      validate();
19858
    }
19859
 
19860
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
19861
      validate();
19862
 
19863
      oprot.writeStructBegin(STRUCT_DESC);
19864
      if (this.voucherCode != null) {
19865
        oprot.writeFieldBegin(VOUCHER_CODE_FIELD_DESC);
19866
        oprot.writeString(this.voucherCode);
19867
        oprot.writeFieldEnd();
19868
      }
19869
      oprot.writeFieldBegin(REDEEMED_ON_FIELD_DESC);
19870
      oprot.writeI64(this.redeemedOn);
19871
      oprot.writeFieldEnd();
19872
      oprot.writeFieldStop();
19873
      oprot.writeStructEnd();
19874
    }
19875
 
19876
    @Override
19877
    public String toString() {
19878
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_args(");
19879
      boolean first = true;
19880
 
19881
      sb.append("voucherCode:");
19882
      if (this.voucherCode == null) {
19883
        sb.append("null");
19884
      } else {
19885
        sb.append(this.voucherCode);
19886
      }
19887
      first = false;
19888
      if (!first) sb.append(", ");
19889
      sb.append("redeemedOn:");
19890
      sb.append(this.redeemedOn);
19891
      first = false;
19892
      sb.append(")");
19893
      return sb.toString();
19894
    }
19895
 
19896
    public void validate() throws org.apache.thrift.TException {
19897
      // check for required fields
19898
    }
19899
 
19900
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
19901
      try {
19902
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
19903
      } catch (org.apache.thrift.TException te) {
19904
        throw new java.io.IOException(te);
19905
      }
19906
    }
19907
 
19908
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
19909
      try {
19910
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
19911
        __isset_bit_vector = new BitSet(1);
19912
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
19913
      } catch (org.apache.thrift.TException te) {
19914
        throw new java.io.IOException(te);
19915
      }
19916
    }
19917
 
19918
  }
19919
 
19920
  public static class markVoucherAsRedeemed_result implements org.apache.thrift.TBase<markVoucherAsRedeemed_result, markVoucherAsRedeemed_result._Fields>, java.io.Serializable, Cloneable   {
19921
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_result");
19922
 
19923
    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);
19924
 
19925
    private boolean success; // required
19926
 
19927
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
19928
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
19929
      SUCCESS((short)0, "success");
19930
 
19931
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
19932
 
19933
      static {
19934
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
19935
          byName.put(field.getFieldName(), field);
19936
        }
19937
      }
19938
 
19939
      /**
19940
       * Find the _Fields constant that matches fieldId, or null if its not found.
19941
       */
19942
      public static _Fields findByThriftId(int fieldId) {
19943
        switch(fieldId) {
19944
          case 0: // SUCCESS
19945
            return SUCCESS;
19946
          default:
19947
            return null;
19948
        }
19949
      }
19950
 
19951
      /**
19952
       * Find the _Fields constant that matches fieldId, throwing an exception
19953
       * if it is not found.
19954
       */
19955
      public static _Fields findByThriftIdOrThrow(int fieldId) {
19956
        _Fields fields = findByThriftId(fieldId);
19957
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
19958
        return fields;
19959
      }
19960
 
19961
      /**
19962
       * Find the _Fields constant that matches name, or null if its not found.
19963
       */
19964
      public static _Fields findByName(String name) {
19965
        return byName.get(name);
19966
      }
19967
 
19968
      private final short _thriftId;
19969
      private final String _fieldName;
19970
 
19971
      _Fields(short thriftId, String fieldName) {
19972
        _thriftId = thriftId;
19973
        _fieldName = fieldName;
19974
      }
19975
 
19976
      public short getThriftFieldId() {
19977
        return _thriftId;
19978
      }
19979
 
19980
      public String getFieldName() {
19981
        return _fieldName;
19982
      }
19983
    }
19984
 
19985
    // isset id assignments
19986
    private static final int __SUCCESS_ISSET_ID = 0;
19987
    private BitSet __isset_bit_vector = new BitSet(1);
19988
 
19989
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
19990
    static {
19991
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
19992
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
19993
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
19994
      metaDataMap = Collections.unmodifiableMap(tmpMap);
19995
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_result.class, metaDataMap);
19996
    }
19997
 
19998
    public markVoucherAsRedeemed_result() {
19999
    }
20000
 
20001
    public markVoucherAsRedeemed_result(
20002
      boolean success)
20003
    {
20004
      this();
20005
      this.success = success;
20006
      setSuccessIsSet(true);
20007
    }
20008
 
20009
    /**
20010
     * Performs a deep copy on <i>other</i>.
20011
     */
20012
    public markVoucherAsRedeemed_result(markVoucherAsRedeemed_result other) {
20013
      __isset_bit_vector.clear();
20014
      __isset_bit_vector.or(other.__isset_bit_vector);
20015
      this.success = other.success;
20016
    }
20017
 
20018
    public markVoucherAsRedeemed_result deepCopy() {
20019
      return new markVoucherAsRedeemed_result(this);
20020
    }
20021
 
20022
    @Override
20023
    public void clear() {
20024
      setSuccessIsSet(false);
20025
      this.success = false;
20026
    }
20027
 
20028
    public boolean isSuccess() {
20029
      return this.success;
20030
    }
20031
 
20032
    public void setSuccess(boolean success) {
20033
      this.success = success;
20034
      setSuccessIsSet(true);
20035
    }
20036
 
20037
    public void unsetSuccess() {
20038
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
20039
    }
20040
 
20041
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
20042
    public boolean isSetSuccess() {
20043
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
20044
    }
20045
 
20046
    public void setSuccessIsSet(boolean value) {
20047
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
20048
    }
20049
 
20050
    public void setFieldValue(_Fields field, Object value) {
20051
      switch (field) {
20052
      case SUCCESS:
20053
        if (value == null) {
20054
          unsetSuccess();
20055
        } else {
20056
          setSuccess((Boolean)value);
20057
        }
20058
        break;
20059
 
20060
      }
20061
    }
20062
 
20063
    public Object getFieldValue(_Fields field) {
20064
      switch (field) {
20065
      case SUCCESS:
20066
        return Boolean.valueOf(isSuccess());
20067
 
20068
      }
20069
      throw new IllegalStateException();
20070
    }
20071
 
20072
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
20073
    public boolean isSet(_Fields field) {
20074
      if (field == null) {
20075
        throw new IllegalArgumentException();
20076
      }
20077
 
20078
      switch (field) {
20079
      case SUCCESS:
20080
        return isSetSuccess();
20081
      }
20082
      throw new IllegalStateException();
20083
    }
20084
 
20085
    @Override
20086
    public boolean equals(Object that) {
20087
      if (that == null)
20088
        return false;
20089
      if (that instanceof markVoucherAsRedeemed_result)
20090
        return this.equals((markVoucherAsRedeemed_result)that);
20091
      return false;
20092
    }
20093
 
20094
    public boolean equals(markVoucherAsRedeemed_result that) {
20095
      if (that == null)
20096
        return false;
20097
 
20098
      boolean this_present_success = true;
20099
      boolean that_present_success = true;
20100
      if (this_present_success || that_present_success) {
20101
        if (!(this_present_success && that_present_success))
20102
          return false;
20103
        if (this.success != that.success)
20104
          return false;
20105
      }
20106
 
20107
      return true;
20108
    }
20109
 
20110
    @Override
20111
    public int hashCode() {
20112
      return 0;
20113
    }
20114
 
20115
    public int compareTo(markVoucherAsRedeemed_result other) {
20116
      if (!getClass().equals(other.getClass())) {
20117
        return getClass().getName().compareTo(other.getClass().getName());
20118
      }
20119
 
20120
      int lastComparison = 0;
20121
      markVoucherAsRedeemed_result typedOther = (markVoucherAsRedeemed_result)other;
20122
 
20123
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
20124
      if (lastComparison != 0) {
20125
        return lastComparison;
20126
      }
20127
      if (isSetSuccess()) {
20128
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
20129
        if (lastComparison != 0) {
20130
          return lastComparison;
20131
        }
20132
      }
20133
      return 0;
20134
    }
20135
 
20136
    public _Fields fieldForId(int fieldId) {
20137
      return _Fields.findByThriftId(fieldId);
20138
    }
20139
 
20140
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
20141
      org.apache.thrift.protocol.TField field;
20142
      iprot.readStructBegin();
20143
      while (true)
20144
      {
20145
        field = iprot.readFieldBegin();
20146
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
20147
          break;
20148
        }
20149
        switch (field.id) {
20150
          case 0: // SUCCESS
20151
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
20152
              this.success = iprot.readBool();
20153
              setSuccessIsSet(true);
20154
            } else { 
20155
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
20156
            }
20157
            break;
20158
          default:
20159
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
20160
        }
20161
        iprot.readFieldEnd();
20162
      }
20163
      iprot.readStructEnd();
20164
      validate();
20165
    }
20166
 
20167
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
20168
      oprot.writeStructBegin(STRUCT_DESC);
20169
 
20170
      if (this.isSetSuccess()) {
20171
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
20172
        oprot.writeBool(this.success);
20173
        oprot.writeFieldEnd();
20174
      }
20175
      oprot.writeFieldStop();
20176
      oprot.writeStructEnd();
20177
    }
20178
 
20179
    @Override
20180
    public String toString() {
20181
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_result(");
20182
      boolean first = true;
20183
 
20184
      sb.append("success:");
20185
      sb.append(this.success);
20186
      first = false;
20187
      sb.append(")");
20188
      return sb.toString();
20189
    }
20190
 
20191
    public void validate() throws org.apache.thrift.TException {
20192
      // check for required fields
20193
    }
20194
 
20195
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
20196
      try {
20197
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
20198
      } catch (org.apache.thrift.TException te) {
20199
        throw new java.io.IOException(te);
20200
      }
20201
    }
20202
 
20203
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
20204
      try {
20205
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
20206
      } catch (org.apache.thrift.TException te) {
20207
        throw new java.io.IOException(te);
20208
      }
20209
    }
20210
 
20211
  }
20212
 
1982 varun.gupt 20213
}