Subversion Repositories SmartDukaan

Rev

Rev 7746 | Rev 8707 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1982 varun.gupt 1
/**
3430 rajveer 2
 * Autogenerated by Thrift Compiler (0.7.0)
1982 varun.gupt 3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.model.v1.user;
7
 
8
import java.util.List;
9
import java.util.ArrayList;
10
import java.util.Map;
11
import java.util.HashMap;
12
import java.util.EnumMap;
13
import java.util.Set;
14
import java.util.HashSet;
15
import java.util.EnumSet;
16
import java.util.Collections;
17
import java.util.BitSet;
3430 rajveer 18
import java.nio.ByteBuffer;
1982 varun.gupt 19
import java.util.Arrays;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22
 
23
public class PromotionService {
24
 
25
  /**
26
   * Promotion Service
27
   */
3374 rajveer 28
  public interface Iface extends in.shop2020.generic.GenericService.Iface {
1982 varun.gupt 29
 
3430 rajveer 30
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 31
 
7746 amit.gupta 32
    public long removeAllCouponsByPromotionId(long promotionId) throws PromotionException, org.apache.thrift.TException;
33
 
6301 amit.gupta 34
    public Coupon getCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
35
 
36
    public boolean isGiftVoucher(String couponCode) throws PromotionException, org.apache.thrift.TException;
37
 
6356 amit.gupta 38
    public boolean isCodApplicable(String couponCode) throws PromotionException, org.apache.thrift.TException;
39
 
3430 rajveer 40
    public List<Promotion> getAllPromotions() throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 41
 
3430 rajveer 42
    public Promotion getPromotionById(long promotionId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 43
 
3430 rajveer 44
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 45
 
3430 rajveer 46
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 47
 
6736 amit.gupta 48
    public Map<Long,Double> getEmiDiscount(long cartId) throws PromotionException, org.apache.thrift.TException;
49
 
6433 anupam.sin 50
    public Map<Long,String> applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws PromotionException, org.apache.thrift.TException;
51
 
3430 rajveer 52
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 53
 
3430 rajveer 54
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 55
 
6497 amit.gupta 56
    public List<Coupon> getActiveCodes(long promotionId) throws PromotionException, org.apache.thrift.TException;
57
 
58
    public void deleteCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
59
 
7092 amit.gupta 60
    public List<Coupon> getAllCouponsByPromotionId(long promotionId) throws PromotionException, org.apache.thrift.TException;
61
 
3385 varun.gupt 62
    /**
63
     * Returns a list of active coupons
64
     */
3430 rajveer 65
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException;
3385 varun.gupt 66
 
67
    /**
6561 amit.gupta 68
     * Creates a coupon with prefix (optional, pass null)and returns couponcode if successfully created.
6250 amit.gupta 69
     * 
70
     * @param promotionId
6730 anupam.sin 71
     * @param couponCode
6679 anupam.sin 72
     * @param arguments
6356 amit.gupta 73
     * @param isCod
6561 amit.gupta 74
     * @param prefix
6250 amit.gupta 75
     */
6730 anupam.sin 76
    public String createCoupon(long promotionId, String couponCode, String arguments, boolean isCod, String prefix) throws PromotionException, org.apache.thrift.TException;
6250 amit.gupta 77
 
78
    /**
3385 varun.gupt 79
     * Returns the count of successful payments done using a given coupon
80
     * 
81
     * @param couponCode
82
     */
3430 rajveer 83
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
3385 varun.gupt 84
 
85
    /**
86
     * Returns the doc string of the rule module
87
     * 
88
     * @param ruleName
89
     */
3430 rajveer 90
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException;
3385 varun.gupt 91
 
4189 varun.gupt 92
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException;
93
 
4494 varun.gupt 94
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException;
95
 
5469 rajveer 96
    public void addVoucher(Voucher voucher) throws org.apache.thrift.TException;
97
 
98
    public Voucher assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException;
99
 
100
    public boolean markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException;
101
 
1982 varun.gupt 102
  }
103
 
3430 rajveer 104
  public interface AsyncIface extends in.shop2020.generic.GenericService .AsyncIface {
1982 varun.gupt 105
 
3430 rajveer 106
    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 107
 
7746 amit.gupta 108
    public void removeAllCouponsByPromotionId(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.removeAllCouponsByPromotionId_call> resultHandler) throws org.apache.thrift.TException;
109
 
6301 amit.gupta 110
    public void getCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCoupon_call> resultHandler) throws org.apache.thrift.TException;
111
 
112
    public void isGiftVoucher(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.isGiftVoucher_call> resultHandler) throws org.apache.thrift.TException;
113
 
6356 amit.gupta 114
    public void isCodApplicable(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.isCodApplicable_call> resultHandler) throws org.apache.thrift.TException;
115
 
3430 rajveer 116
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllPromotions_call> resultHandler) throws org.apache.thrift.TException;
117
 
118
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPromotionById_call> resultHandler) throws org.apache.thrift.TException;
119
 
120
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException;
121
 
122
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyCoupon_call> resultHandler) throws org.apache.thrift.TException;
123
 
6736 amit.gupta 124
    public void getEmiDiscount(long cartId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getEmiDiscount_call> resultHandler) throws org.apache.thrift.TException;
125
 
6433 anupam.sin 126
    public void applyRechargeCoupon(String couponCode, long totalAmount, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyRechargeCoupon_call> resultHandler) throws org.apache.thrift.TException;
127
 
3430 rajveer 128
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException;
129
 
130
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException;
131
 
6497 amit.gupta 132
    public void getActiveCodes(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getActiveCodes_call> resultHandler) throws org.apache.thrift.TException;
133
 
134
    public void deleteCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.deleteCoupon_call> resultHandler) throws org.apache.thrift.TException;
135
 
7092 amit.gupta 136
    public void getAllCouponsByPromotionId(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllCouponsByPromotionId_call> resultHandler) throws org.apache.thrift.TException;
137
 
3430 rajveer 138
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException;
139
 
6730 anupam.sin 140
    public void createCoupon(long promotionId, 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 141
 
3430 rajveer 142
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException;
143
 
144
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getRuleDocString_call> resultHandler) throws org.apache.thrift.TException;
145
 
4189 varun.gupt 146
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException;
147
 
4494 varun.gupt 148
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException;
149
 
5469 rajveer 150
    public void addVoucher(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.addVoucher_call> resultHandler) throws org.apache.thrift.TException;
151
 
152
    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;
153
 
154
    public void markVoucherAsRedeemed(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.markVoucherAsRedeemed_call> resultHandler) throws org.apache.thrift.TException;
155
 
3430 rajveer 156
  }
157
 
158
  public static class Client extends in.shop2020.generic.GenericService.Client implements Iface {
159
    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
160
      public Factory() {}
161
      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
162
        return new Client(prot);
163
      }
164
      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
165
        return new Client(iprot, oprot);
166
      }
1982 varun.gupt 167
    }
168
 
3430 rajveer 169
    public Client(org.apache.thrift.protocol.TProtocol prot)
1982 varun.gupt 170
    {
3430 rajveer 171
      super(prot, prot);
1982 varun.gupt 172
    }
173
 
3430 rajveer 174
    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
175
      super(iprot, oprot);
1982 varun.gupt 176
    }
177
 
3430 rajveer 178
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 179
    {
180
      send_createPromotion(name, ruleExecutionSrc, startOn, endOn);
181
      recv_createPromotion();
182
    }
183
 
3430 rajveer 184
    public void send_createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws org.apache.thrift.TException
1982 varun.gupt 185
    {
186
      createPromotion_args args = new createPromotion_args();
3430 rajveer 187
      args.setName(name);
188
      args.setRuleExecutionSrc(ruleExecutionSrc);
189
      args.setStartOn(startOn);
190
      args.setEndOn(endOn);
191
      sendBase("createPromotion", args);
1982 varun.gupt 192
    }
193
 
3430 rajveer 194
    public void recv_createPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 195
    {
196
      createPromotion_result result = new createPromotion_result();
3430 rajveer 197
      receiveBase(result, "createPromotion");
1982 varun.gupt 198
      if (result.pex != null) {
199
        throw result.pex;
200
      }
201
      return;
202
    }
203
 
7746 amit.gupta 204
    public long removeAllCouponsByPromotionId(long promotionId) throws PromotionException, org.apache.thrift.TException
205
    {
206
      send_removeAllCouponsByPromotionId(promotionId);
207
      return recv_removeAllCouponsByPromotionId();
208
    }
209
 
210
    public void send_removeAllCouponsByPromotionId(long promotionId) throws org.apache.thrift.TException
211
    {
212
      removeAllCouponsByPromotionId_args args = new removeAllCouponsByPromotionId_args();
213
      args.setPromotionId(promotionId);
214
      sendBase("removeAllCouponsByPromotionId", args);
215
    }
216
 
217
    public long recv_removeAllCouponsByPromotionId() throws PromotionException, org.apache.thrift.TException
218
    {
219
      removeAllCouponsByPromotionId_result result = new removeAllCouponsByPromotionId_result();
220
      receiveBase(result, "removeAllCouponsByPromotionId");
221
      if (result.isSetSuccess()) {
222
        return result.success;
223
      }
224
      if (result.pex != null) {
225
        throw result.pex;
226
      }
227
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "removeAllCouponsByPromotionId failed: unknown result");
228
    }
229
 
6301 amit.gupta 230
    public Coupon getCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
231
    {
232
      send_getCoupon(couponCode);
233
      return recv_getCoupon();
234
    }
235
 
236
    public void send_getCoupon(String couponCode) throws org.apache.thrift.TException
237
    {
238
      getCoupon_args args = new getCoupon_args();
239
      args.setCouponCode(couponCode);
240
      sendBase("getCoupon", args);
241
    }
242
 
243
    public Coupon recv_getCoupon() throws PromotionException, org.apache.thrift.TException
244
    {
245
      getCoupon_result result = new getCoupon_result();
246
      receiveBase(result, "getCoupon");
247
      if (result.isSetSuccess()) {
248
        return result.success;
249
      }
250
      if (result.pex != null) {
251
        throw result.pex;
252
      }
253
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCoupon failed: unknown result");
254
    }
255
 
256
    public boolean isGiftVoucher(String couponCode) throws PromotionException, org.apache.thrift.TException
257
    {
258
      send_isGiftVoucher(couponCode);
259
      return recv_isGiftVoucher();
260
    }
261
 
262
    public void send_isGiftVoucher(String couponCode) throws org.apache.thrift.TException
263
    {
264
      isGiftVoucher_args args = new isGiftVoucher_args();
265
      args.setCouponCode(couponCode);
266
      sendBase("isGiftVoucher", args);
267
    }
268
 
269
    public boolean recv_isGiftVoucher() throws PromotionException, org.apache.thrift.TException
270
    {
271
      isGiftVoucher_result result = new isGiftVoucher_result();
272
      receiveBase(result, "isGiftVoucher");
273
      if (result.isSetSuccess()) {
274
        return result.success;
275
      }
276
      if (result.pex != null) {
277
        throw result.pex;
278
      }
279
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isGiftVoucher failed: unknown result");
280
    }
281
 
6356 amit.gupta 282
    public boolean isCodApplicable(String couponCode) throws PromotionException, org.apache.thrift.TException
283
    {
284
      send_isCodApplicable(couponCode);
285
      return recv_isCodApplicable();
286
    }
287
 
288
    public void send_isCodApplicable(String couponCode) throws org.apache.thrift.TException
289
    {
290
      isCodApplicable_args args = new isCodApplicable_args();
291
      args.setCouponCode(couponCode);
292
      sendBase("isCodApplicable", args);
293
    }
294
 
295
    public boolean recv_isCodApplicable() throws PromotionException, org.apache.thrift.TException
296
    {
297
      isCodApplicable_result result = new isCodApplicable_result();
298
      receiveBase(result, "isCodApplicable");
299
      if (result.isSetSuccess()) {
300
        return result.success;
301
      }
302
      if (result.pex != null) {
303
        throw result.pex;
304
      }
305
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isCodApplicable failed: unknown result");
306
    }
307
 
3430 rajveer 308
    public List<Promotion> getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 309
    {
310
      send_getAllPromotions();
311
      return recv_getAllPromotions();
312
    }
313
 
3430 rajveer 314
    public void send_getAllPromotions() throws org.apache.thrift.TException
1982 varun.gupt 315
    {
316
      getAllPromotions_args args = new getAllPromotions_args();
3430 rajveer 317
      sendBase("getAllPromotions", args);
1982 varun.gupt 318
    }
319
 
3430 rajveer 320
    public List<Promotion> recv_getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 321
    {
322
      getAllPromotions_result result = new getAllPromotions_result();
3430 rajveer 323
      receiveBase(result, "getAllPromotions");
1982 varun.gupt 324
      if (result.isSetSuccess()) {
325
        return result.success;
326
      }
327
      if (result.pex != null) {
328
        throw result.pex;
329
      }
3430 rajveer 330
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllPromotions failed: unknown result");
1982 varun.gupt 331
    }
332
 
3430 rajveer 333
    public Promotion getPromotionById(long promotionId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 334
    {
335
      send_getPromotionById(promotionId);
336
      return recv_getPromotionById();
337
    }
338
 
3430 rajveer 339
    public void send_getPromotionById(long promotionId) throws org.apache.thrift.TException
1982 varun.gupt 340
    {
341
      getPromotionById_args args = new getPromotionById_args();
3430 rajveer 342
      args.setPromotionId(promotionId);
343
      sendBase("getPromotionById", args);
1982 varun.gupt 344
    }
345
 
3430 rajveer 346
    public Promotion recv_getPromotionById() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 347
    {
348
      getPromotionById_result result = new getPromotionById_result();
3430 rajveer 349
      receiveBase(result, "getPromotionById");
1982 varun.gupt 350
      if (result.isSetSuccess()) {
351
        return result.success;
352
      }
353
      if (result.pex != null) {
354
        throw result.pex;
355
      }
3430 rajveer 356
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPromotionById failed: unknown result");
1982 varun.gupt 357
    }
358
 
3430 rajveer 359
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 360
    {
361
      send_generateCouponsForPromotion(promotionId, couponCode);
362
      recv_generateCouponsForPromotion();
363
    }
364
 
3430 rajveer 365
    public void send_generateCouponsForPromotion(long promotionId, String couponCode) throws org.apache.thrift.TException
1982 varun.gupt 366
    {
367
      generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
3430 rajveer 368
      args.setPromotionId(promotionId);
369
      args.setCouponCode(couponCode);
370
      sendBase("generateCouponsForPromotion", args);
1982 varun.gupt 371
    }
372
 
3430 rajveer 373
    public void recv_generateCouponsForPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 374
    {
375
      generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
3430 rajveer 376
      receiveBase(result, "generateCouponsForPromotion");
1982 varun.gupt 377
      if (result.pex != null) {
378
        throw result.pex;
379
      }
380
      return;
381
    }
382
 
3430 rajveer 383
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 384
    {
385
      send_applyCoupon(couponCode, cartId);
386
      return recv_applyCoupon();
387
    }
388
 
3430 rajveer 389
    public void send_applyCoupon(String couponCode, long cartId) throws org.apache.thrift.TException
1982 varun.gupt 390
    {
391
      applyCoupon_args args = new applyCoupon_args();
3430 rajveer 392
      args.setCouponCode(couponCode);
393
      args.setCartId(cartId);
394
      sendBase("applyCoupon", args);
1982 varun.gupt 395
    }
396
 
3430 rajveer 397
    public Cart recv_applyCoupon() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 398
    {
399
      applyCoupon_result result = new applyCoupon_result();
3430 rajveer 400
      receiveBase(result, "applyCoupon");
1982 varun.gupt 401
      if (result.isSetSuccess()) {
402
        return result.success;
403
      }
404
      if (result.pex != null) {
405
        throw result.pex;
406
      }
3430 rajveer 407
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "applyCoupon failed: unknown result");
1982 varun.gupt 408
    }
409
 
6736 amit.gupta 410
    public Map<Long,Double> getEmiDiscount(long cartId) throws PromotionException, org.apache.thrift.TException
411
    {
412
      send_getEmiDiscount(cartId);
413
      return recv_getEmiDiscount();
414
    }
415
 
416
    public void send_getEmiDiscount(long cartId) throws org.apache.thrift.TException
417
    {
418
      getEmiDiscount_args args = new getEmiDiscount_args();
419
      args.setCartId(cartId);
420
      sendBase("getEmiDiscount", args);
421
    }
422
 
423
    public Map<Long,Double> recv_getEmiDiscount() throws PromotionException, org.apache.thrift.TException
424
    {
425
      getEmiDiscount_result result = new getEmiDiscount_result();
426
      receiveBase(result, "getEmiDiscount");
427
      if (result.isSetSuccess()) {
428
        return result.success;
429
      }
430
      if (result.pex != null) {
431
        throw result.pex;
432
      }
433
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getEmiDiscount failed: unknown result");
434
    }
435
 
6433 anupam.sin 436
    public Map<Long,String> applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws PromotionException, org.apache.thrift.TException
437
    {
438
      send_applyRechargeCoupon(couponCode, totalAmount, userId);
439
      return recv_applyRechargeCoupon();
440
    }
441
 
442
    public void send_applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws org.apache.thrift.TException
443
    {
444
      applyRechargeCoupon_args args = new applyRechargeCoupon_args();
445
      args.setCouponCode(couponCode);
446
      args.setTotalAmount(totalAmount);
447
      args.setUserId(userId);
448
      sendBase("applyRechargeCoupon", args);
449
    }
450
 
451
    public Map<Long,String> recv_applyRechargeCoupon() throws PromotionException, org.apache.thrift.TException
452
    {
453
      applyRechargeCoupon_result result = new applyRechargeCoupon_result();
454
      receiveBase(result, "applyRechargeCoupon");
455
      if (result.isSetSuccess()) {
456
        return result.success;
457
      }
458
      if (result.pex != null) {
459
        throw result.pex;
460
      }
461
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "applyRechargeCoupon failed: unknown result");
462
    }
463
 
3430 rajveer 464
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 465
    {
466
      send_trackCouponUsage(couponCode, transactionId, userId);
467
      recv_trackCouponUsage();
468
    }
469
 
3430 rajveer 470
    public void send_trackCouponUsage(String couponCode, long transactionId, long userId) throws org.apache.thrift.TException
1982 varun.gupt 471
    {
472
      trackCouponUsage_args args = new trackCouponUsage_args();
3430 rajveer 473
      args.setCouponCode(couponCode);
474
      args.setTransactionId(transactionId);
475
      args.setUserId(userId);
476
      sendBase("trackCouponUsage", args);
1982 varun.gupt 477
    }
478
 
3430 rajveer 479
    public void recv_trackCouponUsage() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 480
    {
481
      trackCouponUsage_result result = new trackCouponUsage_result();
3430 rajveer 482
      receiveBase(result, "trackCouponUsage");
1982 varun.gupt 483
      if (result.pex != null) {
484
        throw result.pex;
485
      }
486
      return;
487
    }
488
 
3430 rajveer 489
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 490
    {
491
      send_getCouponUsageCountByUser(couponCode, userId);
492
      return recv_getCouponUsageCountByUser();
493
    }
494
 
3430 rajveer 495
    public void send_getCouponUsageCountByUser(String couponCode, long userId) throws org.apache.thrift.TException
1982 varun.gupt 496
    {
497
      getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
3430 rajveer 498
      args.setCouponCode(couponCode);
499
      args.setUserId(userId);
500
      sendBase("getCouponUsageCountByUser", args);
1982 varun.gupt 501
    }
502
 
3430 rajveer 503
    public long recv_getCouponUsageCountByUser() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 504
    {
505
      getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
3430 rajveer 506
      receiveBase(result, "getCouponUsageCountByUser");
1982 varun.gupt 507
      if (result.isSetSuccess()) {
508
        return result.success;
509
      }
510
      if (result.pex != null) {
511
        throw result.pex;
512
      }
3430 rajveer 513
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCouponUsageCountByUser failed: unknown result");
1982 varun.gupt 514
    }
515
 
6497 amit.gupta 516
    public List<Coupon> getActiveCodes(long promotionId) throws PromotionException, org.apache.thrift.TException
517
    {
518
      send_getActiveCodes(promotionId);
519
      return recv_getActiveCodes();
520
    }
521
 
522
    public void send_getActiveCodes(long promotionId) throws org.apache.thrift.TException
523
    {
524
      getActiveCodes_args args = new getActiveCodes_args();
525
      args.setPromotionId(promotionId);
526
      sendBase("getActiveCodes", args);
527
    }
528
 
529
    public List<Coupon> recv_getActiveCodes() throws PromotionException, org.apache.thrift.TException
530
    {
531
      getActiveCodes_result result = new getActiveCodes_result();
532
      receiveBase(result, "getActiveCodes");
533
      if (result.isSetSuccess()) {
534
        return result.success;
535
      }
536
      if (result.pex != null) {
537
        throw result.pex;
538
      }
539
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getActiveCodes failed: unknown result");
540
    }
541
 
542
    public void deleteCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
543
    {
544
      send_deleteCoupon(couponCode);
545
      recv_deleteCoupon();
546
    }
547
 
548
    public void send_deleteCoupon(String couponCode) throws org.apache.thrift.TException
549
    {
550
      deleteCoupon_args args = new deleteCoupon_args();
551
      args.setCouponCode(couponCode);
552
      sendBase("deleteCoupon", args);
553
    }
554
 
555
    public void recv_deleteCoupon() throws PromotionException, org.apache.thrift.TException
556
    {
557
      deleteCoupon_result result = new deleteCoupon_result();
558
      receiveBase(result, "deleteCoupon");
559
      if (result.pex != null) {
560
        throw result.pex;
561
      }
562
      return;
563
    }
564
 
7092 amit.gupta 565
    public List<Coupon> getAllCouponsByPromotionId(long promotionId) throws PromotionException, org.apache.thrift.TException
566
    {
567
      send_getAllCouponsByPromotionId(promotionId);
568
      return recv_getAllCouponsByPromotionId();
569
    }
570
 
571
    public void send_getAllCouponsByPromotionId(long promotionId) throws org.apache.thrift.TException
572
    {
573
      getAllCouponsByPromotionId_args args = new getAllCouponsByPromotionId_args();
574
      args.setPromotionId(promotionId);
575
      sendBase("getAllCouponsByPromotionId", args);
576
    }
577
 
578
    public List<Coupon> recv_getAllCouponsByPromotionId() throws PromotionException, org.apache.thrift.TException
579
    {
580
      getAllCouponsByPromotionId_result result = new getAllCouponsByPromotionId_result();
581
      receiveBase(result, "getAllCouponsByPromotionId");
582
      if (result.isSetSuccess()) {
583
        return result.success;
584
      }
585
      if (result.pex != null) {
586
        throw result.pex;
587
      }
588
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllCouponsByPromotionId failed: unknown result");
589
    }
590
 
3430 rajveer 591
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 592
    {
593
      send_getActiveCoupons();
594
      return recv_getActiveCoupons();
595
    }
596
 
3430 rajveer 597
    public void send_getActiveCoupons() throws org.apache.thrift.TException
3385 varun.gupt 598
    {
599
      getActiveCoupons_args args = new getActiveCoupons_args();
3430 rajveer 600
      sendBase("getActiveCoupons", args);
3385 varun.gupt 601
    }
602
 
3430 rajveer 603
    public List<Coupon> recv_getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 604
    {
605
      getActiveCoupons_result result = new getActiveCoupons_result();
3430 rajveer 606
      receiveBase(result, "getActiveCoupons");
3385 varun.gupt 607
      if (result.isSetSuccess()) {
608
        return result.success;
609
      }
610
      if (result.pex != null) {
611
        throw result.pex;
612
      }
3430 rajveer 613
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getActiveCoupons failed: unknown result");
3385 varun.gupt 614
    }
615
 
6730 anupam.sin 616
    public String createCoupon(long promotionId, String couponCode, String arguments, boolean isCod, String prefix) throws PromotionException, org.apache.thrift.TException
6250 amit.gupta 617
    {
6730 anupam.sin 618
      send_createCoupon(promotionId, couponCode, arguments, isCod, prefix);
6250 amit.gupta 619
      return recv_createCoupon();
620
    }
621
 
6730 anupam.sin 622
    public void send_createCoupon(long promotionId, String couponCode, String arguments, boolean isCod, String prefix) throws org.apache.thrift.TException
6250 amit.gupta 623
    {
624
      createCoupon_args args = new createCoupon_args();
625
      args.setPromotionId(promotionId);
6730 anupam.sin 626
      args.setCouponCode(couponCode);
6679 anupam.sin 627
      args.setArguments(arguments);
6356 amit.gupta 628
      args.setIsCod(isCod);
6561 amit.gupta 629
      args.setPrefix(prefix);
6250 amit.gupta 630
      sendBase("createCoupon", args);
631
    }
632
 
633
    public String recv_createCoupon() throws PromotionException, org.apache.thrift.TException
634
    {
635
      createCoupon_result result = new createCoupon_result();
636
      receiveBase(result, "createCoupon");
637
      if (result.isSetSuccess()) {
638
        return result.success;
639
      }
640
      if (result.pex != null) {
641
        throw result.pex;
642
      }
643
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createCoupon failed: unknown result");
644
    }
645
 
3430 rajveer 646
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 647
    {
648
      send_getSuccessfulPaymentCountForCoupon(couponCode);
649
      return recv_getSuccessfulPaymentCountForCoupon();
650
    }
651
 
3430 rajveer 652
    public void send_getSuccessfulPaymentCountForCoupon(String couponCode) throws org.apache.thrift.TException
3385 varun.gupt 653
    {
654
      getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
3430 rajveer 655
      args.setCouponCode(couponCode);
656
      sendBase("getSuccessfulPaymentCountForCoupon", args);
3385 varun.gupt 657
    }
658
 
3430 rajveer 659
    public long recv_getSuccessfulPaymentCountForCoupon() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 660
    {
661
      getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
3430 rajveer 662
      receiveBase(result, "getSuccessfulPaymentCountForCoupon");
3385 varun.gupt 663
      if (result.isSetSuccess()) {
664
        return result.success;
665
      }
666
      if (result.pex != null) {
667
        throw result.pex;
668
      }
3430 rajveer 669
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSuccessfulPaymentCountForCoupon failed: unknown result");
3385 varun.gupt 670
    }
671
 
3430 rajveer 672
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 673
    {
674
      send_getRuleDocString(ruleName);
675
      return recv_getRuleDocString();
676
    }
677
 
3430 rajveer 678
    public void send_getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 679
    {
680
      getRuleDocString_args args = new getRuleDocString_args();
3430 rajveer 681
      args.setRuleName(ruleName);
682
      sendBase("getRuleDocString", args);
3385 varun.gupt 683
    }
684
 
3430 rajveer 685
    public String recv_getRuleDocString() throws org.apache.thrift.TException
3385 varun.gupt 686
    {
687
      getRuleDocString_result result = new getRuleDocString_result();
3430 rajveer 688
      receiveBase(result, "getRuleDocString");
3385 varun.gupt 689
      if (result.isSetSuccess()) {
690
        return result.success;
691
      }
3430 rajveer 692
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRuleDocString failed: unknown result");
3385 varun.gupt 693
    }
694
 
4189 varun.gupt 695
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException
696
    {
697
      send_getItemDiscountMap(itemIds);
698
      return recv_getItemDiscountMap();
699
    }
700
 
701
    public void send_getItemDiscountMap(List<Long> itemIds) throws org.apache.thrift.TException
702
    {
703
      getItemDiscountMap_args args = new getItemDiscountMap_args();
704
      args.setItemIds(itemIds);
705
      sendBase("getItemDiscountMap", args);
706
    }
707
 
708
    public List<ItemCouponDiscount> recv_getItemDiscountMap() throws PromotionException, org.apache.thrift.TException
709
    {
710
      getItemDiscountMap_result result = new getItemDiscountMap_result();
711
      receiveBase(result, "getItemDiscountMap");
712
      if (result.isSetSuccess()) {
713
        return result.success;
714
      }
715
      if (result.pex != null) {
716
        throw result.pex;
717
      }
718
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemDiscountMap failed: unknown result");
719
    }
720
 
4494 varun.gupt 721
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
722
    {
723
      send_getDiscountsForEntity(entityId);
724
      return recv_getDiscountsForEntity();
725
    }
726
 
727
    public void send_getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
728
    {
729
      getDiscountsForEntity_args args = new getDiscountsForEntity_args();
730
      args.setEntityId(entityId);
731
      sendBase("getDiscountsForEntity", args);
732
    }
733
 
734
    public Map<String,Double> recv_getDiscountsForEntity() throws org.apache.thrift.TException
735
    {
736
      getDiscountsForEntity_result result = new getDiscountsForEntity_result();
737
      receiveBase(result, "getDiscountsForEntity");
738
      if (result.isSetSuccess()) {
739
        return result.success;
740
      }
741
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getDiscountsForEntity failed: unknown result");
742
    }
743
 
5469 rajveer 744
    public void addVoucher(Voucher voucher) throws org.apache.thrift.TException
745
    {
746
      send_addVoucher(voucher);
747
      recv_addVoucher();
748
    }
749
 
750
    public void send_addVoucher(Voucher voucher) throws org.apache.thrift.TException
751
    {
752
      addVoucher_args args = new addVoucher_args();
753
      args.setVoucher(voucher);
754
      sendBase("addVoucher", args);
755
    }
756
 
757
    public void recv_addVoucher() throws org.apache.thrift.TException
758
    {
759
      addVoucher_result result = new addVoucher_result();
760
      receiveBase(result, "addVoucher");
761
      return;
762
    }
763
 
764
    public Voucher assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException
765
    {
766
      send_assignVoucher(userId, userEmail, voucherType, amount);
767
      return recv_assignVoucher();
768
    }
769
 
770
    public void send_assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException
771
    {
772
      assignVoucher_args args = new assignVoucher_args();
773
      args.setUserId(userId);
774
      args.setUserEmail(userEmail);
775
      args.setVoucherType(voucherType);
776
      args.setAmount(amount);
777
      sendBase("assignVoucher", args);
778
    }
779
 
780
    public Voucher recv_assignVoucher() throws org.apache.thrift.TException
781
    {
782
      assignVoucher_result result = new assignVoucher_result();
783
      receiveBase(result, "assignVoucher");
784
      if (result.isSetSuccess()) {
785
        return result.success;
786
      }
787
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "assignVoucher failed: unknown result");
788
    }
789
 
790
    public boolean markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException
791
    {
792
      send_markVoucherAsRedeemed(voucherCode, redeemedOn);
793
      return recv_markVoucherAsRedeemed();
794
    }
795
 
796
    public void send_markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException
797
    {
798
      markVoucherAsRedeemed_args args = new markVoucherAsRedeemed_args();
799
      args.setVoucherCode(voucherCode);
800
      args.setRedeemedOn(redeemedOn);
801
      sendBase("markVoucherAsRedeemed", args);
802
    }
803
 
804
    public boolean recv_markVoucherAsRedeemed() throws org.apache.thrift.TException
805
    {
806
      markVoucherAsRedeemed_result result = new markVoucherAsRedeemed_result();
807
      receiveBase(result, "markVoucherAsRedeemed");
808
      if (result.isSetSuccess()) {
809
        return result.success;
810
      }
811
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "markVoucherAsRedeemed failed: unknown result");
812
    }
813
 
1982 varun.gupt 814
  }
3430 rajveer 815
  public static class AsyncClient extends in.shop2020.generic.GenericService.AsyncClient implements AsyncIface {
816
    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
817
      private org.apache.thrift.async.TAsyncClientManager clientManager;
818
      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
819
      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
820
        this.clientManager = clientManager;
821
        this.protocolFactory = protocolFactory;
822
      }
823
      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
824
        return new AsyncClient(protocolFactory, clientManager, transport);
825
      }
1982 varun.gupt 826
    }
827
 
3430 rajveer 828
    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
829
      super(protocolFactory, clientManager, transport);
830
    }
1982 varun.gupt 831
 
3430 rajveer 832
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn, org.apache.thrift.async.AsyncMethodCallback<createPromotion_call> resultHandler) throws org.apache.thrift.TException {
833
      checkReady();
834
      createPromotion_call method_call = new createPromotion_call(name, ruleExecutionSrc, startOn, endOn, resultHandler, this, ___protocolFactory, ___transport);
835
      this.___currentMethod = method_call;
836
      ___manager.call(method_call);
1982 varun.gupt 837
    }
838
 
3430 rajveer 839
    public static class createPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
840
      private String name;
841
      private String ruleExecutionSrc;
842
      private long startOn;
843
      private long endOn;
844
      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 {
845
        super(client, protocolFactory, transport, resultHandler, false);
846
        this.name = name;
847
        this.ruleExecutionSrc = ruleExecutionSrc;
848
        this.startOn = startOn;
849
        this.endOn = endOn;
1982 varun.gupt 850
      }
851
 
3430 rajveer 852
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
853
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
1982 varun.gupt 854
        createPromotion_args args = new createPromotion_args();
3430 rajveer 855
        args.setName(name);
856
        args.setRuleExecutionSrc(ruleExecutionSrc);
857
        args.setStartOn(startOn);
858
        args.setEndOn(endOn);
859
        args.write(prot);
860
        prot.writeMessageEnd();
1982 varun.gupt 861
      }
862
 
3430 rajveer 863
      public void getResult() throws PromotionException, org.apache.thrift.TException {
864
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
865
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 866
        }
3430 rajveer 867
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
868
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
869
        (new Client(prot)).recv_createPromotion();
1982 varun.gupt 870
      }
3430 rajveer 871
    }
1982 varun.gupt 872
 
7746 amit.gupta 873
    public void removeAllCouponsByPromotionId(long promotionId, org.apache.thrift.async.AsyncMethodCallback<removeAllCouponsByPromotionId_call> resultHandler) throws org.apache.thrift.TException {
874
      checkReady();
875
      removeAllCouponsByPromotionId_call method_call = new removeAllCouponsByPromotionId_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
876
      this.___currentMethod = method_call;
877
      ___manager.call(method_call);
878
    }
879
 
880
    public static class removeAllCouponsByPromotionId_call extends org.apache.thrift.async.TAsyncMethodCall {
881
      private long promotionId;
882
      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 {
883
        super(client, protocolFactory, transport, resultHandler, false);
884
        this.promotionId = promotionId;
885
      }
886
 
887
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
888
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("removeAllCouponsByPromotionId", org.apache.thrift.protocol.TMessageType.CALL, 0));
889
        removeAllCouponsByPromotionId_args args = new removeAllCouponsByPromotionId_args();
890
        args.setPromotionId(promotionId);
891
        args.write(prot);
892
        prot.writeMessageEnd();
893
      }
894
 
895
      public long getResult() throws PromotionException, org.apache.thrift.TException {
896
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
897
          throw new IllegalStateException("Method call not finished!");
898
        }
899
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
900
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
901
        return (new Client(prot)).recv_removeAllCouponsByPromotionId();
902
      }
903
    }
904
 
6301 amit.gupta 905
    public void getCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getCoupon_call> resultHandler) throws org.apache.thrift.TException {
906
      checkReady();
907
      getCoupon_call method_call = new getCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
908
      this.___currentMethod = method_call;
909
      ___manager.call(method_call);
910
    }
911
 
912
    public static class getCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
913
      private String couponCode;
914
      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 {
915
        super(client, protocolFactory, transport, resultHandler, false);
916
        this.couponCode = couponCode;
917
      }
918
 
919
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
920
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
921
        getCoupon_args args = new getCoupon_args();
922
        args.setCouponCode(couponCode);
923
        args.write(prot);
924
        prot.writeMessageEnd();
925
      }
926
 
927
      public Coupon getResult() throws PromotionException, org.apache.thrift.TException {
928
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
929
          throw new IllegalStateException("Method call not finished!");
930
        }
931
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
932
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
933
        return (new Client(prot)).recv_getCoupon();
934
      }
935
    }
936
 
937
    public void isGiftVoucher(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isGiftVoucher_call> resultHandler) throws org.apache.thrift.TException {
938
      checkReady();
939
      isGiftVoucher_call method_call = new isGiftVoucher_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
940
      this.___currentMethod = method_call;
941
      ___manager.call(method_call);
942
    }
943
 
944
    public static class isGiftVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
945
      private String couponCode;
946
      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 {
947
        super(client, protocolFactory, transport, resultHandler, false);
948
        this.couponCode = couponCode;
949
      }
950
 
951
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
952
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isGiftVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
953
        isGiftVoucher_args args = new isGiftVoucher_args();
954
        args.setCouponCode(couponCode);
955
        args.write(prot);
956
        prot.writeMessageEnd();
957
      }
958
 
959
      public boolean getResult() throws PromotionException, org.apache.thrift.TException {
960
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
961
          throw new IllegalStateException("Method call not finished!");
962
        }
963
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
964
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
965
        return (new Client(prot)).recv_isGiftVoucher();
966
      }
967
    }
968
 
6356 amit.gupta 969
    public void isCodApplicable(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isCodApplicable_call> resultHandler) throws org.apache.thrift.TException {
970
      checkReady();
971
      isCodApplicable_call method_call = new isCodApplicable_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
972
      this.___currentMethod = method_call;
973
      ___manager.call(method_call);
974
    }
975
 
976
    public static class isCodApplicable_call extends org.apache.thrift.async.TAsyncMethodCall {
977
      private String couponCode;
978
      public isCodApplicable_call(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isCodApplicable_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
979
        super(client, protocolFactory, transport, resultHandler, false);
980
        this.couponCode = couponCode;
981
      }
982
 
983
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
984
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isCodApplicable", org.apache.thrift.protocol.TMessageType.CALL, 0));
985
        isCodApplicable_args args = new isCodApplicable_args();
986
        args.setCouponCode(couponCode);
987
        args.write(prot);
988
        prot.writeMessageEnd();
989
      }
990
 
991
      public boolean getResult() throws PromotionException, org.apache.thrift.TException {
992
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
993
          throw new IllegalStateException("Method call not finished!");
994
        }
995
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
996
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
997
        return (new Client(prot)).recv_isCodApplicable();
998
      }
999
    }
1000
 
3430 rajveer 1001
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<getAllPromotions_call> resultHandler) throws org.apache.thrift.TException {
1002
      checkReady();
1003
      getAllPromotions_call method_call = new getAllPromotions_call(resultHandler, this, ___protocolFactory, ___transport);
1004
      this.___currentMethod = method_call;
1005
      ___manager.call(method_call);
1982 varun.gupt 1006
    }
1007
 
3430 rajveer 1008
    public static class getAllPromotions_call extends org.apache.thrift.async.TAsyncMethodCall {
1009
      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 {
1010
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 1011
      }
1012
 
3430 rajveer 1013
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1014
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllPromotions", org.apache.thrift.protocol.TMessageType.CALL, 0));
1015
        getAllPromotions_args args = new getAllPromotions_args();
1016
        args.write(prot);
1017
        prot.writeMessageEnd();
1018
      }
1982 varun.gupt 1019
 
3430 rajveer 1020
      public List<Promotion> getResult() throws PromotionException, org.apache.thrift.TException {
1021
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1022
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 1023
        }
3430 rajveer 1024
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1025
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1026
        return (new Client(prot)).recv_getAllPromotions();
1982 varun.gupt 1027
      }
3430 rajveer 1028
    }
1982 varun.gupt 1029
 
3430 rajveer 1030
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getPromotionById_call> resultHandler) throws org.apache.thrift.TException {
1031
      checkReady();
1032
      getPromotionById_call method_call = new getPromotionById_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
1033
      this.___currentMethod = method_call;
1034
      ___manager.call(method_call);
1982 varun.gupt 1035
    }
1036
 
3430 rajveer 1037
    public static class getPromotionById_call extends org.apache.thrift.async.TAsyncMethodCall {
1038
      private long promotionId;
1039
      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 {
1040
        super(client, protocolFactory, transport, resultHandler, false);
1041
        this.promotionId = promotionId;
1982 varun.gupt 1042
      }
1043
 
3430 rajveer 1044
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1045
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPromotionById", org.apache.thrift.protocol.TMessageType.CALL, 0));
1046
        getPromotionById_args args = new getPromotionById_args();
1047
        args.setPromotionId(promotionId);
1048
        args.write(prot);
1049
        prot.writeMessageEnd();
1050
      }
1982 varun.gupt 1051
 
3430 rajveer 1052
      public Promotion getResult() throws PromotionException, org.apache.thrift.TException {
1053
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1054
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 1055
        }
3430 rajveer 1056
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1057
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1058
        return (new Client(prot)).recv_getPromotionById();
1982 varun.gupt 1059
      }
3430 rajveer 1060
    }
1982 varun.gupt 1061
 
3430 rajveer 1062
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException {
1063
      checkReady();
1064
      generateCouponsForPromotion_call method_call = new generateCouponsForPromotion_call(promotionId, couponCode, resultHandler, this, ___protocolFactory, ___transport);
1065
      this.___currentMethod = method_call;
1066
      ___manager.call(method_call);
1982 varun.gupt 1067
    }
1068
 
3430 rajveer 1069
    public static class generateCouponsForPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
1070
      private long promotionId;
1071
      private String couponCode;
1072
      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 {
1073
        super(client, protocolFactory, transport, resultHandler, false);
1074
        this.promotionId = promotionId;
1075
        this.couponCode = couponCode;
1982 varun.gupt 1076
      }
1077
 
3430 rajveer 1078
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1079
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("generateCouponsForPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
1080
        generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
1081
        args.setPromotionId(promotionId);
1082
        args.setCouponCode(couponCode);
1083
        args.write(prot);
1084
        prot.writeMessageEnd();
3385 varun.gupt 1085
      }
1086
 
3430 rajveer 1087
      public void getResult() throws PromotionException, org.apache.thrift.TException {
1088
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1089
          throw new IllegalStateException("Method call not finished!");
3385 varun.gupt 1090
        }
3430 rajveer 1091
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1092
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1093
        (new Client(prot)).recv_generateCouponsForPromotion();
3385 varun.gupt 1094
      }
1095
    }
1096
 
3430 rajveer 1097
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<applyCoupon_call> resultHandler) throws org.apache.thrift.TException {
1098
      checkReady();
1099
      applyCoupon_call method_call = new applyCoupon_call(couponCode, cartId, resultHandler, this, ___protocolFactory, ___transport);
1100
      this.___currentMethod = method_call;
1101
      ___manager.call(method_call);
3385 varun.gupt 1102
    }
1103
 
3430 rajveer 1104
    public static class applyCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1105
      private String couponCode;
1106
      private long cartId;
1107
      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 {
1108
        super(client, protocolFactory, transport, resultHandler, false);
1109
        this.couponCode = couponCode;
1110
        this.cartId = cartId;
1982 varun.gupt 1111
      }
1112
 
3430 rajveer 1113
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1114
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("applyCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1115
        applyCoupon_args args = new applyCoupon_args();
1116
        args.setCouponCode(couponCode);
1117
        args.setCartId(cartId);
1118
        args.write(prot);
1119
        prot.writeMessageEnd();
1982 varun.gupt 1120
      }
1121
 
3430 rajveer 1122
      public Cart getResult() throws PromotionException, org.apache.thrift.TException {
1123
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1124
          throw new IllegalStateException("Method call not finished!");
1125
        }
1126
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1127
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1128
        return (new Client(prot)).recv_applyCoupon();
1982 varun.gupt 1129
      }
3430 rajveer 1130
    }
1982 varun.gupt 1131
 
6736 amit.gupta 1132
    public void getEmiDiscount(long cartId, org.apache.thrift.async.AsyncMethodCallback<getEmiDiscount_call> resultHandler) throws org.apache.thrift.TException {
1133
      checkReady();
1134
      getEmiDiscount_call method_call = new getEmiDiscount_call(cartId, resultHandler, this, ___protocolFactory, ___transport);
1135
      this.___currentMethod = method_call;
1136
      ___manager.call(method_call);
1137
    }
1138
 
1139
    public static class getEmiDiscount_call extends org.apache.thrift.async.TAsyncMethodCall {
1140
      private long cartId;
1141
      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 {
1142
        super(client, protocolFactory, transport, resultHandler, false);
1143
        this.cartId = cartId;
1144
      }
1145
 
1146
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1147
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getEmiDiscount", org.apache.thrift.protocol.TMessageType.CALL, 0));
1148
        getEmiDiscount_args args = new getEmiDiscount_args();
1149
        args.setCartId(cartId);
1150
        args.write(prot);
1151
        prot.writeMessageEnd();
1152
      }
1153
 
1154
      public Map<Long,Double> getResult() throws PromotionException, org.apache.thrift.TException {
1155
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1156
          throw new IllegalStateException("Method call not finished!");
1157
        }
1158
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1159
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1160
        return (new Client(prot)).recv_getEmiDiscount();
1161
      }
1162
    }
1163
 
6433 anupam.sin 1164
    public void applyRechargeCoupon(String couponCode, long totalAmount, long userId, org.apache.thrift.async.AsyncMethodCallback<applyRechargeCoupon_call> resultHandler) throws org.apache.thrift.TException {
1165
      checkReady();
1166
      applyRechargeCoupon_call method_call = new applyRechargeCoupon_call(couponCode, totalAmount, userId, resultHandler, this, ___protocolFactory, ___transport);
1167
      this.___currentMethod = method_call;
1168
      ___manager.call(method_call);
1169
    }
1170
 
1171
    public static class applyRechargeCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1172
      private String couponCode;
1173
      private long totalAmount;
1174
      private long userId;
1175
      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 {
1176
        super(client, protocolFactory, transport, resultHandler, false);
1177
        this.couponCode = couponCode;
1178
        this.totalAmount = totalAmount;
1179
        this.userId = userId;
1180
      }
1181
 
1182
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1183
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("applyRechargeCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1184
        applyRechargeCoupon_args args = new applyRechargeCoupon_args();
1185
        args.setCouponCode(couponCode);
1186
        args.setTotalAmount(totalAmount);
1187
        args.setUserId(userId);
1188
        args.write(prot);
1189
        prot.writeMessageEnd();
1190
      }
1191
 
1192
      public Map<Long,String> getResult() throws PromotionException, org.apache.thrift.TException {
1193
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1194
          throw new IllegalStateException("Method call not finished!");
1195
        }
1196
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1197
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1198
        return (new Client(prot)).recv_applyRechargeCoupon();
1199
      }
1200
    }
1201
 
3430 rajveer 1202
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException {
1203
      checkReady();
1204
      trackCouponUsage_call method_call = new trackCouponUsage_call(couponCode, transactionId, userId, resultHandler, this, ___protocolFactory, ___transport);
1205
      this.___currentMethod = method_call;
1206
      ___manager.call(method_call);
1207
    }
1982 varun.gupt 1208
 
3430 rajveer 1209
    public static class trackCouponUsage_call extends org.apache.thrift.async.TAsyncMethodCall {
1210
      private String couponCode;
1211
      private long transactionId;
1212
      private long userId;
1213
      public trackCouponUsage_call(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<trackCouponUsage_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1214
        super(client, protocolFactory, transport, resultHandler, false);
1215
        this.couponCode = couponCode;
1216
        this.transactionId = transactionId;
1217
        this.userId = userId;
1982 varun.gupt 1218
      }
1219
 
3430 rajveer 1220
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1221
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("trackCouponUsage", org.apache.thrift.protocol.TMessageType.CALL, 0));
1222
        trackCouponUsage_args args = new trackCouponUsage_args();
1223
        args.setCouponCode(couponCode);
1224
        args.setTransactionId(transactionId);
1225
        args.setUserId(userId);
1226
        args.write(prot);
1227
        prot.writeMessageEnd();
1982 varun.gupt 1228
      }
1229
 
3430 rajveer 1230
      public void getResult() throws PromotionException, org.apache.thrift.TException {
1231
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1232
          throw new IllegalStateException("Method call not finished!");
1233
        }
1234
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1235
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1236
        (new Client(prot)).recv_trackCouponUsage();
1982 varun.gupt 1237
      }
1238
    }
1239
 
3430 rajveer 1240
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException {
1241
      checkReady();
1242
      getCouponUsageCountByUser_call method_call = new getCouponUsageCountByUser_call(couponCode, userId, resultHandler, this, ___protocolFactory, ___transport);
1243
      this.___currentMethod = method_call;
1244
      ___manager.call(method_call);
1982 varun.gupt 1245
    }
1246
 
3430 rajveer 1247
    public static class getCouponUsageCountByUser_call extends org.apache.thrift.async.TAsyncMethodCall {
1248
      private String couponCode;
1249
      private long userId;
1250
      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 {
1251
        super(client, protocolFactory, transport, resultHandler, false);
1252
        this.couponCode = couponCode;
1253
        this.userId = userId;
1254
      }
1982 varun.gupt 1255
 
3430 rajveer 1256
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1257
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCouponUsageCountByUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
1258
        getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
1259
        args.setCouponCode(couponCode);
1260
        args.setUserId(userId);
1261
        args.write(prot);
1262
        prot.writeMessageEnd();
1263
      }
1982 varun.gupt 1264
 
3430 rajveer 1265
      public long getResult() throws PromotionException, org.apache.thrift.TException {
1266
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1267
          throw new IllegalStateException("Method call not finished!");
1268
        }
1269
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1270
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1271
        return (new Client(prot)).recv_getCouponUsageCountByUser();
1272
      }
1982 varun.gupt 1273
    }
1274
 
6497 amit.gupta 1275
    public void getActiveCodes(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getActiveCodes_call> resultHandler) throws org.apache.thrift.TException {
1276
      checkReady();
1277
      getActiveCodes_call method_call = new getActiveCodes_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
1278
      this.___currentMethod = method_call;
1279
      ___manager.call(method_call);
1280
    }
1281
 
1282
    public static class getActiveCodes_call extends org.apache.thrift.async.TAsyncMethodCall {
1283
      private long promotionId;
1284
      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 {
1285
        super(client, protocolFactory, transport, resultHandler, false);
1286
        this.promotionId = promotionId;
1287
      }
1288
 
1289
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1290
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getActiveCodes", org.apache.thrift.protocol.TMessageType.CALL, 0));
1291
        getActiveCodes_args args = new getActiveCodes_args();
1292
        args.setPromotionId(promotionId);
1293
        args.write(prot);
1294
        prot.writeMessageEnd();
1295
      }
1296
 
1297
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
1298
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1299
          throw new IllegalStateException("Method call not finished!");
1300
        }
1301
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1302
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1303
        return (new Client(prot)).recv_getActiveCodes();
1304
      }
1305
    }
1306
 
1307
    public void deleteCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<deleteCoupon_call> resultHandler) throws org.apache.thrift.TException {
1308
      checkReady();
1309
      deleteCoupon_call method_call = new deleteCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
1310
      this.___currentMethod = method_call;
1311
      ___manager.call(method_call);
1312
    }
1313
 
1314
    public static class deleteCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1315
      private String couponCode;
1316
      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 {
1317
        super(client, protocolFactory, transport, resultHandler, false);
1318
        this.couponCode = couponCode;
1319
      }
1320
 
1321
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1322
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1323
        deleteCoupon_args args = new deleteCoupon_args();
1324
        args.setCouponCode(couponCode);
1325
        args.write(prot);
1326
        prot.writeMessageEnd();
1327
      }
1328
 
1329
      public void getResult() throws PromotionException, org.apache.thrift.TException {
1330
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1331
          throw new IllegalStateException("Method call not finished!");
1332
        }
1333
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1334
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1335
        (new Client(prot)).recv_deleteCoupon();
1336
      }
1337
    }
1338
 
7092 amit.gupta 1339
    public void getAllCouponsByPromotionId(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getAllCouponsByPromotionId_call> resultHandler) throws org.apache.thrift.TException {
1340
      checkReady();
1341
      getAllCouponsByPromotionId_call method_call = new getAllCouponsByPromotionId_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
1342
      this.___currentMethod = method_call;
1343
      ___manager.call(method_call);
1344
    }
1345
 
1346
    public static class getAllCouponsByPromotionId_call extends org.apache.thrift.async.TAsyncMethodCall {
1347
      private long promotionId;
1348
      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 {
1349
        super(client, protocolFactory, transport, resultHandler, false);
1350
        this.promotionId = promotionId;
1351
      }
1352
 
1353
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1354
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllCouponsByPromotionId", org.apache.thrift.protocol.TMessageType.CALL, 0));
1355
        getAllCouponsByPromotionId_args args = new getAllCouponsByPromotionId_args();
1356
        args.setPromotionId(promotionId);
1357
        args.write(prot);
1358
        prot.writeMessageEnd();
1359
      }
1360
 
1361
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
1362
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1363
          throw new IllegalStateException("Method call not finished!");
1364
        }
1365
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1366
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1367
        return (new Client(prot)).recv_getAllCouponsByPromotionId();
1368
      }
1369
    }
1370
 
3430 rajveer 1371
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException {
1372
      checkReady();
1373
      getActiveCoupons_call method_call = new getActiveCoupons_call(resultHandler, this, ___protocolFactory, ___transport);
1374
      this.___currentMethod = method_call;
1375
      ___manager.call(method_call);
1982 varun.gupt 1376
    }
1377
 
3430 rajveer 1378
    public static class getActiveCoupons_call extends org.apache.thrift.async.TAsyncMethodCall {
1379
      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 {
1380
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 1381
      }
1382
 
3430 rajveer 1383
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1384
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getActiveCoupons", org.apache.thrift.protocol.TMessageType.CALL, 0));
1385
        getActiveCoupons_args args = new getActiveCoupons_args();
1386
        args.write(prot);
1387
        prot.writeMessageEnd();
1388
      }
1982 varun.gupt 1389
 
3430 rajveer 1390
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
1391
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1392
          throw new IllegalStateException("Method call not finished!");
1393
        }
1394
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1395
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1396
        return (new Client(prot)).recv_getActiveCoupons();
1982 varun.gupt 1397
      }
1398
    }
1399
 
6730 anupam.sin 1400
    public void createCoupon(long promotionId, String couponCode, String arguments, boolean isCod, String prefix, org.apache.thrift.async.AsyncMethodCallback<createCoupon_call> resultHandler) throws org.apache.thrift.TException {
6250 amit.gupta 1401
      checkReady();
6730 anupam.sin 1402
      createCoupon_call method_call = new createCoupon_call(promotionId, couponCode, arguments, isCod, prefix, resultHandler, this, ___protocolFactory, ___transport);
6250 amit.gupta 1403
      this.___currentMethod = method_call;
1404
      ___manager.call(method_call);
1405
    }
1406
 
1407
    public static class createCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1408
      private long promotionId;
6730 anupam.sin 1409
      private String couponCode;
6679 anupam.sin 1410
      private String arguments;
6356 amit.gupta 1411
      private boolean isCod;
6561 amit.gupta 1412
      private String prefix;
6730 anupam.sin 1413
      public createCoupon_call(long promotionId, 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 1414
        super(client, protocolFactory, transport, resultHandler, false);
1415
        this.promotionId = promotionId;
6730 anupam.sin 1416
        this.couponCode = couponCode;
6679 anupam.sin 1417
        this.arguments = arguments;
6356 amit.gupta 1418
        this.isCod = isCod;
6561 amit.gupta 1419
        this.prefix = prefix;
6250 amit.gupta 1420
      }
1421
 
1422
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1423
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1424
        createCoupon_args args = new createCoupon_args();
1425
        args.setPromotionId(promotionId);
6730 anupam.sin 1426
        args.setCouponCode(couponCode);
6679 anupam.sin 1427
        args.setArguments(arguments);
6356 amit.gupta 1428
        args.setIsCod(isCod);
6561 amit.gupta 1429
        args.setPrefix(prefix);
6250 amit.gupta 1430
        args.write(prot);
1431
        prot.writeMessageEnd();
1432
      }
1433
 
1434
      public String getResult() throws PromotionException, org.apache.thrift.TException {
1435
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1436
          throw new IllegalStateException("Method call not finished!");
1437
        }
1438
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1439
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1440
        return (new Client(prot)).recv_createCoupon();
1441
      }
1442
    }
1443
 
3430 rajveer 1444
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException {
1445
      checkReady();
1446
      getSuccessfulPaymentCountForCoupon_call method_call = new getSuccessfulPaymentCountForCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
1447
      this.___currentMethod = method_call;
1448
      ___manager.call(method_call);
1982 varun.gupt 1449
    }
1450
 
3430 rajveer 1451
    public static class getSuccessfulPaymentCountForCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1452
      private String couponCode;
1453
      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 {
1454
        super(client, protocolFactory, transport, resultHandler, false);
1455
        this.couponCode = couponCode;
1982 varun.gupt 1456
      }
1457
 
3430 rajveer 1458
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1459
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSuccessfulPaymentCountForCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1460
        getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
1461
        args.setCouponCode(couponCode);
1462
        args.write(prot);
1463
        prot.writeMessageEnd();
1464
      }
1982 varun.gupt 1465
 
3430 rajveer 1466
      public long getResult() throws PromotionException, org.apache.thrift.TException {
1467
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1468
          throw new IllegalStateException("Method call not finished!");
1469
        }
1470
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1471
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1472
        return (new Client(prot)).recv_getSuccessfulPaymentCountForCoupon();
1473
      }
1982 varun.gupt 1474
    }
1475
 
3430 rajveer 1476
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<getRuleDocString_call> resultHandler) throws org.apache.thrift.TException {
1477
      checkReady();
1478
      getRuleDocString_call method_call = new getRuleDocString_call(ruleName, resultHandler, this, ___protocolFactory, ___transport);
1479
      this.___currentMethod = method_call;
1480
      ___manager.call(method_call);
1982 varun.gupt 1481
    }
1482
 
3430 rajveer 1483
    public static class getRuleDocString_call extends org.apache.thrift.async.TAsyncMethodCall {
1484
      private String ruleName;
1485
      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 {
1486
        super(client, protocolFactory, transport, resultHandler, false);
1487
        this.ruleName = ruleName;
1488
      }
1982 varun.gupt 1489
 
3430 rajveer 1490
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1491
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRuleDocString", org.apache.thrift.protocol.TMessageType.CALL, 0));
1492
        getRuleDocString_args args = new getRuleDocString_args();
1493
        args.setRuleName(ruleName);
1494
        args.write(prot);
1495
        prot.writeMessageEnd();
1982 varun.gupt 1496
      }
1497
 
3430 rajveer 1498
      public String getResult() throws org.apache.thrift.TException {
1499
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1500
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 1501
        }
3430 rajveer 1502
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1503
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1504
        return (new Client(prot)).recv_getRuleDocString();
1982 varun.gupt 1505
      }
1506
    }
1507
 
4189 varun.gupt 1508
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException {
1509
      checkReady();
1510
      getItemDiscountMap_call method_call = new getItemDiscountMap_call(itemIds, resultHandler, this, ___protocolFactory, ___transport);
1511
      this.___currentMethod = method_call;
1512
      ___manager.call(method_call);
1513
    }
1514
 
1515
    public static class getItemDiscountMap_call extends org.apache.thrift.async.TAsyncMethodCall {
1516
      private List<Long> itemIds;
1517
      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 {
1518
        super(client, protocolFactory, transport, resultHandler, false);
1519
        this.itemIds = itemIds;
1520
      }
1521
 
1522
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1523
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getItemDiscountMap", org.apache.thrift.protocol.TMessageType.CALL, 0));
1524
        getItemDiscountMap_args args = new getItemDiscountMap_args();
1525
        args.setItemIds(itemIds);
1526
        args.write(prot);
1527
        prot.writeMessageEnd();
1528
      }
1529
 
1530
      public List<ItemCouponDiscount> getResult() throws PromotionException, org.apache.thrift.TException {
1531
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1532
          throw new IllegalStateException("Method call not finished!");
1533
        }
1534
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1535
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1536
        return (new Client(prot)).recv_getItemDiscountMap();
1537
      }
1538
    }
1539
 
4494 varun.gupt 1540
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException {
1541
      checkReady();
1542
      getDiscountsForEntity_call method_call = new getDiscountsForEntity_call(entityId, resultHandler, this, ___protocolFactory, ___transport);
1543
      this.___currentMethod = method_call;
1544
      ___manager.call(method_call);
1545
    }
1546
 
1547
    public static class getDiscountsForEntity_call extends org.apache.thrift.async.TAsyncMethodCall {
1548
      private long entityId;
1549
      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 {
1550
        super(client, protocolFactory, transport, resultHandler, false);
1551
        this.entityId = entityId;
1552
      }
1553
 
1554
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1555
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getDiscountsForEntity", org.apache.thrift.protocol.TMessageType.CALL, 0));
1556
        getDiscountsForEntity_args args = new getDiscountsForEntity_args();
1557
        args.setEntityId(entityId);
1558
        args.write(prot);
1559
        prot.writeMessageEnd();
1560
      }
1561
 
1562
      public Map<String,Double> getResult() throws org.apache.thrift.TException {
1563
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1564
          throw new IllegalStateException("Method call not finished!");
1565
        }
1566
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1567
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1568
        return (new Client(prot)).recv_getDiscountsForEntity();
1569
      }
1570
    }
1571
 
5469 rajveer 1572
    public void addVoucher(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<addVoucher_call> resultHandler) throws org.apache.thrift.TException {
1573
      checkReady();
1574
      addVoucher_call method_call = new addVoucher_call(voucher, resultHandler, this, ___protocolFactory, ___transport);
1575
      this.___currentMethod = method_call;
1576
      ___manager.call(method_call);
1577
    }
1578
 
1579
    public static class addVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
1580
      private Voucher voucher;
1581
      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 {
1582
        super(client, protocolFactory, transport, resultHandler, false);
1583
        this.voucher = voucher;
1584
      }
1585
 
1586
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1587
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
1588
        addVoucher_args args = new addVoucher_args();
1589
        args.setVoucher(voucher);
1590
        args.write(prot);
1591
        prot.writeMessageEnd();
1592
      }
1593
 
1594
      public void getResult() throws org.apache.thrift.TException {
1595
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1596
          throw new IllegalStateException("Method call not finished!");
1597
        }
1598
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1599
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1600
        (new Client(prot)).recv_addVoucher();
1601
      }
1602
    }
1603
 
1604
    public void assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount, org.apache.thrift.async.AsyncMethodCallback<assignVoucher_call> resultHandler) throws org.apache.thrift.TException {
1605
      checkReady();
1606
      assignVoucher_call method_call = new assignVoucher_call(userId, userEmail, voucherType, amount, resultHandler, this, ___protocolFactory, ___transport);
1607
      this.___currentMethod = method_call;
1608
      ___manager.call(method_call);
1609
    }
1610
 
1611
    public static class assignVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
1612
      private long userId;
1613
      private String userEmail;
1614
      private VoucherType voucherType;
1615
      private long amount;
1616
      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 {
1617
        super(client, protocolFactory, transport, resultHandler, false);
1618
        this.userId = userId;
1619
        this.userEmail = userEmail;
1620
        this.voucherType = voucherType;
1621
        this.amount = amount;
1622
      }
1623
 
1624
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1625
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("assignVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
1626
        assignVoucher_args args = new assignVoucher_args();
1627
        args.setUserId(userId);
1628
        args.setUserEmail(userEmail);
1629
        args.setVoucherType(voucherType);
1630
        args.setAmount(amount);
1631
        args.write(prot);
1632
        prot.writeMessageEnd();
1633
      }
1634
 
1635
      public Voucher getResult() throws org.apache.thrift.TException {
1636
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1637
          throw new IllegalStateException("Method call not finished!");
1638
        }
1639
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1640
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1641
        return (new Client(prot)).recv_assignVoucher();
1642
      }
1643
    }
1644
 
1645
    public void markVoucherAsRedeemed(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<markVoucherAsRedeemed_call> resultHandler) throws org.apache.thrift.TException {
1646
      checkReady();
1647
      markVoucherAsRedeemed_call method_call = new markVoucherAsRedeemed_call(voucherCode, redeemedOn, resultHandler, this, ___protocolFactory, ___transport);
1648
      this.___currentMethod = method_call;
1649
      ___manager.call(method_call);
1650
    }
1651
 
1652
    public static class markVoucherAsRedeemed_call extends org.apache.thrift.async.TAsyncMethodCall {
1653
      private String voucherCode;
1654
      private long redeemedOn;
1655
      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 {
1656
        super(client, protocolFactory, transport, resultHandler, false);
1657
        this.voucherCode = voucherCode;
1658
        this.redeemedOn = redeemedOn;
1659
      }
1660
 
1661
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1662
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("markVoucherAsRedeemed", org.apache.thrift.protocol.TMessageType.CALL, 0));
1663
        markVoucherAsRedeemed_args args = new markVoucherAsRedeemed_args();
1664
        args.setVoucherCode(voucherCode);
1665
        args.setRedeemedOn(redeemedOn);
1666
        args.write(prot);
1667
        prot.writeMessageEnd();
1668
      }
1669
 
1670
      public boolean getResult() throws org.apache.thrift.TException {
1671
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1672
          throw new IllegalStateException("Method call not finished!");
1673
        }
1674
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1675
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1676
        return (new Client(prot)).recv_markVoucherAsRedeemed();
1677
      }
1678
    }
1679
 
3430 rajveer 1680
  }
1982 varun.gupt 1681
 
3430 rajveer 1682
  public static class Processor<I extends Iface> extends in.shop2020.generic.GenericService.Processor implements org.apache.thrift.TProcessor {
1683
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
1684
    public Processor(I iface) {
1685
      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
1982 varun.gupt 1686
    }
1687
 
3430 rajveer 1688
    protected Processor(I iface, Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
1689
      super(iface, getProcessMap(processMap));
1982 varun.gupt 1690
    }
1691
 
3430 rajveer 1692
    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) {
1693
      processMap.put("createPromotion", new createPromotion());
7746 amit.gupta 1694
      processMap.put("removeAllCouponsByPromotionId", new removeAllCouponsByPromotionId());
6301 amit.gupta 1695
      processMap.put("getCoupon", new getCoupon());
1696
      processMap.put("isGiftVoucher", new isGiftVoucher());
6356 amit.gupta 1697
      processMap.put("isCodApplicable", new isCodApplicable());
3430 rajveer 1698
      processMap.put("getAllPromotions", new getAllPromotions());
1699
      processMap.put("getPromotionById", new getPromotionById());
1700
      processMap.put("generateCouponsForPromotion", new generateCouponsForPromotion());
1701
      processMap.put("applyCoupon", new applyCoupon());
6736 amit.gupta 1702
      processMap.put("getEmiDiscount", new getEmiDiscount());
6433 anupam.sin 1703
      processMap.put("applyRechargeCoupon", new applyRechargeCoupon());
3430 rajveer 1704
      processMap.put("trackCouponUsage", new trackCouponUsage());
1705
      processMap.put("getCouponUsageCountByUser", new getCouponUsageCountByUser());
6497 amit.gupta 1706
      processMap.put("getActiveCodes", new getActiveCodes());
1707
      processMap.put("deleteCoupon", new deleteCoupon());
7092 amit.gupta 1708
      processMap.put("getAllCouponsByPromotionId", new getAllCouponsByPromotionId());
3430 rajveer 1709
      processMap.put("getActiveCoupons", new getActiveCoupons());
6250 amit.gupta 1710
      processMap.put("createCoupon", new createCoupon());
3430 rajveer 1711
      processMap.put("getSuccessfulPaymentCountForCoupon", new getSuccessfulPaymentCountForCoupon());
1712
      processMap.put("getRuleDocString", new getRuleDocString());
4189 varun.gupt 1713
      processMap.put("getItemDiscountMap", new getItemDiscountMap());
4494 varun.gupt 1714
      processMap.put("getDiscountsForEntity", new getDiscountsForEntity());
5469 rajveer 1715
      processMap.put("addVoucher", new addVoucher());
1716
      processMap.put("assignVoucher", new assignVoucher());
1717
      processMap.put("markVoucherAsRedeemed", new markVoucherAsRedeemed());
3430 rajveer 1718
      return processMap;
1982 varun.gupt 1719
    }
1720
 
3430 rajveer 1721
    private static class createPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createPromotion_args> {
1722
      public createPromotion() {
1723
        super("createPromotion");
1724
      }
1982 varun.gupt 1725
 
3430 rajveer 1726
      protected createPromotion_args getEmptyArgsInstance() {
1727
        return new createPromotion_args();
1728
      }
1982 varun.gupt 1729
 
3430 rajveer 1730
      protected createPromotion_result getResult(I iface, createPromotion_args args) throws org.apache.thrift.TException {
1731
        createPromotion_result result = new createPromotion_result();
1732
        try {
1733
          iface.createPromotion(args.name, args.ruleExecutionSrc, args.startOn, args.endOn);
1734
        } catch (PromotionException pex) {
1735
          result.pex = pex;
1982 varun.gupt 1736
        }
3430 rajveer 1737
        return result;
1982 varun.gupt 1738
      }
3430 rajveer 1739
    }
1982 varun.gupt 1740
 
7746 amit.gupta 1741
    private static class removeAllCouponsByPromotionId<I extends Iface> extends org.apache.thrift.ProcessFunction<I, removeAllCouponsByPromotionId_args> {
1742
      public removeAllCouponsByPromotionId() {
1743
        super("removeAllCouponsByPromotionId");
1744
      }
1745
 
1746
      protected removeAllCouponsByPromotionId_args getEmptyArgsInstance() {
1747
        return new removeAllCouponsByPromotionId_args();
1748
      }
1749
 
1750
      protected removeAllCouponsByPromotionId_result getResult(I iface, removeAllCouponsByPromotionId_args args) throws org.apache.thrift.TException {
1751
        removeAllCouponsByPromotionId_result result = new removeAllCouponsByPromotionId_result();
1752
        try {
1753
          result.success = iface.removeAllCouponsByPromotionId(args.promotionId);
1754
          result.setSuccessIsSet(true);
1755
        } catch (PromotionException pex) {
1756
          result.pex = pex;
1757
        }
1758
        return result;
1759
      }
1760
    }
1761
 
6301 amit.gupta 1762
    private static class getCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCoupon_args> {
1763
      public getCoupon() {
1764
        super("getCoupon");
1765
      }
1766
 
1767
      protected getCoupon_args getEmptyArgsInstance() {
1768
        return new getCoupon_args();
1769
      }
1770
 
1771
      protected getCoupon_result getResult(I iface, getCoupon_args args) throws org.apache.thrift.TException {
1772
        getCoupon_result result = new getCoupon_result();
1773
        try {
1774
          result.success = iface.getCoupon(args.couponCode);
1775
        } catch (PromotionException pex) {
1776
          result.pex = pex;
1777
        }
1778
        return result;
1779
      }
1780
    }
1781
 
1782
    private static class isGiftVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isGiftVoucher_args> {
1783
      public isGiftVoucher() {
1784
        super("isGiftVoucher");
1785
      }
1786
 
1787
      protected isGiftVoucher_args getEmptyArgsInstance() {
1788
        return new isGiftVoucher_args();
1789
      }
1790
 
1791
      protected isGiftVoucher_result getResult(I iface, isGiftVoucher_args args) throws org.apache.thrift.TException {
1792
        isGiftVoucher_result result = new isGiftVoucher_result();
1793
        try {
1794
          result.success = iface.isGiftVoucher(args.couponCode);
1795
          result.setSuccessIsSet(true);
1796
        } catch (PromotionException pex) {
1797
          result.pex = pex;
1798
        }
1799
        return result;
1800
      }
1801
    }
1802
 
6356 amit.gupta 1803
    private static class isCodApplicable<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isCodApplicable_args> {
1804
      public isCodApplicable() {
1805
        super("isCodApplicable");
1806
      }
1807
 
1808
      protected isCodApplicable_args getEmptyArgsInstance() {
1809
        return new isCodApplicable_args();
1810
      }
1811
 
1812
      protected isCodApplicable_result getResult(I iface, isCodApplicable_args args) throws org.apache.thrift.TException {
1813
        isCodApplicable_result result = new isCodApplicable_result();
1814
        try {
1815
          result.success = iface.isCodApplicable(args.couponCode);
1816
          result.setSuccessIsSet(true);
1817
        } catch (PromotionException pex) {
1818
          result.pex = pex;
1819
        }
1820
        return result;
1821
      }
1822
    }
1823
 
3430 rajveer 1824
    private static class getAllPromotions<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllPromotions_args> {
1825
      public getAllPromotions() {
1826
        super("getAllPromotions");
1982 varun.gupt 1827
      }
1828
 
3430 rajveer 1829
      protected getAllPromotions_args getEmptyArgsInstance() {
1830
        return new getAllPromotions_args();
1982 varun.gupt 1831
      }
1832
 
3430 rajveer 1833
      protected getAllPromotions_result getResult(I iface, getAllPromotions_args args) throws org.apache.thrift.TException {
1834
        getAllPromotions_result result = new getAllPromotions_result();
1835
        try {
1836
          result.success = iface.getAllPromotions();
1837
        } catch (PromotionException pex) {
1838
          result.pex = pex;
1839
        }
1840
        return result;
1982 varun.gupt 1841
      }
3430 rajveer 1842
    }
1982 varun.gupt 1843
 
3430 rajveer 1844
    private static class getPromotionById<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPromotionById_args> {
1845
      public getPromotionById() {
1846
        super("getPromotionById");
1982 varun.gupt 1847
      }
1848
 
3430 rajveer 1849
      protected getPromotionById_args getEmptyArgsInstance() {
1850
        return new getPromotionById_args();
1982 varun.gupt 1851
      }
1852
 
3430 rajveer 1853
      protected getPromotionById_result getResult(I iface, getPromotionById_args args) throws org.apache.thrift.TException {
1854
        getPromotionById_result result = new getPromotionById_result();
1855
        try {
1856
          result.success = iface.getPromotionById(args.promotionId);
1857
        } catch (PromotionException pex) {
1858
          result.pex = pex;
1859
        }
1860
        return result;
1982 varun.gupt 1861
      }
1862
    }
1863
 
3430 rajveer 1864
    private static class generateCouponsForPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, generateCouponsForPromotion_args> {
1865
      public generateCouponsForPromotion() {
1866
        super("generateCouponsForPromotion");
1867
      }
1982 varun.gupt 1868
 
3430 rajveer 1869
      protected generateCouponsForPromotion_args getEmptyArgsInstance() {
1870
        return new generateCouponsForPromotion_args();
1871
      }
1982 varun.gupt 1872
 
3430 rajveer 1873
      protected generateCouponsForPromotion_result getResult(I iface, generateCouponsForPromotion_args args) throws org.apache.thrift.TException {
1874
        generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
1875
        try {
1876
          iface.generateCouponsForPromotion(args.promotionId, args.couponCode);
1877
        } catch (PromotionException pex) {
1878
          result.pex = pex;
1879
        }
1880
        return result;
1881
      }
1982 varun.gupt 1882
    }
1883
 
3430 rajveer 1884
    private static class applyCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, applyCoupon_args> {
1885
      public applyCoupon() {
1886
        super("applyCoupon");
1887
      }
1982 varun.gupt 1888
 
3430 rajveer 1889
      protected applyCoupon_args getEmptyArgsInstance() {
1890
        return new applyCoupon_args();
1891
      }
1982 varun.gupt 1892
 
3430 rajveer 1893
      protected applyCoupon_result getResult(I iface, applyCoupon_args args) throws org.apache.thrift.TException {
1894
        applyCoupon_result result = new applyCoupon_result();
1895
        try {
1896
          result.success = iface.applyCoupon(args.couponCode, args.cartId);
1897
        } catch (PromotionException pex) {
1898
          result.pex = pex;
1899
        }
1900
        return result;
1982 varun.gupt 1901
      }
1902
    }
1903
 
6736 amit.gupta 1904
    private static class getEmiDiscount<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getEmiDiscount_args> {
1905
      public getEmiDiscount() {
1906
        super("getEmiDiscount");
1907
      }
1908
 
1909
      protected getEmiDiscount_args getEmptyArgsInstance() {
1910
        return new getEmiDiscount_args();
1911
      }
1912
 
1913
      protected getEmiDiscount_result getResult(I iface, getEmiDiscount_args args) throws org.apache.thrift.TException {
1914
        getEmiDiscount_result result = new getEmiDiscount_result();
1915
        try {
1916
          result.success = iface.getEmiDiscount(args.cartId);
1917
        } catch (PromotionException pex) {
1918
          result.pex = pex;
1919
        }
1920
        return result;
1921
      }
1922
    }
1923
 
6433 anupam.sin 1924
    private static class applyRechargeCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, applyRechargeCoupon_args> {
1925
      public applyRechargeCoupon() {
1926
        super("applyRechargeCoupon");
1927
      }
1928
 
1929
      protected applyRechargeCoupon_args getEmptyArgsInstance() {
1930
        return new applyRechargeCoupon_args();
1931
      }
1932
 
1933
      protected applyRechargeCoupon_result getResult(I iface, applyRechargeCoupon_args args) throws org.apache.thrift.TException {
1934
        applyRechargeCoupon_result result = new applyRechargeCoupon_result();
1935
        try {
1936
          result.success = iface.applyRechargeCoupon(args.couponCode, args.totalAmount, args.userId);
1937
        } catch (PromotionException pex) {
1938
          result.pex = pex;
1939
        }
1940
        return result;
1941
      }
1942
    }
1943
 
3430 rajveer 1944
    private static class trackCouponUsage<I extends Iface> extends org.apache.thrift.ProcessFunction<I, trackCouponUsage_args> {
1945
      public trackCouponUsage() {
1946
        super("trackCouponUsage");
1947
      }
1982 varun.gupt 1948
 
3430 rajveer 1949
      protected trackCouponUsage_args getEmptyArgsInstance() {
1950
        return new trackCouponUsage_args();
1982 varun.gupt 1951
      }
1952
 
3430 rajveer 1953
      protected trackCouponUsage_result getResult(I iface, trackCouponUsage_args args) throws org.apache.thrift.TException {
1954
        trackCouponUsage_result result = new trackCouponUsage_result();
1955
        try {
1956
          iface.trackCouponUsage(args.couponCode, args.transactionId, args.userId);
1957
        } catch (PromotionException pex) {
1958
          result.pex = pex;
1959
        }
1960
        return result;
1961
      }
1982 varun.gupt 1962
    }
1963
 
3430 rajveer 1964
    private static class getCouponUsageCountByUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCouponUsageCountByUser_args> {
1965
      public getCouponUsageCountByUser() {
1966
        super("getCouponUsageCountByUser");
1982 varun.gupt 1967
      }
1968
 
3430 rajveer 1969
      protected getCouponUsageCountByUser_args getEmptyArgsInstance() {
1970
        return new getCouponUsageCountByUser_args();
1971
      }
1982 varun.gupt 1972
 
3430 rajveer 1973
      protected getCouponUsageCountByUser_result getResult(I iface, getCouponUsageCountByUser_args args) throws org.apache.thrift.TException {
1974
        getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
1975
        try {
1976
          result.success = iface.getCouponUsageCountByUser(args.couponCode, args.userId);
1977
          result.setSuccessIsSet(true);
1978
        } catch (PromotionException pex) {
1979
          result.pex = pex;
1980
        }
1981
        return result;
1982
      }
1982 varun.gupt 1983
    }
1984
 
6497 amit.gupta 1985
    private static class getActiveCodes<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getActiveCodes_args> {
1986
      public getActiveCodes() {
1987
        super("getActiveCodes");
1988
      }
1989
 
1990
      protected getActiveCodes_args getEmptyArgsInstance() {
1991
        return new getActiveCodes_args();
1992
      }
1993
 
1994
      protected getActiveCodes_result getResult(I iface, getActiveCodes_args args) throws org.apache.thrift.TException {
1995
        getActiveCodes_result result = new getActiveCodes_result();
1996
        try {
1997
          result.success = iface.getActiveCodes(args.promotionId);
1998
        } catch (PromotionException pex) {
1999
          result.pex = pex;
2000
        }
2001
        return result;
2002
      }
2003
    }
2004
 
2005
    private static class deleteCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, deleteCoupon_args> {
2006
      public deleteCoupon() {
2007
        super("deleteCoupon");
2008
      }
2009
 
2010
      protected deleteCoupon_args getEmptyArgsInstance() {
2011
        return new deleteCoupon_args();
2012
      }
2013
 
2014
      protected deleteCoupon_result getResult(I iface, deleteCoupon_args args) throws org.apache.thrift.TException {
2015
        deleteCoupon_result result = new deleteCoupon_result();
2016
        try {
2017
          iface.deleteCoupon(args.couponCode);
2018
        } catch (PromotionException pex) {
2019
          result.pex = pex;
2020
        }
2021
        return result;
2022
      }
2023
    }
2024
 
7092 amit.gupta 2025
    private static class getAllCouponsByPromotionId<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllCouponsByPromotionId_args> {
2026
      public getAllCouponsByPromotionId() {
2027
        super("getAllCouponsByPromotionId");
2028
      }
2029
 
2030
      protected getAllCouponsByPromotionId_args getEmptyArgsInstance() {
2031
        return new getAllCouponsByPromotionId_args();
2032
      }
2033
 
2034
      protected getAllCouponsByPromotionId_result getResult(I iface, getAllCouponsByPromotionId_args args) throws org.apache.thrift.TException {
2035
        getAllCouponsByPromotionId_result result = new getAllCouponsByPromotionId_result();
2036
        try {
2037
          result.success = iface.getAllCouponsByPromotionId(args.promotionId);
2038
        } catch (PromotionException pex) {
2039
          result.pex = pex;
2040
        }
2041
        return result;
2042
      }
2043
    }
2044
 
3430 rajveer 2045
    private static class getActiveCoupons<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getActiveCoupons_args> {
2046
      public getActiveCoupons() {
2047
        super("getActiveCoupons");
2048
      }
1982 varun.gupt 2049
 
3430 rajveer 2050
      protected getActiveCoupons_args getEmptyArgsInstance() {
2051
        return new getActiveCoupons_args();
2052
      }
1982 varun.gupt 2053
 
3430 rajveer 2054
      protected getActiveCoupons_result getResult(I iface, getActiveCoupons_args args) throws org.apache.thrift.TException {
2055
        getActiveCoupons_result result = new getActiveCoupons_result();
2056
        try {
2057
          result.success = iface.getActiveCoupons();
2058
        } catch (PromotionException pex) {
2059
          result.pex = pex;
2060
        }
2061
        return result;
2062
      }
1982 varun.gupt 2063
    }
2064
 
6250 amit.gupta 2065
    private static class createCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createCoupon_args> {
2066
      public createCoupon() {
2067
        super("createCoupon");
2068
      }
2069
 
2070
      protected createCoupon_args getEmptyArgsInstance() {
2071
        return new createCoupon_args();
2072
      }
2073
 
2074
      protected createCoupon_result getResult(I iface, createCoupon_args args) throws org.apache.thrift.TException {
2075
        createCoupon_result result = new createCoupon_result();
2076
        try {
6730 anupam.sin 2077
          result.success = iface.createCoupon(args.promotionId, args.couponCode, args.arguments, args.isCod, args.prefix);
6250 amit.gupta 2078
        } catch (PromotionException pex) {
2079
          result.pex = pex;
2080
        }
2081
        return result;
2082
      }
2083
    }
2084
 
3430 rajveer 2085
    private static class getSuccessfulPaymentCountForCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSuccessfulPaymentCountForCoupon_args> {
2086
      public getSuccessfulPaymentCountForCoupon() {
2087
        super("getSuccessfulPaymentCountForCoupon");
1982 varun.gupt 2088
      }
2089
 
3430 rajveer 2090
      protected getSuccessfulPaymentCountForCoupon_args getEmptyArgsInstance() {
2091
        return new getSuccessfulPaymentCountForCoupon_args();
2092
      }
1982 varun.gupt 2093
 
3430 rajveer 2094
      protected getSuccessfulPaymentCountForCoupon_result getResult(I iface, getSuccessfulPaymentCountForCoupon_args args) throws org.apache.thrift.TException {
2095
        getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
2096
        try {
2097
          result.success = iface.getSuccessfulPaymentCountForCoupon(args.couponCode);
2098
          result.setSuccessIsSet(true);
2099
        } catch (PromotionException pex) {
2100
          result.pex = pex;
1982 varun.gupt 2101
        }
3430 rajveer 2102
        return result;
1982 varun.gupt 2103
      }
2104
    }
2105
 
3430 rajveer 2106
    private static class getRuleDocString<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getRuleDocString_args> {
2107
      public getRuleDocString() {
2108
        super("getRuleDocString");
2109
      }
1982 varun.gupt 2110
 
3430 rajveer 2111
      protected getRuleDocString_args getEmptyArgsInstance() {
2112
        return new getRuleDocString_args();
2113
      }
1982 varun.gupt 2114
 
3430 rajveer 2115
      protected getRuleDocString_result getResult(I iface, getRuleDocString_args args) throws org.apache.thrift.TException {
2116
        getRuleDocString_result result = new getRuleDocString_result();
2117
        result.success = iface.getRuleDocString(args.ruleName);
2118
        return result;
2119
      }
1982 varun.gupt 2120
    }
2121
 
4189 varun.gupt 2122
    private static class getItemDiscountMap<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getItemDiscountMap_args> {
2123
      public getItemDiscountMap() {
2124
        super("getItemDiscountMap");
2125
      }
2126
 
2127
      protected getItemDiscountMap_args getEmptyArgsInstance() {
2128
        return new getItemDiscountMap_args();
2129
      }
2130
 
2131
      protected getItemDiscountMap_result getResult(I iface, getItemDiscountMap_args args) throws org.apache.thrift.TException {
2132
        getItemDiscountMap_result result = new getItemDiscountMap_result();
2133
        try {
2134
          result.success = iface.getItemDiscountMap(args.itemIds);
2135
        } catch (PromotionException pex) {
2136
          result.pex = pex;
2137
        }
2138
        return result;
2139
      }
2140
    }
2141
 
4494 varun.gupt 2142
    private static class getDiscountsForEntity<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getDiscountsForEntity_args> {
2143
      public getDiscountsForEntity() {
2144
        super("getDiscountsForEntity");
2145
      }
2146
 
2147
      protected getDiscountsForEntity_args getEmptyArgsInstance() {
2148
        return new getDiscountsForEntity_args();
2149
      }
2150
 
2151
      protected getDiscountsForEntity_result getResult(I iface, getDiscountsForEntity_args args) throws org.apache.thrift.TException {
2152
        getDiscountsForEntity_result result = new getDiscountsForEntity_result();
2153
        result.success = iface.getDiscountsForEntity(args.entityId);
2154
        return result;
2155
      }
2156
    }
2157
 
5469 rajveer 2158
    private static class addVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addVoucher_args> {
2159
      public addVoucher() {
2160
        super("addVoucher");
2161
      }
2162
 
2163
      protected addVoucher_args getEmptyArgsInstance() {
2164
        return new addVoucher_args();
2165
      }
2166
 
2167
      protected addVoucher_result getResult(I iface, addVoucher_args args) throws org.apache.thrift.TException {
2168
        addVoucher_result result = new addVoucher_result();
2169
        iface.addVoucher(args.voucher);
2170
        return result;
2171
      }
2172
    }
2173
 
2174
    private static class assignVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, assignVoucher_args> {
2175
      public assignVoucher() {
2176
        super("assignVoucher");
2177
      }
2178
 
2179
      protected assignVoucher_args getEmptyArgsInstance() {
2180
        return new assignVoucher_args();
2181
      }
2182
 
2183
      protected assignVoucher_result getResult(I iface, assignVoucher_args args) throws org.apache.thrift.TException {
2184
        assignVoucher_result result = new assignVoucher_result();
2185
        result.success = iface.assignVoucher(args.userId, args.userEmail, args.voucherType, args.amount);
2186
        return result;
2187
      }
2188
    }
2189
 
2190
    private static class markVoucherAsRedeemed<I extends Iface> extends org.apache.thrift.ProcessFunction<I, markVoucherAsRedeemed_args> {
2191
      public markVoucherAsRedeemed() {
2192
        super("markVoucherAsRedeemed");
2193
      }
2194
 
2195
      protected markVoucherAsRedeemed_args getEmptyArgsInstance() {
2196
        return new markVoucherAsRedeemed_args();
2197
      }
2198
 
2199
      protected markVoucherAsRedeemed_result getResult(I iface, markVoucherAsRedeemed_args args) throws org.apache.thrift.TException {
2200
        markVoucherAsRedeemed_result result = new markVoucherAsRedeemed_result();
2201
        result.success = iface.markVoucherAsRedeemed(args.voucherCode, args.redeemedOn);
2202
        result.setSuccessIsSet(true);
2203
        return result;
2204
      }
2205
    }
2206
 
1982 varun.gupt 2207
  }
2208
 
3430 rajveer 2209
  public static class createPromotion_args implements org.apache.thrift.TBase<createPromotion_args, createPromotion_args._Fields>, java.io.Serializable, Cloneable   {
2210
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_args");
1982 varun.gupt 2211
 
3430 rajveer 2212
    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);
2213
    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);
2214
    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);
2215
    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 2216
 
3430 rajveer 2217
    private String name; // required
2218
    private String ruleExecutionSrc; // required
2219
    private long startOn; // required
2220
    private long endOn; // required
1982 varun.gupt 2221
 
2222
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2223
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2224
      NAME((short)1, "name"),
2225
      RULE_EXECUTION_SRC((short)2, "ruleExecutionSrc"),
2226
      START_ON((short)3, "startOn"),
2227
      END_ON((short)4, "endOn");
2228
 
2229
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2230
 
2231
      static {
2232
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2233
          byName.put(field.getFieldName(), field);
2234
        }
2235
      }
2236
 
2237
      /**
2238
       * Find the _Fields constant that matches fieldId, or null if its not found.
2239
       */
2240
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2241
        switch(fieldId) {
2242
          case 1: // NAME
2243
            return NAME;
2244
          case 2: // RULE_EXECUTION_SRC
2245
            return RULE_EXECUTION_SRC;
2246
          case 3: // START_ON
2247
            return START_ON;
2248
          case 4: // END_ON
2249
            return END_ON;
2250
          default:
2251
            return null;
2252
        }
1982 varun.gupt 2253
      }
2254
 
2255
      /**
2256
       * Find the _Fields constant that matches fieldId, throwing an exception
2257
       * if it is not found.
2258
       */
2259
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2260
        _Fields fields = findByThriftId(fieldId);
2261
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2262
        return fields;
2263
      }
2264
 
2265
      /**
2266
       * Find the _Fields constant that matches name, or null if its not found.
2267
       */
2268
      public static _Fields findByName(String name) {
2269
        return byName.get(name);
2270
      }
2271
 
2272
      private final short _thriftId;
2273
      private final String _fieldName;
2274
 
2275
      _Fields(short thriftId, String fieldName) {
2276
        _thriftId = thriftId;
2277
        _fieldName = fieldName;
2278
      }
2279
 
2280
      public short getThriftFieldId() {
2281
        return _thriftId;
2282
      }
2283
 
2284
      public String getFieldName() {
2285
        return _fieldName;
2286
      }
2287
    }
2288
 
2289
    // isset id assignments
2290
    private static final int __STARTON_ISSET_ID = 0;
2291
    private static final int __ENDON_ISSET_ID = 1;
2292
    private BitSet __isset_bit_vector = new BitSet(2);
2293
 
3430 rajveer 2294
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2295
    static {
3430 rajveer 2296
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2297
      tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2298
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
2299
      tmpMap.put(_Fields.RULE_EXECUTION_SRC, new org.apache.thrift.meta_data.FieldMetaData("ruleExecutionSrc", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2300
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
2301
      tmpMap.put(_Fields.START_ON, new org.apache.thrift.meta_data.FieldMetaData("startOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2302
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
2303
      tmpMap.put(_Fields.END_ON, new org.apache.thrift.meta_data.FieldMetaData("endOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2304
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
2305
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2306
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_args.class, metaDataMap);
1982 varun.gupt 2307
    }
2308
 
2309
    public createPromotion_args() {
2310
    }
2311
 
2312
    public createPromotion_args(
2313
      String name,
2314
      String ruleExecutionSrc,
2315
      long startOn,
2316
      long endOn)
2317
    {
2318
      this();
2319
      this.name = name;
2320
      this.ruleExecutionSrc = ruleExecutionSrc;
2321
      this.startOn = startOn;
2322
      setStartOnIsSet(true);
2323
      this.endOn = endOn;
2324
      setEndOnIsSet(true);
2325
    }
2326
 
2327
    /**
2328
     * Performs a deep copy on <i>other</i>.
2329
     */
2330
    public createPromotion_args(createPromotion_args other) {
2331
      __isset_bit_vector.clear();
2332
      __isset_bit_vector.or(other.__isset_bit_vector);
2333
      if (other.isSetName()) {
2334
        this.name = other.name;
2335
      }
2336
      if (other.isSetRuleExecutionSrc()) {
2337
        this.ruleExecutionSrc = other.ruleExecutionSrc;
2338
      }
2339
      this.startOn = other.startOn;
2340
      this.endOn = other.endOn;
2341
    }
2342
 
2343
    public createPromotion_args deepCopy() {
2344
      return new createPromotion_args(this);
2345
    }
2346
 
3430 rajveer 2347
    @Override
2348
    public void clear() {
2349
      this.name = null;
2350
      this.ruleExecutionSrc = null;
2351
      setStartOnIsSet(false);
2352
      this.startOn = 0;
2353
      setEndOnIsSet(false);
2354
      this.endOn = 0;
1982 varun.gupt 2355
    }
2356
 
2357
    public String getName() {
2358
      return this.name;
2359
    }
2360
 
3430 rajveer 2361
    public void setName(String name) {
1982 varun.gupt 2362
      this.name = name;
2363
    }
2364
 
2365
    public void unsetName() {
2366
      this.name = null;
2367
    }
2368
 
3430 rajveer 2369
    /** Returns true if field name is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2370
    public boolean isSetName() {
2371
      return this.name != null;
2372
    }
2373
 
2374
    public void setNameIsSet(boolean value) {
2375
      if (!value) {
2376
        this.name = null;
2377
      }
2378
    }
2379
 
2380
    public String getRuleExecutionSrc() {
2381
      return this.ruleExecutionSrc;
2382
    }
2383
 
3430 rajveer 2384
    public void setRuleExecutionSrc(String ruleExecutionSrc) {
1982 varun.gupt 2385
      this.ruleExecutionSrc = ruleExecutionSrc;
2386
    }
2387
 
2388
    public void unsetRuleExecutionSrc() {
2389
      this.ruleExecutionSrc = null;
2390
    }
2391
 
3430 rajveer 2392
    /** Returns true if field ruleExecutionSrc is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2393
    public boolean isSetRuleExecutionSrc() {
2394
      return this.ruleExecutionSrc != null;
2395
    }
2396
 
2397
    public void setRuleExecutionSrcIsSet(boolean value) {
2398
      if (!value) {
2399
        this.ruleExecutionSrc = null;
2400
      }
2401
    }
2402
 
2403
    public long getStartOn() {
2404
      return this.startOn;
2405
    }
2406
 
3430 rajveer 2407
    public void setStartOn(long startOn) {
1982 varun.gupt 2408
      this.startOn = startOn;
2409
      setStartOnIsSet(true);
2410
    }
2411
 
2412
    public void unsetStartOn() {
2413
      __isset_bit_vector.clear(__STARTON_ISSET_ID);
2414
    }
2415
 
3430 rajveer 2416
    /** Returns true if field startOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2417
    public boolean isSetStartOn() {
2418
      return __isset_bit_vector.get(__STARTON_ISSET_ID);
2419
    }
2420
 
2421
    public void setStartOnIsSet(boolean value) {
2422
      __isset_bit_vector.set(__STARTON_ISSET_ID, value);
2423
    }
2424
 
2425
    public long getEndOn() {
2426
      return this.endOn;
2427
    }
2428
 
3430 rajveer 2429
    public void setEndOn(long endOn) {
1982 varun.gupt 2430
      this.endOn = endOn;
2431
      setEndOnIsSet(true);
2432
    }
2433
 
2434
    public void unsetEndOn() {
2435
      __isset_bit_vector.clear(__ENDON_ISSET_ID);
2436
    }
2437
 
3430 rajveer 2438
    /** Returns true if field endOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2439
    public boolean isSetEndOn() {
2440
      return __isset_bit_vector.get(__ENDON_ISSET_ID);
2441
    }
2442
 
2443
    public void setEndOnIsSet(boolean value) {
2444
      __isset_bit_vector.set(__ENDON_ISSET_ID, value);
2445
    }
2446
 
2447
    public void setFieldValue(_Fields field, Object value) {
2448
      switch (field) {
2449
      case NAME:
2450
        if (value == null) {
2451
          unsetName();
2452
        } else {
2453
          setName((String)value);
2454
        }
2455
        break;
2456
 
2457
      case RULE_EXECUTION_SRC:
2458
        if (value == null) {
2459
          unsetRuleExecutionSrc();
2460
        } else {
2461
          setRuleExecutionSrc((String)value);
2462
        }
2463
        break;
2464
 
2465
      case START_ON:
2466
        if (value == null) {
2467
          unsetStartOn();
2468
        } else {
2469
          setStartOn((Long)value);
2470
        }
2471
        break;
2472
 
2473
      case END_ON:
2474
        if (value == null) {
2475
          unsetEndOn();
2476
        } else {
2477
          setEndOn((Long)value);
2478
        }
2479
        break;
2480
 
2481
      }
2482
    }
2483
 
2484
    public Object getFieldValue(_Fields field) {
2485
      switch (field) {
2486
      case NAME:
2487
        return getName();
2488
 
2489
      case RULE_EXECUTION_SRC:
2490
        return getRuleExecutionSrc();
2491
 
2492
      case START_ON:
3430 rajveer 2493
        return Long.valueOf(getStartOn());
1982 varun.gupt 2494
 
2495
      case END_ON:
3430 rajveer 2496
        return Long.valueOf(getEndOn());
1982 varun.gupt 2497
 
2498
      }
2499
      throw new IllegalStateException();
2500
    }
2501
 
3430 rajveer 2502
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2503
    public boolean isSet(_Fields field) {
2504
      if (field == null) {
2505
        throw new IllegalArgumentException();
2506
      }
1982 varun.gupt 2507
 
2508
      switch (field) {
2509
      case NAME:
2510
        return isSetName();
2511
      case RULE_EXECUTION_SRC:
2512
        return isSetRuleExecutionSrc();
2513
      case START_ON:
2514
        return isSetStartOn();
2515
      case END_ON:
2516
        return isSetEndOn();
2517
      }
2518
      throw new IllegalStateException();
2519
    }
2520
 
2521
    @Override
2522
    public boolean equals(Object that) {
2523
      if (that == null)
2524
        return false;
2525
      if (that instanceof createPromotion_args)
2526
        return this.equals((createPromotion_args)that);
2527
      return false;
2528
    }
2529
 
2530
    public boolean equals(createPromotion_args that) {
2531
      if (that == null)
2532
        return false;
2533
 
2534
      boolean this_present_name = true && this.isSetName();
2535
      boolean that_present_name = true && that.isSetName();
2536
      if (this_present_name || that_present_name) {
2537
        if (!(this_present_name && that_present_name))
2538
          return false;
2539
        if (!this.name.equals(that.name))
2540
          return false;
2541
      }
2542
 
2543
      boolean this_present_ruleExecutionSrc = true && this.isSetRuleExecutionSrc();
2544
      boolean that_present_ruleExecutionSrc = true && that.isSetRuleExecutionSrc();
2545
      if (this_present_ruleExecutionSrc || that_present_ruleExecutionSrc) {
2546
        if (!(this_present_ruleExecutionSrc && that_present_ruleExecutionSrc))
2547
          return false;
2548
        if (!this.ruleExecutionSrc.equals(that.ruleExecutionSrc))
2549
          return false;
2550
      }
2551
 
2552
      boolean this_present_startOn = true;
2553
      boolean that_present_startOn = true;
2554
      if (this_present_startOn || that_present_startOn) {
2555
        if (!(this_present_startOn && that_present_startOn))
2556
          return false;
2557
        if (this.startOn != that.startOn)
2558
          return false;
2559
      }
2560
 
2561
      boolean this_present_endOn = true;
2562
      boolean that_present_endOn = true;
2563
      if (this_present_endOn || that_present_endOn) {
2564
        if (!(this_present_endOn && that_present_endOn))
2565
          return false;
2566
        if (this.endOn != that.endOn)
2567
          return false;
2568
      }
2569
 
2570
      return true;
2571
    }
2572
 
2573
    @Override
2574
    public int hashCode() {
2575
      return 0;
2576
    }
2577
 
2578
    public int compareTo(createPromotion_args other) {
2579
      if (!getClass().equals(other.getClass())) {
2580
        return getClass().getName().compareTo(other.getClass().getName());
2581
      }
2582
 
2583
      int lastComparison = 0;
2584
      createPromotion_args typedOther = (createPromotion_args)other;
2585
 
3430 rajveer 2586
      lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
1982 varun.gupt 2587
      if (lastComparison != 0) {
2588
        return lastComparison;
2589
      }
3430 rajveer 2590
      if (isSetName()) {
2591
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
2592
        if (lastComparison != 0) {
2593
          return lastComparison;
2594
        }
1982 varun.gupt 2595
      }
3430 rajveer 2596
      lastComparison = Boolean.valueOf(isSetRuleExecutionSrc()).compareTo(typedOther.isSetRuleExecutionSrc());
1982 varun.gupt 2597
      if (lastComparison != 0) {
2598
        return lastComparison;
2599
      }
3430 rajveer 2600
      if (isSetRuleExecutionSrc()) {
2601
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleExecutionSrc, typedOther.ruleExecutionSrc);
2602
        if (lastComparison != 0) {
2603
          return lastComparison;
2604
        }
1982 varun.gupt 2605
      }
3430 rajveer 2606
      lastComparison = Boolean.valueOf(isSetStartOn()).compareTo(typedOther.isSetStartOn());
1982 varun.gupt 2607
      if (lastComparison != 0) {
2608
        return lastComparison;
2609
      }
3430 rajveer 2610
      if (isSetStartOn()) {
2611
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startOn, typedOther.startOn);
2612
        if (lastComparison != 0) {
2613
          return lastComparison;
2614
        }
1982 varun.gupt 2615
      }
3430 rajveer 2616
      lastComparison = Boolean.valueOf(isSetEndOn()).compareTo(typedOther.isSetEndOn());
1982 varun.gupt 2617
      if (lastComparison != 0) {
2618
        return lastComparison;
2619
      }
3430 rajveer 2620
      if (isSetEndOn()) {
2621
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endOn, typedOther.endOn);
2622
        if (lastComparison != 0) {
2623
          return lastComparison;
2624
        }
1982 varun.gupt 2625
      }
2626
      return 0;
2627
    }
2628
 
3430 rajveer 2629
    public _Fields fieldForId(int fieldId) {
2630
      return _Fields.findByThriftId(fieldId);
2631
    }
2632
 
2633
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2634
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2635
      iprot.readStructBegin();
2636
      while (true)
2637
      {
2638
        field = iprot.readFieldBegin();
3430 rajveer 2639
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2640
          break;
2641
        }
3430 rajveer 2642
        switch (field.id) {
2643
          case 1: // NAME
2644
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
2645
              this.name = iprot.readString();
2646
            } else { 
2647
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2648
            }
2649
            break;
2650
          case 2: // RULE_EXECUTION_SRC
2651
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
2652
              this.ruleExecutionSrc = iprot.readString();
2653
            } else { 
2654
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2655
            }
2656
            break;
2657
          case 3: // START_ON
2658
            if (field.type == org.apache.thrift.protocol.TType.I64) {
2659
              this.startOn = iprot.readI64();
2660
              setStartOnIsSet(true);
2661
            } else { 
2662
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2663
            }
2664
            break;
2665
          case 4: // END_ON
2666
            if (field.type == org.apache.thrift.protocol.TType.I64) {
2667
              this.endOn = iprot.readI64();
2668
              setEndOnIsSet(true);
2669
            } else { 
2670
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2671
            }
2672
            break;
2673
          default:
2674
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2675
        }
3430 rajveer 2676
        iprot.readFieldEnd();
1982 varun.gupt 2677
      }
2678
      iprot.readStructEnd();
2679
      validate();
2680
    }
2681
 
3430 rajveer 2682
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2683
      validate();
2684
 
2685
      oprot.writeStructBegin(STRUCT_DESC);
2686
      if (this.name != null) {
2687
        oprot.writeFieldBegin(NAME_FIELD_DESC);
2688
        oprot.writeString(this.name);
2689
        oprot.writeFieldEnd();
2690
      }
2691
      if (this.ruleExecutionSrc != null) {
2692
        oprot.writeFieldBegin(RULE_EXECUTION_SRC_FIELD_DESC);
2693
        oprot.writeString(this.ruleExecutionSrc);
2694
        oprot.writeFieldEnd();
2695
      }
2696
      oprot.writeFieldBegin(START_ON_FIELD_DESC);
2697
      oprot.writeI64(this.startOn);
2698
      oprot.writeFieldEnd();
2699
      oprot.writeFieldBegin(END_ON_FIELD_DESC);
2700
      oprot.writeI64(this.endOn);
2701
      oprot.writeFieldEnd();
2702
      oprot.writeFieldStop();
2703
      oprot.writeStructEnd();
2704
    }
2705
 
2706
    @Override
2707
    public String toString() {
2708
      StringBuilder sb = new StringBuilder("createPromotion_args(");
2709
      boolean first = true;
2710
 
2711
      sb.append("name:");
2712
      if (this.name == null) {
2713
        sb.append("null");
2714
      } else {
2715
        sb.append(this.name);
2716
      }
2717
      first = false;
2718
      if (!first) sb.append(", ");
2719
      sb.append("ruleExecutionSrc:");
2720
      if (this.ruleExecutionSrc == null) {
2721
        sb.append("null");
2722
      } else {
2723
        sb.append(this.ruleExecutionSrc);
2724
      }
2725
      first = false;
2726
      if (!first) sb.append(", ");
2727
      sb.append("startOn:");
2728
      sb.append(this.startOn);
2729
      first = false;
2730
      if (!first) sb.append(", ");
2731
      sb.append("endOn:");
2732
      sb.append(this.endOn);
2733
      first = false;
2734
      sb.append(")");
2735
      return sb.toString();
2736
    }
2737
 
3430 rajveer 2738
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2739
      // check for required fields
2740
    }
2741
 
3430 rajveer 2742
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2743
      try {
2744
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2745
      } catch (org.apache.thrift.TException te) {
2746
        throw new java.io.IOException(te);
2747
      }
2748
    }
2749
 
2750
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2751
      try {
2752
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
2753
        __isset_bit_vector = new BitSet(1);
2754
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2755
      } catch (org.apache.thrift.TException te) {
2756
        throw new java.io.IOException(te);
2757
      }
2758
    }
2759
 
1982 varun.gupt 2760
  }
2761
 
3430 rajveer 2762
  public static class createPromotion_result implements org.apache.thrift.TBase<createPromotion_result, createPromotion_result._Fields>, java.io.Serializable, Cloneable   {
2763
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_result");
1982 varun.gupt 2764
 
3430 rajveer 2765
    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 2766
 
3430 rajveer 2767
    private PromotionException pex; // required
1982 varun.gupt 2768
 
2769
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2770
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2771
      PEX((short)1, "pex");
2772
 
2773
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2774
 
2775
      static {
2776
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2777
          byName.put(field.getFieldName(), field);
2778
        }
2779
      }
2780
 
2781
      /**
2782
       * Find the _Fields constant that matches fieldId, or null if its not found.
2783
       */
2784
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2785
        switch(fieldId) {
2786
          case 1: // PEX
2787
            return PEX;
2788
          default:
2789
            return null;
2790
        }
1982 varun.gupt 2791
      }
2792
 
2793
      /**
2794
       * Find the _Fields constant that matches fieldId, throwing an exception
2795
       * if it is not found.
2796
       */
2797
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2798
        _Fields fields = findByThriftId(fieldId);
2799
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2800
        return fields;
2801
      }
2802
 
2803
      /**
2804
       * Find the _Fields constant that matches name, or null if its not found.
2805
       */
2806
      public static _Fields findByName(String name) {
2807
        return byName.get(name);
2808
      }
2809
 
2810
      private final short _thriftId;
2811
      private final String _fieldName;
2812
 
2813
      _Fields(short thriftId, String fieldName) {
2814
        _thriftId = thriftId;
2815
        _fieldName = fieldName;
2816
      }
2817
 
2818
      public short getThriftFieldId() {
2819
        return _thriftId;
2820
      }
2821
 
2822
      public String getFieldName() {
2823
        return _fieldName;
2824
      }
2825
    }
2826
 
2827
    // isset id assignments
2828
 
3430 rajveer 2829
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2830
    static {
3430 rajveer 2831
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2832
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2833
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
2834
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2835
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_result.class, metaDataMap);
1982 varun.gupt 2836
    }
2837
 
2838
    public createPromotion_result() {
2839
    }
2840
 
2841
    public createPromotion_result(
2842
      PromotionException pex)
2843
    {
2844
      this();
2845
      this.pex = pex;
2846
    }
2847
 
2848
    /**
2849
     * Performs a deep copy on <i>other</i>.
2850
     */
2851
    public createPromotion_result(createPromotion_result other) {
2852
      if (other.isSetPex()) {
2853
        this.pex = new PromotionException(other.pex);
2854
      }
2855
    }
2856
 
2857
    public createPromotion_result deepCopy() {
2858
      return new createPromotion_result(this);
2859
    }
2860
 
3430 rajveer 2861
    @Override
2862
    public void clear() {
2863
      this.pex = null;
1982 varun.gupt 2864
    }
2865
 
2866
    public PromotionException getPex() {
2867
      return this.pex;
2868
    }
2869
 
3430 rajveer 2870
    public void setPex(PromotionException pex) {
1982 varun.gupt 2871
      this.pex = pex;
2872
    }
2873
 
2874
    public void unsetPex() {
2875
      this.pex = null;
2876
    }
2877
 
3430 rajveer 2878
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2879
    public boolean isSetPex() {
2880
      return this.pex != null;
2881
    }
2882
 
2883
    public void setPexIsSet(boolean value) {
2884
      if (!value) {
2885
        this.pex = null;
2886
      }
2887
    }
2888
 
2889
    public void setFieldValue(_Fields field, Object value) {
2890
      switch (field) {
2891
      case PEX:
2892
        if (value == null) {
2893
          unsetPex();
2894
        } else {
2895
          setPex((PromotionException)value);
2896
        }
2897
        break;
2898
 
2899
      }
2900
    }
2901
 
2902
    public Object getFieldValue(_Fields field) {
2903
      switch (field) {
2904
      case PEX:
2905
        return getPex();
2906
 
2907
      }
2908
      throw new IllegalStateException();
2909
    }
2910
 
3430 rajveer 2911
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2912
    public boolean isSet(_Fields field) {
2913
      if (field == null) {
2914
        throw new IllegalArgumentException();
2915
      }
1982 varun.gupt 2916
 
2917
      switch (field) {
2918
      case PEX:
2919
        return isSetPex();
2920
      }
2921
      throw new IllegalStateException();
2922
    }
2923
 
2924
    @Override
2925
    public boolean equals(Object that) {
2926
      if (that == null)
2927
        return false;
2928
      if (that instanceof createPromotion_result)
2929
        return this.equals((createPromotion_result)that);
2930
      return false;
2931
    }
2932
 
2933
    public boolean equals(createPromotion_result that) {
2934
      if (that == null)
2935
        return false;
2936
 
2937
      boolean this_present_pex = true && this.isSetPex();
2938
      boolean that_present_pex = true && that.isSetPex();
2939
      if (this_present_pex || that_present_pex) {
2940
        if (!(this_present_pex && that_present_pex))
2941
          return false;
2942
        if (!this.pex.equals(that.pex))
2943
          return false;
2944
      }
2945
 
2946
      return true;
2947
    }
2948
 
2949
    @Override
2950
    public int hashCode() {
2951
      return 0;
2952
    }
2953
 
2954
    public int compareTo(createPromotion_result other) {
2955
      if (!getClass().equals(other.getClass())) {
2956
        return getClass().getName().compareTo(other.getClass().getName());
2957
      }
2958
 
2959
      int lastComparison = 0;
2960
      createPromotion_result typedOther = (createPromotion_result)other;
2961
 
3430 rajveer 2962
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 2963
      if (lastComparison != 0) {
2964
        return lastComparison;
2965
      }
3430 rajveer 2966
      if (isSetPex()) {
2967
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
2968
        if (lastComparison != 0) {
2969
          return lastComparison;
2970
        }
1982 varun.gupt 2971
      }
2972
      return 0;
2973
    }
2974
 
3430 rajveer 2975
    public _Fields fieldForId(int fieldId) {
2976
      return _Fields.findByThriftId(fieldId);
2977
    }
2978
 
2979
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2980
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2981
      iprot.readStructBegin();
2982
      while (true)
2983
      {
2984
        field = iprot.readFieldBegin();
3430 rajveer 2985
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2986
          break;
2987
        }
3430 rajveer 2988
        switch (field.id) {
2989
          case 1: // PEX
2990
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
2991
              this.pex = new PromotionException();
2992
              this.pex.read(iprot);
2993
            } else { 
2994
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2995
            }
2996
            break;
2997
          default:
2998
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2999
        }
3430 rajveer 3000
        iprot.readFieldEnd();
1982 varun.gupt 3001
      }
3002
      iprot.readStructEnd();
3003
      validate();
3004
    }
3005
 
3430 rajveer 3006
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 3007
      oprot.writeStructBegin(STRUCT_DESC);
3008
 
3009
      if (this.isSetPex()) {
3010
        oprot.writeFieldBegin(PEX_FIELD_DESC);
3011
        this.pex.write(oprot);
3012
        oprot.writeFieldEnd();
3013
      }
3014
      oprot.writeFieldStop();
3015
      oprot.writeStructEnd();
3016
    }
3017
 
3018
    @Override
3019
    public String toString() {
3020
      StringBuilder sb = new StringBuilder("createPromotion_result(");
3021
      boolean first = true;
3022
 
3023
      sb.append("pex:");
3024
      if (this.pex == null) {
3025
        sb.append("null");
3026
      } else {
3027
        sb.append(this.pex);
3028
      }
3029
      first = false;
3030
      sb.append(")");
3031
      return sb.toString();
3032
    }
3033
 
3430 rajveer 3034
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 3035
      // check for required fields
3036
    }
3037
 
3430 rajveer 3038
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3039
      try {
3040
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3041
      } catch (org.apache.thrift.TException te) {
3042
        throw new java.io.IOException(te);
3043
      }
3044
    }
3045
 
3046
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3047
      try {
3048
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3049
      } catch (org.apache.thrift.TException te) {
3050
        throw new java.io.IOException(te);
3051
      }
3052
    }
3053
 
1982 varun.gupt 3054
  }
3055
 
7746 amit.gupta 3056
  public static class removeAllCouponsByPromotionId_args implements org.apache.thrift.TBase<removeAllCouponsByPromotionId_args, removeAllCouponsByPromotionId_args._Fields>, java.io.Serializable, Cloneable   {
3057
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("removeAllCouponsByPromotionId_args");
3058
 
3059
    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);
3060
 
3061
    private long promotionId; // required
3062
 
3063
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3064
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3065
      PROMOTION_ID((short)1, "promotionId");
3066
 
3067
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3068
 
3069
      static {
3070
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3071
          byName.put(field.getFieldName(), field);
3072
        }
3073
      }
3074
 
3075
      /**
3076
       * Find the _Fields constant that matches fieldId, or null if its not found.
3077
       */
3078
      public static _Fields findByThriftId(int fieldId) {
3079
        switch(fieldId) {
3080
          case 1: // PROMOTION_ID
3081
            return PROMOTION_ID;
3082
          default:
3083
            return null;
3084
        }
3085
      }
3086
 
3087
      /**
3088
       * Find the _Fields constant that matches fieldId, throwing an exception
3089
       * if it is not found.
3090
       */
3091
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3092
        _Fields fields = findByThriftId(fieldId);
3093
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3094
        return fields;
3095
      }
3096
 
3097
      /**
3098
       * Find the _Fields constant that matches name, or null if its not found.
3099
       */
3100
      public static _Fields findByName(String name) {
3101
        return byName.get(name);
3102
      }
3103
 
3104
      private final short _thriftId;
3105
      private final String _fieldName;
3106
 
3107
      _Fields(short thriftId, String fieldName) {
3108
        _thriftId = thriftId;
3109
        _fieldName = fieldName;
3110
      }
3111
 
3112
      public short getThriftFieldId() {
3113
        return _thriftId;
3114
      }
3115
 
3116
      public String getFieldName() {
3117
        return _fieldName;
3118
      }
3119
    }
3120
 
3121
    // isset id assignments
3122
    private static final int __PROMOTIONID_ISSET_ID = 0;
3123
    private BitSet __isset_bit_vector = new BitSet(1);
3124
 
3125
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3126
    static {
3127
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3128
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3129
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
3130
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3131
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(removeAllCouponsByPromotionId_args.class, metaDataMap);
3132
    }
3133
 
3134
    public removeAllCouponsByPromotionId_args() {
3135
    }
3136
 
3137
    public removeAllCouponsByPromotionId_args(
3138
      long promotionId)
3139
    {
3140
      this();
3141
      this.promotionId = promotionId;
3142
      setPromotionIdIsSet(true);
3143
    }
3144
 
3145
    /**
3146
     * Performs a deep copy on <i>other</i>.
3147
     */
3148
    public removeAllCouponsByPromotionId_args(removeAllCouponsByPromotionId_args other) {
3149
      __isset_bit_vector.clear();
3150
      __isset_bit_vector.or(other.__isset_bit_vector);
3151
      this.promotionId = other.promotionId;
3152
    }
3153
 
3154
    public removeAllCouponsByPromotionId_args deepCopy() {
3155
      return new removeAllCouponsByPromotionId_args(this);
3156
    }
3157
 
3158
    @Override
3159
    public void clear() {
3160
      setPromotionIdIsSet(false);
3161
      this.promotionId = 0;
3162
    }
3163
 
3164
    public long getPromotionId() {
3165
      return this.promotionId;
3166
    }
3167
 
3168
    public void setPromotionId(long promotionId) {
3169
      this.promotionId = promotionId;
3170
      setPromotionIdIsSet(true);
3171
    }
3172
 
3173
    public void unsetPromotionId() {
3174
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
3175
    }
3176
 
3177
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
3178
    public boolean isSetPromotionId() {
3179
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
3180
    }
3181
 
3182
    public void setPromotionIdIsSet(boolean value) {
3183
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
3184
    }
3185
 
3186
    public void setFieldValue(_Fields field, Object value) {
3187
      switch (field) {
3188
      case PROMOTION_ID:
3189
        if (value == null) {
3190
          unsetPromotionId();
3191
        } else {
3192
          setPromotionId((Long)value);
3193
        }
3194
        break;
3195
 
3196
      }
3197
    }
3198
 
3199
    public Object getFieldValue(_Fields field) {
3200
      switch (field) {
3201
      case PROMOTION_ID:
3202
        return Long.valueOf(getPromotionId());
3203
 
3204
      }
3205
      throw new IllegalStateException();
3206
    }
3207
 
3208
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3209
    public boolean isSet(_Fields field) {
3210
      if (field == null) {
3211
        throw new IllegalArgumentException();
3212
      }
3213
 
3214
      switch (field) {
3215
      case PROMOTION_ID:
3216
        return isSetPromotionId();
3217
      }
3218
      throw new IllegalStateException();
3219
    }
3220
 
3221
    @Override
3222
    public boolean equals(Object that) {
3223
      if (that == null)
3224
        return false;
3225
      if (that instanceof removeAllCouponsByPromotionId_args)
3226
        return this.equals((removeAllCouponsByPromotionId_args)that);
3227
      return false;
3228
    }
3229
 
3230
    public boolean equals(removeAllCouponsByPromotionId_args that) {
3231
      if (that == null)
3232
        return false;
3233
 
3234
      boolean this_present_promotionId = true;
3235
      boolean that_present_promotionId = true;
3236
      if (this_present_promotionId || that_present_promotionId) {
3237
        if (!(this_present_promotionId && that_present_promotionId))
3238
          return false;
3239
        if (this.promotionId != that.promotionId)
3240
          return false;
3241
      }
3242
 
3243
      return true;
3244
    }
3245
 
3246
    @Override
3247
    public int hashCode() {
3248
      return 0;
3249
    }
3250
 
3251
    public int compareTo(removeAllCouponsByPromotionId_args other) {
3252
      if (!getClass().equals(other.getClass())) {
3253
        return getClass().getName().compareTo(other.getClass().getName());
3254
      }
3255
 
3256
      int lastComparison = 0;
3257
      removeAllCouponsByPromotionId_args typedOther = (removeAllCouponsByPromotionId_args)other;
3258
 
3259
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
3260
      if (lastComparison != 0) {
3261
        return lastComparison;
3262
      }
3263
      if (isSetPromotionId()) {
3264
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
3265
        if (lastComparison != 0) {
3266
          return lastComparison;
3267
        }
3268
      }
3269
      return 0;
3270
    }
3271
 
3272
    public _Fields fieldForId(int fieldId) {
3273
      return _Fields.findByThriftId(fieldId);
3274
    }
3275
 
3276
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3277
      org.apache.thrift.protocol.TField field;
3278
      iprot.readStructBegin();
3279
      while (true)
3280
      {
3281
        field = iprot.readFieldBegin();
3282
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3283
          break;
3284
        }
3285
        switch (field.id) {
3286
          case 1: // PROMOTION_ID
3287
            if (field.type == org.apache.thrift.protocol.TType.I64) {
3288
              this.promotionId = iprot.readI64();
3289
              setPromotionIdIsSet(true);
3290
            } else { 
3291
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3292
            }
3293
            break;
3294
          default:
3295
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3296
        }
3297
        iprot.readFieldEnd();
3298
      }
3299
      iprot.readStructEnd();
3300
      validate();
3301
    }
3302
 
3303
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3304
      validate();
3305
 
3306
      oprot.writeStructBegin(STRUCT_DESC);
3307
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
3308
      oprot.writeI64(this.promotionId);
3309
      oprot.writeFieldEnd();
3310
      oprot.writeFieldStop();
3311
      oprot.writeStructEnd();
3312
    }
3313
 
3314
    @Override
3315
    public String toString() {
3316
      StringBuilder sb = new StringBuilder("removeAllCouponsByPromotionId_args(");
3317
      boolean first = true;
3318
 
3319
      sb.append("promotionId:");
3320
      sb.append(this.promotionId);
3321
      first = false;
3322
      sb.append(")");
3323
      return sb.toString();
3324
    }
3325
 
3326
    public void validate() throws org.apache.thrift.TException {
3327
      // check for required fields
3328
    }
3329
 
3330
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3331
      try {
3332
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3333
      } catch (org.apache.thrift.TException te) {
3334
        throw new java.io.IOException(te);
3335
      }
3336
    }
3337
 
3338
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3339
      try {
3340
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
3341
        __isset_bit_vector = new BitSet(1);
3342
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3343
      } catch (org.apache.thrift.TException te) {
3344
        throw new java.io.IOException(te);
3345
      }
3346
    }
3347
 
3348
  }
3349
 
3350
  public static class removeAllCouponsByPromotionId_result implements org.apache.thrift.TBase<removeAllCouponsByPromotionId_result, removeAllCouponsByPromotionId_result._Fields>, java.io.Serializable, Cloneable   {
3351
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("removeAllCouponsByPromotionId_result");
3352
 
3353
    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);
3354
    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);
3355
 
3356
    private long success; // required
3357
    private PromotionException pex; // required
3358
 
3359
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3360
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3361
      SUCCESS((short)0, "success"),
3362
      PEX((short)1, "pex");
3363
 
3364
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3365
 
3366
      static {
3367
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3368
          byName.put(field.getFieldName(), field);
3369
        }
3370
      }
3371
 
3372
      /**
3373
       * Find the _Fields constant that matches fieldId, or null if its not found.
3374
       */
3375
      public static _Fields findByThriftId(int fieldId) {
3376
        switch(fieldId) {
3377
          case 0: // SUCCESS
3378
            return SUCCESS;
3379
          case 1: // PEX
3380
            return PEX;
3381
          default:
3382
            return null;
3383
        }
3384
      }
3385
 
3386
      /**
3387
       * Find the _Fields constant that matches fieldId, throwing an exception
3388
       * if it is not found.
3389
       */
3390
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3391
        _Fields fields = findByThriftId(fieldId);
3392
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3393
        return fields;
3394
      }
3395
 
3396
      /**
3397
       * Find the _Fields constant that matches name, or null if its not found.
3398
       */
3399
      public static _Fields findByName(String name) {
3400
        return byName.get(name);
3401
      }
3402
 
3403
      private final short _thriftId;
3404
      private final String _fieldName;
3405
 
3406
      _Fields(short thriftId, String fieldName) {
3407
        _thriftId = thriftId;
3408
        _fieldName = fieldName;
3409
      }
3410
 
3411
      public short getThriftFieldId() {
3412
        return _thriftId;
3413
      }
3414
 
3415
      public String getFieldName() {
3416
        return _fieldName;
3417
      }
3418
    }
3419
 
3420
    // isset id assignments
3421
    private static final int __SUCCESS_ISSET_ID = 0;
3422
    private BitSet __isset_bit_vector = new BitSet(1);
3423
 
3424
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3425
    static {
3426
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3427
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3428
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
3429
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3430
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
3431
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3432
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(removeAllCouponsByPromotionId_result.class, metaDataMap);
3433
    }
3434
 
3435
    public removeAllCouponsByPromotionId_result() {
3436
    }
3437
 
3438
    public removeAllCouponsByPromotionId_result(
3439
      long success,
3440
      PromotionException pex)
3441
    {
3442
      this();
3443
      this.success = success;
3444
      setSuccessIsSet(true);
3445
      this.pex = pex;
3446
    }
3447
 
3448
    /**
3449
     * Performs a deep copy on <i>other</i>.
3450
     */
3451
    public removeAllCouponsByPromotionId_result(removeAllCouponsByPromotionId_result other) {
3452
      __isset_bit_vector.clear();
3453
      __isset_bit_vector.or(other.__isset_bit_vector);
3454
      this.success = other.success;
3455
      if (other.isSetPex()) {
3456
        this.pex = new PromotionException(other.pex);
3457
      }
3458
    }
3459
 
3460
    public removeAllCouponsByPromotionId_result deepCopy() {
3461
      return new removeAllCouponsByPromotionId_result(this);
3462
    }
3463
 
3464
    @Override
3465
    public void clear() {
3466
      setSuccessIsSet(false);
3467
      this.success = 0;
3468
      this.pex = null;
3469
    }
3470
 
3471
    public long getSuccess() {
3472
      return this.success;
3473
    }
3474
 
3475
    public void setSuccess(long success) {
3476
      this.success = success;
3477
      setSuccessIsSet(true);
3478
    }
3479
 
3480
    public void unsetSuccess() {
3481
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
3482
    }
3483
 
3484
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3485
    public boolean isSetSuccess() {
3486
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
3487
    }
3488
 
3489
    public void setSuccessIsSet(boolean value) {
3490
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
3491
    }
3492
 
3493
    public PromotionException getPex() {
3494
      return this.pex;
3495
    }
3496
 
3497
    public void setPex(PromotionException pex) {
3498
      this.pex = pex;
3499
    }
3500
 
3501
    public void unsetPex() {
3502
      this.pex = null;
3503
    }
3504
 
3505
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3506
    public boolean isSetPex() {
3507
      return this.pex != null;
3508
    }
3509
 
3510
    public void setPexIsSet(boolean value) {
3511
      if (!value) {
3512
        this.pex = null;
3513
      }
3514
    }
3515
 
3516
    public void setFieldValue(_Fields field, Object value) {
3517
      switch (field) {
3518
      case SUCCESS:
3519
        if (value == null) {
3520
          unsetSuccess();
3521
        } else {
3522
          setSuccess((Long)value);
3523
        }
3524
        break;
3525
 
3526
      case PEX:
3527
        if (value == null) {
3528
          unsetPex();
3529
        } else {
3530
          setPex((PromotionException)value);
3531
        }
3532
        break;
3533
 
3534
      }
3535
    }
3536
 
3537
    public Object getFieldValue(_Fields field) {
3538
      switch (field) {
3539
      case SUCCESS:
3540
        return Long.valueOf(getSuccess());
3541
 
3542
      case PEX:
3543
        return getPex();
3544
 
3545
      }
3546
      throw new IllegalStateException();
3547
    }
3548
 
3549
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3550
    public boolean isSet(_Fields field) {
3551
      if (field == null) {
3552
        throw new IllegalArgumentException();
3553
      }
3554
 
3555
      switch (field) {
3556
      case SUCCESS:
3557
        return isSetSuccess();
3558
      case PEX:
3559
        return isSetPex();
3560
      }
3561
      throw new IllegalStateException();
3562
    }
3563
 
3564
    @Override
3565
    public boolean equals(Object that) {
3566
      if (that == null)
3567
        return false;
3568
      if (that instanceof removeAllCouponsByPromotionId_result)
3569
        return this.equals((removeAllCouponsByPromotionId_result)that);
3570
      return false;
3571
    }
3572
 
3573
    public boolean equals(removeAllCouponsByPromotionId_result that) {
3574
      if (that == null)
3575
        return false;
3576
 
3577
      boolean this_present_success = true;
3578
      boolean that_present_success = true;
3579
      if (this_present_success || that_present_success) {
3580
        if (!(this_present_success && that_present_success))
3581
          return false;
3582
        if (this.success != that.success)
3583
          return false;
3584
      }
3585
 
3586
      boolean this_present_pex = true && this.isSetPex();
3587
      boolean that_present_pex = true && that.isSetPex();
3588
      if (this_present_pex || that_present_pex) {
3589
        if (!(this_present_pex && that_present_pex))
3590
          return false;
3591
        if (!this.pex.equals(that.pex))
3592
          return false;
3593
      }
3594
 
3595
      return true;
3596
    }
3597
 
3598
    @Override
3599
    public int hashCode() {
3600
      return 0;
3601
    }
3602
 
3603
    public int compareTo(removeAllCouponsByPromotionId_result other) {
3604
      if (!getClass().equals(other.getClass())) {
3605
        return getClass().getName().compareTo(other.getClass().getName());
3606
      }
3607
 
3608
      int lastComparison = 0;
3609
      removeAllCouponsByPromotionId_result typedOther = (removeAllCouponsByPromotionId_result)other;
3610
 
3611
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3612
      if (lastComparison != 0) {
3613
        return lastComparison;
3614
      }
3615
      if (isSetSuccess()) {
3616
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
3617
        if (lastComparison != 0) {
3618
          return lastComparison;
3619
        }
3620
      }
3621
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3622
      if (lastComparison != 0) {
3623
        return lastComparison;
3624
      }
3625
      if (isSetPex()) {
3626
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
3627
        if (lastComparison != 0) {
3628
          return lastComparison;
3629
        }
3630
      }
3631
      return 0;
3632
    }
3633
 
3634
    public _Fields fieldForId(int fieldId) {
3635
      return _Fields.findByThriftId(fieldId);
3636
    }
3637
 
3638
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3639
      org.apache.thrift.protocol.TField field;
3640
      iprot.readStructBegin();
3641
      while (true)
3642
      {
3643
        field = iprot.readFieldBegin();
3644
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3645
          break;
3646
        }
3647
        switch (field.id) {
3648
          case 0: // SUCCESS
3649
            if (field.type == org.apache.thrift.protocol.TType.I64) {
3650
              this.success = iprot.readI64();
3651
              setSuccessIsSet(true);
3652
            } else { 
3653
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3654
            }
3655
            break;
3656
          case 1: // PEX
3657
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3658
              this.pex = new PromotionException();
3659
              this.pex.read(iprot);
3660
            } else { 
3661
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3662
            }
3663
            break;
3664
          default:
3665
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3666
        }
3667
        iprot.readFieldEnd();
3668
      }
3669
      iprot.readStructEnd();
3670
      validate();
3671
    }
3672
 
3673
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3674
      oprot.writeStructBegin(STRUCT_DESC);
3675
 
3676
      if (this.isSetSuccess()) {
3677
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
3678
        oprot.writeI64(this.success);
3679
        oprot.writeFieldEnd();
3680
      } else if (this.isSetPex()) {
3681
        oprot.writeFieldBegin(PEX_FIELD_DESC);
3682
        this.pex.write(oprot);
3683
        oprot.writeFieldEnd();
3684
      }
3685
      oprot.writeFieldStop();
3686
      oprot.writeStructEnd();
3687
    }
3688
 
3689
    @Override
3690
    public String toString() {
3691
      StringBuilder sb = new StringBuilder("removeAllCouponsByPromotionId_result(");
3692
      boolean first = true;
3693
 
3694
      sb.append("success:");
3695
      sb.append(this.success);
3696
      first = false;
3697
      if (!first) sb.append(", ");
3698
      sb.append("pex:");
3699
      if (this.pex == null) {
3700
        sb.append("null");
3701
      } else {
3702
        sb.append(this.pex);
3703
      }
3704
      first = false;
3705
      sb.append(")");
3706
      return sb.toString();
3707
    }
3708
 
3709
    public void validate() throws org.apache.thrift.TException {
3710
      // check for required fields
3711
    }
3712
 
3713
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3714
      try {
3715
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3716
      } catch (org.apache.thrift.TException te) {
3717
        throw new java.io.IOException(te);
3718
      }
3719
    }
3720
 
3721
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3722
      try {
3723
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3724
      } catch (org.apache.thrift.TException te) {
3725
        throw new java.io.IOException(te);
3726
      }
3727
    }
3728
 
3729
  }
3730
 
6301 amit.gupta 3731
  public static class getCoupon_args implements org.apache.thrift.TBase<getCoupon_args, getCoupon_args._Fields>, java.io.Serializable, Cloneable   {
3732
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCoupon_args");
3733
 
3734
    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);
3735
 
3736
    private String couponCode; // required
3737
 
3738
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3739
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3740
      COUPON_CODE((short)1, "couponCode");
3741
 
3742
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3743
 
3744
      static {
3745
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3746
          byName.put(field.getFieldName(), field);
3747
        }
3748
      }
3749
 
3750
      /**
3751
       * Find the _Fields constant that matches fieldId, or null if its not found.
3752
       */
3753
      public static _Fields findByThriftId(int fieldId) {
3754
        switch(fieldId) {
3755
          case 1: // COUPON_CODE
3756
            return COUPON_CODE;
3757
          default:
3758
            return null;
3759
        }
3760
      }
3761
 
3762
      /**
3763
       * Find the _Fields constant that matches fieldId, throwing an exception
3764
       * if it is not found.
3765
       */
3766
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3767
        _Fields fields = findByThriftId(fieldId);
3768
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3769
        return fields;
3770
      }
3771
 
3772
      /**
3773
       * Find the _Fields constant that matches name, or null if its not found.
3774
       */
3775
      public static _Fields findByName(String name) {
3776
        return byName.get(name);
3777
      }
3778
 
3779
      private final short _thriftId;
3780
      private final String _fieldName;
3781
 
3782
      _Fields(short thriftId, String fieldName) {
3783
        _thriftId = thriftId;
3784
        _fieldName = fieldName;
3785
      }
3786
 
3787
      public short getThriftFieldId() {
3788
        return _thriftId;
3789
      }
3790
 
3791
      public String getFieldName() {
3792
        return _fieldName;
3793
      }
3794
    }
3795
 
3796
    // isset id assignments
3797
 
3798
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3799
    static {
3800
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3801
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3802
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
3803
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3804
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCoupon_args.class, metaDataMap);
3805
    }
3806
 
3807
    public getCoupon_args() {
3808
    }
3809
 
3810
    public getCoupon_args(
3811
      String couponCode)
3812
    {
3813
      this();
3814
      this.couponCode = couponCode;
3815
    }
3816
 
3817
    /**
3818
     * Performs a deep copy on <i>other</i>.
3819
     */
3820
    public getCoupon_args(getCoupon_args other) {
3821
      if (other.isSetCouponCode()) {
3822
        this.couponCode = other.couponCode;
3823
      }
3824
    }
3825
 
3826
    public getCoupon_args deepCopy() {
3827
      return new getCoupon_args(this);
3828
    }
3829
 
3830
    @Override
3831
    public void clear() {
3832
      this.couponCode = null;
3833
    }
3834
 
3835
    public String getCouponCode() {
3836
      return this.couponCode;
3837
    }
3838
 
3839
    public void setCouponCode(String couponCode) {
3840
      this.couponCode = couponCode;
3841
    }
3842
 
3843
    public void unsetCouponCode() {
3844
      this.couponCode = null;
3845
    }
3846
 
3847
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3848
    public boolean isSetCouponCode() {
3849
      return this.couponCode != null;
3850
    }
3851
 
3852
    public void setCouponCodeIsSet(boolean value) {
3853
      if (!value) {
3854
        this.couponCode = null;
3855
      }
3856
    }
3857
 
3858
    public void setFieldValue(_Fields field, Object value) {
3859
      switch (field) {
3860
      case COUPON_CODE:
3861
        if (value == null) {
3862
          unsetCouponCode();
3863
        } else {
3864
          setCouponCode((String)value);
3865
        }
3866
        break;
3867
 
3868
      }
3869
    }
3870
 
3871
    public Object getFieldValue(_Fields field) {
3872
      switch (field) {
3873
      case COUPON_CODE:
3874
        return getCouponCode();
3875
 
3876
      }
3877
      throw new IllegalStateException();
3878
    }
3879
 
3880
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3881
    public boolean isSet(_Fields field) {
3882
      if (field == null) {
3883
        throw new IllegalArgumentException();
3884
      }
3885
 
3886
      switch (field) {
3887
      case COUPON_CODE:
3888
        return isSetCouponCode();
3889
      }
3890
      throw new IllegalStateException();
3891
    }
3892
 
3893
    @Override
3894
    public boolean equals(Object that) {
3895
      if (that == null)
3896
        return false;
3897
      if (that instanceof getCoupon_args)
3898
        return this.equals((getCoupon_args)that);
3899
      return false;
3900
    }
3901
 
3902
    public boolean equals(getCoupon_args that) {
3903
      if (that == null)
3904
        return false;
3905
 
3906
      boolean this_present_couponCode = true && this.isSetCouponCode();
3907
      boolean that_present_couponCode = true && that.isSetCouponCode();
3908
      if (this_present_couponCode || that_present_couponCode) {
3909
        if (!(this_present_couponCode && that_present_couponCode))
3910
          return false;
3911
        if (!this.couponCode.equals(that.couponCode))
3912
          return false;
3913
      }
3914
 
3915
      return true;
3916
    }
3917
 
3918
    @Override
3919
    public int hashCode() {
3920
      return 0;
3921
    }
3922
 
3923
    public int compareTo(getCoupon_args other) {
3924
      if (!getClass().equals(other.getClass())) {
3925
        return getClass().getName().compareTo(other.getClass().getName());
3926
      }
3927
 
3928
      int lastComparison = 0;
3929
      getCoupon_args typedOther = (getCoupon_args)other;
3930
 
3931
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3932
      if (lastComparison != 0) {
3933
        return lastComparison;
3934
      }
3935
      if (isSetCouponCode()) {
3936
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
3937
        if (lastComparison != 0) {
3938
          return lastComparison;
3939
        }
3940
      }
3941
      return 0;
3942
    }
3943
 
3944
    public _Fields fieldForId(int fieldId) {
3945
      return _Fields.findByThriftId(fieldId);
3946
    }
3947
 
3948
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3949
      org.apache.thrift.protocol.TField field;
3950
      iprot.readStructBegin();
3951
      while (true)
3952
      {
3953
        field = iprot.readFieldBegin();
3954
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3955
          break;
3956
        }
3957
        switch (field.id) {
3958
          case 1: // COUPON_CODE
3959
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
3960
              this.couponCode = iprot.readString();
3961
            } else { 
3962
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3963
            }
3964
            break;
3965
          default:
3966
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3967
        }
3968
        iprot.readFieldEnd();
3969
      }
3970
      iprot.readStructEnd();
3971
      validate();
3972
    }
3973
 
3974
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3975
      validate();
3976
 
3977
      oprot.writeStructBegin(STRUCT_DESC);
3978
      if (this.couponCode != null) {
3979
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
3980
        oprot.writeString(this.couponCode);
3981
        oprot.writeFieldEnd();
3982
      }
3983
      oprot.writeFieldStop();
3984
      oprot.writeStructEnd();
3985
    }
3986
 
3987
    @Override
3988
    public String toString() {
3989
      StringBuilder sb = new StringBuilder("getCoupon_args(");
3990
      boolean first = true;
3991
 
3992
      sb.append("couponCode:");
3993
      if (this.couponCode == null) {
3994
        sb.append("null");
3995
      } else {
3996
        sb.append(this.couponCode);
3997
      }
3998
      first = false;
3999
      sb.append(")");
4000
      return sb.toString();
4001
    }
4002
 
4003
    public void validate() throws org.apache.thrift.TException {
4004
      // check for required fields
4005
    }
4006
 
4007
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4008
      try {
4009
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4010
      } catch (org.apache.thrift.TException te) {
4011
        throw new java.io.IOException(te);
4012
      }
4013
    }
4014
 
4015
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4016
      try {
4017
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4018
      } catch (org.apache.thrift.TException te) {
4019
        throw new java.io.IOException(te);
4020
      }
4021
    }
4022
 
4023
  }
4024
 
4025
  public static class getCoupon_result implements org.apache.thrift.TBase<getCoupon_result, getCoupon_result._Fields>, java.io.Serializable, Cloneable   {
4026
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCoupon_result");
4027
 
4028
    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);
4029
    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);
4030
 
4031
    private Coupon success; // required
4032
    private PromotionException pex; // required
4033
 
4034
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4035
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4036
      SUCCESS((short)0, "success"),
4037
      PEX((short)1, "pex");
4038
 
4039
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4040
 
4041
      static {
4042
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4043
          byName.put(field.getFieldName(), field);
4044
        }
4045
      }
4046
 
4047
      /**
4048
       * Find the _Fields constant that matches fieldId, or null if its not found.
4049
       */
4050
      public static _Fields findByThriftId(int fieldId) {
4051
        switch(fieldId) {
4052
          case 0: // SUCCESS
4053
            return SUCCESS;
4054
          case 1: // PEX
4055
            return PEX;
4056
          default:
4057
            return null;
4058
        }
4059
      }
4060
 
4061
      /**
4062
       * Find the _Fields constant that matches fieldId, throwing an exception
4063
       * if it is not found.
4064
       */
4065
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4066
        _Fields fields = findByThriftId(fieldId);
4067
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4068
        return fields;
4069
      }
4070
 
4071
      /**
4072
       * Find the _Fields constant that matches name, or null if its not found.
4073
       */
4074
      public static _Fields findByName(String name) {
4075
        return byName.get(name);
4076
      }
4077
 
4078
      private final short _thriftId;
4079
      private final String _fieldName;
4080
 
4081
      _Fields(short thriftId, String fieldName) {
4082
        _thriftId = thriftId;
4083
        _fieldName = fieldName;
4084
      }
4085
 
4086
      public short getThriftFieldId() {
4087
        return _thriftId;
4088
      }
4089
 
4090
      public String getFieldName() {
4091
        return _fieldName;
4092
      }
4093
    }
4094
 
4095
    // isset id assignments
4096
 
4097
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4098
    static {
4099
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4100
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4101
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class)));
4102
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4103
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4104
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4105
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCoupon_result.class, metaDataMap);
4106
    }
4107
 
4108
    public getCoupon_result() {
4109
    }
4110
 
4111
    public getCoupon_result(
4112
      Coupon success,
4113
      PromotionException pex)
4114
    {
4115
      this();
4116
      this.success = success;
4117
      this.pex = pex;
4118
    }
4119
 
4120
    /**
4121
     * Performs a deep copy on <i>other</i>.
4122
     */
4123
    public getCoupon_result(getCoupon_result other) {
4124
      if (other.isSetSuccess()) {
4125
        this.success = new Coupon(other.success);
4126
      }
4127
      if (other.isSetPex()) {
4128
        this.pex = new PromotionException(other.pex);
4129
      }
4130
    }
4131
 
4132
    public getCoupon_result deepCopy() {
4133
      return new getCoupon_result(this);
4134
    }
4135
 
4136
    @Override
4137
    public void clear() {
4138
      this.success = null;
4139
      this.pex = null;
4140
    }
4141
 
4142
    public Coupon getSuccess() {
4143
      return this.success;
4144
    }
4145
 
4146
    public void setSuccess(Coupon success) {
4147
      this.success = success;
4148
    }
4149
 
4150
    public void unsetSuccess() {
4151
      this.success = null;
4152
    }
4153
 
4154
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
4155
    public boolean isSetSuccess() {
4156
      return this.success != null;
4157
    }
4158
 
4159
    public void setSuccessIsSet(boolean value) {
4160
      if (!value) {
4161
        this.success = null;
4162
      }
4163
    }
4164
 
4165
    public PromotionException getPex() {
4166
      return this.pex;
4167
    }
4168
 
4169
    public void setPex(PromotionException pex) {
4170
      this.pex = pex;
4171
    }
4172
 
4173
    public void unsetPex() {
4174
      this.pex = null;
4175
    }
4176
 
4177
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
4178
    public boolean isSetPex() {
4179
      return this.pex != null;
4180
    }
4181
 
4182
    public void setPexIsSet(boolean value) {
4183
      if (!value) {
4184
        this.pex = null;
4185
      }
4186
    }
4187
 
4188
    public void setFieldValue(_Fields field, Object value) {
4189
      switch (field) {
4190
      case SUCCESS:
4191
        if (value == null) {
4192
          unsetSuccess();
4193
        } else {
4194
          setSuccess((Coupon)value);
4195
        }
4196
        break;
4197
 
4198
      case PEX:
4199
        if (value == null) {
4200
          unsetPex();
4201
        } else {
4202
          setPex((PromotionException)value);
4203
        }
4204
        break;
4205
 
4206
      }
4207
    }
4208
 
4209
    public Object getFieldValue(_Fields field) {
4210
      switch (field) {
4211
      case SUCCESS:
4212
        return getSuccess();
4213
 
4214
      case PEX:
4215
        return getPex();
4216
 
4217
      }
4218
      throw new IllegalStateException();
4219
    }
4220
 
4221
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4222
    public boolean isSet(_Fields field) {
4223
      if (field == null) {
4224
        throw new IllegalArgumentException();
4225
      }
4226
 
4227
      switch (field) {
4228
      case SUCCESS:
4229
        return isSetSuccess();
4230
      case PEX:
4231
        return isSetPex();
4232
      }
4233
      throw new IllegalStateException();
4234
    }
4235
 
4236
    @Override
4237
    public boolean equals(Object that) {
4238
      if (that == null)
4239
        return false;
4240
      if (that instanceof getCoupon_result)
4241
        return this.equals((getCoupon_result)that);
4242
      return false;
4243
    }
4244
 
4245
    public boolean equals(getCoupon_result that) {
4246
      if (that == null)
4247
        return false;
4248
 
4249
      boolean this_present_success = true && this.isSetSuccess();
4250
      boolean that_present_success = true && that.isSetSuccess();
4251
      if (this_present_success || that_present_success) {
4252
        if (!(this_present_success && that_present_success))
4253
          return false;
4254
        if (!this.success.equals(that.success))
4255
          return false;
4256
      }
4257
 
4258
      boolean this_present_pex = true && this.isSetPex();
4259
      boolean that_present_pex = true && that.isSetPex();
4260
      if (this_present_pex || that_present_pex) {
4261
        if (!(this_present_pex && that_present_pex))
4262
          return false;
4263
        if (!this.pex.equals(that.pex))
4264
          return false;
4265
      }
4266
 
4267
      return true;
4268
    }
4269
 
4270
    @Override
4271
    public int hashCode() {
4272
      return 0;
4273
    }
4274
 
4275
    public int compareTo(getCoupon_result other) {
4276
      if (!getClass().equals(other.getClass())) {
4277
        return getClass().getName().compareTo(other.getClass().getName());
4278
      }
4279
 
4280
      int lastComparison = 0;
4281
      getCoupon_result typedOther = (getCoupon_result)other;
4282
 
4283
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
4284
      if (lastComparison != 0) {
4285
        return lastComparison;
4286
      }
4287
      if (isSetSuccess()) {
4288
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4289
        if (lastComparison != 0) {
4290
          return lastComparison;
4291
        }
4292
      }
4293
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
4294
      if (lastComparison != 0) {
4295
        return lastComparison;
4296
      }
4297
      if (isSetPex()) {
4298
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
4299
        if (lastComparison != 0) {
4300
          return lastComparison;
4301
        }
4302
      }
4303
      return 0;
4304
    }
4305
 
4306
    public _Fields fieldForId(int fieldId) {
4307
      return _Fields.findByThriftId(fieldId);
4308
    }
4309
 
4310
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4311
      org.apache.thrift.protocol.TField field;
4312
      iprot.readStructBegin();
4313
      while (true)
4314
      {
4315
        field = iprot.readFieldBegin();
4316
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4317
          break;
4318
        }
4319
        switch (field.id) {
4320
          case 0: // SUCCESS
4321
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4322
              this.success = new Coupon();
4323
              this.success.read(iprot);
4324
            } else { 
4325
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4326
            }
4327
            break;
4328
          case 1: // PEX
4329
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4330
              this.pex = new PromotionException();
4331
              this.pex.read(iprot);
4332
            } else { 
4333
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4334
            }
4335
            break;
4336
          default:
4337
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4338
        }
4339
        iprot.readFieldEnd();
4340
      }
4341
      iprot.readStructEnd();
4342
      validate();
4343
    }
4344
 
4345
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4346
      oprot.writeStructBegin(STRUCT_DESC);
4347
 
4348
      if (this.isSetSuccess()) {
4349
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4350
        this.success.write(oprot);
4351
        oprot.writeFieldEnd();
4352
      } else if (this.isSetPex()) {
4353
        oprot.writeFieldBegin(PEX_FIELD_DESC);
4354
        this.pex.write(oprot);
4355
        oprot.writeFieldEnd();
4356
      }
4357
      oprot.writeFieldStop();
4358
      oprot.writeStructEnd();
4359
    }
4360
 
4361
    @Override
4362
    public String toString() {
4363
      StringBuilder sb = new StringBuilder("getCoupon_result(");
4364
      boolean first = true;
4365
 
4366
      sb.append("success:");
4367
      if (this.success == null) {
4368
        sb.append("null");
4369
      } else {
4370
        sb.append(this.success);
4371
      }
4372
      first = false;
4373
      if (!first) sb.append(", ");
4374
      sb.append("pex:");
4375
      if (this.pex == null) {
4376
        sb.append("null");
4377
      } else {
4378
        sb.append(this.pex);
4379
      }
4380
      first = false;
4381
      sb.append(")");
4382
      return sb.toString();
4383
    }
4384
 
4385
    public void validate() throws org.apache.thrift.TException {
4386
      // check for required fields
4387
    }
4388
 
4389
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4390
      try {
4391
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4392
      } catch (org.apache.thrift.TException te) {
4393
        throw new java.io.IOException(te);
4394
      }
4395
    }
4396
 
4397
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4398
      try {
4399
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4400
      } catch (org.apache.thrift.TException te) {
4401
        throw new java.io.IOException(te);
4402
      }
4403
    }
4404
 
4405
  }
4406
 
4407
  public static class isGiftVoucher_args implements org.apache.thrift.TBase<isGiftVoucher_args, isGiftVoucher_args._Fields>, java.io.Serializable, Cloneable   {
4408
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isGiftVoucher_args");
4409
 
4410
    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);
4411
 
4412
    private String couponCode; // required
4413
 
4414
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4415
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4416
      COUPON_CODE((short)1, "couponCode");
4417
 
4418
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4419
 
4420
      static {
4421
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4422
          byName.put(field.getFieldName(), field);
4423
        }
4424
      }
4425
 
4426
      /**
4427
       * Find the _Fields constant that matches fieldId, or null if its not found.
4428
       */
4429
      public static _Fields findByThriftId(int fieldId) {
4430
        switch(fieldId) {
4431
          case 1: // COUPON_CODE
4432
            return COUPON_CODE;
4433
          default:
4434
            return null;
4435
        }
4436
      }
4437
 
4438
      /**
4439
       * Find the _Fields constant that matches fieldId, throwing an exception
4440
       * if it is not found.
4441
       */
4442
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4443
        _Fields fields = findByThriftId(fieldId);
4444
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4445
        return fields;
4446
      }
4447
 
4448
      /**
4449
       * Find the _Fields constant that matches name, or null if its not found.
4450
       */
4451
      public static _Fields findByName(String name) {
4452
        return byName.get(name);
4453
      }
4454
 
4455
      private final short _thriftId;
4456
      private final String _fieldName;
4457
 
4458
      _Fields(short thriftId, String fieldName) {
4459
        _thriftId = thriftId;
4460
        _fieldName = fieldName;
4461
      }
4462
 
4463
      public short getThriftFieldId() {
4464
        return _thriftId;
4465
      }
4466
 
4467
      public String getFieldName() {
4468
        return _fieldName;
4469
      }
4470
    }
4471
 
4472
    // isset id assignments
4473
 
4474
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4475
    static {
4476
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4477
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4478
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
4479
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4480
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isGiftVoucher_args.class, metaDataMap);
4481
    }
4482
 
4483
    public isGiftVoucher_args() {
4484
    }
4485
 
4486
    public isGiftVoucher_args(
4487
      String couponCode)
4488
    {
4489
      this();
4490
      this.couponCode = couponCode;
4491
    }
4492
 
4493
    /**
4494
     * Performs a deep copy on <i>other</i>.
4495
     */
4496
    public isGiftVoucher_args(isGiftVoucher_args other) {
4497
      if (other.isSetCouponCode()) {
4498
        this.couponCode = other.couponCode;
4499
      }
4500
    }
4501
 
4502
    public isGiftVoucher_args deepCopy() {
4503
      return new isGiftVoucher_args(this);
4504
    }
4505
 
4506
    @Override
4507
    public void clear() {
4508
      this.couponCode = null;
4509
    }
4510
 
4511
    public String getCouponCode() {
4512
      return this.couponCode;
4513
    }
4514
 
4515
    public void setCouponCode(String couponCode) {
4516
      this.couponCode = couponCode;
4517
    }
4518
 
4519
    public void unsetCouponCode() {
4520
      this.couponCode = null;
4521
    }
4522
 
4523
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
4524
    public boolean isSetCouponCode() {
4525
      return this.couponCode != null;
4526
    }
4527
 
4528
    public void setCouponCodeIsSet(boolean value) {
4529
      if (!value) {
4530
        this.couponCode = null;
4531
      }
4532
    }
4533
 
4534
    public void setFieldValue(_Fields field, Object value) {
4535
      switch (field) {
4536
      case COUPON_CODE:
4537
        if (value == null) {
4538
          unsetCouponCode();
4539
        } else {
4540
          setCouponCode((String)value);
4541
        }
4542
        break;
4543
 
4544
      }
4545
    }
4546
 
4547
    public Object getFieldValue(_Fields field) {
4548
      switch (field) {
4549
      case COUPON_CODE:
4550
        return getCouponCode();
4551
 
4552
      }
4553
      throw new IllegalStateException();
4554
    }
4555
 
4556
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4557
    public boolean isSet(_Fields field) {
4558
      if (field == null) {
4559
        throw new IllegalArgumentException();
4560
      }
4561
 
4562
      switch (field) {
4563
      case COUPON_CODE:
4564
        return isSetCouponCode();
4565
      }
4566
      throw new IllegalStateException();
4567
    }
4568
 
4569
    @Override
4570
    public boolean equals(Object that) {
4571
      if (that == null)
4572
        return false;
4573
      if (that instanceof isGiftVoucher_args)
4574
        return this.equals((isGiftVoucher_args)that);
4575
      return false;
4576
    }
4577
 
4578
    public boolean equals(isGiftVoucher_args that) {
4579
      if (that == null)
4580
        return false;
4581
 
4582
      boolean this_present_couponCode = true && this.isSetCouponCode();
4583
      boolean that_present_couponCode = true && that.isSetCouponCode();
4584
      if (this_present_couponCode || that_present_couponCode) {
4585
        if (!(this_present_couponCode && that_present_couponCode))
4586
          return false;
4587
        if (!this.couponCode.equals(that.couponCode))
4588
          return false;
4589
      }
4590
 
4591
      return true;
4592
    }
4593
 
4594
    @Override
4595
    public int hashCode() {
4596
      return 0;
4597
    }
4598
 
4599
    public int compareTo(isGiftVoucher_args other) {
4600
      if (!getClass().equals(other.getClass())) {
4601
        return getClass().getName().compareTo(other.getClass().getName());
4602
      }
4603
 
4604
      int lastComparison = 0;
4605
      isGiftVoucher_args typedOther = (isGiftVoucher_args)other;
4606
 
4607
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
4608
      if (lastComparison != 0) {
4609
        return lastComparison;
4610
      }
4611
      if (isSetCouponCode()) {
4612
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
4613
        if (lastComparison != 0) {
4614
          return lastComparison;
4615
        }
4616
      }
4617
      return 0;
4618
    }
4619
 
4620
    public _Fields fieldForId(int fieldId) {
4621
      return _Fields.findByThriftId(fieldId);
4622
    }
4623
 
4624
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4625
      org.apache.thrift.protocol.TField field;
4626
      iprot.readStructBegin();
4627
      while (true)
4628
      {
4629
        field = iprot.readFieldBegin();
4630
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4631
          break;
4632
        }
4633
        switch (field.id) {
4634
          case 1: // COUPON_CODE
4635
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
4636
              this.couponCode = iprot.readString();
4637
            } else { 
4638
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4639
            }
4640
            break;
4641
          default:
4642
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4643
        }
4644
        iprot.readFieldEnd();
4645
      }
4646
      iprot.readStructEnd();
4647
      validate();
4648
    }
4649
 
4650
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4651
      validate();
4652
 
4653
      oprot.writeStructBegin(STRUCT_DESC);
4654
      if (this.couponCode != null) {
4655
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
4656
        oprot.writeString(this.couponCode);
4657
        oprot.writeFieldEnd();
4658
      }
4659
      oprot.writeFieldStop();
4660
      oprot.writeStructEnd();
4661
    }
4662
 
4663
    @Override
4664
    public String toString() {
4665
      StringBuilder sb = new StringBuilder("isGiftVoucher_args(");
4666
      boolean first = true;
4667
 
4668
      sb.append("couponCode:");
4669
      if (this.couponCode == null) {
4670
        sb.append("null");
4671
      } else {
4672
        sb.append(this.couponCode);
4673
      }
4674
      first = false;
4675
      sb.append(")");
4676
      return sb.toString();
4677
    }
4678
 
4679
    public void validate() throws org.apache.thrift.TException {
4680
      // check for required fields
4681
    }
4682
 
4683
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4684
      try {
4685
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4686
      } catch (org.apache.thrift.TException te) {
4687
        throw new java.io.IOException(te);
4688
      }
4689
    }
4690
 
4691
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4692
      try {
4693
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4694
      } catch (org.apache.thrift.TException te) {
4695
        throw new java.io.IOException(te);
4696
      }
4697
    }
4698
 
4699
  }
4700
 
4701
  public static class isGiftVoucher_result implements org.apache.thrift.TBase<isGiftVoucher_result, isGiftVoucher_result._Fields>, java.io.Serializable, Cloneable   {
4702
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isGiftVoucher_result");
4703
 
4704
    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);
4705
    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);
4706
 
4707
    private boolean success; // required
4708
    private PromotionException pex; // required
4709
 
4710
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4711
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4712
      SUCCESS((short)0, "success"),
4713
      PEX((short)1, "pex");
4714
 
4715
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4716
 
4717
      static {
4718
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4719
          byName.put(field.getFieldName(), field);
4720
        }
4721
      }
4722
 
4723
      /**
4724
       * Find the _Fields constant that matches fieldId, or null if its not found.
4725
       */
4726
      public static _Fields findByThriftId(int fieldId) {
4727
        switch(fieldId) {
4728
          case 0: // SUCCESS
4729
            return SUCCESS;
4730
          case 1: // PEX
4731
            return PEX;
4732
          default:
4733
            return null;
4734
        }
4735
      }
4736
 
4737
      /**
4738
       * Find the _Fields constant that matches fieldId, throwing an exception
4739
       * if it is not found.
4740
       */
4741
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4742
        _Fields fields = findByThriftId(fieldId);
4743
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4744
        return fields;
4745
      }
4746
 
4747
      /**
4748
       * Find the _Fields constant that matches name, or null if its not found.
4749
       */
4750
      public static _Fields findByName(String name) {
4751
        return byName.get(name);
4752
      }
4753
 
4754
      private final short _thriftId;
4755
      private final String _fieldName;
4756
 
4757
      _Fields(short thriftId, String fieldName) {
4758
        _thriftId = thriftId;
4759
        _fieldName = fieldName;
4760
      }
4761
 
4762
      public short getThriftFieldId() {
4763
        return _thriftId;
4764
      }
4765
 
4766
      public String getFieldName() {
4767
        return _fieldName;
4768
      }
4769
    }
4770
 
4771
    // isset id assignments
4772
    private static final int __SUCCESS_ISSET_ID = 0;
4773
    private BitSet __isset_bit_vector = new BitSet(1);
4774
 
4775
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4776
    static {
4777
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4778
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4779
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
4780
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4781
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4782
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4783
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isGiftVoucher_result.class, metaDataMap);
4784
    }
4785
 
4786
    public isGiftVoucher_result() {
4787
    }
4788
 
4789
    public isGiftVoucher_result(
4790
      boolean success,
4791
      PromotionException pex)
4792
    {
4793
      this();
4794
      this.success = success;
4795
      setSuccessIsSet(true);
4796
      this.pex = pex;
4797
    }
4798
 
4799
    /**
4800
     * Performs a deep copy on <i>other</i>.
4801
     */
4802
    public isGiftVoucher_result(isGiftVoucher_result other) {
4803
      __isset_bit_vector.clear();
4804
      __isset_bit_vector.or(other.__isset_bit_vector);
4805
      this.success = other.success;
4806
      if (other.isSetPex()) {
4807
        this.pex = new PromotionException(other.pex);
4808
      }
4809
    }
4810
 
4811
    public isGiftVoucher_result deepCopy() {
4812
      return new isGiftVoucher_result(this);
4813
    }
4814
 
4815
    @Override
4816
    public void clear() {
4817
      setSuccessIsSet(false);
4818
      this.success = false;
4819
      this.pex = null;
4820
    }
4821
 
4822
    public boolean isSuccess() {
4823
      return this.success;
4824
    }
4825
 
4826
    public void setSuccess(boolean success) {
4827
      this.success = success;
4828
      setSuccessIsSet(true);
4829
    }
4830
 
4831
    public void unsetSuccess() {
4832
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
4833
    }
4834
 
4835
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
4836
    public boolean isSetSuccess() {
4837
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
4838
    }
4839
 
4840
    public void setSuccessIsSet(boolean value) {
4841
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
4842
    }
4843
 
4844
    public PromotionException getPex() {
4845
      return this.pex;
4846
    }
4847
 
4848
    public void setPex(PromotionException pex) {
4849
      this.pex = pex;
4850
    }
4851
 
4852
    public void unsetPex() {
4853
      this.pex = null;
4854
    }
4855
 
4856
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
4857
    public boolean isSetPex() {
4858
      return this.pex != null;
4859
    }
4860
 
4861
    public void setPexIsSet(boolean value) {
4862
      if (!value) {
4863
        this.pex = null;
4864
      }
4865
    }
4866
 
4867
    public void setFieldValue(_Fields field, Object value) {
4868
      switch (field) {
4869
      case SUCCESS:
4870
        if (value == null) {
4871
          unsetSuccess();
4872
        } else {
4873
          setSuccess((Boolean)value);
4874
        }
4875
        break;
4876
 
4877
      case PEX:
4878
        if (value == null) {
4879
          unsetPex();
4880
        } else {
4881
          setPex((PromotionException)value);
4882
        }
4883
        break;
4884
 
4885
      }
4886
    }
4887
 
4888
    public Object getFieldValue(_Fields field) {
4889
      switch (field) {
4890
      case SUCCESS:
4891
        return Boolean.valueOf(isSuccess());
4892
 
4893
      case PEX:
4894
        return getPex();
4895
 
4896
      }
4897
      throw new IllegalStateException();
4898
    }
4899
 
4900
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4901
    public boolean isSet(_Fields field) {
4902
      if (field == null) {
4903
        throw new IllegalArgumentException();
4904
      }
4905
 
4906
      switch (field) {
4907
      case SUCCESS:
4908
        return isSetSuccess();
4909
      case PEX:
4910
        return isSetPex();
4911
      }
4912
      throw new IllegalStateException();
4913
    }
4914
 
4915
    @Override
4916
    public boolean equals(Object that) {
4917
      if (that == null)
4918
        return false;
4919
      if (that instanceof isGiftVoucher_result)
4920
        return this.equals((isGiftVoucher_result)that);
4921
      return false;
4922
    }
4923
 
4924
    public boolean equals(isGiftVoucher_result that) {
4925
      if (that == null)
4926
        return false;
4927
 
4928
      boolean this_present_success = true;
4929
      boolean that_present_success = true;
4930
      if (this_present_success || that_present_success) {
4931
        if (!(this_present_success && that_present_success))
4932
          return false;
4933
        if (this.success != that.success)
4934
          return false;
4935
      }
4936
 
4937
      boolean this_present_pex = true && this.isSetPex();
4938
      boolean that_present_pex = true && that.isSetPex();
4939
      if (this_present_pex || that_present_pex) {
4940
        if (!(this_present_pex && that_present_pex))
4941
          return false;
4942
        if (!this.pex.equals(that.pex))
4943
          return false;
4944
      }
4945
 
4946
      return true;
4947
    }
4948
 
4949
    @Override
4950
    public int hashCode() {
4951
      return 0;
4952
    }
4953
 
4954
    public int compareTo(isGiftVoucher_result other) {
4955
      if (!getClass().equals(other.getClass())) {
4956
        return getClass().getName().compareTo(other.getClass().getName());
4957
      }
4958
 
4959
      int lastComparison = 0;
4960
      isGiftVoucher_result typedOther = (isGiftVoucher_result)other;
4961
 
4962
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
4963
      if (lastComparison != 0) {
4964
        return lastComparison;
4965
      }
4966
      if (isSetSuccess()) {
4967
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4968
        if (lastComparison != 0) {
4969
          return lastComparison;
4970
        }
4971
      }
4972
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
4973
      if (lastComparison != 0) {
4974
        return lastComparison;
4975
      }
4976
      if (isSetPex()) {
4977
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
4978
        if (lastComparison != 0) {
4979
          return lastComparison;
4980
        }
4981
      }
4982
      return 0;
4983
    }
4984
 
4985
    public _Fields fieldForId(int fieldId) {
4986
      return _Fields.findByThriftId(fieldId);
4987
    }
4988
 
4989
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4990
      org.apache.thrift.protocol.TField field;
4991
      iprot.readStructBegin();
4992
      while (true)
4993
      {
4994
        field = iprot.readFieldBegin();
4995
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4996
          break;
4997
        }
4998
        switch (field.id) {
4999
          case 0: // SUCCESS
5000
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
5001
              this.success = iprot.readBool();
5002
              setSuccessIsSet(true);
5003
            } else { 
5004
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5005
            }
5006
            break;
5007
          case 1: // PEX
5008
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5009
              this.pex = new PromotionException();
5010
              this.pex.read(iprot);
5011
            } else { 
5012
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5013
            }
5014
            break;
5015
          default:
5016
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5017
        }
5018
        iprot.readFieldEnd();
5019
      }
5020
      iprot.readStructEnd();
5021
      validate();
5022
    }
5023
 
5024
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
5025
      oprot.writeStructBegin(STRUCT_DESC);
5026
 
5027
      if (this.isSetSuccess()) {
5028
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
5029
        oprot.writeBool(this.success);
5030
        oprot.writeFieldEnd();
5031
      } else if (this.isSetPex()) {
5032
        oprot.writeFieldBegin(PEX_FIELD_DESC);
5033
        this.pex.write(oprot);
5034
        oprot.writeFieldEnd();
5035
      }
5036
      oprot.writeFieldStop();
5037
      oprot.writeStructEnd();
5038
    }
5039
 
5040
    @Override
5041
    public String toString() {
5042
      StringBuilder sb = new StringBuilder("isGiftVoucher_result(");
5043
      boolean first = true;
5044
 
5045
      sb.append("success:");
5046
      sb.append(this.success);
5047
      first = false;
5048
      if (!first) sb.append(", ");
5049
      sb.append("pex:");
5050
      if (this.pex == null) {
5051
        sb.append("null");
5052
      } else {
5053
        sb.append(this.pex);
5054
      }
5055
      first = false;
5056
      sb.append(")");
5057
      return sb.toString();
5058
    }
5059
 
5060
    public void validate() throws org.apache.thrift.TException {
5061
      // check for required fields
5062
    }
5063
 
5064
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5065
      try {
5066
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5067
      } catch (org.apache.thrift.TException te) {
5068
        throw new java.io.IOException(te);
5069
      }
5070
    }
5071
 
5072
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5073
      try {
5074
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5075
      } catch (org.apache.thrift.TException te) {
5076
        throw new java.io.IOException(te);
5077
      }
5078
    }
5079
 
5080
  }
5081
 
6356 amit.gupta 5082
  public static class isCodApplicable_args implements org.apache.thrift.TBase<isCodApplicable_args, isCodApplicable_args._Fields>, java.io.Serializable, Cloneable   {
5083
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isCodApplicable_args");
5084
 
5085
    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);
5086
 
5087
    private String couponCode; // required
5088
 
5089
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
5090
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
5091
      COUPON_CODE((short)1, "couponCode");
5092
 
5093
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5094
 
5095
      static {
5096
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5097
          byName.put(field.getFieldName(), field);
5098
        }
5099
      }
5100
 
5101
      /**
5102
       * Find the _Fields constant that matches fieldId, or null if its not found.
5103
       */
5104
      public static _Fields findByThriftId(int fieldId) {
5105
        switch(fieldId) {
5106
          case 1: // COUPON_CODE
5107
            return COUPON_CODE;
5108
          default:
5109
            return null;
5110
        }
5111
      }
5112
 
5113
      /**
5114
       * Find the _Fields constant that matches fieldId, throwing an exception
5115
       * if it is not found.
5116
       */
5117
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5118
        _Fields fields = findByThriftId(fieldId);
5119
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5120
        return fields;
5121
      }
5122
 
5123
      /**
5124
       * Find the _Fields constant that matches name, or null if its not found.
5125
       */
5126
      public static _Fields findByName(String name) {
5127
        return byName.get(name);
5128
      }
5129
 
5130
      private final short _thriftId;
5131
      private final String _fieldName;
5132
 
5133
      _Fields(short thriftId, String fieldName) {
5134
        _thriftId = thriftId;
5135
        _fieldName = fieldName;
5136
      }
5137
 
5138
      public short getThriftFieldId() {
5139
        return _thriftId;
5140
      }
5141
 
5142
      public String getFieldName() {
5143
        return _fieldName;
5144
      }
5145
    }
5146
 
5147
    // isset id assignments
5148
 
5149
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
5150
    static {
5151
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5152
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5153
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
5154
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5155
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isCodApplicable_args.class, metaDataMap);
5156
    }
5157
 
5158
    public isCodApplicable_args() {
5159
    }
5160
 
5161
    public isCodApplicable_args(
5162
      String couponCode)
5163
    {
5164
      this();
5165
      this.couponCode = couponCode;
5166
    }
5167
 
5168
    /**
5169
     * Performs a deep copy on <i>other</i>.
5170
     */
5171
    public isCodApplicable_args(isCodApplicable_args other) {
5172
      if (other.isSetCouponCode()) {
5173
        this.couponCode = other.couponCode;
5174
      }
5175
    }
5176
 
5177
    public isCodApplicable_args deepCopy() {
5178
      return new isCodApplicable_args(this);
5179
    }
5180
 
5181
    @Override
5182
    public void clear() {
5183
      this.couponCode = null;
5184
    }
5185
 
5186
    public String getCouponCode() {
5187
      return this.couponCode;
5188
    }
5189
 
5190
    public void setCouponCode(String couponCode) {
5191
      this.couponCode = couponCode;
5192
    }
5193
 
5194
    public void unsetCouponCode() {
5195
      this.couponCode = null;
5196
    }
5197
 
5198
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
5199
    public boolean isSetCouponCode() {
5200
      return this.couponCode != null;
5201
    }
5202
 
5203
    public void setCouponCodeIsSet(boolean value) {
5204
      if (!value) {
5205
        this.couponCode = null;
5206
      }
5207
    }
5208
 
5209
    public void setFieldValue(_Fields field, Object value) {
5210
      switch (field) {
5211
      case COUPON_CODE:
5212
        if (value == null) {
5213
          unsetCouponCode();
5214
        } else {
5215
          setCouponCode((String)value);
5216
        }
5217
        break;
5218
 
5219
      }
5220
    }
5221
 
5222
    public Object getFieldValue(_Fields field) {
5223
      switch (field) {
5224
      case COUPON_CODE:
5225
        return getCouponCode();
5226
 
5227
      }
5228
      throw new IllegalStateException();
5229
    }
5230
 
5231
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5232
    public boolean isSet(_Fields field) {
5233
      if (field == null) {
5234
        throw new IllegalArgumentException();
5235
      }
5236
 
5237
      switch (field) {
5238
      case COUPON_CODE:
5239
        return isSetCouponCode();
5240
      }
5241
      throw new IllegalStateException();
5242
    }
5243
 
5244
    @Override
5245
    public boolean equals(Object that) {
5246
      if (that == null)
5247
        return false;
5248
      if (that instanceof isCodApplicable_args)
5249
        return this.equals((isCodApplicable_args)that);
5250
      return false;
5251
    }
5252
 
5253
    public boolean equals(isCodApplicable_args that) {
5254
      if (that == null)
5255
        return false;
5256
 
5257
      boolean this_present_couponCode = true && this.isSetCouponCode();
5258
      boolean that_present_couponCode = true && that.isSetCouponCode();
5259
      if (this_present_couponCode || that_present_couponCode) {
5260
        if (!(this_present_couponCode && that_present_couponCode))
5261
          return false;
5262
        if (!this.couponCode.equals(that.couponCode))
5263
          return false;
5264
      }
5265
 
5266
      return true;
5267
    }
5268
 
5269
    @Override
5270
    public int hashCode() {
5271
      return 0;
5272
    }
5273
 
5274
    public int compareTo(isCodApplicable_args other) {
5275
      if (!getClass().equals(other.getClass())) {
5276
        return getClass().getName().compareTo(other.getClass().getName());
5277
      }
5278
 
5279
      int lastComparison = 0;
5280
      isCodApplicable_args typedOther = (isCodApplicable_args)other;
5281
 
5282
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
5283
      if (lastComparison != 0) {
5284
        return lastComparison;
5285
      }
5286
      if (isSetCouponCode()) {
5287
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
5288
        if (lastComparison != 0) {
5289
          return lastComparison;
5290
        }
5291
      }
5292
      return 0;
5293
    }
5294
 
5295
    public _Fields fieldForId(int fieldId) {
5296
      return _Fields.findByThriftId(fieldId);
5297
    }
5298
 
5299
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5300
      org.apache.thrift.protocol.TField field;
5301
      iprot.readStructBegin();
5302
      while (true)
5303
      {
5304
        field = iprot.readFieldBegin();
5305
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
5306
          break;
5307
        }
5308
        switch (field.id) {
5309
          case 1: // COUPON_CODE
5310
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
5311
              this.couponCode = iprot.readString();
5312
            } else { 
5313
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5314
            }
5315
            break;
5316
          default:
5317
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5318
        }
5319
        iprot.readFieldEnd();
5320
      }
5321
      iprot.readStructEnd();
5322
      validate();
5323
    }
5324
 
5325
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
5326
      validate();
5327
 
5328
      oprot.writeStructBegin(STRUCT_DESC);
5329
      if (this.couponCode != null) {
5330
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
5331
        oprot.writeString(this.couponCode);
5332
        oprot.writeFieldEnd();
5333
      }
5334
      oprot.writeFieldStop();
5335
      oprot.writeStructEnd();
5336
    }
5337
 
5338
    @Override
5339
    public String toString() {
5340
      StringBuilder sb = new StringBuilder("isCodApplicable_args(");
5341
      boolean first = true;
5342
 
5343
      sb.append("couponCode:");
5344
      if (this.couponCode == null) {
5345
        sb.append("null");
5346
      } else {
5347
        sb.append(this.couponCode);
5348
      }
5349
      first = false;
5350
      sb.append(")");
5351
      return sb.toString();
5352
    }
5353
 
5354
    public void validate() throws org.apache.thrift.TException {
5355
      // check for required fields
5356
    }
5357
 
5358
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5359
      try {
5360
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5361
      } catch (org.apache.thrift.TException te) {
5362
        throw new java.io.IOException(te);
5363
      }
5364
    }
5365
 
5366
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5367
      try {
5368
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5369
      } catch (org.apache.thrift.TException te) {
5370
        throw new java.io.IOException(te);
5371
      }
5372
    }
5373
 
5374
  }
5375
 
5376
  public static class isCodApplicable_result implements org.apache.thrift.TBase<isCodApplicable_result, isCodApplicable_result._Fields>, java.io.Serializable, Cloneable   {
5377
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isCodApplicable_result");
5378
 
5379
    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);
5380
    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);
5381
 
5382
    private boolean success; // required
5383
    private PromotionException pex; // required
5384
 
5385
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
5386
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
5387
      SUCCESS((short)0, "success"),
5388
      PEX((short)1, "pex");
5389
 
5390
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5391
 
5392
      static {
5393
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5394
          byName.put(field.getFieldName(), field);
5395
        }
5396
      }
5397
 
5398
      /**
5399
       * Find the _Fields constant that matches fieldId, or null if its not found.
5400
       */
5401
      public static _Fields findByThriftId(int fieldId) {
5402
        switch(fieldId) {
5403
          case 0: // SUCCESS
5404
            return SUCCESS;
5405
          case 1: // PEX
5406
            return PEX;
5407
          default:
5408
            return null;
5409
        }
5410
      }
5411
 
5412
      /**
5413
       * Find the _Fields constant that matches fieldId, throwing an exception
5414
       * if it is not found.
5415
       */
5416
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5417
        _Fields fields = findByThriftId(fieldId);
5418
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5419
        return fields;
5420
      }
5421
 
5422
      /**
5423
       * Find the _Fields constant that matches name, or null if its not found.
5424
       */
5425
      public static _Fields findByName(String name) {
5426
        return byName.get(name);
5427
      }
5428
 
5429
      private final short _thriftId;
5430
      private final String _fieldName;
5431
 
5432
      _Fields(short thriftId, String fieldName) {
5433
        _thriftId = thriftId;
5434
        _fieldName = fieldName;
5435
      }
5436
 
5437
      public short getThriftFieldId() {
5438
        return _thriftId;
5439
      }
5440
 
5441
      public String getFieldName() {
5442
        return _fieldName;
5443
      }
5444
    }
5445
 
5446
    // isset id assignments
5447
    private static final int __SUCCESS_ISSET_ID = 0;
5448
    private BitSet __isset_bit_vector = new BitSet(1);
5449
 
5450
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
5451
    static {
5452
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5453
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5454
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
5455
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5456
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
5457
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5458
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isCodApplicable_result.class, metaDataMap);
5459
    }
5460
 
5461
    public isCodApplicable_result() {
5462
    }
5463
 
5464
    public isCodApplicable_result(
5465
      boolean success,
5466
      PromotionException pex)
5467
    {
5468
      this();
5469
      this.success = success;
5470
      setSuccessIsSet(true);
5471
      this.pex = pex;
5472
    }
5473
 
5474
    /**
5475
     * Performs a deep copy on <i>other</i>.
5476
     */
5477
    public isCodApplicable_result(isCodApplicable_result other) {
5478
      __isset_bit_vector.clear();
5479
      __isset_bit_vector.or(other.__isset_bit_vector);
5480
      this.success = other.success;
5481
      if (other.isSetPex()) {
5482
        this.pex = new PromotionException(other.pex);
5483
      }
5484
    }
5485
 
5486
    public isCodApplicable_result deepCopy() {
5487
      return new isCodApplicable_result(this);
5488
    }
5489
 
5490
    @Override
5491
    public void clear() {
5492
      setSuccessIsSet(false);
5493
      this.success = false;
5494
      this.pex = null;
5495
    }
5496
 
5497
    public boolean isSuccess() {
5498
      return this.success;
5499
    }
5500
 
5501
    public void setSuccess(boolean success) {
5502
      this.success = success;
5503
      setSuccessIsSet(true);
5504
    }
5505
 
5506
    public void unsetSuccess() {
5507
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
5508
    }
5509
 
5510
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
5511
    public boolean isSetSuccess() {
5512
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
5513
    }
5514
 
5515
    public void setSuccessIsSet(boolean value) {
5516
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
5517
    }
5518
 
5519
    public PromotionException getPex() {
5520
      return this.pex;
5521
    }
5522
 
5523
    public void setPex(PromotionException pex) {
5524
      this.pex = pex;
5525
    }
5526
 
5527
    public void unsetPex() {
5528
      this.pex = null;
5529
    }
5530
 
5531
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
5532
    public boolean isSetPex() {
5533
      return this.pex != null;
5534
    }
5535
 
5536
    public void setPexIsSet(boolean value) {
5537
      if (!value) {
5538
        this.pex = null;
5539
      }
5540
    }
5541
 
5542
    public void setFieldValue(_Fields field, Object value) {
5543
      switch (field) {
5544
      case SUCCESS:
5545
        if (value == null) {
5546
          unsetSuccess();
5547
        } else {
5548
          setSuccess((Boolean)value);
5549
        }
5550
        break;
5551
 
5552
      case PEX:
5553
        if (value == null) {
5554
          unsetPex();
5555
        } else {
5556
          setPex((PromotionException)value);
5557
        }
5558
        break;
5559
 
5560
      }
5561
    }
5562
 
5563
    public Object getFieldValue(_Fields field) {
5564
      switch (field) {
5565
      case SUCCESS:
5566
        return Boolean.valueOf(isSuccess());
5567
 
5568
      case PEX:
5569
        return getPex();
5570
 
5571
      }
5572
      throw new IllegalStateException();
5573
    }
5574
 
5575
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5576
    public boolean isSet(_Fields field) {
5577
      if (field == null) {
5578
        throw new IllegalArgumentException();
5579
      }
5580
 
5581
      switch (field) {
5582
      case SUCCESS:
5583
        return isSetSuccess();
5584
      case PEX:
5585
        return isSetPex();
5586
      }
5587
      throw new IllegalStateException();
5588
    }
5589
 
5590
    @Override
5591
    public boolean equals(Object that) {
5592
      if (that == null)
5593
        return false;
5594
      if (that instanceof isCodApplicable_result)
5595
        return this.equals((isCodApplicable_result)that);
5596
      return false;
5597
    }
5598
 
5599
    public boolean equals(isCodApplicable_result that) {
5600
      if (that == null)
5601
        return false;
5602
 
5603
      boolean this_present_success = true;
5604
      boolean that_present_success = true;
5605
      if (this_present_success || that_present_success) {
5606
        if (!(this_present_success && that_present_success))
5607
          return false;
5608
        if (this.success != that.success)
5609
          return false;
5610
      }
5611
 
5612
      boolean this_present_pex = true && this.isSetPex();
5613
      boolean that_present_pex = true && that.isSetPex();
5614
      if (this_present_pex || that_present_pex) {
5615
        if (!(this_present_pex && that_present_pex))
5616
          return false;
5617
        if (!this.pex.equals(that.pex))
5618
          return false;
5619
      }
5620
 
5621
      return true;
5622
    }
5623
 
5624
    @Override
5625
    public int hashCode() {
5626
      return 0;
5627
    }
5628
 
5629
    public int compareTo(isCodApplicable_result other) {
5630
      if (!getClass().equals(other.getClass())) {
5631
        return getClass().getName().compareTo(other.getClass().getName());
5632
      }
5633
 
5634
      int lastComparison = 0;
5635
      isCodApplicable_result typedOther = (isCodApplicable_result)other;
5636
 
5637
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
5638
      if (lastComparison != 0) {
5639
        return lastComparison;
5640
      }
5641
      if (isSetSuccess()) {
5642
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
5643
        if (lastComparison != 0) {
5644
          return lastComparison;
5645
        }
5646
      }
5647
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
5648
      if (lastComparison != 0) {
5649
        return lastComparison;
5650
      }
5651
      if (isSetPex()) {
5652
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
5653
        if (lastComparison != 0) {
5654
          return lastComparison;
5655
        }
5656
      }
5657
      return 0;
5658
    }
5659
 
5660
    public _Fields fieldForId(int fieldId) {
5661
      return _Fields.findByThriftId(fieldId);
5662
    }
5663
 
5664
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5665
      org.apache.thrift.protocol.TField field;
5666
      iprot.readStructBegin();
5667
      while (true)
5668
      {
5669
        field = iprot.readFieldBegin();
5670
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
5671
          break;
5672
        }
5673
        switch (field.id) {
5674
          case 0: // SUCCESS
5675
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
5676
              this.success = iprot.readBool();
5677
              setSuccessIsSet(true);
5678
            } else { 
5679
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5680
            }
5681
            break;
5682
          case 1: // PEX
5683
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5684
              this.pex = new PromotionException();
5685
              this.pex.read(iprot);
5686
            } else { 
5687
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5688
            }
5689
            break;
5690
          default:
5691
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5692
        }
5693
        iprot.readFieldEnd();
5694
      }
5695
      iprot.readStructEnd();
5696
      validate();
5697
    }
5698
 
5699
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
5700
      oprot.writeStructBegin(STRUCT_DESC);
5701
 
5702
      if (this.isSetSuccess()) {
5703
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
5704
        oprot.writeBool(this.success);
5705
        oprot.writeFieldEnd();
5706
      } else if (this.isSetPex()) {
5707
        oprot.writeFieldBegin(PEX_FIELD_DESC);
5708
        this.pex.write(oprot);
5709
        oprot.writeFieldEnd();
5710
      }
5711
      oprot.writeFieldStop();
5712
      oprot.writeStructEnd();
5713
    }
5714
 
5715
    @Override
5716
    public String toString() {
5717
      StringBuilder sb = new StringBuilder("isCodApplicable_result(");
5718
      boolean first = true;
5719
 
5720
      sb.append("success:");
5721
      sb.append(this.success);
5722
      first = false;
5723
      if (!first) sb.append(", ");
5724
      sb.append("pex:");
5725
      if (this.pex == null) {
5726
        sb.append("null");
5727
      } else {
5728
        sb.append(this.pex);
5729
      }
5730
      first = false;
5731
      sb.append(")");
5732
      return sb.toString();
5733
    }
5734
 
5735
    public void validate() throws org.apache.thrift.TException {
5736
      // check for required fields
5737
    }
5738
 
5739
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5740
      try {
5741
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5742
      } catch (org.apache.thrift.TException te) {
5743
        throw new java.io.IOException(te);
5744
      }
5745
    }
5746
 
5747
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5748
      try {
5749
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5750
      } catch (org.apache.thrift.TException te) {
5751
        throw new java.io.IOException(te);
5752
      }
5753
    }
5754
 
5755
  }
5756
 
3430 rajveer 5757
  public static class getAllPromotions_args implements org.apache.thrift.TBase<getAllPromotions_args, getAllPromotions_args._Fields>, java.io.Serializable, Cloneable   {
5758
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_args");
1982 varun.gupt 5759
 
5760
 
5761
 
5762
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5763
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5764
;
5765
 
5766
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5767
 
5768
      static {
5769
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5770
          byName.put(field.getFieldName(), field);
5771
        }
5772
      }
5773
 
5774
      /**
5775
       * Find the _Fields constant that matches fieldId, or null if its not found.
5776
       */
5777
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5778
        switch(fieldId) {
5779
          default:
5780
            return null;
5781
        }
1982 varun.gupt 5782
      }
5783
 
5784
      /**
5785
       * Find the _Fields constant that matches fieldId, throwing an exception
5786
       * if it is not found.
5787
       */
5788
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5789
        _Fields fields = findByThriftId(fieldId);
5790
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5791
        return fields;
5792
      }
5793
 
5794
      /**
5795
       * Find the _Fields constant that matches name, or null if its not found.
5796
       */
5797
      public static _Fields findByName(String name) {
5798
        return byName.get(name);
5799
      }
5800
 
5801
      private final short _thriftId;
5802
      private final String _fieldName;
5803
 
5804
      _Fields(short thriftId, String fieldName) {
5805
        _thriftId = thriftId;
5806
        _fieldName = fieldName;
5807
      }
5808
 
5809
      public short getThriftFieldId() {
5810
        return _thriftId;
5811
      }
5812
 
5813
      public String getFieldName() {
5814
        return _fieldName;
5815
      }
5816
    }
3430 rajveer 5817
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5818
    static {
3430 rajveer 5819
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5820
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5821
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_args.class, metaDataMap);
1982 varun.gupt 5822
    }
5823
 
5824
    public getAllPromotions_args() {
5825
    }
5826
 
5827
    /**
5828
     * Performs a deep copy on <i>other</i>.
5829
     */
5830
    public getAllPromotions_args(getAllPromotions_args other) {
5831
    }
5832
 
5833
    public getAllPromotions_args deepCopy() {
5834
      return new getAllPromotions_args(this);
5835
    }
5836
 
3430 rajveer 5837
    @Override
5838
    public void clear() {
1982 varun.gupt 5839
    }
5840
 
5841
    public void setFieldValue(_Fields field, Object value) {
5842
      switch (field) {
5843
      }
5844
    }
5845
 
5846
    public Object getFieldValue(_Fields field) {
5847
      switch (field) {
5848
      }
5849
      throw new IllegalStateException();
5850
    }
5851
 
3430 rajveer 5852
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5853
    public boolean isSet(_Fields field) {
5854
      if (field == null) {
5855
        throw new IllegalArgumentException();
5856
      }
1982 varun.gupt 5857
 
5858
      switch (field) {
5859
      }
5860
      throw new IllegalStateException();
5861
    }
5862
 
5863
    @Override
5864
    public boolean equals(Object that) {
5865
      if (that == null)
5866
        return false;
5867
      if (that instanceof getAllPromotions_args)
5868
        return this.equals((getAllPromotions_args)that);
5869
      return false;
5870
    }
5871
 
5872
    public boolean equals(getAllPromotions_args that) {
5873
      if (that == null)
5874
        return false;
5875
 
5876
      return true;
5877
    }
5878
 
5879
    @Override
5880
    public int hashCode() {
5881
      return 0;
5882
    }
5883
 
5884
    public int compareTo(getAllPromotions_args other) {
5885
      if (!getClass().equals(other.getClass())) {
5886
        return getClass().getName().compareTo(other.getClass().getName());
5887
      }
5888
 
5889
      int lastComparison = 0;
5890
      getAllPromotions_args typedOther = (getAllPromotions_args)other;
5891
 
5892
      return 0;
5893
    }
5894
 
3430 rajveer 5895
    public _Fields fieldForId(int fieldId) {
5896
      return _Fields.findByThriftId(fieldId);
5897
    }
5898
 
5899
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5900
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5901
      iprot.readStructBegin();
5902
      while (true)
5903
      {
5904
        field = iprot.readFieldBegin();
3430 rajveer 5905
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5906
          break;
5907
        }
3430 rajveer 5908
        switch (field.id) {
5909
          default:
5910
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5911
        }
3430 rajveer 5912
        iprot.readFieldEnd();
1982 varun.gupt 5913
      }
5914
      iprot.readStructEnd();
5915
      validate();
5916
    }
5917
 
3430 rajveer 5918
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5919
      validate();
5920
 
5921
      oprot.writeStructBegin(STRUCT_DESC);
5922
      oprot.writeFieldStop();
5923
      oprot.writeStructEnd();
5924
    }
5925
 
5926
    @Override
5927
    public String toString() {
5928
      StringBuilder sb = new StringBuilder("getAllPromotions_args(");
5929
      boolean first = true;
5930
 
5931
      sb.append(")");
5932
      return sb.toString();
5933
    }
5934
 
3430 rajveer 5935
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5936
      // check for required fields
5937
    }
5938
 
3430 rajveer 5939
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5940
      try {
5941
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5942
      } catch (org.apache.thrift.TException te) {
5943
        throw new java.io.IOException(te);
5944
      }
5945
    }
5946
 
5947
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5948
      try {
5949
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5950
      } catch (org.apache.thrift.TException te) {
5951
        throw new java.io.IOException(te);
5952
      }
5953
    }
5954
 
1982 varun.gupt 5955
  }
5956
 
3430 rajveer 5957
  public static class getAllPromotions_result implements org.apache.thrift.TBase<getAllPromotions_result, getAllPromotions_result._Fields>, java.io.Serializable, Cloneable   {
5958
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_result");
1982 varun.gupt 5959
 
3430 rajveer 5960
    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);
5961
    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 5962
 
3430 rajveer 5963
    private List<Promotion> success; // required
5964
    private PromotionException pex; // required
1982 varun.gupt 5965
 
5966
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5967
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5968
      SUCCESS((short)0, "success"),
5969
      PEX((short)1, "pex");
5970
 
5971
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5972
 
5973
      static {
5974
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5975
          byName.put(field.getFieldName(), field);
5976
        }
5977
      }
5978
 
5979
      /**
5980
       * Find the _Fields constant that matches fieldId, or null if its not found.
5981
       */
5982
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5983
        switch(fieldId) {
5984
          case 0: // SUCCESS
5985
            return SUCCESS;
5986
          case 1: // PEX
5987
            return PEX;
5988
          default:
5989
            return null;
5990
        }
1982 varun.gupt 5991
      }
5992
 
5993
      /**
5994
       * Find the _Fields constant that matches fieldId, throwing an exception
5995
       * if it is not found.
5996
       */
5997
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5998
        _Fields fields = findByThriftId(fieldId);
5999
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6000
        return fields;
6001
      }
6002
 
6003
      /**
6004
       * Find the _Fields constant that matches name, or null if its not found.
6005
       */
6006
      public static _Fields findByName(String name) {
6007
        return byName.get(name);
6008
      }
6009
 
6010
      private final short _thriftId;
6011
      private final String _fieldName;
6012
 
6013
      _Fields(short thriftId, String fieldName) {
6014
        _thriftId = thriftId;
6015
        _fieldName = fieldName;
6016
      }
6017
 
6018
      public short getThriftFieldId() {
6019
        return _thriftId;
6020
      }
6021
 
6022
      public String getFieldName() {
6023
        return _fieldName;
6024
      }
6025
    }
6026
 
6027
    // isset id assignments
6028
 
3430 rajveer 6029
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6030
    static {
3430 rajveer 6031
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6032
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6033
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
6034
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class))));
6035
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6036
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
6037
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6038
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_result.class, metaDataMap);
1982 varun.gupt 6039
    }
6040
 
6041
    public getAllPromotions_result() {
6042
    }
6043
 
6044
    public getAllPromotions_result(
6045
      List<Promotion> success,
6046
      PromotionException pex)
6047
    {
6048
      this();
6049
      this.success = success;
6050
      this.pex = pex;
6051
    }
6052
 
6053
    /**
6054
     * Performs a deep copy on <i>other</i>.
6055
     */
6056
    public getAllPromotions_result(getAllPromotions_result other) {
6057
      if (other.isSetSuccess()) {
6058
        List<Promotion> __this__success = new ArrayList<Promotion>();
6059
        for (Promotion other_element : other.success) {
6060
          __this__success.add(new Promotion(other_element));
6061
        }
6062
        this.success = __this__success;
6063
      }
6064
      if (other.isSetPex()) {
6065
        this.pex = new PromotionException(other.pex);
6066
      }
6067
    }
6068
 
6069
    public getAllPromotions_result deepCopy() {
6070
      return new getAllPromotions_result(this);
6071
    }
6072
 
3430 rajveer 6073
    @Override
6074
    public void clear() {
6075
      this.success = null;
6076
      this.pex = null;
1982 varun.gupt 6077
    }
6078
 
6079
    public int getSuccessSize() {
6080
      return (this.success == null) ? 0 : this.success.size();
6081
    }
6082
 
6083
    public java.util.Iterator<Promotion> getSuccessIterator() {
6084
      return (this.success == null) ? null : this.success.iterator();
6085
    }
6086
 
6087
    public void addToSuccess(Promotion elem) {
6088
      if (this.success == null) {
6089
        this.success = new ArrayList<Promotion>();
6090
      }
6091
      this.success.add(elem);
6092
    }
6093
 
6094
    public List<Promotion> getSuccess() {
6095
      return this.success;
6096
    }
6097
 
3430 rajveer 6098
    public void setSuccess(List<Promotion> success) {
1982 varun.gupt 6099
      this.success = success;
6100
    }
6101
 
6102
    public void unsetSuccess() {
6103
      this.success = null;
6104
    }
6105
 
3430 rajveer 6106
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6107
    public boolean isSetSuccess() {
6108
      return this.success != null;
6109
    }
6110
 
6111
    public void setSuccessIsSet(boolean value) {
6112
      if (!value) {
6113
        this.success = null;
6114
      }
6115
    }
6116
 
6117
    public PromotionException getPex() {
6118
      return this.pex;
6119
    }
6120
 
3430 rajveer 6121
    public void setPex(PromotionException pex) {
1982 varun.gupt 6122
      this.pex = pex;
6123
    }
6124
 
6125
    public void unsetPex() {
6126
      this.pex = null;
6127
    }
6128
 
3430 rajveer 6129
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6130
    public boolean isSetPex() {
6131
      return this.pex != null;
6132
    }
6133
 
6134
    public void setPexIsSet(boolean value) {
6135
      if (!value) {
6136
        this.pex = null;
6137
      }
6138
    }
6139
 
6140
    public void setFieldValue(_Fields field, Object value) {
6141
      switch (field) {
6142
      case SUCCESS:
6143
        if (value == null) {
6144
          unsetSuccess();
6145
        } else {
6146
          setSuccess((List<Promotion>)value);
6147
        }
6148
        break;
6149
 
6150
      case PEX:
6151
        if (value == null) {
6152
          unsetPex();
6153
        } else {
6154
          setPex((PromotionException)value);
6155
        }
6156
        break;
6157
 
6158
      }
6159
    }
6160
 
6161
    public Object getFieldValue(_Fields field) {
6162
      switch (field) {
6163
      case SUCCESS:
6164
        return getSuccess();
6165
 
6166
      case PEX:
6167
        return getPex();
6168
 
6169
      }
6170
      throw new IllegalStateException();
6171
    }
6172
 
3430 rajveer 6173
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6174
    public boolean isSet(_Fields field) {
6175
      if (field == null) {
6176
        throw new IllegalArgumentException();
6177
      }
1982 varun.gupt 6178
 
6179
      switch (field) {
6180
      case SUCCESS:
6181
        return isSetSuccess();
6182
      case PEX:
6183
        return isSetPex();
6184
      }
6185
      throw new IllegalStateException();
6186
    }
6187
 
6188
    @Override
6189
    public boolean equals(Object that) {
6190
      if (that == null)
6191
        return false;
6192
      if (that instanceof getAllPromotions_result)
6193
        return this.equals((getAllPromotions_result)that);
6194
      return false;
6195
    }
6196
 
6197
    public boolean equals(getAllPromotions_result that) {
6198
      if (that == null)
6199
        return false;
6200
 
6201
      boolean this_present_success = true && this.isSetSuccess();
6202
      boolean that_present_success = true && that.isSetSuccess();
6203
      if (this_present_success || that_present_success) {
6204
        if (!(this_present_success && that_present_success))
6205
          return false;
6206
        if (!this.success.equals(that.success))
6207
          return false;
6208
      }
6209
 
6210
      boolean this_present_pex = true && this.isSetPex();
6211
      boolean that_present_pex = true && that.isSetPex();
6212
      if (this_present_pex || that_present_pex) {
6213
        if (!(this_present_pex && that_present_pex))
6214
          return false;
6215
        if (!this.pex.equals(that.pex))
6216
          return false;
6217
      }
6218
 
6219
      return true;
6220
    }
6221
 
6222
    @Override
6223
    public int hashCode() {
6224
      return 0;
6225
    }
6226
 
6227
    public int compareTo(getAllPromotions_result other) {
6228
      if (!getClass().equals(other.getClass())) {
6229
        return getClass().getName().compareTo(other.getClass().getName());
6230
      }
6231
 
6232
      int lastComparison = 0;
6233
      getAllPromotions_result typedOther = (getAllPromotions_result)other;
6234
 
3430 rajveer 6235
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 6236
      if (lastComparison != 0) {
6237
        return lastComparison;
6238
      }
3430 rajveer 6239
      if (isSetSuccess()) {
6240
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
6241
        if (lastComparison != 0) {
6242
          return lastComparison;
6243
        }
1982 varun.gupt 6244
      }
3430 rajveer 6245
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 6246
      if (lastComparison != 0) {
6247
        return lastComparison;
6248
      }
3430 rajveer 6249
      if (isSetPex()) {
6250
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
6251
        if (lastComparison != 0) {
6252
          return lastComparison;
6253
        }
1982 varun.gupt 6254
      }
6255
      return 0;
6256
    }
6257
 
3430 rajveer 6258
    public _Fields fieldForId(int fieldId) {
6259
      return _Fields.findByThriftId(fieldId);
6260
    }
6261
 
6262
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6263
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6264
      iprot.readStructBegin();
6265
      while (true)
6266
      {
6267
        field = iprot.readFieldBegin();
3430 rajveer 6268
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6269
          break;
6270
        }
3430 rajveer 6271
        switch (field.id) {
6272
          case 0: // SUCCESS
6273
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
6274
              {
5327 rajveer 6275
                org.apache.thrift.protocol.TList _list12 = iprot.readListBegin();
6276
                this.success = new ArrayList<Promotion>(_list12.size);
6277
                for (int _i13 = 0; _i13 < _list12.size; ++_i13)
1982 varun.gupt 6278
                {
5327 rajveer 6279
                  Promotion _elem14; // required
6280
                  _elem14 = new Promotion();
6281
                  _elem14.read(iprot);
6282
                  this.success.add(_elem14);
1982 varun.gupt 6283
                }
3430 rajveer 6284
                iprot.readListEnd();
1982 varun.gupt 6285
              }
3430 rajveer 6286
            } else { 
6287
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6288
            }
6289
            break;
6290
          case 1: // PEX
6291
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6292
              this.pex = new PromotionException();
6293
              this.pex.read(iprot);
6294
            } else { 
6295
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6296
            }
6297
            break;
6298
          default:
6299
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6300
        }
3430 rajveer 6301
        iprot.readFieldEnd();
1982 varun.gupt 6302
      }
6303
      iprot.readStructEnd();
6304
      validate();
6305
    }
6306
 
3430 rajveer 6307
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6308
      oprot.writeStructBegin(STRUCT_DESC);
6309
 
6310
      if (this.isSetSuccess()) {
6311
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
6312
        {
3430 rajveer 6313
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
5327 rajveer 6314
          for (Promotion _iter15 : this.success)
1982 varun.gupt 6315
          {
5327 rajveer 6316
            _iter15.write(oprot);
1982 varun.gupt 6317
          }
6318
          oprot.writeListEnd();
6319
        }
6320
        oprot.writeFieldEnd();
6321
      } else if (this.isSetPex()) {
6322
        oprot.writeFieldBegin(PEX_FIELD_DESC);
6323
        this.pex.write(oprot);
6324
        oprot.writeFieldEnd();
6325
      }
6326
      oprot.writeFieldStop();
6327
      oprot.writeStructEnd();
6328
    }
6329
 
6330
    @Override
6331
    public String toString() {
6332
      StringBuilder sb = new StringBuilder("getAllPromotions_result(");
6333
      boolean first = true;
6334
 
6335
      sb.append("success:");
6336
      if (this.success == null) {
6337
        sb.append("null");
6338
      } else {
6339
        sb.append(this.success);
6340
      }
6341
      first = false;
6342
      if (!first) sb.append(", ");
6343
      sb.append("pex:");
6344
      if (this.pex == null) {
6345
        sb.append("null");
6346
      } else {
6347
        sb.append(this.pex);
6348
      }
6349
      first = false;
6350
      sb.append(")");
6351
      return sb.toString();
6352
    }
6353
 
3430 rajveer 6354
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6355
      // check for required fields
6356
    }
6357
 
3430 rajveer 6358
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6359
      try {
6360
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6361
      } catch (org.apache.thrift.TException te) {
6362
        throw new java.io.IOException(te);
6363
      }
6364
    }
6365
 
6366
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6367
      try {
6368
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6369
      } catch (org.apache.thrift.TException te) {
6370
        throw new java.io.IOException(te);
6371
      }
6372
    }
6373
 
1982 varun.gupt 6374
  }
6375
 
3430 rajveer 6376
  public static class getPromotionById_args implements org.apache.thrift.TBase<getPromotionById_args, getPromotionById_args._Fields>, java.io.Serializable, Cloneable   {
6377
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_args");
1982 varun.gupt 6378
 
3430 rajveer 6379
    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 6380
 
3430 rajveer 6381
    private long promotionId; // required
1982 varun.gupt 6382
 
6383
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6384
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6385
      PROMOTION_ID((short)1, "promotionId");
6386
 
6387
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6388
 
6389
      static {
6390
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6391
          byName.put(field.getFieldName(), field);
6392
        }
6393
      }
6394
 
6395
      /**
6396
       * Find the _Fields constant that matches fieldId, or null if its not found.
6397
       */
6398
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6399
        switch(fieldId) {
6400
          case 1: // PROMOTION_ID
6401
            return PROMOTION_ID;
6402
          default:
6403
            return null;
6404
        }
1982 varun.gupt 6405
      }
6406
 
6407
      /**
6408
       * Find the _Fields constant that matches fieldId, throwing an exception
6409
       * if it is not found.
6410
       */
6411
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6412
        _Fields fields = findByThriftId(fieldId);
6413
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6414
        return fields;
6415
      }
6416
 
6417
      /**
6418
       * Find the _Fields constant that matches name, or null if its not found.
6419
       */
6420
      public static _Fields findByName(String name) {
6421
        return byName.get(name);
6422
      }
6423
 
6424
      private final short _thriftId;
6425
      private final String _fieldName;
6426
 
6427
      _Fields(short thriftId, String fieldName) {
6428
        _thriftId = thriftId;
6429
        _fieldName = fieldName;
6430
      }
6431
 
6432
      public short getThriftFieldId() {
6433
        return _thriftId;
6434
      }
6435
 
6436
      public String getFieldName() {
6437
        return _fieldName;
6438
      }
6439
    }
6440
 
6441
    // isset id assignments
6442
    private static final int __PROMOTIONID_ISSET_ID = 0;
6443
    private BitSet __isset_bit_vector = new BitSet(1);
6444
 
3430 rajveer 6445
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6446
    static {
3430 rajveer 6447
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6448
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6449
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6450
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6451
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_args.class, metaDataMap);
1982 varun.gupt 6452
    }
6453
 
6454
    public getPromotionById_args() {
6455
    }
6456
 
6457
    public getPromotionById_args(
6458
      long promotionId)
6459
    {
6460
      this();
6461
      this.promotionId = promotionId;
6462
      setPromotionIdIsSet(true);
6463
    }
6464
 
6465
    /**
6466
     * Performs a deep copy on <i>other</i>.
6467
     */
6468
    public getPromotionById_args(getPromotionById_args other) {
6469
      __isset_bit_vector.clear();
6470
      __isset_bit_vector.or(other.__isset_bit_vector);
6471
      this.promotionId = other.promotionId;
6472
    }
6473
 
6474
    public getPromotionById_args deepCopy() {
6475
      return new getPromotionById_args(this);
6476
    }
6477
 
3430 rajveer 6478
    @Override
6479
    public void clear() {
6480
      setPromotionIdIsSet(false);
6481
      this.promotionId = 0;
1982 varun.gupt 6482
    }
6483
 
6484
    public long getPromotionId() {
6485
      return this.promotionId;
6486
    }
6487
 
3430 rajveer 6488
    public void setPromotionId(long promotionId) {
1982 varun.gupt 6489
      this.promotionId = promotionId;
6490
      setPromotionIdIsSet(true);
6491
    }
6492
 
6493
    public void unsetPromotionId() {
6494
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
6495
    }
6496
 
3430 rajveer 6497
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6498
    public boolean isSetPromotionId() {
6499
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
6500
    }
6501
 
6502
    public void setPromotionIdIsSet(boolean value) {
6503
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
6504
    }
6505
 
6506
    public void setFieldValue(_Fields field, Object value) {
6507
      switch (field) {
6508
      case PROMOTION_ID:
6509
        if (value == null) {
6510
          unsetPromotionId();
6511
        } else {
6512
          setPromotionId((Long)value);
6513
        }
6514
        break;
6515
 
6516
      }
6517
    }
6518
 
6519
    public Object getFieldValue(_Fields field) {
6520
      switch (field) {
6521
      case PROMOTION_ID:
3430 rajveer 6522
        return Long.valueOf(getPromotionId());
1982 varun.gupt 6523
 
6524
      }
6525
      throw new IllegalStateException();
6526
    }
6527
 
3430 rajveer 6528
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6529
    public boolean isSet(_Fields field) {
6530
      if (field == null) {
6531
        throw new IllegalArgumentException();
6532
      }
1982 varun.gupt 6533
 
6534
      switch (field) {
6535
      case PROMOTION_ID:
6536
        return isSetPromotionId();
6537
      }
6538
      throw new IllegalStateException();
6539
    }
6540
 
6541
    @Override
6542
    public boolean equals(Object that) {
6543
      if (that == null)
6544
        return false;
6545
      if (that instanceof getPromotionById_args)
6546
        return this.equals((getPromotionById_args)that);
6547
      return false;
6548
    }
6549
 
6550
    public boolean equals(getPromotionById_args that) {
6551
      if (that == null)
6552
        return false;
6553
 
6554
      boolean this_present_promotionId = true;
6555
      boolean that_present_promotionId = true;
6556
      if (this_present_promotionId || that_present_promotionId) {
6557
        if (!(this_present_promotionId && that_present_promotionId))
6558
          return false;
6559
        if (this.promotionId != that.promotionId)
6560
          return false;
6561
      }
6562
 
6563
      return true;
6564
    }
6565
 
6566
    @Override
6567
    public int hashCode() {
6568
      return 0;
6569
    }
6570
 
6571
    public int compareTo(getPromotionById_args other) {
6572
      if (!getClass().equals(other.getClass())) {
6573
        return getClass().getName().compareTo(other.getClass().getName());
6574
      }
6575
 
6576
      int lastComparison = 0;
6577
      getPromotionById_args typedOther = (getPromotionById_args)other;
6578
 
3430 rajveer 6579
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 6580
      if (lastComparison != 0) {
6581
        return lastComparison;
6582
      }
3430 rajveer 6583
      if (isSetPromotionId()) {
6584
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
6585
        if (lastComparison != 0) {
6586
          return lastComparison;
6587
        }
1982 varun.gupt 6588
      }
6589
      return 0;
6590
    }
6591
 
3430 rajveer 6592
    public _Fields fieldForId(int fieldId) {
6593
      return _Fields.findByThriftId(fieldId);
6594
    }
6595
 
6596
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6597
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6598
      iprot.readStructBegin();
6599
      while (true)
6600
      {
6601
        field = iprot.readFieldBegin();
3430 rajveer 6602
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6603
          break;
6604
        }
3430 rajveer 6605
        switch (field.id) {
6606
          case 1: // PROMOTION_ID
6607
            if (field.type == org.apache.thrift.protocol.TType.I64) {
6608
              this.promotionId = iprot.readI64();
6609
              setPromotionIdIsSet(true);
6610
            } else { 
6611
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6612
            }
6613
            break;
6614
          default:
6615
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6616
        }
3430 rajveer 6617
        iprot.readFieldEnd();
1982 varun.gupt 6618
      }
6619
      iprot.readStructEnd();
6620
      validate();
6621
    }
6622
 
3430 rajveer 6623
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6624
      validate();
6625
 
6626
      oprot.writeStructBegin(STRUCT_DESC);
6627
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
6628
      oprot.writeI64(this.promotionId);
6629
      oprot.writeFieldEnd();
6630
      oprot.writeFieldStop();
6631
      oprot.writeStructEnd();
6632
    }
6633
 
6634
    @Override
6635
    public String toString() {
6636
      StringBuilder sb = new StringBuilder("getPromotionById_args(");
6637
      boolean first = true;
6638
 
6639
      sb.append("promotionId:");
6640
      sb.append(this.promotionId);
6641
      first = false;
6642
      sb.append(")");
6643
      return sb.toString();
6644
    }
6645
 
3430 rajveer 6646
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6647
      // check for required fields
6648
    }
6649
 
3430 rajveer 6650
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6651
      try {
6652
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6653
      } catch (org.apache.thrift.TException te) {
6654
        throw new java.io.IOException(te);
6655
      }
6656
    }
6657
 
6658
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6659
      try {
6660
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
6661
        __isset_bit_vector = new BitSet(1);
6662
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6663
      } catch (org.apache.thrift.TException te) {
6664
        throw new java.io.IOException(te);
6665
      }
6666
    }
6667
 
1982 varun.gupt 6668
  }
6669
 
3430 rajveer 6670
  public static class getPromotionById_result implements org.apache.thrift.TBase<getPromotionById_result, getPromotionById_result._Fields>, java.io.Serializable, Cloneable   {
6671
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_result");
1982 varun.gupt 6672
 
3430 rajveer 6673
    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);
6674
    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 6675
 
3430 rajveer 6676
    private Promotion success; // required
6677
    private PromotionException pex; // required
1982 varun.gupt 6678
 
6679
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6680
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6681
      SUCCESS((short)0, "success"),
6682
      PEX((short)1, "pex");
6683
 
6684
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6685
 
6686
      static {
6687
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6688
          byName.put(field.getFieldName(), field);
6689
        }
6690
      }
6691
 
6692
      /**
6693
       * Find the _Fields constant that matches fieldId, or null if its not found.
6694
       */
6695
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6696
        switch(fieldId) {
6697
          case 0: // SUCCESS
6698
            return SUCCESS;
6699
          case 1: // PEX
6700
            return PEX;
6701
          default:
6702
            return null;
6703
        }
1982 varun.gupt 6704
      }
6705
 
6706
      /**
6707
       * Find the _Fields constant that matches fieldId, throwing an exception
6708
       * if it is not found.
6709
       */
6710
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6711
        _Fields fields = findByThriftId(fieldId);
6712
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6713
        return fields;
6714
      }
6715
 
6716
      /**
6717
       * Find the _Fields constant that matches name, or null if its not found.
6718
       */
6719
      public static _Fields findByName(String name) {
6720
        return byName.get(name);
6721
      }
6722
 
6723
      private final short _thriftId;
6724
      private final String _fieldName;
6725
 
6726
      _Fields(short thriftId, String fieldName) {
6727
        _thriftId = thriftId;
6728
        _fieldName = fieldName;
6729
      }
6730
 
6731
      public short getThriftFieldId() {
6732
        return _thriftId;
6733
      }
6734
 
6735
      public String getFieldName() {
6736
        return _fieldName;
6737
      }
6738
    }
6739
 
6740
    // isset id assignments
6741
 
3430 rajveer 6742
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6743
    static {
3430 rajveer 6744
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6745
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6746
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class)));
6747
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6748
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
6749
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6750
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_result.class, metaDataMap);
1982 varun.gupt 6751
    }
6752
 
6753
    public getPromotionById_result() {
6754
    }
6755
 
6756
    public getPromotionById_result(
6757
      Promotion success,
6758
      PromotionException pex)
6759
    {
6760
      this();
6761
      this.success = success;
6762
      this.pex = pex;
6763
    }
6764
 
6765
    /**
6766
     * Performs a deep copy on <i>other</i>.
6767
     */
6768
    public getPromotionById_result(getPromotionById_result other) {
6769
      if (other.isSetSuccess()) {
6770
        this.success = new Promotion(other.success);
6771
      }
6772
      if (other.isSetPex()) {
6773
        this.pex = new PromotionException(other.pex);
6774
      }
6775
    }
6776
 
6777
    public getPromotionById_result deepCopy() {
6778
      return new getPromotionById_result(this);
6779
    }
6780
 
3430 rajveer 6781
    @Override
6782
    public void clear() {
6783
      this.success = null;
6784
      this.pex = null;
1982 varun.gupt 6785
    }
6786
 
6787
    public Promotion getSuccess() {
6788
      return this.success;
6789
    }
6790
 
3430 rajveer 6791
    public void setSuccess(Promotion success) {
1982 varun.gupt 6792
      this.success = success;
6793
    }
6794
 
6795
    public void unsetSuccess() {
6796
      this.success = null;
6797
    }
6798
 
3430 rajveer 6799
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6800
    public boolean isSetSuccess() {
6801
      return this.success != null;
6802
    }
6803
 
6804
    public void setSuccessIsSet(boolean value) {
6805
      if (!value) {
6806
        this.success = null;
6807
      }
6808
    }
6809
 
6810
    public PromotionException getPex() {
6811
      return this.pex;
6812
    }
6813
 
3430 rajveer 6814
    public void setPex(PromotionException pex) {
1982 varun.gupt 6815
      this.pex = pex;
6816
    }
6817
 
6818
    public void unsetPex() {
6819
      this.pex = null;
6820
    }
6821
 
3430 rajveer 6822
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6823
    public boolean isSetPex() {
6824
      return this.pex != null;
6825
    }
6826
 
6827
    public void setPexIsSet(boolean value) {
6828
      if (!value) {
6829
        this.pex = null;
6830
      }
6831
    }
6832
 
6833
    public void setFieldValue(_Fields field, Object value) {
6834
      switch (field) {
6835
      case SUCCESS:
6836
        if (value == null) {
6837
          unsetSuccess();
6838
        } else {
6839
          setSuccess((Promotion)value);
6840
        }
6841
        break;
6842
 
6843
      case PEX:
6844
        if (value == null) {
6845
          unsetPex();
6846
        } else {
6847
          setPex((PromotionException)value);
6848
        }
6849
        break;
6850
 
6851
      }
6852
    }
6853
 
6854
    public Object getFieldValue(_Fields field) {
6855
      switch (field) {
6856
      case SUCCESS:
6857
        return getSuccess();
6858
 
6859
      case PEX:
6860
        return getPex();
6861
 
6862
      }
6863
      throw new IllegalStateException();
6864
    }
6865
 
3430 rajveer 6866
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6867
    public boolean isSet(_Fields field) {
6868
      if (field == null) {
6869
        throw new IllegalArgumentException();
6870
      }
1982 varun.gupt 6871
 
6872
      switch (field) {
6873
      case SUCCESS:
6874
        return isSetSuccess();
6875
      case PEX:
6876
        return isSetPex();
6877
      }
6878
      throw new IllegalStateException();
6879
    }
6880
 
6881
    @Override
6882
    public boolean equals(Object that) {
6883
      if (that == null)
6884
        return false;
6885
      if (that instanceof getPromotionById_result)
6886
        return this.equals((getPromotionById_result)that);
6887
      return false;
6888
    }
6889
 
6890
    public boolean equals(getPromotionById_result that) {
6891
      if (that == null)
6892
        return false;
6893
 
6894
      boolean this_present_success = true && this.isSetSuccess();
6895
      boolean that_present_success = true && that.isSetSuccess();
6896
      if (this_present_success || that_present_success) {
6897
        if (!(this_present_success && that_present_success))
6898
          return false;
6899
        if (!this.success.equals(that.success))
6900
          return false;
6901
      }
6902
 
6903
      boolean this_present_pex = true && this.isSetPex();
6904
      boolean that_present_pex = true && that.isSetPex();
6905
      if (this_present_pex || that_present_pex) {
6906
        if (!(this_present_pex && that_present_pex))
6907
          return false;
6908
        if (!this.pex.equals(that.pex))
6909
          return false;
6910
      }
6911
 
6912
      return true;
6913
    }
6914
 
6915
    @Override
6916
    public int hashCode() {
6917
      return 0;
6918
    }
6919
 
6920
    public int compareTo(getPromotionById_result other) {
6921
      if (!getClass().equals(other.getClass())) {
6922
        return getClass().getName().compareTo(other.getClass().getName());
6923
      }
6924
 
6925
      int lastComparison = 0;
6926
      getPromotionById_result typedOther = (getPromotionById_result)other;
6927
 
3430 rajveer 6928
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 6929
      if (lastComparison != 0) {
6930
        return lastComparison;
6931
      }
3430 rajveer 6932
      if (isSetSuccess()) {
6933
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
6934
        if (lastComparison != 0) {
6935
          return lastComparison;
6936
        }
1982 varun.gupt 6937
      }
3430 rajveer 6938
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 6939
      if (lastComparison != 0) {
6940
        return lastComparison;
6941
      }
3430 rajveer 6942
      if (isSetPex()) {
6943
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
6944
        if (lastComparison != 0) {
6945
          return lastComparison;
6946
        }
1982 varun.gupt 6947
      }
6948
      return 0;
6949
    }
6950
 
3430 rajveer 6951
    public _Fields fieldForId(int fieldId) {
6952
      return _Fields.findByThriftId(fieldId);
6953
    }
6954
 
6955
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6956
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6957
      iprot.readStructBegin();
6958
      while (true)
6959
      {
6960
        field = iprot.readFieldBegin();
3430 rajveer 6961
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6962
          break;
6963
        }
3430 rajveer 6964
        switch (field.id) {
6965
          case 0: // SUCCESS
6966
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6967
              this.success = new Promotion();
6968
              this.success.read(iprot);
6969
            } else { 
6970
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6971
            }
6972
            break;
6973
          case 1: // PEX
6974
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6975
              this.pex = new PromotionException();
6976
              this.pex.read(iprot);
6977
            } else { 
6978
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6979
            }
6980
            break;
6981
          default:
6982
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6983
        }
3430 rajveer 6984
        iprot.readFieldEnd();
1982 varun.gupt 6985
      }
6986
      iprot.readStructEnd();
6987
      validate();
6988
    }
6989
 
3430 rajveer 6990
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6991
      oprot.writeStructBegin(STRUCT_DESC);
6992
 
6993
      if (this.isSetSuccess()) {
6994
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
6995
        this.success.write(oprot);
6996
        oprot.writeFieldEnd();
6997
      } else if (this.isSetPex()) {
6998
        oprot.writeFieldBegin(PEX_FIELD_DESC);
6999
        this.pex.write(oprot);
7000
        oprot.writeFieldEnd();
7001
      }
7002
      oprot.writeFieldStop();
7003
      oprot.writeStructEnd();
7004
    }
7005
 
7006
    @Override
7007
    public String toString() {
7008
      StringBuilder sb = new StringBuilder("getPromotionById_result(");
7009
      boolean first = true;
7010
 
7011
      sb.append("success:");
7012
      if (this.success == null) {
7013
        sb.append("null");
7014
      } else {
7015
        sb.append(this.success);
7016
      }
7017
      first = false;
7018
      if (!first) sb.append(", ");
7019
      sb.append("pex:");
7020
      if (this.pex == null) {
7021
        sb.append("null");
7022
      } else {
7023
        sb.append(this.pex);
7024
      }
7025
      first = false;
7026
      sb.append(")");
7027
      return sb.toString();
7028
    }
7029
 
3430 rajveer 7030
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7031
      // check for required fields
7032
    }
7033
 
3430 rajveer 7034
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7035
      try {
7036
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7037
      } catch (org.apache.thrift.TException te) {
7038
        throw new java.io.IOException(te);
7039
      }
7040
    }
7041
 
7042
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7043
      try {
7044
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7045
      } catch (org.apache.thrift.TException te) {
7046
        throw new java.io.IOException(te);
7047
      }
7048
    }
7049
 
1982 varun.gupt 7050
  }
7051
 
3430 rajveer 7052
  public static class generateCouponsForPromotion_args implements org.apache.thrift.TBase<generateCouponsForPromotion_args, generateCouponsForPromotion_args._Fields>, java.io.Serializable, Cloneable   {
7053
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_args");
1982 varun.gupt 7054
 
3430 rajveer 7055
    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);
7056
    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 7057
 
3430 rajveer 7058
    private long promotionId; // required
7059
    private String couponCode; // required
1982 varun.gupt 7060
 
7061
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7062
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 7063
      PROMOTION_ID((short)1, "promotionId"),
7064
      COUPON_CODE((short)2, "couponCode");
7065
 
7066
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7067
 
7068
      static {
7069
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7070
          byName.put(field.getFieldName(), field);
7071
        }
7072
      }
7073
 
7074
      /**
7075
       * Find the _Fields constant that matches fieldId, or null if its not found.
7076
       */
7077
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7078
        switch(fieldId) {
7079
          case 1: // PROMOTION_ID
7080
            return PROMOTION_ID;
7081
          case 2: // COUPON_CODE
7082
            return COUPON_CODE;
7083
          default:
7084
            return null;
7085
        }
1982 varun.gupt 7086
      }
7087
 
7088
      /**
7089
       * Find the _Fields constant that matches fieldId, throwing an exception
7090
       * if it is not found.
7091
       */
7092
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7093
        _Fields fields = findByThriftId(fieldId);
7094
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7095
        return fields;
7096
      }
7097
 
7098
      /**
7099
       * Find the _Fields constant that matches name, or null if its not found.
7100
       */
7101
      public static _Fields findByName(String name) {
7102
        return byName.get(name);
7103
      }
7104
 
7105
      private final short _thriftId;
7106
      private final String _fieldName;
7107
 
7108
      _Fields(short thriftId, String fieldName) {
7109
        _thriftId = thriftId;
7110
        _fieldName = fieldName;
7111
      }
7112
 
7113
      public short getThriftFieldId() {
7114
        return _thriftId;
7115
      }
7116
 
7117
      public String getFieldName() {
7118
        return _fieldName;
7119
      }
7120
    }
7121
 
7122
    // isset id assignments
7123
    private static final int __PROMOTIONID_ISSET_ID = 0;
7124
    private BitSet __isset_bit_vector = new BitSet(1);
7125
 
3430 rajveer 7126
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 7127
    static {
3430 rajveer 7128
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7129
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7130
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7131
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7132
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
7133
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7134
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_args.class, metaDataMap);
1982 varun.gupt 7135
    }
7136
 
7137
    public generateCouponsForPromotion_args() {
7138
    }
7139
 
7140
    public generateCouponsForPromotion_args(
7141
      long promotionId,
7142
      String couponCode)
7143
    {
7144
      this();
7145
      this.promotionId = promotionId;
7146
      setPromotionIdIsSet(true);
7147
      this.couponCode = couponCode;
7148
    }
7149
 
7150
    /**
7151
     * Performs a deep copy on <i>other</i>.
7152
     */
7153
    public generateCouponsForPromotion_args(generateCouponsForPromotion_args other) {
7154
      __isset_bit_vector.clear();
7155
      __isset_bit_vector.or(other.__isset_bit_vector);
7156
      this.promotionId = other.promotionId;
7157
      if (other.isSetCouponCode()) {
7158
        this.couponCode = other.couponCode;
7159
      }
7160
    }
7161
 
7162
    public generateCouponsForPromotion_args deepCopy() {
7163
      return new generateCouponsForPromotion_args(this);
7164
    }
7165
 
3430 rajveer 7166
    @Override
7167
    public void clear() {
7168
      setPromotionIdIsSet(false);
7169
      this.promotionId = 0;
7170
      this.couponCode = null;
1982 varun.gupt 7171
    }
7172
 
7173
    public long getPromotionId() {
7174
      return this.promotionId;
7175
    }
7176
 
3430 rajveer 7177
    public void setPromotionId(long promotionId) {
1982 varun.gupt 7178
      this.promotionId = promotionId;
7179
      setPromotionIdIsSet(true);
7180
    }
7181
 
7182
    public void unsetPromotionId() {
7183
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
7184
    }
7185
 
3430 rajveer 7186
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7187
    public boolean isSetPromotionId() {
7188
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
7189
    }
7190
 
7191
    public void setPromotionIdIsSet(boolean value) {
7192
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
7193
    }
7194
 
7195
    public String getCouponCode() {
7196
      return this.couponCode;
7197
    }
7198
 
3430 rajveer 7199
    public void setCouponCode(String couponCode) {
1982 varun.gupt 7200
      this.couponCode = couponCode;
7201
    }
7202
 
7203
    public void unsetCouponCode() {
7204
      this.couponCode = null;
7205
    }
7206
 
3430 rajveer 7207
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7208
    public boolean isSetCouponCode() {
7209
      return this.couponCode != null;
7210
    }
7211
 
7212
    public void setCouponCodeIsSet(boolean value) {
7213
      if (!value) {
7214
        this.couponCode = null;
7215
      }
7216
    }
7217
 
7218
    public void setFieldValue(_Fields field, Object value) {
7219
      switch (field) {
7220
      case PROMOTION_ID:
7221
        if (value == null) {
7222
          unsetPromotionId();
7223
        } else {
7224
          setPromotionId((Long)value);
7225
        }
7226
        break;
7227
 
7228
      case COUPON_CODE:
7229
        if (value == null) {
7230
          unsetCouponCode();
7231
        } else {
7232
          setCouponCode((String)value);
7233
        }
7234
        break;
7235
 
7236
      }
7237
    }
7238
 
7239
    public Object getFieldValue(_Fields field) {
7240
      switch (field) {
7241
      case PROMOTION_ID:
3430 rajveer 7242
        return Long.valueOf(getPromotionId());
1982 varun.gupt 7243
 
7244
      case COUPON_CODE:
7245
        return getCouponCode();
7246
 
7247
      }
7248
      throw new IllegalStateException();
7249
    }
7250
 
3430 rajveer 7251
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7252
    public boolean isSet(_Fields field) {
7253
      if (field == null) {
7254
        throw new IllegalArgumentException();
7255
      }
1982 varun.gupt 7256
 
7257
      switch (field) {
7258
      case PROMOTION_ID:
7259
        return isSetPromotionId();
7260
      case COUPON_CODE:
7261
        return isSetCouponCode();
7262
      }
7263
      throw new IllegalStateException();
7264
    }
7265
 
7266
    @Override
7267
    public boolean equals(Object that) {
7268
      if (that == null)
7269
        return false;
7270
      if (that instanceof generateCouponsForPromotion_args)
7271
        return this.equals((generateCouponsForPromotion_args)that);
7272
      return false;
7273
    }
7274
 
7275
    public boolean equals(generateCouponsForPromotion_args that) {
7276
      if (that == null)
7277
        return false;
7278
 
7279
      boolean this_present_promotionId = true;
7280
      boolean that_present_promotionId = true;
7281
      if (this_present_promotionId || that_present_promotionId) {
7282
        if (!(this_present_promotionId && that_present_promotionId))
7283
          return false;
7284
        if (this.promotionId != that.promotionId)
7285
          return false;
7286
      }
7287
 
7288
      boolean this_present_couponCode = true && this.isSetCouponCode();
7289
      boolean that_present_couponCode = true && that.isSetCouponCode();
7290
      if (this_present_couponCode || that_present_couponCode) {
7291
        if (!(this_present_couponCode && that_present_couponCode))
7292
          return false;
7293
        if (!this.couponCode.equals(that.couponCode))
7294
          return false;
7295
      }
7296
 
7297
      return true;
7298
    }
7299
 
7300
    @Override
7301
    public int hashCode() {
7302
      return 0;
7303
    }
7304
 
7305
    public int compareTo(generateCouponsForPromotion_args other) {
7306
      if (!getClass().equals(other.getClass())) {
7307
        return getClass().getName().compareTo(other.getClass().getName());
7308
      }
7309
 
7310
      int lastComparison = 0;
7311
      generateCouponsForPromotion_args typedOther = (generateCouponsForPromotion_args)other;
7312
 
3430 rajveer 7313
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 7314
      if (lastComparison != 0) {
7315
        return lastComparison;
7316
      }
3430 rajveer 7317
      if (isSetPromotionId()) {
7318
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
7319
        if (lastComparison != 0) {
7320
          return lastComparison;
7321
        }
1982 varun.gupt 7322
      }
3430 rajveer 7323
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 7324
      if (lastComparison != 0) {
7325
        return lastComparison;
7326
      }
3430 rajveer 7327
      if (isSetCouponCode()) {
7328
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
7329
        if (lastComparison != 0) {
7330
          return lastComparison;
7331
        }
1982 varun.gupt 7332
      }
7333
      return 0;
7334
    }
7335
 
3430 rajveer 7336
    public _Fields fieldForId(int fieldId) {
7337
      return _Fields.findByThriftId(fieldId);
7338
    }
7339
 
7340
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7341
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 7342
      iprot.readStructBegin();
7343
      while (true)
7344
      {
7345
        field = iprot.readFieldBegin();
3430 rajveer 7346
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 7347
          break;
7348
        }
3430 rajveer 7349
        switch (field.id) {
7350
          case 1: // PROMOTION_ID
7351
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7352
              this.promotionId = iprot.readI64();
7353
              setPromotionIdIsSet(true);
7354
            } else { 
7355
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7356
            }
7357
            break;
7358
          case 2: // COUPON_CODE
7359
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
7360
              this.couponCode = iprot.readString();
7361
            } else { 
7362
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7363
            }
7364
            break;
7365
          default:
7366
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 7367
        }
3430 rajveer 7368
        iprot.readFieldEnd();
1982 varun.gupt 7369
      }
7370
      iprot.readStructEnd();
7371
      validate();
7372
    }
7373
 
3430 rajveer 7374
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 7375
      validate();
7376
 
7377
      oprot.writeStructBegin(STRUCT_DESC);
7378
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
7379
      oprot.writeI64(this.promotionId);
7380
      oprot.writeFieldEnd();
7381
      if (this.couponCode != null) {
7382
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
7383
        oprot.writeString(this.couponCode);
7384
        oprot.writeFieldEnd();
7385
      }
7386
      oprot.writeFieldStop();
7387
      oprot.writeStructEnd();
7388
    }
7389
 
7390
    @Override
7391
    public String toString() {
7392
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_args(");
7393
      boolean first = true;
7394
 
7395
      sb.append("promotionId:");
7396
      sb.append(this.promotionId);
7397
      first = false;
7398
      if (!first) sb.append(", ");
7399
      sb.append("couponCode:");
7400
      if (this.couponCode == null) {
7401
        sb.append("null");
7402
      } else {
7403
        sb.append(this.couponCode);
7404
      }
7405
      first = false;
7406
      sb.append(")");
7407
      return sb.toString();
7408
    }
7409
 
3430 rajveer 7410
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7411
      // check for required fields
7412
    }
7413
 
3430 rajveer 7414
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7415
      try {
7416
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7417
      } catch (org.apache.thrift.TException te) {
7418
        throw new java.io.IOException(te);
7419
      }
7420
    }
7421
 
7422
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7423
      try {
7424
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
7425
        __isset_bit_vector = new BitSet(1);
7426
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7427
      } catch (org.apache.thrift.TException te) {
7428
        throw new java.io.IOException(te);
7429
      }
7430
    }
7431
 
1982 varun.gupt 7432
  }
7433
 
3430 rajveer 7434
  public static class generateCouponsForPromotion_result implements org.apache.thrift.TBase<generateCouponsForPromotion_result, generateCouponsForPromotion_result._Fields>, java.io.Serializable, Cloneable   {
7435
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_result");
1982 varun.gupt 7436
 
3430 rajveer 7437
    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 7438
 
3430 rajveer 7439
    private PromotionException pex; // required
1982 varun.gupt 7440
 
7441
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7442
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 7443
      PEX((short)1, "pex");
7444
 
7445
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7446
 
7447
      static {
7448
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7449
          byName.put(field.getFieldName(), field);
7450
        }
7451
      }
7452
 
7453
      /**
7454
       * Find the _Fields constant that matches fieldId, or null if its not found.
7455
       */
7456
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7457
        switch(fieldId) {
7458
          case 1: // PEX
7459
            return PEX;
7460
          default:
7461
            return null;
7462
        }
1982 varun.gupt 7463
      }
7464
 
7465
      /**
7466
       * Find the _Fields constant that matches fieldId, throwing an exception
7467
       * if it is not found.
7468
       */
7469
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7470
        _Fields fields = findByThriftId(fieldId);
7471
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7472
        return fields;
7473
      }
7474
 
7475
      /**
7476
       * Find the _Fields constant that matches name, or null if its not found.
7477
       */
7478
      public static _Fields findByName(String name) {
7479
        return byName.get(name);
7480
      }
7481
 
7482
      private final short _thriftId;
7483
      private final String _fieldName;
7484
 
7485
      _Fields(short thriftId, String fieldName) {
7486
        _thriftId = thriftId;
7487
        _fieldName = fieldName;
7488
      }
7489
 
7490
      public short getThriftFieldId() {
7491
        return _thriftId;
7492
      }
7493
 
7494
      public String getFieldName() {
7495
        return _fieldName;
7496
      }
7497
    }
7498
 
7499
    // isset id assignments
7500
 
3430 rajveer 7501
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 7502
    static {
3430 rajveer 7503
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7504
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7505
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
7506
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7507
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_result.class, metaDataMap);
1982 varun.gupt 7508
    }
7509
 
7510
    public generateCouponsForPromotion_result() {
7511
    }
7512
 
7513
    public generateCouponsForPromotion_result(
7514
      PromotionException pex)
7515
    {
7516
      this();
7517
      this.pex = pex;
7518
    }
7519
 
7520
    /**
7521
     * Performs a deep copy on <i>other</i>.
7522
     */
7523
    public generateCouponsForPromotion_result(generateCouponsForPromotion_result other) {
7524
      if (other.isSetPex()) {
7525
        this.pex = new PromotionException(other.pex);
7526
      }
7527
    }
7528
 
7529
    public generateCouponsForPromotion_result deepCopy() {
7530
      return new generateCouponsForPromotion_result(this);
7531
    }
7532
 
3430 rajveer 7533
    @Override
7534
    public void clear() {
7535
      this.pex = null;
1982 varun.gupt 7536
    }
7537
 
7538
    public PromotionException getPex() {
7539
      return this.pex;
7540
    }
7541
 
3430 rajveer 7542
    public void setPex(PromotionException pex) {
1982 varun.gupt 7543
      this.pex = pex;
7544
    }
7545
 
7546
    public void unsetPex() {
7547
      this.pex = null;
7548
    }
7549
 
3430 rajveer 7550
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7551
    public boolean isSetPex() {
7552
      return this.pex != null;
7553
    }
7554
 
7555
    public void setPexIsSet(boolean value) {
7556
      if (!value) {
7557
        this.pex = null;
7558
      }
7559
    }
7560
 
7561
    public void setFieldValue(_Fields field, Object value) {
7562
      switch (field) {
7563
      case PEX:
7564
        if (value == null) {
7565
          unsetPex();
7566
        } else {
7567
          setPex((PromotionException)value);
7568
        }
7569
        break;
7570
 
7571
      }
7572
    }
7573
 
7574
    public Object getFieldValue(_Fields field) {
7575
      switch (field) {
7576
      case PEX:
7577
        return getPex();
7578
 
7579
      }
7580
      throw new IllegalStateException();
7581
    }
7582
 
3430 rajveer 7583
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7584
    public boolean isSet(_Fields field) {
7585
      if (field == null) {
7586
        throw new IllegalArgumentException();
7587
      }
1982 varun.gupt 7588
 
7589
      switch (field) {
7590
      case PEX:
7591
        return isSetPex();
7592
      }
7593
      throw new IllegalStateException();
7594
    }
7595
 
7596
    @Override
7597
    public boolean equals(Object that) {
7598
      if (that == null)
7599
        return false;
7600
      if (that instanceof generateCouponsForPromotion_result)
7601
        return this.equals((generateCouponsForPromotion_result)that);
7602
      return false;
7603
    }
7604
 
7605
    public boolean equals(generateCouponsForPromotion_result that) {
7606
      if (that == null)
7607
        return false;
7608
 
7609
      boolean this_present_pex = true && this.isSetPex();
7610
      boolean that_present_pex = true && that.isSetPex();
7611
      if (this_present_pex || that_present_pex) {
7612
        if (!(this_present_pex && that_present_pex))
7613
          return false;
7614
        if (!this.pex.equals(that.pex))
7615
          return false;
7616
      }
7617
 
7618
      return true;
7619
    }
7620
 
7621
    @Override
7622
    public int hashCode() {
7623
      return 0;
7624
    }
7625
 
7626
    public int compareTo(generateCouponsForPromotion_result other) {
7627
      if (!getClass().equals(other.getClass())) {
7628
        return getClass().getName().compareTo(other.getClass().getName());
7629
      }
7630
 
7631
      int lastComparison = 0;
7632
      generateCouponsForPromotion_result typedOther = (generateCouponsForPromotion_result)other;
7633
 
3430 rajveer 7634
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 7635
      if (lastComparison != 0) {
7636
        return lastComparison;
7637
      }
3430 rajveer 7638
      if (isSetPex()) {
7639
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
7640
        if (lastComparison != 0) {
7641
          return lastComparison;
7642
        }
1982 varun.gupt 7643
      }
7644
      return 0;
7645
    }
7646
 
3430 rajveer 7647
    public _Fields fieldForId(int fieldId) {
7648
      return _Fields.findByThriftId(fieldId);
7649
    }
7650
 
7651
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7652
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 7653
      iprot.readStructBegin();
7654
      while (true)
7655
      {
7656
        field = iprot.readFieldBegin();
3430 rajveer 7657
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 7658
          break;
7659
        }
3430 rajveer 7660
        switch (field.id) {
7661
          case 1: // PEX
7662
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
7663
              this.pex = new PromotionException();
7664
              this.pex.read(iprot);
7665
            } else { 
7666
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7667
            }
7668
            break;
7669
          default:
7670
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 7671
        }
3430 rajveer 7672
        iprot.readFieldEnd();
1982 varun.gupt 7673
      }
7674
      iprot.readStructEnd();
7675
      validate();
7676
    }
7677
 
3430 rajveer 7678
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 7679
      oprot.writeStructBegin(STRUCT_DESC);
7680
 
7681
      if (this.isSetPex()) {
7682
        oprot.writeFieldBegin(PEX_FIELD_DESC);
7683
        this.pex.write(oprot);
7684
        oprot.writeFieldEnd();
7685
      }
7686
      oprot.writeFieldStop();
7687
      oprot.writeStructEnd();
7688
    }
7689
 
7690
    @Override
7691
    public String toString() {
7692
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_result(");
7693
      boolean first = true;
7694
 
7695
      sb.append("pex:");
7696
      if (this.pex == null) {
7697
        sb.append("null");
7698
      } else {
7699
        sb.append(this.pex);
7700
      }
7701
      first = false;
7702
      sb.append(")");
7703
      return sb.toString();
7704
    }
7705
 
3430 rajveer 7706
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7707
      // check for required fields
7708
    }
7709
 
3430 rajveer 7710
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7711
      try {
7712
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7713
      } catch (org.apache.thrift.TException te) {
7714
        throw new java.io.IOException(te);
7715
      }
7716
    }
7717
 
7718
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7719
      try {
7720
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7721
      } catch (org.apache.thrift.TException te) {
7722
        throw new java.io.IOException(te);
7723
      }
7724
    }
7725
 
1982 varun.gupt 7726
  }
7727
 
3430 rajveer 7728
  public static class applyCoupon_args implements org.apache.thrift.TBase<applyCoupon_args, applyCoupon_args._Fields>, java.io.Serializable, Cloneable   {
7729
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_args");
1982 varun.gupt 7730
 
3430 rajveer 7731
    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);
7732
    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 7733
 
3430 rajveer 7734
    private String couponCode; // required
7735
    private long cartId; // required
1982 varun.gupt 7736
 
7737
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7738
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 7739
      COUPON_CODE((short)1, "couponCode"),
7740
      CART_ID((short)2, "cartId");
7741
 
7742
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7743
 
7744
      static {
7745
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7746
          byName.put(field.getFieldName(), field);
7747
        }
7748
      }
7749
 
7750
      /**
7751
       * Find the _Fields constant that matches fieldId, or null if its not found.
7752
       */
7753
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7754
        switch(fieldId) {
7755
          case 1: // COUPON_CODE
7756
            return COUPON_CODE;
7757
          case 2: // CART_ID
7758
            return CART_ID;
7759
          default:
7760
            return null;
7761
        }
1982 varun.gupt 7762
      }
7763
 
7764
      /**
7765
       * Find the _Fields constant that matches fieldId, throwing an exception
7766
       * if it is not found.
7767
       */
7768
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7769
        _Fields fields = findByThriftId(fieldId);
7770
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7771
        return fields;
7772
      }
7773
 
7774
      /**
7775
       * Find the _Fields constant that matches name, or null if its not found.
7776
       */
7777
      public static _Fields findByName(String name) {
7778
        return byName.get(name);
7779
      }
7780
 
7781
      private final short _thriftId;
7782
      private final String _fieldName;
7783
 
7784
      _Fields(short thriftId, String fieldName) {
7785
        _thriftId = thriftId;
7786
        _fieldName = fieldName;
7787
      }
7788
 
7789
      public short getThriftFieldId() {
7790
        return _thriftId;
7791
      }
7792
 
7793
      public String getFieldName() {
7794
        return _fieldName;
7795
      }
7796
    }
7797
 
7798
    // isset id assignments
7799
    private static final int __CARTID_ISSET_ID = 0;
7800
    private BitSet __isset_bit_vector = new BitSet(1);
7801
 
3430 rajveer 7802
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 7803
    static {
3430 rajveer 7804
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7805
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7806
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
7807
      tmpMap.put(_Fields.CART_ID, new org.apache.thrift.meta_data.FieldMetaData("cartId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7808
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7809
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7810
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_args.class, metaDataMap);
1982 varun.gupt 7811
    }
7812
 
7813
    public applyCoupon_args() {
7814
    }
7815
 
7816
    public applyCoupon_args(
7817
      String couponCode,
7818
      long cartId)
7819
    {
7820
      this();
7821
      this.couponCode = couponCode;
7822
      this.cartId = cartId;
7823
      setCartIdIsSet(true);
7824
    }
7825
 
7826
    /**
7827
     * Performs a deep copy on <i>other</i>.
7828
     */
7829
    public applyCoupon_args(applyCoupon_args other) {
7830
      __isset_bit_vector.clear();
7831
      __isset_bit_vector.or(other.__isset_bit_vector);
7832
      if (other.isSetCouponCode()) {
7833
        this.couponCode = other.couponCode;
7834
      }
7835
      this.cartId = other.cartId;
7836
    }
7837
 
7838
    public applyCoupon_args deepCopy() {
7839
      return new applyCoupon_args(this);
7840
    }
7841
 
3430 rajveer 7842
    @Override
7843
    public void clear() {
7844
      this.couponCode = null;
7845
      setCartIdIsSet(false);
7846
      this.cartId = 0;
1982 varun.gupt 7847
    }
7848
 
7849
    public String getCouponCode() {
7850
      return this.couponCode;
7851
    }
7852
 
3430 rajveer 7853
    public void setCouponCode(String couponCode) {
1982 varun.gupt 7854
      this.couponCode = couponCode;
7855
    }
7856
 
7857
    public void unsetCouponCode() {
7858
      this.couponCode = null;
7859
    }
7860
 
3430 rajveer 7861
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7862
    public boolean isSetCouponCode() {
7863
      return this.couponCode != null;
7864
    }
7865
 
7866
    public void setCouponCodeIsSet(boolean value) {
7867
      if (!value) {
7868
        this.couponCode = null;
7869
      }
7870
    }
7871
 
7872
    public long getCartId() {
7873
      return this.cartId;
7874
    }
7875
 
3430 rajveer 7876
    public void setCartId(long cartId) {
1982 varun.gupt 7877
      this.cartId = cartId;
7878
      setCartIdIsSet(true);
7879
    }
7880
 
7881
    public void unsetCartId() {
7882
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
7883
    }
7884
 
3430 rajveer 7885
    /** Returns true if field cartId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7886
    public boolean isSetCartId() {
7887
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
7888
    }
7889
 
7890
    public void setCartIdIsSet(boolean value) {
7891
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
7892
    }
7893
 
7894
    public void setFieldValue(_Fields field, Object value) {
7895
      switch (field) {
7896
      case COUPON_CODE:
7897
        if (value == null) {
7898
          unsetCouponCode();
7899
        } else {
7900
          setCouponCode((String)value);
7901
        }
7902
        break;
7903
 
7904
      case CART_ID:
7905
        if (value == null) {
7906
          unsetCartId();
7907
        } else {
7908
          setCartId((Long)value);
7909
        }
7910
        break;
7911
 
7912
      }
7913
    }
7914
 
7915
    public Object getFieldValue(_Fields field) {
7916
      switch (field) {
7917
      case COUPON_CODE:
7918
        return getCouponCode();
7919
 
7920
      case CART_ID:
3430 rajveer 7921
        return Long.valueOf(getCartId());
1982 varun.gupt 7922
 
7923
      }
7924
      throw new IllegalStateException();
7925
    }
7926
 
3430 rajveer 7927
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7928
    public boolean isSet(_Fields field) {
7929
      if (field == null) {
7930
        throw new IllegalArgumentException();
7931
      }
1982 varun.gupt 7932
 
7933
      switch (field) {
7934
      case COUPON_CODE:
7935
        return isSetCouponCode();
7936
      case CART_ID:
7937
        return isSetCartId();
7938
      }
7939
      throw new IllegalStateException();
7940
    }
7941
 
7942
    @Override
7943
    public boolean equals(Object that) {
7944
      if (that == null)
7945
        return false;
7946
      if (that instanceof applyCoupon_args)
7947
        return this.equals((applyCoupon_args)that);
7948
      return false;
7949
    }
7950
 
7951
    public boolean equals(applyCoupon_args that) {
7952
      if (that == null)
7953
        return false;
7954
 
7955
      boolean this_present_couponCode = true && this.isSetCouponCode();
7956
      boolean that_present_couponCode = true && that.isSetCouponCode();
7957
      if (this_present_couponCode || that_present_couponCode) {
7958
        if (!(this_present_couponCode && that_present_couponCode))
7959
          return false;
7960
        if (!this.couponCode.equals(that.couponCode))
7961
          return false;
7962
      }
7963
 
7964
      boolean this_present_cartId = true;
7965
      boolean that_present_cartId = true;
7966
      if (this_present_cartId || that_present_cartId) {
7967
        if (!(this_present_cartId && that_present_cartId))
7968
          return false;
7969
        if (this.cartId != that.cartId)
7970
          return false;
7971
      }
7972
 
7973
      return true;
7974
    }
7975
 
7976
    @Override
7977
    public int hashCode() {
7978
      return 0;
7979
    }
7980
 
7981
    public int compareTo(applyCoupon_args other) {
7982
      if (!getClass().equals(other.getClass())) {
7983
        return getClass().getName().compareTo(other.getClass().getName());
7984
      }
7985
 
7986
      int lastComparison = 0;
7987
      applyCoupon_args typedOther = (applyCoupon_args)other;
7988
 
3430 rajveer 7989
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 7990
      if (lastComparison != 0) {
7991
        return lastComparison;
7992
      }
3430 rajveer 7993
      if (isSetCouponCode()) {
7994
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
7995
        if (lastComparison != 0) {
7996
          return lastComparison;
7997
        }
1982 varun.gupt 7998
      }
3430 rajveer 7999
      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(typedOther.isSetCartId());
1982 varun.gupt 8000
      if (lastComparison != 0) {
8001
        return lastComparison;
8002
      }
3430 rajveer 8003
      if (isSetCartId()) {
8004
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cartId, typedOther.cartId);
8005
        if (lastComparison != 0) {
8006
          return lastComparison;
8007
        }
1982 varun.gupt 8008
      }
8009
      return 0;
8010
    }
8011
 
3430 rajveer 8012
    public _Fields fieldForId(int fieldId) {
8013
      return _Fields.findByThriftId(fieldId);
8014
    }
8015
 
8016
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8017
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 8018
      iprot.readStructBegin();
8019
      while (true)
8020
      {
8021
        field = iprot.readFieldBegin();
3430 rajveer 8022
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 8023
          break;
8024
        }
3430 rajveer 8025
        switch (field.id) {
8026
          case 1: // COUPON_CODE
8027
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
8028
              this.couponCode = iprot.readString();
8029
            } else { 
8030
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8031
            }
8032
            break;
8033
          case 2: // CART_ID
8034
            if (field.type == org.apache.thrift.protocol.TType.I64) {
8035
              this.cartId = iprot.readI64();
8036
              setCartIdIsSet(true);
8037
            } else { 
8038
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8039
            }
8040
            break;
8041
          default:
8042
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 8043
        }
3430 rajveer 8044
        iprot.readFieldEnd();
1982 varun.gupt 8045
      }
8046
      iprot.readStructEnd();
8047
      validate();
8048
    }
8049
 
3430 rajveer 8050
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 8051
      validate();
8052
 
8053
      oprot.writeStructBegin(STRUCT_DESC);
8054
      if (this.couponCode != null) {
8055
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
8056
        oprot.writeString(this.couponCode);
8057
        oprot.writeFieldEnd();
8058
      }
8059
      oprot.writeFieldBegin(CART_ID_FIELD_DESC);
8060
      oprot.writeI64(this.cartId);
8061
      oprot.writeFieldEnd();
8062
      oprot.writeFieldStop();
8063
      oprot.writeStructEnd();
8064
    }
8065
 
8066
    @Override
8067
    public String toString() {
8068
      StringBuilder sb = new StringBuilder("applyCoupon_args(");
8069
      boolean first = true;
8070
 
8071
      sb.append("couponCode:");
8072
      if (this.couponCode == null) {
8073
        sb.append("null");
8074
      } else {
8075
        sb.append(this.couponCode);
8076
      }
8077
      first = false;
8078
      if (!first) sb.append(", ");
8079
      sb.append("cartId:");
8080
      sb.append(this.cartId);
8081
      first = false;
8082
      sb.append(")");
8083
      return sb.toString();
8084
    }
8085
 
3430 rajveer 8086
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 8087
      // check for required fields
8088
    }
8089
 
3430 rajveer 8090
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8091
      try {
8092
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8093
      } catch (org.apache.thrift.TException te) {
8094
        throw new java.io.IOException(te);
8095
      }
8096
    }
8097
 
8098
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8099
      try {
8100
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
8101
        __isset_bit_vector = new BitSet(1);
8102
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8103
      } catch (org.apache.thrift.TException te) {
8104
        throw new java.io.IOException(te);
8105
      }
8106
    }
8107
 
1982 varun.gupt 8108
  }
8109
 
3430 rajveer 8110
  public static class applyCoupon_result implements org.apache.thrift.TBase<applyCoupon_result, applyCoupon_result._Fields>, java.io.Serializable, Cloneable   {
8111
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_result");
1982 varun.gupt 8112
 
3430 rajveer 8113
    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);
8114
    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 8115
 
3430 rajveer 8116
    private Cart success; // required
8117
    private PromotionException pex; // required
1982 varun.gupt 8118
 
8119
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 8120
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 8121
      SUCCESS((short)0, "success"),
8122
      PEX((short)1, "pex");
8123
 
8124
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8125
 
8126
      static {
8127
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8128
          byName.put(field.getFieldName(), field);
8129
        }
8130
      }
8131
 
8132
      /**
8133
       * Find the _Fields constant that matches fieldId, or null if its not found.
8134
       */
8135
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 8136
        switch(fieldId) {
8137
          case 0: // SUCCESS
8138
            return SUCCESS;
8139
          case 1: // PEX
8140
            return PEX;
8141
          default:
8142
            return null;
8143
        }
1982 varun.gupt 8144
      }
8145
 
8146
      /**
8147
       * Find the _Fields constant that matches fieldId, throwing an exception
8148
       * if it is not found.
8149
       */
8150
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8151
        _Fields fields = findByThriftId(fieldId);
8152
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8153
        return fields;
8154
      }
8155
 
8156
      /**
8157
       * Find the _Fields constant that matches name, or null if its not found.
8158
       */
8159
      public static _Fields findByName(String name) {
8160
        return byName.get(name);
8161
      }
8162
 
8163
      private final short _thriftId;
8164
      private final String _fieldName;
8165
 
8166
      _Fields(short thriftId, String fieldName) {
8167
        _thriftId = thriftId;
8168
        _fieldName = fieldName;
8169
      }
8170
 
8171
      public short getThriftFieldId() {
8172
        return _thriftId;
8173
      }
8174
 
8175
      public String getFieldName() {
8176
        return _fieldName;
8177
      }
8178
    }
8179
 
8180
    // isset id assignments
8181
 
3430 rajveer 8182
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 8183
    static {
3430 rajveer 8184
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8185
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8186
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Cart.class)));
8187
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8188
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
8189
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8190
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_result.class, metaDataMap);
1982 varun.gupt 8191
    }
8192
 
8193
    public applyCoupon_result() {
8194
    }
8195
 
8196
    public applyCoupon_result(
8197
      Cart success,
8198
      PromotionException pex)
8199
    {
8200
      this();
8201
      this.success = success;
8202
      this.pex = pex;
8203
    }
8204
 
8205
    /**
8206
     * Performs a deep copy on <i>other</i>.
8207
     */
8208
    public applyCoupon_result(applyCoupon_result other) {
8209
      if (other.isSetSuccess()) {
8210
        this.success = new Cart(other.success);
8211
      }
8212
      if (other.isSetPex()) {
8213
        this.pex = new PromotionException(other.pex);
8214
      }
8215
    }
8216
 
8217
    public applyCoupon_result deepCopy() {
8218
      return new applyCoupon_result(this);
8219
    }
8220
 
3430 rajveer 8221
    @Override
8222
    public void clear() {
8223
      this.success = null;
8224
      this.pex = null;
1982 varun.gupt 8225
    }
8226
 
8227
    public Cart getSuccess() {
8228
      return this.success;
8229
    }
8230
 
3430 rajveer 8231
    public void setSuccess(Cart success) {
1982 varun.gupt 8232
      this.success = success;
8233
    }
8234
 
8235
    public void unsetSuccess() {
8236
      this.success = null;
8237
    }
8238
 
3430 rajveer 8239
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 8240
    public boolean isSetSuccess() {
8241
      return this.success != null;
8242
    }
8243
 
8244
    public void setSuccessIsSet(boolean value) {
8245
      if (!value) {
8246
        this.success = null;
8247
      }
8248
    }
8249
 
8250
    public PromotionException getPex() {
8251
      return this.pex;
8252
    }
8253
 
3430 rajveer 8254
    public void setPex(PromotionException pex) {
1982 varun.gupt 8255
      this.pex = pex;
8256
    }
8257
 
8258
    public void unsetPex() {
8259
      this.pex = null;
8260
    }
8261
 
3430 rajveer 8262
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 8263
    public boolean isSetPex() {
8264
      return this.pex != null;
8265
    }
8266
 
8267
    public void setPexIsSet(boolean value) {
8268
      if (!value) {
8269
        this.pex = null;
8270
      }
8271
    }
8272
 
8273
    public void setFieldValue(_Fields field, Object value) {
8274
      switch (field) {
8275
      case SUCCESS:
8276
        if (value == null) {
8277
          unsetSuccess();
8278
        } else {
8279
          setSuccess((Cart)value);
8280
        }
8281
        break;
8282
 
8283
      case PEX:
8284
        if (value == null) {
8285
          unsetPex();
8286
        } else {
8287
          setPex((PromotionException)value);
8288
        }
8289
        break;
8290
 
8291
      }
8292
    }
8293
 
8294
    public Object getFieldValue(_Fields field) {
8295
      switch (field) {
8296
      case SUCCESS:
8297
        return getSuccess();
8298
 
8299
      case PEX:
8300
        return getPex();
8301
 
8302
      }
8303
      throw new IllegalStateException();
8304
    }
8305
 
3430 rajveer 8306
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8307
    public boolean isSet(_Fields field) {
8308
      if (field == null) {
8309
        throw new IllegalArgumentException();
8310
      }
1982 varun.gupt 8311
 
8312
      switch (field) {
8313
      case SUCCESS:
8314
        return isSetSuccess();
8315
      case PEX:
8316
        return isSetPex();
8317
      }
8318
      throw new IllegalStateException();
8319
    }
8320
 
8321
    @Override
8322
    public boolean equals(Object that) {
8323
      if (that == null)
8324
        return false;
8325
      if (that instanceof applyCoupon_result)
8326
        return this.equals((applyCoupon_result)that);
8327
      return false;
8328
    }
8329
 
8330
    public boolean equals(applyCoupon_result that) {
8331
      if (that == null)
8332
        return false;
8333
 
8334
      boolean this_present_success = true && this.isSetSuccess();
8335
      boolean that_present_success = true && that.isSetSuccess();
8336
      if (this_present_success || that_present_success) {
8337
        if (!(this_present_success && that_present_success))
8338
          return false;
8339
        if (!this.success.equals(that.success))
8340
          return false;
8341
      }
8342
 
8343
      boolean this_present_pex = true && this.isSetPex();
8344
      boolean that_present_pex = true && that.isSetPex();
8345
      if (this_present_pex || that_present_pex) {
8346
        if (!(this_present_pex && that_present_pex))
8347
          return false;
8348
        if (!this.pex.equals(that.pex))
8349
          return false;
8350
      }
8351
 
8352
      return true;
8353
    }
8354
 
8355
    @Override
8356
    public int hashCode() {
8357
      return 0;
8358
    }
8359
 
8360
    public int compareTo(applyCoupon_result other) {
8361
      if (!getClass().equals(other.getClass())) {
8362
        return getClass().getName().compareTo(other.getClass().getName());
8363
      }
8364
 
8365
      int lastComparison = 0;
8366
      applyCoupon_result typedOther = (applyCoupon_result)other;
8367
 
3430 rajveer 8368
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 8369
      if (lastComparison != 0) {
8370
        return lastComparison;
8371
      }
3430 rajveer 8372
      if (isSetSuccess()) {
8373
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
8374
        if (lastComparison != 0) {
8375
          return lastComparison;
8376
        }
1982 varun.gupt 8377
      }
3430 rajveer 8378
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 8379
      if (lastComparison != 0) {
8380
        return lastComparison;
8381
      }
3430 rajveer 8382
      if (isSetPex()) {
8383
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
8384
        if (lastComparison != 0) {
8385
          return lastComparison;
8386
        }
1982 varun.gupt 8387
      }
8388
      return 0;
8389
    }
8390
 
3430 rajveer 8391
    public _Fields fieldForId(int fieldId) {
8392
      return _Fields.findByThriftId(fieldId);
8393
    }
8394
 
8395
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8396
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 8397
      iprot.readStructBegin();
8398
      while (true)
8399
      {
8400
        field = iprot.readFieldBegin();
3430 rajveer 8401
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 8402
          break;
8403
        }
3430 rajveer 8404
        switch (field.id) {
8405
          case 0: // SUCCESS
8406
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
8407
              this.success = new Cart();
8408
              this.success.read(iprot);
8409
            } else { 
8410
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8411
            }
8412
            break;
8413
          case 1: // PEX
8414
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
8415
              this.pex = new PromotionException();
8416
              this.pex.read(iprot);
8417
            } else { 
8418
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8419
            }
8420
            break;
8421
          default:
8422
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 8423
        }
3430 rajveer 8424
        iprot.readFieldEnd();
1982 varun.gupt 8425
      }
8426
      iprot.readStructEnd();
8427
      validate();
8428
    }
8429
 
3430 rajveer 8430
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 8431
      oprot.writeStructBegin(STRUCT_DESC);
8432
 
8433
      if (this.isSetSuccess()) {
8434
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
8435
        this.success.write(oprot);
8436
        oprot.writeFieldEnd();
8437
      } else if (this.isSetPex()) {
8438
        oprot.writeFieldBegin(PEX_FIELD_DESC);
8439
        this.pex.write(oprot);
8440
        oprot.writeFieldEnd();
8441
      }
8442
      oprot.writeFieldStop();
8443
      oprot.writeStructEnd();
8444
    }
8445
 
8446
    @Override
8447
    public String toString() {
8448
      StringBuilder sb = new StringBuilder("applyCoupon_result(");
8449
      boolean first = true;
8450
 
8451
      sb.append("success:");
8452
      if (this.success == null) {
8453
        sb.append("null");
8454
      } else {
8455
        sb.append(this.success);
8456
      }
8457
      first = false;
8458
      if (!first) sb.append(", ");
8459
      sb.append("pex:");
8460
      if (this.pex == null) {
8461
        sb.append("null");
8462
      } else {
8463
        sb.append(this.pex);
8464
      }
8465
      first = false;
8466
      sb.append(")");
8467
      return sb.toString();
8468
    }
8469
 
3430 rajveer 8470
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 8471
      // check for required fields
8472
    }
8473
 
3430 rajveer 8474
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8475
      try {
8476
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8477
      } catch (org.apache.thrift.TException te) {
8478
        throw new java.io.IOException(te);
8479
      }
8480
    }
8481
 
8482
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8483
      try {
8484
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8485
      } catch (org.apache.thrift.TException te) {
8486
        throw new java.io.IOException(te);
8487
      }
8488
    }
8489
 
1982 varun.gupt 8490
  }
8491
 
6736 amit.gupta 8492
  public static class getEmiDiscount_args implements org.apache.thrift.TBase<getEmiDiscount_args, getEmiDiscount_args._Fields>, java.io.Serializable, Cloneable   {
8493
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getEmiDiscount_args");
8494
 
8495
    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);
8496
 
8497
    private long cartId; // required
8498
 
8499
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8500
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
8501
      CART_ID((short)1, "cartId");
8502
 
8503
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8504
 
8505
      static {
8506
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8507
          byName.put(field.getFieldName(), field);
8508
        }
8509
      }
8510
 
8511
      /**
8512
       * Find the _Fields constant that matches fieldId, or null if its not found.
8513
       */
8514
      public static _Fields findByThriftId(int fieldId) {
8515
        switch(fieldId) {
8516
          case 1: // CART_ID
8517
            return CART_ID;
8518
          default:
8519
            return null;
8520
        }
8521
      }
8522
 
8523
      /**
8524
       * Find the _Fields constant that matches fieldId, throwing an exception
8525
       * if it is not found.
8526
       */
8527
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8528
        _Fields fields = findByThriftId(fieldId);
8529
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8530
        return fields;
8531
      }
8532
 
8533
      /**
8534
       * Find the _Fields constant that matches name, or null if its not found.
8535
       */
8536
      public static _Fields findByName(String name) {
8537
        return byName.get(name);
8538
      }
8539
 
8540
      private final short _thriftId;
8541
      private final String _fieldName;
8542
 
8543
      _Fields(short thriftId, String fieldName) {
8544
        _thriftId = thriftId;
8545
        _fieldName = fieldName;
8546
      }
8547
 
8548
      public short getThriftFieldId() {
8549
        return _thriftId;
8550
      }
8551
 
8552
      public String getFieldName() {
8553
        return _fieldName;
8554
      }
8555
    }
8556
 
8557
    // isset id assignments
8558
    private static final int __CARTID_ISSET_ID = 0;
8559
    private BitSet __isset_bit_vector = new BitSet(1);
8560
 
8561
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
8562
    static {
8563
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8564
      tmpMap.put(_Fields.CART_ID, new org.apache.thrift.meta_data.FieldMetaData("cartId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8565
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8566
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8567
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getEmiDiscount_args.class, metaDataMap);
8568
    }
8569
 
8570
    public getEmiDiscount_args() {
8571
    }
8572
 
8573
    public getEmiDiscount_args(
8574
      long cartId)
8575
    {
8576
      this();
8577
      this.cartId = cartId;
8578
      setCartIdIsSet(true);
8579
    }
8580
 
8581
    /**
8582
     * Performs a deep copy on <i>other</i>.
8583
     */
8584
    public getEmiDiscount_args(getEmiDiscount_args other) {
8585
      __isset_bit_vector.clear();
8586
      __isset_bit_vector.or(other.__isset_bit_vector);
8587
      this.cartId = other.cartId;
8588
    }
8589
 
8590
    public getEmiDiscount_args deepCopy() {
8591
      return new getEmiDiscount_args(this);
8592
    }
8593
 
8594
    @Override
8595
    public void clear() {
8596
      setCartIdIsSet(false);
8597
      this.cartId = 0;
8598
    }
8599
 
8600
    public long getCartId() {
8601
      return this.cartId;
8602
    }
8603
 
8604
    public void setCartId(long cartId) {
8605
      this.cartId = cartId;
8606
      setCartIdIsSet(true);
8607
    }
8608
 
8609
    public void unsetCartId() {
8610
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
8611
    }
8612
 
8613
    /** Returns true if field cartId is set (has been assigned a value) and false otherwise */
8614
    public boolean isSetCartId() {
8615
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
8616
    }
8617
 
8618
    public void setCartIdIsSet(boolean value) {
8619
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
8620
    }
8621
 
8622
    public void setFieldValue(_Fields field, Object value) {
8623
      switch (field) {
8624
      case CART_ID:
8625
        if (value == null) {
8626
          unsetCartId();
8627
        } else {
8628
          setCartId((Long)value);
8629
        }
8630
        break;
8631
 
8632
      }
8633
    }
8634
 
8635
    public Object getFieldValue(_Fields field) {
8636
      switch (field) {
8637
      case CART_ID:
8638
        return Long.valueOf(getCartId());
8639
 
8640
      }
8641
      throw new IllegalStateException();
8642
    }
8643
 
8644
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8645
    public boolean isSet(_Fields field) {
8646
      if (field == null) {
8647
        throw new IllegalArgumentException();
8648
      }
8649
 
8650
      switch (field) {
8651
      case CART_ID:
8652
        return isSetCartId();
8653
      }
8654
      throw new IllegalStateException();
8655
    }
8656
 
8657
    @Override
8658
    public boolean equals(Object that) {
8659
      if (that == null)
8660
        return false;
8661
      if (that instanceof getEmiDiscount_args)
8662
        return this.equals((getEmiDiscount_args)that);
8663
      return false;
8664
    }
8665
 
8666
    public boolean equals(getEmiDiscount_args that) {
8667
      if (that == null)
8668
        return false;
8669
 
8670
      boolean this_present_cartId = true;
8671
      boolean that_present_cartId = true;
8672
      if (this_present_cartId || that_present_cartId) {
8673
        if (!(this_present_cartId && that_present_cartId))
8674
          return false;
8675
        if (this.cartId != that.cartId)
8676
          return false;
8677
      }
8678
 
8679
      return true;
8680
    }
8681
 
8682
    @Override
8683
    public int hashCode() {
8684
      return 0;
8685
    }
8686
 
8687
    public int compareTo(getEmiDiscount_args other) {
8688
      if (!getClass().equals(other.getClass())) {
8689
        return getClass().getName().compareTo(other.getClass().getName());
8690
      }
8691
 
8692
      int lastComparison = 0;
8693
      getEmiDiscount_args typedOther = (getEmiDiscount_args)other;
8694
 
8695
      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(typedOther.isSetCartId());
8696
      if (lastComparison != 0) {
8697
        return lastComparison;
8698
      }
8699
      if (isSetCartId()) {
8700
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cartId, typedOther.cartId);
8701
        if (lastComparison != 0) {
8702
          return lastComparison;
8703
        }
8704
      }
8705
      return 0;
8706
    }
8707
 
8708
    public _Fields fieldForId(int fieldId) {
8709
      return _Fields.findByThriftId(fieldId);
8710
    }
8711
 
8712
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8713
      org.apache.thrift.protocol.TField field;
8714
      iprot.readStructBegin();
8715
      while (true)
8716
      {
8717
        field = iprot.readFieldBegin();
8718
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
8719
          break;
8720
        }
8721
        switch (field.id) {
8722
          case 1: // CART_ID
8723
            if (field.type == org.apache.thrift.protocol.TType.I64) {
8724
              this.cartId = iprot.readI64();
8725
              setCartIdIsSet(true);
8726
            } else { 
8727
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8728
            }
8729
            break;
8730
          default:
8731
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8732
        }
8733
        iprot.readFieldEnd();
8734
      }
8735
      iprot.readStructEnd();
8736
      validate();
8737
    }
8738
 
8739
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
8740
      validate();
8741
 
8742
      oprot.writeStructBegin(STRUCT_DESC);
8743
      oprot.writeFieldBegin(CART_ID_FIELD_DESC);
8744
      oprot.writeI64(this.cartId);
8745
      oprot.writeFieldEnd();
8746
      oprot.writeFieldStop();
8747
      oprot.writeStructEnd();
8748
    }
8749
 
8750
    @Override
8751
    public String toString() {
8752
      StringBuilder sb = new StringBuilder("getEmiDiscount_args(");
8753
      boolean first = true;
8754
 
8755
      sb.append("cartId:");
8756
      sb.append(this.cartId);
8757
      first = false;
8758
      sb.append(")");
8759
      return sb.toString();
8760
    }
8761
 
8762
    public void validate() throws org.apache.thrift.TException {
8763
      // check for required fields
8764
    }
8765
 
8766
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8767
      try {
8768
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8769
      } catch (org.apache.thrift.TException te) {
8770
        throw new java.io.IOException(te);
8771
      }
8772
    }
8773
 
8774
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8775
      try {
8776
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
8777
        __isset_bit_vector = new BitSet(1);
8778
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8779
      } catch (org.apache.thrift.TException te) {
8780
        throw new java.io.IOException(te);
8781
      }
8782
    }
8783
 
8784
  }
8785
 
8786
  public static class getEmiDiscount_result implements org.apache.thrift.TBase<getEmiDiscount_result, getEmiDiscount_result._Fields>, java.io.Serializable, Cloneable   {
8787
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getEmiDiscount_result");
8788
 
8789
    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);
8790
    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);
8791
 
8792
    private Map<Long,Double> success; // required
8793
    private PromotionException pex; // required
8794
 
8795
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8796
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
8797
      SUCCESS((short)0, "success"),
8798
      PEX((short)1, "pex");
8799
 
8800
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8801
 
8802
      static {
8803
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8804
          byName.put(field.getFieldName(), field);
8805
        }
8806
      }
8807
 
8808
      /**
8809
       * Find the _Fields constant that matches fieldId, or null if its not found.
8810
       */
8811
      public static _Fields findByThriftId(int fieldId) {
8812
        switch(fieldId) {
8813
          case 0: // SUCCESS
8814
            return SUCCESS;
8815
          case 1: // PEX
8816
            return PEX;
8817
          default:
8818
            return null;
8819
        }
8820
      }
8821
 
8822
      /**
8823
       * Find the _Fields constant that matches fieldId, throwing an exception
8824
       * if it is not found.
8825
       */
8826
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8827
        _Fields fields = findByThriftId(fieldId);
8828
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8829
        return fields;
8830
      }
8831
 
8832
      /**
8833
       * Find the _Fields constant that matches name, or null if its not found.
8834
       */
8835
      public static _Fields findByName(String name) {
8836
        return byName.get(name);
8837
      }
8838
 
8839
      private final short _thriftId;
8840
      private final String _fieldName;
8841
 
8842
      _Fields(short thriftId, String fieldName) {
8843
        _thriftId = thriftId;
8844
        _fieldName = fieldName;
8845
      }
8846
 
8847
      public short getThriftFieldId() {
8848
        return _thriftId;
8849
      }
8850
 
8851
      public String getFieldName() {
8852
        return _fieldName;
8853
      }
8854
    }
8855
 
8856
    // isset id assignments
8857
 
8858
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
8859
    static {
8860
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8861
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8862
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
8863
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), 
8864
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
8865
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8866
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
8867
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8868
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getEmiDiscount_result.class, metaDataMap);
8869
    }
8870
 
8871
    public getEmiDiscount_result() {
8872
    }
8873
 
8874
    public getEmiDiscount_result(
8875
      Map<Long,Double> success,
8876
      PromotionException pex)
8877
    {
8878
      this();
8879
      this.success = success;
8880
      this.pex = pex;
8881
    }
8882
 
8883
    /**
8884
     * Performs a deep copy on <i>other</i>.
8885
     */
8886
    public getEmiDiscount_result(getEmiDiscount_result other) {
8887
      if (other.isSetSuccess()) {
8888
        Map<Long,Double> __this__success = new HashMap<Long,Double>();
8889
        for (Map.Entry<Long, Double> other_element : other.success.entrySet()) {
8890
 
8891
          Long other_element_key = other_element.getKey();
8892
          Double other_element_value = other_element.getValue();
8893
 
8894
          Long __this__success_copy_key = other_element_key;
8895
 
8896
          Double __this__success_copy_value = other_element_value;
8897
 
8898
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
8899
        }
8900
        this.success = __this__success;
8901
      }
8902
      if (other.isSetPex()) {
8903
        this.pex = new PromotionException(other.pex);
8904
      }
8905
    }
8906
 
8907
    public getEmiDiscount_result deepCopy() {
8908
      return new getEmiDiscount_result(this);
8909
    }
8910
 
8911
    @Override
8912
    public void clear() {
8913
      this.success = null;
8914
      this.pex = null;
8915
    }
8916
 
8917
    public int getSuccessSize() {
8918
      return (this.success == null) ? 0 : this.success.size();
8919
    }
8920
 
8921
    public void putToSuccess(long key, double val) {
8922
      if (this.success == null) {
8923
        this.success = new HashMap<Long,Double>();
8924
      }
8925
      this.success.put(key, val);
8926
    }
8927
 
8928
    public Map<Long,Double> getSuccess() {
8929
      return this.success;
8930
    }
8931
 
8932
    public void setSuccess(Map<Long,Double> success) {
8933
      this.success = success;
8934
    }
8935
 
8936
    public void unsetSuccess() {
8937
      this.success = null;
8938
    }
8939
 
8940
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
8941
    public boolean isSetSuccess() {
8942
      return this.success != null;
8943
    }
8944
 
8945
    public void setSuccessIsSet(boolean value) {
8946
      if (!value) {
8947
        this.success = null;
8948
      }
8949
    }
8950
 
8951
    public PromotionException getPex() {
8952
      return this.pex;
8953
    }
8954
 
8955
    public void setPex(PromotionException pex) {
8956
      this.pex = pex;
8957
    }
8958
 
8959
    public void unsetPex() {
8960
      this.pex = null;
8961
    }
8962
 
8963
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
8964
    public boolean isSetPex() {
8965
      return this.pex != null;
8966
    }
8967
 
8968
    public void setPexIsSet(boolean value) {
8969
      if (!value) {
8970
        this.pex = null;
8971
      }
8972
    }
8973
 
8974
    public void setFieldValue(_Fields field, Object value) {
8975
      switch (field) {
8976
      case SUCCESS:
8977
        if (value == null) {
8978
          unsetSuccess();
8979
        } else {
8980
          setSuccess((Map<Long,Double>)value);
8981
        }
8982
        break;
8983
 
8984
      case PEX:
8985
        if (value == null) {
8986
          unsetPex();
8987
        } else {
8988
          setPex((PromotionException)value);
8989
        }
8990
        break;
8991
 
8992
      }
8993
    }
8994
 
8995
    public Object getFieldValue(_Fields field) {
8996
      switch (field) {
8997
      case SUCCESS:
8998
        return getSuccess();
8999
 
9000
      case PEX:
9001
        return getPex();
9002
 
9003
      }
9004
      throw new IllegalStateException();
9005
    }
9006
 
9007
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9008
    public boolean isSet(_Fields field) {
9009
      if (field == null) {
9010
        throw new IllegalArgumentException();
9011
      }
9012
 
9013
      switch (field) {
9014
      case SUCCESS:
9015
        return isSetSuccess();
9016
      case PEX:
9017
        return isSetPex();
9018
      }
9019
      throw new IllegalStateException();
9020
    }
9021
 
9022
    @Override
9023
    public boolean equals(Object that) {
9024
      if (that == null)
9025
        return false;
9026
      if (that instanceof getEmiDiscount_result)
9027
        return this.equals((getEmiDiscount_result)that);
9028
      return false;
9029
    }
9030
 
9031
    public boolean equals(getEmiDiscount_result that) {
9032
      if (that == null)
9033
        return false;
9034
 
9035
      boolean this_present_success = true && this.isSetSuccess();
9036
      boolean that_present_success = true && that.isSetSuccess();
9037
      if (this_present_success || that_present_success) {
9038
        if (!(this_present_success && that_present_success))
9039
          return false;
9040
        if (!this.success.equals(that.success))
9041
          return false;
9042
      }
9043
 
9044
      boolean this_present_pex = true && this.isSetPex();
9045
      boolean that_present_pex = true && that.isSetPex();
9046
      if (this_present_pex || that_present_pex) {
9047
        if (!(this_present_pex && that_present_pex))
9048
          return false;
9049
        if (!this.pex.equals(that.pex))
9050
          return false;
9051
      }
9052
 
9053
      return true;
9054
    }
9055
 
9056
    @Override
9057
    public int hashCode() {
9058
      return 0;
9059
    }
9060
 
9061
    public int compareTo(getEmiDiscount_result other) {
9062
      if (!getClass().equals(other.getClass())) {
9063
        return getClass().getName().compareTo(other.getClass().getName());
9064
      }
9065
 
9066
      int lastComparison = 0;
9067
      getEmiDiscount_result typedOther = (getEmiDiscount_result)other;
9068
 
9069
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
9070
      if (lastComparison != 0) {
9071
        return lastComparison;
9072
      }
9073
      if (isSetSuccess()) {
9074
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
9075
        if (lastComparison != 0) {
9076
          return lastComparison;
9077
        }
9078
      }
9079
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
9080
      if (lastComparison != 0) {
9081
        return lastComparison;
9082
      }
9083
      if (isSetPex()) {
9084
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
9085
        if (lastComparison != 0) {
9086
          return lastComparison;
9087
        }
9088
      }
9089
      return 0;
9090
    }
9091
 
9092
    public _Fields fieldForId(int fieldId) {
9093
      return _Fields.findByThriftId(fieldId);
9094
    }
9095
 
9096
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9097
      org.apache.thrift.protocol.TField field;
9098
      iprot.readStructBegin();
9099
      while (true)
9100
      {
9101
        field = iprot.readFieldBegin();
9102
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
9103
          break;
9104
        }
9105
        switch (field.id) {
9106
          case 0: // SUCCESS
9107
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
9108
              {
9109
                org.apache.thrift.protocol.TMap _map16 = iprot.readMapBegin();
9110
                this.success = new HashMap<Long,Double>(2*_map16.size);
9111
                for (int _i17 = 0; _i17 < _map16.size; ++_i17)
9112
                {
9113
                  long _key18; // required
9114
                  double _val19; // required
9115
                  _key18 = iprot.readI64();
9116
                  _val19 = iprot.readDouble();
9117
                  this.success.put(_key18, _val19);
9118
                }
9119
                iprot.readMapEnd();
9120
              }
9121
            } else { 
9122
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9123
            }
9124
            break;
9125
          case 1: // PEX
9126
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
9127
              this.pex = new PromotionException();
9128
              this.pex.read(iprot);
9129
            } else { 
9130
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9131
            }
9132
            break;
9133
          default:
9134
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9135
        }
9136
        iprot.readFieldEnd();
9137
      }
9138
      iprot.readStructEnd();
9139
      validate();
9140
    }
9141
 
9142
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
9143
      oprot.writeStructBegin(STRUCT_DESC);
9144
 
9145
      if (this.isSetSuccess()) {
9146
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
9147
        {
9148
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.DOUBLE, this.success.size()));
9149
          for (Map.Entry<Long, Double> _iter20 : this.success.entrySet())
9150
          {
9151
            oprot.writeI64(_iter20.getKey());
9152
            oprot.writeDouble(_iter20.getValue());
9153
          }
9154
          oprot.writeMapEnd();
9155
        }
9156
        oprot.writeFieldEnd();
9157
      } else if (this.isSetPex()) {
9158
        oprot.writeFieldBegin(PEX_FIELD_DESC);
9159
        this.pex.write(oprot);
9160
        oprot.writeFieldEnd();
9161
      }
9162
      oprot.writeFieldStop();
9163
      oprot.writeStructEnd();
9164
    }
9165
 
9166
    @Override
9167
    public String toString() {
9168
      StringBuilder sb = new StringBuilder("getEmiDiscount_result(");
9169
      boolean first = true;
9170
 
9171
      sb.append("success:");
9172
      if (this.success == null) {
9173
        sb.append("null");
9174
      } else {
9175
        sb.append(this.success);
9176
      }
9177
      first = false;
9178
      if (!first) sb.append(", ");
9179
      sb.append("pex:");
9180
      if (this.pex == null) {
9181
        sb.append("null");
9182
      } else {
9183
        sb.append(this.pex);
9184
      }
9185
      first = false;
9186
      sb.append(")");
9187
      return sb.toString();
9188
    }
9189
 
9190
    public void validate() throws org.apache.thrift.TException {
9191
      // check for required fields
9192
    }
9193
 
9194
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9195
      try {
9196
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9197
      } catch (org.apache.thrift.TException te) {
9198
        throw new java.io.IOException(te);
9199
      }
9200
    }
9201
 
9202
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9203
      try {
9204
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9205
      } catch (org.apache.thrift.TException te) {
9206
        throw new java.io.IOException(te);
9207
      }
9208
    }
9209
 
9210
  }
9211
 
6433 anupam.sin 9212
  public static class applyRechargeCoupon_args implements org.apache.thrift.TBase<applyRechargeCoupon_args, applyRechargeCoupon_args._Fields>, java.io.Serializable, Cloneable   {
9213
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyRechargeCoupon_args");
9214
 
9215
    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);
9216
    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);
9217
    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);
9218
 
9219
    private String couponCode; // required
9220
    private long totalAmount; // required
9221
    private long userId; // required
9222
 
9223
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9224
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
9225
      COUPON_CODE((short)1, "couponCode"),
9226
      TOTAL_AMOUNT((short)2, "totalAmount"),
9227
      USER_ID((short)3, "userId");
9228
 
9229
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9230
 
9231
      static {
9232
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9233
          byName.put(field.getFieldName(), field);
9234
        }
9235
      }
9236
 
9237
      /**
9238
       * Find the _Fields constant that matches fieldId, or null if its not found.
9239
       */
9240
      public static _Fields findByThriftId(int fieldId) {
9241
        switch(fieldId) {
9242
          case 1: // COUPON_CODE
9243
            return COUPON_CODE;
9244
          case 2: // TOTAL_AMOUNT
9245
            return TOTAL_AMOUNT;
9246
          case 3: // USER_ID
9247
            return USER_ID;
9248
          default:
9249
            return null;
9250
        }
9251
      }
9252
 
9253
      /**
9254
       * Find the _Fields constant that matches fieldId, throwing an exception
9255
       * if it is not found.
9256
       */
9257
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9258
        _Fields fields = findByThriftId(fieldId);
9259
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9260
        return fields;
9261
      }
9262
 
9263
      /**
9264
       * Find the _Fields constant that matches name, or null if its not found.
9265
       */
9266
      public static _Fields findByName(String name) {
9267
        return byName.get(name);
9268
      }
9269
 
9270
      private final short _thriftId;
9271
      private final String _fieldName;
9272
 
9273
      _Fields(short thriftId, String fieldName) {
9274
        _thriftId = thriftId;
9275
        _fieldName = fieldName;
9276
      }
9277
 
9278
      public short getThriftFieldId() {
9279
        return _thriftId;
9280
      }
9281
 
9282
      public String getFieldName() {
9283
        return _fieldName;
9284
      }
9285
    }
9286
 
9287
    // isset id assignments
9288
    private static final int __TOTALAMOUNT_ISSET_ID = 0;
9289
    private static final int __USERID_ISSET_ID = 1;
9290
    private BitSet __isset_bit_vector = new BitSet(2);
9291
 
9292
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
9293
    static {
9294
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9295
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9296
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
9297
      tmpMap.put(_Fields.TOTAL_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("totalAmount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9298
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9299
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9300
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9301
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9302
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyRechargeCoupon_args.class, metaDataMap);
9303
    }
9304
 
9305
    public applyRechargeCoupon_args() {
9306
    }
9307
 
9308
    public applyRechargeCoupon_args(
9309
      String couponCode,
9310
      long totalAmount,
9311
      long userId)
9312
    {
9313
      this();
9314
      this.couponCode = couponCode;
9315
      this.totalAmount = totalAmount;
9316
      setTotalAmountIsSet(true);
9317
      this.userId = userId;
9318
      setUserIdIsSet(true);
9319
    }
9320
 
9321
    /**
9322
     * Performs a deep copy on <i>other</i>.
9323
     */
9324
    public applyRechargeCoupon_args(applyRechargeCoupon_args other) {
9325
      __isset_bit_vector.clear();
9326
      __isset_bit_vector.or(other.__isset_bit_vector);
9327
      if (other.isSetCouponCode()) {
9328
        this.couponCode = other.couponCode;
9329
      }
9330
      this.totalAmount = other.totalAmount;
9331
      this.userId = other.userId;
9332
    }
9333
 
9334
    public applyRechargeCoupon_args deepCopy() {
9335
      return new applyRechargeCoupon_args(this);
9336
    }
9337
 
9338
    @Override
9339
    public void clear() {
9340
      this.couponCode = null;
9341
      setTotalAmountIsSet(false);
9342
      this.totalAmount = 0;
9343
      setUserIdIsSet(false);
9344
      this.userId = 0;
9345
    }
9346
 
9347
    public String getCouponCode() {
9348
      return this.couponCode;
9349
    }
9350
 
9351
    public void setCouponCode(String couponCode) {
9352
      this.couponCode = couponCode;
9353
    }
9354
 
9355
    public void unsetCouponCode() {
9356
      this.couponCode = null;
9357
    }
9358
 
9359
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
9360
    public boolean isSetCouponCode() {
9361
      return this.couponCode != null;
9362
    }
9363
 
9364
    public void setCouponCodeIsSet(boolean value) {
9365
      if (!value) {
9366
        this.couponCode = null;
9367
      }
9368
    }
9369
 
9370
    public long getTotalAmount() {
9371
      return this.totalAmount;
9372
    }
9373
 
9374
    public void setTotalAmount(long totalAmount) {
9375
      this.totalAmount = totalAmount;
9376
      setTotalAmountIsSet(true);
9377
    }
9378
 
9379
    public void unsetTotalAmount() {
9380
      __isset_bit_vector.clear(__TOTALAMOUNT_ISSET_ID);
9381
    }
9382
 
9383
    /** Returns true if field totalAmount is set (has been assigned a value) and false otherwise */
9384
    public boolean isSetTotalAmount() {
9385
      return __isset_bit_vector.get(__TOTALAMOUNT_ISSET_ID);
9386
    }
9387
 
9388
    public void setTotalAmountIsSet(boolean value) {
9389
      __isset_bit_vector.set(__TOTALAMOUNT_ISSET_ID, value);
9390
    }
9391
 
9392
    public long getUserId() {
9393
      return this.userId;
9394
    }
9395
 
9396
    public void setUserId(long userId) {
9397
      this.userId = userId;
9398
      setUserIdIsSet(true);
9399
    }
9400
 
9401
    public void unsetUserId() {
9402
      __isset_bit_vector.clear(__USERID_ISSET_ID);
9403
    }
9404
 
9405
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
9406
    public boolean isSetUserId() {
9407
      return __isset_bit_vector.get(__USERID_ISSET_ID);
9408
    }
9409
 
9410
    public void setUserIdIsSet(boolean value) {
9411
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
9412
    }
9413
 
9414
    public void setFieldValue(_Fields field, Object value) {
9415
      switch (field) {
9416
      case COUPON_CODE:
9417
        if (value == null) {
9418
          unsetCouponCode();
9419
        } else {
9420
          setCouponCode((String)value);
9421
        }
9422
        break;
9423
 
9424
      case TOTAL_AMOUNT:
9425
        if (value == null) {
9426
          unsetTotalAmount();
9427
        } else {
9428
          setTotalAmount((Long)value);
9429
        }
9430
        break;
9431
 
9432
      case USER_ID:
9433
        if (value == null) {
9434
          unsetUserId();
9435
        } else {
9436
          setUserId((Long)value);
9437
        }
9438
        break;
9439
 
9440
      }
9441
    }
9442
 
9443
    public Object getFieldValue(_Fields field) {
9444
      switch (field) {
9445
      case COUPON_CODE:
9446
        return getCouponCode();
9447
 
9448
      case TOTAL_AMOUNT:
9449
        return Long.valueOf(getTotalAmount());
9450
 
9451
      case USER_ID:
9452
        return Long.valueOf(getUserId());
9453
 
9454
      }
9455
      throw new IllegalStateException();
9456
    }
9457
 
9458
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9459
    public boolean isSet(_Fields field) {
9460
      if (field == null) {
9461
        throw new IllegalArgumentException();
9462
      }
9463
 
9464
      switch (field) {
9465
      case COUPON_CODE:
9466
        return isSetCouponCode();
9467
      case TOTAL_AMOUNT:
9468
        return isSetTotalAmount();
9469
      case USER_ID:
9470
        return isSetUserId();
9471
      }
9472
      throw new IllegalStateException();
9473
    }
9474
 
9475
    @Override
9476
    public boolean equals(Object that) {
9477
      if (that == null)
9478
        return false;
9479
      if (that instanceof applyRechargeCoupon_args)
9480
        return this.equals((applyRechargeCoupon_args)that);
9481
      return false;
9482
    }
9483
 
9484
    public boolean equals(applyRechargeCoupon_args that) {
9485
      if (that == null)
9486
        return false;
9487
 
9488
      boolean this_present_couponCode = true && this.isSetCouponCode();
9489
      boolean that_present_couponCode = true && that.isSetCouponCode();
9490
      if (this_present_couponCode || that_present_couponCode) {
9491
        if (!(this_present_couponCode && that_present_couponCode))
9492
          return false;
9493
        if (!this.couponCode.equals(that.couponCode))
9494
          return false;
9495
      }
9496
 
9497
      boolean this_present_totalAmount = true;
9498
      boolean that_present_totalAmount = true;
9499
      if (this_present_totalAmount || that_present_totalAmount) {
9500
        if (!(this_present_totalAmount && that_present_totalAmount))
9501
          return false;
9502
        if (this.totalAmount != that.totalAmount)
9503
          return false;
9504
      }
9505
 
9506
      boolean this_present_userId = true;
9507
      boolean that_present_userId = true;
9508
      if (this_present_userId || that_present_userId) {
9509
        if (!(this_present_userId && that_present_userId))
9510
          return false;
9511
        if (this.userId != that.userId)
9512
          return false;
9513
      }
9514
 
9515
      return true;
9516
    }
9517
 
9518
    @Override
9519
    public int hashCode() {
9520
      return 0;
9521
    }
9522
 
9523
    public int compareTo(applyRechargeCoupon_args other) {
9524
      if (!getClass().equals(other.getClass())) {
9525
        return getClass().getName().compareTo(other.getClass().getName());
9526
      }
9527
 
9528
      int lastComparison = 0;
9529
      applyRechargeCoupon_args typedOther = (applyRechargeCoupon_args)other;
9530
 
9531
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
9532
      if (lastComparison != 0) {
9533
        return lastComparison;
9534
      }
9535
      if (isSetCouponCode()) {
9536
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
9537
        if (lastComparison != 0) {
9538
          return lastComparison;
9539
        }
9540
      }
9541
      lastComparison = Boolean.valueOf(isSetTotalAmount()).compareTo(typedOther.isSetTotalAmount());
9542
      if (lastComparison != 0) {
9543
        return lastComparison;
9544
      }
9545
      if (isSetTotalAmount()) {
9546
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.totalAmount, typedOther.totalAmount);
9547
        if (lastComparison != 0) {
9548
          return lastComparison;
9549
        }
9550
      }
9551
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
9552
      if (lastComparison != 0) {
9553
        return lastComparison;
9554
      }
9555
      if (isSetUserId()) {
9556
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
9557
        if (lastComparison != 0) {
9558
          return lastComparison;
9559
        }
9560
      }
9561
      return 0;
9562
    }
9563
 
9564
    public _Fields fieldForId(int fieldId) {
9565
      return _Fields.findByThriftId(fieldId);
9566
    }
9567
 
9568
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9569
      org.apache.thrift.protocol.TField field;
9570
      iprot.readStructBegin();
9571
      while (true)
9572
      {
9573
        field = iprot.readFieldBegin();
9574
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
9575
          break;
9576
        }
9577
        switch (field.id) {
9578
          case 1: // COUPON_CODE
9579
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
9580
              this.couponCode = iprot.readString();
9581
            } else { 
9582
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9583
            }
9584
            break;
9585
          case 2: // TOTAL_AMOUNT
9586
            if (field.type == org.apache.thrift.protocol.TType.I64) {
9587
              this.totalAmount = iprot.readI64();
9588
              setTotalAmountIsSet(true);
9589
            } else { 
9590
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9591
            }
9592
            break;
9593
          case 3: // USER_ID
9594
            if (field.type == org.apache.thrift.protocol.TType.I64) {
9595
              this.userId = iprot.readI64();
9596
              setUserIdIsSet(true);
9597
            } else { 
9598
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9599
            }
9600
            break;
9601
          default:
9602
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9603
        }
9604
        iprot.readFieldEnd();
9605
      }
9606
      iprot.readStructEnd();
9607
      validate();
9608
    }
9609
 
9610
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
9611
      validate();
9612
 
9613
      oprot.writeStructBegin(STRUCT_DESC);
9614
      if (this.couponCode != null) {
9615
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
9616
        oprot.writeString(this.couponCode);
9617
        oprot.writeFieldEnd();
9618
      }
9619
      oprot.writeFieldBegin(TOTAL_AMOUNT_FIELD_DESC);
9620
      oprot.writeI64(this.totalAmount);
9621
      oprot.writeFieldEnd();
9622
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
9623
      oprot.writeI64(this.userId);
9624
      oprot.writeFieldEnd();
9625
      oprot.writeFieldStop();
9626
      oprot.writeStructEnd();
9627
    }
9628
 
9629
    @Override
9630
    public String toString() {
9631
      StringBuilder sb = new StringBuilder("applyRechargeCoupon_args(");
9632
      boolean first = true;
9633
 
9634
      sb.append("couponCode:");
9635
      if (this.couponCode == null) {
9636
        sb.append("null");
9637
      } else {
9638
        sb.append(this.couponCode);
9639
      }
9640
      first = false;
9641
      if (!first) sb.append(", ");
9642
      sb.append("totalAmount:");
9643
      sb.append(this.totalAmount);
9644
      first = false;
9645
      if (!first) sb.append(", ");
9646
      sb.append("userId:");
9647
      sb.append(this.userId);
9648
      first = false;
9649
      sb.append(")");
9650
      return sb.toString();
9651
    }
9652
 
9653
    public void validate() throws org.apache.thrift.TException {
9654
      // check for required fields
9655
    }
9656
 
9657
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9658
      try {
9659
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9660
      } catch (org.apache.thrift.TException te) {
9661
        throw new java.io.IOException(te);
9662
      }
9663
    }
9664
 
9665
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9666
      try {
9667
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
9668
        __isset_bit_vector = new BitSet(1);
9669
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9670
      } catch (org.apache.thrift.TException te) {
9671
        throw new java.io.IOException(te);
9672
      }
9673
    }
9674
 
9675
  }
9676
 
9677
  public static class applyRechargeCoupon_result implements org.apache.thrift.TBase<applyRechargeCoupon_result, applyRechargeCoupon_result._Fields>, java.io.Serializable, Cloneable   {
9678
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyRechargeCoupon_result");
9679
 
9680
    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);
9681
    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);
9682
 
9683
    private Map<Long,String> success; // required
9684
    private PromotionException pex; // required
9685
 
9686
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9687
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
9688
      SUCCESS((short)0, "success"),
9689
      PEX((short)1, "pex");
9690
 
9691
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9692
 
9693
      static {
9694
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9695
          byName.put(field.getFieldName(), field);
9696
        }
9697
      }
9698
 
9699
      /**
9700
       * Find the _Fields constant that matches fieldId, or null if its not found.
9701
       */
9702
      public static _Fields findByThriftId(int fieldId) {
9703
        switch(fieldId) {
9704
          case 0: // SUCCESS
9705
            return SUCCESS;
9706
          case 1: // PEX
9707
            return PEX;
9708
          default:
9709
            return null;
9710
        }
9711
      }
9712
 
9713
      /**
9714
       * Find the _Fields constant that matches fieldId, throwing an exception
9715
       * if it is not found.
9716
       */
9717
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9718
        _Fields fields = findByThriftId(fieldId);
9719
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9720
        return fields;
9721
      }
9722
 
9723
      /**
9724
       * Find the _Fields constant that matches name, or null if its not found.
9725
       */
9726
      public static _Fields findByName(String name) {
9727
        return byName.get(name);
9728
      }
9729
 
9730
      private final short _thriftId;
9731
      private final String _fieldName;
9732
 
9733
      _Fields(short thriftId, String fieldName) {
9734
        _thriftId = thriftId;
9735
        _fieldName = fieldName;
9736
      }
9737
 
9738
      public short getThriftFieldId() {
9739
        return _thriftId;
9740
      }
9741
 
9742
      public String getFieldName() {
9743
        return _fieldName;
9744
      }
9745
    }
9746
 
9747
    // isset id assignments
9748
 
9749
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
9750
    static {
9751
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9752
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9753
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
9754
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), 
9755
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
9756
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9757
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
9758
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9759
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyRechargeCoupon_result.class, metaDataMap);
9760
    }
9761
 
9762
    public applyRechargeCoupon_result() {
9763
    }
9764
 
9765
    public applyRechargeCoupon_result(
9766
      Map<Long,String> success,
9767
      PromotionException pex)
9768
    {
9769
      this();
9770
      this.success = success;
9771
      this.pex = pex;
9772
    }
9773
 
9774
    /**
9775
     * Performs a deep copy on <i>other</i>.
9776
     */
9777
    public applyRechargeCoupon_result(applyRechargeCoupon_result other) {
9778
      if (other.isSetSuccess()) {
9779
        Map<Long,String> __this__success = new HashMap<Long,String>();
9780
        for (Map.Entry<Long, String> other_element : other.success.entrySet()) {
9781
 
9782
          Long other_element_key = other_element.getKey();
9783
          String other_element_value = other_element.getValue();
9784
 
9785
          Long __this__success_copy_key = other_element_key;
9786
 
9787
          String __this__success_copy_value = other_element_value;
9788
 
9789
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
9790
        }
9791
        this.success = __this__success;
9792
      }
9793
      if (other.isSetPex()) {
9794
        this.pex = new PromotionException(other.pex);
9795
      }
9796
    }
9797
 
9798
    public applyRechargeCoupon_result deepCopy() {
9799
      return new applyRechargeCoupon_result(this);
9800
    }
9801
 
9802
    @Override
9803
    public void clear() {
9804
      this.success = null;
9805
      this.pex = null;
9806
    }
9807
 
9808
    public int getSuccessSize() {
9809
      return (this.success == null) ? 0 : this.success.size();
9810
    }
9811
 
9812
    public void putToSuccess(long key, String val) {
9813
      if (this.success == null) {
9814
        this.success = new HashMap<Long,String>();
9815
      }
9816
      this.success.put(key, val);
9817
    }
9818
 
9819
    public Map<Long,String> getSuccess() {
9820
      return this.success;
9821
    }
9822
 
9823
    public void setSuccess(Map<Long,String> success) {
9824
      this.success = success;
9825
    }
9826
 
9827
    public void unsetSuccess() {
9828
      this.success = null;
9829
    }
9830
 
9831
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
9832
    public boolean isSetSuccess() {
9833
      return this.success != null;
9834
    }
9835
 
9836
    public void setSuccessIsSet(boolean value) {
9837
      if (!value) {
9838
        this.success = null;
9839
      }
9840
    }
9841
 
9842
    public PromotionException getPex() {
9843
      return this.pex;
9844
    }
9845
 
9846
    public void setPex(PromotionException pex) {
9847
      this.pex = pex;
9848
    }
9849
 
9850
    public void unsetPex() {
9851
      this.pex = null;
9852
    }
9853
 
9854
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
9855
    public boolean isSetPex() {
9856
      return this.pex != null;
9857
    }
9858
 
9859
    public void setPexIsSet(boolean value) {
9860
      if (!value) {
9861
        this.pex = null;
9862
      }
9863
    }
9864
 
9865
    public void setFieldValue(_Fields field, Object value) {
9866
      switch (field) {
9867
      case SUCCESS:
9868
        if (value == null) {
9869
          unsetSuccess();
9870
        } else {
9871
          setSuccess((Map<Long,String>)value);
9872
        }
9873
        break;
9874
 
9875
      case PEX:
9876
        if (value == null) {
9877
          unsetPex();
9878
        } else {
9879
          setPex((PromotionException)value);
9880
        }
9881
        break;
9882
 
9883
      }
9884
    }
9885
 
9886
    public Object getFieldValue(_Fields field) {
9887
      switch (field) {
9888
      case SUCCESS:
9889
        return getSuccess();
9890
 
9891
      case PEX:
9892
        return getPex();
9893
 
9894
      }
9895
      throw new IllegalStateException();
9896
    }
9897
 
9898
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9899
    public boolean isSet(_Fields field) {
9900
      if (field == null) {
9901
        throw new IllegalArgumentException();
9902
      }
9903
 
9904
      switch (field) {
9905
      case SUCCESS:
9906
        return isSetSuccess();
9907
      case PEX:
9908
        return isSetPex();
9909
      }
9910
      throw new IllegalStateException();
9911
    }
9912
 
9913
    @Override
9914
    public boolean equals(Object that) {
9915
      if (that == null)
9916
        return false;
9917
      if (that instanceof applyRechargeCoupon_result)
9918
        return this.equals((applyRechargeCoupon_result)that);
9919
      return false;
9920
    }
9921
 
9922
    public boolean equals(applyRechargeCoupon_result that) {
9923
      if (that == null)
9924
        return false;
9925
 
9926
      boolean this_present_success = true && this.isSetSuccess();
9927
      boolean that_present_success = true && that.isSetSuccess();
9928
      if (this_present_success || that_present_success) {
9929
        if (!(this_present_success && that_present_success))
9930
          return false;
9931
        if (!this.success.equals(that.success))
9932
          return false;
9933
      }
9934
 
9935
      boolean this_present_pex = true && this.isSetPex();
9936
      boolean that_present_pex = true && that.isSetPex();
9937
      if (this_present_pex || that_present_pex) {
9938
        if (!(this_present_pex && that_present_pex))
9939
          return false;
9940
        if (!this.pex.equals(that.pex))
9941
          return false;
9942
      }
9943
 
9944
      return true;
9945
    }
9946
 
9947
    @Override
9948
    public int hashCode() {
9949
      return 0;
9950
    }
9951
 
9952
    public int compareTo(applyRechargeCoupon_result other) {
9953
      if (!getClass().equals(other.getClass())) {
9954
        return getClass().getName().compareTo(other.getClass().getName());
9955
      }
9956
 
9957
      int lastComparison = 0;
9958
      applyRechargeCoupon_result typedOther = (applyRechargeCoupon_result)other;
9959
 
9960
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
9961
      if (lastComparison != 0) {
9962
        return lastComparison;
9963
      }
9964
      if (isSetSuccess()) {
9965
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
9966
        if (lastComparison != 0) {
9967
          return lastComparison;
9968
        }
9969
      }
9970
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
9971
      if (lastComparison != 0) {
9972
        return lastComparison;
9973
      }
9974
      if (isSetPex()) {
9975
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
9976
        if (lastComparison != 0) {
9977
          return lastComparison;
9978
        }
9979
      }
9980
      return 0;
9981
    }
9982
 
9983
    public _Fields fieldForId(int fieldId) {
9984
      return _Fields.findByThriftId(fieldId);
9985
    }
9986
 
9987
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9988
      org.apache.thrift.protocol.TField field;
9989
      iprot.readStructBegin();
9990
      while (true)
9991
      {
9992
        field = iprot.readFieldBegin();
9993
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
9994
          break;
9995
        }
9996
        switch (field.id) {
9997
          case 0: // SUCCESS
9998
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
9999
              {
6736 amit.gupta 10000
                org.apache.thrift.protocol.TMap _map21 = iprot.readMapBegin();
10001
                this.success = new HashMap<Long,String>(2*_map21.size);
10002
                for (int _i22 = 0; _i22 < _map21.size; ++_i22)
6433 anupam.sin 10003
                {
6736 amit.gupta 10004
                  long _key23; // required
10005
                  String _val24; // required
10006
                  _key23 = iprot.readI64();
10007
                  _val24 = iprot.readString();
10008
                  this.success.put(_key23, _val24);
6433 anupam.sin 10009
                }
10010
                iprot.readMapEnd();
10011
              }
10012
            } else { 
10013
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10014
            }
10015
            break;
10016
          case 1: // PEX
10017
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
10018
              this.pex = new PromotionException();
10019
              this.pex.read(iprot);
10020
            } else { 
10021
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10022
            }
10023
            break;
10024
          default:
10025
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10026
        }
10027
        iprot.readFieldEnd();
10028
      }
10029
      iprot.readStructEnd();
10030
      validate();
10031
    }
10032
 
10033
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
10034
      oprot.writeStructBegin(STRUCT_DESC);
10035
 
10036
      if (this.isSetSuccess()) {
10037
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
10038
        {
10039
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.STRING, this.success.size()));
6736 amit.gupta 10040
          for (Map.Entry<Long, String> _iter25 : this.success.entrySet())
6433 anupam.sin 10041
          {
6736 amit.gupta 10042
            oprot.writeI64(_iter25.getKey());
10043
            oprot.writeString(_iter25.getValue());
6433 anupam.sin 10044
          }
10045
          oprot.writeMapEnd();
10046
        }
10047
        oprot.writeFieldEnd();
10048
      } else if (this.isSetPex()) {
10049
        oprot.writeFieldBegin(PEX_FIELD_DESC);
10050
        this.pex.write(oprot);
10051
        oprot.writeFieldEnd();
10052
      }
10053
      oprot.writeFieldStop();
10054
      oprot.writeStructEnd();
10055
    }
10056
 
10057
    @Override
10058
    public String toString() {
10059
      StringBuilder sb = new StringBuilder("applyRechargeCoupon_result(");
10060
      boolean first = true;
10061
 
10062
      sb.append("success:");
10063
      if (this.success == null) {
10064
        sb.append("null");
10065
      } else {
10066
        sb.append(this.success);
10067
      }
10068
      first = false;
10069
      if (!first) sb.append(", ");
10070
      sb.append("pex:");
10071
      if (this.pex == null) {
10072
        sb.append("null");
10073
      } else {
10074
        sb.append(this.pex);
10075
      }
10076
      first = false;
10077
      sb.append(")");
10078
      return sb.toString();
10079
    }
10080
 
10081
    public void validate() throws org.apache.thrift.TException {
10082
      // check for required fields
10083
    }
10084
 
10085
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10086
      try {
10087
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10088
      } catch (org.apache.thrift.TException te) {
10089
        throw new java.io.IOException(te);
10090
      }
10091
    }
10092
 
10093
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10094
      try {
10095
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10096
      } catch (org.apache.thrift.TException te) {
10097
        throw new java.io.IOException(te);
10098
      }
10099
    }
10100
 
10101
  }
10102
 
3430 rajveer 10103
  public static class trackCouponUsage_args implements org.apache.thrift.TBase<trackCouponUsage_args, trackCouponUsage_args._Fields>, java.io.Serializable, Cloneable   {
10104
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_args");
1982 varun.gupt 10105
 
3430 rajveer 10106
    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);
10107
    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);
10108
    private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.I64, (short)3);
1982 varun.gupt 10109
 
3430 rajveer 10110
    private String couponCode; // required
10111
    private long transactionId; // required
10112
    private long userId; // required
1982 varun.gupt 10113
 
10114
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 10115
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 10116
      COUPON_CODE((short)1, "couponCode"),
10117
      TRANSACTION_ID((short)2, "transactionId"),
10118
      USER_ID((short)3, "userId");
10119
 
10120
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10121
 
10122
      static {
10123
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10124
          byName.put(field.getFieldName(), field);
10125
        }
10126
      }
10127
 
10128
      /**
10129
       * Find the _Fields constant that matches fieldId, or null if its not found.
10130
       */
10131
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 10132
        switch(fieldId) {
10133
          case 1: // COUPON_CODE
10134
            return COUPON_CODE;
10135
          case 2: // TRANSACTION_ID
10136
            return TRANSACTION_ID;
10137
          case 3: // USER_ID
10138
            return USER_ID;
10139
          default:
10140
            return null;
10141
        }
1982 varun.gupt 10142
      }
10143
 
10144
      /**
10145
       * Find the _Fields constant that matches fieldId, throwing an exception
10146
       * if it is not found.
10147
       */
10148
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10149
        _Fields fields = findByThriftId(fieldId);
10150
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10151
        return fields;
10152
      }
10153
 
10154
      /**
10155
       * Find the _Fields constant that matches name, or null if its not found.
10156
       */
10157
      public static _Fields findByName(String name) {
10158
        return byName.get(name);
10159
      }
10160
 
10161
      private final short _thriftId;
10162
      private final String _fieldName;
10163
 
10164
      _Fields(short thriftId, String fieldName) {
10165
        _thriftId = thriftId;
10166
        _fieldName = fieldName;
10167
      }
10168
 
10169
      public short getThriftFieldId() {
10170
        return _thriftId;
10171
      }
10172
 
10173
      public String getFieldName() {
10174
        return _fieldName;
10175
      }
10176
    }
10177
 
10178
    // isset id assignments
10179
    private static final int __TRANSACTIONID_ISSET_ID = 0;
10180
    private static final int __USERID_ISSET_ID = 1;
10181
    private BitSet __isset_bit_vector = new BitSet(2);
10182
 
3430 rajveer 10183
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 10184
    static {
3430 rajveer 10185
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10186
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10187
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
10188
      tmpMap.put(_Fields.TRANSACTION_ID, new org.apache.thrift.meta_data.FieldMetaData("transactionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10189
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
10190
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10191
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
10192
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10193
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_args.class, metaDataMap);
1982 varun.gupt 10194
    }
10195
 
10196
    public trackCouponUsage_args() {
10197
    }
10198
 
10199
    public trackCouponUsage_args(
10200
      String couponCode,
10201
      long transactionId,
10202
      long userId)
10203
    {
10204
      this();
10205
      this.couponCode = couponCode;
10206
      this.transactionId = transactionId;
10207
      setTransactionIdIsSet(true);
10208
      this.userId = userId;
10209
      setUserIdIsSet(true);
10210
    }
10211
 
10212
    /**
10213
     * Performs a deep copy on <i>other</i>.
10214
     */
10215
    public trackCouponUsage_args(trackCouponUsage_args other) {
10216
      __isset_bit_vector.clear();
10217
      __isset_bit_vector.or(other.__isset_bit_vector);
10218
      if (other.isSetCouponCode()) {
10219
        this.couponCode = other.couponCode;
10220
      }
10221
      this.transactionId = other.transactionId;
10222
      this.userId = other.userId;
10223
    }
10224
 
10225
    public trackCouponUsage_args deepCopy() {
10226
      return new trackCouponUsage_args(this);
10227
    }
10228
 
3430 rajveer 10229
    @Override
10230
    public void clear() {
10231
      this.couponCode = null;
10232
      setTransactionIdIsSet(false);
10233
      this.transactionId = 0;
10234
      setUserIdIsSet(false);
10235
      this.userId = 0;
1982 varun.gupt 10236
    }
10237
 
10238
    public String getCouponCode() {
10239
      return this.couponCode;
10240
    }
10241
 
3430 rajveer 10242
    public void setCouponCode(String couponCode) {
1982 varun.gupt 10243
      this.couponCode = couponCode;
10244
    }
10245
 
10246
    public void unsetCouponCode() {
10247
      this.couponCode = null;
10248
    }
10249
 
3430 rajveer 10250
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 10251
    public boolean isSetCouponCode() {
10252
      return this.couponCode != null;
10253
    }
10254
 
10255
    public void setCouponCodeIsSet(boolean value) {
10256
      if (!value) {
10257
        this.couponCode = null;
10258
      }
10259
    }
10260
 
10261
    public long getTransactionId() {
10262
      return this.transactionId;
10263
    }
10264
 
3430 rajveer 10265
    public void setTransactionId(long transactionId) {
1982 varun.gupt 10266
      this.transactionId = transactionId;
10267
      setTransactionIdIsSet(true);
10268
    }
10269
 
10270
    public void unsetTransactionId() {
10271
      __isset_bit_vector.clear(__TRANSACTIONID_ISSET_ID);
10272
    }
10273
 
3430 rajveer 10274
    /** Returns true if field transactionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 10275
    public boolean isSetTransactionId() {
10276
      return __isset_bit_vector.get(__TRANSACTIONID_ISSET_ID);
10277
    }
10278
 
10279
    public void setTransactionIdIsSet(boolean value) {
10280
      __isset_bit_vector.set(__TRANSACTIONID_ISSET_ID, value);
10281
    }
10282
 
10283
    public long getUserId() {
10284
      return this.userId;
10285
    }
10286
 
3430 rajveer 10287
    public void setUserId(long userId) {
1982 varun.gupt 10288
      this.userId = userId;
10289
      setUserIdIsSet(true);
10290
    }
10291
 
10292
    public void unsetUserId() {
10293
      __isset_bit_vector.clear(__USERID_ISSET_ID);
10294
    }
10295
 
3430 rajveer 10296
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 10297
    public boolean isSetUserId() {
10298
      return __isset_bit_vector.get(__USERID_ISSET_ID);
10299
    }
10300
 
10301
    public void setUserIdIsSet(boolean value) {
10302
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
10303
    }
10304
 
10305
    public void setFieldValue(_Fields field, Object value) {
10306
      switch (field) {
10307
      case COUPON_CODE:
10308
        if (value == null) {
10309
          unsetCouponCode();
10310
        } else {
10311
          setCouponCode((String)value);
10312
        }
10313
        break;
10314
 
10315
      case TRANSACTION_ID:
10316
        if (value == null) {
10317
          unsetTransactionId();
10318
        } else {
10319
          setTransactionId((Long)value);
10320
        }
10321
        break;
10322
 
10323
      case USER_ID:
10324
        if (value == null) {
10325
          unsetUserId();
10326
        } else {
10327
          setUserId((Long)value);
10328
        }
10329
        break;
10330
 
10331
      }
10332
    }
10333
 
10334
    public Object getFieldValue(_Fields field) {
10335
      switch (field) {
10336
      case COUPON_CODE:
10337
        return getCouponCode();
10338
 
10339
      case TRANSACTION_ID:
3430 rajveer 10340
        return Long.valueOf(getTransactionId());
1982 varun.gupt 10341
 
10342
      case USER_ID:
3430 rajveer 10343
        return Long.valueOf(getUserId());
1982 varun.gupt 10344
 
10345
      }
10346
      throw new IllegalStateException();
10347
    }
10348
 
3430 rajveer 10349
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10350
    public boolean isSet(_Fields field) {
10351
      if (field == null) {
10352
        throw new IllegalArgumentException();
10353
      }
1982 varun.gupt 10354
 
10355
      switch (field) {
10356
      case COUPON_CODE:
10357
        return isSetCouponCode();
10358
      case TRANSACTION_ID:
10359
        return isSetTransactionId();
10360
      case USER_ID:
10361
        return isSetUserId();
10362
      }
10363
      throw new IllegalStateException();
10364
    }
10365
 
10366
    @Override
10367
    public boolean equals(Object that) {
10368
      if (that == null)
10369
        return false;
10370
      if (that instanceof trackCouponUsage_args)
10371
        return this.equals((trackCouponUsage_args)that);
10372
      return false;
10373
    }
10374
 
10375
    public boolean equals(trackCouponUsage_args that) {
10376
      if (that == null)
10377
        return false;
10378
 
10379
      boolean this_present_couponCode = true && this.isSetCouponCode();
10380
      boolean that_present_couponCode = true && that.isSetCouponCode();
10381
      if (this_present_couponCode || that_present_couponCode) {
10382
        if (!(this_present_couponCode && that_present_couponCode))
10383
          return false;
10384
        if (!this.couponCode.equals(that.couponCode))
10385
          return false;
10386
      }
10387
 
10388
      boolean this_present_transactionId = true;
10389
      boolean that_present_transactionId = true;
10390
      if (this_present_transactionId || that_present_transactionId) {
10391
        if (!(this_present_transactionId && that_present_transactionId))
10392
          return false;
10393
        if (this.transactionId != that.transactionId)
10394
          return false;
10395
      }
10396
 
10397
      boolean this_present_userId = true;
10398
      boolean that_present_userId = true;
10399
      if (this_present_userId || that_present_userId) {
10400
        if (!(this_present_userId && that_present_userId))
10401
          return false;
10402
        if (this.userId != that.userId)
10403
          return false;
10404
      }
10405
 
10406
      return true;
10407
    }
10408
 
10409
    @Override
10410
    public int hashCode() {
10411
      return 0;
10412
    }
10413
 
10414
    public int compareTo(trackCouponUsage_args other) {
10415
      if (!getClass().equals(other.getClass())) {
10416
        return getClass().getName().compareTo(other.getClass().getName());
10417
      }
10418
 
10419
      int lastComparison = 0;
10420
      trackCouponUsage_args typedOther = (trackCouponUsage_args)other;
10421
 
3430 rajveer 10422
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 10423
      if (lastComparison != 0) {
10424
        return lastComparison;
10425
      }
3430 rajveer 10426
      if (isSetCouponCode()) {
10427
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
10428
        if (lastComparison != 0) {
10429
          return lastComparison;
10430
        }
1982 varun.gupt 10431
      }
3430 rajveer 10432
      lastComparison = Boolean.valueOf(isSetTransactionId()).compareTo(typedOther.isSetTransactionId());
1982 varun.gupt 10433
      if (lastComparison != 0) {
10434
        return lastComparison;
10435
      }
3430 rajveer 10436
      if (isSetTransactionId()) {
10437
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transactionId, typedOther.transactionId);
10438
        if (lastComparison != 0) {
10439
          return lastComparison;
10440
        }
1982 varun.gupt 10441
      }
3430 rajveer 10442
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 10443
      if (lastComparison != 0) {
10444
        return lastComparison;
10445
      }
3430 rajveer 10446
      if (isSetUserId()) {
10447
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
10448
        if (lastComparison != 0) {
10449
          return lastComparison;
10450
        }
1982 varun.gupt 10451
      }
10452
      return 0;
10453
    }
10454
 
3430 rajveer 10455
    public _Fields fieldForId(int fieldId) {
10456
      return _Fields.findByThriftId(fieldId);
10457
    }
10458
 
10459
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10460
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 10461
      iprot.readStructBegin();
10462
      while (true)
10463
      {
10464
        field = iprot.readFieldBegin();
3430 rajveer 10465
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 10466
          break;
10467
        }
3430 rajveer 10468
        switch (field.id) {
10469
          case 1: // COUPON_CODE
10470
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
10471
              this.couponCode = iprot.readString();
10472
            } else { 
10473
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10474
            }
10475
            break;
10476
          case 2: // TRANSACTION_ID
10477
            if (field.type == org.apache.thrift.protocol.TType.I64) {
10478
              this.transactionId = iprot.readI64();
10479
              setTransactionIdIsSet(true);
10480
            } else { 
10481
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10482
            }
10483
            break;
10484
          case 3: // USER_ID
10485
            if (field.type == org.apache.thrift.protocol.TType.I64) {
10486
              this.userId = iprot.readI64();
10487
              setUserIdIsSet(true);
10488
            } else { 
10489
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10490
            }
10491
            break;
10492
          default:
10493
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 10494
        }
3430 rajveer 10495
        iprot.readFieldEnd();
1982 varun.gupt 10496
      }
10497
      iprot.readStructEnd();
10498
      validate();
10499
    }
10500
 
3430 rajveer 10501
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 10502
      validate();
10503
 
10504
      oprot.writeStructBegin(STRUCT_DESC);
10505
      if (this.couponCode != null) {
10506
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
10507
        oprot.writeString(this.couponCode);
10508
        oprot.writeFieldEnd();
10509
      }
10510
      oprot.writeFieldBegin(TRANSACTION_ID_FIELD_DESC);
10511
      oprot.writeI64(this.transactionId);
10512
      oprot.writeFieldEnd();
10513
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
10514
      oprot.writeI64(this.userId);
10515
      oprot.writeFieldEnd();
10516
      oprot.writeFieldStop();
10517
      oprot.writeStructEnd();
10518
    }
10519
 
10520
    @Override
10521
    public String toString() {
10522
      StringBuilder sb = new StringBuilder("trackCouponUsage_args(");
10523
      boolean first = true;
10524
 
10525
      sb.append("couponCode:");
10526
      if (this.couponCode == null) {
10527
        sb.append("null");
10528
      } else {
10529
        sb.append(this.couponCode);
10530
      }
10531
      first = false;
10532
      if (!first) sb.append(", ");
10533
      sb.append("transactionId:");
10534
      sb.append(this.transactionId);
10535
      first = false;
10536
      if (!first) sb.append(", ");
10537
      sb.append("userId:");
10538
      sb.append(this.userId);
10539
      first = false;
10540
      sb.append(")");
10541
      return sb.toString();
10542
    }
10543
 
3430 rajveer 10544
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 10545
      // check for required fields
10546
    }
10547
 
3430 rajveer 10548
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10549
      try {
10550
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10551
      } catch (org.apache.thrift.TException te) {
10552
        throw new java.io.IOException(te);
10553
      }
10554
    }
10555
 
10556
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10557
      try {
10558
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
10559
        __isset_bit_vector = new BitSet(1);
10560
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10561
      } catch (org.apache.thrift.TException te) {
10562
        throw new java.io.IOException(te);
10563
      }
10564
    }
10565
 
1982 varun.gupt 10566
  }
10567
 
3430 rajveer 10568
  public static class trackCouponUsage_result implements org.apache.thrift.TBase<trackCouponUsage_result, trackCouponUsage_result._Fields>, java.io.Serializable, Cloneable   {
10569
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_result");
1982 varun.gupt 10570
 
3430 rajveer 10571
    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 10572
 
3430 rajveer 10573
    private PromotionException pex; // required
1982 varun.gupt 10574
 
10575
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 10576
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 10577
      PEX((short)1, "pex");
10578
 
10579
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10580
 
10581
      static {
10582
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10583
          byName.put(field.getFieldName(), field);
10584
        }
10585
      }
10586
 
10587
      /**
10588
       * Find the _Fields constant that matches fieldId, or null if its not found.
10589
       */
10590
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 10591
        switch(fieldId) {
10592
          case 1: // PEX
10593
            return PEX;
10594
          default:
10595
            return null;
10596
        }
1982 varun.gupt 10597
      }
10598
 
10599
      /**
10600
       * Find the _Fields constant that matches fieldId, throwing an exception
10601
       * if it is not found.
10602
       */
10603
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10604
        _Fields fields = findByThriftId(fieldId);
10605
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10606
        return fields;
10607
      }
10608
 
10609
      /**
10610
       * Find the _Fields constant that matches name, or null if its not found.
10611
       */
10612
      public static _Fields findByName(String name) {
10613
        return byName.get(name);
10614
      }
10615
 
10616
      private final short _thriftId;
10617
      private final String _fieldName;
10618
 
10619
      _Fields(short thriftId, String fieldName) {
10620
        _thriftId = thriftId;
10621
        _fieldName = fieldName;
10622
      }
10623
 
10624
      public short getThriftFieldId() {
10625
        return _thriftId;
10626
      }
10627
 
10628
      public String getFieldName() {
10629
        return _fieldName;
10630
      }
10631
    }
10632
 
10633
    // isset id assignments
10634
 
3430 rajveer 10635
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 10636
    static {
3430 rajveer 10637
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10638
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10639
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
10640
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10641
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_result.class, metaDataMap);
1982 varun.gupt 10642
    }
10643
 
10644
    public trackCouponUsage_result() {
10645
    }
10646
 
10647
    public trackCouponUsage_result(
10648
      PromotionException pex)
10649
    {
10650
      this();
10651
      this.pex = pex;
10652
    }
10653
 
10654
    /**
10655
     * Performs a deep copy on <i>other</i>.
10656
     */
10657
    public trackCouponUsage_result(trackCouponUsage_result other) {
10658
      if (other.isSetPex()) {
10659
        this.pex = new PromotionException(other.pex);
10660
      }
10661
    }
10662
 
10663
    public trackCouponUsage_result deepCopy() {
10664
      return new trackCouponUsage_result(this);
10665
    }
10666
 
3430 rajveer 10667
    @Override
10668
    public void clear() {
10669
      this.pex = null;
1982 varun.gupt 10670
    }
10671
 
10672
    public PromotionException getPex() {
10673
      return this.pex;
10674
    }
10675
 
3430 rajveer 10676
    public void setPex(PromotionException pex) {
1982 varun.gupt 10677
      this.pex = pex;
10678
    }
10679
 
10680
    public void unsetPex() {
10681
      this.pex = null;
10682
    }
10683
 
3430 rajveer 10684
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 10685
    public boolean isSetPex() {
10686
      return this.pex != null;
10687
    }
10688
 
10689
    public void setPexIsSet(boolean value) {
10690
      if (!value) {
10691
        this.pex = null;
10692
      }
10693
    }
10694
 
10695
    public void setFieldValue(_Fields field, Object value) {
10696
      switch (field) {
10697
      case PEX:
10698
        if (value == null) {
10699
          unsetPex();
10700
        } else {
10701
          setPex((PromotionException)value);
10702
        }
10703
        break;
10704
 
10705
      }
10706
    }
10707
 
10708
    public Object getFieldValue(_Fields field) {
10709
      switch (field) {
10710
      case PEX:
10711
        return getPex();
10712
 
10713
      }
10714
      throw new IllegalStateException();
10715
    }
10716
 
3430 rajveer 10717
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10718
    public boolean isSet(_Fields field) {
10719
      if (field == null) {
10720
        throw new IllegalArgumentException();
10721
      }
1982 varun.gupt 10722
 
10723
      switch (field) {
10724
      case PEX:
10725
        return isSetPex();
10726
      }
10727
      throw new IllegalStateException();
10728
    }
10729
 
10730
    @Override
10731
    public boolean equals(Object that) {
10732
      if (that == null)
10733
        return false;
10734
      if (that instanceof trackCouponUsage_result)
10735
        return this.equals((trackCouponUsage_result)that);
10736
      return false;
10737
    }
10738
 
10739
    public boolean equals(trackCouponUsage_result that) {
10740
      if (that == null)
10741
        return false;
10742
 
10743
      boolean this_present_pex = true && this.isSetPex();
10744
      boolean that_present_pex = true && that.isSetPex();
10745
      if (this_present_pex || that_present_pex) {
10746
        if (!(this_present_pex && that_present_pex))
10747
          return false;
10748
        if (!this.pex.equals(that.pex))
10749
          return false;
10750
      }
10751
 
10752
      return true;
10753
    }
10754
 
10755
    @Override
10756
    public int hashCode() {
10757
      return 0;
10758
    }
10759
 
10760
    public int compareTo(trackCouponUsage_result other) {
10761
      if (!getClass().equals(other.getClass())) {
10762
        return getClass().getName().compareTo(other.getClass().getName());
10763
      }
10764
 
10765
      int lastComparison = 0;
10766
      trackCouponUsage_result typedOther = (trackCouponUsage_result)other;
10767
 
3430 rajveer 10768
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 10769
      if (lastComparison != 0) {
10770
        return lastComparison;
10771
      }
3430 rajveer 10772
      if (isSetPex()) {
10773
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
10774
        if (lastComparison != 0) {
10775
          return lastComparison;
10776
        }
1982 varun.gupt 10777
      }
10778
      return 0;
10779
    }
10780
 
3430 rajveer 10781
    public _Fields fieldForId(int fieldId) {
10782
      return _Fields.findByThriftId(fieldId);
10783
    }
10784
 
10785
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10786
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 10787
      iprot.readStructBegin();
10788
      while (true)
10789
      {
10790
        field = iprot.readFieldBegin();
3430 rajveer 10791
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 10792
          break;
10793
        }
3430 rajveer 10794
        switch (field.id) {
10795
          case 1: // PEX
10796
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
10797
              this.pex = new PromotionException();
10798
              this.pex.read(iprot);
10799
            } else { 
10800
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10801
            }
10802
            break;
10803
          default:
10804
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 10805
        }
3430 rajveer 10806
        iprot.readFieldEnd();
1982 varun.gupt 10807
      }
10808
      iprot.readStructEnd();
10809
      validate();
10810
    }
10811
 
3430 rajveer 10812
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 10813
      oprot.writeStructBegin(STRUCT_DESC);
10814
 
10815
      if (this.isSetPex()) {
10816
        oprot.writeFieldBegin(PEX_FIELD_DESC);
10817
        this.pex.write(oprot);
10818
        oprot.writeFieldEnd();
10819
      }
10820
      oprot.writeFieldStop();
10821
      oprot.writeStructEnd();
10822
    }
10823
 
10824
    @Override
10825
    public String toString() {
10826
      StringBuilder sb = new StringBuilder("trackCouponUsage_result(");
10827
      boolean first = true;
10828
 
10829
      sb.append("pex:");
10830
      if (this.pex == null) {
10831
        sb.append("null");
10832
      } else {
10833
        sb.append(this.pex);
10834
      }
10835
      first = false;
10836
      sb.append(")");
10837
      return sb.toString();
10838
    }
10839
 
3430 rajveer 10840
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 10841
      // check for required fields
10842
    }
10843
 
3430 rajveer 10844
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10845
      try {
10846
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10847
      } catch (org.apache.thrift.TException te) {
10848
        throw new java.io.IOException(te);
10849
      }
10850
    }
10851
 
10852
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10853
      try {
10854
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10855
      } catch (org.apache.thrift.TException te) {
10856
        throw new java.io.IOException(te);
10857
      }
10858
    }
10859
 
1982 varun.gupt 10860
  }
10861
 
3430 rajveer 10862
  public static class getCouponUsageCountByUser_args implements org.apache.thrift.TBase<getCouponUsageCountByUser_args, getCouponUsageCountByUser_args._Fields>, java.io.Serializable, Cloneable   {
10863
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_args");
1982 varun.gupt 10864
 
3430 rajveer 10865
    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);
10866
    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 10867
 
3430 rajveer 10868
    private String couponCode; // required
10869
    private long userId; // required
1982 varun.gupt 10870
 
10871
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 10872
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 10873
      COUPON_CODE((short)1, "couponCode"),
10874
      USER_ID((short)2, "userId");
10875
 
10876
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10877
 
10878
      static {
10879
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10880
          byName.put(field.getFieldName(), field);
10881
        }
10882
      }
10883
 
10884
      /**
10885
       * Find the _Fields constant that matches fieldId, or null if its not found.
10886
       */
10887
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 10888
        switch(fieldId) {
10889
          case 1: // COUPON_CODE
10890
            return COUPON_CODE;
10891
          case 2: // USER_ID
10892
            return USER_ID;
10893
          default:
10894
            return null;
10895
        }
1982 varun.gupt 10896
      }
10897
 
10898
      /**
10899
       * Find the _Fields constant that matches fieldId, throwing an exception
10900
       * if it is not found.
10901
       */
10902
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10903
        _Fields fields = findByThriftId(fieldId);
10904
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10905
        return fields;
10906
      }
10907
 
10908
      /**
10909
       * Find the _Fields constant that matches name, or null if its not found.
10910
       */
10911
      public static _Fields findByName(String name) {
10912
        return byName.get(name);
10913
      }
10914
 
10915
      private final short _thriftId;
10916
      private final String _fieldName;
10917
 
10918
      _Fields(short thriftId, String fieldName) {
10919
        _thriftId = thriftId;
10920
        _fieldName = fieldName;
10921
      }
10922
 
10923
      public short getThriftFieldId() {
10924
        return _thriftId;
10925
      }
10926
 
10927
      public String getFieldName() {
10928
        return _fieldName;
10929
      }
10930
    }
10931
 
10932
    // isset id assignments
10933
    private static final int __USERID_ISSET_ID = 0;
10934
    private BitSet __isset_bit_vector = new BitSet(1);
10935
 
3430 rajveer 10936
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 10937
    static {
3430 rajveer 10938
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10939
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10940
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
10941
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10942
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
10943
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10944
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_args.class, metaDataMap);
1982 varun.gupt 10945
    }
10946
 
10947
    public getCouponUsageCountByUser_args() {
10948
    }
10949
 
10950
    public getCouponUsageCountByUser_args(
10951
      String couponCode,
10952
      long userId)
10953
    {
10954
      this();
10955
      this.couponCode = couponCode;
10956
      this.userId = userId;
10957
      setUserIdIsSet(true);
10958
    }
10959
 
10960
    /**
10961
     * Performs a deep copy on <i>other</i>.
10962
     */
10963
    public getCouponUsageCountByUser_args(getCouponUsageCountByUser_args other) {
10964
      __isset_bit_vector.clear();
10965
      __isset_bit_vector.or(other.__isset_bit_vector);
10966
      if (other.isSetCouponCode()) {
10967
        this.couponCode = other.couponCode;
10968
      }
10969
      this.userId = other.userId;
10970
    }
10971
 
10972
    public getCouponUsageCountByUser_args deepCopy() {
10973
      return new getCouponUsageCountByUser_args(this);
10974
    }
10975
 
3430 rajveer 10976
    @Override
10977
    public void clear() {
10978
      this.couponCode = null;
10979
      setUserIdIsSet(false);
10980
      this.userId = 0;
1982 varun.gupt 10981
    }
10982
 
10983
    public String getCouponCode() {
10984
      return this.couponCode;
10985
    }
10986
 
3430 rajveer 10987
    public void setCouponCode(String couponCode) {
1982 varun.gupt 10988
      this.couponCode = couponCode;
10989
    }
10990
 
10991
    public void unsetCouponCode() {
10992
      this.couponCode = null;
10993
    }
10994
 
3430 rajveer 10995
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 10996
    public boolean isSetCouponCode() {
10997
      return this.couponCode != null;
10998
    }
10999
 
11000
    public void setCouponCodeIsSet(boolean value) {
11001
      if (!value) {
11002
        this.couponCode = null;
11003
      }
11004
    }
11005
 
11006
    public long getUserId() {
11007
      return this.userId;
11008
    }
11009
 
3430 rajveer 11010
    public void setUserId(long userId) {
1982 varun.gupt 11011
      this.userId = userId;
11012
      setUserIdIsSet(true);
11013
    }
11014
 
11015
    public void unsetUserId() {
11016
      __isset_bit_vector.clear(__USERID_ISSET_ID);
11017
    }
11018
 
3430 rajveer 11019
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 11020
    public boolean isSetUserId() {
11021
      return __isset_bit_vector.get(__USERID_ISSET_ID);
11022
    }
11023
 
11024
    public void setUserIdIsSet(boolean value) {
11025
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
11026
    }
11027
 
11028
    public void setFieldValue(_Fields field, Object value) {
11029
      switch (field) {
11030
      case COUPON_CODE:
11031
        if (value == null) {
11032
          unsetCouponCode();
11033
        } else {
11034
          setCouponCode((String)value);
11035
        }
11036
        break;
11037
 
11038
      case USER_ID:
11039
        if (value == null) {
11040
          unsetUserId();
11041
        } else {
11042
          setUserId((Long)value);
11043
        }
11044
        break;
11045
 
11046
      }
11047
    }
11048
 
11049
    public Object getFieldValue(_Fields field) {
11050
      switch (field) {
11051
      case COUPON_CODE:
11052
        return getCouponCode();
11053
 
11054
      case USER_ID:
3430 rajveer 11055
        return Long.valueOf(getUserId());
1982 varun.gupt 11056
 
11057
      }
11058
      throw new IllegalStateException();
11059
    }
11060
 
3430 rajveer 11061
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11062
    public boolean isSet(_Fields field) {
11063
      if (field == null) {
11064
        throw new IllegalArgumentException();
11065
      }
1982 varun.gupt 11066
 
11067
      switch (field) {
11068
      case COUPON_CODE:
11069
        return isSetCouponCode();
11070
      case USER_ID:
11071
        return isSetUserId();
11072
      }
11073
      throw new IllegalStateException();
11074
    }
11075
 
11076
    @Override
11077
    public boolean equals(Object that) {
11078
      if (that == null)
11079
        return false;
11080
      if (that instanceof getCouponUsageCountByUser_args)
11081
        return this.equals((getCouponUsageCountByUser_args)that);
11082
      return false;
11083
    }
11084
 
11085
    public boolean equals(getCouponUsageCountByUser_args that) {
11086
      if (that == null)
11087
        return false;
11088
 
11089
      boolean this_present_couponCode = true && this.isSetCouponCode();
11090
      boolean that_present_couponCode = true && that.isSetCouponCode();
11091
      if (this_present_couponCode || that_present_couponCode) {
11092
        if (!(this_present_couponCode && that_present_couponCode))
11093
          return false;
11094
        if (!this.couponCode.equals(that.couponCode))
11095
          return false;
11096
      }
11097
 
11098
      boolean this_present_userId = true;
11099
      boolean that_present_userId = true;
11100
      if (this_present_userId || that_present_userId) {
11101
        if (!(this_present_userId && that_present_userId))
11102
          return false;
11103
        if (this.userId != that.userId)
11104
          return false;
11105
      }
11106
 
11107
      return true;
11108
    }
11109
 
11110
    @Override
11111
    public int hashCode() {
11112
      return 0;
11113
    }
11114
 
11115
    public int compareTo(getCouponUsageCountByUser_args other) {
11116
      if (!getClass().equals(other.getClass())) {
11117
        return getClass().getName().compareTo(other.getClass().getName());
11118
      }
11119
 
11120
      int lastComparison = 0;
11121
      getCouponUsageCountByUser_args typedOther = (getCouponUsageCountByUser_args)other;
11122
 
3430 rajveer 11123
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 11124
      if (lastComparison != 0) {
11125
        return lastComparison;
11126
      }
3430 rajveer 11127
      if (isSetCouponCode()) {
11128
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
11129
        if (lastComparison != 0) {
11130
          return lastComparison;
11131
        }
1982 varun.gupt 11132
      }
3430 rajveer 11133
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 11134
      if (lastComparison != 0) {
11135
        return lastComparison;
11136
      }
3430 rajveer 11137
      if (isSetUserId()) {
11138
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
11139
        if (lastComparison != 0) {
11140
          return lastComparison;
11141
        }
1982 varun.gupt 11142
      }
11143
      return 0;
11144
    }
11145
 
3430 rajveer 11146
    public _Fields fieldForId(int fieldId) {
11147
      return _Fields.findByThriftId(fieldId);
11148
    }
11149
 
11150
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11151
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 11152
      iprot.readStructBegin();
11153
      while (true)
11154
      {
11155
        field = iprot.readFieldBegin();
3430 rajveer 11156
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 11157
          break;
11158
        }
3430 rajveer 11159
        switch (field.id) {
11160
          case 1: // COUPON_CODE
11161
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
11162
              this.couponCode = iprot.readString();
11163
            } else { 
11164
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11165
            }
11166
            break;
11167
          case 2: // USER_ID
11168
            if (field.type == org.apache.thrift.protocol.TType.I64) {
11169
              this.userId = iprot.readI64();
11170
              setUserIdIsSet(true);
11171
            } else { 
11172
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11173
            }
11174
            break;
11175
          default:
11176
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 11177
        }
3430 rajveer 11178
        iprot.readFieldEnd();
1982 varun.gupt 11179
      }
11180
      iprot.readStructEnd();
11181
      validate();
11182
    }
11183
 
3430 rajveer 11184
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 11185
      validate();
11186
 
11187
      oprot.writeStructBegin(STRUCT_DESC);
11188
      if (this.couponCode != null) {
11189
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
11190
        oprot.writeString(this.couponCode);
11191
        oprot.writeFieldEnd();
11192
      }
11193
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
11194
      oprot.writeI64(this.userId);
11195
      oprot.writeFieldEnd();
11196
      oprot.writeFieldStop();
11197
      oprot.writeStructEnd();
11198
    }
11199
 
11200
    @Override
11201
    public String toString() {
11202
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_args(");
11203
      boolean first = true;
11204
 
11205
      sb.append("couponCode:");
11206
      if (this.couponCode == null) {
11207
        sb.append("null");
11208
      } else {
11209
        sb.append(this.couponCode);
11210
      }
11211
      first = false;
11212
      if (!first) sb.append(", ");
11213
      sb.append("userId:");
11214
      sb.append(this.userId);
11215
      first = false;
11216
      sb.append(")");
11217
      return sb.toString();
11218
    }
11219
 
3430 rajveer 11220
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 11221
      // check for required fields
11222
    }
11223
 
3430 rajveer 11224
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11225
      try {
11226
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11227
      } catch (org.apache.thrift.TException te) {
11228
        throw new java.io.IOException(te);
11229
      }
11230
    }
11231
 
11232
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11233
      try {
11234
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
11235
        __isset_bit_vector = new BitSet(1);
11236
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11237
      } catch (org.apache.thrift.TException te) {
11238
        throw new java.io.IOException(te);
11239
      }
11240
    }
11241
 
1982 varun.gupt 11242
  }
11243
 
3430 rajveer 11244
  public static class getCouponUsageCountByUser_result implements org.apache.thrift.TBase<getCouponUsageCountByUser_result, getCouponUsageCountByUser_result._Fields>, java.io.Serializable, Cloneable   {
11245
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_result");
1982 varun.gupt 11246
 
3430 rajveer 11247
    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);
11248
    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 11249
 
3430 rajveer 11250
    private long success; // required
11251
    private PromotionException pex; // required
1982 varun.gupt 11252
 
11253
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 11254
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 11255
      SUCCESS((short)0, "success"),
11256
      PEX((short)1, "pex");
11257
 
11258
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11259
 
11260
      static {
11261
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11262
          byName.put(field.getFieldName(), field);
11263
        }
11264
      }
11265
 
11266
      /**
11267
       * Find the _Fields constant that matches fieldId, or null if its not found.
11268
       */
11269
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 11270
        switch(fieldId) {
11271
          case 0: // SUCCESS
11272
            return SUCCESS;
11273
          case 1: // PEX
11274
            return PEX;
11275
          default:
11276
            return null;
11277
        }
1982 varun.gupt 11278
      }
11279
 
11280
      /**
11281
       * Find the _Fields constant that matches fieldId, throwing an exception
11282
       * if it is not found.
11283
       */
11284
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11285
        _Fields fields = findByThriftId(fieldId);
11286
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11287
        return fields;
11288
      }
11289
 
11290
      /**
11291
       * Find the _Fields constant that matches name, or null if its not found.
11292
       */
11293
      public static _Fields findByName(String name) {
11294
        return byName.get(name);
11295
      }
11296
 
11297
      private final short _thriftId;
11298
      private final String _fieldName;
11299
 
11300
      _Fields(short thriftId, String fieldName) {
11301
        _thriftId = thriftId;
11302
        _fieldName = fieldName;
11303
      }
11304
 
11305
      public short getThriftFieldId() {
11306
        return _thriftId;
11307
      }
11308
 
11309
      public String getFieldName() {
11310
        return _fieldName;
11311
      }
11312
    }
11313
 
11314
    // isset id assignments
11315
    private static final int __SUCCESS_ISSET_ID = 0;
11316
    private BitSet __isset_bit_vector = new BitSet(1);
11317
 
3430 rajveer 11318
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 11319
    static {
3430 rajveer 11320
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11321
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11322
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
11323
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11324
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
11325
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11326
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_result.class, metaDataMap);
1982 varun.gupt 11327
    }
11328
 
11329
    public getCouponUsageCountByUser_result() {
11330
    }
11331
 
11332
    public getCouponUsageCountByUser_result(
11333
      long success,
11334
      PromotionException pex)
11335
    {
11336
      this();
11337
      this.success = success;
11338
      setSuccessIsSet(true);
11339
      this.pex = pex;
11340
    }
11341
 
11342
    /**
11343
     * Performs a deep copy on <i>other</i>.
11344
     */
11345
    public getCouponUsageCountByUser_result(getCouponUsageCountByUser_result other) {
11346
      __isset_bit_vector.clear();
11347
      __isset_bit_vector.or(other.__isset_bit_vector);
11348
      this.success = other.success;
11349
      if (other.isSetPex()) {
11350
        this.pex = new PromotionException(other.pex);
11351
      }
11352
    }
11353
 
11354
    public getCouponUsageCountByUser_result deepCopy() {
11355
      return new getCouponUsageCountByUser_result(this);
11356
    }
11357
 
3430 rajveer 11358
    @Override
11359
    public void clear() {
11360
      setSuccessIsSet(false);
11361
      this.success = 0;
11362
      this.pex = null;
1982 varun.gupt 11363
    }
11364
 
11365
    public long getSuccess() {
11366
      return this.success;
11367
    }
11368
 
3430 rajveer 11369
    public void setSuccess(long success) {
1982 varun.gupt 11370
      this.success = success;
11371
      setSuccessIsSet(true);
11372
    }
11373
 
11374
    public void unsetSuccess() {
11375
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
11376
    }
11377
 
3430 rajveer 11378
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 11379
    public boolean isSetSuccess() {
11380
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
11381
    }
11382
 
11383
    public void setSuccessIsSet(boolean value) {
11384
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
11385
    }
11386
 
11387
    public PromotionException getPex() {
11388
      return this.pex;
11389
    }
11390
 
3430 rajveer 11391
    public void setPex(PromotionException pex) {
1982 varun.gupt 11392
      this.pex = pex;
11393
    }
11394
 
11395
    public void unsetPex() {
11396
      this.pex = null;
11397
    }
11398
 
3430 rajveer 11399
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 11400
    public boolean isSetPex() {
11401
      return this.pex != null;
11402
    }
11403
 
11404
    public void setPexIsSet(boolean value) {
11405
      if (!value) {
11406
        this.pex = null;
11407
      }
11408
    }
11409
 
11410
    public void setFieldValue(_Fields field, Object value) {
11411
      switch (field) {
11412
      case SUCCESS:
11413
        if (value == null) {
11414
          unsetSuccess();
11415
        } else {
11416
          setSuccess((Long)value);
11417
        }
11418
        break;
11419
 
11420
      case PEX:
11421
        if (value == null) {
11422
          unsetPex();
11423
        } else {
11424
          setPex((PromotionException)value);
11425
        }
11426
        break;
11427
 
11428
      }
11429
    }
11430
 
11431
    public Object getFieldValue(_Fields field) {
11432
      switch (field) {
11433
      case SUCCESS:
3430 rajveer 11434
        return Long.valueOf(getSuccess());
1982 varun.gupt 11435
 
11436
      case PEX:
11437
        return getPex();
11438
 
11439
      }
11440
      throw new IllegalStateException();
11441
    }
11442
 
3430 rajveer 11443
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11444
    public boolean isSet(_Fields field) {
11445
      if (field == null) {
11446
        throw new IllegalArgumentException();
11447
      }
1982 varun.gupt 11448
 
11449
      switch (field) {
11450
      case SUCCESS:
11451
        return isSetSuccess();
11452
      case PEX:
11453
        return isSetPex();
11454
      }
11455
      throw new IllegalStateException();
11456
    }
11457
 
11458
    @Override
11459
    public boolean equals(Object that) {
11460
      if (that == null)
11461
        return false;
11462
      if (that instanceof getCouponUsageCountByUser_result)
11463
        return this.equals((getCouponUsageCountByUser_result)that);
11464
      return false;
11465
    }
11466
 
11467
    public boolean equals(getCouponUsageCountByUser_result that) {
11468
      if (that == null)
11469
        return false;
11470
 
11471
      boolean this_present_success = true;
11472
      boolean that_present_success = true;
11473
      if (this_present_success || that_present_success) {
11474
        if (!(this_present_success && that_present_success))
11475
          return false;
11476
        if (this.success != that.success)
11477
          return false;
11478
      }
11479
 
11480
      boolean this_present_pex = true && this.isSetPex();
11481
      boolean that_present_pex = true && that.isSetPex();
11482
      if (this_present_pex || that_present_pex) {
11483
        if (!(this_present_pex && that_present_pex))
11484
          return false;
11485
        if (!this.pex.equals(that.pex))
11486
          return false;
11487
      }
11488
 
11489
      return true;
11490
    }
11491
 
11492
    @Override
11493
    public int hashCode() {
11494
      return 0;
11495
    }
11496
 
11497
    public int compareTo(getCouponUsageCountByUser_result other) {
11498
      if (!getClass().equals(other.getClass())) {
11499
        return getClass().getName().compareTo(other.getClass().getName());
11500
      }
11501
 
11502
      int lastComparison = 0;
11503
      getCouponUsageCountByUser_result typedOther = (getCouponUsageCountByUser_result)other;
11504
 
3430 rajveer 11505
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 11506
      if (lastComparison != 0) {
11507
        return lastComparison;
11508
      }
3430 rajveer 11509
      if (isSetSuccess()) {
11510
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
11511
        if (lastComparison != 0) {
11512
          return lastComparison;
11513
        }
1982 varun.gupt 11514
      }
3430 rajveer 11515
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 11516
      if (lastComparison != 0) {
11517
        return lastComparison;
11518
      }
3430 rajveer 11519
      if (isSetPex()) {
11520
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
11521
        if (lastComparison != 0) {
11522
          return lastComparison;
11523
        }
1982 varun.gupt 11524
      }
11525
      return 0;
11526
    }
11527
 
3430 rajveer 11528
    public _Fields fieldForId(int fieldId) {
11529
      return _Fields.findByThriftId(fieldId);
11530
    }
11531
 
11532
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11533
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 11534
      iprot.readStructBegin();
11535
      while (true)
11536
      {
11537
        field = iprot.readFieldBegin();
3430 rajveer 11538
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 11539
          break;
11540
        }
3430 rajveer 11541
        switch (field.id) {
11542
          case 0: // SUCCESS
11543
            if (field.type == org.apache.thrift.protocol.TType.I64) {
11544
              this.success = iprot.readI64();
11545
              setSuccessIsSet(true);
11546
            } else { 
11547
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11548
            }
11549
            break;
11550
          case 1: // PEX
11551
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
11552
              this.pex = new PromotionException();
11553
              this.pex.read(iprot);
11554
            } else { 
11555
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11556
            }
11557
            break;
11558
          default:
11559
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 11560
        }
3430 rajveer 11561
        iprot.readFieldEnd();
1982 varun.gupt 11562
      }
11563
      iprot.readStructEnd();
11564
      validate();
11565
    }
11566
 
3430 rajveer 11567
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 11568
      oprot.writeStructBegin(STRUCT_DESC);
11569
 
11570
      if (this.isSetSuccess()) {
11571
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
11572
        oprot.writeI64(this.success);
11573
        oprot.writeFieldEnd();
11574
      } else if (this.isSetPex()) {
11575
        oprot.writeFieldBegin(PEX_FIELD_DESC);
11576
        this.pex.write(oprot);
11577
        oprot.writeFieldEnd();
11578
      }
11579
      oprot.writeFieldStop();
11580
      oprot.writeStructEnd();
11581
    }
11582
 
11583
    @Override
11584
    public String toString() {
11585
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_result(");
11586
      boolean first = true;
11587
 
11588
      sb.append("success:");
11589
      sb.append(this.success);
11590
      first = false;
11591
      if (!first) sb.append(", ");
11592
      sb.append("pex:");
11593
      if (this.pex == null) {
11594
        sb.append("null");
11595
      } else {
11596
        sb.append(this.pex);
11597
      }
11598
      first = false;
11599
      sb.append(")");
11600
      return sb.toString();
11601
    }
11602
 
3430 rajveer 11603
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 11604
      // check for required fields
11605
    }
11606
 
3430 rajveer 11607
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11608
      try {
11609
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11610
      } catch (org.apache.thrift.TException te) {
11611
        throw new java.io.IOException(te);
11612
      }
11613
    }
11614
 
11615
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11616
      try {
11617
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11618
      } catch (org.apache.thrift.TException te) {
11619
        throw new java.io.IOException(te);
11620
      }
11621
    }
11622
 
1982 varun.gupt 11623
  }
11624
 
6497 amit.gupta 11625
  public static class getActiveCodes_args implements org.apache.thrift.TBase<getActiveCodes_args, getActiveCodes_args._Fields>, java.io.Serializable, Cloneable   {
11626
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCodes_args");
11627
 
11628
    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);
11629
 
11630
    private long promotionId; // required
11631
 
11632
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11633
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11634
      PROMOTION_ID((short)1, "promotionId");
11635
 
11636
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11637
 
11638
      static {
11639
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11640
          byName.put(field.getFieldName(), field);
11641
        }
11642
      }
11643
 
11644
      /**
11645
       * Find the _Fields constant that matches fieldId, or null if its not found.
11646
       */
11647
      public static _Fields findByThriftId(int fieldId) {
11648
        switch(fieldId) {
11649
          case 1: // PROMOTION_ID
11650
            return PROMOTION_ID;
11651
          default:
11652
            return null;
11653
        }
11654
      }
11655
 
11656
      /**
11657
       * Find the _Fields constant that matches fieldId, throwing an exception
11658
       * if it is not found.
11659
       */
11660
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11661
        _Fields fields = findByThriftId(fieldId);
11662
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11663
        return fields;
11664
      }
11665
 
11666
      /**
11667
       * Find the _Fields constant that matches name, or null if its not found.
11668
       */
11669
      public static _Fields findByName(String name) {
11670
        return byName.get(name);
11671
      }
11672
 
11673
      private final short _thriftId;
11674
      private final String _fieldName;
11675
 
11676
      _Fields(short thriftId, String fieldName) {
11677
        _thriftId = thriftId;
11678
        _fieldName = fieldName;
11679
      }
11680
 
11681
      public short getThriftFieldId() {
11682
        return _thriftId;
11683
      }
11684
 
11685
      public String getFieldName() {
11686
        return _fieldName;
11687
      }
11688
    }
11689
 
11690
    // isset id assignments
11691
    private static final int __PROMOTIONID_ISSET_ID = 0;
11692
    private BitSet __isset_bit_vector = new BitSet(1);
11693
 
11694
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
11695
    static {
11696
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11697
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11698
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
11699
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11700
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCodes_args.class, metaDataMap);
11701
    }
11702
 
11703
    public getActiveCodes_args() {
11704
    }
11705
 
11706
    public getActiveCodes_args(
11707
      long promotionId)
11708
    {
11709
      this();
11710
      this.promotionId = promotionId;
11711
      setPromotionIdIsSet(true);
11712
    }
11713
 
11714
    /**
11715
     * Performs a deep copy on <i>other</i>.
11716
     */
11717
    public getActiveCodes_args(getActiveCodes_args other) {
11718
      __isset_bit_vector.clear();
11719
      __isset_bit_vector.or(other.__isset_bit_vector);
11720
      this.promotionId = other.promotionId;
11721
    }
11722
 
11723
    public getActiveCodes_args deepCopy() {
11724
      return new getActiveCodes_args(this);
11725
    }
11726
 
11727
    @Override
11728
    public void clear() {
11729
      setPromotionIdIsSet(false);
11730
      this.promotionId = 0;
11731
    }
11732
 
11733
    public long getPromotionId() {
11734
      return this.promotionId;
11735
    }
11736
 
11737
    public void setPromotionId(long promotionId) {
11738
      this.promotionId = promotionId;
11739
      setPromotionIdIsSet(true);
11740
    }
11741
 
11742
    public void unsetPromotionId() {
11743
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
11744
    }
11745
 
11746
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
11747
    public boolean isSetPromotionId() {
11748
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
11749
    }
11750
 
11751
    public void setPromotionIdIsSet(boolean value) {
11752
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
11753
    }
11754
 
11755
    public void setFieldValue(_Fields field, Object value) {
11756
      switch (field) {
11757
      case PROMOTION_ID:
11758
        if (value == null) {
11759
          unsetPromotionId();
11760
        } else {
11761
          setPromotionId((Long)value);
11762
        }
11763
        break;
11764
 
11765
      }
11766
    }
11767
 
11768
    public Object getFieldValue(_Fields field) {
11769
      switch (field) {
11770
      case PROMOTION_ID:
11771
        return Long.valueOf(getPromotionId());
11772
 
11773
      }
11774
      throw new IllegalStateException();
11775
    }
11776
 
11777
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11778
    public boolean isSet(_Fields field) {
11779
      if (field == null) {
11780
        throw new IllegalArgumentException();
11781
      }
11782
 
11783
      switch (field) {
11784
      case PROMOTION_ID:
11785
        return isSetPromotionId();
11786
      }
11787
      throw new IllegalStateException();
11788
    }
11789
 
11790
    @Override
11791
    public boolean equals(Object that) {
11792
      if (that == null)
11793
        return false;
11794
      if (that instanceof getActiveCodes_args)
11795
        return this.equals((getActiveCodes_args)that);
11796
      return false;
11797
    }
11798
 
11799
    public boolean equals(getActiveCodes_args that) {
11800
      if (that == null)
11801
        return false;
11802
 
11803
      boolean this_present_promotionId = true;
11804
      boolean that_present_promotionId = true;
11805
      if (this_present_promotionId || that_present_promotionId) {
11806
        if (!(this_present_promotionId && that_present_promotionId))
11807
          return false;
11808
        if (this.promotionId != that.promotionId)
11809
          return false;
11810
      }
11811
 
11812
      return true;
11813
    }
11814
 
11815
    @Override
11816
    public int hashCode() {
11817
      return 0;
11818
    }
11819
 
11820
    public int compareTo(getActiveCodes_args other) {
11821
      if (!getClass().equals(other.getClass())) {
11822
        return getClass().getName().compareTo(other.getClass().getName());
11823
      }
11824
 
11825
      int lastComparison = 0;
11826
      getActiveCodes_args typedOther = (getActiveCodes_args)other;
11827
 
11828
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
11829
      if (lastComparison != 0) {
11830
        return lastComparison;
11831
      }
11832
      if (isSetPromotionId()) {
11833
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
11834
        if (lastComparison != 0) {
11835
          return lastComparison;
11836
        }
11837
      }
11838
      return 0;
11839
    }
11840
 
11841
    public _Fields fieldForId(int fieldId) {
11842
      return _Fields.findByThriftId(fieldId);
11843
    }
11844
 
11845
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11846
      org.apache.thrift.protocol.TField field;
11847
      iprot.readStructBegin();
11848
      while (true)
11849
      {
11850
        field = iprot.readFieldBegin();
11851
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
11852
          break;
11853
        }
11854
        switch (field.id) {
11855
          case 1: // PROMOTION_ID
11856
            if (field.type == org.apache.thrift.protocol.TType.I64) {
11857
              this.promotionId = iprot.readI64();
11858
              setPromotionIdIsSet(true);
11859
            } else { 
11860
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11861
            }
11862
            break;
11863
          default:
11864
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11865
        }
11866
        iprot.readFieldEnd();
11867
      }
11868
      iprot.readStructEnd();
11869
      validate();
11870
    }
11871
 
11872
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
11873
      validate();
11874
 
11875
      oprot.writeStructBegin(STRUCT_DESC);
11876
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
11877
      oprot.writeI64(this.promotionId);
11878
      oprot.writeFieldEnd();
11879
      oprot.writeFieldStop();
11880
      oprot.writeStructEnd();
11881
    }
11882
 
11883
    @Override
11884
    public String toString() {
11885
      StringBuilder sb = new StringBuilder("getActiveCodes_args(");
11886
      boolean first = true;
11887
 
11888
      sb.append("promotionId:");
11889
      sb.append(this.promotionId);
11890
      first = false;
11891
      sb.append(")");
11892
      return sb.toString();
11893
    }
11894
 
11895
    public void validate() throws org.apache.thrift.TException {
11896
      // check for required fields
11897
    }
11898
 
11899
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11900
      try {
11901
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11902
      } catch (org.apache.thrift.TException te) {
11903
        throw new java.io.IOException(te);
11904
      }
11905
    }
11906
 
11907
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11908
      try {
11909
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
11910
        __isset_bit_vector = new BitSet(1);
11911
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11912
      } catch (org.apache.thrift.TException te) {
11913
        throw new java.io.IOException(te);
11914
      }
11915
    }
11916
 
11917
  }
11918
 
11919
  public static class getActiveCodes_result implements org.apache.thrift.TBase<getActiveCodes_result, getActiveCodes_result._Fields>, java.io.Serializable, Cloneable   {
11920
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCodes_result");
11921
 
11922
    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);
11923
    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);
11924
 
11925
    private List<Coupon> success; // required
11926
    private PromotionException pex; // required
11927
 
11928
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11929
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11930
      SUCCESS((short)0, "success"),
11931
      PEX((short)1, "pex");
11932
 
11933
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11934
 
11935
      static {
11936
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11937
          byName.put(field.getFieldName(), field);
11938
        }
11939
      }
11940
 
11941
      /**
11942
       * Find the _Fields constant that matches fieldId, or null if its not found.
11943
       */
11944
      public static _Fields findByThriftId(int fieldId) {
11945
        switch(fieldId) {
11946
          case 0: // SUCCESS
11947
            return SUCCESS;
11948
          case 1: // PEX
11949
            return PEX;
11950
          default:
11951
            return null;
11952
        }
11953
      }
11954
 
11955
      /**
11956
       * Find the _Fields constant that matches fieldId, throwing an exception
11957
       * if it is not found.
11958
       */
11959
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11960
        _Fields fields = findByThriftId(fieldId);
11961
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11962
        return fields;
11963
      }
11964
 
11965
      /**
11966
       * Find the _Fields constant that matches name, or null if its not found.
11967
       */
11968
      public static _Fields findByName(String name) {
11969
        return byName.get(name);
11970
      }
11971
 
11972
      private final short _thriftId;
11973
      private final String _fieldName;
11974
 
11975
      _Fields(short thriftId, String fieldName) {
11976
        _thriftId = thriftId;
11977
        _fieldName = fieldName;
11978
      }
11979
 
11980
      public short getThriftFieldId() {
11981
        return _thriftId;
11982
      }
11983
 
11984
      public String getFieldName() {
11985
        return _fieldName;
11986
      }
11987
    }
11988
 
11989
    // isset id assignments
11990
 
11991
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
11992
    static {
11993
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11994
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11995
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
11996
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
11997
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11998
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
11999
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12000
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCodes_result.class, metaDataMap);
12001
    }
12002
 
12003
    public getActiveCodes_result() {
12004
    }
12005
 
12006
    public getActiveCodes_result(
12007
      List<Coupon> success,
12008
      PromotionException pex)
12009
    {
12010
      this();
12011
      this.success = success;
12012
      this.pex = pex;
12013
    }
12014
 
12015
    /**
12016
     * Performs a deep copy on <i>other</i>.
12017
     */
12018
    public getActiveCodes_result(getActiveCodes_result other) {
12019
      if (other.isSetSuccess()) {
12020
        List<Coupon> __this__success = new ArrayList<Coupon>();
12021
        for (Coupon other_element : other.success) {
12022
          __this__success.add(new Coupon(other_element));
12023
        }
12024
        this.success = __this__success;
12025
      }
12026
      if (other.isSetPex()) {
12027
        this.pex = new PromotionException(other.pex);
12028
      }
12029
    }
12030
 
12031
    public getActiveCodes_result deepCopy() {
12032
      return new getActiveCodes_result(this);
12033
    }
12034
 
12035
    @Override
12036
    public void clear() {
12037
      this.success = null;
12038
      this.pex = null;
12039
    }
12040
 
12041
    public int getSuccessSize() {
12042
      return (this.success == null) ? 0 : this.success.size();
12043
    }
12044
 
12045
    public java.util.Iterator<Coupon> getSuccessIterator() {
12046
      return (this.success == null) ? null : this.success.iterator();
12047
    }
12048
 
12049
    public void addToSuccess(Coupon elem) {
12050
      if (this.success == null) {
12051
        this.success = new ArrayList<Coupon>();
12052
      }
12053
      this.success.add(elem);
12054
    }
12055
 
12056
    public List<Coupon> getSuccess() {
12057
      return this.success;
12058
    }
12059
 
12060
    public void setSuccess(List<Coupon> success) {
12061
      this.success = success;
12062
    }
12063
 
12064
    public void unsetSuccess() {
12065
      this.success = null;
12066
    }
12067
 
12068
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
12069
    public boolean isSetSuccess() {
12070
      return this.success != null;
12071
    }
12072
 
12073
    public void setSuccessIsSet(boolean value) {
12074
      if (!value) {
12075
        this.success = null;
12076
      }
12077
    }
12078
 
12079
    public PromotionException getPex() {
12080
      return this.pex;
12081
    }
12082
 
12083
    public void setPex(PromotionException pex) {
12084
      this.pex = pex;
12085
    }
12086
 
12087
    public void unsetPex() {
12088
      this.pex = null;
12089
    }
12090
 
12091
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
12092
    public boolean isSetPex() {
12093
      return this.pex != null;
12094
    }
12095
 
12096
    public void setPexIsSet(boolean value) {
12097
      if (!value) {
12098
        this.pex = null;
12099
      }
12100
    }
12101
 
12102
    public void setFieldValue(_Fields field, Object value) {
12103
      switch (field) {
12104
      case SUCCESS:
12105
        if (value == null) {
12106
          unsetSuccess();
12107
        } else {
12108
          setSuccess((List<Coupon>)value);
12109
        }
12110
        break;
12111
 
12112
      case PEX:
12113
        if (value == null) {
12114
          unsetPex();
12115
        } else {
12116
          setPex((PromotionException)value);
12117
        }
12118
        break;
12119
 
12120
      }
12121
    }
12122
 
12123
    public Object getFieldValue(_Fields field) {
12124
      switch (field) {
12125
      case SUCCESS:
12126
        return getSuccess();
12127
 
12128
      case PEX:
12129
        return getPex();
12130
 
12131
      }
12132
      throw new IllegalStateException();
12133
    }
12134
 
12135
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12136
    public boolean isSet(_Fields field) {
12137
      if (field == null) {
12138
        throw new IllegalArgumentException();
12139
      }
12140
 
12141
      switch (field) {
12142
      case SUCCESS:
12143
        return isSetSuccess();
12144
      case PEX:
12145
        return isSetPex();
12146
      }
12147
      throw new IllegalStateException();
12148
    }
12149
 
12150
    @Override
12151
    public boolean equals(Object that) {
12152
      if (that == null)
12153
        return false;
12154
      if (that instanceof getActiveCodes_result)
12155
        return this.equals((getActiveCodes_result)that);
12156
      return false;
12157
    }
12158
 
12159
    public boolean equals(getActiveCodes_result that) {
12160
      if (that == null)
12161
        return false;
12162
 
12163
      boolean this_present_success = true && this.isSetSuccess();
12164
      boolean that_present_success = true && that.isSetSuccess();
12165
      if (this_present_success || that_present_success) {
12166
        if (!(this_present_success && that_present_success))
12167
          return false;
12168
        if (!this.success.equals(that.success))
12169
          return false;
12170
      }
12171
 
12172
      boolean this_present_pex = true && this.isSetPex();
12173
      boolean that_present_pex = true && that.isSetPex();
12174
      if (this_present_pex || that_present_pex) {
12175
        if (!(this_present_pex && that_present_pex))
12176
          return false;
12177
        if (!this.pex.equals(that.pex))
12178
          return false;
12179
      }
12180
 
12181
      return true;
12182
    }
12183
 
12184
    @Override
12185
    public int hashCode() {
12186
      return 0;
12187
    }
12188
 
12189
    public int compareTo(getActiveCodes_result other) {
12190
      if (!getClass().equals(other.getClass())) {
12191
        return getClass().getName().compareTo(other.getClass().getName());
12192
      }
12193
 
12194
      int lastComparison = 0;
12195
      getActiveCodes_result typedOther = (getActiveCodes_result)other;
12196
 
12197
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
12198
      if (lastComparison != 0) {
12199
        return lastComparison;
12200
      }
12201
      if (isSetSuccess()) {
12202
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
12203
        if (lastComparison != 0) {
12204
          return lastComparison;
12205
        }
12206
      }
12207
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
12208
      if (lastComparison != 0) {
12209
        return lastComparison;
12210
      }
12211
      if (isSetPex()) {
12212
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
12213
        if (lastComparison != 0) {
12214
          return lastComparison;
12215
        }
12216
      }
12217
      return 0;
12218
    }
12219
 
12220
    public _Fields fieldForId(int fieldId) {
12221
      return _Fields.findByThriftId(fieldId);
12222
    }
12223
 
12224
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12225
      org.apache.thrift.protocol.TField field;
12226
      iprot.readStructBegin();
12227
      while (true)
12228
      {
12229
        field = iprot.readFieldBegin();
12230
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12231
          break;
12232
        }
12233
        switch (field.id) {
12234
          case 0: // SUCCESS
12235
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
12236
              {
6736 amit.gupta 12237
                org.apache.thrift.protocol.TList _list26 = iprot.readListBegin();
12238
                this.success = new ArrayList<Coupon>(_list26.size);
12239
                for (int _i27 = 0; _i27 < _list26.size; ++_i27)
6497 amit.gupta 12240
                {
6736 amit.gupta 12241
                  Coupon _elem28; // required
12242
                  _elem28 = new Coupon();
12243
                  _elem28.read(iprot);
12244
                  this.success.add(_elem28);
6497 amit.gupta 12245
                }
12246
                iprot.readListEnd();
12247
              }
12248
            } else { 
12249
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12250
            }
12251
            break;
12252
          case 1: // PEX
12253
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
12254
              this.pex = new PromotionException();
12255
              this.pex.read(iprot);
12256
            } else { 
12257
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12258
            }
12259
            break;
12260
          default:
12261
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12262
        }
12263
        iprot.readFieldEnd();
12264
      }
12265
      iprot.readStructEnd();
12266
      validate();
12267
    }
12268
 
12269
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12270
      oprot.writeStructBegin(STRUCT_DESC);
12271
 
12272
      if (this.isSetSuccess()) {
12273
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
12274
        {
12275
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
6736 amit.gupta 12276
          for (Coupon _iter29 : this.success)
6497 amit.gupta 12277
          {
6736 amit.gupta 12278
            _iter29.write(oprot);
6497 amit.gupta 12279
          }
12280
          oprot.writeListEnd();
12281
        }
12282
        oprot.writeFieldEnd();
12283
      } else if (this.isSetPex()) {
12284
        oprot.writeFieldBegin(PEX_FIELD_DESC);
12285
        this.pex.write(oprot);
12286
        oprot.writeFieldEnd();
12287
      }
12288
      oprot.writeFieldStop();
12289
      oprot.writeStructEnd();
12290
    }
12291
 
12292
    @Override
12293
    public String toString() {
12294
      StringBuilder sb = new StringBuilder("getActiveCodes_result(");
12295
      boolean first = true;
12296
 
12297
      sb.append("success:");
12298
      if (this.success == null) {
12299
        sb.append("null");
12300
      } else {
12301
        sb.append(this.success);
12302
      }
12303
      first = false;
12304
      if (!first) sb.append(", ");
12305
      sb.append("pex:");
12306
      if (this.pex == null) {
12307
        sb.append("null");
12308
      } else {
12309
        sb.append(this.pex);
12310
      }
12311
      first = false;
12312
      sb.append(")");
12313
      return sb.toString();
12314
    }
12315
 
12316
    public void validate() throws org.apache.thrift.TException {
12317
      // check for required fields
12318
    }
12319
 
12320
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12321
      try {
12322
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12323
      } catch (org.apache.thrift.TException te) {
12324
        throw new java.io.IOException(te);
12325
      }
12326
    }
12327
 
12328
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12329
      try {
12330
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12331
      } catch (org.apache.thrift.TException te) {
12332
        throw new java.io.IOException(te);
12333
      }
12334
    }
12335
 
12336
  }
12337
 
12338
  public static class deleteCoupon_args implements org.apache.thrift.TBase<deleteCoupon_args, deleteCoupon_args._Fields>, java.io.Serializable, Cloneable   {
12339
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteCoupon_args");
12340
 
12341
    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);
12342
 
12343
    private String couponCode; // required
12344
 
12345
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12346
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12347
      COUPON_CODE((short)1, "couponCode");
12348
 
12349
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12350
 
12351
      static {
12352
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12353
          byName.put(field.getFieldName(), field);
12354
        }
12355
      }
12356
 
12357
      /**
12358
       * Find the _Fields constant that matches fieldId, or null if its not found.
12359
       */
12360
      public static _Fields findByThriftId(int fieldId) {
12361
        switch(fieldId) {
12362
          case 1: // COUPON_CODE
12363
            return COUPON_CODE;
12364
          default:
12365
            return null;
12366
        }
12367
      }
12368
 
12369
      /**
12370
       * Find the _Fields constant that matches fieldId, throwing an exception
12371
       * if it is not found.
12372
       */
12373
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12374
        _Fields fields = findByThriftId(fieldId);
12375
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12376
        return fields;
12377
      }
12378
 
12379
      /**
12380
       * Find the _Fields constant that matches name, or null if its not found.
12381
       */
12382
      public static _Fields findByName(String name) {
12383
        return byName.get(name);
12384
      }
12385
 
12386
      private final short _thriftId;
12387
      private final String _fieldName;
12388
 
12389
      _Fields(short thriftId, String fieldName) {
12390
        _thriftId = thriftId;
12391
        _fieldName = fieldName;
12392
      }
12393
 
12394
      public short getThriftFieldId() {
12395
        return _thriftId;
12396
      }
12397
 
12398
      public String getFieldName() {
12399
        return _fieldName;
12400
      }
12401
    }
12402
 
12403
    // isset id assignments
12404
 
12405
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12406
    static {
12407
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12408
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12409
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
12410
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12411
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteCoupon_args.class, metaDataMap);
12412
    }
12413
 
12414
    public deleteCoupon_args() {
12415
    }
12416
 
12417
    public deleteCoupon_args(
12418
      String couponCode)
12419
    {
12420
      this();
12421
      this.couponCode = couponCode;
12422
    }
12423
 
12424
    /**
12425
     * Performs a deep copy on <i>other</i>.
12426
     */
12427
    public deleteCoupon_args(deleteCoupon_args other) {
12428
      if (other.isSetCouponCode()) {
12429
        this.couponCode = other.couponCode;
12430
      }
12431
    }
12432
 
12433
    public deleteCoupon_args deepCopy() {
12434
      return new deleteCoupon_args(this);
12435
    }
12436
 
12437
    @Override
12438
    public void clear() {
12439
      this.couponCode = null;
12440
    }
12441
 
12442
    public String getCouponCode() {
12443
      return this.couponCode;
12444
    }
12445
 
12446
    public void setCouponCode(String couponCode) {
12447
      this.couponCode = couponCode;
12448
    }
12449
 
12450
    public void unsetCouponCode() {
12451
      this.couponCode = null;
12452
    }
12453
 
12454
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
12455
    public boolean isSetCouponCode() {
12456
      return this.couponCode != null;
12457
    }
12458
 
12459
    public void setCouponCodeIsSet(boolean value) {
12460
      if (!value) {
12461
        this.couponCode = null;
12462
      }
12463
    }
12464
 
12465
    public void setFieldValue(_Fields field, Object value) {
12466
      switch (field) {
12467
      case COUPON_CODE:
12468
        if (value == null) {
12469
          unsetCouponCode();
12470
        } else {
12471
          setCouponCode((String)value);
12472
        }
12473
        break;
12474
 
12475
      }
12476
    }
12477
 
12478
    public Object getFieldValue(_Fields field) {
12479
      switch (field) {
12480
      case COUPON_CODE:
12481
        return getCouponCode();
12482
 
12483
      }
12484
      throw new IllegalStateException();
12485
    }
12486
 
12487
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12488
    public boolean isSet(_Fields field) {
12489
      if (field == null) {
12490
        throw new IllegalArgumentException();
12491
      }
12492
 
12493
      switch (field) {
12494
      case COUPON_CODE:
12495
        return isSetCouponCode();
12496
      }
12497
      throw new IllegalStateException();
12498
    }
12499
 
12500
    @Override
12501
    public boolean equals(Object that) {
12502
      if (that == null)
12503
        return false;
12504
      if (that instanceof deleteCoupon_args)
12505
        return this.equals((deleteCoupon_args)that);
12506
      return false;
12507
    }
12508
 
12509
    public boolean equals(deleteCoupon_args that) {
12510
      if (that == null)
12511
        return false;
12512
 
12513
      boolean this_present_couponCode = true && this.isSetCouponCode();
12514
      boolean that_present_couponCode = true && that.isSetCouponCode();
12515
      if (this_present_couponCode || that_present_couponCode) {
12516
        if (!(this_present_couponCode && that_present_couponCode))
12517
          return false;
12518
        if (!this.couponCode.equals(that.couponCode))
12519
          return false;
12520
      }
12521
 
12522
      return true;
12523
    }
12524
 
12525
    @Override
12526
    public int hashCode() {
12527
      return 0;
12528
    }
12529
 
12530
    public int compareTo(deleteCoupon_args other) {
12531
      if (!getClass().equals(other.getClass())) {
12532
        return getClass().getName().compareTo(other.getClass().getName());
12533
      }
12534
 
12535
      int lastComparison = 0;
12536
      deleteCoupon_args typedOther = (deleteCoupon_args)other;
12537
 
12538
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
12539
      if (lastComparison != 0) {
12540
        return lastComparison;
12541
      }
12542
      if (isSetCouponCode()) {
12543
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
12544
        if (lastComparison != 0) {
12545
          return lastComparison;
12546
        }
12547
      }
12548
      return 0;
12549
    }
12550
 
12551
    public _Fields fieldForId(int fieldId) {
12552
      return _Fields.findByThriftId(fieldId);
12553
    }
12554
 
12555
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12556
      org.apache.thrift.protocol.TField field;
12557
      iprot.readStructBegin();
12558
      while (true)
12559
      {
12560
        field = iprot.readFieldBegin();
12561
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12562
          break;
12563
        }
12564
        switch (field.id) {
12565
          case 1: // COUPON_CODE
12566
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
12567
              this.couponCode = iprot.readString();
12568
            } else { 
12569
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12570
            }
12571
            break;
12572
          default:
12573
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12574
        }
12575
        iprot.readFieldEnd();
12576
      }
12577
      iprot.readStructEnd();
12578
      validate();
12579
    }
12580
 
12581
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12582
      validate();
12583
 
12584
      oprot.writeStructBegin(STRUCT_DESC);
12585
      if (this.couponCode != null) {
12586
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
12587
        oprot.writeString(this.couponCode);
12588
        oprot.writeFieldEnd();
12589
      }
12590
      oprot.writeFieldStop();
12591
      oprot.writeStructEnd();
12592
    }
12593
 
12594
    @Override
12595
    public String toString() {
12596
      StringBuilder sb = new StringBuilder("deleteCoupon_args(");
12597
      boolean first = true;
12598
 
12599
      sb.append("couponCode:");
12600
      if (this.couponCode == null) {
12601
        sb.append("null");
12602
      } else {
12603
        sb.append(this.couponCode);
12604
      }
12605
      first = false;
12606
      sb.append(")");
12607
      return sb.toString();
12608
    }
12609
 
12610
    public void validate() throws org.apache.thrift.TException {
12611
      // check for required fields
12612
    }
12613
 
12614
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12615
      try {
12616
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12617
      } catch (org.apache.thrift.TException te) {
12618
        throw new java.io.IOException(te);
12619
      }
12620
    }
12621
 
12622
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12623
      try {
12624
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12625
      } catch (org.apache.thrift.TException te) {
12626
        throw new java.io.IOException(te);
12627
      }
12628
    }
12629
 
12630
  }
12631
 
12632
  public static class deleteCoupon_result implements org.apache.thrift.TBase<deleteCoupon_result, deleteCoupon_result._Fields>, java.io.Serializable, Cloneable   {
12633
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteCoupon_result");
12634
 
12635
    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);
12636
 
12637
    private PromotionException pex; // required
12638
 
12639
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12640
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12641
      PEX((short)1, "pex");
12642
 
12643
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12644
 
12645
      static {
12646
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12647
          byName.put(field.getFieldName(), field);
12648
        }
12649
      }
12650
 
12651
      /**
12652
       * Find the _Fields constant that matches fieldId, or null if its not found.
12653
       */
12654
      public static _Fields findByThriftId(int fieldId) {
12655
        switch(fieldId) {
12656
          case 1: // PEX
12657
            return PEX;
12658
          default:
12659
            return null;
12660
        }
12661
      }
12662
 
12663
      /**
12664
       * Find the _Fields constant that matches fieldId, throwing an exception
12665
       * if it is not found.
12666
       */
12667
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12668
        _Fields fields = findByThriftId(fieldId);
12669
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12670
        return fields;
12671
      }
12672
 
12673
      /**
12674
       * Find the _Fields constant that matches name, or null if its not found.
12675
       */
12676
      public static _Fields findByName(String name) {
12677
        return byName.get(name);
12678
      }
12679
 
12680
      private final short _thriftId;
12681
      private final String _fieldName;
12682
 
12683
      _Fields(short thriftId, String fieldName) {
12684
        _thriftId = thriftId;
12685
        _fieldName = fieldName;
12686
      }
12687
 
12688
      public short getThriftFieldId() {
12689
        return _thriftId;
12690
      }
12691
 
12692
      public String getFieldName() {
12693
        return _fieldName;
12694
      }
12695
    }
12696
 
12697
    // isset id assignments
12698
 
12699
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12700
    static {
12701
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12702
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12703
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
12704
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12705
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteCoupon_result.class, metaDataMap);
12706
    }
12707
 
12708
    public deleteCoupon_result() {
12709
    }
12710
 
12711
    public deleteCoupon_result(
12712
      PromotionException pex)
12713
    {
12714
      this();
12715
      this.pex = pex;
12716
    }
12717
 
12718
    /**
12719
     * Performs a deep copy on <i>other</i>.
12720
     */
12721
    public deleteCoupon_result(deleteCoupon_result other) {
12722
      if (other.isSetPex()) {
12723
        this.pex = new PromotionException(other.pex);
12724
      }
12725
    }
12726
 
12727
    public deleteCoupon_result deepCopy() {
12728
      return new deleteCoupon_result(this);
12729
    }
12730
 
12731
    @Override
12732
    public void clear() {
12733
      this.pex = null;
12734
    }
12735
 
12736
    public PromotionException getPex() {
12737
      return this.pex;
12738
    }
12739
 
12740
    public void setPex(PromotionException pex) {
12741
      this.pex = pex;
12742
    }
12743
 
12744
    public void unsetPex() {
12745
      this.pex = null;
12746
    }
12747
 
12748
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
12749
    public boolean isSetPex() {
12750
      return this.pex != null;
12751
    }
12752
 
12753
    public void setPexIsSet(boolean value) {
12754
      if (!value) {
12755
        this.pex = null;
12756
      }
12757
    }
12758
 
12759
    public void setFieldValue(_Fields field, Object value) {
12760
      switch (field) {
12761
      case PEX:
12762
        if (value == null) {
12763
          unsetPex();
12764
        } else {
12765
          setPex((PromotionException)value);
12766
        }
12767
        break;
12768
 
12769
      }
12770
    }
12771
 
12772
    public Object getFieldValue(_Fields field) {
12773
      switch (field) {
12774
      case PEX:
12775
        return getPex();
12776
 
12777
      }
12778
      throw new IllegalStateException();
12779
    }
12780
 
12781
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12782
    public boolean isSet(_Fields field) {
12783
      if (field == null) {
12784
        throw new IllegalArgumentException();
12785
      }
12786
 
12787
      switch (field) {
12788
      case PEX:
12789
        return isSetPex();
12790
      }
12791
      throw new IllegalStateException();
12792
    }
12793
 
12794
    @Override
12795
    public boolean equals(Object that) {
12796
      if (that == null)
12797
        return false;
12798
      if (that instanceof deleteCoupon_result)
12799
        return this.equals((deleteCoupon_result)that);
12800
      return false;
12801
    }
12802
 
12803
    public boolean equals(deleteCoupon_result that) {
12804
      if (that == null)
12805
        return false;
12806
 
12807
      boolean this_present_pex = true && this.isSetPex();
12808
      boolean that_present_pex = true && that.isSetPex();
12809
      if (this_present_pex || that_present_pex) {
12810
        if (!(this_present_pex && that_present_pex))
12811
          return false;
12812
        if (!this.pex.equals(that.pex))
12813
          return false;
12814
      }
12815
 
12816
      return true;
12817
    }
12818
 
12819
    @Override
12820
    public int hashCode() {
12821
      return 0;
12822
    }
12823
 
12824
    public int compareTo(deleteCoupon_result other) {
12825
      if (!getClass().equals(other.getClass())) {
12826
        return getClass().getName().compareTo(other.getClass().getName());
12827
      }
12828
 
12829
      int lastComparison = 0;
12830
      deleteCoupon_result typedOther = (deleteCoupon_result)other;
12831
 
12832
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
12833
      if (lastComparison != 0) {
12834
        return lastComparison;
12835
      }
12836
      if (isSetPex()) {
12837
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
12838
        if (lastComparison != 0) {
12839
          return lastComparison;
12840
        }
12841
      }
12842
      return 0;
12843
    }
12844
 
12845
    public _Fields fieldForId(int fieldId) {
12846
      return _Fields.findByThriftId(fieldId);
12847
    }
12848
 
12849
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12850
      org.apache.thrift.protocol.TField field;
12851
      iprot.readStructBegin();
12852
      while (true)
12853
      {
12854
        field = iprot.readFieldBegin();
12855
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12856
          break;
12857
        }
12858
        switch (field.id) {
12859
          case 1: // PEX
12860
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
12861
              this.pex = new PromotionException();
12862
              this.pex.read(iprot);
12863
            } else { 
12864
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12865
            }
12866
            break;
12867
          default:
12868
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12869
        }
12870
        iprot.readFieldEnd();
12871
      }
12872
      iprot.readStructEnd();
12873
      validate();
12874
    }
12875
 
12876
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12877
      oprot.writeStructBegin(STRUCT_DESC);
12878
 
12879
      if (this.isSetPex()) {
12880
        oprot.writeFieldBegin(PEX_FIELD_DESC);
12881
        this.pex.write(oprot);
12882
        oprot.writeFieldEnd();
12883
      }
12884
      oprot.writeFieldStop();
12885
      oprot.writeStructEnd();
12886
    }
12887
 
12888
    @Override
12889
    public String toString() {
12890
      StringBuilder sb = new StringBuilder("deleteCoupon_result(");
12891
      boolean first = true;
12892
 
12893
      sb.append("pex:");
12894
      if (this.pex == null) {
12895
        sb.append("null");
12896
      } else {
12897
        sb.append(this.pex);
12898
      }
12899
      first = false;
12900
      sb.append(")");
12901
      return sb.toString();
12902
    }
12903
 
12904
    public void validate() throws org.apache.thrift.TException {
12905
      // check for required fields
12906
    }
12907
 
12908
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12909
      try {
12910
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12911
      } catch (org.apache.thrift.TException te) {
12912
        throw new java.io.IOException(te);
12913
      }
12914
    }
12915
 
12916
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12917
      try {
12918
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12919
      } catch (org.apache.thrift.TException te) {
12920
        throw new java.io.IOException(te);
12921
      }
12922
    }
12923
 
12924
  }
12925
 
7092 amit.gupta 12926
  public static class getAllCouponsByPromotionId_args implements org.apache.thrift.TBase<getAllCouponsByPromotionId_args, getAllCouponsByPromotionId_args._Fields>, java.io.Serializable, Cloneable   {
12927
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllCouponsByPromotionId_args");
12928
 
12929
    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);
12930
 
12931
    private long promotionId; // required
12932
 
12933
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12934
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12935
      PROMOTION_ID((short)1, "promotionId");
12936
 
12937
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12938
 
12939
      static {
12940
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12941
          byName.put(field.getFieldName(), field);
12942
        }
12943
      }
12944
 
12945
      /**
12946
       * Find the _Fields constant that matches fieldId, or null if its not found.
12947
       */
12948
      public static _Fields findByThriftId(int fieldId) {
12949
        switch(fieldId) {
12950
          case 1: // PROMOTION_ID
12951
            return PROMOTION_ID;
12952
          default:
12953
            return null;
12954
        }
12955
      }
12956
 
12957
      /**
12958
       * Find the _Fields constant that matches fieldId, throwing an exception
12959
       * if it is not found.
12960
       */
12961
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12962
        _Fields fields = findByThriftId(fieldId);
12963
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12964
        return fields;
12965
      }
12966
 
12967
      /**
12968
       * Find the _Fields constant that matches name, or null if its not found.
12969
       */
12970
      public static _Fields findByName(String name) {
12971
        return byName.get(name);
12972
      }
12973
 
12974
      private final short _thriftId;
12975
      private final String _fieldName;
12976
 
12977
      _Fields(short thriftId, String fieldName) {
12978
        _thriftId = thriftId;
12979
        _fieldName = fieldName;
12980
      }
12981
 
12982
      public short getThriftFieldId() {
12983
        return _thriftId;
12984
      }
12985
 
12986
      public String getFieldName() {
12987
        return _fieldName;
12988
      }
12989
    }
12990
 
12991
    // isset id assignments
12992
    private static final int __PROMOTIONID_ISSET_ID = 0;
12993
    private BitSet __isset_bit_vector = new BitSet(1);
12994
 
12995
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12996
    static {
12997
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12998
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12999
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
13000
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13001
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllCouponsByPromotionId_args.class, metaDataMap);
13002
    }
13003
 
13004
    public getAllCouponsByPromotionId_args() {
13005
    }
13006
 
13007
    public getAllCouponsByPromotionId_args(
13008
      long promotionId)
13009
    {
13010
      this();
13011
      this.promotionId = promotionId;
13012
      setPromotionIdIsSet(true);
13013
    }
13014
 
13015
    /**
13016
     * Performs a deep copy on <i>other</i>.
13017
     */
13018
    public getAllCouponsByPromotionId_args(getAllCouponsByPromotionId_args other) {
13019
      __isset_bit_vector.clear();
13020
      __isset_bit_vector.or(other.__isset_bit_vector);
13021
      this.promotionId = other.promotionId;
13022
    }
13023
 
13024
    public getAllCouponsByPromotionId_args deepCopy() {
13025
      return new getAllCouponsByPromotionId_args(this);
13026
    }
13027
 
13028
    @Override
13029
    public void clear() {
13030
      setPromotionIdIsSet(false);
13031
      this.promotionId = 0;
13032
    }
13033
 
13034
    public long getPromotionId() {
13035
      return this.promotionId;
13036
    }
13037
 
13038
    public void setPromotionId(long promotionId) {
13039
      this.promotionId = promotionId;
13040
      setPromotionIdIsSet(true);
13041
    }
13042
 
13043
    public void unsetPromotionId() {
13044
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
13045
    }
13046
 
13047
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
13048
    public boolean isSetPromotionId() {
13049
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
13050
    }
13051
 
13052
    public void setPromotionIdIsSet(boolean value) {
13053
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
13054
    }
13055
 
13056
    public void setFieldValue(_Fields field, Object value) {
13057
      switch (field) {
13058
      case PROMOTION_ID:
13059
        if (value == null) {
13060
          unsetPromotionId();
13061
        } else {
13062
          setPromotionId((Long)value);
13063
        }
13064
        break;
13065
 
13066
      }
13067
    }
13068
 
13069
    public Object getFieldValue(_Fields field) {
13070
      switch (field) {
13071
      case PROMOTION_ID:
13072
        return Long.valueOf(getPromotionId());
13073
 
13074
      }
13075
      throw new IllegalStateException();
13076
    }
13077
 
13078
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13079
    public boolean isSet(_Fields field) {
13080
      if (field == null) {
13081
        throw new IllegalArgumentException();
13082
      }
13083
 
13084
      switch (field) {
13085
      case PROMOTION_ID:
13086
        return isSetPromotionId();
13087
      }
13088
      throw new IllegalStateException();
13089
    }
13090
 
13091
    @Override
13092
    public boolean equals(Object that) {
13093
      if (that == null)
13094
        return false;
13095
      if (that instanceof getAllCouponsByPromotionId_args)
13096
        return this.equals((getAllCouponsByPromotionId_args)that);
13097
      return false;
13098
    }
13099
 
13100
    public boolean equals(getAllCouponsByPromotionId_args that) {
13101
      if (that == null)
13102
        return false;
13103
 
13104
      boolean this_present_promotionId = true;
13105
      boolean that_present_promotionId = true;
13106
      if (this_present_promotionId || that_present_promotionId) {
13107
        if (!(this_present_promotionId && that_present_promotionId))
13108
          return false;
13109
        if (this.promotionId != that.promotionId)
13110
          return false;
13111
      }
13112
 
13113
      return true;
13114
    }
13115
 
13116
    @Override
13117
    public int hashCode() {
13118
      return 0;
13119
    }
13120
 
13121
    public int compareTo(getAllCouponsByPromotionId_args other) {
13122
      if (!getClass().equals(other.getClass())) {
13123
        return getClass().getName().compareTo(other.getClass().getName());
13124
      }
13125
 
13126
      int lastComparison = 0;
13127
      getAllCouponsByPromotionId_args typedOther = (getAllCouponsByPromotionId_args)other;
13128
 
13129
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
13130
      if (lastComparison != 0) {
13131
        return lastComparison;
13132
      }
13133
      if (isSetPromotionId()) {
13134
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
13135
        if (lastComparison != 0) {
13136
          return lastComparison;
13137
        }
13138
      }
13139
      return 0;
13140
    }
13141
 
13142
    public _Fields fieldForId(int fieldId) {
13143
      return _Fields.findByThriftId(fieldId);
13144
    }
13145
 
13146
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13147
      org.apache.thrift.protocol.TField field;
13148
      iprot.readStructBegin();
13149
      while (true)
13150
      {
13151
        field = iprot.readFieldBegin();
13152
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
13153
          break;
13154
        }
13155
        switch (field.id) {
13156
          case 1: // PROMOTION_ID
13157
            if (field.type == org.apache.thrift.protocol.TType.I64) {
13158
              this.promotionId = iprot.readI64();
13159
              setPromotionIdIsSet(true);
13160
            } else { 
13161
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13162
            }
13163
            break;
13164
          default:
13165
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13166
        }
13167
        iprot.readFieldEnd();
13168
      }
13169
      iprot.readStructEnd();
13170
      validate();
13171
    }
13172
 
13173
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
13174
      validate();
13175
 
13176
      oprot.writeStructBegin(STRUCT_DESC);
13177
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
13178
      oprot.writeI64(this.promotionId);
13179
      oprot.writeFieldEnd();
13180
      oprot.writeFieldStop();
13181
      oprot.writeStructEnd();
13182
    }
13183
 
13184
    @Override
13185
    public String toString() {
13186
      StringBuilder sb = new StringBuilder("getAllCouponsByPromotionId_args(");
13187
      boolean first = true;
13188
 
13189
      sb.append("promotionId:");
13190
      sb.append(this.promotionId);
13191
      first = false;
13192
      sb.append(")");
13193
      return sb.toString();
13194
    }
13195
 
13196
    public void validate() throws org.apache.thrift.TException {
13197
      // check for required fields
13198
    }
13199
 
13200
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13201
      try {
13202
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13203
      } catch (org.apache.thrift.TException te) {
13204
        throw new java.io.IOException(te);
13205
      }
13206
    }
13207
 
13208
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13209
      try {
13210
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
13211
        __isset_bit_vector = new BitSet(1);
13212
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13213
      } catch (org.apache.thrift.TException te) {
13214
        throw new java.io.IOException(te);
13215
      }
13216
    }
13217
 
13218
  }
13219
 
13220
  public static class getAllCouponsByPromotionId_result implements org.apache.thrift.TBase<getAllCouponsByPromotionId_result, getAllCouponsByPromotionId_result._Fields>, java.io.Serializable, Cloneable   {
13221
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllCouponsByPromotionId_result");
13222
 
13223
    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);
13224
    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);
13225
 
13226
    private List<Coupon> success; // required
13227
    private PromotionException pex; // required
13228
 
13229
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
13230
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
13231
      SUCCESS((short)0, "success"),
13232
      PEX((short)1, "pex");
13233
 
13234
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13235
 
13236
      static {
13237
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13238
          byName.put(field.getFieldName(), field);
13239
        }
13240
      }
13241
 
13242
      /**
13243
       * Find the _Fields constant that matches fieldId, or null if its not found.
13244
       */
13245
      public static _Fields findByThriftId(int fieldId) {
13246
        switch(fieldId) {
13247
          case 0: // SUCCESS
13248
            return SUCCESS;
13249
          case 1: // PEX
13250
            return PEX;
13251
          default:
13252
            return null;
13253
        }
13254
      }
13255
 
13256
      /**
13257
       * Find the _Fields constant that matches fieldId, throwing an exception
13258
       * if it is not found.
13259
       */
13260
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13261
        _Fields fields = findByThriftId(fieldId);
13262
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13263
        return fields;
13264
      }
13265
 
13266
      /**
13267
       * Find the _Fields constant that matches name, or null if its not found.
13268
       */
13269
      public static _Fields findByName(String name) {
13270
        return byName.get(name);
13271
      }
13272
 
13273
      private final short _thriftId;
13274
      private final String _fieldName;
13275
 
13276
      _Fields(short thriftId, String fieldName) {
13277
        _thriftId = thriftId;
13278
        _fieldName = fieldName;
13279
      }
13280
 
13281
      public short getThriftFieldId() {
13282
        return _thriftId;
13283
      }
13284
 
13285
      public String getFieldName() {
13286
        return _fieldName;
13287
      }
13288
    }
13289
 
13290
    // isset id assignments
13291
 
13292
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
13293
    static {
13294
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13295
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13296
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
13297
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
13298
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13299
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
13300
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13301
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllCouponsByPromotionId_result.class, metaDataMap);
13302
    }
13303
 
13304
    public getAllCouponsByPromotionId_result() {
13305
    }
13306
 
13307
    public getAllCouponsByPromotionId_result(
13308
      List<Coupon> success,
13309
      PromotionException pex)
13310
    {
13311
      this();
13312
      this.success = success;
13313
      this.pex = pex;
13314
    }
13315
 
13316
    /**
13317
     * Performs a deep copy on <i>other</i>.
13318
     */
13319
    public getAllCouponsByPromotionId_result(getAllCouponsByPromotionId_result other) {
13320
      if (other.isSetSuccess()) {
13321
        List<Coupon> __this__success = new ArrayList<Coupon>();
13322
        for (Coupon other_element : other.success) {
13323
          __this__success.add(new Coupon(other_element));
13324
        }
13325
        this.success = __this__success;
13326
      }
13327
      if (other.isSetPex()) {
13328
        this.pex = new PromotionException(other.pex);
13329
      }
13330
    }
13331
 
13332
    public getAllCouponsByPromotionId_result deepCopy() {
13333
      return new getAllCouponsByPromotionId_result(this);
13334
    }
13335
 
13336
    @Override
13337
    public void clear() {
13338
      this.success = null;
13339
      this.pex = null;
13340
    }
13341
 
13342
    public int getSuccessSize() {
13343
      return (this.success == null) ? 0 : this.success.size();
13344
    }
13345
 
13346
    public java.util.Iterator<Coupon> getSuccessIterator() {
13347
      return (this.success == null) ? null : this.success.iterator();
13348
    }
13349
 
13350
    public void addToSuccess(Coupon elem) {
13351
      if (this.success == null) {
13352
        this.success = new ArrayList<Coupon>();
13353
      }
13354
      this.success.add(elem);
13355
    }
13356
 
13357
    public List<Coupon> getSuccess() {
13358
      return this.success;
13359
    }
13360
 
13361
    public void setSuccess(List<Coupon> success) {
13362
      this.success = success;
13363
    }
13364
 
13365
    public void unsetSuccess() {
13366
      this.success = null;
13367
    }
13368
 
13369
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
13370
    public boolean isSetSuccess() {
13371
      return this.success != null;
13372
    }
13373
 
13374
    public void setSuccessIsSet(boolean value) {
13375
      if (!value) {
13376
        this.success = null;
13377
      }
13378
    }
13379
 
13380
    public PromotionException getPex() {
13381
      return this.pex;
13382
    }
13383
 
13384
    public void setPex(PromotionException pex) {
13385
      this.pex = pex;
13386
    }
13387
 
13388
    public void unsetPex() {
13389
      this.pex = null;
13390
    }
13391
 
13392
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
13393
    public boolean isSetPex() {
13394
      return this.pex != null;
13395
    }
13396
 
13397
    public void setPexIsSet(boolean value) {
13398
      if (!value) {
13399
        this.pex = null;
13400
      }
13401
    }
13402
 
13403
    public void setFieldValue(_Fields field, Object value) {
13404
      switch (field) {
13405
      case SUCCESS:
13406
        if (value == null) {
13407
          unsetSuccess();
13408
        } else {
13409
          setSuccess((List<Coupon>)value);
13410
        }
13411
        break;
13412
 
13413
      case PEX:
13414
        if (value == null) {
13415
          unsetPex();
13416
        } else {
13417
          setPex((PromotionException)value);
13418
        }
13419
        break;
13420
 
13421
      }
13422
    }
13423
 
13424
    public Object getFieldValue(_Fields field) {
13425
      switch (field) {
13426
      case SUCCESS:
13427
        return getSuccess();
13428
 
13429
      case PEX:
13430
        return getPex();
13431
 
13432
      }
13433
      throw new IllegalStateException();
13434
    }
13435
 
13436
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13437
    public boolean isSet(_Fields field) {
13438
      if (field == null) {
13439
        throw new IllegalArgumentException();
13440
      }
13441
 
13442
      switch (field) {
13443
      case SUCCESS:
13444
        return isSetSuccess();
13445
      case PEX:
13446
        return isSetPex();
13447
      }
13448
      throw new IllegalStateException();
13449
    }
13450
 
13451
    @Override
13452
    public boolean equals(Object that) {
13453
      if (that == null)
13454
        return false;
13455
      if (that instanceof getAllCouponsByPromotionId_result)
13456
        return this.equals((getAllCouponsByPromotionId_result)that);
13457
      return false;
13458
    }
13459
 
13460
    public boolean equals(getAllCouponsByPromotionId_result that) {
13461
      if (that == null)
13462
        return false;
13463
 
13464
      boolean this_present_success = true && this.isSetSuccess();
13465
      boolean that_present_success = true && that.isSetSuccess();
13466
      if (this_present_success || that_present_success) {
13467
        if (!(this_present_success && that_present_success))
13468
          return false;
13469
        if (!this.success.equals(that.success))
13470
          return false;
13471
      }
13472
 
13473
      boolean this_present_pex = true && this.isSetPex();
13474
      boolean that_present_pex = true && that.isSetPex();
13475
      if (this_present_pex || that_present_pex) {
13476
        if (!(this_present_pex && that_present_pex))
13477
          return false;
13478
        if (!this.pex.equals(that.pex))
13479
          return false;
13480
      }
13481
 
13482
      return true;
13483
    }
13484
 
13485
    @Override
13486
    public int hashCode() {
13487
      return 0;
13488
    }
13489
 
13490
    public int compareTo(getAllCouponsByPromotionId_result other) {
13491
      if (!getClass().equals(other.getClass())) {
13492
        return getClass().getName().compareTo(other.getClass().getName());
13493
      }
13494
 
13495
      int lastComparison = 0;
13496
      getAllCouponsByPromotionId_result typedOther = (getAllCouponsByPromotionId_result)other;
13497
 
13498
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
13499
      if (lastComparison != 0) {
13500
        return lastComparison;
13501
      }
13502
      if (isSetSuccess()) {
13503
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
13504
        if (lastComparison != 0) {
13505
          return lastComparison;
13506
        }
13507
      }
13508
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
13509
      if (lastComparison != 0) {
13510
        return lastComparison;
13511
      }
13512
      if (isSetPex()) {
13513
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
13514
        if (lastComparison != 0) {
13515
          return lastComparison;
13516
        }
13517
      }
13518
      return 0;
13519
    }
13520
 
13521
    public _Fields fieldForId(int fieldId) {
13522
      return _Fields.findByThriftId(fieldId);
13523
    }
13524
 
13525
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13526
      org.apache.thrift.protocol.TField field;
13527
      iprot.readStructBegin();
13528
      while (true)
13529
      {
13530
        field = iprot.readFieldBegin();
13531
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
13532
          break;
13533
        }
13534
        switch (field.id) {
13535
          case 0: // SUCCESS
13536
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
13537
              {
13538
                org.apache.thrift.protocol.TList _list30 = iprot.readListBegin();
13539
                this.success = new ArrayList<Coupon>(_list30.size);
13540
                for (int _i31 = 0; _i31 < _list30.size; ++_i31)
13541
                {
13542
                  Coupon _elem32; // required
13543
                  _elem32 = new Coupon();
13544
                  _elem32.read(iprot);
13545
                  this.success.add(_elem32);
13546
                }
13547
                iprot.readListEnd();
13548
              }
13549
            } else { 
13550
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13551
            }
13552
            break;
13553
          case 1: // PEX
13554
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
13555
              this.pex = new PromotionException();
13556
              this.pex.read(iprot);
13557
            } else { 
13558
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13559
            }
13560
            break;
13561
          default:
13562
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13563
        }
13564
        iprot.readFieldEnd();
13565
      }
13566
      iprot.readStructEnd();
13567
      validate();
13568
    }
13569
 
13570
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
13571
      oprot.writeStructBegin(STRUCT_DESC);
13572
 
13573
      if (this.isSetSuccess()) {
13574
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
13575
        {
13576
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
13577
          for (Coupon _iter33 : this.success)
13578
          {
13579
            _iter33.write(oprot);
13580
          }
13581
          oprot.writeListEnd();
13582
        }
13583
        oprot.writeFieldEnd();
13584
      } else if (this.isSetPex()) {
13585
        oprot.writeFieldBegin(PEX_FIELD_DESC);
13586
        this.pex.write(oprot);
13587
        oprot.writeFieldEnd();
13588
      }
13589
      oprot.writeFieldStop();
13590
      oprot.writeStructEnd();
13591
    }
13592
 
13593
    @Override
13594
    public String toString() {
13595
      StringBuilder sb = new StringBuilder("getAllCouponsByPromotionId_result(");
13596
      boolean first = true;
13597
 
13598
      sb.append("success:");
13599
      if (this.success == null) {
13600
        sb.append("null");
13601
      } else {
13602
        sb.append(this.success);
13603
      }
13604
      first = false;
13605
      if (!first) sb.append(", ");
13606
      sb.append("pex:");
13607
      if (this.pex == null) {
13608
        sb.append("null");
13609
      } else {
13610
        sb.append(this.pex);
13611
      }
13612
      first = false;
13613
      sb.append(")");
13614
      return sb.toString();
13615
    }
13616
 
13617
    public void validate() throws org.apache.thrift.TException {
13618
      // check for required fields
13619
    }
13620
 
13621
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13622
      try {
13623
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13624
      } catch (org.apache.thrift.TException te) {
13625
        throw new java.io.IOException(te);
13626
      }
13627
    }
13628
 
13629
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13630
      try {
13631
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13632
      } catch (org.apache.thrift.TException te) {
13633
        throw new java.io.IOException(te);
13634
      }
13635
    }
13636
 
13637
  }
13638
 
3430 rajveer 13639
  public static class getActiveCoupons_args implements org.apache.thrift.TBase<getActiveCoupons_args, getActiveCoupons_args._Fields>, java.io.Serializable, Cloneable   {
13640
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_args");
3385 varun.gupt 13641
 
13642
 
13643
 
13644
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 13645
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 13646
;
13647
 
13648
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13649
 
13650
      static {
13651
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13652
          byName.put(field.getFieldName(), field);
13653
        }
13654
      }
13655
 
13656
      /**
13657
       * Find the _Fields constant that matches fieldId, or null if its not found.
13658
       */
13659
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 13660
        switch(fieldId) {
13661
          default:
13662
            return null;
13663
        }
3385 varun.gupt 13664
      }
13665
 
13666
      /**
13667
       * Find the _Fields constant that matches fieldId, throwing an exception
13668
       * if it is not found.
13669
       */
13670
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13671
        _Fields fields = findByThriftId(fieldId);
13672
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13673
        return fields;
13674
      }
13675
 
13676
      /**
13677
       * Find the _Fields constant that matches name, or null if its not found.
13678
       */
13679
      public static _Fields findByName(String name) {
13680
        return byName.get(name);
13681
      }
13682
 
13683
      private final short _thriftId;
13684
      private final String _fieldName;
13685
 
13686
      _Fields(short thriftId, String fieldName) {
13687
        _thriftId = thriftId;
13688
        _fieldName = fieldName;
13689
      }
13690
 
13691
      public short getThriftFieldId() {
13692
        return _thriftId;
13693
      }
13694
 
13695
      public String getFieldName() {
13696
        return _fieldName;
13697
      }
13698
    }
3430 rajveer 13699
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 13700
    static {
3430 rajveer 13701
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13702
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13703
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_args.class, metaDataMap);
3385 varun.gupt 13704
    }
13705
 
13706
    public getActiveCoupons_args() {
13707
    }
13708
 
13709
    /**
13710
     * Performs a deep copy on <i>other</i>.
13711
     */
13712
    public getActiveCoupons_args(getActiveCoupons_args other) {
13713
    }
13714
 
13715
    public getActiveCoupons_args deepCopy() {
13716
      return new getActiveCoupons_args(this);
13717
    }
13718
 
3430 rajveer 13719
    @Override
13720
    public void clear() {
3385 varun.gupt 13721
    }
13722
 
13723
    public void setFieldValue(_Fields field, Object value) {
13724
      switch (field) {
13725
      }
13726
    }
13727
 
13728
    public Object getFieldValue(_Fields field) {
13729
      switch (field) {
13730
      }
13731
      throw new IllegalStateException();
13732
    }
13733
 
3430 rajveer 13734
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13735
    public boolean isSet(_Fields field) {
13736
      if (field == null) {
13737
        throw new IllegalArgumentException();
13738
      }
3385 varun.gupt 13739
 
13740
      switch (field) {
13741
      }
13742
      throw new IllegalStateException();
13743
    }
13744
 
13745
    @Override
13746
    public boolean equals(Object that) {
13747
      if (that == null)
13748
        return false;
13749
      if (that instanceof getActiveCoupons_args)
13750
        return this.equals((getActiveCoupons_args)that);
13751
      return false;
13752
    }
13753
 
13754
    public boolean equals(getActiveCoupons_args that) {
13755
      if (that == null)
13756
        return false;
13757
 
13758
      return true;
13759
    }
13760
 
13761
    @Override
13762
    public int hashCode() {
13763
      return 0;
13764
    }
13765
 
13766
    public int compareTo(getActiveCoupons_args other) {
13767
      if (!getClass().equals(other.getClass())) {
13768
        return getClass().getName().compareTo(other.getClass().getName());
13769
      }
13770
 
13771
      int lastComparison = 0;
13772
      getActiveCoupons_args typedOther = (getActiveCoupons_args)other;
13773
 
13774
      return 0;
13775
    }
13776
 
3430 rajveer 13777
    public _Fields fieldForId(int fieldId) {
13778
      return _Fields.findByThriftId(fieldId);
13779
    }
13780
 
13781
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13782
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 13783
      iprot.readStructBegin();
13784
      while (true)
13785
      {
13786
        field = iprot.readFieldBegin();
3430 rajveer 13787
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 13788
          break;
13789
        }
3430 rajveer 13790
        switch (field.id) {
13791
          default:
13792
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 13793
        }
3430 rajveer 13794
        iprot.readFieldEnd();
3385 varun.gupt 13795
      }
13796
      iprot.readStructEnd();
13797
      validate();
13798
    }
13799
 
3430 rajveer 13800
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 13801
      validate();
13802
 
13803
      oprot.writeStructBegin(STRUCT_DESC);
13804
      oprot.writeFieldStop();
13805
      oprot.writeStructEnd();
13806
    }
13807
 
13808
    @Override
13809
    public String toString() {
13810
      StringBuilder sb = new StringBuilder("getActiveCoupons_args(");
13811
      boolean first = true;
13812
 
13813
      sb.append(")");
13814
      return sb.toString();
13815
    }
13816
 
3430 rajveer 13817
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 13818
      // check for required fields
13819
    }
13820
 
3430 rajveer 13821
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13822
      try {
13823
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13824
      } catch (org.apache.thrift.TException te) {
13825
        throw new java.io.IOException(te);
13826
      }
13827
    }
13828
 
13829
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13830
      try {
13831
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13832
      } catch (org.apache.thrift.TException te) {
13833
        throw new java.io.IOException(te);
13834
      }
13835
    }
13836
 
3385 varun.gupt 13837
  }
13838
 
3430 rajveer 13839
  public static class getActiveCoupons_result implements org.apache.thrift.TBase<getActiveCoupons_result, getActiveCoupons_result._Fields>, java.io.Serializable, Cloneable   {
13840
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_result");
3385 varun.gupt 13841
 
3430 rajveer 13842
    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);
13843
    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 13844
 
3430 rajveer 13845
    private List<Coupon> success; // required
13846
    private PromotionException pex; // required
3385 varun.gupt 13847
 
13848
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 13849
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 13850
      SUCCESS((short)0, "success"),
13851
      PEX((short)1, "pex");
13852
 
13853
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13854
 
13855
      static {
13856
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13857
          byName.put(field.getFieldName(), field);
13858
        }
13859
      }
13860
 
13861
      /**
13862
       * Find the _Fields constant that matches fieldId, or null if its not found.
13863
       */
13864
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 13865
        switch(fieldId) {
13866
          case 0: // SUCCESS
13867
            return SUCCESS;
13868
          case 1: // PEX
13869
            return PEX;
13870
          default:
13871
            return null;
13872
        }
3385 varun.gupt 13873
      }
13874
 
13875
      /**
13876
       * Find the _Fields constant that matches fieldId, throwing an exception
13877
       * if it is not found.
13878
       */
13879
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13880
        _Fields fields = findByThriftId(fieldId);
13881
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13882
        return fields;
13883
      }
13884
 
13885
      /**
13886
       * Find the _Fields constant that matches name, or null if its not found.
13887
       */
13888
      public static _Fields findByName(String name) {
13889
        return byName.get(name);
13890
      }
13891
 
13892
      private final short _thriftId;
13893
      private final String _fieldName;
13894
 
13895
      _Fields(short thriftId, String fieldName) {
13896
        _thriftId = thriftId;
13897
        _fieldName = fieldName;
13898
      }
13899
 
13900
      public short getThriftFieldId() {
13901
        return _thriftId;
13902
      }
13903
 
13904
      public String getFieldName() {
13905
        return _fieldName;
13906
      }
13907
    }
13908
 
13909
    // isset id assignments
13910
 
3430 rajveer 13911
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 13912
    static {
3430 rajveer 13913
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13914
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13915
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
13916
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
13917
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13918
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
13919
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13920
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_result.class, metaDataMap);
3385 varun.gupt 13921
    }
13922
 
13923
    public getActiveCoupons_result() {
13924
    }
13925
 
13926
    public getActiveCoupons_result(
13927
      List<Coupon> success,
13928
      PromotionException pex)
13929
    {
13930
      this();
13931
      this.success = success;
13932
      this.pex = pex;
13933
    }
13934
 
13935
    /**
13936
     * Performs a deep copy on <i>other</i>.
13937
     */
13938
    public getActiveCoupons_result(getActiveCoupons_result other) {
13939
      if (other.isSetSuccess()) {
13940
        List<Coupon> __this__success = new ArrayList<Coupon>();
13941
        for (Coupon other_element : other.success) {
13942
          __this__success.add(new Coupon(other_element));
13943
        }
13944
        this.success = __this__success;
13945
      }
13946
      if (other.isSetPex()) {
13947
        this.pex = new PromotionException(other.pex);
13948
      }
13949
    }
13950
 
13951
    public getActiveCoupons_result deepCopy() {
13952
      return new getActiveCoupons_result(this);
13953
    }
13954
 
3430 rajveer 13955
    @Override
13956
    public void clear() {
13957
      this.success = null;
13958
      this.pex = null;
3385 varun.gupt 13959
    }
13960
 
13961
    public int getSuccessSize() {
13962
      return (this.success == null) ? 0 : this.success.size();
13963
    }
13964
 
13965
    public java.util.Iterator<Coupon> getSuccessIterator() {
13966
      return (this.success == null) ? null : this.success.iterator();
13967
    }
13968
 
13969
    public void addToSuccess(Coupon elem) {
13970
      if (this.success == null) {
13971
        this.success = new ArrayList<Coupon>();
13972
      }
13973
      this.success.add(elem);
13974
    }
13975
 
13976
    public List<Coupon> getSuccess() {
13977
      return this.success;
13978
    }
13979
 
3430 rajveer 13980
    public void setSuccess(List<Coupon> success) {
3385 varun.gupt 13981
      this.success = success;
13982
    }
13983
 
13984
    public void unsetSuccess() {
13985
      this.success = null;
13986
    }
13987
 
3430 rajveer 13988
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 13989
    public boolean isSetSuccess() {
13990
      return this.success != null;
13991
    }
13992
 
13993
    public void setSuccessIsSet(boolean value) {
13994
      if (!value) {
13995
        this.success = null;
13996
      }
13997
    }
13998
 
13999
    public PromotionException getPex() {
14000
      return this.pex;
14001
    }
14002
 
3430 rajveer 14003
    public void setPex(PromotionException pex) {
3385 varun.gupt 14004
      this.pex = pex;
14005
    }
14006
 
14007
    public void unsetPex() {
14008
      this.pex = null;
14009
    }
14010
 
3430 rajveer 14011
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 14012
    public boolean isSetPex() {
14013
      return this.pex != null;
14014
    }
14015
 
14016
    public void setPexIsSet(boolean value) {
14017
      if (!value) {
14018
        this.pex = null;
14019
      }
14020
    }
14021
 
14022
    public void setFieldValue(_Fields field, Object value) {
14023
      switch (field) {
14024
      case SUCCESS:
14025
        if (value == null) {
14026
          unsetSuccess();
14027
        } else {
14028
          setSuccess((List<Coupon>)value);
14029
        }
14030
        break;
14031
 
14032
      case PEX:
14033
        if (value == null) {
14034
          unsetPex();
14035
        } else {
14036
          setPex((PromotionException)value);
14037
        }
14038
        break;
14039
 
14040
      }
14041
    }
14042
 
14043
    public Object getFieldValue(_Fields field) {
14044
      switch (field) {
14045
      case SUCCESS:
14046
        return getSuccess();
14047
 
14048
      case PEX:
14049
        return getPex();
14050
 
14051
      }
14052
      throw new IllegalStateException();
14053
    }
14054
 
3430 rajveer 14055
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14056
    public boolean isSet(_Fields field) {
14057
      if (field == null) {
14058
        throw new IllegalArgumentException();
14059
      }
3385 varun.gupt 14060
 
14061
      switch (field) {
14062
      case SUCCESS:
14063
        return isSetSuccess();
14064
      case PEX:
14065
        return isSetPex();
14066
      }
14067
      throw new IllegalStateException();
14068
    }
14069
 
14070
    @Override
14071
    public boolean equals(Object that) {
14072
      if (that == null)
14073
        return false;
14074
      if (that instanceof getActiveCoupons_result)
14075
        return this.equals((getActiveCoupons_result)that);
14076
      return false;
14077
    }
14078
 
14079
    public boolean equals(getActiveCoupons_result that) {
14080
      if (that == null)
14081
        return false;
14082
 
14083
      boolean this_present_success = true && this.isSetSuccess();
14084
      boolean that_present_success = true && that.isSetSuccess();
14085
      if (this_present_success || that_present_success) {
14086
        if (!(this_present_success && that_present_success))
14087
          return false;
14088
        if (!this.success.equals(that.success))
14089
          return false;
14090
      }
14091
 
14092
      boolean this_present_pex = true && this.isSetPex();
14093
      boolean that_present_pex = true && that.isSetPex();
14094
      if (this_present_pex || that_present_pex) {
14095
        if (!(this_present_pex && that_present_pex))
14096
          return false;
14097
        if (!this.pex.equals(that.pex))
14098
          return false;
14099
      }
14100
 
14101
      return true;
14102
    }
14103
 
14104
    @Override
14105
    public int hashCode() {
14106
      return 0;
14107
    }
14108
 
14109
    public int compareTo(getActiveCoupons_result other) {
14110
      if (!getClass().equals(other.getClass())) {
14111
        return getClass().getName().compareTo(other.getClass().getName());
14112
      }
14113
 
14114
      int lastComparison = 0;
14115
      getActiveCoupons_result typedOther = (getActiveCoupons_result)other;
14116
 
3430 rajveer 14117
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 14118
      if (lastComparison != 0) {
14119
        return lastComparison;
14120
      }
3430 rajveer 14121
      if (isSetSuccess()) {
14122
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
14123
        if (lastComparison != 0) {
14124
          return lastComparison;
14125
        }
3385 varun.gupt 14126
      }
3430 rajveer 14127
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 14128
      if (lastComparison != 0) {
14129
        return lastComparison;
14130
      }
3430 rajveer 14131
      if (isSetPex()) {
14132
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
14133
        if (lastComparison != 0) {
14134
          return lastComparison;
14135
        }
3385 varun.gupt 14136
      }
14137
      return 0;
14138
    }
14139
 
3430 rajveer 14140
    public _Fields fieldForId(int fieldId) {
14141
      return _Fields.findByThriftId(fieldId);
14142
    }
14143
 
14144
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14145
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 14146
      iprot.readStructBegin();
14147
      while (true)
14148
      {
14149
        field = iprot.readFieldBegin();
3430 rajveer 14150
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 14151
          break;
14152
        }
3430 rajveer 14153
        switch (field.id) {
14154
          case 0: // SUCCESS
14155
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
14156
              {
7092 amit.gupta 14157
                org.apache.thrift.protocol.TList _list34 = iprot.readListBegin();
14158
                this.success = new ArrayList<Coupon>(_list34.size);
14159
                for (int _i35 = 0; _i35 < _list34.size; ++_i35)
3385 varun.gupt 14160
                {
7092 amit.gupta 14161
                  Coupon _elem36; // required
14162
                  _elem36 = new Coupon();
14163
                  _elem36.read(iprot);
14164
                  this.success.add(_elem36);
3385 varun.gupt 14165
                }
3430 rajveer 14166
                iprot.readListEnd();
3385 varun.gupt 14167
              }
3430 rajveer 14168
            } else { 
14169
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14170
            }
14171
            break;
14172
          case 1: // PEX
14173
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
14174
              this.pex = new PromotionException();
14175
              this.pex.read(iprot);
14176
            } else { 
14177
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14178
            }
14179
            break;
14180
          default:
14181
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 14182
        }
3430 rajveer 14183
        iprot.readFieldEnd();
3385 varun.gupt 14184
      }
14185
      iprot.readStructEnd();
14186
      validate();
14187
    }
14188
 
3430 rajveer 14189
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 14190
      oprot.writeStructBegin(STRUCT_DESC);
14191
 
14192
      if (this.isSetSuccess()) {
14193
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
14194
        {
3430 rajveer 14195
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
7092 amit.gupta 14196
          for (Coupon _iter37 : this.success)
3385 varun.gupt 14197
          {
7092 amit.gupta 14198
            _iter37.write(oprot);
3385 varun.gupt 14199
          }
14200
          oprot.writeListEnd();
14201
        }
14202
        oprot.writeFieldEnd();
14203
      } else if (this.isSetPex()) {
14204
        oprot.writeFieldBegin(PEX_FIELD_DESC);
14205
        this.pex.write(oprot);
14206
        oprot.writeFieldEnd();
14207
      }
14208
      oprot.writeFieldStop();
14209
      oprot.writeStructEnd();
14210
    }
14211
 
14212
    @Override
14213
    public String toString() {
14214
      StringBuilder sb = new StringBuilder("getActiveCoupons_result(");
14215
      boolean first = true;
14216
 
14217
      sb.append("success:");
14218
      if (this.success == null) {
14219
        sb.append("null");
14220
      } else {
14221
        sb.append(this.success);
14222
      }
14223
      first = false;
14224
      if (!first) sb.append(", ");
14225
      sb.append("pex:");
14226
      if (this.pex == null) {
14227
        sb.append("null");
14228
      } else {
14229
        sb.append(this.pex);
14230
      }
14231
      first = false;
14232
      sb.append(")");
14233
      return sb.toString();
14234
    }
14235
 
3430 rajveer 14236
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 14237
      // check for required fields
14238
    }
14239
 
3430 rajveer 14240
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14241
      try {
14242
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14243
      } catch (org.apache.thrift.TException te) {
14244
        throw new java.io.IOException(te);
14245
      }
14246
    }
14247
 
14248
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14249
      try {
14250
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14251
      } catch (org.apache.thrift.TException te) {
14252
        throw new java.io.IOException(te);
14253
      }
14254
    }
14255
 
3385 varun.gupt 14256
  }
14257
 
6250 amit.gupta 14258
  public static class createCoupon_args implements org.apache.thrift.TBase<createCoupon_args, createCoupon_args._Fields>, java.io.Serializable, Cloneable   {
14259
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_args");
14260
 
14261
    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);
6730 anupam.sin 14262
    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);
14263
    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)3);
14264
    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)4);
14265
    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)5);
6250 amit.gupta 14266
 
14267
    private long promotionId; // required
6730 anupam.sin 14268
    private String couponCode; // required
6679 anupam.sin 14269
    private String arguments; // required
6356 amit.gupta 14270
    private boolean isCod; // required
6561 amit.gupta 14271
    private String prefix; // required
6250 amit.gupta 14272
 
14273
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14274
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
14275
      PROMOTION_ID((short)1, "promotionId"),
6730 anupam.sin 14276
      COUPON_CODE((short)2, "couponCode"),
14277
      ARGUMENTS((short)3, "arguments"),
14278
      IS_COD((short)4, "isCod"),
14279
      PREFIX((short)5, "prefix");
6250 amit.gupta 14280
 
14281
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14282
 
14283
      static {
14284
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14285
          byName.put(field.getFieldName(), field);
14286
        }
14287
      }
14288
 
14289
      /**
14290
       * Find the _Fields constant that matches fieldId, or null if its not found.
14291
       */
14292
      public static _Fields findByThriftId(int fieldId) {
14293
        switch(fieldId) {
14294
          case 1: // PROMOTION_ID
14295
            return PROMOTION_ID;
6730 anupam.sin 14296
          case 2: // COUPON_CODE
14297
            return COUPON_CODE;
14298
          case 3: // ARGUMENTS
6679 anupam.sin 14299
            return ARGUMENTS;
6730 anupam.sin 14300
          case 4: // IS_COD
6356 amit.gupta 14301
            return IS_COD;
6730 anupam.sin 14302
          case 5: // PREFIX
6561 amit.gupta 14303
            return PREFIX;
6250 amit.gupta 14304
          default:
14305
            return null;
14306
        }
14307
      }
14308
 
14309
      /**
14310
       * Find the _Fields constant that matches fieldId, throwing an exception
14311
       * if it is not found.
14312
       */
14313
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14314
        _Fields fields = findByThriftId(fieldId);
14315
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14316
        return fields;
14317
      }
14318
 
14319
      /**
14320
       * Find the _Fields constant that matches name, or null if its not found.
14321
       */
14322
      public static _Fields findByName(String name) {
14323
        return byName.get(name);
14324
      }
14325
 
14326
      private final short _thriftId;
14327
      private final String _fieldName;
14328
 
14329
      _Fields(short thriftId, String fieldName) {
14330
        _thriftId = thriftId;
14331
        _fieldName = fieldName;
14332
      }
14333
 
14334
      public short getThriftFieldId() {
14335
        return _thriftId;
14336
      }
14337
 
14338
      public String getFieldName() {
14339
        return _fieldName;
14340
      }
14341
    }
14342
 
14343
    // isset id assignments
14344
    private static final int __PROMOTIONID_ISSET_ID = 0;
6679 anupam.sin 14345
    private static final int __ISCOD_ISSET_ID = 1;
14346
    private BitSet __isset_bit_vector = new BitSet(2);
6250 amit.gupta 14347
 
14348
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
14349
    static {
14350
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
14351
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14352
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6730 anupam.sin 14353
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14354
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6679 anupam.sin 14355
      tmpMap.put(_Fields.ARGUMENTS, new org.apache.thrift.meta_data.FieldMetaData("arguments", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6250 amit.gupta 14356
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6356 amit.gupta 14357
      tmpMap.put(_Fields.IS_COD, new org.apache.thrift.meta_data.FieldMetaData("isCod", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14358
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
6561 amit.gupta 14359
      tmpMap.put(_Fields.PREFIX, new org.apache.thrift.meta_data.FieldMetaData("prefix", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14360
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6250 amit.gupta 14361
      metaDataMap = Collections.unmodifiableMap(tmpMap);
14362
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_args.class, metaDataMap);
14363
    }
14364
 
14365
    public createCoupon_args() {
14366
    }
14367
 
14368
    public createCoupon_args(
14369
      long promotionId,
6730 anupam.sin 14370
      String couponCode,
6679 anupam.sin 14371
      String arguments,
6356 amit.gupta 14372
      boolean isCod,
6561 amit.gupta 14373
      String prefix)
6250 amit.gupta 14374
    {
14375
      this();
14376
      this.promotionId = promotionId;
14377
      setPromotionIdIsSet(true);
6730 anupam.sin 14378
      this.couponCode = couponCode;
6679 anupam.sin 14379
      this.arguments = arguments;
6356 amit.gupta 14380
      this.isCod = isCod;
14381
      setIsCodIsSet(true);
6561 amit.gupta 14382
      this.prefix = prefix;
6250 amit.gupta 14383
    }
14384
 
14385
    /**
14386
     * Performs a deep copy on <i>other</i>.
14387
     */
14388
    public createCoupon_args(createCoupon_args other) {
14389
      __isset_bit_vector.clear();
14390
      __isset_bit_vector.or(other.__isset_bit_vector);
14391
      this.promotionId = other.promotionId;
6730 anupam.sin 14392
      if (other.isSetCouponCode()) {
14393
        this.couponCode = other.couponCode;
14394
      }
6679 anupam.sin 14395
      if (other.isSetArguments()) {
14396
        this.arguments = other.arguments;
6250 amit.gupta 14397
      }
6356 amit.gupta 14398
      this.isCod = other.isCod;
6561 amit.gupta 14399
      if (other.isSetPrefix()) {
14400
        this.prefix = other.prefix;
14401
      }
6250 amit.gupta 14402
    }
14403
 
14404
    public createCoupon_args deepCopy() {
14405
      return new createCoupon_args(this);
14406
    }
14407
 
14408
    @Override
14409
    public void clear() {
14410
      setPromotionIdIsSet(false);
14411
      this.promotionId = 0;
6730 anupam.sin 14412
      this.couponCode = null;
6679 anupam.sin 14413
      this.arguments = null;
6356 amit.gupta 14414
      setIsCodIsSet(false);
14415
      this.isCod = false;
6561 amit.gupta 14416
      this.prefix = null;
6250 amit.gupta 14417
    }
14418
 
14419
    public long getPromotionId() {
14420
      return this.promotionId;
14421
    }
14422
 
14423
    public void setPromotionId(long promotionId) {
14424
      this.promotionId = promotionId;
14425
      setPromotionIdIsSet(true);
14426
    }
14427
 
14428
    public void unsetPromotionId() {
14429
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
14430
    }
14431
 
14432
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
14433
    public boolean isSetPromotionId() {
14434
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
14435
    }
14436
 
14437
    public void setPromotionIdIsSet(boolean value) {
14438
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
14439
    }
14440
 
6730 anupam.sin 14441
    public String getCouponCode() {
14442
      return this.couponCode;
14443
    }
14444
 
14445
    public void setCouponCode(String couponCode) {
14446
      this.couponCode = couponCode;
14447
    }
14448
 
14449
    public void unsetCouponCode() {
14450
      this.couponCode = null;
14451
    }
14452
 
14453
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
14454
    public boolean isSetCouponCode() {
14455
      return this.couponCode != null;
14456
    }
14457
 
14458
    public void setCouponCodeIsSet(boolean value) {
14459
      if (!value) {
14460
        this.couponCode = null;
14461
      }
14462
    }
14463
 
6679 anupam.sin 14464
    public String getArguments() {
14465
      return this.arguments;
6250 amit.gupta 14466
    }
14467
 
6679 anupam.sin 14468
    public void setArguments(String arguments) {
14469
      this.arguments = arguments;
6250 amit.gupta 14470
    }
14471
 
6679 anupam.sin 14472
    public void unsetArguments() {
14473
      this.arguments = null;
6250 amit.gupta 14474
    }
14475
 
6679 anupam.sin 14476
    /** Returns true if field arguments is set (has been assigned a value) and false otherwise */
14477
    public boolean isSetArguments() {
14478
      return this.arguments != null;
6250 amit.gupta 14479
    }
14480
 
6679 anupam.sin 14481
    public void setArgumentsIsSet(boolean value) {
6250 amit.gupta 14482
      if (!value) {
6679 anupam.sin 14483
        this.arguments = null;
6250 amit.gupta 14484
      }
14485
    }
14486
 
6356 amit.gupta 14487
    public boolean isIsCod() {
14488
      return this.isCod;
14489
    }
14490
 
14491
    public void setIsCod(boolean isCod) {
14492
      this.isCod = isCod;
14493
      setIsCodIsSet(true);
14494
    }
14495
 
14496
    public void unsetIsCod() {
14497
      __isset_bit_vector.clear(__ISCOD_ISSET_ID);
14498
    }
14499
 
14500
    /** Returns true if field isCod is set (has been assigned a value) and false otherwise */
14501
    public boolean isSetIsCod() {
14502
      return __isset_bit_vector.get(__ISCOD_ISSET_ID);
14503
    }
14504
 
14505
    public void setIsCodIsSet(boolean value) {
14506
      __isset_bit_vector.set(__ISCOD_ISSET_ID, value);
14507
    }
14508
 
6561 amit.gupta 14509
    public String getPrefix() {
14510
      return this.prefix;
14511
    }
14512
 
14513
    public void setPrefix(String prefix) {
14514
      this.prefix = prefix;
14515
    }
14516
 
14517
    public void unsetPrefix() {
14518
      this.prefix = null;
14519
    }
14520
 
14521
    /** Returns true if field prefix is set (has been assigned a value) and false otherwise */
14522
    public boolean isSetPrefix() {
14523
      return this.prefix != null;
14524
    }
14525
 
14526
    public void setPrefixIsSet(boolean value) {
14527
      if (!value) {
14528
        this.prefix = null;
14529
      }
14530
    }
14531
 
6250 amit.gupta 14532
    public void setFieldValue(_Fields field, Object value) {
14533
      switch (field) {
14534
      case PROMOTION_ID:
14535
        if (value == null) {
14536
          unsetPromotionId();
14537
        } else {
14538
          setPromotionId((Long)value);
14539
        }
14540
        break;
14541
 
6730 anupam.sin 14542
      case COUPON_CODE:
14543
        if (value == null) {
14544
          unsetCouponCode();
14545
        } else {
14546
          setCouponCode((String)value);
14547
        }
14548
        break;
14549
 
6679 anupam.sin 14550
      case ARGUMENTS:
6250 amit.gupta 14551
        if (value == null) {
6679 anupam.sin 14552
          unsetArguments();
6250 amit.gupta 14553
        } else {
6679 anupam.sin 14554
          setArguments((String)value);
6250 amit.gupta 14555
        }
14556
        break;
14557
 
6356 amit.gupta 14558
      case IS_COD:
14559
        if (value == null) {
14560
          unsetIsCod();
14561
        } else {
14562
          setIsCod((Boolean)value);
14563
        }
14564
        break;
14565
 
6561 amit.gupta 14566
      case PREFIX:
14567
        if (value == null) {
14568
          unsetPrefix();
14569
        } else {
14570
          setPrefix((String)value);
14571
        }
14572
        break;
14573
 
6250 amit.gupta 14574
      }
14575
    }
14576
 
14577
    public Object getFieldValue(_Fields field) {
14578
      switch (field) {
14579
      case PROMOTION_ID:
14580
        return Long.valueOf(getPromotionId());
14581
 
6730 anupam.sin 14582
      case COUPON_CODE:
14583
        return getCouponCode();
14584
 
6679 anupam.sin 14585
      case ARGUMENTS:
14586
        return getArguments();
6250 amit.gupta 14587
 
6356 amit.gupta 14588
      case IS_COD:
14589
        return Boolean.valueOf(isIsCod());
14590
 
6561 amit.gupta 14591
      case PREFIX:
14592
        return getPrefix();
14593
 
6250 amit.gupta 14594
      }
14595
      throw new IllegalStateException();
14596
    }
14597
 
14598
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14599
    public boolean isSet(_Fields field) {
14600
      if (field == null) {
14601
        throw new IllegalArgumentException();
14602
      }
14603
 
14604
      switch (field) {
14605
      case PROMOTION_ID:
14606
        return isSetPromotionId();
6730 anupam.sin 14607
      case COUPON_CODE:
14608
        return isSetCouponCode();
6679 anupam.sin 14609
      case ARGUMENTS:
14610
        return isSetArguments();
6356 amit.gupta 14611
      case IS_COD:
14612
        return isSetIsCod();
6561 amit.gupta 14613
      case PREFIX:
14614
        return isSetPrefix();
6250 amit.gupta 14615
      }
14616
      throw new IllegalStateException();
14617
    }
14618
 
14619
    @Override
14620
    public boolean equals(Object that) {
14621
      if (that == null)
14622
        return false;
14623
      if (that instanceof createCoupon_args)
14624
        return this.equals((createCoupon_args)that);
14625
      return false;
14626
    }
14627
 
14628
    public boolean equals(createCoupon_args that) {
14629
      if (that == null)
14630
        return false;
14631
 
14632
      boolean this_present_promotionId = true;
14633
      boolean that_present_promotionId = true;
14634
      if (this_present_promotionId || that_present_promotionId) {
14635
        if (!(this_present_promotionId && that_present_promotionId))
14636
          return false;
14637
        if (this.promotionId != that.promotionId)
14638
          return false;
14639
      }
14640
 
6730 anupam.sin 14641
      boolean this_present_couponCode = true && this.isSetCouponCode();
14642
      boolean that_present_couponCode = true && that.isSetCouponCode();
14643
      if (this_present_couponCode || that_present_couponCode) {
14644
        if (!(this_present_couponCode && that_present_couponCode))
14645
          return false;
14646
        if (!this.couponCode.equals(that.couponCode))
14647
          return false;
14648
      }
14649
 
6679 anupam.sin 14650
      boolean this_present_arguments = true && this.isSetArguments();
14651
      boolean that_present_arguments = true && that.isSetArguments();
14652
      if (this_present_arguments || that_present_arguments) {
14653
        if (!(this_present_arguments && that_present_arguments))
6250 amit.gupta 14654
          return false;
6679 anupam.sin 14655
        if (!this.arguments.equals(that.arguments))
6250 amit.gupta 14656
          return false;
14657
      }
14658
 
6356 amit.gupta 14659
      boolean this_present_isCod = true;
14660
      boolean that_present_isCod = true;
14661
      if (this_present_isCod || that_present_isCod) {
14662
        if (!(this_present_isCod && that_present_isCod))
14663
          return false;
14664
        if (this.isCod != that.isCod)
14665
          return false;
14666
      }
14667
 
6561 amit.gupta 14668
      boolean this_present_prefix = true && this.isSetPrefix();
14669
      boolean that_present_prefix = true && that.isSetPrefix();
14670
      if (this_present_prefix || that_present_prefix) {
14671
        if (!(this_present_prefix && that_present_prefix))
14672
          return false;
14673
        if (!this.prefix.equals(that.prefix))
14674
          return false;
14675
      }
14676
 
6250 amit.gupta 14677
      return true;
14678
    }
14679
 
14680
    @Override
14681
    public int hashCode() {
14682
      return 0;
14683
    }
14684
 
14685
    public int compareTo(createCoupon_args other) {
14686
      if (!getClass().equals(other.getClass())) {
14687
        return getClass().getName().compareTo(other.getClass().getName());
14688
      }
14689
 
14690
      int lastComparison = 0;
14691
      createCoupon_args typedOther = (createCoupon_args)other;
14692
 
14693
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
14694
      if (lastComparison != 0) {
14695
        return lastComparison;
14696
      }
14697
      if (isSetPromotionId()) {
14698
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
14699
        if (lastComparison != 0) {
14700
          return lastComparison;
14701
        }
14702
      }
6730 anupam.sin 14703
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
14704
      if (lastComparison != 0) {
14705
        return lastComparison;
14706
      }
14707
      if (isSetCouponCode()) {
14708
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
14709
        if (lastComparison != 0) {
14710
          return lastComparison;
14711
        }
14712
      }
6679 anupam.sin 14713
      lastComparison = Boolean.valueOf(isSetArguments()).compareTo(typedOther.isSetArguments());
6250 amit.gupta 14714
      if (lastComparison != 0) {
14715
        return lastComparison;
14716
      }
6679 anupam.sin 14717
      if (isSetArguments()) {
14718
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.arguments, typedOther.arguments);
6250 amit.gupta 14719
        if (lastComparison != 0) {
14720
          return lastComparison;
14721
        }
14722
      }
6356 amit.gupta 14723
      lastComparison = Boolean.valueOf(isSetIsCod()).compareTo(typedOther.isSetIsCod());
14724
      if (lastComparison != 0) {
14725
        return lastComparison;
14726
      }
14727
      if (isSetIsCod()) {
14728
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isCod, typedOther.isCod);
14729
        if (lastComparison != 0) {
14730
          return lastComparison;
14731
        }
14732
      }
6561 amit.gupta 14733
      lastComparison = Boolean.valueOf(isSetPrefix()).compareTo(typedOther.isSetPrefix());
14734
      if (lastComparison != 0) {
14735
        return lastComparison;
14736
      }
14737
      if (isSetPrefix()) {
14738
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.prefix, typedOther.prefix);
14739
        if (lastComparison != 0) {
14740
          return lastComparison;
14741
        }
14742
      }
6250 amit.gupta 14743
      return 0;
14744
    }
14745
 
14746
    public _Fields fieldForId(int fieldId) {
14747
      return _Fields.findByThriftId(fieldId);
14748
    }
14749
 
14750
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14751
      org.apache.thrift.protocol.TField field;
14752
      iprot.readStructBegin();
14753
      while (true)
14754
      {
14755
        field = iprot.readFieldBegin();
14756
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
14757
          break;
14758
        }
14759
        switch (field.id) {
14760
          case 1: // PROMOTION_ID
14761
            if (field.type == org.apache.thrift.protocol.TType.I64) {
14762
              this.promotionId = iprot.readI64();
14763
              setPromotionIdIsSet(true);
14764
            } else { 
14765
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14766
            }
14767
            break;
6730 anupam.sin 14768
          case 2: // COUPON_CODE
6250 amit.gupta 14769
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
6730 anupam.sin 14770
              this.couponCode = iprot.readString();
14771
            } else { 
14772
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14773
            }
14774
            break;
14775
          case 3: // ARGUMENTS
14776
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
6679 anupam.sin 14777
              this.arguments = iprot.readString();
6250 amit.gupta 14778
            } else { 
14779
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14780
            }
14781
            break;
6730 anupam.sin 14782
          case 4: // IS_COD
6356 amit.gupta 14783
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
14784
              this.isCod = iprot.readBool();
14785
              setIsCodIsSet(true);
14786
            } else { 
14787
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14788
            }
14789
            break;
6730 anupam.sin 14790
          case 5: // PREFIX
6561 amit.gupta 14791
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
14792
              this.prefix = iprot.readString();
14793
            } else { 
14794
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14795
            }
14796
            break;
6250 amit.gupta 14797
          default:
14798
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14799
        }
14800
        iprot.readFieldEnd();
14801
      }
14802
      iprot.readStructEnd();
14803
      validate();
14804
    }
14805
 
14806
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
14807
      validate();
14808
 
14809
      oprot.writeStructBegin(STRUCT_DESC);
14810
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
14811
      oprot.writeI64(this.promotionId);
14812
      oprot.writeFieldEnd();
6730 anupam.sin 14813
      if (this.couponCode != null) {
14814
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
14815
        oprot.writeString(this.couponCode);
14816
        oprot.writeFieldEnd();
14817
      }
6679 anupam.sin 14818
      if (this.arguments != null) {
14819
        oprot.writeFieldBegin(ARGUMENTS_FIELD_DESC);
14820
        oprot.writeString(this.arguments);
6250 amit.gupta 14821
        oprot.writeFieldEnd();
14822
      }
6356 amit.gupta 14823
      oprot.writeFieldBegin(IS_COD_FIELD_DESC);
14824
      oprot.writeBool(this.isCod);
14825
      oprot.writeFieldEnd();
6561 amit.gupta 14826
      if (this.prefix != null) {
14827
        oprot.writeFieldBegin(PREFIX_FIELD_DESC);
14828
        oprot.writeString(this.prefix);
14829
        oprot.writeFieldEnd();
14830
      }
6250 amit.gupta 14831
      oprot.writeFieldStop();
14832
      oprot.writeStructEnd();
14833
    }
14834
 
14835
    @Override
14836
    public String toString() {
14837
      StringBuilder sb = new StringBuilder("createCoupon_args(");
14838
      boolean first = true;
14839
 
14840
      sb.append("promotionId:");
14841
      sb.append(this.promotionId);
14842
      first = false;
14843
      if (!first) sb.append(", ");
6730 anupam.sin 14844
      sb.append("couponCode:");
14845
      if (this.couponCode == null) {
14846
        sb.append("null");
14847
      } else {
14848
        sb.append(this.couponCode);
14849
      }
14850
      first = false;
14851
      if (!first) sb.append(", ");
6679 anupam.sin 14852
      sb.append("arguments:");
14853
      if (this.arguments == null) {
6250 amit.gupta 14854
        sb.append("null");
14855
      } else {
6679 anupam.sin 14856
        sb.append(this.arguments);
6250 amit.gupta 14857
      }
14858
      first = false;
14859
      if (!first) sb.append(", ");
6356 amit.gupta 14860
      sb.append("isCod:");
14861
      sb.append(this.isCod);
14862
      first = false;
14863
      if (!first) sb.append(", ");
6561 amit.gupta 14864
      sb.append("prefix:");
14865
      if (this.prefix == null) {
14866
        sb.append("null");
14867
      } else {
14868
        sb.append(this.prefix);
14869
      }
14870
      first = false;
6250 amit.gupta 14871
      sb.append(")");
14872
      return sb.toString();
14873
    }
14874
 
14875
    public void validate() throws org.apache.thrift.TException {
14876
      // check for required fields
14877
    }
14878
 
14879
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14880
      try {
14881
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14882
      } catch (org.apache.thrift.TException te) {
14883
        throw new java.io.IOException(te);
14884
      }
14885
    }
14886
 
14887
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14888
      try {
8201 rajveer 14889
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
14890
        __isset_bit_vector = new BitSet(1);
6250 amit.gupta 14891
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14892
      } catch (org.apache.thrift.TException te) {
14893
        throw new java.io.IOException(te);
14894
      }
14895
    }
14896
 
14897
  }
14898
 
14899
  public static class createCoupon_result implements org.apache.thrift.TBase<createCoupon_result, createCoupon_result._Fields>, java.io.Serializable, Cloneable   {
14900
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_result");
14901
 
14902
    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);
14903
    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);
14904
 
14905
    private String success; // required
14906
    private PromotionException pex; // required
14907
 
14908
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14909
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
14910
      SUCCESS((short)0, "success"),
14911
      PEX((short)1, "pex");
14912
 
14913
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14914
 
14915
      static {
14916
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14917
          byName.put(field.getFieldName(), field);
14918
        }
14919
      }
14920
 
14921
      /**
14922
       * Find the _Fields constant that matches fieldId, or null if its not found.
14923
       */
14924
      public static _Fields findByThriftId(int fieldId) {
14925
        switch(fieldId) {
14926
          case 0: // SUCCESS
14927
            return SUCCESS;
14928
          case 1: // PEX
14929
            return PEX;
14930
          default:
14931
            return null;
14932
        }
14933
      }
14934
 
14935
      /**
14936
       * Find the _Fields constant that matches fieldId, throwing an exception
14937
       * if it is not found.
14938
       */
14939
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14940
        _Fields fields = findByThriftId(fieldId);
14941
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14942
        return fields;
14943
      }
14944
 
14945
      /**
14946
       * Find the _Fields constant that matches name, or null if its not found.
14947
       */
14948
      public static _Fields findByName(String name) {
14949
        return byName.get(name);
14950
      }
14951
 
14952
      private final short _thriftId;
14953
      private final String _fieldName;
14954
 
14955
      _Fields(short thriftId, String fieldName) {
14956
        _thriftId = thriftId;
14957
        _fieldName = fieldName;
14958
      }
14959
 
14960
      public short getThriftFieldId() {
14961
        return _thriftId;
14962
      }
14963
 
14964
      public String getFieldName() {
14965
        return _fieldName;
14966
      }
14967
    }
14968
 
14969
    // isset id assignments
14970
 
14971
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
14972
    static {
14973
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
14974
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14975
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
14976
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14977
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
14978
      metaDataMap = Collections.unmodifiableMap(tmpMap);
14979
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_result.class, metaDataMap);
14980
    }
14981
 
14982
    public createCoupon_result() {
14983
    }
14984
 
14985
    public createCoupon_result(
14986
      String success,
14987
      PromotionException pex)
14988
    {
14989
      this();
14990
      this.success = success;
14991
      this.pex = pex;
14992
    }
14993
 
14994
    /**
14995
     * Performs a deep copy on <i>other</i>.
14996
     */
14997
    public createCoupon_result(createCoupon_result other) {
14998
      if (other.isSetSuccess()) {
14999
        this.success = other.success;
15000
      }
15001
      if (other.isSetPex()) {
15002
        this.pex = new PromotionException(other.pex);
15003
      }
15004
    }
15005
 
15006
    public createCoupon_result deepCopy() {
15007
      return new createCoupon_result(this);
15008
    }
15009
 
15010
    @Override
15011
    public void clear() {
15012
      this.success = null;
15013
      this.pex = null;
15014
    }
15015
 
15016
    public String getSuccess() {
15017
      return this.success;
15018
    }
15019
 
15020
    public void setSuccess(String success) {
15021
      this.success = success;
15022
    }
15023
 
15024
    public void unsetSuccess() {
15025
      this.success = null;
15026
    }
15027
 
15028
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
15029
    public boolean isSetSuccess() {
15030
      return this.success != null;
15031
    }
15032
 
15033
    public void setSuccessIsSet(boolean value) {
15034
      if (!value) {
15035
        this.success = null;
15036
      }
15037
    }
15038
 
15039
    public PromotionException getPex() {
15040
      return this.pex;
15041
    }
15042
 
15043
    public void setPex(PromotionException pex) {
15044
      this.pex = pex;
15045
    }
15046
 
15047
    public void unsetPex() {
15048
      this.pex = null;
15049
    }
15050
 
15051
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
15052
    public boolean isSetPex() {
15053
      return this.pex != null;
15054
    }
15055
 
15056
    public void setPexIsSet(boolean value) {
15057
      if (!value) {
15058
        this.pex = null;
15059
      }
15060
    }
15061
 
15062
    public void setFieldValue(_Fields field, Object value) {
15063
      switch (field) {
15064
      case SUCCESS:
15065
        if (value == null) {
15066
          unsetSuccess();
15067
        } else {
15068
          setSuccess((String)value);
15069
        }
15070
        break;
15071
 
15072
      case PEX:
15073
        if (value == null) {
15074
          unsetPex();
15075
        } else {
15076
          setPex((PromotionException)value);
15077
        }
15078
        break;
15079
 
15080
      }
15081
    }
15082
 
15083
    public Object getFieldValue(_Fields field) {
15084
      switch (field) {
15085
      case SUCCESS:
15086
        return getSuccess();
15087
 
15088
      case PEX:
15089
        return getPex();
15090
 
15091
      }
15092
      throw new IllegalStateException();
15093
    }
15094
 
15095
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15096
    public boolean isSet(_Fields field) {
15097
      if (field == null) {
15098
        throw new IllegalArgumentException();
15099
      }
15100
 
15101
      switch (field) {
15102
      case SUCCESS:
15103
        return isSetSuccess();
15104
      case PEX:
15105
        return isSetPex();
15106
      }
15107
      throw new IllegalStateException();
15108
    }
15109
 
15110
    @Override
15111
    public boolean equals(Object that) {
15112
      if (that == null)
15113
        return false;
15114
      if (that instanceof createCoupon_result)
15115
        return this.equals((createCoupon_result)that);
15116
      return false;
15117
    }
15118
 
15119
    public boolean equals(createCoupon_result that) {
15120
      if (that == null)
15121
        return false;
15122
 
15123
      boolean this_present_success = true && this.isSetSuccess();
15124
      boolean that_present_success = true && that.isSetSuccess();
15125
      if (this_present_success || that_present_success) {
15126
        if (!(this_present_success && that_present_success))
15127
          return false;
15128
        if (!this.success.equals(that.success))
15129
          return false;
15130
      }
15131
 
15132
      boolean this_present_pex = true && this.isSetPex();
15133
      boolean that_present_pex = true && that.isSetPex();
15134
      if (this_present_pex || that_present_pex) {
15135
        if (!(this_present_pex && that_present_pex))
15136
          return false;
15137
        if (!this.pex.equals(that.pex))
15138
          return false;
15139
      }
15140
 
15141
      return true;
15142
    }
15143
 
15144
    @Override
15145
    public int hashCode() {
15146
      return 0;
15147
    }
15148
 
15149
    public int compareTo(createCoupon_result other) {
15150
      if (!getClass().equals(other.getClass())) {
15151
        return getClass().getName().compareTo(other.getClass().getName());
15152
      }
15153
 
15154
      int lastComparison = 0;
15155
      createCoupon_result typedOther = (createCoupon_result)other;
15156
 
15157
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
15158
      if (lastComparison != 0) {
15159
        return lastComparison;
15160
      }
15161
      if (isSetSuccess()) {
15162
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
15163
        if (lastComparison != 0) {
15164
          return lastComparison;
15165
        }
15166
      }
15167
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
15168
      if (lastComparison != 0) {
15169
        return lastComparison;
15170
      }
15171
      if (isSetPex()) {
15172
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
15173
        if (lastComparison != 0) {
15174
          return lastComparison;
15175
        }
15176
      }
15177
      return 0;
15178
    }
15179
 
15180
    public _Fields fieldForId(int fieldId) {
15181
      return _Fields.findByThriftId(fieldId);
15182
    }
15183
 
15184
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15185
      org.apache.thrift.protocol.TField field;
15186
      iprot.readStructBegin();
15187
      while (true)
15188
      {
15189
        field = iprot.readFieldBegin();
15190
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
15191
          break;
15192
        }
15193
        switch (field.id) {
15194
          case 0: // SUCCESS
15195
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
15196
              this.success = iprot.readString();
15197
            } else { 
15198
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15199
            }
15200
            break;
15201
          case 1: // PEX
15202
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
15203
              this.pex = new PromotionException();
15204
              this.pex.read(iprot);
15205
            } else { 
15206
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15207
            }
15208
            break;
15209
          default:
15210
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15211
        }
15212
        iprot.readFieldEnd();
15213
      }
15214
      iprot.readStructEnd();
15215
      validate();
15216
    }
15217
 
15218
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
15219
      oprot.writeStructBegin(STRUCT_DESC);
15220
 
15221
      if (this.isSetSuccess()) {
15222
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
15223
        oprot.writeString(this.success);
15224
        oprot.writeFieldEnd();
15225
      } else if (this.isSetPex()) {
15226
        oprot.writeFieldBegin(PEX_FIELD_DESC);
15227
        this.pex.write(oprot);
15228
        oprot.writeFieldEnd();
15229
      }
15230
      oprot.writeFieldStop();
15231
      oprot.writeStructEnd();
15232
    }
15233
 
15234
    @Override
15235
    public String toString() {
15236
      StringBuilder sb = new StringBuilder("createCoupon_result(");
15237
      boolean first = true;
15238
 
15239
      sb.append("success:");
15240
      if (this.success == null) {
15241
        sb.append("null");
15242
      } else {
15243
        sb.append(this.success);
15244
      }
15245
      first = false;
15246
      if (!first) sb.append(", ");
15247
      sb.append("pex:");
15248
      if (this.pex == null) {
15249
        sb.append("null");
15250
      } else {
15251
        sb.append(this.pex);
15252
      }
15253
      first = false;
15254
      sb.append(")");
15255
      return sb.toString();
15256
    }
15257
 
15258
    public void validate() throws org.apache.thrift.TException {
15259
      // check for required fields
15260
    }
15261
 
15262
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15263
      try {
15264
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15265
      } catch (org.apache.thrift.TException te) {
15266
        throw new java.io.IOException(te);
15267
      }
15268
    }
15269
 
15270
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15271
      try {
15272
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15273
      } catch (org.apache.thrift.TException te) {
15274
        throw new java.io.IOException(te);
15275
      }
15276
    }
15277
 
15278
  }
15279
 
3430 rajveer 15280
  public static class getSuccessfulPaymentCountForCoupon_args implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_args, getSuccessfulPaymentCountForCoupon_args._Fields>, java.io.Serializable, Cloneable   {
15281
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_args");
3385 varun.gupt 15282
 
3430 rajveer 15283
    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 15284
 
3430 rajveer 15285
    private String couponCode; // required
3385 varun.gupt 15286
 
15287
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 15288
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 15289
      COUPON_CODE((short)1, "couponCode");
15290
 
15291
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15292
 
15293
      static {
15294
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15295
          byName.put(field.getFieldName(), field);
15296
        }
15297
      }
15298
 
15299
      /**
15300
       * Find the _Fields constant that matches fieldId, or null if its not found.
15301
       */
15302
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 15303
        switch(fieldId) {
15304
          case 1: // COUPON_CODE
15305
            return COUPON_CODE;
15306
          default:
15307
            return null;
15308
        }
3385 varun.gupt 15309
      }
15310
 
15311
      /**
15312
       * Find the _Fields constant that matches fieldId, throwing an exception
15313
       * if it is not found.
15314
       */
15315
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15316
        _Fields fields = findByThriftId(fieldId);
15317
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15318
        return fields;
15319
      }
15320
 
15321
      /**
15322
       * Find the _Fields constant that matches name, or null if its not found.
15323
       */
15324
      public static _Fields findByName(String name) {
15325
        return byName.get(name);
15326
      }
15327
 
15328
      private final short _thriftId;
15329
      private final String _fieldName;
15330
 
15331
      _Fields(short thriftId, String fieldName) {
15332
        _thriftId = thriftId;
15333
        _fieldName = fieldName;
15334
      }
15335
 
15336
      public short getThriftFieldId() {
15337
        return _thriftId;
15338
      }
15339
 
15340
      public String getFieldName() {
15341
        return _fieldName;
15342
      }
15343
    }
15344
 
15345
    // isset id assignments
15346
 
3430 rajveer 15347
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 15348
    static {
3430 rajveer 15349
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15350
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15351
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
15352
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15353
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_args.class, metaDataMap);
3385 varun.gupt 15354
    }
15355
 
15356
    public getSuccessfulPaymentCountForCoupon_args() {
15357
    }
15358
 
15359
    public getSuccessfulPaymentCountForCoupon_args(
15360
      String couponCode)
15361
    {
15362
      this();
15363
      this.couponCode = couponCode;
15364
    }
15365
 
15366
    /**
15367
     * Performs a deep copy on <i>other</i>.
15368
     */
15369
    public getSuccessfulPaymentCountForCoupon_args(getSuccessfulPaymentCountForCoupon_args other) {
15370
      if (other.isSetCouponCode()) {
15371
        this.couponCode = other.couponCode;
15372
      }
15373
    }
15374
 
15375
    public getSuccessfulPaymentCountForCoupon_args deepCopy() {
15376
      return new getSuccessfulPaymentCountForCoupon_args(this);
15377
    }
15378
 
3430 rajveer 15379
    @Override
15380
    public void clear() {
15381
      this.couponCode = null;
3385 varun.gupt 15382
    }
15383
 
15384
    public String getCouponCode() {
15385
      return this.couponCode;
15386
    }
15387
 
3430 rajveer 15388
    public void setCouponCode(String couponCode) {
3385 varun.gupt 15389
      this.couponCode = couponCode;
15390
    }
15391
 
15392
    public void unsetCouponCode() {
15393
      this.couponCode = null;
15394
    }
15395
 
3430 rajveer 15396
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3385 varun.gupt 15397
    public boolean isSetCouponCode() {
15398
      return this.couponCode != null;
15399
    }
15400
 
15401
    public void setCouponCodeIsSet(boolean value) {
15402
      if (!value) {
15403
        this.couponCode = null;
15404
      }
15405
    }
15406
 
15407
    public void setFieldValue(_Fields field, Object value) {
15408
      switch (field) {
15409
      case COUPON_CODE:
15410
        if (value == null) {
15411
          unsetCouponCode();
15412
        } else {
15413
          setCouponCode((String)value);
15414
        }
15415
        break;
15416
 
15417
      }
15418
    }
15419
 
15420
    public Object getFieldValue(_Fields field) {
15421
      switch (field) {
15422
      case COUPON_CODE:
15423
        return getCouponCode();
15424
 
15425
      }
15426
      throw new IllegalStateException();
15427
    }
15428
 
3430 rajveer 15429
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15430
    public boolean isSet(_Fields field) {
15431
      if (field == null) {
15432
        throw new IllegalArgumentException();
15433
      }
3385 varun.gupt 15434
 
15435
      switch (field) {
15436
      case COUPON_CODE:
15437
        return isSetCouponCode();
15438
      }
15439
      throw new IllegalStateException();
15440
    }
15441
 
15442
    @Override
15443
    public boolean equals(Object that) {
15444
      if (that == null)
15445
        return false;
15446
      if (that instanceof getSuccessfulPaymentCountForCoupon_args)
15447
        return this.equals((getSuccessfulPaymentCountForCoupon_args)that);
15448
      return false;
15449
    }
15450
 
15451
    public boolean equals(getSuccessfulPaymentCountForCoupon_args that) {
15452
      if (that == null)
15453
        return false;
15454
 
15455
      boolean this_present_couponCode = true && this.isSetCouponCode();
15456
      boolean that_present_couponCode = true && that.isSetCouponCode();
15457
      if (this_present_couponCode || that_present_couponCode) {
15458
        if (!(this_present_couponCode && that_present_couponCode))
15459
          return false;
15460
        if (!this.couponCode.equals(that.couponCode))
15461
          return false;
15462
      }
15463
 
15464
      return true;
15465
    }
15466
 
15467
    @Override
15468
    public int hashCode() {
15469
      return 0;
15470
    }
15471
 
15472
    public int compareTo(getSuccessfulPaymentCountForCoupon_args other) {
15473
      if (!getClass().equals(other.getClass())) {
15474
        return getClass().getName().compareTo(other.getClass().getName());
15475
      }
15476
 
15477
      int lastComparison = 0;
15478
      getSuccessfulPaymentCountForCoupon_args typedOther = (getSuccessfulPaymentCountForCoupon_args)other;
15479
 
3430 rajveer 15480
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3385 varun.gupt 15481
      if (lastComparison != 0) {
15482
        return lastComparison;
15483
      }
3430 rajveer 15484
      if (isSetCouponCode()) {
15485
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
15486
        if (lastComparison != 0) {
15487
          return lastComparison;
15488
        }
3385 varun.gupt 15489
      }
15490
      return 0;
15491
    }
15492
 
3430 rajveer 15493
    public _Fields fieldForId(int fieldId) {
15494
      return _Fields.findByThriftId(fieldId);
15495
    }
15496
 
15497
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15498
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 15499
      iprot.readStructBegin();
15500
      while (true)
15501
      {
15502
        field = iprot.readFieldBegin();
3430 rajveer 15503
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 15504
          break;
15505
        }
3430 rajveer 15506
        switch (field.id) {
15507
          case 1: // COUPON_CODE
15508
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
15509
              this.couponCode = iprot.readString();
15510
            } else { 
15511
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15512
            }
15513
            break;
15514
          default:
15515
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 15516
        }
3430 rajveer 15517
        iprot.readFieldEnd();
3385 varun.gupt 15518
      }
15519
      iprot.readStructEnd();
15520
      validate();
15521
    }
15522
 
3430 rajveer 15523
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 15524
      validate();
15525
 
15526
      oprot.writeStructBegin(STRUCT_DESC);
15527
      if (this.couponCode != null) {
15528
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
15529
        oprot.writeString(this.couponCode);
15530
        oprot.writeFieldEnd();
15531
      }
15532
      oprot.writeFieldStop();
15533
      oprot.writeStructEnd();
15534
    }
15535
 
15536
    @Override
15537
    public String toString() {
15538
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_args(");
15539
      boolean first = true;
15540
 
15541
      sb.append("couponCode:");
15542
      if (this.couponCode == null) {
15543
        sb.append("null");
15544
      } else {
15545
        sb.append(this.couponCode);
15546
      }
15547
      first = false;
15548
      sb.append(")");
15549
      return sb.toString();
15550
    }
15551
 
3430 rajveer 15552
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 15553
      // check for required fields
15554
    }
15555
 
3430 rajveer 15556
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15557
      try {
15558
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15559
      } catch (org.apache.thrift.TException te) {
15560
        throw new java.io.IOException(te);
15561
      }
15562
    }
15563
 
15564
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15565
      try {
15566
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15567
      } catch (org.apache.thrift.TException te) {
15568
        throw new java.io.IOException(te);
15569
      }
15570
    }
15571
 
3385 varun.gupt 15572
  }
15573
 
3430 rajveer 15574
  public static class getSuccessfulPaymentCountForCoupon_result implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_result, getSuccessfulPaymentCountForCoupon_result._Fields>, java.io.Serializable, Cloneable   {
15575
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_result");
3385 varun.gupt 15576
 
3430 rajveer 15577
    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);
15578
    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 15579
 
3430 rajveer 15580
    private long success; // required
15581
    private PromotionException pex; // required
3385 varun.gupt 15582
 
15583
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 15584
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 15585
      SUCCESS((short)0, "success"),
15586
      PEX((short)1, "pex");
15587
 
15588
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15589
 
15590
      static {
15591
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15592
          byName.put(field.getFieldName(), field);
15593
        }
15594
      }
15595
 
15596
      /**
15597
       * Find the _Fields constant that matches fieldId, or null if its not found.
15598
       */
15599
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 15600
        switch(fieldId) {
15601
          case 0: // SUCCESS
15602
            return SUCCESS;
15603
          case 1: // PEX
15604
            return PEX;
15605
          default:
15606
            return null;
15607
        }
3385 varun.gupt 15608
      }
15609
 
15610
      /**
15611
       * Find the _Fields constant that matches fieldId, throwing an exception
15612
       * if it is not found.
15613
       */
15614
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15615
        _Fields fields = findByThriftId(fieldId);
15616
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15617
        return fields;
15618
      }
15619
 
15620
      /**
15621
       * Find the _Fields constant that matches name, or null if its not found.
15622
       */
15623
      public static _Fields findByName(String name) {
15624
        return byName.get(name);
15625
      }
15626
 
15627
      private final short _thriftId;
15628
      private final String _fieldName;
15629
 
15630
      _Fields(short thriftId, String fieldName) {
15631
        _thriftId = thriftId;
15632
        _fieldName = fieldName;
15633
      }
15634
 
15635
      public short getThriftFieldId() {
15636
        return _thriftId;
15637
      }
15638
 
15639
      public String getFieldName() {
15640
        return _fieldName;
15641
      }
15642
    }
15643
 
15644
    // isset id assignments
15645
    private static final int __SUCCESS_ISSET_ID = 0;
15646
    private BitSet __isset_bit_vector = new BitSet(1);
15647
 
3430 rajveer 15648
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 15649
    static {
3430 rajveer 15650
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15651
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15652
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
15653
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15654
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
15655
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15656
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_result.class, metaDataMap);
3385 varun.gupt 15657
    }
15658
 
15659
    public getSuccessfulPaymentCountForCoupon_result() {
15660
    }
15661
 
15662
    public getSuccessfulPaymentCountForCoupon_result(
15663
      long success,
15664
      PromotionException pex)
15665
    {
15666
      this();
15667
      this.success = success;
15668
      setSuccessIsSet(true);
15669
      this.pex = pex;
15670
    }
15671
 
15672
    /**
15673
     * Performs a deep copy on <i>other</i>.
15674
     */
15675
    public getSuccessfulPaymentCountForCoupon_result(getSuccessfulPaymentCountForCoupon_result other) {
15676
      __isset_bit_vector.clear();
15677
      __isset_bit_vector.or(other.__isset_bit_vector);
15678
      this.success = other.success;
15679
      if (other.isSetPex()) {
15680
        this.pex = new PromotionException(other.pex);
15681
      }
15682
    }
15683
 
15684
    public getSuccessfulPaymentCountForCoupon_result deepCopy() {
15685
      return new getSuccessfulPaymentCountForCoupon_result(this);
15686
    }
15687
 
3430 rajveer 15688
    @Override
15689
    public void clear() {
15690
      setSuccessIsSet(false);
15691
      this.success = 0;
15692
      this.pex = null;
3385 varun.gupt 15693
    }
15694
 
15695
    public long getSuccess() {
15696
      return this.success;
15697
    }
15698
 
3430 rajveer 15699
    public void setSuccess(long success) {
3385 varun.gupt 15700
      this.success = success;
15701
      setSuccessIsSet(true);
15702
    }
15703
 
15704
    public void unsetSuccess() {
15705
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
15706
    }
15707
 
3430 rajveer 15708
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 15709
    public boolean isSetSuccess() {
15710
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
15711
    }
15712
 
15713
    public void setSuccessIsSet(boolean value) {
15714
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
15715
    }
15716
 
15717
    public PromotionException getPex() {
15718
      return this.pex;
15719
    }
15720
 
3430 rajveer 15721
    public void setPex(PromotionException pex) {
3385 varun.gupt 15722
      this.pex = pex;
15723
    }
15724
 
15725
    public void unsetPex() {
15726
      this.pex = null;
15727
    }
15728
 
3430 rajveer 15729
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 15730
    public boolean isSetPex() {
15731
      return this.pex != null;
15732
    }
15733
 
15734
    public void setPexIsSet(boolean value) {
15735
      if (!value) {
15736
        this.pex = null;
15737
      }
15738
    }
15739
 
15740
    public void setFieldValue(_Fields field, Object value) {
15741
      switch (field) {
15742
      case SUCCESS:
15743
        if (value == null) {
15744
          unsetSuccess();
15745
        } else {
15746
          setSuccess((Long)value);
15747
        }
15748
        break;
15749
 
15750
      case PEX:
15751
        if (value == null) {
15752
          unsetPex();
15753
        } else {
15754
          setPex((PromotionException)value);
15755
        }
15756
        break;
15757
 
15758
      }
15759
    }
15760
 
15761
    public Object getFieldValue(_Fields field) {
15762
      switch (field) {
15763
      case SUCCESS:
3430 rajveer 15764
        return Long.valueOf(getSuccess());
3385 varun.gupt 15765
 
15766
      case PEX:
15767
        return getPex();
15768
 
15769
      }
15770
      throw new IllegalStateException();
15771
    }
15772
 
3430 rajveer 15773
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15774
    public boolean isSet(_Fields field) {
15775
      if (field == null) {
15776
        throw new IllegalArgumentException();
15777
      }
3385 varun.gupt 15778
 
15779
      switch (field) {
15780
      case SUCCESS:
15781
        return isSetSuccess();
15782
      case PEX:
15783
        return isSetPex();
15784
      }
15785
      throw new IllegalStateException();
15786
    }
15787
 
15788
    @Override
15789
    public boolean equals(Object that) {
15790
      if (that == null)
15791
        return false;
15792
      if (that instanceof getSuccessfulPaymentCountForCoupon_result)
15793
        return this.equals((getSuccessfulPaymentCountForCoupon_result)that);
15794
      return false;
15795
    }
15796
 
15797
    public boolean equals(getSuccessfulPaymentCountForCoupon_result that) {
15798
      if (that == null)
15799
        return false;
15800
 
15801
      boolean this_present_success = true;
15802
      boolean that_present_success = true;
15803
      if (this_present_success || that_present_success) {
15804
        if (!(this_present_success && that_present_success))
15805
          return false;
15806
        if (this.success != that.success)
15807
          return false;
15808
      }
15809
 
15810
      boolean this_present_pex = true && this.isSetPex();
15811
      boolean that_present_pex = true && that.isSetPex();
15812
      if (this_present_pex || that_present_pex) {
15813
        if (!(this_present_pex && that_present_pex))
15814
          return false;
15815
        if (!this.pex.equals(that.pex))
15816
          return false;
15817
      }
15818
 
15819
      return true;
15820
    }
15821
 
15822
    @Override
15823
    public int hashCode() {
15824
      return 0;
15825
    }
15826
 
15827
    public int compareTo(getSuccessfulPaymentCountForCoupon_result other) {
15828
      if (!getClass().equals(other.getClass())) {
15829
        return getClass().getName().compareTo(other.getClass().getName());
15830
      }
15831
 
15832
      int lastComparison = 0;
15833
      getSuccessfulPaymentCountForCoupon_result typedOther = (getSuccessfulPaymentCountForCoupon_result)other;
15834
 
3430 rajveer 15835
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 15836
      if (lastComparison != 0) {
15837
        return lastComparison;
15838
      }
3430 rajveer 15839
      if (isSetSuccess()) {
15840
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
15841
        if (lastComparison != 0) {
15842
          return lastComparison;
15843
        }
3385 varun.gupt 15844
      }
3430 rajveer 15845
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 15846
      if (lastComparison != 0) {
15847
        return lastComparison;
15848
      }
3430 rajveer 15849
      if (isSetPex()) {
15850
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
15851
        if (lastComparison != 0) {
15852
          return lastComparison;
15853
        }
3385 varun.gupt 15854
      }
15855
      return 0;
15856
    }
15857
 
3430 rajveer 15858
    public _Fields fieldForId(int fieldId) {
15859
      return _Fields.findByThriftId(fieldId);
15860
    }
15861
 
15862
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15863
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 15864
      iprot.readStructBegin();
15865
      while (true)
15866
      {
15867
        field = iprot.readFieldBegin();
3430 rajveer 15868
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 15869
          break;
15870
        }
3430 rajveer 15871
        switch (field.id) {
15872
          case 0: // SUCCESS
15873
            if (field.type == org.apache.thrift.protocol.TType.I64) {
15874
              this.success = iprot.readI64();
15875
              setSuccessIsSet(true);
15876
            } else { 
15877
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15878
            }
15879
            break;
15880
          case 1: // PEX
15881
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
15882
              this.pex = new PromotionException();
15883
              this.pex.read(iprot);
15884
            } else { 
15885
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15886
            }
15887
            break;
15888
          default:
15889
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 15890
        }
3430 rajveer 15891
        iprot.readFieldEnd();
3385 varun.gupt 15892
      }
15893
      iprot.readStructEnd();
15894
      validate();
15895
    }
15896
 
3430 rajveer 15897
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 15898
      oprot.writeStructBegin(STRUCT_DESC);
15899
 
15900
      if (this.isSetSuccess()) {
15901
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
15902
        oprot.writeI64(this.success);
15903
        oprot.writeFieldEnd();
15904
      } else if (this.isSetPex()) {
15905
        oprot.writeFieldBegin(PEX_FIELD_DESC);
15906
        this.pex.write(oprot);
15907
        oprot.writeFieldEnd();
15908
      }
15909
      oprot.writeFieldStop();
15910
      oprot.writeStructEnd();
15911
    }
15912
 
15913
    @Override
15914
    public String toString() {
15915
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_result(");
15916
      boolean first = true;
15917
 
15918
      sb.append("success:");
15919
      sb.append(this.success);
15920
      first = false;
15921
      if (!first) sb.append(", ");
15922
      sb.append("pex:");
15923
      if (this.pex == null) {
15924
        sb.append("null");
15925
      } else {
15926
        sb.append(this.pex);
15927
      }
15928
      first = false;
15929
      sb.append(")");
15930
      return sb.toString();
15931
    }
15932
 
3430 rajveer 15933
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 15934
      // check for required fields
15935
    }
15936
 
3430 rajveer 15937
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15938
      try {
15939
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15940
      } catch (org.apache.thrift.TException te) {
15941
        throw new java.io.IOException(te);
15942
      }
15943
    }
15944
 
15945
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15946
      try {
15947
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15948
      } catch (org.apache.thrift.TException te) {
15949
        throw new java.io.IOException(te);
15950
      }
15951
    }
15952
 
3385 varun.gupt 15953
  }
15954
 
3430 rajveer 15955
  public static class getRuleDocString_args implements org.apache.thrift.TBase<getRuleDocString_args, getRuleDocString_args._Fields>, java.io.Serializable, Cloneable   {
15956
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_args");
3385 varun.gupt 15957
 
3430 rajveer 15958
    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 15959
 
3430 rajveer 15960
    private String ruleName; // required
3385 varun.gupt 15961
 
15962
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 15963
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 15964
      RULE_NAME((short)1, "ruleName");
15965
 
15966
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15967
 
15968
      static {
15969
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15970
          byName.put(field.getFieldName(), field);
15971
        }
15972
      }
15973
 
15974
      /**
15975
       * Find the _Fields constant that matches fieldId, or null if its not found.
15976
       */
15977
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 15978
        switch(fieldId) {
15979
          case 1: // RULE_NAME
15980
            return RULE_NAME;
15981
          default:
15982
            return null;
15983
        }
3385 varun.gupt 15984
      }
15985
 
15986
      /**
15987
       * Find the _Fields constant that matches fieldId, throwing an exception
15988
       * if it is not found.
15989
       */
15990
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15991
        _Fields fields = findByThriftId(fieldId);
15992
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15993
        return fields;
15994
      }
15995
 
15996
      /**
15997
       * Find the _Fields constant that matches name, or null if its not found.
15998
       */
15999
      public static _Fields findByName(String name) {
16000
        return byName.get(name);
16001
      }
16002
 
16003
      private final short _thriftId;
16004
      private final String _fieldName;
16005
 
16006
      _Fields(short thriftId, String fieldName) {
16007
        _thriftId = thriftId;
16008
        _fieldName = fieldName;
16009
      }
16010
 
16011
      public short getThriftFieldId() {
16012
        return _thriftId;
16013
      }
16014
 
16015
      public String getFieldName() {
16016
        return _fieldName;
16017
      }
16018
    }
16019
 
16020
    // isset id assignments
16021
 
3430 rajveer 16022
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 16023
    static {
3430 rajveer 16024
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16025
      tmpMap.put(_Fields.RULE_NAME, new org.apache.thrift.meta_data.FieldMetaData("ruleName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16026
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
16027
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16028
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_args.class, metaDataMap);
3385 varun.gupt 16029
    }
16030
 
16031
    public getRuleDocString_args() {
16032
    }
16033
 
16034
    public getRuleDocString_args(
16035
      String ruleName)
16036
    {
16037
      this();
16038
      this.ruleName = ruleName;
16039
    }
16040
 
16041
    /**
16042
     * Performs a deep copy on <i>other</i>.
16043
     */
16044
    public getRuleDocString_args(getRuleDocString_args other) {
16045
      if (other.isSetRuleName()) {
16046
        this.ruleName = other.ruleName;
16047
      }
16048
    }
16049
 
16050
    public getRuleDocString_args deepCopy() {
16051
      return new getRuleDocString_args(this);
16052
    }
16053
 
3430 rajveer 16054
    @Override
16055
    public void clear() {
16056
      this.ruleName = null;
3385 varun.gupt 16057
    }
16058
 
16059
    public String getRuleName() {
16060
      return this.ruleName;
16061
    }
16062
 
3430 rajveer 16063
    public void setRuleName(String ruleName) {
3385 varun.gupt 16064
      this.ruleName = ruleName;
16065
    }
16066
 
16067
    public void unsetRuleName() {
16068
      this.ruleName = null;
16069
    }
16070
 
3430 rajveer 16071
    /** Returns true if field ruleName is set (has been assigned a value) and false otherwise */
3385 varun.gupt 16072
    public boolean isSetRuleName() {
16073
      return this.ruleName != null;
16074
    }
16075
 
16076
    public void setRuleNameIsSet(boolean value) {
16077
      if (!value) {
16078
        this.ruleName = null;
16079
      }
16080
    }
16081
 
16082
    public void setFieldValue(_Fields field, Object value) {
16083
      switch (field) {
16084
      case RULE_NAME:
16085
        if (value == null) {
16086
          unsetRuleName();
16087
        } else {
16088
          setRuleName((String)value);
16089
        }
16090
        break;
16091
 
16092
      }
16093
    }
16094
 
16095
    public Object getFieldValue(_Fields field) {
16096
      switch (field) {
16097
      case RULE_NAME:
16098
        return getRuleName();
16099
 
16100
      }
16101
      throw new IllegalStateException();
16102
    }
16103
 
3430 rajveer 16104
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16105
    public boolean isSet(_Fields field) {
16106
      if (field == null) {
16107
        throw new IllegalArgumentException();
16108
      }
3385 varun.gupt 16109
 
16110
      switch (field) {
16111
      case RULE_NAME:
16112
        return isSetRuleName();
16113
      }
16114
      throw new IllegalStateException();
16115
    }
16116
 
16117
    @Override
16118
    public boolean equals(Object that) {
16119
      if (that == null)
16120
        return false;
16121
      if (that instanceof getRuleDocString_args)
16122
        return this.equals((getRuleDocString_args)that);
16123
      return false;
16124
    }
16125
 
16126
    public boolean equals(getRuleDocString_args that) {
16127
      if (that == null)
16128
        return false;
16129
 
16130
      boolean this_present_ruleName = true && this.isSetRuleName();
16131
      boolean that_present_ruleName = true && that.isSetRuleName();
16132
      if (this_present_ruleName || that_present_ruleName) {
16133
        if (!(this_present_ruleName && that_present_ruleName))
16134
          return false;
16135
        if (!this.ruleName.equals(that.ruleName))
16136
          return false;
16137
      }
16138
 
16139
      return true;
16140
    }
16141
 
16142
    @Override
16143
    public int hashCode() {
16144
      return 0;
16145
    }
16146
 
16147
    public int compareTo(getRuleDocString_args other) {
16148
      if (!getClass().equals(other.getClass())) {
16149
        return getClass().getName().compareTo(other.getClass().getName());
16150
      }
16151
 
16152
      int lastComparison = 0;
16153
      getRuleDocString_args typedOther = (getRuleDocString_args)other;
16154
 
3430 rajveer 16155
      lastComparison = Boolean.valueOf(isSetRuleName()).compareTo(typedOther.isSetRuleName());
3385 varun.gupt 16156
      if (lastComparison != 0) {
16157
        return lastComparison;
16158
      }
3430 rajveer 16159
      if (isSetRuleName()) {
16160
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleName, typedOther.ruleName);
16161
        if (lastComparison != 0) {
16162
          return lastComparison;
16163
        }
3385 varun.gupt 16164
      }
16165
      return 0;
16166
    }
16167
 
3430 rajveer 16168
    public _Fields fieldForId(int fieldId) {
16169
      return _Fields.findByThriftId(fieldId);
16170
    }
16171
 
16172
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16173
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 16174
      iprot.readStructBegin();
16175
      while (true)
16176
      {
16177
        field = iprot.readFieldBegin();
3430 rajveer 16178
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 16179
          break;
16180
        }
3430 rajveer 16181
        switch (field.id) {
16182
          case 1: // RULE_NAME
16183
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
16184
              this.ruleName = iprot.readString();
16185
            } else { 
16186
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16187
            }
16188
            break;
16189
          default:
16190
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 16191
        }
3430 rajveer 16192
        iprot.readFieldEnd();
3385 varun.gupt 16193
      }
16194
      iprot.readStructEnd();
16195
      validate();
16196
    }
16197
 
3430 rajveer 16198
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 16199
      validate();
16200
 
16201
      oprot.writeStructBegin(STRUCT_DESC);
16202
      if (this.ruleName != null) {
16203
        oprot.writeFieldBegin(RULE_NAME_FIELD_DESC);
16204
        oprot.writeString(this.ruleName);
16205
        oprot.writeFieldEnd();
16206
      }
16207
      oprot.writeFieldStop();
16208
      oprot.writeStructEnd();
16209
    }
16210
 
16211
    @Override
16212
    public String toString() {
16213
      StringBuilder sb = new StringBuilder("getRuleDocString_args(");
16214
      boolean first = true;
16215
 
16216
      sb.append("ruleName:");
16217
      if (this.ruleName == null) {
16218
        sb.append("null");
16219
      } else {
16220
        sb.append(this.ruleName);
16221
      }
16222
      first = false;
16223
      sb.append(")");
16224
      return sb.toString();
16225
    }
16226
 
3430 rajveer 16227
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 16228
      // check for required fields
16229
    }
16230
 
3430 rajveer 16231
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16232
      try {
16233
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16234
      } catch (org.apache.thrift.TException te) {
16235
        throw new java.io.IOException(te);
16236
      }
16237
    }
16238
 
16239
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16240
      try {
16241
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16242
      } catch (org.apache.thrift.TException te) {
16243
        throw new java.io.IOException(te);
16244
      }
16245
    }
16246
 
3385 varun.gupt 16247
  }
16248
 
3430 rajveer 16249
  public static class getRuleDocString_result implements org.apache.thrift.TBase<getRuleDocString_result, getRuleDocString_result._Fields>, java.io.Serializable, Cloneable   {
16250
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_result");
3385 varun.gupt 16251
 
3430 rajveer 16252
    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 16253
 
3430 rajveer 16254
    private String success; // required
3385 varun.gupt 16255
 
16256
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 16257
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 16258
      SUCCESS((short)0, "success");
16259
 
16260
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16261
 
16262
      static {
16263
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16264
          byName.put(field.getFieldName(), field);
16265
        }
16266
      }
16267
 
16268
      /**
16269
       * Find the _Fields constant that matches fieldId, or null if its not found.
16270
       */
16271
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 16272
        switch(fieldId) {
16273
          case 0: // SUCCESS
16274
            return SUCCESS;
16275
          default:
16276
            return null;
16277
        }
3385 varun.gupt 16278
      }
16279
 
16280
      /**
16281
       * Find the _Fields constant that matches fieldId, throwing an exception
16282
       * if it is not found.
16283
       */
16284
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16285
        _Fields fields = findByThriftId(fieldId);
16286
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16287
        return fields;
16288
      }
16289
 
16290
      /**
16291
       * Find the _Fields constant that matches name, or null if its not found.
16292
       */
16293
      public static _Fields findByName(String name) {
16294
        return byName.get(name);
16295
      }
16296
 
16297
      private final short _thriftId;
16298
      private final String _fieldName;
16299
 
16300
      _Fields(short thriftId, String fieldName) {
16301
        _thriftId = thriftId;
16302
        _fieldName = fieldName;
16303
      }
16304
 
16305
      public short getThriftFieldId() {
16306
        return _thriftId;
16307
      }
16308
 
16309
      public String getFieldName() {
16310
        return _fieldName;
16311
      }
16312
    }
16313
 
16314
    // isset id assignments
16315
 
3430 rajveer 16316
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 16317
    static {
3430 rajveer 16318
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16319
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16320
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
16321
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16322
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_result.class, metaDataMap);
3385 varun.gupt 16323
    }
16324
 
16325
    public getRuleDocString_result() {
16326
    }
16327
 
16328
    public getRuleDocString_result(
16329
      String success)
16330
    {
16331
      this();
16332
      this.success = success;
16333
    }
16334
 
16335
    /**
16336
     * Performs a deep copy on <i>other</i>.
16337
     */
16338
    public getRuleDocString_result(getRuleDocString_result other) {
16339
      if (other.isSetSuccess()) {
16340
        this.success = other.success;
16341
      }
16342
    }
16343
 
16344
    public getRuleDocString_result deepCopy() {
16345
      return new getRuleDocString_result(this);
16346
    }
16347
 
3430 rajveer 16348
    @Override
16349
    public void clear() {
16350
      this.success = null;
3385 varun.gupt 16351
    }
16352
 
16353
    public String getSuccess() {
16354
      return this.success;
16355
    }
16356
 
3430 rajveer 16357
    public void setSuccess(String success) {
3385 varun.gupt 16358
      this.success = success;
16359
    }
16360
 
16361
    public void unsetSuccess() {
16362
      this.success = null;
16363
    }
16364
 
3430 rajveer 16365
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 16366
    public boolean isSetSuccess() {
16367
      return this.success != null;
16368
    }
16369
 
16370
    public void setSuccessIsSet(boolean value) {
16371
      if (!value) {
16372
        this.success = null;
16373
      }
16374
    }
16375
 
16376
    public void setFieldValue(_Fields field, Object value) {
16377
      switch (field) {
16378
      case SUCCESS:
16379
        if (value == null) {
16380
          unsetSuccess();
16381
        } else {
16382
          setSuccess((String)value);
16383
        }
16384
        break;
16385
 
16386
      }
16387
    }
16388
 
16389
    public Object getFieldValue(_Fields field) {
16390
      switch (field) {
16391
      case SUCCESS:
16392
        return getSuccess();
16393
 
16394
      }
16395
      throw new IllegalStateException();
16396
    }
16397
 
3430 rajveer 16398
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16399
    public boolean isSet(_Fields field) {
16400
      if (field == null) {
16401
        throw new IllegalArgumentException();
16402
      }
3385 varun.gupt 16403
 
16404
      switch (field) {
16405
      case SUCCESS:
16406
        return isSetSuccess();
16407
      }
16408
      throw new IllegalStateException();
16409
    }
16410
 
16411
    @Override
16412
    public boolean equals(Object that) {
16413
      if (that == null)
16414
        return false;
16415
      if (that instanceof getRuleDocString_result)
16416
        return this.equals((getRuleDocString_result)that);
16417
      return false;
16418
    }
16419
 
16420
    public boolean equals(getRuleDocString_result that) {
16421
      if (that == null)
16422
        return false;
16423
 
16424
      boolean this_present_success = true && this.isSetSuccess();
16425
      boolean that_present_success = true && that.isSetSuccess();
16426
      if (this_present_success || that_present_success) {
16427
        if (!(this_present_success && that_present_success))
16428
          return false;
16429
        if (!this.success.equals(that.success))
16430
          return false;
16431
      }
16432
 
16433
      return true;
16434
    }
16435
 
16436
    @Override
16437
    public int hashCode() {
16438
      return 0;
16439
    }
16440
 
16441
    public int compareTo(getRuleDocString_result other) {
16442
      if (!getClass().equals(other.getClass())) {
16443
        return getClass().getName().compareTo(other.getClass().getName());
16444
      }
16445
 
16446
      int lastComparison = 0;
16447
      getRuleDocString_result typedOther = (getRuleDocString_result)other;
16448
 
3430 rajveer 16449
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 16450
      if (lastComparison != 0) {
16451
        return lastComparison;
16452
      }
3430 rajveer 16453
      if (isSetSuccess()) {
16454
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
16455
        if (lastComparison != 0) {
16456
          return lastComparison;
16457
        }
3385 varun.gupt 16458
      }
16459
      return 0;
16460
    }
16461
 
3430 rajveer 16462
    public _Fields fieldForId(int fieldId) {
16463
      return _Fields.findByThriftId(fieldId);
16464
    }
16465
 
16466
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16467
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 16468
      iprot.readStructBegin();
16469
      while (true)
16470
      {
16471
        field = iprot.readFieldBegin();
3430 rajveer 16472
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 16473
          break;
16474
        }
3430 rajveer 16475
        switch (field.id) {
16476
          case 0: // SUCCESS
16477
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
16478
              this.success = iprot.readString();
16479
            } else { 
16480
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16481
            }
16482
            break;
16483
          default:
16484
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 16485
        }
3430 rajveer 16486
        iprot.readFieldEnd();
3385 varun.gupt 16487
      }
16488
      iprot.readStructEnd();
16489
      validate();
16490
    }
16491
 
3430 rajveer 16492
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 16493
      oprot.writeStructBegin(STRUCT_DESC);
16494
 
16495
      if (this.isSetSuccess()) {
16496
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
16497
        oprot.writeString(this.success);
16498
        oprot.writeFieldEnd();
16499
      }
16500
      oprot.writeFieldStop();
16501
      oprot.writeStructEnd();
16502
    }
16503
 
16504
    @Override
16505
    public String toString() {
16506
      StringBuilder sb = new StringBuilder("getRuleDocString_result(");
16507
      boolean first = true;
16508
 
16509
      sb.append("success:");
16510
      if (this.success == null) {
16511
        sb.append("null");
16512
      } else {
16513
        sb.append(this.success);
16514
      }
16515
      first = false;
16516
      sb.append(")");
16517
      return sb.toString();
16518
    }
16519
 
3430 rajveer 16520
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 16521
      // check for required fields
16522
    }
16523
 
3430 rajveer 16524
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16525
      try {
16526
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16527
      } catch (org.apache.thrift.TException te) {
16528
        throw new java.io.IOException(te);
16529
      }
16530
    }
16531
 
16532
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16533
      try {
16534
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16535
      } catch (org.apache.thrift.TException te) {
16536
        throw new java.io.IOException(te);
16537
      }
16538
    }
16539
 
3385 varun.gupt 16540
  }
16541
 
4189 varun.gupt 16542
  public static class getItemDiscountMap_args implements org.apache.thrift.TBase<getItemDiscountMap_args, getItemDiscountMap_args._Fields>, java.io.Serializable, Cloneable   {
16543
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_args");
16544
 
16545
    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);
16546
 
16547
    private List<Long> itemIds; // required
16548
 
16549
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
16550
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
16551
      ITEM_IDS((short)1, "itemIds");
16552
 
16553
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16554
 
16555
      static {
16556
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16557
          byName.put(field.getFieldName(), field);
16558
        }
16559
      }
16560
 
16561
      /**
16562
       * Find the _Fields constant that matches fieldId, or null if its not found.
16563
       */
16564
      public static _Fields findByThriftId(int fieldId) {
16565
        switch(fieldId) {
16566
          case 1: // ITEM_IDS
16567
            return ITEM_IDS;
16568
          default:
16569
            return null;
16570
        }
16571
      }
16572
 
16573
      /**
16574
       * Find the _Fields constant that matches fieldId, throwing an exception
16575
       * if it is not found.
16576
       */
16577
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16578
        _Fields fields = findByThriftId(fieldId);
16579
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16580
        return fields;
16581
      }
16582
 
16583
      /**
16584
       * Find the _Fields constant that matches name, or null if its not found.
16585
       */
16586
      public static _Fields findByName(String name) {
16587
        return byName.get(name);
16588
      }
16589
 
16590
      private final short _thriftId;
16591
      private final String _fieldName;
16592
 
16593
      _Fields(short thriftId, String fieldName) {
16594
        _thriftId = thriftId;
16595
        _fieldName = fieldName;
16596
      }
16597
 
16598
      public short getThriftFieldId() {
16599
        return _thriftId;
16600
      }
16601
 
16602
      public String getFieldName() {
16603
        return _fieldName;
16604
      }
16605
    }
16606
 
16607
    // isset id assignments
16608
 
16609
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
16610
    static {
16611
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16612
      tmpMap.put(_Fields.ITEM_IDS, new org.apache.thrift.meta_data.FieldMetaData("itemIds", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16613
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
16614
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
16615
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16616
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_args.class, metaDataMap);
16617
    }
16618
 
16619
    public getItemDiscountMap_args() {
16620
    }
16621
 
16622
    public getItemDiscountMap_args(
16623
      List<Long> itemIds)
16624
    {
16625
      this();
16626
      this.itemIds = itemIds;
16627
    }
16628
 
16629
    /**
16630
     * Performs a deep copy on <i>other</i>.
16631
     */
16632
    public getItemDiscountMap_args(getItemDiscountMap_args other) {
16633
      if (other.isSetItemIds()) {
16634
        List<Long> __this__itemIds = new ArrayList<Long>();
16635
        for (Long other_element : other.itemIds) {
16636
          __this__itemIds.add(other_element);
16637
        }
16638
        this.itemIds = __this__itemIds;
16639
      }
16640
    }
16641
 
16642
    public getItemDiscountMap_args deepCopy() {
16643
      return new getItemDiscountMap_args(this);
16644
    }
16645
 
16646
    @Override
16647
    public void clear() {
16648
      this.itemIds = null;
16649
    }
16650
 
16651
    public int getItemIdsSize() {
16652
      return (this.itemIds == null) ? 0 : this.itemIds.size();
16653
    }
16654
 
16655
    public java.util.Iterator<Long> getItemIdsIterator() {
16656
      return (this.itemIds == null) ? null : this.itemIds.iterator();
16657
    }
16658
 
16659
    public void addToItemIds(long elem) {
16660
      if (this.itemIds == null) {
16661
        this.itemIds = new ArrayList<Long>();
16662
      }
16663
      this.itemIds.add(elem);
16664
    }
16665
 
16666
    public List<Long> getItemIds() {
16667
      return this.itemIds;
16668
    }
16669
 
16670
    public void setItemIds(List<Long> itemIds) {
16671
      this.itemIds = itemIds;
16672
    }
16673
 
16674
    public void unsetItemIds() {
16675
      this.itemIds = null;
16676
    }
16677
 
16678
    /** Returns true if field itemIds is set (has been assigned a value) and false otherwise */
16679
    public boolean isSetItemIds() {
16680
      return this.itemIds != null;
16681
    }
16682
 
16683
    public void setItemIdsIsSet(boolean value) {
16684
      if (!value) {
16685
        this.itemIds = null;
16686
      }
16687
    }
16688
 
16689
    public void setFieldValue(_Fields field, Object value) {
16690
      switch (field) {
16691
      case ITEM_IDS:
16692
        if (value == null) {
16693
          unsetItemIds();
16694
        } else {
16695
          setItemIds((List<Long>)value);
16696
        }
16697
        break;
16698
 
16699
      }
16700
    }
16701
 
16702
    public Object getFieldValue(_Fields field) {
16703
      switch (field) {
16704
      case ITEM_IDS:
16705
        return getItemIds();
16706
 
16707
      }
16708
      throw new IllegalStateException();
16709
    }
16710
 
16711
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16712
    public boolean isSet(_Fields field) {
16713
      if (field == null) {
16714
        throw new IllegalArgumentException();
16715
      }
16716
 
16717
      switch (field) {
16718
      case ITEM_IDS:
16719
        return isSetItemIds();
16720
      }
16721
      throw new IllegalStateException();
16722
    }
16723
 
16724
    @Override
16725
    public boolean equals(Object that) {
16726
      if (that == null)
16727
        return false;
16728
      if (that instanceof getItemDiscountMap_args)
16729
        return this.equals((getItemDiscountMap_args)that);
16730
      return false;
16731
    }
16732
 
16733
    public boolean equals(getItemDiscountMap_args that) {
16734
      if (that == null)
16735
        return false;
16736
 
16737
      boolean this_present_itemIds = true && this.isSetItemIds();
16738
      boolean that_present_itemIds = true && that.isSetItemIds();
16739
      if (this_present_itemIds || that_present_itemIds) {
16740
        if (!(this_present_itemIds && that_present_itemIds))
16741
          return false;
16742
        if (!this.itemIds.equals(that.itemIds))
16743
          return false;
16744
      }
16745
 
16746
      return true;
16747
    }
16748
 
16749
    @Override
16750
    public int hashCode() {
16751
      return 0;
16752
    }
16753
 
16754
    public int compareTo(getItemDiscountMap_args other) {
16755
      if (!getClass().equals(other.getClass())) {
16756
        return getClass().getName().compareTo(other.getClass().getName());
16757
      }
16758
 
16759
      int lastComparison = 0;
16760
      getItemDiscountMap_args typedOther = (getItemDiscountMap_args)other;
16761
 
16762
      lastComparison = Boolean.valueOf(isSetItemIds()).compareTo(typedOther.isSetItemIds());
16763
      if (lastComparison != 0) {
16764
        return lastComparison;
16765
      }
16766
      if (isSetItemIds()) {
16767
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemIds, typedOther.itemIds);
16768
        if (lastComparison != 0) {
16769
          return lastComparison;
16770
        }
16771
      }
16772
      return 0;
16773
    }
16774
 
16775
    public _Fields fieldForId(int fieldId) {
16776
      return _Fields.findByThriftId(fieldId);
16777
    }
16778
 
16779
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16780
      org.apache.thrift.protocol.TField field;
16781
      iprot.readStructBegin();
16782
      while (true)
16783
      {
16784
        field = iprot.readFieldBegin();
16785
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
16786
          break;
16787
        }
16788
        switch (field.id) {
16789
          case 1: // ITEM_IDS
16790
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
16791
              {
7092 amit.gupta 16792
                org.apache.thrift.protocol.TList _list38 = iprot.readListBegin();
16793
                this.itemIds = new ArrayList<Long>(_list38.size);
16794
                for (int _i39 = 0; _i39 < _list38.size; ++_i39)
4189 varun.gupt 16795
                {
7092 amit.gupta 16796
                  long _elem40; // required
16797
                  _elem40 = iprot.readI64();
16798
                  this.itemIds.add(_elem40);
4189 varun.gupt 16799
                }
16800
                iprot.readListEnd();
16801
              }
16802
            } else { 
16803
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16804
            }
16805
            break;
16806
          default:
16807
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16808
        }
16809
        iprot.readFieldEnd();
16810
      }
16811
      iprot.readStructEnd();
16812
      validate();
16813
    }
16814
 
16815
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
16816
      validate();
16817
 
16818
      oprot.writeStructBegin(STRUCT_DESC);
16819
      if (this.itemIds != null) {
16820
        oprot.writeFieldBegin(ITEM_IDS_FIELD_DESC);
16821
        {
16822
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.itemIds.size()));
7092 amit.gupta 16823
          for (long _iter41 : this.itemIds)
4189 varun.gupt 16824
          {
7092 amit.gupta 16825
            oprot.writeI64(_iter41);
4189 varun.gupt 16826
          }
16827
          oprot.writeListEnd();
16828
        }
16829
        oprot.writeFieldEnd();
16830
      }
16831
      oprot.writeFieldStop();
16832
      oprot.writeStructEnd();
16833
    }
16834
 
16835
    @Override
16836
    public String toString() {
16837
      StringBuilder sb = new StringBuilder("getItemDiscountMap_args(");
16838
      boolean first = true;
16839
 
16840
      sb.append("itemIds:");
16841
      if (this.itemIds == null) {
16842
        sb.append("null");
16843
      } else {
16844
        sb.append(this.itemIds);
16845
      }
16846
      first = false;
16847
      sb.append(")");
16848
      return sb.toString();
16849
    }
16850
 
16851
    public void validate() throws org.apache.thrift.TException {
16852
      // check for required fields
16853
    }
16854
 
16855
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16856
      try {
16857
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16858
      } catch (org.apache.thrift.TException te) {
16859
        throw new java.io.IOException(te);
16860
      }
16861
    }
16862
 
16863
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16864
      try {
16865
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16866
      } catch (org.apache.thrift.TException te) {
16867
        throw new java.io.IOException(te);
16868
      }
16869
    }
16870
 
16871
  }
16872
 
16873
  public static class getItemDiscountMap_result implements org.apache.thrift.TBase<getItemDiscountMap_result, getItemDiscountMap_result._Fields>, java.io.Serializable, Cloneable   {
16874
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_result");
16875
 
16876
    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);
16877
    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);
16878
 
16879
    private List<ItemCouponDiscount> success; // required
16880
    private PromotionException pex; // required
16881
 
16882
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
16883
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
16884
      SUCCESS((short)0, "success"),
16885
      PEX((short)1, "pex");
16886
 
16887
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16888
 
16889
      static {
16890
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16891
          byName.put(field.getFieldName(), field);
16892
        }
16893
      }
16894
 
16895
      /**
16896
       * Find the _Fields constant that matches fieldId, or null if its not found.
16897
       */
16898
      public static _Fields findByThriftId(int fieldId) {
16899
        switch(fieldId) {
16900
          case 0: // SUCCESS
16901
            return SUCCESS;
16902
          case 1: // PEX
16903
            return PEX;
16904
          default:
16905
            return null;
16906
        }
16907
      }
16908
 
16909
      /**
16910
       * Find the _Fields constant that matches fieldId, throwing an exception
16911
       * if it is not found.
16912
       */
16913
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16914
        _Fields fields = findByThriftId(fieldId);
16915
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16916
        return fields;
16917
      }
16918
 
16919
      /**
16920
       * Find the _Fields constant that matches name, or null if its not found.
16921
       */
16922
      public static _Fields findByName(String name) {
16923
        return byName.get(name);
16924
      }
16925
 
16926
      private final short _thriftId;
16927
      private final String _fieldName;
16928
 
16929
      _Fields(short thriftId, String fieldName) {
16930
        _thriftId = thriftId;
16931
        _fieldName = fieldName;
16932
      }
16933
 
16934
      public short getThriftFieldId() {
16935
        return _thriftId;
16936
      }
16937
 
16938
      public String getFieldName() {
16939
        return _fieldName;
16940
      }
16941
    }
16942
 
16943
    // isset id assignments
16944
 
16945
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
16946
    static {
16947
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16948
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16949
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
16950
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ItemCouponDiscount.class))));
16951
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16952
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
16953
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16954
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_result.class, metaDataMap);
16955
    }
16956
 
16957
    public getItemDiscountMap_result() {
16958
    }
16959
 
16960
    public getItemDiscountMap_result(
16961
      List<ItemCouponDiscount> success,
16962
      PromotionException pex)
16963
    {
16964
      this();
16965
      this.success = success;
16966
      this.pex = pex;
16967
    }
16968
 
16969
    /**
16970
     * Performs a deep copy on <i>other</i>.
16971
     */
16972
    public getItemDiscountMap_result(getItemDiscountMap_result other) {
16973
      if (other.isSetSuccess()) {
16974
        List<ItemCouponDiscount> __this__success = new ArrayList<ItemCouponDiscount>();
16975
        for (ItemCouponDiscount other_element : other.success) {
16976
          __this__success.add(new ItemCouponDiscount(other_element));
16977
        }
16978
        this.success = __this__success;
16979
      }
16980
      if (other.isSetPex()) {
16981
        this.pex = new PromotionException(other.pex);
16982
      }
16983
    }
16984
 
16985
    public getItemDiscountMap_result deepCopy() {
16986
      return new getItemDiscountMap_result(this);
16987
    }
16988
 
16989
    @Override
16990
    public void clear() {
16991
      this.success = null;
16992
      this.pex = null;
16993
    }
16994
 
16995
    public int getSuccessSize() {
16996
      return (this.success == null) ? 0 : this.success.size();
16997
    }
16998
 
16999
    public java.util.Iterator<ItemCouponDiscount> getSuccessIterator() {
17000
      return (this.success == null) ? null : this.success.iterator();
17001
    }
17002
 
17003
    public void addToSuccess(ItemCouponDiscount elem) {
17004
      if (this.success == null) {
17005
        this.success = new ArrayList<ItemCouponDiscount>();
17006
      }
17007
      this.success.add(elem);
17008
    }
17009
 
17010
    public List<ItemCouponDiscount> getSuccess() {
17011
      return this.success;
17012
    }
17013
 
17014
    public void setSuccess(List<ItemCouponDiscount> success) {
17015
      this.success = success;
17016
    }
17017
 
17018
    public void unsetSuccess() {
17019
      this.success = null;
17020
    }
17021
 
17022
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
17023
    public boolean isSetSuccess() {
17024
      return this.success != null;
17025
    }
17026
 
17027
    public void setSuccessIsSet(boolean value) {
17028
      if (!value) {
17029
        this.success = null;
17030
      }
17031
    }
17032
 
17033
    public PromotionException getPex() {
17034
      return this.pex;
17035
    }
17036
 
17037
    public void setPex(PromotionException pex) {
17038
      this.pex = pex;
17039
    }
17040
 
17041
    public void unsetPex() {
17042
      this.pex = null;
17043
    }
17044
 
17045
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
17046
    public boolean isSetPex() {
17047
      return this.pex != null;
17048
    }
17049
 
17050
    public void setPexIsSet(boolean value) {
17051
      if (!value) {
17052
        this.pex = null;
17053
      }
17054
    }
17055
 
17056
    public void setFieldValue(_Fields field, Object value) {
17057
      switch (field) {
17058
      case SUCCESS:
17059
        if (value == null) {
17060
          unsetSuccess();
17061
        } else {
17062
          setSuccess((List<ItemCouponDiscount>)value);
17063
        }
17064
        break;
17065
 
17066
      case PEX:
17067
        if (value == null) {
17068
          unsetPex();
17069
        } else {
17070
          setPex((PromotionException)value);
17071
        }
17072
        break;
17073
 
17074
      }
17075
    }
17076
 
17077
    public Object getFieldValue(_Fields field) {
17078
      switch (field) {
17079
      case SUCCESS:
17080
        return getSuccess();
17081
 
17082
      case PEX:
17083
        return getPex();
17084
 
17085
      }
17086
      throw new IllegalStateException();
17087
    }
17088
 
17089
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
17090
    public boolean isSet(_Fields field) {
17091
      if (field == null) {
17092
        throw new IllegalArgumentException();
17093
      }
17094
 
17095
      switch (field) {
17096
      case SUCCESS:
17097
        return isSetSuccess();
17098
      case PEX:
17099
        return isSetPex();
17100
      }
17101
      throw new IllegalStateException();
17102
    }
17103
 
17104
    @Override
17105
    public boolean equals(Object that) {
17106
      if (that == null)
17107
        return false;
17108
      if (that instanceof getItemDiscountMap_result)
17109
        return this.equals((getItemDiscountMap_result)that);
17110
      return false;
17111
    }
17112
 
17113
    public boolean equals(getItemDiscountMap_result that) {
17114
      if (that == null)
17115
        return false;
17116
 
17117
      boolean this_present_success = true && this.isSetSuccess();
17118
      boolean that_present_success = true && that.isSetSuccess();
17119
      if (this_present_success || that_present_success) {
17120
        if (!(this_present_success && that_present_success))
17121
          return false;
17122
        if (!this.success.equals(that.success))
17123
          return false;
17124
      }
17125
 
17126
      boolean this_present_pex = true && this.isSetPex();
17127
      boolean that_present_pex = true && that.isSetPex();
17128
      if (this_present_pex || that_present_pex) {
17129
        if (!(this_present_pex && that_present_pex))
17130
          return false;
17131
        if (!this.pex.equals(that.pex))
17132
          return false;
17133
      }
17134
 
17135
      return true;
17136
    }
17137
 
17138
    @Override
17139
    public int hashCode() {
17140
      return 0;
17141
    }
17142
 
17143
    public int compareTo(getItemDiscountMap_result other) {
17144
      if (!getClass().equals(other.getClass())) {
17145
        return getClass().getName().compareTo(other.getClass().getName());
17146
      }
17147
 
17148
      int lastComparison = 0;
17149
      getItemDiscountMap_result typedOther = (getItemDiscountMap_result)other;
17150
 
17151
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
17152
      if (lastComparison != 0) {
17153
        return lastComparison;
17154
      }
17155
      if (isSetSuccess()) {
17156
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
17157
        if (lastComparison != 0) {
17158
          return lastComparison;
17159
        }
17160
      }
17161
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
17162
      if (lastComparison != 0) {
17163
        return lastComparison;
17164
      }
17165
      if (isSetPex()) {
17166
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
17167
        if (lastComparison != 0) {
17168
          return lastComparison;
17169
        }
17170
      }
17171
      return 0;
17172
    }
17173
 
17174
    public _Fields fieldForId(int fieldId) {
17175
      return _Fields.findByThriftId(fieldId);
17176
    }
17177
 
17178
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17179
      org.apache.thrift.protocol.TField field;
17180
      iprot.readStructBegin();
17181
      while (true)
17182
      {
17183
        field = iprot.readFieldBegin();
17184
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17185
          break;
17186
        }
17187
        switch (field.id) {
17188
          case 0: // SUCCESS
17189
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
17190
              {
7092 amit.gupta 17191
                org.apache.thrift.protocol.TList _list42 = iprot.readListBegin();
17192
                this.success = new ArrayList<ItemCouponDiscount>(_list42.size);
17193
                for (int _i43 = 0; _i43 < _list42.size; ++_i43)
4189 varun.gupt 17194
                {
7092 amit.gupta 17195
                  ItemCouponDiscount _elem44; // required
17196
                  _elem44 = new ItemCouponDiscount();
17197
                  _elem44.read(iprot);
17198
                  this.success.add(_elem44);
4189 varun.gupt 17199
                }
17200
                iprot.readListEnd();
17201
              }
17202
            } else { 
17203
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17204
            }
17205
            break;
17206
          case 1: // PEX
17207
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
17208
              this.pex = new PromotionException();
17209
              this.pex.read(iprot);
17210
            } else { 
17211
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17212
            }
17213
            break;
17214
          default:
17215
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17216
        }
17217
        iprot.readFieldEnd();
17218
      }
17219
      iprot.readStructEnd();
17220
      validate();
17221
    }
17222
 
17223
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17224
      oprot.writeStructBegin(STRUCT_DESC);
17225
 
17226
      if (this.isSetSuccess()) {
17227
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
17228
        {
17229
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
7092 amit.gupta 17230
          for (ItemCouponDiscount _iter45 : this.success)
4189 varun.gupt 17231
          {
7092 amit.gupta 17232
            _iter45.write(oprot);
4189 varun.gupt 17233
          }
17234
          oprot.writeListEnd();
17235
        }
17236
        oprot.writeFieldEnd();
17237
      } else if (this.isSetPex()) {
17238
        oprot.writeFieldBegin(PEX_FIELD_DESC);
17239
        this.pex.write(oprot);
17240
        oprot.writeFieldEnd();
17241
      }
17242
      oprot.writeFieldStop();
17243
      oprot.writeStructEnd();
17244
    }
17245
 
17246
    @Override
17247
    public String toString() {
17248
      StringBuilder sb = new StringBuilder("getItemDiscountMap_result(");
17249
      boolean first = true;
17250
 
17251
      sb.append("success:");
17252
      if (this.success == null) {
17253
        sb.append("null");
17254
      } else {
17255
        sb.append(this.success);
17256
      }
17257
      first = false;
17258
      if (!first) sb.append(", ");
17259
      sb.append("pex:");
17260
      if (this.pex == null) {
17261
        sb.append("null");
17262
      } else {
17263
        sb.append(this.pex);
17264
      }
17265
      first = false;
17266
      sb.append(")");
17267
      return sb.toString();
17268
    }
17269
 
17270
    public void validate() throws org.apache.thrift.TException {
17271
      // check for required fields
17272
    }
17273
 
17274
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17275
      try {
17276
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17277
      } catch (org.apache.thrift.TException te) {
17278
        throw new java.io.IOException(te);
17279
      }
17280
    }
17281
 
17282
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
17283
      try {
17284
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
17285
      } catch (org.apache.thrift.TException te) {
17286
        throw new java.io.IOException(te);
17287
      }
17288
    }
17289
 
17290
  }
17291
 
4494 varun.gupt 17292
  public static class getDiscountsForEntity_args implements org.apache.thrift.TBase<getDiscountsForEntity_args, getDiscountsForEntity_args._Fields>, java.io.Serializable, Cloneable   {
17293
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_args");
17294
 
17295
    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);
17296
 
17297
    private long entityId; // required
17298
 
17299
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
17300
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
17301
      ENTITY_ID((short)1, "entityId");
17302
 
17303
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
17304
 
17305
      static {
17306
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
17307
          byName.put(field.getFieldName(), field);
17308
        }
17309
      }
17310
 
17311
      /**
17312
       * Find the _Fields constant that matches fieldId, or null if its not found.
17313
       */
17314
      public static _Fields findByThriftId(int fieldId) {
17315
        switch(fieldId) {
17316
          case 1: // ENTITY_ID
17317
            return ENTITY_ID;
17318
          default:
17319
            return null;
17320
        }
17321
      }
17322
 
17323
      /**
17324
       * Find the _Fields constant that matches fieldId, throwing an exception
17325
       * if it is not found.
17326
       */
17327
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17328
        _Fields fields = findByThriftId(fieldId);
17329
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17330
        return fields;
17331
      }
17332
 
17333
      /**
17334
       * Find the _Fields constant that matches name, or null if its not found.
17335
       */
17336
      public static _Fields findByName(String name) {
17337
        return byName.get(name);
17338
      }
17339
 
17340
      private final short _thriftId;
17341
      private final String _fieldName;
17342
 
17343
      _Fields(short thriftId, String fieldName) {
17344
        _thriftId = thriftId;
17345
        _fieldName = fieldName;
17346
      }
17347
 
17348
      public short getThriftFieldId() {
17349
        return _thriftId;
17350
      }
17351
 
17352
      public String getFieldName() {
17353
        return _fieldName;
17354
      }
17355
    }
17356
 
17357
    // isset id assignments
17358
    private static final int __ENTITYID_ISSET_ID = 0;
17359
    private BitSet __isset_bit_vector = new BitSet(1);
17360
 
17361
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
17362
    static {
17363
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
17364
      tmpMap.put(_Fields.ENTITY_ID, new org.apache.thrift.meta_data.FieldMetaData("entityId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17365
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
17366
      metaDataMap = Collections.unmodifiableMap(tmpMap);
17367
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_args.class, metaDataMap);
17368
    }
17369
 
17370
    public getDiscountsForEntity_args() {
17371
    }
17372
 
17373
    public getDiscountsForEntity_args(
17374
      long entityId)
17375
    {
17376
      this();
17377
      this.entityId = entityId;
17378
      setEntityIdIsSet(true);
17379
    }
17380
 
17381
    /**
17382
     * Performs a deep copy on <i>other</i>.
17383
     */
17384
    public getDiscountsForEntity_args(getDiscountsForEntity_args other) {
17385
      __isset_bit_vector.clear();
17386
      __isset_bit_vector.or(other.__isset_bit_vector);
17387
      this.entityId = other.entityId;
17388
    }
17389
 
17390
    public getDiscountsForEntity_args deepCopy() {
17391
      return new getDiscountsForEntity_args(this);
17392
    }
17393
 
17394
    @Override
17395
    public void clear() {
17396
      setEntityIdIsSet(false);
17397
      this.entityId = 0;
17398
    }
17399
 
17400
    public long getEntityId() {
17401
      return this.entityId;
17402
    }
17403
 
17404
    public void setEntityId(long entityId) {
17405
      this.entityId = entityId;
17406
      setEntityIdIsSet(true);
17407
    }
17408
 
17409
    public void unsetEntityId() {
17410
      __isset_bit_vector.clear(__ENTITYID_ISSET_ID);
17411
    }
17412
 
17413
    /** Returns true if field entityId is set (has been assigned a value) and false otherwise */
17414
    public boolean isSetEntityId() {
17415
      return __isset_bit_vector.get(__ENTITYID_ISSET_ID);
17416
    }
17417
 
17418
    public void setEntityIdIsSet(boolean value) {
17419
      __isset_bit_vector.set(__ENTITYID_ISSET_ID, value);
17420
    }
17421
 
17422
    public void setFieldValue(_Fields field, Object value) {
17423
      switch (field) {
17424
      case ENTITY_ID:
17425
        if (value == null) {
17426
          unsetEntityId();
17427
        } else {
17428
          setEntityId((Long)value);
17429
        }
17430
        break;
17431
 
17432
      }
17433
    }
17434
 
17435
    public Object getFieldValue(_Fields field) {
17436
      switch (field) {
17437
      case ENTITY_ID:
17438
        return Long.valueOf(getEntityId());
17439
 
17440
      }
17441
      throw new IllegalStateException();
17442
    }
17443
 
17444
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
17445
    public boolean isSet(_Fields field) {
17446
      if (field == null) {
17447
        throw new IllegalArgumentException();
17448
      }
17449
 
17450
      switch (field) {
17451
      case ENTITY_ID:
17452
        return isSetEntityId();
17453
      }
17454
      throw new IllegalStateException();
17455
    }
17456
 
17457
    @Override
17458
    public boolean equals(Object that) {
17459
      if (that == null)
17460
        return false;
17461
      if (that instanceof getDiscountsForEntity_args)
17462
        return this.equals((getDiscountsForEntity_args)that);
17463
      return false;
17464
    }
17465
 
17466
    public boolean equals(getDiscountsForEntity_args that) {
17467
      if (that == null)
17468
        return false;
17469
 
17470
      boolean this_present_entityId = true;
17471
      boolean that_present_entityId = true;
17472
      if (this_present_entityId || that_present_entityId) {
17473
        if (!(this_present_entityId && that_present_entityId))
17474
          return false;
17475
        if (this.entityId != that.entityId)
17476
          return false;
17477
      }
17478
 
17479
      return true;
17480
    }
17481
 
17482
    @Override
17483
    public int hashCode() {
17484
      return 0;
17485
    }
17486
 
17487
    public int compareTo(getDiscountsForEntity_args other) {
17488
      if (!getClass().equals(other.getClass())) {
17489
        return getClass().getName().compareTo(other.getClass().getName());
17490
      }
17491
 
17492
      int lastComparison = 0;
17493
      getDiscountsForEntity_args typedOther = (getDiscountsForEntity_args)other;
17494
 
17495
      lastComparison = Boolean.valueOf(isSetEntityId()).compareTo(typedOther.isSetEntityId());
17496
      if (lastComparison != 0) {
17497
        return lastComparison;
17498
      }
17499
      if (isSetEntityId()) {
17500
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityId, typedOther.entityId);
17501
        if (lastComparison != 0) {
17502
          return lastComparison;
17503
        }
17504
      }
17505
      return 0;
17506
    }
17507
 
17508
    public _Fields fieldForId(int fieldId) {
17509
      return _Fields.findByThriftId(fieldId);
17510
    }
17511
 
17512
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17513
      org.apache.thrift.protocol.TField field;
17514
      iprot.readStructBegin();
17515
      while (true)
17516
      {
17517
        field = iprot.readFieldBegin();
17518
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17519
          break;
17520
        }
17521
        switch (field.id) {
17522
          case 1: // ENTITY_ID
17523
            if (field.type == org.apache.thrift.protocol.TType.I64) {
17524
              this.entityId = iprot.readI64();
17525
              setEntityIdIsSet(true);
17526
            } else { 
17527
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17528
            }
17529
            break;
17530
          default:
17531
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17532
        }
17533
        iprot.readFieldEnd();
17534
      }
17535
      iprot.readStructEnd();
17536
      validate();
17537
    }
17538
 
17539
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17540
      validate();
17541
 
17542
      oprot.writeStructBegin(STRUCT_DESC);
17543
      oprot.writeFieldBegin(ENTITY_ID_FIELD_DESC);
17544
      oprot.writeI64(this.entityId);
17545
      oprot.writeFieldEnd();
17546
      oprot.writeFieldStop();
17547
      oprot.writeStructEnd();
17548
    }
17549
 
17550
    @Override
17551
    public String toString() {
17552
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_args(");
17553
      boolean first = true;
17554
 
17555
      sb.append("entityId:");
17556
      sb.append(this.entityId);
17557
      first = false;
17558
      sb.append(")");
17559
      return sb.toString();
17560
    }
17561
 
17562
    public void validate() throws org.apache.thrift.TException {
17563
      // check for required fields
17564
    }
17565
 
17566
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17567
      try {
17568
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17569
      } catch (org.apache.thrift.TException te) {
17570
        throw new java.io.IOException(te);
17571
      }
17572
    }
17573
 
17574
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
17575
      try {
17576
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
17577
        __isset_bit_vector = new BitSet(1);
17578
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
17579
      } catch (org.apache.thrift.TException te) {
17580
        throw new java.io.IOException(te);
17581
      }
17582
    }
17583
 
17584
  }
17585
 
17586
  public static class getDiscountsForEntity_result implements org.apache.thrift.TBase<getDiscountsForEntity_result, getDiscountsForEntity_result._Fields>, java.io.Serializable, Cloneable   {
17587
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_result");
17588
 
17589
    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);
17590
 
17591
    private Map<String,Double> success; // required
17592
 
17593
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
17594
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
17595
      SUCCESS((short)0, "success");
17596
 
17597
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
17598
 
17599
      static {
17600
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
17601
          byName.put(field.getFieldName(), field);
17602
        }
17603
      }
17604
 
17605
      /**
17606
       * Find the _Fields constant that matches fieldId, or null if its not found.
17607
       */
17608
      public static _Fields findByThriftId(int fieldId) {
17609
        switch(fieldId) {
17610
          case 0: // SUCCESS
17611
            return SUCCESS;
17612
          default:
17613
            return null;
17614
        }
17615
      }
17616
 
17617
      /**
17618
       * Find the _Fields constant that matches fieldId, throwing an exception
17619
       * if it is not found.
17620
       */
17621
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17622
        _Fields fields = findByThriftId(fieldId);
17623
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17624
        return fields;
17625
      }
17626
 
17627
      /**
17628
       * Find the _Fields constant that matches name, or null if its not found.
17629
       */
17630
      public static _Fields findByName(String name) {
17631
        return byName.get(name);
17632
      }
17633
 
17634
      private final short _thriftId;
17635
      private final String _fieldName;
17636
 
17637
      _Fields(short thriftId, String fieldName) {
17638
        _thriftId = thriftId;
17639
        _fieldName = fieldName;
17640
      }
17641
 
17642
      public short getThriftFieldId() {
17643
        return _thriftId;
17644
      }
17645
 
17646
      public String getFieldName() {
17647
        return _fieldName;
17648
      }
17649
    }
17650
 
17651
    // isset id assignments
17652
 
17653
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
17654
    static {
17655
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
17656
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17657
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
17658
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
17659
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
17660
      metaDataMap = Collections.unmodifiableMap(tmpMap);
17661
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_result.class, metaDataMap);
17662
    }
17663
 
17664
    public getDiscountsForEntity_result() {
17665
    }
17666
 
17667
    public getDiscountsForEntity_result(
17668
      Map<String,Double> success)
17669
    {
17670
      this();
17671
      this.success = success;
17672
    }
17673
 
17674
    /**
17675
     * Performs a deep copy on <i>other</i>.
17676
     */
17677
    public getDiscountsForEntity_result(getDiscountsForEntity_result other) {
17678
      if (other.isSetSuccess()) {
17679
        Map<String,Double> __this__success = new HashMap<String,Double>();
17680
        for (Map.Entry<String, Double> other_element : other.success.entrySet()) {
17681
 
17682
          String other_element_key = other_element.getKey();
17683
          Double other_element_value = other_element.getValue();
17684
 
17685
          String __this__success_copy_key = other_element_key;
17686
 
17687
          Double __this__success_copy_value = other_element_value;
17688
 
17689
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
17690
        }
17691
        this.success = __this__success;
17692
      }
17693
    }
17694
 
17695
    public getDiscountsForEntity_result deepCopy() {
17696
      return new getDiscountsForEntity_result(this);
17697
    }
17698
 
17699
    @Override
17700
    public void clear() {
17701
      this.success = null;
17702
    }
17703
 
17704
    public int getSuccessSize() {
17705
      return (this.success == null) ? 0 : this.success.size();
17706
    }
17707
 
17708
    public void putToSuccess(String key, double val) {
17709
      if (this.success == null) {
17710
        this.success = new HashMap<String,Double>();
17711
      }
17712
      this.success.put(key, val);
17713
    }
17714
 
17715
    public Map<String,Double> getSuccess() {
17716
      return this.success;
17717
    }
17718
 
17719
    public void setSuccess(Map<String,Double> success) {
17720
      this.success = success;
17721
    }
17722
 
17723
    public void unsetSuccess() {
17724
      this.success = null;
17725
    }
17726
 
17727
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
17728
    public boolean isSetSuccess() {
17729
      return this.success != null;
17730
    }
17731
 
17732
    public void setSuccessIsSet(boolean value) {
17733
      if (!value) {
17734
        this.success = null;
17735
      }
17736
    }
17737
 
17738
    public void setFieldValue(_Fields field, Object value) {
17739
      switch (field) {
17740
      case SUCCESS:
17741
        if (value == null) {
17742
          unsetSuccess();
17743
        } else {
17744
          setSuccess((Map<String,Double>)value);
17745
        }
17746
        break;
17747
 
17748
      }
17749
    }
17750
 
17751
    public Object getFieldValue(_Fields field) {
17752
      switch (field) {
17753
      case SUCCESS:
17754
        return getSuccess();
17755
 
17756
      }
17757
      throw new IllegalStateException();
17758
    }
17759
 
17760
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
17761
    public boolean isSet(_Fields field) {
17762
      if (field == null) {
17763
        throw new IllegalArgumentException();
17764
      }
17765
 
17766
      switch (field) {
17767
      case SUCCESS:
17768
        return isSetSuccess();
17769
      }
17770
      throw new IllegalStateException();
17771
    }
17772
 
17773
    @Override
17774
    public boolean equals(Object that) {
17775
      if (that == null)
17776
        return false;
17777
      if (that instanceof getDiscountsForEntity_result)
17778
        return this.equals((getDiscountsForEntity_result)that);
17779
      return false;
17780
    }
17781
 
17782
    public boolean equals(getDiscountsForEntity_result that) {
17783
      if (that == null)
17784
        return false;
17785
 
17786
      boolean this_present_success = true && this.isSetSuccess();
17787
      boolean that_present_success = true && that.isSetSuccess();
17788
      if (this_present_success || that_present_success) {
17789
        if (!(this_present_success && that_present_success))
17790
          return false;
17791
        if (!this.success.equals(that.success))
17792
          return false;
17793
      }
17794
 
17795
      return true;
17796
    }
17797
 
17798
    @Override
17799
    public int hashCode() {
17800
      return 0;
17801
    }
17802
 
17803
    public int compareTo(getDiscountsForEntity_result other) {
17804
      if (!getClass().equals(other.getClass())) {
17805
        return getClass().getName().compareTo(other.getClass().getName());
17806
      }
17807
 
17808
      int lastComparison = 0;
17809
      getDiscountsForEntity_result typedOther = (getDiscountsForEntity_result)other;
17810
 
17811
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
17812
      if (lastComparison != 0) {
17813
        return lastComparison;
17814
      }
17815
      if (isSetSuccess()) {
17816
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
17817
        if (lastComparison != 0) {
17818
          return lastComparison;
17819
        }
17820
      }
17821
      return 0;
17822
    }
17823
 
17824
    public _Fields fieldForId(int fieldId) {
17825
      return _Fields.findByThriftId(fieldId);
17826
    }
17827
 
17828
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17829
      org.apache.thrift.protocol.TField field;
17830
      iprot.readStructBegin();
17831
      while (true)
17832
      {
17833
        field = iprot.readFieldBegin();
17834
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17835
          break;
17836
        }
17837
        switch (field.id) {
17838
          case 0: // SUCCESS
17839
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
17840
              {
7092 amit.gupta 17841
                org.apache.thrift.protocol.TMap _map46 = iprot.readMapBegin();
17842
                this.success = new HashMap<String,Double>(2*_map46.size);
17843
                for (int _i47 = 0; _i47 < _map46.size; ++_i47)
4494 varun.gupt 17844
                {
7092 amit.gupta 17845
                  String _key48; // required
17846
                  double _val49; // required
17847
                  _key48 = iprot.readString();
17848
                  _val49 = iprot.readDouble();
17849
                  this.success.put(_key48, _val49);
4494 varun.gupt 17850
                }
17851
                iprot.readMapEnd();
17852
              }
17853
            } else { 
17854
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17855
            }
17856
            break;
17857
          default:
17858
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17859
        }
17860
        iprot.readFieldEnd();
17861
      }
17862
      iprot.readStructEnd();
17863
      validate();
17864
    }
17865
 
17866
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17867
      oprot.writeStructBegin(STRUCT_DESC);
17868
 
17869
      if (this.isSetSuccess()) {
17870
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
17871
        {
17872
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, this.success.size()));
7092 amit.gupta 17873
          for (Map.Entry<String, Double> _iter50 : this.success.entrySet())
4494 varun.gupt 17874
          {
7092 amit.gupta 17875
            oprot.writeString(_iter50.getKey());
17876
            oprot.writeDouble(_iter50.getValue());
4494 varun.gupt 17877
          }
17878
          oprot.writeMapEnd();
17879
        }
17880
        oprot.writeFieldEnd();
17881
      }
17882
      oprot.writeFieldStop();
17883
      oprot.writeStructEnd();
17884
    }
17885
 
17886
    @Override
17887
    public String toString() {
17888
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_result(");
17889
      boolean first = true;
17890
 
17891
      sb.append("success:");
17892
      if (this.success == null) {
17893
        sb.append("null");
17894
      } else {
17895
        sb.append(this.success);
17896
      }
17897
      first = false;
17898
      sb.append(")");
17899
      return sb.toString();
17900
    }
17901
 
17902
    public void validate() throws org.apache.thrift.TException {
17903
      // check for required fields
17904
    }
17905
 
17906
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17907
      try {
17908
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17909
      } catch (org.apache.thrift.TException te) {
17910
        throw new java.io.IOException(te);
17911
      }
17912
    }
17913
 
17914
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
17915
      try {
17916
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
17917
      } catch (org.apache.thrift.TException te) {
17918
        throw new java.io.IOException(te);
17919
      }
17920
    }
17921
 
17922
  }
17923
 
5469 rajveer 17924
  public static class addVoucher_args implements org.apache.thrift.TBase<addVoucher_args, addVoucher_args._Fields>, java.io.Serializable, Cloneable   {
17925
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_args");
17926
 
17927
    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);
17928
 
17929
    private Voucher voucher; // required
17930
 
17931
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
17932
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
17933
      VOUCHER((short)1, "voucher");
17934
 
17935
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
17936
 
17937
      static {
17938
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
17939
          byName.put(field.getFieldName(), field);
17940
        }
17941
      }
17942
 
17943
      /**
17944
       * Find the _Fields constant that matches fieldId, or null if its not found.
17945
       */
17946
      public static _Fields findByThriftId(int fieldId) {
17947
        switch(fieldId) {
17948
          case 1: // VOUCHER
17949
            return VOUCHER;
17950
          default:
17951
            return null;
17952
        }
17953
      }
17954
 
17955
      /**
17956
       * Find the _Fields constant that matches fieldId, throwing an exception
17957
       * if it is not found.
17958
       */
17959
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17960
        _Fields fields = findByThriftId(fieldId);
17961
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17962
        return fields;
17963
      }
17964
 
17965
      /**
17966
       * Find the _Fields constant that matches name, or null if its not found.
17967
       */
17968
      public static _Fields findByName(String name) {
17969
        return byName.get(name);
17970
      }
17971
 
17972
      private final short _thriftId;
17973
      private final String _fieldName;
17974
 
17975
      _Fields(short thriftId, String fieldName) {
17976
        _thriftId = thriftId;
17977
        _fieldName = fieldName;
17978
      }
17979
 
17980
      public short getThriftFieldId() {
17981
        return _thriftId;
17982
      }
17983
 
17984
      public String getFieldName() {
17985
        return _fieldName;
17986
      }
17987
    }
17988
 
17989
    // isset id assignments
17990
 
17991
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
17992
    static {
17993
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
17994
      tmpMap.put(_Fields.VOUCHER, new org.apache.thrift.meta_data.FieldMetaData("voucher", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17995
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
17996
      metaDataMap = Collections.unmodifiableMap(tmpMap);
17997
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_args.class, metaDataMap);
17998
    }
17999
 
18000
    public addVoucher_args() {
18001
    }
18002
 
18003
    public addVoucher_args(
18004
      Voucher voucher)
18005
    {
18006
      this();
18007
      this.voucher = voucher;
18008
    }
18009
 
18010
    /**
18011
     * Performs a deep copy on <i>other</i>.
18012
     */
18013
    public addVoucher_args(addVoucher_args other) {
18014
      if (other.isSetVoucher()) {
18015
        this.voucher = new Voucher(other.voucher);
18016
      }
18017
    }
18018
 
18019
    public addVoucher_args deepCopy() {
18020
      return new addVoucher_args(this);
18021
    }
18022
 
18023
    @Override
18024
    public void clear() {
18025
      this.voucher = null;
18026
    }
18027
 
18028
    public Voucher getVoucher() {
18029
      return this.voucher;
18030
    }
18031
 
18032
    public void setVoucher(Voucher voucher) {
18033
      this.voucher = voucher;
18034
    }
18035
 
18036
    public void unsetVoucher() {
18037
      this.voucher = null;
18038
    }
18039
 
18040
    /** Returns true if field voucher is set (has been assigned a value) and false otherwise */
18041
    public boolean isSetVoucher() {
18042
      return this.voucher != null;
18043
    }
18044
 
18045
    public void setVoucherIsSet(boolean value) {
18046
      if (!value) {
18047
        this.voucher = null;
18048
      }
18049
    }
18050
 
18051
    public void setFieldValue(_Fields field, Object value) {
18052
      switch (field) {
18053
      case VOUCHER:
18054
        if (value == null) {
18055
          unsetVoucher();
18056
        } else {
18057
          setVoucher((Voucher)value);
18058
        }
18059
        break;
18060
 
18061
      }
18062
    }
18063
 
18064
    public Object getFieldValue(_Fields field) {
18065
      switch (field) {
18066
      case VOUCHER:
18067
        return getVoucher();
18068
 
18069
      }
18070
      throw new IllegalStateException();
18071
    }
18072
 
18073
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
18074
    public boolean isSet(_Fields field) {
18075
      if (field == null) {
18076
        throw new IllegalArgumentException();
18077
      }
18078
 
18079
      switch (field) {
18080
      case VOUCHER:
18081
        return isSetVoucher();
18082
      }
18083
      throw new IllegalStateException();
18084
    }
18085
 
18086
    @Override
18087
    public boolean equals(Object that) {
18088
      if (that == null)
18089
        return false;
18090
      if (that instanceof addVoucher_args)
18091
        return this.equals((addVoucher_args)that);
18092
      return false;
18093
    }
18094
 
18095
    public boolean equals(addVoucher_args that) {
18096
      if (that == null)
18097
        return false;
18098
 
18099
      boolean this_present_voucher = true && this.isSetVoucher();
18100
      boolean that_present_voucher = true && that.isSetVoucher();
18101
      if (this_present_voucher || that_present_voucher) {
18102
        if (!(this_present_voucher && that_present_voucher))
18103
          return false;
18104
        if (!this.voucher.equals(that.voucher))
18105
          return false;
18106
      }
18107
 
18108
      return true;
18109
    }
18110
 
18111
    @Override
18112
    public int hashCode() {
18113
      return 0;
18114
    }
18115
 
18116
    public int compareTo(addVoucher_args other) {
18117
      if (!getClass().equals(other.getClass())) {
18118
        return getClass().getName().compareTo(other.getClass().getName());
18119
      }
18120
 
18121
      int lastComparison = 0;
18122
      addVoucher_args typedOther = (addVoucher_args)other;
18123
 
18124
      lastComparison = Boolean.valueOf(isSetVoucher()).compareTo(typedOther.isSetVoucher());
18125
      if (lastComparison != 0) {
18126
        return lastComparison;
18127
      }
18128
      if (isSetVoucher()) {
18129
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucher, typedOther.voucher);
18130
        if (lastComparison != 0) {
18131
          return lastComparison;
18132
        }
18133
      }
18134
      return 0;
18135
    }
18136
 
18137
    public _Fields fieldForId(int fieldId) {
18138
      return _Fields.findByThriftId(fieldId);
18139
    }
18140
 
18141
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
18142
      org.apache.thrift.protocol.TField field;
18143
      iprot.readStructBegin();
18144
      while (true)
18145
      {
18146
        field = iprot.readFieldBegin();
18147
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
18148
          break;
18149
        }
18150
        switch (field.id) {
18151
          case 1: // VOUCHER
18152
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
18153
              this.voucher = new Voucher();
18154
              this.voucher.read(iprot);
18155
            } else { 
18156
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18157
            }
18158
            break;
18159
          default:
18160
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18161
        }
18162
        iprot.readFieldEnd();
18163
      }
18164
      iprot.readStructEnd();
18165
      validate();
18166
    }
18167
 
18168
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
18169
      validate();
18170
 
18171
      oprot.writeStructBegin(STRUCT_DESC);
18172
      if (this.voucher != null) {
18173
        oprot.writeFieldBegin(VOUCHER_FIELD_DESC);
18174
        this.voucher.write(oprot);
18175
        oprot.writeFieldEnd();
18176
      }
18177
      oprot.writeFieldStop();
18178
      oprot.writeStructEnd();
18179
    }
18180
 
18181
    @Override
18182
    public String toString() {
18183
      StringBuilder sb = new StringBuilder("addVoucher_args(");
18184
      boolean first = true;
18185
 
18186
      sb.append("voucher:");
18187
      if (this.voucher == null) {
18188
        sb.append("null");
18189
      } else {
18190
        sb.append(this.voucher);
18191
      }
18192
      first = false;
18193
      sb.append(")");
18194
      return sb.toString();
18195
    }
18196
 
18197
    public void validate() throws org.apache.thrift.TException {
18198
      // check for required fields
18199
    }
18200
 
18201
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
18202
      try {
18203
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
18204
      } catch (org.apache.thrift.TException te) {
18205
        throw new java.io.IOException(te);
18206
      }
18207
    }
18208
 
18209
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
18210
      try {
18211
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
18212
      } catch (org.apache.thrift.TException te) {
18213
        throw new java.io.IOException(te);
18214
      }
18215
    }
18216
 
18217
  }
18218
 
18219
  public static class addVoucher_result implements org.apache.thrift.TBase<addVoucher_result, addVoucher_result._Fields>, java.io.Serializable, Cloneable   {
18220
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_result");
18221
 
18222
 
18223
 
18224
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
18225
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
18226
;
18227
 
18228
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
18229
 
18230
      static {
18231
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
18232
          byName.put(field.getFieldName(), field);
18233
        }
18234
      }
18235
 
18236
      /**
18237
       * Find the _Fields constant that matches fieldId, or null if its not found.
18238
       */
18239
      public static _Fields findByThriftId(int fieldId) {
18240
        switch(fieldId) {
18241
          default:
18242
            return null;
18243
        }
18244
      }
18245
 
18246
      /**
18247
       * Find the _Fields constant that matches fieldId, throwing an exception
18248
       * if it is not found.
18249
       */
18250
      public static _Fields findByThriftIdOrThrow(int fieldId) {
18251
        _Fields fields = findByThriftId(fieldId);
18252
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
18253
        return fields;
18254
      }
18255
 
18256
      /**
18257
       * Find the _Fields constant that matches name, or null if its not found.
18258
       */
18259
      public static _Fields findByName(String name) {
18260
        return byName.get(name);
18261
      }
18262
 
18263
      private final short _thriftId;
18264
      private final String _fieldName;
18265
 
18266
      _Fields(short thriftId, String fieldName) {
18267
        _thriftId = thriftId;
18268
        _fieldName = fieldName;
18269
      }
18270
 
18271
      public short getThriftFieldId() {
18272
        return _thriftId;
18273
      }
18274
 
18275
      public String getFieldName() {
18276
        return _fieldName;
18277
      }
18278
    }
18279
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
18280
    static {
18281
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
18282
      metaDataMap = Collections.unmodifiableMap(tmpMap);
18283
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_result.class, metaDataMap);
18284
    }
18285
 
18286
    public addVoucher_result() {
18287
    }
18288
 
18289
    /**
18290
     * Performs a deep copy on <i>other</i>.
18291
     */
18292
    public addVoucher_result(addVoucher_result other) {
18293
    }
18294
 
18295
    public addVoucher_result deepCopy() {
18296
      return new addVoucher_result(this);
18297
    }
18298
 
18299
    @Override
18300
    public void clear() {
18301
    }
18302
 
18303
    public void setFieldValue(_Fields field, Object value) {
18304
      switch (field) {
18305
      }
18306
    }
18307
 
18308
    public Object getFieldValue(_Fields field) {
18309
      switch (field) {
18310
      }
18311
      throw new IllegalStateException();
18312
    }
18313
 
18314
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
18315
    public boolean isSet(_Fields field) {
18316
      if (field == null) {
18317
        throw new IllegalArgumentException();
18318
      }
18319
 
18320
      switch (field) {
18321
      }
18322
      throw new IllegalStateException();
18323
    }
18324
 
18325
    @Override
18326
    public boolean equals(Object that) {
18327
      if (that == null)
18328
        return false;
18329
      if (that instanceof addVoucher_result)
18330
        return this.equals((addVoucher_result)that);
18331
      return false;
18332
    }
18333
 
18334
    public boolean equals(addVoucher_result that) {
18335
      if (that == null)
18336
        return false;
18337
 
18338
      return true;
18339
    }
18340
 
18341
    @Override
18342
    public int hashCode() {
18343
      return 0;
18344
    }
18345
 
18346
    public int compareTo(addVoucher_result other) {
18347
      if (!getClass().equals(other.getClass())) {
18348
        return getClass().getName().compareTo(other.getClass().getName());
18349
      }
18350
 
18351
      int lastComparison = 0;
18352
      addVoucher_result typedOther = (addVoucher_result)other;
18353
 
18354
      return 0;
18355
    }
18356
 
18357
    public _Fields fieldForId(int fieldId) {
18358
      return _Fields.findByThriftId(fieldId);
18359
    }
18360
 
18361
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
18362
      org.apache.thrift.protocol.TField field;
18363
      iprot.readStructBegin();
18364
      while (true)
18365
      {
18366
        field = iprot.readFieldBegin();
18367
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
18368
          break;
18369
        }
18370
        switch (field.id) {
18371
          default:
18372
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18373
        }
18374
        iprot.readFieldEnd();
18375
      }
18376
      iprot.readStructEnd();
18377
      validate();
18378
    }
18379
 
18380
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
18381
      oprot.writeStructBegin(STRUCT_DESC);
18382
 
18383
      oprot.writeFieldStop();
18384
      oprot.writeStructEnd();
18385
    }
18386
 
18387
    @Override
18388
    public String toString() {
18389
      StringBuilder sb = new StringBuilder("addVoucher_result(");
18390
      boolean first = true;
18391
 
18392
      sb.append(")");
18393
      return sb.toString();
18394
    }
18395
 
18396
    public void validate() throws org.apache.thrift.TException {
18397
      // check for required fields
18398
    }
18399
 
18400
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
18401
      try {
18402
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
18403
      } catch (org.apache.thrift.TException te) {
18404
        throw new java.io.IOException(te);
18405
      }
18406
    }
18407
 
18408
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
18409
      try {
18410
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
18411
      } catch (org.apache.thrift.TException te) {
18412
        throw new java.io.IOException(te);
18413
      }
18414
    }
18415
 
18416
  }
18417
 
18418
  public static class assignVoucher_args implements org.apache.thrift.TBase<assignVoucher_args, assignVoucher_args._Fields>, java.io.Serializable, Cloneable   {
18419
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_args");
18420
 
18421
    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);
18422
    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);
18423
    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);
18424
    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);
18425
 
18426
    private long userId; // required
18427
    private String userEmail; // required
18428
    private VoucherType voucherType; // required
18429
    private long amount; // required
18430
 
18431
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
18432
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
18433
      USER_ID((short)1, "userId"),
18434
      USER_EMAIL((short)2, "userEmail"),
18435
      /**
18436
       * 
18437
       * @see VoucherType
18438
       */
18439
      VOUCHER_TYPE((short)3, "voucherType"),
18440
      AMOUNT((short)4, "amount");
18441
 
18442
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
18443
 
18444
      static {
18445
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
18446
          byName.put(field.getFieldName(), field);
18447
        }
18448
      }
18449
 
18450
      /**
18451
       * Find the _Fields constant that matches fieldId, or null if its not found.
18452
       */
18453
      public static _Fields findByThriftId(int fieldId) {
18454
        switch(fieldId) {
18455
          case 1: // USER_ID
18456
            return USER_ID;
18457
          case 2: // USER_EMAIL
18458
            return USER_EMAIL;
18459
          case 3: // VOUCHER_TYPE
18460
            return VOUCHER_TYPE;
18461
          case 4: // AMOUNT
18462
            return AMOUNT;
18463
          default:
18464
            return null;
18465
        }
18466
      }
18467
 
18468
      /**
18469
       * Find the _Fields constant that matches fieldId, throwing an exception
18470
       * if it is not found.
18471
       */
18472
      public static _Fields findByThriftIdOrThrow(int fieldId) {
18473
        _Fields fields = findByThriftId(fieldId);
18474
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
18475
        return fields;
18476
      }
18477
 
18478
      /**
18479
       * Find the _Fields constant that matches name, or null if its not found.
18480
       */
18481
      public static _Fields findByName(String name) {
18482
        return byName.get(name);
18483
      }
18484
 
18485
      private final short _thriftId;
18486
      private final String _fieldName;
18487
 
18488
      _Fields(short thriftId, String fieldName) {
18489
        _thriftId = thriftId;
18490
        _fieldName = fieldName;
18491
      }
18492
 
18493
      public short getThriftFieldId() {
18494
        return _thriftId;
18495
      }
18496
 
18497
      public String getFieldName() {
18498
        return _fieldName;
18499
      }
18500
    }
18501
 
18502
    // isset id assignments
18503
    private static final int __USERID_ISSET_ID = 0;
18504
    private static final int __AMOUNT_ISSET_ID = 1;
18505
    private BitSet __isset_bit_vector = new BitSet(2);
18506
 
18507
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
18508
    static {
18509
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
18510
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18511
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
18512
      tmpMap.put(_Fields.USER_EMAIL, new org.apache.thrift.meta_data.FieldMetaData("userEmail", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18513
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
18514
      tmpMap.put(_Fields.VOUCHER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("voucherType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18515
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, VoucherType.class)));
18516
      tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18517
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
18518
      metaDataMap = Collections.unmodifiableMap(tmpMap);
18519
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_args.class, metaDataMap);
18520
    }
18521
 
18522
    public assignVoucher_args() {
18523
    }
18524
 
18525
    public assignVoucher_args(
18526
      long userId,
18527
      String userEmail,
18528
      VoucherType voucherType,
18529
      long amount)
18530
    {
18531
      this();
18532
      this.userId = userId;
18533
      setUserIdIsSet(true);
18534
      this.userEmail = userEmail;
18535
      this.voucherType = voucherType;
18536
      this.amount = amount;
18537
      setAmountIsSet(true);
18538
    }
18539
 
18540
    /**
18541
     * Performs a deep copy on <i>other</i>.
18542
     */
18543
    public assignVoucher_args(assignVoucher_args other) {
18544
      __isset_bit_vector.clear();
18545
      __isset_bit_vector.or(other.__isset_bit_vector);
18546
      this.userId = other.userId;
18547
      if (other.isSetUserEmail()) {
18548
        this.userEmail = other.userEmail;
18549
      }
18550
      if (other.isSetVoucherType()) {
18551
        this.voucherType = other.voucherType;
18552
      }
18553
      this.amount = other.amount;
18554
    }
18555
 
18556
    public assignVoucher_args deepCopy() {
18557
      return new assignVoucher_args(this);
18558
    }
18559
 
18560
    @Override
18561
    public void clear() {
18562
      setUserIdIsSet(false);
18563
      this.userId = 0;
18564
      this.userEmail = null;
18565
      this.voucherType = null;
18566
      setAmountIsSet(false);
18567
      this.amount = 0;
18568
    }
18569
 
18570
    public long getUserId() {
18571
      return this.userId;
18572
    }
18573
 
18574
    public void setUserId(long userId) {
18575
      this.userId = userId;
18576
      setUserIdIsSet(true);
18577
    }
18578
 
18579
    public void unsetUserId() {
18580
      __isset_bit_vector.clear(__USERID_ISSET_ID);
18581
    }
18582
 
18583
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
18584
    public boolean isSetUserId() {
18585
      return __isset_bit_vector.get(__USERID_ISSET_ID);
18586
    }
18587
 
18588
    public void setUserIdIsSet(boolean value) {
18589
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
18590
    }
18591
 
18592
    public String getUserEmail() {
18593
      return this.userEmail;
18594
    }
18595
 
18596
    public void setUserEmail(String userEmail) {
18597
      this.userEmail = userEmail;
18598
    }
18599
 
18600
    public void unsetUserEmail() {
18601
      this.userEmail = null;
18602
    }
18603
 
18604
    /** Returns true if field userEmail is set (has been assigned a value) and false otherwise */
18605
    public boolean isSetUserEmail() {
18606
      return this.userEmail != null;
18607
    }
18608
 
18609
    public void setUserEmailIsSet(boolean value) {
18610
      if (!value) {
18611
        this.userEmail = null;
18612
      }
18613
    }
18614
 
18615
    /**
18616
     * 
18617
     * @see VoucherType
18618
     */
18619
    public VoucherType getVoucherType() {
18620
      return this.voucherType;
18621
    }
18622
 
18623
    /**
18624
     * 
18625
     * @see VoucherType
18626
     */
18627
    public void setVoucherType(VoucherType voucherType) {
18628
      this.voucherType = voucherType;
18629
    }
18630
 
18631
    public void unsetVoucherType() {
18632
      this.voucherType = null;
18633
    }
18634
 
18635
    /** Returns true if field voucherType is set (has been assigned a value) and false otherwise */
18636
    public boolean isSetVoucherType() {
18637
      return this.voucherType != null;
18638
    }
18639
 
18640
    public void setVoucherTypeIsSet(boolean value) {
18641
      if (!value) {
18642
        this.voucherType = null;
18643
      }
18644
    }
18645
 
18646
    public long getAmount() {
18647
      return this.amount;
18648
    }
18649
 
18650
    public void setAmount(long amount) {
18651
      this.amount = amount;
18652
      setAmountIsSet(true);
18653
    }
18654
 
18655
    public void unsetAmount() {
18656
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
18657
    }
18658
 
18659
    /** Returns true if field amount is set (has been assigned a value) and false otherwise */
18660
    public boolean isSetAmount() {
18661
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
18662
    }
18663
 
18664
    public void setAmountIsSet(boolean value) {
18665
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
18666
    }
18667
 
18668
    public void setFieldValue(_Fields field, Object value) {
18669
      switch (field) {
18670
      case USER_ID:
18671
        if (value == null) {
18672
          unsetUserId();
18673
        } else {
18674
          setUserId((Long)value);
18675
        }
18676
        break;
18677
 
18678
      case USER_EMAIL:
18679
        if (value == null) {
18680
          unsetUserEmail();
18681
        } else {
18682
          setUserEmail((String)value);
18683
        }
18684
        break;
18685
 
18686
      case VOUCHER_TYPE:
18687
        if (value == null) {
18688
          unsetVoucherType();
18689
        } else {
18690
          setVoucherType((VoucherType)value);
18691
        }
18692
        break;
18693
 
18694
      case AMOUNT:
18695
        if (value == null) {
18696
          unsetAmount();
18697
        } else {
18698
          setAmount((Long)value);
18699
        }
18700
        break;
18701
 
18702
      }
18703
    }
18704
 
18705
    public Object getFieldValue(_Fields field) {
18706
      switch (field) {
18707
      case USER_ID:
18708
        return Long.valueOf(getUserId());
18709
 
18710
      case USER_EMAIL:
18711
        return getUserEmail();
18712
 
18713
      case VOUCHER_TYPE:
18714
        return getVoucherType();
18715
 
18716
      case AMOUNT:
18717
        return Long.valueOf(getAmount());
18718
 
18719
      }
18720
      throw new IllegalStateException();
18721
    }
18722
 
18723
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
18724
    public boolean isSet(_Fields field) {
18725
      if (field == null) {
18726
        throw new IllegalArgumentException();
18727
      }
18728
 
18729
      switch (field) {
18730
      case USER_ID:
18731
        return isSetUserId();
18732
      case USER_EMAIL:
18733
        return isSetUserEmail();
18734
      case VOUCHER_TYPE:
18735
        return isSetVoucherType();
18736
      case AMOUNT:
18737
        return isSetAmount();
18738
      }
18739
      throw new IllegalStateException();
18740
    }
18741
 
18742
    @Override
18743
    public boolean equals(Object that) {
18744
      if (that == null)
18745
        return false;
18746
      if (that instanceof assignVoucher_args)
18747
        return this.equals((assignVoucher_args)that);
18748
      return false;
18749
    }
18750
 
18751
    public boolean equals(assignVoucher_args that) {
18752
      if (that == null)
18753
        return false;
18754
 
18755
      boolean this_present_userId = true;
18756
      boolean that_present_userId = true;
18757
      if (this_present_userId || that_present_userId) {
18758
        if (!(this_present_userId && that_present_userId))
18759
          return false;
18760
        if (this.userId != that.userId)
18761
          return false;
18762
      }
18763
 
18764
      boolean this_present_userEmail = true && this.isSetUserEmail();
18765
      boolean that_present_userEmail = true && that.isSetUserEmail();
18766
      if (this_present_userEmail || that_present_userEmail) {
18767
        if (!(this_present_userEmail && that_present_userEmail))
18768
          return false;
18769
        if (!this.userEmail.equals(that.userEmail))
18770
          return false;
18771
      }
18772
 
18773
      boolean this_present_voucherType = true && this.isSetVoucherType();
18774
      boolean that_present_voucherType = true && that.isSetVoucherType();
18775
      if (this_present_voucherType || that_present_voucherType) {
18776
        if (!(this_present_voucherType && that_present_voucherType))
18777
          return false;
18778
        if (!this.voucherType.equals(that.voucherType))
18779
          return false;
18780
      }
18781
 
18782
      boolean this_present_amount = true;
18783
      boolean that_present_amount = true;
18784
      if (this_present_amount || that_present_amount) {
18785
        if (!(this_present_amount && that_present_amount))
18786
          return false;
18787
        if (this.amount != that.amount)
18788
          return false;
18789
      }
18790
 
18791
      return true;
18792
    }
18793
 
18794
    @Override
18795
    public int hashCode() {
18796
      return 0;
18797
    }
18798
 
18799
    public int compareTo(assignVoucher_args other) {
18800
      if (!getClass().equals(other.getClass())) {
18801
        return getClass().getName().compareTo(other.getClass().getName());
18802
      }
18803
 
18804
      int lastComparison = 0;
18805
      assignVoucher_args typedOther = (assignVoucher_args)other;
18806
 
18807
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
18808
      if (lastComparison != 0) {
18809
        return lastComparison;
18810
      }
18811
      if (isSetUserId()) {
18812
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
18813
        if (lastComparison != 0) {
18814
          return lastComparison;
18815
        }
18816
      }
18817
      lastComparison = Boolean.valueOf(isSetUserEmail()).compareTo(typedOther.isSetUserEmail());
18818
      if (lastComparison != 0) {
18819
        return lastComparison;
18820
      }
18821
      if (isSetUserEmail()) {
18822
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userEmail, typedOther.userEmail);
18823
        if (lastComparison != 0) {
18824
          return lastComparison;
18825
        }
18826
      }
18827
      lastComparison = Boolean.valueOf(isSetVoucherType()).compareTo(typedOther.isSetVoucherType());
18828
      if (lastComparison != 0) {
18829
        return lastComparison;
18830
      }
18831
      if (isSetVoucherType()) {
18832
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherType, typedOther.voucherType);
18833
        if (lastComparison != 0) {
18834
          return lastComparison;
18835
        }
18836
      }
18837
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
18838
      if (lastComparison != 0) {
18839
        return lastComparison;
18840
      }
18841
      if (isSetAmount()) {
18842
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
18843
        if (lastComparison != 0) {
18844
          return lastComparison;
18845
        }
18846
      }
18847
      return 0;
18848
    }
18849
 
18850
    public _Fields fieldForId(int fieldId) {
18851
      return _Fields.findByThriftId(fieldId);
18852
    }
18853
 
18854
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
18855
      org.apache.thrift.protocol.TField field;
18856
      iprot.readStructBegin();
18857
      while (true)
18858
      {
18859
        field = iprot.readFieldBegin();
18860
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
18861
          break;
18862
        }
18863
        switch (field.id) {
18864
          case 1: // USER_ID
18865
            if (field.type == org.apache.thrift.protocol.TType.I64) {
18866
              this.userId = iprot.readI64();
18867
              setUserIdIsSet(true);
18868
            } else { 
18869
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18870
            }
18871
            break;
18872
          case 2: // USER_EMAIL
18873
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
18874
              this.userEmail = iprot.readString();
18875
            } else { 
18876
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18877
            }
18878
            break;
18879
          case 3: // VOUCHER_TYPE
18880
            if (field.type == org.apache.thrift.protocol.TType.I32) {
18881
              this.voucherType = VoucherType.findByValue(iprot.readI32());
18882
            } else { 
18883
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18884
            }
18885
            break;
18886
          case 4: // AMOUNT
18887
            if (field.type == org.apache.thrift.protocol.TType.I64) {
18888
              this.amount = iprot.readI64();
18889
              setAmountIsSet(true);
18890
            } else { 
18891
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18892
            }
18893
            break;
18894
          default:
18895
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18896
        }
18897
        iprot.readFieldEnd();
18898
      }
18899
      iprot.readStructEnd();
18900
      validate();
18901
    }
18902
 
18903
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
18904
      validate();
18905
 
18906
      oprot.writeStructBegin(STRUCT_DESC);
18907
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
18908
      oprot.writeI64(this.userId);
18909
      oprot.writeFieldEnd();
18910
      if (this.userEmail != null) {
18911
        oprot.writeFieldBegin(USER_EMAIL_FIELD_DESC);
18912
        oprot.writeString(this.userEmail);
18913
        oprot.writeFieldEnd();
18914
      }
18915
      if (this.voucherType != null) {
18916
        oprot.writeFieldBegin(VOUCHER_TYPE_FIELD_DESC);
18917
        oprot.writeI32(this.voucherType.getValue());
18918
        oprot.writeFieldEnd();
18919
      }
18920
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
18921
      oprot.writeI64(this.amount);
18922
      oprot.writeFieldEnd();
18923
      oprot.writeFieldStop();
18924
      oprot.writeStructEnd();
18925
    }
18926
 
18927
    @Override
18928
    public String toString() {
18929
      StringBuilder sb = new StringBuilder("assignVoucher_args(");
18930
      boolean first = true;
18931
 
18932
      sb.append("userId:");
18933
      sb.append(this.userId);
18934
      first = false;
18935
      if (!first) sb.append(", ");
18936
      sb.append("userEmail:");
18937
      if (this.userEmail == null) {
18938
        sb.append("null");
18939
      } else {
18940
        sb.append(this.userEmail);
18941
      }
18942
      first = false;
18943
      if (!first) sb.append(", ");
18944
      sb.append("voucherType:");
18945
      if (this.voucherType == null) {
18946
        sb.append("null");
18947
      } else {
18948
        sb.append(this.voucherType);
18949
      }
18950
      first = false;
18951
      if (!first) sb.append(", ");
18952
      sb.append("amount:");
18953
      sb.append(this.amount);
18954
      first = false;
18955
      sb.append(")");
18956
      return sb.toString();
18957
    }
18958
 
18959
    public void validate() throws org.apache.thrift.TException {
18960
      // check for required fields
18961
    }
18962
 
18963
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
18964
      try {
18965
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
18966
      } catch (org.apache.thrift.TException te) {
18967
        throw new java.io.IOException(te);
18968
      }
18969
    }
18970
 
18971
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
18972
      try {
18973
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
18974
        __isset_bit_vector = new BitSet(1);
18975
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
18976
      } catch (org.apache.thrift.TException te) {
18977
        throw new java.io.IOException(te);
18978
      }
18979
    }
18980
 
18981
  }
18982
 
18983
  public static class assignVoucher_result implements org.apache.thrift.TBase<assignVoucher_result, assignVoucher_result._Fields>, java.io.Serializable, Cloneable   {
18984
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_result");
18985
 
18986
    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);
18987
 
18988
    private Voucher success; // required
18989
 
18990
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
18991
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
18992
      SUCCESS((short)0, "success");
18993
 
18994
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
18995
 
18996
      static {
18997
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
18998
          byName.put(field.getFieldName(), field);
18999
        }
19000
      }
19001
 
19002
      /**
19003
       * Find the _Fields constant that matches fieldId, or null if its not found.
19004
       */
19005
      public static _Fields findByThriftId(int fieldId) {
19006
        switch(fieldId) {
19007
          case 0: // SUCCESS
19008
            return SUCCESS;
19009
          default:
19010
            return null;
19011
        }
19012
      }
19013
 
19014
      /**
19015
       * Find the _Fields constant that matches fieldId, throwing an exception
19016
       * if it is not found.
19017
       */
19018
      public static _Fields findByThriftIdOrThrow(int fieldId) {
19019
        _Fields fields = findByThriftId(fieldId);
19020
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
19021
        return fields;
19022
      }
19023
 
19024
      /**
19025
       * Find the _Fields constant that matches name, or null if its not found.
19026
       */
19027
      public static _Fields findByName(String name) {
19028
        return byName.get(name);
19029
      }
19030
 
19031
      private final short _thriftId;
19032
      private final String _fieldName;
19033
 
19034
      _Fields(short thriftId, String fieldName) {
19035
        _thriftId = thriftId;
19036
        _fieldName = fieldName;
19037
      }
19038
 
19039
      public short getThriftFieldId() {
19040
        return _thriftId;
19041
      }
19042
 
19043
      public String getFieldName() {
19044
        return _fieldName;
19045
      }
19046
    }
19047
 
19048
    // isset id assignments
19049
 
19050
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
19051
    static {
19052
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
19053
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
19054
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
19055
      metaDataMap = Collections.unmodifiableMap(tmpMap);
19056
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_result.class, metaDataMap);
19057
    }
19058
 
19059
    public assignVoucher_result() {
19060
    }
19061
 
19062
    public assignVoucher_result(
19063
      Voucher success)
19064
    {
19065
      this();
19066
      this.success = success;
19067
    }
19068
 
19069
    /**
19070
     * Performs a deep copy on <i>other</i>.
19071
     */
19072
    public assignVoucher_result(assignVoucher_result other) {
19073
      if (other.isSetSuccess()) {
19074
        this.success = new Voucher(other.success);
19075
      }
19076
    }
19077
 
19078
    public assignVoucher_result deepCopy() {
19079
      return new assignVoucher_result(this);
19080
    }
19081
 
19082
    @Override
19083
    public void clear() {
19084
      this.success = null;
19085
    }
19086
 
19087
    public Voucher getSuccess() {
19088
      return this.success;
19089
    }
19090
 
19091
    public void setSuccess(Voucher success) {
19092
      this.success = success;
19093
    }
19094
 
19095
    public void unsetSuccess() {
19096
      this.success = null;
19097
    }
19098
 
19099
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
19100
    public boolean isSetSuccess() {
19101
      return this.success != null;
19102
    }
19103
 
19104
    public void setSuccessIsSet(boolean value) {
19105
      if (!value) {
19106
        this.success = null;
19107
      }
19108
    }
19109
 
19110
    public void setFieldValue(_Fields field, Object value) {
19111
      switch (field) {
19112
      case SUCCESS:
19113
        if (value == null) {
19114
          unsetSuccess();
19115
        } else {
19116
          setSuccess((Voucher)value);
19117
        }
19118
        break;
19119
 
19120
      }
19121
    }
19122
 
19123
    public Object getFieldValue(_Fields field) {
19124
      switch (field) {
19125
      case SUCCESS:
19126
        return getSuccess();
19127
 
19128
      }
19129
      throw new IllegalStateException();
19130
    }
19131
 
19132
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
19133
    public boolean isSet(_Fields field) {
19134
      if (field == null) {
19135
        throw new IllegalArgumentException();
19136
      }
19137
 
19138
      switch (field) {
19139
      case SUCCESS:
19140
        return isSetSuccess();
19141
      }
19142
      throw new IllegalStateException();
19143
    }
19144
 
19145
    @Override
19146
    public boolean equals(Object that) {
19147
      if (that == null)
19148
        return false;
19149
      if (that instanceof assignVoucher_result)
19150
        return this.equals((assignVoucher_result)that);
19151
      return false;
19152
    }
19153
 
19154
    public boolean equals(assignVoucher_result that) {
19155
      if (that == null)
19156
        return false;
19157
 
19158
      boolean this_present_success = true && this.isSetSuccess();
19159
      boolean that_present_success = true && that.isSetSuccess();
19160
      if (this_present_success || that_present_success) {
19161
        if (!(this_present_success && that_present_success))
19162
          return false;
19163
        if (!this.success.equals(that.success))
19164
          return false;
19165
      }
19166
 
19167
      return true;
19168
    }
19169
 
19170
    @Override
19171
    public int hashCode() {
19172
      return 0;
19173
    }
19174
 
19175
    public int compareTo(assignVoucher_result other) {
19176
      if (!getClass().equals(other.getClass())) {
19177
        return getClass().getName().compareTo(other.getClass().getName());
19178
      }
19179
 
19180
      int lastComparison = 0;
19181
      assignVoucher_result typedOther = (assignVoucher_result)other;
19182
 
19183
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
19184
      if (lastComparison != 0) {
19185
        return lastComparison;
19186
      }
19187
      if (isSetSuccess()) {
19188
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
19189
        if (lastComparison != 0) {
19190
          return lastComparison;
19191
        }
19192
      }
19193
      return 0;
19194
    }
19195
 
19196
    public _Fields fieldForId(int fieldId) {
19197
      return _Fields.findByThriftId(fieldId);
19198
    }
19199
 
19200
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
19201
      org.apache.thrift.protocol.TField field;
19202
      iprot.readStructBegin();
19203
      while (true)
19204
      {
19205
        field = iprot.readFieldBegin();
19206
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
19207
          break;
19208
        }
19209
        switch (field.id) {
19210
          case 0: // SUCCESS
19211
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
19212
              this.success = new Voucher();
19213
              this.success.read(iprot);
19214
            } else { 
19215
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19216
            }
19217
            break;
19218
          default:
19219
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19220
        }
19221
        iprot.readFieldEnd();
19222
      }
19223
      iprot.readStructEnd();
19224
      validate();
19225
    }
19226
 
19227
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
19228
      oprot.writeStructBegin(STRUCT_DESC);
19229
 
19230
      if (this.isSetSuccess()) {
19231
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
19232
        this.success.write(oprot);
19233
        oprot.writeFieldEnd();
19234
      }
19235
      oprot.writeFieldStop();
19236
      oprot.writeStructEnd();
19237
    }
19238
 
19239
    @Override
19240
    public String toString() {
19241
      StringBuilder sb = new StringBuilder("assignVoucher_result(");
19242
      boolean first = true;
19243
 
19244
      sb.append("success:");
19245
      if (this.success == null) {
19246
        sb.append("null");
19247
      } else {
19248
        sb.append(this.success);
19249
      }
19250
      first = false;
19251
      sb.append(")");
19252
      return sb.toString();
19253
    }
19254
 
19255
    public void validate() throws org.apache.thrift.TException {
19256
      // check for required fields
19257
    }
19258
 
19259
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
19260
      try {
19261
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
19262
      } catch (org.apache.thrift.TException te) {
19263
        throw new java.io.IOException(te);
19264
      }
19265
    }
19266
 
19267
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
19268
      try {
19269
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
19270
      } catch (org.apache.thrift.TException te) {
19271
        throw new java.io.IOException(te);
19272
      }
19273
    }
19274
 
19275
  }
19276
 
19277
  public static class markVoucherAsRedeemed_args implements org.apache.thrift.TBase<markVoucherAsRedeemed_args, markVoucherAsRedeemed_args._Fields>, java.io.Serializable, Cloneable   {
19278
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_args");
19279
 
19280
    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);
19281
    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);
19282
 
19283
    private String voucherCode; // required
19284
    private long redeemedOn; // required
19285
 
19286
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
19287
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
19288
      VOUCHER_CODE((short)1, "voucherCode"),
19289
      REDEEMED_ON((short)2, "redeemedOn");
19290
 
19291
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
19292
 
19293
      static {
19294
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
19295
          byName.put(field.getFieldName(), field);
19296
        }
19297
      }
19298
 
19299
      /**
19300
       * Find the _Fields constant that matches fieldId, or null if its not found.
19301
       */
19302
      public static _Fields findByThriftId(int fieldId) {
19303
        switch(fieldId) {
19304
          case 1: // VOUCHER_CODE
19305
            return VOUCHER_CODE;
19306
          case 2: // REDEEMED_ON
19307
            return REDEEMED_ON;
19308
          default:
19309
            return null;
19310
        }
19311
      }
19312
 
19313
      /**
19314
       * Find the _Fields constant that matches fieldId, throwing an exception
19315
       * if it is not found.
19316
       */
19317
      public static _Fields findByThriftIdOrThrow(int fieldId) {
19318
        _Fields fields = findByThriftId(fieldId);
19319
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
19320
        return fields;
19321
      }
19322
 
19323
      /**
19324
       * Find the _Fields constant that matches name, or null if its not found.
19325
       */
19326
      public static _Fields findByName(String name) {
19327
        return byName.get(name);
19328
      }
19329
 
19330
      private final short _thriftId;
19331
      private final String _fieldName;
19332
 
19333
      _Fields(short thriftId, String fieldName) {
19334
        _thriftId = thriftId;
19335
        _fieldName = fieldName;
19336
      }
19337
 
19338
      public short getThriftFieldId() {
19339
        return _thriftId;
19340
      }
19341
 
19342
      public String getFieldName() {
19343
        return _fieldName;
19344
      }
19345
    }
19346
 
19347
    // isset id assignments
19348
    private static final int __REDEEMEDON_ISSET_ID = 0;
19349
    private BitSet __isset_bit_vector = new BitSet(1);
19350
 
19351
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
19352
    static {
19353
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
19354
      tmpMap.put(_Fields.VOUCHER_CODE, new org.apache.thrift.meta_data.FieldMetaData("voucherCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
19355
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
19356
      tmpMap.put(_Fields.REDEEMED_ON, new org.apache.thrift.meta_data.FieldMetaData("redeemedOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
19357
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
19358
      metaDataMap = Collections.unmodifiableMap(tmpMap);
19359
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_args.class, metaDataMap);
19360
    }
19361
 
19362
    public markVoucherAsRedeemed_args() {
19363
    }
19364
 
19365
    public markVoucherAsRedeemed_args(
19366
      String voucherCode,
19367
      long redeemedOn)
19368
    {
19369
      this();
19370
      this.voucherCode = voucherCode;
19371
      this.redeemedOn = redeemedOn;
19372
      setRedeemedOnIsSet(true);
19373
    }
19374
 
19375
    /**
19376
     * Performs a deep copy on <i>other</i>.
19377
     */
19378
    public markVoucherAsRedeemed_args(markVoucherAsRedeemed_args other) {
19379
      __isset_bit_vector.clear();
19380
      __isset_bit_vector.or(other.__isset_bit_vector);
19381
      if (other.isSetVoucherCode()) {
19382
        this.voucherCode = other.voucherCode;
19383
      }
19384
      this.redeemedOn = other.redeemedOn;
19385
    }
19386
 
19387
    public markVoucherAsRedeemed_args deepCopy() {
19388
      return new markVoucherAsRedeemed_args(this);
19389
    }
19390
 
19391
    @Override
19392
    public void clear() {
19393
      this.voucherCode = null;
19394
      setRedeemedOnIsSet(false);
19395
      this.redeemedOn = 0;
19396
    }
19397
 
19398
    public String getVoucherCode() {
19399
      return this.voucherCode;
19400
    }
19401
 
19402
    public void setVoucherCode(String voucherCode) {
19403
      this.voucherCode = voucherCode;
19404
    }
19405
 
19406
    public void unsetVoucherCode() {
19407
      this.voucherCode = null;
19408
    }
19409
 
19410
    /** Returns true if field voucherCode is set (has been assigned a value) and false otherwise */
19411
    public boolean isSetVoucherCode() {
19412
      return this.voucherCode != null;
19413
    }
19414
 
19415
    public void setVoucherCodeIsSet(boolean value) {
19416
      if (!value) {
19417
        this.voucherCode = null;
19418
      }
19419
    }
19420
 
19421
    public long getRedeemedOn() {
19422
      return this.redeemedOn;
19423
    }
19424
 
19425
    public void setRedeemedOn(long redeemedOn) {
19426
      this.redeemedOn = redeemedOn;
19427
      setRedeemedOnIsSet(true);
19428
    }
19429
 
19430
    public void unsetRedeemedOn() {
19431
      __isset_bit_vector.clear(__REDEEMEDON_ISSET_ID);
19432
    }
19433
 
19434
    /** Returns true if field redeemedOn is set (has been assigned a value) and false otherwise */
19435
    public boolean isSetRedeemedOn() {
19436
      return __isset_bit_vector.get(__REDEEMEDON_ISSET_ID);
19437
    }
19438
 
19439
    public void setRedeemedOnIsSet(boolean value) {
19440
      __isset_bit_vector.set(__REDEEMEDON_ISSET_ID, value);
19441
    }
19442
 
19443
    public void setFieldValue(_Fields field, Object value) {
19444
      switch (field) {
19445
      case VOUCHER_CODE:
19446
        if (value == null) {
19447
          unsetVoucherCode();
19448
        } else {
19449
          setVoucherCode((String)value);
19450
        }
19451
        break;
19452
 
19453
      case REDEEMED_ON:
19454
        if (value == null) {
19455
          unsetRedeemedOn();
19456
        } else {
19457
          setRedeemedOn((Long)value);
19458
        }
19459
        break;
19460
 
19461
      }
19462
    }
19463
 
19464
    public Object getFieldValue(_Fields field) {
19465
      switch (field) {
19466
      case VOUCHER_CODE:
19467
        return getVoucherCode();
19468
 
19469
      case REDEEMED_ON:
19470
        return Long.valueOf(getRedeemedOn());
19471
 
19472
      }
19473
      throw new IllegalStateException();
19474
    }
19475
 
19476
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
19477
    public boolean isSet(_Fields field) {
19478
      if (field == null) {
19479
        throw new IllegalArgumentException();
19480
      }
19481
 
19482
      switch (field) {
19483
      case VOUCHER_CODE:
19484
        return isSetVoucherCode();
19485
      case REDEEMED_ON:
19486
        return isSetRedeemedOn();
19487
      }
19488
      throw new IllegalStateException();
19489
    }
19490
 
19491
    @Override
19492
    public boolean equals(Object that) {
19493
      if (that == null)
19494
        return false;
19495
      if (that instanceof markVoucherAsRedeemed_args)
19496
        return this.equals((markVoucherAsRedeemed_args)that);
19497
      return false;
19498
    }
19499
 
19500
    public boolean equals(markVoucherAsRedeemed_args that) {
19501
      if (that == null)
19502
        return false;
19503
 
19504
      boolean this_present_voucherCode = true && this.isSetVoucherCode();
19505
      boolean that_present_voucherCode = true && that.isSetVoucherCode();
19506
      if (this_present_voucherCode || that_present_voucherCode) {
19507
        if (!(this_present_voucherCode && that_present_voucherCode))
19508
          return false;
19509
        if (!this.voucherCode.equals(that.voucherCode))
19510
          return false;
19511
      }
19512
 
19513
      boolean this_present_redeemedOn = true;
19514
      boolean that_present_redeemedOn = true;
19515
      if (this_present_redeemedOn || that_present_redeemedOn) {
19516
        if (!(this_present_redeemedOn && that_present_redeemedOn))
19517
          return false;
19518
        if (this.redeemedOn != that.redeemedOn)
19519
          return false;
19520
      }
19521
 
19522
      return true;
19523
    }
19524
 
19525
    @Override
19526
    public int hashCode() {
19527
      return 0;
19528
    }
19529
 
19530
    public int compareTo(markVoucherAsRedeemed_args other) {
19531
      if (!getClass().equals(other.getClass())) {
19532
        return getClass().getName().compareTo(other.getClass().getName());
19533
      }
19534
 
19535
      int lastComparison = 0;
19536
      markVoucherAsRedeemed_args typedOther = (markVoucherAsRedeemed_args)other;
19537
 
19538
      lastComparison = Boolean.valueOf(isSetVoucherCode()).compareTo(typedOther.isSetVoucherCode());
19539
      if (lastComparison != 0) {
19540
        return lastComparison;
19541
      }
19542
      if (isSetVoucherCode()) {
19543
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherCode, typedOther.voucherCode);
19544
        if (lastComparison != 0) {
19545
          return lastComparison;
19546
        }
19547
      }
19548
      lastComparison = Boolean.valueOf(isSetRedeemedOn()).compareTo(typedOther.isSetRedeemedOn());
19549
      if (lastComparison != 0) {
19550
        return lastComparison;
19551
      }
19552
      if (isSetRedeemedOn()) {
19553
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.redeemedOn, typedOther.redeemedOn);
19554
        if (lastComparison != 0) {
19555
          return lastComparison;
19556
        }
19557
      }
19558
      return 0;
19559
    }
19560
 
19561
    public _Fields fieldForId(int fieldId) {
19562
      return _Fields.findByThriftId(fieldId);
19563
    }
19564
 
19565
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
19566
      org.apache.thrift.protocol.TField field;
19567
      iprot.readStructBegin();
19568
      while (true)
19569
      {
19570
        field = iprot.readFieldBegin();
19571
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
19572
          break;
19573
        }
19574
        switch (field.id) {
19575
          case 1: // VOUCHER_CODE
19576
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
19577
              this.voucherCode = iprot.readString();
19578
            } else { 
19579
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19580
            }
19581
            break;
19582
          case 2: // REDEEMED_ON
19583
            if (field.type == org.apache.thrift.protocol.TType.I64) {
19584
              this.redeemedOn = iprot.readI64();
19585
              setRedeemedOnIsSet(true);
19586
            } else { 
19587
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19588
            }
19589
            break;
19590
          default:
19591
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19592
        }
19593
        iprot.readFieldEnd();
19594
      }
19595
      iprot.readStructEnd();
19596
      validate();
19597
    }
19598
 
19599
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
19600
      validate();
19601
 
19602
      oprot.writeStructBegin(STRUCT_DESC);
19603
      if (this.voucherCode != null) {
19604
        oprot.writeFieldBegin(VOUCHER_CODE_FIELD_DESC);
19605
        oprot.writeString(this.voucherCode);
19606
        oprot.writeFieldEnd();
19607
      }
19608
      oprot.writeFieldBegin(REDEEMED_ON_FIELD_DESC);
19609
      oprot.writeI64(this.redeemedOn);
19610
      oprot.writeFieldEnd();
19611
      oprot.writeFieldStop();
19612
      oprot.writeStructEnd();
19613
    }
19614
 
19615
    @Override
19616
    public String toString() {
19617
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_args(");
19618
      boolean first = true;
19619
 
19620
      sb.append("voucherCode:");
19621
      if (this.voucherCode == null) {
19622
        sb.append("null");
19623
      } else {
19624
        sb.append(this.voucherCode);
19625
      }
19626
      first = false;
19627
      if (!first) sb.append(", ");
19628
      sb.append("redeemedOn:");
19629
      sb.append(this.redeemedOn);
19630
      first = false;
19631
      sb.append(")");
19632
      return sb.toString();
19633
    }
19634
 
19635
    public void validate() throws org.apache.thrift.TException {
19636
      // check for required fields
19637
    }
19638
 
19639
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
19640
      try {
19641
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
19642
      } catch (org.apache.thrift.TException te) {
19643
        throw new java.io.IOException(te);
19644
      }
19645
    }
19646
 
19647
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
19648
      try {
19649
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
19650
        __isset_bit_vector = new BitSet(1);
19651
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
19652
      } catch (org.apache.thrift.TException te) {
19653
        throw new java.io.IOException(te);
19654
      }
19655
    }
19656
 
19657
  }
19658
 
19659
  public static class markVoucherAsRedeemed_result implements org.apache.thrift.TBase<markVoucherAsRedeemed_result, markVoucherAsRedeemed_result._Fields>, java.io.Serializable, Cloneable   {
19660
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_result");
19661
 
19662
    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);
19663
 
19664
    private boolean success; // required
19665
 
19666
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
19667
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
19668
      SUCCESS((short)0, "success");
19669
 
19670
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
19671
 
19672
      static {
19673
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
19674
          byName.put(field.getFieldName(), field);
19675
        }
19676
      }
19677
 
19678
      /**
19679
       * Find the _Fields constant that matches fieldId, or null if its not found.
19680
       */
19681
      public static _Fields findByThriftId(int fieldId) {
19682
        switch(fieldId) {
19683
          case 0: // SUCCESS
19684
            return SUCCESS;
19685
          default:
19686
            return null;
19687
        }
19688
      }
19689
 
19690
      /**
19691
       * Find the _Fields constant that matches fieldId, throwing an exception
19692
       * if it is not found.
19693
       */
19694
      public static _Fields findByThriftIdOrThrow(int fieldId) {
19695
        _Fields fields = findByThriftId(fieldId);
19696
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
19697
        return fields;
19698
      }
19699
 
19700
      /**
19701
       * Find the _Fields constant that matches name, or null if its not found.
19702
       */
19703
      public static _Fields findByName(String name) {
19704
        return byName.get(name);
19705
      }
19706
 
19707
      private final short _thriftId;
19708
      private final String _fieldName;
19709
 
19710
      _Fields(short thriftId, String fieldName) {
19711
        _thriftId = thriftId;
19712
        _fieldName = fieldName;
19713
      }
19714
 
19715
      public short getThriftFieldId() {
19716
        return _thriftId;
19717
      }
19718
 
19719
      public String getFieldName() {
19720
        return _fieldName;
19721
      }
19722
    }
19723
 
19724
    // isset id assignments
19725
    private static final int __SUCCESS_ISSET_ID = 0;
19726
    private BitSet __isset_bit_vector = new BitSet(1);
19727
 
19728
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
19729
    static {
19730
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
19731
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
19732
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
19733
      metaDataMap = Collections.unmodifiableMap(tmpMap);
19734
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_result.class, metaDataMap);
19735
    }
19736
 
19737
    public markVoucherAsRedeemed_result() {
19738
    }
19739
 
19740
    public markVoucherAsRedeemed_result(
19741
      boolean success)
19742
    {
19743
      this();
19744
      this.success = success;
19745
      setSuccessIsSet(true);
19746
    }
19747
 
19748
    /**
19749
     * Performs a deep copy on <i>other</i>.
19750
     */
19751
    public markVoucherAsRedeemed_result(markVoucherAsRedeemed_result other) {
19752
      __isset_bit_vector.clear();
19753
      __isset_bit_vector.or(other.__isset_bit_vector);
19754
      this.success = other.success;
19755
    }
19756
 
19757
    public markVoucherAsRedeemed_result deepCopy() {
19758
      return new markVoucherAsRedeemed_result(this);
19759
    }
19760
 
19761
    @Override
19762
    public void clear() {
19763
      setSuccessIsSet(false);
19764
      this.success = false;
19765
    }
19766
 
19767
    public boolean isSuccess() {
19768
      return this.success;
19769
    }
19770
 
19771
    public void setSuccess(boolean success) {
19772
      this.success = success;
19773
      setSuccessIsSet(true);
19774
    }
19775
 
19776
    public void unsetSuccess() {
19777
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
19778
    }
19779
 
19780
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
19781
    public boolean isSetSuccess() {
19782
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
19783
    }
19784
 
19785
    public void setSuccessIsSet(boolean value) {
19786
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
19787
    }
19788
 
19789
    public void setFieldValue(_Fields field, Object value) {
19790
      switch (field) {
19791
      case SUCCESS:
19792
        if (value == null) {
19793
          unsetSuccess();
19794
        } else {
19795
          setSuccess((Boolean)value);
19796
        }
19797
        break;
19798
 
19799
      }
19800
    }
19801
 
19802
    public Object getFieldValue(_Fields field) {
19803
      switch (field) {
19804
      case SUCCESS:
19805
        return Boolean.valueOf(isSuccess());
19806
 
19807
      }
19808
      throw new IllegalStateException();
19809
    }
19810
 
19811
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
19812
    public boolean isSet(_Fields field) {
19813
      if (field == null) {
19814
        throw new IllegalArgumentException();
19815
      }
19816
 
19817
      switch (field) {
19818
      case SUCCESS:
19819
        return isSetSuccess();
19820
      }
19821
      throw new IllegalStateException();
19822
    }
19823
 
19824
    @Override
19825
    public boolean equals(Object that) {
19826
      if (that == null)
19827
        return false;
19828
      if (that instanceof markVoucherAsRedeemed_result)
19829
        return this.equals((markVoucherAsRedeemed_result)that);
19830
      return false;
19831
    }
19832
 
19833
    public boolean equals(markVoucherAsRedeemed_result that) {
19834
      if (that == null)
19835
        return false;
19836
 
19837
      boolean this_present_success = true;
19838
      boolean that_present_success = true;
19839
      if (this_present_success || that_present_success) {
19840
        if (!(this_present_success && that_present_success))
19841
          return false;
19842
        if (this.success != that.success)
19843
          return false;
19844
      }
19845
 
19846
      return true;
19847
    }
19848
 
19849
    @Override
19850
    public int hashCode() {
19851
      return 0;
19852
    }
19853
 
19854
    public int compareTo(markVoucherAsRedeemed_result other) {
19855
      if (!getClass().equals(other.getClass())) {
19856
        return getClass().getName().compareTo(other.getClass().getName());
19857
      }
19858
 
19859
      int lastComparison = 0;
19860
      markVoucherAsRedeemed_result typedOther = (markVoucherAsRedeemed_result)other;
19861
 
19862
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
19863
      if (lastComparison != 0) {
19864
        return lastComparison;
19865
      }
19866
      if (isSetSuccess()) {
19867
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
19868
        if (lastComparison != 0) {
19869
          return lastComparison;
19870
        }
19871
      }
19872
      return 0;
19873
    }
19874
 
19875
    public _Fields fieldForId(int fieldId) {
19876
      return _Fields.findByThriftId(fieldId);
19877
    }
19878
 
19879
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
19880
      org.apache.thrift.protocol.TField field;
19881
      iprot.readStructBegin();
19882
      while (true)
19883
      {
19884
        field = iprot.readFieldBegin();
19885
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
19886
          break;
19887
        }
19888
        switch (field.id) {
19889
          case 0: // SUCCESS
19890
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
19891
              this.success = iprot.readBool();
19892
              setSuccessIsSet(true);
19893
            } else { 
19894
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19895
            }
19896
            break;
19897
          default:
19898
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19899
        }
19900
        iprot.readFieldEnd();
19901
      }
19902
      iprot.readStructEnd();
19903
      validate();
19904
    }
19905
 
19906
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
19907
      oprot.writeStructBegin(STRUCT_DESC);
19908
 
19909
      if (this.isSetSuccess()) {
19910
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
19911
        oprot.writeBool(this.success);
19912
        oprot.writeFieldEnd();
19913
      }
19914
      oprot.writeFieldStop();
19915
      oprot.writeStructEnd();
19916
    }
19917
 
19918
    @Override
19919
    public String toString() {
19920
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_result(");
19921
      boolean first = true;
19922
 
19923
      sb.append("success:");
19924
      sb.append(this.success);
19925
      first = false;
19926
      sb.append(")");
19927
      return sb.toString();
19928
    }
19929
 
19930
    public void validate() throws org.apache.thrift.TException {
19931
      // check for required fields
19932
    }
19933
 
19934
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
19935
      try {
19936
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
19937
      } catch (org.apache.thrift.TException te) {
19938
        throw new java.io.IOException(te);
19939
      }
19940
    }
19941
 
19942
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
19943
      try {
19944
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
19945
      } catch (org.apache.thrift.TException te) {
19946
        throw new java.io.IOException(te);
19947
      }
19948
    }
19949
 
19950
  }
19951
 
1982 varun.gupt 19952
}