Subversion Repositories SmartDukaan

Rev

Rev 6561 | Rev 6730 | 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
 
6301 amit.gupta 32
    public Coupon getCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
33
 
34
    public boolean isGiftVoucher(String couponCode) throws PromotionException, org.apache.thrift.TException;
35
 
6356 amit.gupta 36
    public boolean isCodApplicable(String couponCode) throws PromotionException, org.apache.thrift.TException;
37
 
3430 rajveer 38
    public List<Promotion> getAllPromotions() throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 39
 
3430 rajveer 40
    public Promotion getPromotionById(long promotionId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 41
 
3430 rajveer 42
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 43
 
3430 rajveer 44
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 45
 
6433 anupam.sin 46
    public Map<Long,String> applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws PromotionException, org.apache.thrift.TException;
47
 
3430 rajveer 48
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 49
 
3430 rajveer 50
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 51
 
6497 amit.gupta 52
    public List<Coupon> getActiveCodes(long promotionId) throws PromotionException, org.apache.thrift.TException;
53
 
54
    public void deleteCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
55
 
3385 varun.gupt 56
    /**
57
     * Returns a list of active coupons
58
     */
3430 rajveer 59
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException;
3385 varun.gupt 60
 
61
    /**
6561 amit.gupta 62
     * Creates a coupon with prefix (optional, pass null)and returns couponcode if successfully created.
6250 amit.gupta 63
     * 
64
     * @param promotionId
6679 anupam.sin 65
     * @param arguments
6356 amit.gupta 66
     * @param isCod
6561 amit.gupta 67
     * @param prefix
6250 amit.gupta 68
     */
6679 anupam.sin 69
    public String createCoupon(long promotionId, String arguments, boolean isCod, String prefix) throws PromotionException, org.apache.thrift.TException;
6250 amit.gupta 70
 
71
    /**
3385 varun.gupt 72
     * Returns the count of successful payments done using a given coupon
73
     * 
74
     * @param couponCode
75
     */
3430 rajveer 76
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
3385 varun.gupt 77
 
78
    /**
79
     * Returns the doc string of the rule module
80
     * 
81
     * @param ruleName
82
     */
3430 rajveer 83
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException;
3385 varun.gupt 84
 
4189 varun.gupt 85
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException;
86
 
4494 varun.gupt 87
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException;
88
 
5469 rajveer 89
    public void addVoucher(Voucher voucher) throws org.apache.thrift.TException;
90
 
91
    public Voucher assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException;
92
 
93
    public boolean markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException;
94
 
1982 varun.gupt 95
  }
96
 
3430 rajveer 97
  public interface AsyncIface extends in.shop2020.generic.GenericService .AsyncIface {
1982 varun.gupt 98
 
3430 rajveer 99
    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 100
 
6301 amit.gupta 101
    public void getCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCoupon_call> resultHandler) throws org.apache.thrift.TException;
102
 
103
    public void isGiftVoucher(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.isGiftVoucher_call> resultHandler) throws org.apache.thrift.TException;
104
 
6356 amit.gupta 105
    public void isCodApplicable(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.isCodApplicable_call> resultHandler) throws org.apache.thrift.TException;
106
 
3430 rajveer 107
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllPromotions_call> resultHandler) throws org.apache.thrift.TException;
108
 
109
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPromotionById_call> resultHandler) throws org.apache.thrift.TException;
110
 
111
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException;
112
 
113
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyCoupon_call> resultHandler) throws org.apache.thrift.TException;
114
 
6433 anupam.sin 115
    public void applyRechargeCoupon(String couponCode, long totalAmount, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyRechargeCoupon_call> resultHandler) throws org.apache.thrift.TException;
116
 
3430 rajveer 117
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException;
118
 
119
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException;
120
 
6497 amit.gupta 121
    public void getActiveCodes(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getActiveCodes_call> resultHandler) throws org.apache.thrift.TException;
122
 
123
    public void deleteCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.deleteCoupon_call> resultHandler) throws org.apache.thrift.TException;
124
 
3430 rajveer 125
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException;
126
 
6679 anupam.sin 127
    public void createCoupon(long promotionId, String arguments, boolean isCod, String prefix, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.createCoupon_call> resultHandler) throws org.apache.thrift.TException;
6250 amit.gupta 128
 
3430 rajveer 129
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException;
130
 
131
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getRuleDocString_call> resultHandler) throws org.apache.thrift.TException;
132
 
4189 varun.gupt 133
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException;
134
 
4494 varun.gupt 135
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException;
136
 
5469 rajveer 137
    public void addVoucher(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.addVoucher_call> resultHandler) throws org.apache.thrift.TException;
138
 
139
    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;
140
 
141
    public void markVoucherAsRedeemed(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.markVoucherAsRedeemed_call> resultHandler) throws org.apache.thrift.TException;
142
 
3430 rajveer 143
  }
144
 
145
  public static class Client extends in.shop2020.generic.GenericService.Client implements Iface {
146
    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
147
      public Factory() {}
148
      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
149
        return new Client(prot);
150
      }
151
      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
152
        return new Client(iprot, oprot);
153
      }
1982 varun.gupt 154
    }
155
 
3430 rajveer 156
    public Client(org.apache.thrift.protocol.TProtocol prot)
1982 varun.gupt 157
    {
3430 rajveer 158
      super(prot, prot);
1982 varun.gupt 159
    }
160
 
3430 rajveer 161
    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
162
      super(iprot, oprot);
1982 varun.gupt 163
    }
164
 
3430 rajveer 165
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 166
    {
167
      send_createPromotion(name, ruleExecutionSrc, startOn, endOn);
168
      recv_createPromotion();
169
    }
170
 
3430 rajveer 171
    public void send_createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws org.apache.thrift.TException
1982 varun.gupt 172
    {
173
      createPromotion_args args = new createPromotion_args();
3430 rajveer 174
      args.setName(name);
175
      args.setRuleExecutionSrc(ruleExecutionSrc);
176
      args.setStartOn(startOn);
177
      args.setEndOn(endOn);
178
      sendBase("createPromotion", args);
1982 varun.gupt 179
    }
180
 
3430 rajveer 181
    public void recv_createPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 182
    {
183
      createPromotion_result result = new createPromotion_result();
3430 rajveer 184
      receiveBase(result, "createPromotion");
1982 varun.gupt 185
      if (result.pex != null) {
186
        throw result.pex;
187
      }
188
      return;
189
    }
190
 
6301 amit.gupta 191
    public Coupon getCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
192
    {
193
      send_getCoupon(couponCode);
194
      return recv_getCoupon();
195
    }
196
 
197
    public void send_getCoupon(String couponCode) throws org.apache.thrift.TException
198
    {
199
      getCoupon_args args = new getCoupon_args();
200
      args.setCouponCode(couponCode);
201
      sendBase("getCoupon", args);
202
    }
203
 
204
    public Coupon recv_getCoupon() throws PromotionException, org.apache.thrift.TException
205
    {
206
      getCoupon_result result = new getCoupon_result();
207
      receiveBase(result, "getCoupon");
208
      if (result.isSetSuccess()) {
209
        return result.success;
210
      }
211
      if (result.pex != null) {
212
        throw result.pex;
213
      }
214
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCoupon failed: unknown result");
215
    }
216
 
217
    public boolean isGiftVoucher(String couponCode) throws PromotionException, org.apache.thrift.TException
218
    {
219
      send_isGiftVoucher(couponCode);
220
      return recv_isGiftVoucher();
221
    }
222
 
223
    public void send_isGiftVoucher(String couponCode) throws org.apache.thrift.TException
224
    {
225
      isGiftVoucher_args args = new isGiftVoucher_args();
226
      args.setCouponCode(couponCode);
227
      sendBase("isGiftVoucher", args);
228
    }
229
 
230
    public boolean recv_isGiftVoucher() throws PromotionException, org.apache.thrift.TException
231
    {
232
      isGiftVoucher_result result = new isGiftVoucher_result();
233
      receiveBase(result, "isGiftVoucher");
234
      if (result.isSetSuccess()) {
235
        return result.success;
236
      }
237
      if (result.pex != null) {
238
        throw result.pex;
239
      }
240
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isGiftVoucher failed: unknown result");
241
    }
242
 
6356 amit.gupta 243
    public boolean isCodApplicable(String couponCode) throws PromotionException, org.apache.thrift.TException
244
    {
245
      send_isCodApplicable(couponCode);
246
      return recv_isCodApplicable();
247
    }
248
 
249
    public void send_isCodApplicable(String couponCode) throws org.apache.thrift.TException
250
    {
251
      isCodApplicable_args args = new isCodApplicable_args();
252
      args.setCouponCode(couponCode);
253
      sendBase("isCodApplicable", args);
254
    }
255
 
256
    public boolean recv_isCodApplicable() throws PromotionException, org.apache.thrift.TException
257
    {
258
      isCodApplicable_result result = new isCodApplicable_result();
259
      receiveBase(result, "isCodApplicable");
260
      if (result.isSetSuccess()) {
261
        return result.success;
262
      }
263
      if (result.pex != null) {
264
        throw result.pex;
265
      }
266
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isCodApplicable failed: unknown result");
267
    }
268
 
3430 rajveer 269
    public List<Promotion> getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 270
    {
271
      send_getAllPromotions();
272
      return recv_getAllPromotions();
273
    }
274
 
3430 rajveer 275
    public void send_getAllPromotions() throws org.apache.thrift.TException
1982 varun.gupt 276
    {
277
      getAllPromotions_args args = new getAllPromotions_args();
3430 rajveer 278
      sendBase("getAllPromotions", args);
1982 varun.gupt 279
    }
280
 
3430 rajveer 281
    public List<Promotion> recv_getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 282
    {
283
      getAllPromotions_result result = new getAllPromotions_result();
3430 rajveer 284
      receiveBase(result, "getAllPromotions");
1982 varun.gupt 285
      if (result.isSetSuccess()) {
286
        return result.success;
287
      }
288
      if (result.pex != null) {
289
        throw result.pex;
290
      }
3430 rajveer 291
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllPromotions failed: unknown result");
1982 varun.gupt 292
    }
293
 
3430 rajveer 294
    public Promotion getPromotionById(long promotionId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 295
    {
296
      send_getPromotionById(promotionId);
297
      return recv_getPromotionById();
298
    }
299
 
3430 rajveer 300
    public void send_getPromotionById(long promotionId) throws org.apache.thrift.TException
1982 varun.gupt 301
    {
302
      getPromotionById_args args = new getPromotionById_args();
3430 rajveer 303
      args.setPromotionId(promotionId);
304
      sendBase("getPromotionById", args);
1982 varun.gupt 305
    }
306
 
3430 rajveer 307
    public Promotion recv_getPromotionById() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 308
    {
309
      getPromotionById_result result = new getPromotionById_result();
3430 rajveer 310
      receiveBase(result, "getPromotionById");
1982 varun.gupt 311
      if (result.isSetSuccess()) {
312
        return result.success;
313
      }
314
      if (result.pex != null) {
315
        throw result.pex;
316
      }
3430 rajveer 317
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPromotionById failed: unknown result");
1982 varun.gupt 318
    }
319
 
3430 rajveer 320
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 321
    {
322
      send_generateCouponsForPromotion(promotionId, couponCode);
323
      recv_generateCouponsForPromotion();
324
    }
325
 
3430 rajveer 326
    public void send_generateCouponsForPromotion(long promotionId, String couponCode) throws org.apache.thrift.TException
1982 varun.gupt 327
    {
328
      generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
3430 rajveer 329
      args.setPromotionId(promotionId);
330
      args.setCouponCode(couponCode);
331
      sendBase("generateCouponsForPromotion", args);
1982 varun.gupt 332
    }
333
 
3430 rajveer 334
    public void recv_generateCouponsForPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 335
    {
336
      generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
3430 rajveer 337
      receiveBase(result, "generateCouponsForPromotion");
1982 varun.gupt 338
      if (result.pex != null) {
339
        throw result.pex;
340
      }
341
      return;
342
    }
343
 
3430 rajveer 344
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 345
    {
346
      send_applyCoupon(couponCode, cartId);
347
      return recv_applyCoupon();
348
    }
349
 
3430 rajveer 350
    public void send_applyCoupon(String couponCode, long cartId) throws org.apache.thrift.TException
1982 varun.gupt 351
    {
352
      applyCoupon_args args = new applyCoupon_args();
3430 rajveer 353
      args.setCouponCode(couponCode);
354
      args.setCartId(cartId);
355
      sendBase("applyCoupon", args);
1982 varun.gupt 356
    }
357
 
3430 rajveer 358
    public Cart recv_applyCoupon() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 359
    {
360
      applyCoupon_result result = new applyCoupon_result();
3430 rajveer 361
      receiveBase(result, "applyCoupon");
1982 varun.gupt 362
      if (result.isSetSuccess()) {
363
        return result.success;
364
      }
365
      if (result.pex != null) {
366
        throw result.pex;
367
      }
3430 rajveer 368
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "applyCoupon failed: unknown result");
1982 varun.gupt 369
    }
370
 
6433 anupam.sin 371
    public Map<Long,String> applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws PromotionException, org.apache.thrift.TException
372
    {
373
      send_applyRechargeCoupon(couponCode, totalAmount, userId);
374
      return recv_applyRechargeCoupon();
375
    }
376
 
377
    public void send_applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws org.apache.thrift.TException
378
    {
379
      applyRechargeCoupon_args args = new applyRechargeCoupon_args();
380
      args.setCouponCode(couponCode);
381
      args.setTotalAmount(totalAmount);
382
      args.setUserId(userId);
383
      sendBase("applyRechargeCoupon", args);
384
    }
385
 
386
    public Map<Long,String> recv_applyRechargeCoupon() throws PromotionException, org.apache.thrift.TException
387
    {
388
      applyRechargeCoupon_result result = new applyRechargeCoupon_result();
389
      receiveBase(result, "applyRechargeCoupon");
390
      if (result.isSetSuccess()) {
391
        return result.success;
392
      }
393
      if (result.pex != null) {
394
        throw result.pex;
395
      }
396
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "applyRechargeCoupon failed: unknown result");
397
    }
398
 
3430 rajveer 399
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 400
    {
401
      send_trackCouponUsage(couponCode, transactionId, userId);
402
      recv_trackCouponUsage();
403
    }
404
 
3430 rajveer 405
    public void send_trackCouponUsage(String couponCode, long transactionId, long userId) throws org.apache.thrift.TException
1982 varun.gupt 406
    {
407
      trackCouponUsage_args args = new trackCouponUsage_args();
3430 rajveer 408
      args.setCouponCode(couponCode);
409
      args.setTransactionId(transactionId);
410
      args.setUserId(userId);
411
      sendBase("trackCouponUsage", args);
1982 varun.gupt 412
    }
413
 
3430 rajveer 414
    public void recv_trackCouponUsage() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 415
    {
416
      trackCouponUsage_result result = new trackCouponUsage_result();
3430 rajveer 417
      receiveBase(result, "trackCouponUsage");
1982 varun.gupt 418
      if (result.pex != null) {
419
        throw result.pex;
420
      }
421
      return;
422
    }
423
 
3430 rajveer 424
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 425
    {
426
      send_getCouponUsageCountByUser(couponCode, userId);
427
      return recv_getCouponUsageCountByUser();
428
    }
429
 
3430 rajveer 430
    public void send_getCouponUsageCountByUser(String couponCode, long userId) throws org.apache.thrift.TException
1982 varun.gupt 431
    {
432
      getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
3430 rajveer 433
      args.setCouponCode(couponCode);
434
      args.setUserId(userId);
435
      sendBase("getCouponUsageCountByUser", args);
1982 varun.gupt 436
    }
437
 
3430 rajveer 438
    public long recv_getCouponUsageCountByUser() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 439
    {
440
      getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
3430 rajveer 441
      receiveBase(result, "getCouponUsageCountByUser");
1982 varun.gupt 442
      if (result.isSetSuccess()) {
443
        return result.success;
444
      }
445
      if (result.pex != null) {
446
        throw result.pex;
447
      }
3430 rajveer 448
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCouponUsageCountByUser failed: unknown result");
1982 varun.gupt 449
    }
450
 
6497 amit.gupta 451
    public List<Coupon> getActiveCodes(long promotionId) throws PromotionException, org.apache.thrift.TException
452
    {
453
      send_getActiveCodes(promotionId);
454
      return recv_getActiveCodes();
455
    }
456
 
457
    public void send_getActiveCodes(long promotionId) throws org.apache.thrift.TException
458
    {
459
      getActiveCodes_args args = new getActiveCodes_args();
460
      args.setPromotionId(promotionId);
461
      sendBase("getActiveCodes", args);
462
    }
463
 
464
    public List<Coupon> recv_getActiveCodes() throws PromotionException, org.apache.thrift.TException
465
    {
466
      getActiveCodes_result result = new getActiveCodes_result();
467
      receiveBase(result, "getActiveCodes");
468
      if (result.isSetSuccess()) {
469
        return result.success;
470
      }
471
      if (result.pex != null) {
472
        throw result.pex;
473
      }
474
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getActiveCodes failed: unknown result");
475
    }
476
 
477
    public void deleteCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
478
    {
479
      send_deleteCoupon(couponCode);
480
      recv_deleteCoupon();
481
    }
482
 
483
    public void send_deleteCoupon(String couponCode) throws org.apache.thrift.TException
484
    {
485
      deleteCoupon_args args = new deleteCoupon_args();
486
      args.setCouponCode(couponCode);
487
      sendBase("deleteCoupon", args);
488
    }
489
 
490
    public void recv_deleteCoupon() throws PromotionException, org.apache.thrift.TException
491
    {
492
      deleteCoupon_result result = new deleteCoupon_result();
493
      receiveBase(result, "deleteCoupon");
494
      if (result.pex != null) {
495
        throw result.pex;
496
      }
497
      return;
498
    }
499
 
3430 rajveer 500
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 501
    {
502
      send_getActiveCoupons();
503
      return recv_getActiveCoupons();
504
    }
505
 
3430 rajveer 506
    public void send_getActiveCoupons() throws org.apache.thrift.TException
3385 varun.gupt 507
    {
508
      getActiveCoupons_args args = new getActiveCoupons_args();
3430 rajveer 509
      sendBase("getActiveCoupons", args);
3385 varun.gupt 510
    }
511
 
3430 rajveer 512
    public List<Coupon> recv_getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 513
    {
514
      getActiveCoupons_result result = new getActiveCoupons_result();
3430 rajveer 515
      receiveBase(result, "getActiveCoupons");
3385 varun.gupt 516
      if (result.isSetSuccess()) {
517
        return result.success;
518
      }
519
      if (result.pex != null) {
520
        throw result.pex;
521
      }
3430 rajveer 522
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getActiveCoupons failed: unknown result");
3385 varun.gupt 523
    }
524
 
6679 anupam.sin 525
    public String createCoupon(long promotionId, String arguments, boolean isCod, String prefix) throws PromotionException, org.apache.thrift.TException
6250 amit.gupta 526
    {
6679 anupam.sin 527
      send_createCoupon(promotionId, arguments, isCod, prefix);
6250 amit.gupta 528
      return recv_createCoupon();
529
    }
530
 
6679 anupam.sin 531
    public void send_createCoupon(long promotionId, String arguments, boolean isCod, String prefix) throws org.apache.thrift.TException
6250 amit.gupta 532
    {
533
      createCoupon_args args = new createCoupon_args();
534
      args.setPromotionId(promotionId);
6679 anupam.sin 535
      args.setArguments(arguments);
6356 amit.gupta 536
      args.setIsCod(isCod);
6561 amit.gupta 537
      args.setPrefix(prefix);
6250 amit.gupta 538
      sendBase("createCoupon", args);
539
    }
540
 
541
    public String recv_createCoupon() throws PromotionException, org.apache.thrift.TException
542
    {
543
      createCoupon_result result = new createCoupon_result();
544
      receiveBase(result, "createCoupon");
545
      if (result.isSetSuccess()) {
546
        return result.success;
547
      }
548
      if (result.pex != null) {
549
        throw result.pex;
550
      }
551
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createCoupon failed: unknown result");
552
    }
553
 
3430 rajveer 554
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 555
    {
556
      send_getSuccessfulPaymentCountForCoupon(couponCode);
557
      return recv_getSuccessfulPaymentCountForCoupon();
558
    }
559
 
3430 rajveer 560
    public void send_getSuccessfulPaymentCountForCoupon(String couponCode) throws org.apache.thrift.TException
3385 varun.gupt 561
    {
562
      getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
3430 rajveer 563
      args.setCouponCode(couponCode);
564
      sendBase("getSuccessfulPaymentCountForCoupon", args);
3385 varun.gupt 565
    }
566
 
3430 rajveer 567
    public long recv_getSuccessfulPaymentCountForCoupon() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 568
    {
569
      getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
3430 rajveer 570
      receiveBase(result, "getSuccessfulPaymentCountForCoupon");
3385 varun.gupt 571
      if (result.isSetSuccess()) {
572
        return result.success;
573
      }
574
      if (result.pex != null) {
575
        throw result.pex;
576
      }
3430 rajveer 577
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSuccessfulPaymentCountForCoupon failed: unknown result");
3385 varun.gupt 578
    }
579
 
3430 rajveer 580
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 581
    {
582
      send_getRuleDocString(ruleName);
583
      return recv_getRuleDocString();
584
    }
585
 
3430 rajveer 586
    public void send_getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 587
    {
588
      getRuleDocString_args args = new getRuleDocString_args();
3430 rajveer 589
      args.setRuleName(ruleName);
590
      sendBase("getRuleDocString", args);
3385 varun.gupt 591
    }
592
 
3430 rajveer 593
    public String recv_getRuleDocString() throws org.apache.thrift.TException
3385 varun.gupt 594
    {
595
      getRuleDocString_result result = new getRuleDocString_result();
3430 rajveer 596
      receiveBase(result, "getRuleDocString");
3385 varun.gupt 597
      if (result.isSetSuccess()) {
598
        return result.success;
599
      }
3430 rajveer 600
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRuleDocString failed: unknown result");
3385 varun.gupt 601
    }
602
 
4189 varun.gupt 603
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException
604
    {
605
      send_getItemDiscountMap(itemIds);
606
      return recv_getItemDiscountMap();
607
    }
608
 
609
    public void send_getItemDiscountMap(List<Long> itemIds) throws org.apache.thrift.TException
610
    {
611
      getItemDiscountMap_args args = new getItemDiscountMap_args();
612
      args.setItemIds(itemIds);
613
      sendBase("getItemDiscountMap", args);
614
    }
615
 
616
    public List<ItemCouponDiscount> recv_getItemDiscountMap() throws PromotionException, org.apache.thrift.TException
617
    {
618
      getItemDiscountMap_result result = new getItemDiscountMap_result();
619
      receiveBase(result, "getItemDiscountMap");
620
      if (result.isSetSuccess()) {
621
        return result.success;
622
      }
623
      if (result.pex != null) {
624
        throw result.pex;
625
      }
626
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemDiscountMap failed: unknown result");
627
    }
628
 
4494 varun.gupt 629
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
630
    {
631
      send_getDiscountsForEntity(entityId);
632
      return recv_getDiscountsForEntity();
633
    }
634
 
635
    public void send_getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
636
    {
637
      getDiscountsForEntity_args args = new getDiscountsForEntity_args();
638
      args.setEntityId(entityId);
639
      sendBase("getDiscountsForEntity", args);
640
    }
641
 
642
    public Map<String,Double> recv_getDiscountsForEntity() throws org.apache.thrift.TException
643
    {
644
      getDiscountsForEntity_result result = new getDiscountsForEntity_result();
645
      receiveBase(result, "getDiscountsForEntity");
646
      if (result.isSetSuccess()) {
647
        return result.success;
648
      }
649
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getDiscountsForEntity failed: unknown result");
650
    }
651
 
5469 rajveer 652
    public void addVoucher(Voucher voucher) throws org.apache.thrift.TException
653
    {
654
      send_addVoucher(voucher);
655
      recv_addVoucher();
656
    }
657
 
658
    public void send_addVoucher(Voucher voucher) throws org.apache.thrift.TException
659
    {
660
      addVoucher_args args = new addVoucher_args();
661
      args.setVoucher(voucher);
662
      sendBase("addVoucher", args);
663
    }
664
 
665
    public void recv_addVoucher() throws org.apache.thrift.TException
666
    {
667
      addVoucher_result result = new addVoucher_result();
668
      receiveBase(result, "addVoucher");
669
      return;
670
    }
671
 
672
    public Voucher assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException
673
    {
674
      send_assignVoucher(userId, userEmail, voucherType, amount);
675
      return recv_assignVoucher();
676
    }
677
 
678
    public void send_assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException
679
    {
680
      assignVoucher_args args = new assignVoucher_args();
681
      args.setUserId(userId);
682
      args.setUserEmail(userEmail);
683
      args.setVoucherType(voucherType);
684
      args.setAmount(amount);
685
      sendBase("assignVoucher", args);
686
    }
687
 
688
    public Voucher recv_assignVoucher() throws org.apache.thrift.TException
689
    {
690
      assignVoucher_result result = new assignVoucher_result();
691
      receiveBase(result, "assignVoucher");
692
      if (result.isSetSuccess()) {
693
        return result.success;
694
      }
695
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "assignVoucher failed: unknown result");
696
    }
697
 
698
    public boolean markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException
699
    {
700
      send_markVoucherAsRedeemed(voucherCode, redeemedOn);
701
      return recv_markVoucherAsRedeemed();
702
    }
703
 
704
    public void send_markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException
705
    {
706
      markVoucherAsRedeemed_args args = new markVoucherAsRedeemed_args();
707
      args.setVoucherCode(voucherCode);
708
      args.setRedeemedOn(redeemedOn);
709
      sendBase("markVoucherAsRedeemed", args);
710
    }
711
 
712
    public boolean recv_markVoucherAsRedeemed() throws org.apache.thrift.TException
713
    {
714
      markVoucherAsRedeemed_result result = new markVoucherAsRedeemed_result();
715
      receiveBase(result, "markVoucherAsRedeemed");
716
      if (result.isSetSuccess()) {
717
        return result.success;
718
      }
719
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "markVoucherAsRedeemed failed: unknown result");
720
    }
721
 
1982 varun.gupt 722
  }
3430 rajveer 723
  public static class AsyncClient extends in.shop2020.generic.GenericService.AsyncClient implements AsyncIface {
724
    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
725
      private org.apache.thrift.async.TAsyncClientManager clientManager;
726
      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
727
      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
728
        this.clientManager = clientManager;
729
        this.protocolFactory = protocolFactory;
730
      }
731
      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
732
        return new AsyncClient(protocolFactory, clientManager, transport);
733
      }
1982 varun.gupt 734
    }
735
 
3430 rajveer 736
    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
737
      super(protocolFactory, clientManager, transport);
738
    }
1982 varun.gupt 739
 
3430 rajveer 740
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn, org.apache.thrift.async.AsyncMethodCallback<createPromotion_call> resultHandler) throws org.apache.thrift.TException {
741
      checkReady();
742
      createPromotion_call method_call = new createPromotion_call(name, ruleExecutionSrc, startOn, endOn, resultHandler, this, ___protocolFactory, ___transport);
743
      this.___currentMethod = method_call;
744
      ___manager.call(method_call);
1982 varun.gupt 745
    }
746
 
3430 rajveer 747
    public static class createPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
748
      private String name;
749
      private String ruleExecutionSrc;
750
      private long startOn;
751
      private long endOn;
752
      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 {
753
        super(client, protocolFactory, transport, resultHandler, false);
754
        this.name = name;
755
        this.ruleExecutionSrc = ruleExecutionSrc;
756
        this.startOn = startOn;
757
        this.endOn = endOn;
1982 varun.gupt 758
      }
759
 
3430 rajveer 760
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
761
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
1982 varun.gupt 762
        createPromotion_args args = new createPromotion_args();
3430 rajveer 763
        args.setName(name);
764
        args.setRuleExecutionSrc(ruleExecutionSrc);
765
        args.setStartOn(startOn);
766
        args.setEndOn(endOn);
767
        args.write(prot);
768
        prot.writeMessageEnd();
1982 varun.gupt 769
      }
770
 
3430 rajveer 771
      public void getResult() throws PromotionException, org.apache.thrift.TException {
772
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
773
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 774
        }
3430 rajveer 775
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
776
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
777
        (new Client(prot)).recv_createPromotion();
1982 varun.gupt 778
      }
3430 rajveer 779
    }
1982 varun.gupt 780
 
6301 amit.gupta 781
    public void getCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getCoupon_call> resultHandler) throws org.apache.thrift.TException {
782
      checkReady();
783
      getCoupon_call method_call = new getCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
784
      this.___currentMethod = method_call;
785
      ___manager.call(method_call);
786
    }
787
 
788
    public static class getCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
789
      private String couponCode;
790
      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 {
791
        super(client, protocolFactory, transport, resultHandler, false);
792
        this.couponCode = couponCode;
793
      }
794
 
795
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
796
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
797
        getCoupon_args args = new getCoupon_args();
798
        args.setCouponCode(couponCode);
799
        args.write(prot);
800
        prot.writeMessageEnd();
801
      }
802
 
803
      public Coupon getResult() throws PromotionException, org.apache.thrift.TException {
804
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
805
          throw new IllegalStateException("Method call not finished!");
806
        }
807
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
808
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
809
        return (new Client(prot)).recv_getCoupon();
810
      }
811
    }
812
 
813
    public void isGiftVoucher(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isGiftVoucher_call> resultHandler) throws org.apache.thrift.TException {
814
      checkReady();
815
      isGiftVoucher_call method_call = new isGiftVoucher_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
816
      this.___currentMethod = method_call;
817
      ___manager.call(method_call);
818
    }
819
 
820
    public static class isGiftVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
821
      private String couponCode;
822
      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 {
823
        super(client, protocolFactory, transport, resultHandler, false);
824
        this.couponCode = couponCode;
825
      }
826
 
827
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
828
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isGiftVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
829
        isGiftVoucher_args args = new isGiftVoucher_args();
830
        args.setCouponCode(couponCode);
831
        args.write(prot);
832
        prot.writeMessageEnd();
833
      }
834
 
835
      public boolean getResult() throws PromotionException, org.apache.thrift.TException {
836
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
837
          throw new IllegalStateException("Method call not finished!");
838
        }
839
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
840
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
841
        return (new Client(prot)).recv_isGiftVoucher();
842
      }
843
    }
844
 
6356 amit.gupta 845
    public void isCodApplicable(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isCodApplicable_call> resultHandler) throws org.apache.thrift.TException {
846
      checkReady();
847
      isCodApplicable_call method_call = new isCodApplicable_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
848
      this.___currentMethod = method_call;
849
      ___manager.call(method_call);
850
    }
851
 
852
    public static class isCodApplicable_call extends org.apache.thrift.async.TAsyncMethodCall {
853
      private String couponCode;
854
      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 {
855
        super(client, protocolFactory, transport, resultHandler, false);
856
        this.couponCode = couponCode;
857
      }
858
 
859
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
860
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isCodApplicable", org.apache.thrift.protocol.TMessageType.CALL, 0));
861
        isCodApplicable_args args = new isCodApplicable_args();
862
        args.setCouponCode(couponCode);
863
        args.write(prot);
864
        prot.writeMessageEnd();
865
      }
866
 
867
      public boolean getResult() throws PromotionException, org.apache.thrift.TException {
868
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
869
          throw new IllegalStateException("Method call not finished!");
870
        }
871
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
872
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
873
        return (new Client(prot)).recv_isCodApplicable();
874
      }
875
    }
876
 
3430 rajveer 877
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<getAllPromotions_call> resultHandler) throws org.apache.thrift.TException {
878
      checkReady();
879
      getAllPromotions_call method_call = new getAllPromotions_call(resultHandler, this, ___protocolFactory, ___transport);
880
      this.___currentMethod = method_call;
881
      ___manager.call(method_call);
1982 varun.gupt 882
    }
883
 
3430 rajveer 884
    public static class getAllPromotions_call extends org.apache.thrift.async.TAsyncMethodCall {
885
      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 {
886
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 887
      }
888
 
3430 rajveer 889
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
890
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllPromotions", org.apache.thrift.protocol.TMessageType.CALL, 0));
891
        getAllPromotions_args args = new getAllPromotions_args();
892
        args.write(prot);
893
        prot.writeMessageEnd();
894
      }
1982 varun.gupt 895
 
3430 rajveer 896
      public List<Promotion> getResult() throws PromotionException, org.apache.thrift.TException {
897
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
898
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 899
        }
3430 rajveer 900
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
901
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
902
        return (new Client(prot)).recv_getAllPromotions();
1982 varun.gupt 903
      }
3430 rajveer 904
    }
1982 varun.gupt 905
 
3430 rajveer 906
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getPromotionById_call> resultHandler) throws org.apache.thrift.TException {
907
      checkReady();
908
      getPromotionById_call method_call = new getPromotionById_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
909
      this.___currentMethod = method_call;
910
      ___manager.call(method_call);
1982 varun.gupt 911
    }
912
 
3430 rajveer 913
    public static class getPromotionById_call extends org.apache.thrift.async.TAsyncMethodCall {
914
      private long promotionId;
915
      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 {
916
        super(client, protocolFactory, transport, resultHandler, false);
917
        this.promotionId = promotionId;
1982 varun.gupt 918
      }
919
 
3430 rajveer 920
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
921
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPromotionById", org.apache.thrift.protocol.TMessageType.CALL, 0));
922
        getPromotionById_args args = new getPromotionById_args();
923
        args.setPromotionId(promotionId);
924
        args.write(prot);
925
        prot.writeMessageEnd();
926
      }
1982 varun.gupt 927
 
3430 rajveer 928
      public Promotion getResult() throws PromotionException, org.apache.thrift.TException {
929
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
930
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 931
        }
3430 rajveer 932
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
933
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
934
        return (new Client(prot)).recv_getPromotionById();
1982 varun.gupt 935
      }
3430 rajveer 936
    }
1982 varun.gupt 937
 
3430 rajveer 938
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException {
939
      checkReady();
940
      generateCouponsForPromotion_call method_call = new generateCouponsForPromotion_call(promotionId, couponCode, resultHandler, this, ___protocolFactory, ___transport);
941
      this.___currentMethod = method_call;
942
      ___manager.call(method_call);
1982 varun.gupt 943
    }
944
 
3430 rajveer 945
    public static class generateCouponsForPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
946
      private long promotionId;
947
      private String couponCode;
948
      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 {
949
        super(client, protocolFactory, transport, resultHandler, false);
950
        this.promotionId = promotionId;
951
        this.couponCode = couponCode;
1982 varun.gupt 952
      }
953
 
3430 rajveer 954
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
955
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("generateCouponsForPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
956
        generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
957
        args.setPromotionId(promotionId);
958
        args.setCouponCode(couponCode);
959
        args.write(prot);
960
        prot.writeMessageEnd();
3385 varun.gupt 961
      }
962
 
3430 rajveer 963
      public void getResult() throws PromotionException, org.apache.thrift.TException {
964
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
965
          throw new IllegalStateException("Method call not finished!");
3385 varun.gupt 966
        }
3430 rajveer 967
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
968
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
969
        (new Client(prot)).recv_generateCouponsForPromotion();
3385 varun.gupt 970
      }
971
    }
972
 
3430 rajveer 973
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<applyCoupon_call> resultHandler) throws org.apache.thrift.TException {
974
      checkReady();
975
      applyCoupon_call method_call = new applyCoupon_call(couponCode, cartId, resultHandler, this, ___protocolFactory, ___transport);
976
      this.___currentMethod = method_call;
977
      ___manager.call(method_call);
3385 varun.gupt 978
    }
979
 
3430 rajveer 980
    public static class applyCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
981
      private String couponCode;
982
      private long cartId;
983
      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 {
984
        super(client, protocolFactory, transport, resultHandler, false);
985
        this.couponCode = couponCode;
986
        this.cartId = cartId;
1982 varun.gupt 987
      }
988
 
3430 rajveer 989
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
990
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("applyCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
991
        applyCoupon_args args = new applyCoupon_args();
992
        args.setCouponCode(couponCode);
993
        args.setCartId(cartId);
994
        args.write(prot);
995
        prot.writeMessageEnd();
1982 varun.gupt 996
      }
997
 
3430 rajveer 998
      public Cart getResult() throws PromotionException, org.apache.thrift.TException {
999
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1000
          throw new IllegalStateException("Method call not finished!");
1001
        }
1002
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1003
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1004
        return (new Client(prot)).recv_applyCoupon();
1982 varun.gupt 1005
      }
3430 rajveer 1006
    }
1982 varun.gupt 1007
 
6433 anupam.sin 1008
    public void applyRechargeCoupon(String couponCode, long totalAmount, long userId, org.apache.thrift.async.AsyncMethodCallback<applyRechargeCoupon_call> resultHandler) throws org.apache.thrift.TException {
1009
      checkReady();
1010
      applyRechargeCoupon_call method_call = new applyRechargeCoupon_call(couponCode, totalAmount, userId, resultHandler, this, ___protocolFactory, ___transport);
1011
      this.___currentMethod = method_call;
1012
      ___manager.call(method_call);
1013
    }
1014
 
1015
    public static class applyRechargeCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1016
      private String couponCode;
1017
      private long totalAmount;
1018
      private long userId;
1019
      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 {
1020
        super(client, protocolFactory, transport, resultHandler, false);
1021
        this.couponCode = couponCode;
1022
        this.totalAmount = totalAmount;
1023
        this.userId = userId;
1024
      }
1025
 
1026
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1027
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("applyRechargeCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1028
        applyRechargeCoupon_args args = new applyRechargeCoupon_args();
1029
        args.setCouponCode(couponCode);
1030
        args.setTotalAmount(totalAmount);
1031
        args.setUserId(userId);
1032
        args.write(prot);
1033
        prot.writeMessageEnd();
1034
      }
1035
 
1036
      public Map<Long,String> getResult() throws PromotionException, org.apache.thrift.TException {
1037
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1038
          throw new IllegalStateException("Method call not finished!");
1039
        }
1040
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1041
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1042
        return (new Client(prot)).recv_applyRechargeCoupon();
1043
      }
1044
    }
1045
 
3430 rajveer 1046
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException {
1047
      checkReady();
1048
      trackCouponUsage_call method_call = new trackCouponUsage_call(couponCode, transactionId, userId, resultHandler, this, ___protocolFactory, ___transport);
1049
      this.___currentMethod = method_call;
1050
      ___manager.call(method_call);
1051
    }
1982 varun.gupt 1052
 
3430 rajveer 1053
    public static class trackCouponUsage_call extends org.apache.thrift.async.TAsyncMethodCall {
1054
      private String couponCode;
1055
      private long transactionId;
1056
      private long userId;
1057
      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 {
1058
        super(client, protocolFactory, transport, resultHandler, false);
1059
        this.couponCode = couponCode;
1060
        this.transactionId = transactionId;
1061
        this.userId = userId;
1982 varun.gupt 1062
      }
1063
 
3430 rajveer 1064
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1065
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("trackCouponUsage", org.apache.thrift.protocol.TMessageType.CALL, 0));
1066
        trackCouponUsage_args args = new trackCouponUsage_args();
1067
        args.setCouponCode(couponCode);
1068
        args.setTransactionId(transactionId);
1069
        args.setUserId(userId);
1070
        args.write(prot);
1071
        prot.writeMessageEnd();
1982 varun.gupt 1072
      }
1073
 
3430 rajveer 1074
      public void getResult() throws PromotionException, org.apache.thrift.TException {
1075
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1076
          throw new IllegalStateException("Method call not finished!");
1077
        }
1078
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1079
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1080
        (new Client(prot)).recv_trackCouponUsage();
1982 varun.gupt 1081
      }
1082
    }
1083
 
3430 rajveer 1084
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException {
1085
      checkReady();
1086
      getCouponUsageCountByUser_call method_call = new getCouponUsageCountByUser_call(couponCode, userId, resultHandler, this, ___protocolFactory, ___transport);
1087
      this.___currentMethod = method_call;
1088
      ___manager.call(method_call);
1982 varun.gupt 1089
    }
1090
 
3430 rajveer 1091
    public static class getCouponUsageCountByUser_call extends org.apache.thrift.async.TAsyncMethodCall {
1092
      private String couponCode;
1093
      private long userId;
1094
      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 {
1095
        super(client, protocolFactory, transport, resultHandler, false);
1096
        this.couponCode = couponCode;
1097
        this.userId = userId;
1098
      }
1982 varun.gupt 1099
 
3430 rajveer 1100
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1101
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCouponUsageCountByUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
1102
        getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
1103
        args.setCouponCode(couponCode);
1104
        args.setUserId(userId);
1105
        args.write(prot);
1106
        prot.writeMessageEnd();
1107
      }
1982 varun.gupt 1108
 
3430 rajveer 1109
      public long getResult() throws PromotionException, org.apache.thrift.TException {
1110
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1111
          throw new IllegalStateException("Method call not finished!");
1112
        }
1113
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1114
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1115
        return (new Client(prot)).recv_getCouponUsageCountByUser();
1116
      }
1982 varun.gupt 1117
    }
1118
 
6497 amit.gupta 1119
    public void getActiveCodes(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getActiveCodes_call> resultHandler) throws org.apache.thrift.TException {
1120
      checkReady();
1121
      getActiveCodes_call method_call = new getActiveCodes_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
1122
      this.___currentMethod = method_call;
1123
      ___manager.call(method_call);
1124
    }
1125
 
1126
    public static class getActiveCodes_call extends org.apache.thrift.async.TAsyncMethodCall {
1127
      private long promotionId;
1128
      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 {
1129
        super(client, protocolFactory, transport, resultHandler, false);
1130
        this.promotionId = promotionId;
1131
      }
1132
 
1133
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1134
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getActiveCodes", org.apache.thrift.protocol.TMessageType.CALL, 0));
1135
        getActiveCodes_args args = new getActiveCodes_args();
1136
        args.setPromotionId(promotionId);
1137
        args.write(prot);
1138
        prot.writeMessageEnd();
1139
      }
1140
 
1141
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
1142
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1143
          throw new IllegalStateException("Method call not finished!");
1144
        }
1145
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1146
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1147
        return (new Client(prot)).recv_getActiveCodes();
1148
      }
1149
    }
1150
 
1151
    public void deleteCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<deleteCoupon_call> resultHandler) throws org.apache.thrift.TException {
1152
      checkReady();
1153
      deleteCoupon_call method_call = new deleteCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
1154
      this.___currentMethod = method_call;
1155
      ___manager.call(method_call);
1156
    }
1157
 
1158
    public static class deleteCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1159
      private String couponCode;
1160
      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 {
1161
        super(client, protocolFactory, transport, resultHandler, false);
1162
        this.couponCode = couponCode;
1163
      }
1164
 
1165
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1166
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1167
        deleteCoupon_args args = new deleteCoupon_args();
1168
        args.setCouponCode(couponCode);
1169
        args.write(prot);
1170
        prot.writeMessageEnd();
1171
      }
1172
 
1173
      public void getResult() throws PromotionException, org.apache.thrift.TException {
1174
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1175
          throw new IllegalStateException("Method call not finished!");
1176
        }
1177
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1178
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1179
        (new Client(prot)).recv_deleteCoupon();
1180
      }
1181
    }
1182
 
3430 rajveer 1183
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException {
1184
      checkReady();
1185
      getActiveCoupons_call method_call = new getActiveCoupons_call(resultHandler, this, ___protocolFactory, ___transport);
1186
      this.___currentMethod = method_call;
1187
      ___manager.call(method_call);
1982 varun.gupt 1188
    }
1189
 
3430 rajveer 1190
    public static class getActiveCoupons_call extends org.apache.thrift.async.TAsyncMethodCall {
1191
      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 {
1192
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 1193
      }
1194
 
3430 rajveer 1195
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1196
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getActiveCoupons", org.apache.thrift.protocol.TMessageType.CALL, 0));
1197
        getActiveCoupons_args args = new getActiveCoupons_args();
1198
        args.write(prot);
1199
        prot.writeMessageEnd();
1200
      }
1982 varun.gupt 1201
 
3430 rajveer 1202
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
1203
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1204
          throw new IllegalStateException("Method call not finished!");
1205
        }
1206
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1207
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1208
        return (new Client(prot)).recv_getActiveCoupons();
1982 varun.gupt 1209
      }
1210
    }
1211
 
6679 anupam.sin 1212
    public void createCoupon(long promotionId, String arguments, boolean isCod, String prefix, org.apache.thrift.async.AsyncMethodCallback<createCoupon_call> resultHandler) throws org.apache.thrift.TException {
6250 amit.gupta 1213
      checkReady();
6679 anupam.sin 1214
      createCoupon_call method_call = new createCoupon_call(promotionId, arguments, isCod, prefix, resultHandler, this, ___protocolFactory, ___transport);
6250 amit.gupta 1215
      this.___currentMethod = method_call;
1216
      ___manager.call(method_call);
1217
    }
1218
 
1219
    public static class createCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1220
      private long promotionId;
6679 anupam.sin 1221
      private String arguments;
6356 amit.gupta 1222
      private boolean isCod;
6561 amit.gupta 1223
      private String prefix;
6679 anupam.sin 1224
      public createCoupon_call(long promotionId, 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 1225
        super(client, protocolFactory, transport, resultHandler, false);
1226
        this.promotionId = promotionId;
6679 anupam.sin 1227
        this.arguments = arguments;
6356 amit.gupta 1228
        this.isCod = isCod;
6561 amit.gupta 1229
        this.prefix = prefix;
6250 amit.gupta 1230
      }
1231
 
1232
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1233
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1234
        createCoupon_args args = new createCoupon_args();
1235
        args.setPromotionId(promotionId);
6679 anupam.sin 1236
        args.setArguments(arguments);
6356 amit.gupta 1237
        args.setIsCod(isCod);
6561 amit.gupta 1238
        args.setPrefix(prefix);
6250 amit.gupta 1239
        args.write(prot);
1240
        prot.writeMessageEnd();
1241
      }
1242
 
1243
      public String getResult() throws PromotionException, org.apache.thrift.TException {
1244
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1245
          throw new IllegalStateException("Method call not finished!");
1246
        }
1247
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1248
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1249
        return (new Client(prot)).recv_createCoupon();
1250
      }
1251
    }
1252
 
3430 rajveer 1253
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException {
1254
      checkReady();
1255
      getSuccessfulPaymentCountForCoupon_call method_call = new getSuccessfulPaymentCountForCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
1256
      this.___currentMethod = method_call;
1257
      ___manager.call(method_call);
1982 varun.gupt 1258
    }
1259
 
3430 rajveer 1260
    public static class getSuccessfulPaymentCountForCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1261
      private String couponCode;
1262
      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 {
1263
        super(client, protocolFactory, transport, resultHandler, false);
1264
        this.couponCode = couponCode;
1982 varun.gupt 1265
      }
1266
 
3430 rajveer 1267
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1268
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSuccessfulPaymentCountForCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1269
        getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
1270
        args.setCouponCode(couponCode);
1271
        args.write(prot);
1272
        prot.writeMessageEnd();
1273
      }
1982 varun.gupt 1274
 
3430 rajveer 1275
      public long getResult() throws PromotionException, org.apache.thrift.TException {
1276
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1277
          throw new IllegalStateException("Method call not finished!");
1278
        }
1279
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1280
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1281
        return (new Client(prot)).recv_getSuccessfulPaymentCountForCoupon();
1282
      }
1982 varun.gupt 1283
    }
1284
 
3430 rajveer 1285
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<getRuleDocString_call> resultHandler) throws org.apache.thrift.TException {
1286
      checkReady();
1287
      getRuleDocString_call method_call = new getRuleDocString_call(ruleName, resultHandler, this, ___protocolFactory, ___transport);
1288
      this.___currentMethod = method_call;
1289
      ___manager.call(method_call);
1982 varun.gupt 1290
    }
1291
 
3430 rajveer 1292
    public static class getRuleDocString_call extends org.apache.thrift.async.TAsyncMethodCall {
1293
      private String ruleName;
1294
      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 {
1295
        super(client, protocolFactory, transport, resultHandler, false);
1296
        this.ruleName = ruleName;
1297
      }
1982 varun.gupt 1298
 
3430 rajveer 1299
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1300
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRuleDocString", org.apache.thrift.protocol.TMessageType.CALL, 0));
1301
        getRuleDocString_args args = new getRuleDocString_args();
1302
        args.setRuleName(ruleName);
1303
        args.write(prot);
1304
        prot.writeMessageEnd();
1982 varun.gupt 1305
      }
1306
 
3430 rajveer 1307
      public String getResult() throws org.apache.thrift.TException {
1308
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1309
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 1310
        }
3430 rajveer 1311
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1312
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1313
        return (new Client(prot)).recv_getRuleDocString();
1982 varun.gupt 1314
      }
1315
    }
1316
 
4189 varun.gupt 1317
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException {
1318
      checkReady();
1319
      getItemDiscountMap_call method_call = new getItemDiscountMap_call(itemIds, resultHandler, this, ___protocolFactory, ___transport);
1320
      this.___currentMethod = method_call;
1321
      ___manager.call(method_call);
1322
    }
1323
 
1324
    public static class getItemDiscountMap_call extends org.apache.thrift.async.TAsyncMethodCall {
1325
      private List<Long> itemIds;
1326
      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 {
1327
        super(client, protocolFactory, transport, resultHandler, false);
1328
        this.itemIds = itemIds;
1329
      }
1330
 
1331
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1332
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getItemDiscountMap", org.apache.thrift.protocol.TMessageType.CALL, 0));
1333
        getItemDiscountMap_args args = new getItemDiscountMap_args();
1334
        args.setItemIds(itemIds);
1335
        args.write(prot);
1336
        prot.writeMessageEnd();
1337
      }
1338
 
1339
      public List<ItemCouponDiscount> getResult() throws PromotionException, org.apache.thrift.TException {
1340
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1341
          throw new IllegalStateException("Method call not finished!");
1342
        }
1343
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1344
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1345
        return (new Client(prot)).recv_getItemDiscountMap();
1346
      }
1347
    }
1348
 
4494 varun.gupt 1349
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException {
1350
      checkReady();
1351
      getDiscountsForEntity_call method_call = new getDiscountsForEntity_call(entityId, resultHandler, this, ___protocolFactory, ___transport);
1352
      this.___currentMethod = method_call;
1353
      ___manager.call(method_call);
1354
    }
1355
 
1356
    public static class getDiscountsForEntity_call extends org.apache.thrift.async.TAsyncMethodCall {
1357
      private long entityId;
1358
      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 {
1359
        super(client, protocolFactory, transport, resultHandler, false);
1360
        this.entityId = entityId;
1361
      }
1362
 
1363
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1364
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getDiscountsForEntity", org.apache.thrift.protocol.TMessageType.CALL, 0));
1365
        getDiscountsForEntity_args args = new getDiscountsForEntity_args();
1366
        args.setEntityId(entityId);
1367
        args.write(prot);
1368
        prot.writeMessageEnd();
1369
      }
1370
 
1371
      public Map<String,Double> getResult() throws org.apache.thrift.TException {
1372
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1373
          throw new IllegalStateException("Method call not finished!");
1374
        }
1375
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1376
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1377
        return (new Client(prot)).recv_getDiscountsForEntity();
1378
      }
1379
    }
1380
 
5469 rajveer 1381
    public void addVoucher(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<addVoucher_call> resultHandler) throws org.apache.thrift.TException {
1382
      checkReady();
1383
      addVoucher_call method_call = new addVoucher_call(voucher, resultHandler, this, ___protocolFactory, ___transport);
1384
      this.___currentMethod = method_call;
1385
      ___manager.call(method_call);
1386
    }
1387
 
1388
    public static class addVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
1389
      private Voucher voucher;
1390
      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 {
1391
        super(client, protocolFactory, transport, resultHandler, false);
1392
        this.voucher = voucher;
1393
      }
1394
 
1395
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1396
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
1397
        addVoucher_args args = new addVoucher_args();
1398
        args.setVoucher(voucher);
1399
        args.write(prot);
1400
        prot.writeMessageEnd();
1401
      }
1402
 
1403
      public void getResult() throws org.apache.thrift.TException {
1404
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1405
          throw new IllegalStateException("Method call not finished!");
1406
        }
1407
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1408
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1409
        (new Client(prot)).recv_addVoucher();
1410
      }
1411
    }
1412
 
1413
    public void assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount, org.apache.thrift.async.AsyncMethodCallback<assignVoucher_call> resultHandler) throws org.apache.thrift.TException {
1414
      checkReady();
1415
      assignVoucher_call method_call = new assignVoucher_call(userId, userEmail, voucherType, amount, resultHandler, this, ___protocolFactory, ___transport);
1416
      this.___currentMethod = method_call;
1417
      ___manager.call(method_call);
1418
    }
1419
 
1420
    public static class assignVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
1421
      private long userId;
1422
      private String userEmail;
1423
      private VoucherType voucherType;
1424
      private long amount;
1425
      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 {
1426
        super(client, protocolFactory, transport, resultHandler, false);
1427
        this.userId = userId;
1428
        this.userEmail = userEmail;
1429
        this.voucherType = voucherType;
1430
        this.amount = amount;
1431
      }
1432
 
1433
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1434
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("assignVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
1435
        assignVoucher_args args = new assignVoucher_args();
1436
        args.setUserId(userId);
1437
        args.setUserEmail(userEmail);
1438
        args.setVoucherType(voucherType);
1439
        args.setAmount(amount);
1440
        args.write(prot);
1441
        prot.writeMessageEnd();
1442
      }
1443
 
1444
      public Voucher getResult() throws org.apache.thrift.TException {
1445
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1446
          throw new IllegalStateException("Method call not finished!");
1447
        }
1448
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1449
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1450
        return (new Client(prot)).recv_assignVoucher();
1451
      }
1452
    }
1453
 
1454
    public void markVoucherAsRedeemed(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<markVoucherAsRedeemed_call> resultHandler) throws org.apache.thrift.TException {
1455
      checkReady();
1456
      markVoucherAsRedeemed_call method_call = new markVoucherAsRedeemed_call(voucherCode, redeemedOn, resultHandler, this, ___protocolFactory, ___transport);
1457
      this.___currentMethod = method_call;
1458
      ___manager.call(method_call);
1459
    }
1460
 
1461
    public static class markVoucherAsRedeemed_call extends org.apache.thrift.async.TAsyncMethodCall {
1462
      private String voucherCode;
1463
      private long redeemedOn;
1464
      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 {
1465
        super(client, protocolFactory, transport, resultHandler, false);
1466
        this.voucherCode = voucherCode;
1467
        this.redeemedOn = redeemedOn;
1468
      }
1469
 
1470
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1471
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("markVoucherAsRedeemed", org.apache.thrift.protocol.TMessageType.CALL, 0));
1472
        markVoucherAsRedeemed_args args = new markVoucherAsRedeemed_args();
1473
        args.setVoucherCode(voucherCode);
1474
        args.setRedeemedOn(redeemedOn);
1475
        args.write(prot);
1476
        prot.writeMessageEnd();
1477
      }
1478
 
1479
      public boolean getResult() throws org.apache.thrift.TException {
1480
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1481
          throw new IllegalStateException("Method call not finished!");
1482
        }
1483
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1484
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1485
        return (new Client(prot)).recv_markVoucherAsRedeemed();
1486
      }
1487
    }
1488
 
3430 rajveer 1489
  }
1982 varun.gupt 1490
 
3430 rajveer 1491
  public static class Processor<I extends Iface> extends in.shop2020.generic.GenericService.Processor implements org.apache.thrift.TProcessor {
1492
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
1493
    public Processor(I iface) {
1494
      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
1982 varun.gupt 1495
    }
1496
 
3430 rajveer 1497
    protected Processor(I iface, Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
1498
      super(iface, getProcessMap(processMap));
1982 varun.gupt 1499
    }
1500
 
3430 rajveer 1501
    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) {
1502
      processMap.put("createPromotion", new createPromotion());
6301 amit.gupta 1503
      processMap.put("getCoupon", new getCoupon());
1504
      processMap.put("isGiftVoucher", new isGiftVoucher());
6356 amit.gupta 1505
      processMap.put("isCodApplicable", new isCodApplicable());
3430 rajveer 1506
      processMap.put("getAllPromotions", new getAllPromotions());
1507
      processMap.put("getPromotionById", new getPromotionById());
1508
      processMap.put("generateCouponsForPromotion", new generateCouponsForPromotion());
1509
      processMap.put("applyCoupon", new applyCoupon());
6433 anupam.sin 1510
      processMap.put("applyRechargeCoupon", new applyRechargeCoupon());
3430 rajveer 1511
      processMap.put("trackCouponUsage", new trackCouponUsage());
1512
      processMap.put("getCouponUsageCountByUser", new getCouponUsageCountByUser());
6497 amit.gupta 1513
      processMap.put("getActiveCodes", new getActiveCodes());
1514
      processMap.put("deleteCoupon", new deleteCoupon());
3430 rajveer 1515
      processMap.put("getActiveCoupons", new getActiveCoupons());
6250 amit.gupta 1516
      processMap.put("createCoupon", new createCoupon());
3430 rajveer 1517
      processMap.put("getSuccessfulPaymentCountForCoupon", new getSuccessfulPaymentCountForCoupon());
1518
      processMap.put("getRuleDocString", new getRuleDocString());
4189 varun.gupt 1519
      processMap.put("getItemDiscountMap", new getItemDiscountMap());
4494 varun.gupt 1520
      processMap.put("getDiscountsForEntity", new getDiscountsForEntity());
5469 rajveer 1521
      processMap.put("addVoucher", new addVoucher());
1522
      processMap.put("assignVoucher", new assignVoucher());
1523
      processMap.put("markVoucherAsRedeemed", new markVoucherAsRedeemed());
3430 rajveer 1524
      return processMap;
1982 varun.gupt 1525
    }
1526
 
3430 rajveer 1527
    private static class createPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createPromotion_args> {
1528
      public createPromotion() {
1529
        super("createPromotion");
1530
      }
1982 varun.gupt 1531
 
3430 rajveer 1532
      protected createPromotion_args getEmptyArgsInstance() {
1533
        return new createPromotion_args();
1534
      }
1982 varun.gupt 1535
 
3430 rajveer 1536
      protected createPromotion_result getResult(I iface, createPromotion_args args) throws org.apache.thrift.TException {
1537
        createPromotion_result result = new createPromotion_result();
1538
        try {
1539
          iface.createPromotion(args.name, args.ruleExecutionSrc, args.startOn, args.endOn);
1540
        } catch (PromotionException pex) {
1541
          result.pex = pex;
1982 varun.gupt 1542
        }
3430 rajveer 1543
        return result;
1982 varun.gupt 1544
      }
3430 rajveer 1545
    }
1982 varun.gupt 1546
 
6301 amit.gupta 1547
    private static class getCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCoupon_args> {
1548
      public getCoupon() {
1549
        super("getCoupon");
1550
      }
1551
 
1552
      protected getCoupon_args getEmptyArgsInstance() {
1553
        return new getCoupon_args();
1554
      }
1555
 
1556
      protected getCoupon_result getResult(I iface, getCoupon_args args) throws org.apache.thrift.TException {
1557
        getCoupon_result result = new getCoupon_result();
1558
        try {
1559
          result.success = iface.getCoupon(args.couponCode);
1560
        } catch (PromotionException pex) {
1561
          result.pex = pex;
1562
        }
1563
        return result;
1564
      }
1565
    }
1566
 
1567
    private static class isGiftVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isGiftVoucher_args> {
1568
      public isGiftVoucher() {
1569
        super("isGiftVoucher");
1570
      }
1571
 
1572
      protected isGiftVoucher_args getEmptyArgsInstance() {
1573
        return new isGiftVoucher_args();
1574
      }
1575
 
1576
      protected isGiftVoucher_result getResult(I iface, isGiftVoucher_args args) throws org.apache.thrift.TException {
1577
        isGiftVoucher_result result = new isGiftVoucher_result();
1578
        try {
1579
          result.success = iface.isGiftVoucher(args.couponCode);
1580
          result.setSuccessIsSet(true);
1581
        } catch (PromotionException pex) {
1582
          result.pex = pex;
1583
        }
1584
        return result;
1585
      }
1586
    }
1587
 
6356 amit.gupta 1588
    private static class isCodApplicable<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isCodApplicable_args> {
1589
      public isCodApplicable() {
1590
        super("isCodApplicable");
1591
      }
1592
 
1593
      protected isCodApplicable_args getEmptyArgsInstance() {
1594
        return new isCodApplicable_args();
1595
      }
1596
 
1597
      protected isCodApplicable_result getResult(I iface, isCodApplicable_args args) throws org.apache.thrift.TException {
1598
        isCodApplicable_result result = new isCodApplicable_result();
1599
        try {
1600
          result.success = iface.isCodApplicable(args.couponCode);
1601
          result.setSuccessIsSet(true);
1602
        } catch (PromotionException pex) {
1603
          result.pex = pex;
1604
        }
1605
        return result;
1606
      }
1607
    }
1608
 
3430 rajveer 1609
    private static class getAllPromotions<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllPromotions_args> {
1610
      public getAllPromotions() {
1611
        super("getAllPromotions");
1982 varun.gupt 1612
      }
1613
 
3430 rajveer 1614
      protected getAllPromotions_args getEmptyArgsInstance() {
1615
        return new getAllPromotions_args();
1982 varun.gupt 1616
      }
1617
 
3430 rajveer 1618
      protected getAllPromotions_result getResult(I iface, getAllPromotions_args args) throws org.apache.thrift.TException {
1619
        getAllPromotions_result result = new getAllPromotions_result();
1620
        try {
1621
          result.success = iface.getAllPromotions();
1622
        } catch (PromotionException pex) {
1623
          result.pex = pex;
1624
        }
1625
        return result;
1982 varun.gupt 1626
      }
3430 rajveer 1627
    }
1982 varun.gupt 1628
 
3430 rajveer 1629
    private static class getPromotionById<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPromotionById_args> {
1630
      public getPromotionById() {
1631
        super("getPromotionById");
1982 varun.gupt 1632
      }
1633
 
3430 rajveer 1634
      protected getPromotionById_args getEmptyArgsInstance() {
1635
        return new getPromotionById_args();
1982 varun.gupt 1636
      }
1637
 
3430 rajveer 1638
      protected getPromotionById_result getResult(I iface, getPromotionById_args args) throws org.apache.thrift.TException {
1639
        getPromotionById_result result = new getPromotionById_result();
1640
        try {
1641
          result.success = iface.getPromotionById(args.promotionId);
1642
        } catch (PromotionException pex) {
1643
          result.pex = pex;
1644
        }
1645
        return result;
1982 varun.gupt 1646
      }
1647
    }
1648
 
3430 rajveer 1649
    private static class generateCouponsForPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, generateCouponsForPromotion_args> {
1650
      public generateCouponsForPromotion() {
1651
        super("generateCouponsForPromotion");
1652
      }
1982 varun.gupt 1653
 
3430 rajveer 1654
      protected generateCouponsForPromotion_args getEmptyArgsInstance() {
1655
        return new generateCouponsForPromotion_args();
1656
      }
1982 varun.gupt 1657
 
3430 rajveer 1658
      protected generateCouponsForPromotion_result getResult(I iface, generateCouponsForPromotion_args args) throws org.apache.thrift.TException {
1659
        generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
1660
        try {
1661
          iface.generateCouponsForPromotion(args.promotionId, args.couponCode);
1662
        } catch (PromotionException pex) {
1663
          result.pex = pex;
1664
        }
1665
        return result;
1666
      }
1982 varun.gupt 1667
    }
1668
 
3430 rajveer 1669
    private static class applyCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, applyCoupon_args> {
1670
      public applyCoupon() {
1671
        super("applyCoupon");
1672
      }
1982 varun.gupt 1673
 
3430 rajveer 1674
      protected applyCoupon_args getEmptyArgsInstance() {
1675
        return new applyCoupon_args();
1676
      }
1982 varun.gupt 1677
 
3430 rajveer 1678
      protected applyCoupon_result getResult(I iface, applyCoupon_args args) throws org.apache.thrift.TException {
1679
        applyCoupon_result result = new applyCoupon_result();
1680
        try {
1681
          result.success = iface.applyCoupon(args.couponCode, args.cartId);
1682
        } catch (PromotionException pex) {
1683
          result.pex = pex;
1684
        }
1685
        return result;
1982 varun.gupt 1686
      }
1687
    }
1688
 
6433 anupam.sin 1689
    private static class applyRechargeCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, applyRechargeCoupon_args> {
1690
      public applyRechargeCoupon() {
1691
        super("applyRechargeCoupon");
1692
      }
1693
 
1694
      protected applyRechargeCoupon_args getEmptyArgsInstance() {
1695
        return new applyRechargeCoupon_args();
1696
      }
1697
 
1698
      protected applyRechargeCoupon_result getResult(I iface, applyRechargeCoupon_args args) throws org.apache.thrift.TException {
1699
        applyRechargeCoupon_result result = new applyRechargeCoupon_result();
1700
        try {
1701
          result.success = iface.applyRechargeCoupon(args.couponCode, args.totalAmount, args.userId);
1702
        } catch (PromotionException pex) {
1703
          result.pex = pex;
1704
        }
1705
        return result;
1706
      }
1707
    }
1708
 
3430 rajveer 1709
    private static class trackCouponUsage<I extends Iface> extends org.apache.thrift.ProcessFunction<I, trackCouponUsage_args> {
1710
      public trackCouponUsage() {
1711
        super("trackCouponUsage");
1712
      }
1982 varun.gupt 1713
 
3430 rajveer 1714
      protected trackCouponUsage_args getEmptyArgsInstance() {
1715
        return new trackCouponUsage_args();
1982 varun.gupt 1716
      }
1717
 
3430 rajveer 1718
      protected trackCouponUsage_result getResult(I iface, trackCouponUsage_args args) throws org.apache.thrift.TException {
1719
        trackCouponUsage_result result = new trackCouponUsage_result();
1720
        try {
1721
          iface.trackCouponUsage(args.couponCode, args.transactionId, args.userId);
1722
        } catch (PromotionException pex) {
1723
          result.pex = pex;
1724
        }
1725
        return result;
1726
      }
1982 varun.gupt 1727
    }
1728
 
3430 rajveer 1729
    private static class getCouponUsageCountByUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCouponUsageCountByUser_args> {
1730
      public getCouponUsageCountByUser() {
1731
        super("getCouponUsageCountByUser");
1982 varun.gupt 1732
      }
1733
 
3430 rajveer 1734
      protected getCouponUsageCountByUser_args getEmptyArgsInstance() {
1735
        return new getCouponUsageCountByUser_args();
1736
      }
1982 varun.gupt 1737
 
3430 rajveer 1738
      protected getCouponUsageCountByUser_result getResult(I iface, getCouponUsageCountByUser_args args) throws org.apache.thrift.TException {
1739
        getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
1740
        try {
1741
          result.success = iface.getCouponUsageCountByUser(args.couponCode, args.userId);
1742
          result.setSuccessIsSet(true);
1743
        } catch (PromotionException pex) {
1744
          result.pex = pex;
1745
        }
1746
        return result;
1747
      }
1982 varun.gupt 1748
    }
1749
 
6497 amit.gupta 1750
    private static class getActiveCodes<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getActiveCodes_args> {
1751
      public getActiveCodes() {
1752
        super("getActiveCodes");
1753
      }
1754
 
1755
      protected getActiveCodes_args getEmptyArgsInstance() {
1756
        return new getActiveCodes_args();
1757
      }
1758
 
1759
      protected getActiveCodes_result getResult(I iface, getActiveCodes_args args) throws org.apache.thrift.TException {
1760
        getActiveCodes_result result = new getActiveCodes_result();
1761
        try {
1762
          result.success = iface.getActiveCodes(args.promotionId);
1763
        } catch (PromotionException pex) {
1764
          result.pex = pex;
1765
        }
1766
        return result;
1767
      }
1768
    }
1769
 
1770
    private static class deleteCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, deleteCoupon_args> {
1771
      public deleteCoupon() {
1772
        super("deleteCoupon");
1773
      }
1774
 
1775
      protected deleteCoupon_args getEmptyArgsInstance() {
1776
        return new deleteCoupon_args();
1777
      }
1778
 
1779
      protected deleteCoupon_result getResult(I iface, deleteCoupon_args args) throws org.apache.thrift.TException {
1780
        deleteCoupon_result result = new deleteCoupon_result();
1781
        try {
1782
          iface.deleteCoupon(args.couponCode);
1783
        } catch (PromotionException pex) {
1784
          result.pex = pex;
1785
        }
1786
        return result;
1787
      }
1788
    }
1789
 
3430 rajveer 1790
    private static class getActiveCoupons<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getActiveCoupons_args> {
1791
      public getActiveCoupons() {
1792
        super("getActiveCoupons");
1793
      }
1982 varun.gupt 1794
 
3430 rajveer 1795
      protected getActiveCoupons_args getEmptyArgsInstance() {
1796
        return new getActiveCoupons_args();
1797
      }
1982 varun.gupt 1798
 
3430 rajveer 1799
      protected getActiveCoupons_result getResult(I iface, getActiveCoupons_args args) throws org.apache.thrift.TException {
1800
        getActiveCoupons_result result = new getActiveCoupons_result();
1801
        try {
1802
          result.success = iface.getActiveCoupons();
1803
        } catch (PromotionException pex) {
1804
          result.pex = pex;
1805
        }
1806
        return result;
1807
      }
1982 varun.gupt 1808
    }
1809
 
6250 amit.gupta 1810
    private static class createCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createCoupon_args> {
1811
      public createCoupon() {
1812
        super("createCoupon");
1813
      }
1814
 
1815
      protected createCoupon_args getEmptyArgsInstance() {
1816
        return new createCoupon_args();
1817
      }
1818
 
1819
      protected createCoupon_result getResult(I iface, createCoupon_args args) throws org.apache.thrift.TException {
1820
        createCoupon_result result = new createCoupon_result();
1821
        try {
6679 anupam.sin 1822
          result.success = iface.createCoupon(args.promotionId, args.arguments, args.isCod, args.prefix);
6250 amit.gupta 1823
        } catch (PromotionException pex) {
1824
          result.pex = pex;
1825
        }
1826
        return result;
1827
      }
1828
    }
1829
 
3430 rajveer 1830
    private static class getSuccessfulPaymentCountForCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSuccessfulPaymentCountForCoupon_args> {
1831
      public getSuccessfulPaymentCountForCoupon() {
1832
        super("getSuccessfulPaymentCountForCoupon");
1982 varun.gupt 1833
      }
1834
 
3430 rajveer 1835
      protected getSuccessfulPaymentCountForCoupon_args getEmptyArgsInstance() {
1836
        return new getSuccessfulPaymentCountForCoupon_args();
1837
      }
1982 varun.gupt 1838
 
3430 rajveer 1839
      protected getSuccessfulPaymentCountForCoupon_result getResult(I iface, getSuccessfulPaymentCountForCoupon_args args) throws org.apache.thrift.TException {
1840
        getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
1841
        try {
1842
          result.success = iface.getSuccessfulPaymentCountForCoupon(args.couponCode);
1843
          result.setSuccessIsSet(true);
1844
        } catch (PromotionException pex) {
1845
          result.pex = pex;
1982 varun.gupt 1846
        }
3430 rajveer 1847
        return result;
1982 varun.gupt 1848
      }
1849
    }
1850
 
3430 rajveer 1851
    private static class getRuleDocString<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getRuleDocString_args> {
1852
      public getRuleDocString() {
1853
        super("getRuleDocString");
1854
      }
1982 varun.gupt 1855
 
3430 rajveer 1856
      protected getRuleDocString_args getEmptyArgsInstance() {
1857
        return new getRuleDocString_args();
1858
      }
1982 varun.gupt 1859
 
3430 rajveer 1860
      protected getRuleDocString_result getResult(I iface, getRuleDocString_args args) throws org.apache.thrift.TException {
1861
        getRuleDocString_result result = new getRuleDocString_result();
1862
        result.success = iface.getRuleDocString(args.ruleName);
1863
        return result;
1864
      }
1982 varun.gupt 1865
    }
1866
 
4189 varun.gupt 1867
    private static class getItemDiscountMap<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getItemDiscountMap_args> {
1868
      public getItemDiscountMap() {
1869
        super("getItemDiscountMap");
1870
      }
1871
 
1872
      protected getItemDiscountMap_args getEmptyArgsInstance() {
1873
        return new getItemDiscountMap_args();
1874
      }
1875
 
1876
      protected getItemDiscountMap_result getResult(I iface, getItemDiscountMap_args args) throws org.apache.thrift.TException {
1877
        getItemDiscountMap_result result = new getItemDiscountMap_result();
1878
        try {
1879
          result.success = iface.getItemDiscountMap(args.itemIds);
1880
        } catch (PromotionException pex) {
1881
          result.pex = pex;
1882
        }
1883
        return result;
1884
      }
1885
    }
1886
 
4494 varun.gupt 1887
    private static class getDiscountsForEntity<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getDiscountsForEntity_args> {
1888
      public getDiscountsForEntity() {
1889
        super("getDiscountsForEntity");
1890
      }
1891
 
1892
      protected getDiscountsForEntity_args getEmptyArgsInstance() {
1893
        return new getDiscountsForEntity_args();
1894
      }
1895
 
1896
      protected getDiscountsForEntity_result getResult(I iface, getDiscountsForEntity_args args) throws org.apache.thrift.TException {
1897
        getDiscountsForEntity_result result = new getDiscountsForEntity_result();
1898
        result.success = iface.getDiscountsForEntity(args.entityId);
1899
        return result;
1900
      }
1901
    }
1902
 
5469 rajveer 1903
    private static class addVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addVoucher_args> {
1904
      public addVoucher() {
1905
        super("addVoucher");
1906
      }
1907
 
1908
      protected addVoucher_args getEmptyArgsInstance() {
1909
        return new addVoucher_args();
1910
      }
1911
 
1912
      protected addVoucher_result getResult(I iface, addVoucher_args args) throws org.apache.thrift.TException {
1913
        addVoucher_result result = new addVoucher_result();
1914
        iface.addVoucher(args.voucher);
1915
        return result;
1916
      }
1917
    }
1918
 
1919
    private static class assignVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, assignVoucher_args> {
1920
      public assignVoucher() {
1921
        super("assignVoucher");
1922
      }
1923
 
1924
      protected assignVoucher_args getEmptyArgsInstance() {
1925
        return new assignVoucher_args();
1926
      }
1927
 
1928
      protected assignVoucher_result getResult(I iface, assignVoucher_args args) throws org.apache.thrift.TException {
1929
        assignVoucher_result result = new assignVoucher_result();
1930
        result.success = iface.assignVoucher(args.userId, args.userEmail, args.voucherType, args.amount);
1931
        return result;
1932
      }
1933
    }
1934
 
1935
    private static class markVoucherAsRedeemed<I extends Iface> extends org.apache.thrift.ProcessFunction<I, markVoucherAsRedeemed_args> {
1936
      public markVoucherAsRedeemed() {
1937
        super("markVoucherAsRedeemed");
1938
      }
1939
 
1940
      protected markVoucherAsRedeemed_args getEmptyArgsInstance() {
1941
        return new markVoucherAsRedeemed_args();
1942
      }
1943
 
1944
      protected markVoucherAsRedeemed_result getResult(I iface, markVoucherAsRedeemed_args args) throws org.apache.thrift.TException {
1945
        markVoucherAsRedeemed_result result = new markVoucherAsRedeemed_result();
1946
        result.success = iface.markVoucherAsRedeemed(args.voucherCode, args.redeemedOn);
1947
        result.setSuccessIsSet(true);
1948
        return result;
1949
      }
1950
    }
1951
 
1982 varun.gupt 1952
  }
1953
 
3430 rajveer 1954
  public static class createPromotion_args implements org.apache.thrift.TBase<createPromotion_args, createPromotion_args._Fields>, java.io.Serializable, Cloneable   {
1955
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_args");
1982 varun.gupt 1956
 
3430 rajveer 1957
    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);
1958
    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);
1959
    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);
1960
    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 1961
 
3430 rajveer 1962
    private String name; // required
1963
    private String ruleExecutionSrc; // required
1964
    private long startOn; // required
1965
    private long endOn; // required
1982 varun.gupt 1966
 
1967
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 1968
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 1969
      NAME((short)1, "name"),
1970
      RULE_EXECUTION_SRC((short)2, "ruleExecutionSrc"),
1971
      START_ON((short)3, "startOn"),
1972
      END_ON((short)4, "endOn");
1973
 
1974
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
1975
 
1976
      static {
1977
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1978
          byName.put(field.getFieldName(), field);
1979
        }
1980
      }
1981
 
1982
      /**
1983
       * Find the _Fields constant that matches fieldId, or null if its not found.
1984
       */
1985
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 1986
        switch(fieldId) {
1987
          case 1: // NAME
1988
            return NAME;
1989
          case 2: // RULE_EXECUTION_SRC
1990
            return RULE_EXECUTION_SRC;
1991
          case 3: // START_ON
1992
            return START_ON;
1993
          case 4: // END_ON
1994
            return END_ON;
1995
          default:
1996
            return null;
1997
        }
1982 varun.gupt 1998
      }
1999
 
2000
      /**
2001
       * Find the _Fields constant that matches fieldId, throwing an exception
2002
       * if it is not found.
2003
       */
2004
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2005
        _Fields fields = findByThriftId(fieldId);
2006
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2007
        return fields;
2008
      }
2009
 
2010
      /**
2011
       * Find the _Fields constant that matches name, or null if its not found.
2012
       */
2013
      public static _Fields findByName(String name) {
2014
        return byName.get(name);
2015
      }
2016
 
2017
      private final short _thriftId;
2018
      private final String _fieldName;
2019
 
2020
      _Fields(short thriftId, String fieldName) {
2021
        _thriftId = thriftId;
2022
        _fieldName = fieldName;
2023
      }
2024
 
2025
      public short getThriftFieldId() {
2026
        return _thriftId;
2027
      }
2028
 
2029
      public String getFieldName() {
2030
        return _fieldName;
2031
      }
2032
    }
2033
 
2034
    // isset id assignments
2035
    private static final int __STARTON_ISSET_ID = 0;
2036
    private static final int __ENDON_ISSET_ID = 1;
2037
    private BitSet __isset_bit_vector = new BitSet(2);
2038
 
3430 rajveer 2039
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2040
    static {
3430 rajveer 2041
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2042
      tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2043
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
2044
      tmpMap.put(_Fields.RULE_EXECUTION_SRC, new org.apache.thrift.meta_data.FieldMetaData("ruleExecutionSrc", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2045
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
2046
      tmpMap.put(_Fields.START_ON, new org.apache.thrift.meta_data.FieldMetaData("startOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2047
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
2048
      tmpMap.put(_Fields.END_ON, new org.apache.thrift.meta_data.FieldMetaData("endOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2049
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
2050
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2051
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_args.class, metaDataMap);
1982 varun.gupt 2052
    }
2053
 
2054
    public createPromotion_args() {
2055
    }
2056
 
2057
    public createPromotion_args(
2058
      String name,
2059
      String ruleExecutionSrc,
2060
      long startOn,
2061
      long endOn)
2062
    {
2063
      this();
2064
      this.name = name;
2065
      this.ruleExecutionSrc = ruleExecutionSrc;
2066
      this.startOn = startOn;
2067
      setStartOnIsSet(true);
2068
      this.endOn = endOn;
2069
      setEndOnIsSet(true);
2070
    }
2071
 
2072
    /**
2073
     * Performs a deep copy on <i>other</i>.
2074
     */
2075
    public createPromotion_args(createPromotion_args other) {
2076
      __isset_bit_vector.clear();
2077
      __isset_bit_vector.or(other.__isset_bit_vector);
2078
      if (other.isSetName()) {
2079
        this.name = other.name;
2080
      }
2081
      if (other.isSetRuleExecutionSrc()) {
2082
        this.ruleExecutionSrc = other.ruleExecutionSrc;
2083
      }
2084
      this.startOn = other.startOn;
2085
      this.endOn = other.endOn;
2086
    }
2087
 
2088
    public createPromotion_args deepCopy() {
2089
      return new createPromotion_args(this);
2090
    }
2091
 
3430 rajveer 2092
    @Override
2093
    public void clear() {
2094
      this.name = null;
2095
      this.ruleExecutionSrc = null;
2096
      setStartOnIsSet(false);
2097
      this.startOn = 0;
2098
      setEndOnIsSet(false);
2099
      this.endOn = 0;
1982 varun.gupt 2100
    }
2101
 
2102
    public String getName() {
2103
      return this.name;
2104
    }
2105
 
3430 rajveer 2106
    public void setName(String name) {
1982 varun.gupt 2107
      this.name = name;
2108
    }
2109
 
2110
    public void unsetName() {
2111
      this.name = null;
2112
    }
2113
 
3430 rajveer 2114
    /** Returns true if field name is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2115
    public boolean isSetName() {
2116
      return this.name != null;
2117
    }
2118
 
2119
    public void setNameIsSet(boolean value) {
2120
      if (!value) {
2121
        this.name = null;
2122
      }
2123
    }
2124
 
2125
    public String getRuleExecutionSrc() {
2126
      return this.ruleExecutionSrc;
2127
    }
2128
 
3430 rajveer 2129
    public void setRuleExecutionSrc(String ruleExecutionSrc) {
1982 varun.gupt 2130
      this.ruleExecutionSrc = ruleExecutionSrc;
2131
    }
2132
 
2133
    public void unsetRuleExecutionSrc() {
2134
      this.ruleExecutionSrc = null;
2135
    }
2136
 
3430 rajveer 2137
    /** Returns true if field ruleExecutionSrc is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2138
    public boolean isSetRuleExecutionSrc() {
2139
      return this.ruleExecutionSrc != null;
2140
    }
2141
 
2142
    public void setRuleExecutionSrcIsSet(boolean value) {
2143
      if (!value) {
2144
        this.ruleExecutionSrc = null;
2145
      }
2146
    }
2147
 
2148
    public long getStartOn() {
2149
      return this.startOn;
2150
    }
2151
 
3430 rajveer 2152
    public void setStartOn(long startOn) {
1982 varun.gupt 2153
      this.startOn = startOn;
2154
      setStartOnIsSet(true);
2155
    }
2156
 
2157
    public void unsetStartOn() {
2158
      __isset_bit_vector.clear(__STARTON_ISSET_ID);
2159
    }
2160
 
3430 rajveer 2161
    /** Returns true if field startOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2162
    public boolean isSetStartOn() {
2163
      return __isset_bit_vector.get(__STARTON_ISSET_ID);
2164
    }
2165
 
2166
    public void setStartOnIsSet(boolean value) {
2167
      __isset_bit_vector.set(__STARTON_ISSET_ID, value);
2168
    }
2169
 
2170
    public long getEndOn() {
2171
      return this.endOn;
2172
    }
2173
 
3430 rajveer 2174
    public void setEndOn(long endOn) {
1982 varun.gupt 2175
      this.endOn = endOn;
2176
      setEndOnIsSet(true);
2177
    }
2178
 
2179
    public void unsetEndOn() {
2180
      __isset_bit_vector.clear(__ENDON_ISSET_ID);
2181
    }
2182
 
3430 rajveer 2183
    /** Returns true if field endOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2184
    public boolean isSetEndOn() {
2185
      return __isset_bit_vector.get(__ENDON_ISSET_ID);
2186
    }
2187
 
2188
    public void setEndOnIsSet(boolean value) {
2189
      __isset_bit_vector.set(__ENDON_ISSET_ID, value);
2190
    }
2191
 
2192
    public void setFieldValue(_Fields field, Object value) {
2193
      switch (field) {
2194
      case NAME:
2195
        if (value == null) {
2196
          unsetName();
2197
        } else {
2198
          setName((String)value);
2199
        }
2200
        break;
2201
 
2202
      case RULE_EXECUTION_SRC:
2203
        if (value == null) {
2204
          unsetRuleExecutionSrc();
2205
        } else {
2206
          setRuleExecutionSrc((String)value);
2207
        }
2208
        break;
2209
 
2210
      case START_ON:
2211
        if (value == null) {
2212
          unsetStartOn();
2213
        } else {
2214
          setStartOn((Long)value);
2215
        }
2216
        break;
2217
 
2218
      case END_ON:
2219
        if (value == null) {
2220
          unsetEndOn();
2221
        } else {
2222
          setEndOn((Long)value);
2223
        }
2224
        break;
2225
 
2226
      }
2227
    }
2228
 
2229
    public Object getFieldValue(_Fields field) {
2230
      switch (field) {
2231
      case NAME:
2232
        return getName();
2233
 
2234
      case RULE_EXECUTION_SRC:
2235
        return getRuleExecutionSrc();
2236
 
2237
      case START_ON:
3430 rajveer 2238
        return Long.valueOf(getStartOn());
1982 varun.gupt 2239
 
2240
      case END_ON:
3430 rajveer 2241
        return Long.valueOf(getEndOn());
1982 varun.gupt 2242
 
2243
      }
2244
      throw new IllegalStateException();
2245
    }
2246
 
3430 rajveer 2247
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2248
    public boolean isSet(_Fields field) {
2249
      if (field == null) {
2250
        throw new IllegalArgumentException();
2251
      }
1982 varun.gupt 2252
 
2253
      switch (field) {
2254
      case NAME:
2255
        return isSetName();
2256
      case RULE_EXECUTION_SRC:
2257
        return isSetRuleExecutionSrc();
2258
      case START_ON:
2259
        return isSetStartOn();
2260
      case END_ON:
2261
        return isSetEndOn();
2262
      }
2263
      throw new IllegalStateException();
2264
    }
2265
 
2266
    @Override
2267
    public boolean equals(Object that) {
2268
      if (that == null)
2269
        return false;
2270
      if (that instanceof createPromotion_args)
2271
        return this.equals((createPromotion_args)that);
2272
      return false;
2273
    }
2274
 
2275
    public boolean equals(createPromotion_args that) {
2276
      if (that == null)
2277
        return false;
2278
 
2279
      boolean this_present_name = true && this.isSetName();
2280
      boolean that_present_name = true && that.isSetName();
2281
      if (this_present_name || that_present_name) {
2282
        if (!(this_present_name && that_present_name))
2283
          return false;
2284
        if (!this.name.equals(that.name))
2285
          return false;
2286
      }
2287
 
2288
      boolean this_present_ruleExecutionSrc = true && this.isSetRuleExecutionSrc();
2289
      boolean that_present_ruleExecutionSrc = true && that.isSetRuleExecutionSrc();
2290
      if (this_present_ruleExecutionSrc || that_present_ruleExecutionSrc) {
2291
        if (!(this_present_ruleExecutionSrc && that_present_ruleExecutionSrc))
2292
          return false;
2293
        if (!this.ruleExecutionSrc.equals(that.ruleExecutionSrc))
2294
          return false;
2295
      }
2296
 
2297
      boolean this_present_startOn = true;
2298
      boolean that_present_startOn = true;
2299
      if (this_present_startOn || that_present_startOn) {
2300
        if (!(this_present_startOn && that_present_startOn))
2301
          return false;
2302
        if (this.startOn != that.startOn)
2303
          return false;
2304
      }
2305
 
2306
      boolean this_present_endOn = true;
2307
      boolean that_present_endOn = true;
2308
      if (this_present_endOn || that_present_endOn) {
2309
        if (!(this_present_endOn && that_present_endOn))
2310
          return false;
2311
        if (this.endOn != that.endOn)
2312
          return false;
2313
      }
2314
 
2315
      return true;
2316
    }
2317
 
2318
    @Override
2319
    public int hashCode() {
2320
      return 0;
2321
    }
2322
 
2323
    public int compareTo(createPromotion_args other) {
2324
      if (!getClass().equals(other.getClass())) {
2325
        return getClass().getName().compareTo(other.getClass().getName());
2326
      }
2327
 
2328
      int lastComparison = 0;
2329
      createPromotion_args typedOther = (createPromotion_args)other;
2330
 
3430 rajveer 2331
      lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
1982 varun.gupt 2332
      if (lastComparison != 0) {
2333
        return lastComparison;
2334
      }
3430 rajveer 2335
      if (isSetName()) {
2336
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
2337
        if (lastComparison != 0) {
2338
          return lastComparison;
2339
        }
1982 varun.gupt 2340
      }
3430 rajveer 2341
      lastComparison = Boolean.valueOf(isSetRuleExecutionSrc()).compareTo(typedOther.isSetRuleExecutionSrc());
1982 varun.gupt 2342
      if (lastComparison != 0) {
2343
        return lastComparison;
2344
      }
3430 rajveer 2345
      if (isSetRuleExecutionSrc()) {
2346
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleExecutionSrc, typedOther.ruleExecutionSrc);
2347
        if (lastComparison != 0) {
2348
          return lastComparison;
2349
        }
1982 varun.gupt 2350
      }
3430 rajveer 2351
      lastComparison = Boolean.valueOf(isSetStartOn()).compareTo(typedOther.isSetStartOn());
1982 varun.gupt 2352
      if (lastComparison != 0) {
2353
        return lastComparison;
2354
      }
3430 rajveer 2355
      if (isSetStartOn()) {
2356
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startOn, typedOther.startOn);
2357
        if (lastComparison != 0) {
2358
          return lastComparison;
2359
        }
1982 varun.gupt 2360
      }
3430 rajveer 2361
      lastComparison = Boolean.valueOf(isSetEndOn()).compareTo(typedOther.isSetEndOn());
1982 varun.gupt 2362
      if (lastComparison != 0) {
2363
        return lastComparison;
2364
      }
3430 rajveer 2365
      if (isSetEndOn()) {
2366
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endOn, typedOther.endOn);
2367
        if (lastComparison != 0) {
2368
          return lastComparison;
2369
        }
1982 varun.gupt 2370
      }
2371
      return 0;
2372
    }
2373
 
3430 rajveer 2374
    public _Fields fieldForId(int fieldId) {
2375
      return _Fields.findByThriftId(fieldId);
2376
    }
2377
 
2378
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2379
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2380
      iprot.readStructBegin();
2381
      while (true)
2382
      {
2383
        field = iprot.readFieldBegin();
3430 rajveer 2384
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2385
          break;
2386
        }
3430 rajveer 2387
        switch (field.id) {
2388
          case 1: // NAME
2389
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
2390
              this.name = iprot.readString();
2391
            } else { 
2392
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2393
            }
2394
            break;
2395
          case 2: // RULE_EXECUTION_SRC
2396
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
2397
              this.ruleExecutionSrc = iprot.readString();
2398
            } else { 
2399
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2400
            }
2401
            break;
2402
          case 3: // START_ON
2403
            if (field.type == org.apache.thrift.protocol.TType.I64) {
2404
              this.startOn = iprot.readI64();
2405
              setStartOnIsSet(true);
2406
            } else { 
2407
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2408
            }
2409
            break;
2410
          case 4: // END_ON
2411
            if (field.type == org.apache.thrift.protocol.TType.I64) {
2412
              this.endOn = iprot.readI64();
2413
              setEndOnIsSet(true);
2414
            } else { 
2415
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2416
            }
2417
            break;
2418
          default:
2419
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2420
        }
3430 rajveer 2421
        iprot.readFieldEnd();
1982 varun.gupt 2422
      }
2423
      iprot.readStructEnd();
2424
      validate();
2425
    }
2426
 
3430 rajveer 2427
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2428
      validate();
2429
 
2430
      oprot.writeStructBegin(STRUCT_DESC);
2431
      if (this.name != null) {
2432
        oprot.writeFieldBegin(NAME_FIELD_DESC);
2433
        oprot.writeString(this.name);
2434
        oprot.writeFieldEnd();
2435
      }
2436
      if (this.ruleExecutionSrc != null) {
2437
        oprot.writeFieldBegin(RULE_EXECUTION_SRC_FIELD_DESC);
2438
        oprot.writeString(this.ruleExecutionSrc);
2439
        oprot.writeFieldEnd();
2440
      }
2441
      oprot.writeFieldBegin(START_ON_FIELD_DESC);
2442
      oprot.writeI64(this.startOn);
2443
      oprot.writeFieldEnd();
2444
      oprot.writeFieldBegin(END_ON_FIELD_DESC);
2445
      oprot.writeI64(this.endOn);
2446
      oprot.writeFieldEnd();
2447
      oprot.writeFieldStop();
2448
      oprot.writeStructEnd();
2449
    }
2450
 
2451
    @Override
2452
    public String toString() {
2453
      StringBuilder sb = new StringBuilder("createPromotion_args(");
2454
      boolean first = true;
2455
 
2456
      sb.append("name:");
2457
      if (this.name == null) {
2458
        sb.append("null");
2459
      } else {
2460
        sb.append(this.name);
2461
      }
2462
      first = false;
2463
      if (!first) sb.append(", ");
2464
      sb.append("ruleExecutionSrc:");
2465
      if (this.ruleExecutionSrc == null) {
2466
        sb.append("null");
2467
      } else {
2468
        sb.append(this.ruleExecutionSrc);
2469
      }
2470
      first = false;
2471
      if (!first) sb.append(", ");
2472
      sb.append("startOn:");
2473
      sb.append(this.startOn);
2474
      first = false;
2475
      if (!first) sb.append(", ");
2476
      sb.append("endOn:");
2477
      sb.append(this.endOn);
2478
      first = false;
2479
      sb.append(")");
2480
      return sb.toString();
2481
    }
2482
 
3430 rajveer 2483
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2484
      // check for required fields
2485
    }
2486
 
3430 rajveer 2487
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2488
      try {
2489
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2490
      } catch (org.apache.thrift.TException te) {
2491
        throw new java.io.IOException(te);
2492
      }
2493
    }
2494
 
2495
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2496
      try {
2497
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
2498
        __isset_bit_vector = new BitSet(1);
2499
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2500
      } catch (org.apache.thrift.TException te) {
2501
        throw new java.io.IOException(te);
2502
      }
2503
    }
2504
 
1982 varun.gupt 2505
  }
2506
 
3430 rajveer 2507
  public static class createPromotion_result implements org.apache.thrift.TBase<createPromotion_result, createPromotion_result._Fields>, java.io.Serializable, Cloneable   {
2508
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_result");
1982 varun.gupt 2509
 
3430 rajveer 2510
    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 2511
 
3430 rajveer 2512
    private PromotionException pex; // required
1982 varun.gupt 2513
 
2514
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2515
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2516
      PEX((short)1, "pex");
2517
 
2518
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2519
 
2520
      static {
2521
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2522
          byName.put(field.getFieldName(), field);
2523
        }
2524
      }
2525
 
2526
      /**
2527
       * Find the _Fields constant that matches fieldId, or null if its not found.
2528
       */
2529
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2530
        switch(fieldId) {
2531
          case 1: // PEX
2532
            return PEX;
2533
          default:
2534
            return null;
2535
        }
1982 varun.gupt 2536
      }
2537
 
2538
      /**
2539
       * Find the _Fields constant that matches fieldId, throwing an exception
2540
       * if it is not found.
2541
       */
2542
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2543
        _Fields fields = findByThriftId(fieldId);
2544
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2545
        return fields;
2546
      }
2547
 
2548
      /**
2549
       * Find the _Fields constant that matches name, or null if its not found.
2550
       */
2551
      public static _Fields findByName(String name) {
2552
        return byName.get(name);
2553
      }
2554
 
2555
      private final short _thriftId;
2556
      private final String _fieldName;
2557
 
2558
      _Fields(short thriftId, String fieldName) {
2559
        _thriftId = thriftId;
2560
        _fieldName = fieldName;
2561
      }
2562
 
2563
      public short getThriftFieldId() {
2564
        return _thriftId;
2565
      }
2566
 
2567
      public String getFieldName() {
2568
        return _fieldName;
2569
      }
2570
    }
2571
 
2572
    // isset id assignments
2573
 
3430 rajveer 2574
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2575
    static {
3430 rajveer 2576
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2577
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2578
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
2579
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2580
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_result.class, metaDataMap);
1982 varun.gupt 2581
    }
2582
 
2583
    public createPromotion_result() {
2584
    }
2585
 
2586
    public createPromotion_result(
2587
      PromotionException pex)
2588
    {
2589
      this();
2590
      this.pex = pex;
2591
    }
2592
 
2593
    /**
2594
     * Performs a deep copy on <i>other</i>.
2595
     */
2596
    public createPromotion_result(createPromotion_result other) {
2597
      if (other.isSetPex()) {
2598
        this.pex = new PromotionException(other.pex);
2599
      }
2600
    }
2601
 
2602
    public createPromotion_result deepCopy() {
2603
      return new createPromotion_result(this);
2604
    }
2605
 
3430 rajveer 2606
    @Override
2607
    public void clear() {
2608
      this.pex = null;
1982 varun.gupt 2609
    }
2610
 
2611
    public PromotionException getPex() {
2612
      return this.pex;
2613
    }
2614
 
3430 rajveer 2615
    public void setPex(PromotionException pex) {
1982 varun.gupt 2616
      this.pex = pex;
2617
    }
2618
 
2619
    public void unsetPex() {
2620
      this.pex = null;
2621
    }
2622
 
3430 rajveer 2623
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2624
    public boolean isSetPex() {
2625
      return this.pex != null;
2626
    }
2627
 
2628
    public void setPexIsSet(boolean value) {
2629
      if (!value) {
2630
        this.pex = null;
2631
      }
2632
    }
2633
 
2634
    public void setFieldValue(_Fields field, Object value) {
2635
      switch (field) {
2636
      case PEX:
2637
        if (value == null) {
2638
          unsetPex();
2639
        } else {
2640
          setPex((PromotionException)value);
2641
        }
2642
        break;
2643
 
2644
      }
2645
    }
2646
 
2647
    public Object getFieldValue(_Fields field) {
2648
      switch (field) {
2649
      case PEX:
2650
        return getPex();
2651
 
2652
      }
2653
      throw new IllegalStateException();
2654
    }
2655
 
3430 rajveer 2656
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2657
    public boolean isSet(_Fields field) {
2658
      if (field == null) {
2659
        throw new IllegalArgumentException();
2660
      }
1982 varun.gupt 2661
 
2662
      switch (field) {
2663
      case PEX:
2664
        return isSetPex();
2665
      }
2666
      throw new IllegalStateException();
2667
    }
2668
 
2669
    @Override
2670
    public boolean equals(Object that) {
2671
      if (that == null)
2672
        return false;
2673
      if (that instanceof createPromotion_result)
2674
        return this.equals((createPromotion_result)that);
2675
      return false;
2676
    }
2677
 
2678
    public boolean equals(createPromotion_result that) {
2679
      if (that == null)
2680
        return false;
2681
 
2682
      boolean this_present_pex = true && this.isSetPex();
2683
      boolean that_present_pex = true && that.isSetPex();
2684
      if (this_present_pex || that_present_pex) {
2685
        if (!(this_present_pex && that_present_pex))
2686
          return false;
2687
        if (!this.pex.equals(that.pex))
2688
          return false;
2689
      }
2690
 
2691
      return true;
2692
    }
2693
 
2694
    @Override
2695
    public int hashCode() {
2696
      return 0;
2697
    }
2698
 
2699
    public int compareTo(createPromotion_result other) {
2700
      if (!getClass().equals(other.getClass())) {
2701
        return getClass().getName().compareTo(other.getClass().getName());
2702
      }
2703
 
2704
      int lastComparison = 0;
2705
      createPromotion_result typedOther = (createPromotion_result)other;
2706
 
3430 rajveer 2707
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 2708
      if (lastComparison != 0) {
2709
        return lastComparison;
2710
      }
3430 rajveer 2711
      if (isSetPex()) {
2712
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
2713
        if (lastComparison != 0) {
2714
          return lastComparison;
2715
        }
1982 varun.gupt 2716
      }
2717
      return 0;
2718
    }
2719
 
3430 rajveer 2720
    public _Fields fieldForId(int fieldId) {
2721
      return _Fields.findByThriftId(fieldId);
2722
    }
2723
 
2724
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2725
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2726
      iprot.readStructBegin();
2727
      while (true)
2728
      {
2729
        field = iprot.readFieldBegin();
3430 rajveer 2730
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2731
          break;
2732
        }
3430 rajveer 2733
        switch (field.id) {
2734
          case 1: // PEX
2735
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
2736
              this.pex = new PromotionException();
2737
              this.pex.read(iprot);
2738
            } else { 
2739
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2740
            }
2741
            break;
2742
          default:
2743
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2744
        }
3430 rajveer 2745
        iprot.readFieldEnd();
1982 varun.gupt 2746
      }
2747
      iprot.readStructEnd();
2748
      validate();
2749
    }
2750
 
3430 rajveer 2751
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2752
      oprot.writeStructBegin(STRUCT_DESC);
2753
 
2754
      if (this.isSetPex()) {
2755
        oprot.writeFieldBegin(PEX_FIELD_DESC);
2756
        this.pex.write(oprot);
2757
        oprot.writeFieldEnd();
2758
      }
2759
      oprot.writeFieldStop();
2760
      oprot.writeStructEnd();
2761
    }
2762
 
2763
    @Override
2764
    public String toString() {
2765
      StringBuilder sb = new StringBuilder("createPromotion_result(");
2766
      boolean first = true;
2767
 
2768
      sb.append("pex:");
2769
      if (this.pex == null) {
2770
        sb.append("null");
2771
      } else {
2772
        sb.append(this.pex);
2773
      }
2774
      first = false;
2775
      sb.append(")");
2776
      return sb.toString();
2777
    }
2778
 
3430 rajveer 2779
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2780
      // check for required fields
2781
    }
2782
 
3430 rajveer 2783
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2784
      try {
2785
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2786
      } catch (org.apache.thrift.TException te) {
2787
        throw new java.io.IOException(te);
2788
      }
2789
    }
2790
 
2791
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2792
      try {
2793
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2794
      } catch (org.apache.thrift.TException te) {
2795
        throw new java.io.IOException(te);
2796
      }
2797
    }
2798
 
1982 varun.gupt 2799
  }
2800
 
6301 amit.gupta 2801
  public static class getCoupon_args implements org.apache.thrift.TBase<getCoupon_args, getCoupon_args._Fields>, java.io.Serializable, Cloneable   {
2802
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCoupon_args");
2803
 
2804
    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);
2805
 
2806
    private String couponCode; // required
2807
 
2808
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2809
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
2810
      COUPON_CODE((short)1, "couponCode");
2811
 
2812
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2813
 
2814
      static {
2815
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2816
          byName.put(field.getFieldName(), field);
2817
        }
2818
      }
2819
 
2820
      /**
2821
       * Find the _Fields constant that matches fieldId, or null if its not found.
2822
       */
2823
      public static _Fields findByThriftId(int fieldId) {
2824
        switch(fieldId) {
2825
          case 1: // COUPON_CODE
2826
            return COUPON_CODE;
2827
          default:
2828
            return null;
2829
        }
2830
      }
2831
 
2832
      /**
2833
       * Find the _Fields constant that matches fieldId, throwing an exception
2834
       * if it is not found.
2835
       */
2836
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2837
        _Fields fields = findByThriftId(fieldId);
2838
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2839
        return fields;
2840
      }
2841
 
2842
      /**
2843
       * Find the _Fields constant that matches name, or null if its not found.
2844
       */
2845
      public static _Fields findByName(String name) {
2846
        return byName.get(name);
2847
      }
2848
 
2849
      private final short _thriftId;
2850
      private final String _fieldName;
2851
 
2852
      _Fields(short thriftId, String fieldName) {
2853
        _thriftId = thriftId;
2854
        _fieldName = fieldName;
2855
      }
2856
 
2857
      public short getThriftFieldId() {
2858
        return _thriftId;
2859
      }
2860
 
2861
      public String getFieldName() {
2862
        return _fieldName;
2863
      }
2864
    }
2865
 
2866
    // isset id assignments
2867
 
2868
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
2869
    static {
2870
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2871
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2872
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
2873
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2874
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCoupon_args.class, metaDataMap);
2875
    }
2876
 
2877
    public getCoupon_args() {
2878
    }
2879
 
2880
    public getCoupon_args(
2881
      String couponCode)
2882
    {
2883
      this();
2884
      this.couponCode = couponCode;
2885
    }
2886
 
2887
    /**
2888
     * Performs a deep copy on <i>other</i>.
2889
     */
2890
    public getCoupon_args(getCoupon_args other) {
2891
      if (other.isSetCouponCode()) {
2892
        this.couponCode = other.couponCode;
2893
      }
2894
    }
2895
 
2896
    public getCoupon_args deepCopy() {
2897
      return new getCoupon_args(this);
2898
    }
2899
 
2900
    @Override
2901
    public void clear() {
2902
      this.couponCode = null;
2903
    }
2904
 
2905
    public String getCouponCode() {
2906
      return this.couponCode;
2907
    }
2908
 
2909
    public void setCouponCode(String couponCode) {
2910
      this.couponCode = couponCode;
2911
    }
2912
 
2913
    public void unsetCouponCode() {
2914
      this.couponCode = null;
2915
    }
2916
 
2917
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
2918
    public boolean isSetCouponCode() {
2919
      return this.couponCode != null;
2920
    }
2921
 
2922
    public void setCouponCodeIsSet(boolean value) {
2923
      if (!value) {
2924
        this.couponCode = null;
2925
      }
2926
    }
2927
 
2928
    public void setFieldValue(_Fields field, Object value) {
2929
      switch (field) {
2930
      case COUPON_CODE:
2931
        if (value == null) {
2932
          unsetCouponCode();
2933
        } else {
2934
          setCouponCode((String)value);
2935
        }
2936
        break;
2937
 
2938
      }
2939
    }
2940
 
2941
    public Object getFieldValue(_Fields field) {
2942
      switch (field) {
2943
      case COUPON_CODE:
2944
        return getCouponCode();
2945
 
2946
      }
2947
      throw new IllegalStateException();
2948
    }
2949
 
2950
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2951
    public boolean isSet(_Fields field) {
2952
      if (field == null) {
2953
        throw new IllegalArgumentException();
2954
      }
2955
 
2956
      switch (field) {
2957
      case COUPON_CODE:
2958
        return isSetCouponCode();
2959
      }
2960
      throw new IllegalStateException();
2961
    }
2962
 
2963
    @Override
2964
    public boolean equals(Object that) {
2965
      if (that == null)
2966
        return false;
2967
      if (that instanceof getCoupon_args)
2968
        return this.equals((getCoupon_args)that);
2969
      return false;
2970
    }
2971
 
2972
    public boolean equals(getCoupon_args that) {
2973
      if (that == null)
2974
        return false;
2975
 
2976
      boolean this_present_couponCode = true && this.isSetCouponCode();
2977
      boolean that_present_couponCode = true && that.isSetCouponCode();
2978
      if (this_present_couponCode || that_present_couponCode) {
2979
        if (!(this_present_couponCode && that_present_couponCode))
2980
          return false;
2981
        if (!this.couponCode.equals(that.couponCode))
2982
          return false;
2983
      }
2984
 
2985
      return true;
2986
    }
2987
 
2988
    @Override
2989
    public int hashCode() {
2990
      return 0;
2991
    }
2992
 
2993
    public int compareTo(getCoupon_args other) {
2994
      if (!getClass().equals(other.getClass())) {
2995
        return getClass().getName().compareTo(other.getClass().getName());
2996
      }
2997
 
2998
      int lastComparison = 0;
2999
      getCoupon_args typedOther = (getCoupon_args)other;
3000
 
3001
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3002
      if (lastComparison != 0) {
3003
        return lastComparison;
3004
      }
3005
      if (isSetCouponCode()) {
3006
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
3007
        if (lastComparison != 0) {
3008
          return lastComparison;
3009
        }
3010
      }
3011
      return 0;
3012
    }
3013
 
3014
    public _Fields fieldForId(int fieldId) {
3015
      return _Fields.findByThriftId(fieldId);
3016
    }
3017
 
3018
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3019
      org.apache.thrift.protocol.TField field;
3020
      iprot.readStructBegin();
3021
      while (true)
3022
      {
3023
        field = iprot.readFieldBegin();
3024
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3025
          break;
3026
        }
3027
        switch (field.id) {
3028
          case 1: // COUPON_CODE
3029
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
3030
              this.couponCode = iprot.readString();
3031
            } else { 
3032
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3033
            }
3034
            break;
3035
          default:
3036
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3037
        }
3038
        iprot.readFieldEnd();
3039
      }
3040
      iprot.readStructEnd();
3041
      validate();
3042
    }
3043
 
3044
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3045
      validate();
3046
 
3047
      oprot.writeStructBegin(STRUCT_DESC);
3048
      if (this.couponCode != null) {
3049
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
3050
        oprot.writeString(this.couponCode);
3051
        oprot.writeFieldEnd();
3052
      }
3053
      oprot.writeFieldStop();
3054
      oprot.writeStructEnd();
3055
    }
3056
 
3057
    @Override
3058
    public String toString() {
3059
      StringBuilder sb = new StringBuilder("getCoupon_args(");
3060
      boolean first = true;
3061
 
3062
      sb.append("couponCode:");
3063
      if (this.couponCode == null) {
3064
        sb.append("null");
3065
      } else {
3066
        sb.append(this.couponCode);
3067
      }
3068
      first = false;
3069
      sb.append(")");
3070
      return sb.toString();
3071
    }
3072
 
3073
    public void validate() throws org.apache.thrift.TException {
3074
      // check for required fields
3075
    }
3076
 
3077
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3078
      try {
3079
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3080
      } catch (org.apache.thrift.TException te) {
3081
        throw new java.io.IOException(te);
3082
      }
3083
    }
3084
 
3085
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3086
      try {
3087
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3088
      } catch (org.apache.thrift.TException te) {
3089
        throw new java.io.IOException(te);
3090
      }
3091
    }
3092
 
3093
  }
3094
 
3095
  public static class getCoupon_result implements org.apache.thrift.TBase<getCoupon_result, getCoupon_result._Fields>, java.io.Serializable, Cloneable   {
3096
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCoupon_result");
3097
 
3098
    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);
3099
    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);
3100
 
3101
    private Coupon success; // required
3102
    private PromotionException pex; // required
3103
 
3104
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3105
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3106
      SUCCESS((short)0, "success"),
3107
      PEX((short)1, "pex");
3108
 
3109
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3110
 
3111
      static {
3112
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3113
          byName.put(field.getFieldName(), field);
3114
        }
3115
      }
3116
 
3117
      /**
3118
       * Find the _Fields constant that matches fieldId, or null if its not found.
3119
       */
3120
      public static _Fields findByThriftId(int fieldId) {
3121
        switch(fieldId) {
3122
          case 0: // SUCCESS
3123
            return SUCCESS;
3124
          case 1: // PEX
3125
            return PEX;
3126
          default:
3127
            return null;
3128
        }
3129
      }
3130
 
3131
      /**
3132
       * Find the _Fields constant that matches fieldId, throwing an exception
3133
       * if it is not found.
3134
       */
3135
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3136
        _Fields fields = findByThriftId(fieldId);
3137
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3138
        return fields;
3139
      }
3140
 
3141
      /**
3142
       * Find the _Fields constant that matches name, or null if its not found.
3143
       */
3144
      public static _Fields findByName(String name) {
3145
        return byName.get(name);
3146
      }
3147
 
3148
      private final short _thriftId;
3149
      private final String _fieldName;
3150
 
3151
      _Fields(short thriftId, String fieldName) {
3152
        _thriftId = thriftId;
3153
        _fieldName = fieldName;
3154
      }
3155
 
3156
      public short getThriftFieldId() {
3157
        return _thriftId;
3158
      }
3159
 
3160
      public String getFieldName() {
3161
        return _fieldName;
3162
      }
3163
    }
3164
 
3165
    // isset id assignments
3166
 
3167
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3168
    static {
3169
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3170
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3171
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class)));
3172
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3173
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
3174
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3175
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCoupon_result.class, metaDataMap);
3176
    }
3177
 
3178
    public getCoupon_result() {
3179
    }
3180
 
3181
    public getCoupon_result(
3182
      Coupon success,
3183
      PromotionException pex)
3184
    {
3185
      this();
3186
      this.success = success;
3187
      this.pex = pex;
3188
    }
3189
 
3190
    /**
3191
     * Performs a deep copy on <i>other</i>.
3192
     */
3193
    public getCoupon_result(getCoupon_result other) {
3194
      if (other.isSetSuccess()) {
3195
        this.success = new Coupon(other.success);
3196
      }
3197
      if (other.isSetPex()) {
3198
        this.pex = new PromotionException(other.pex);
3199
      }
3200
    }
3201
 
3202
    public getCoupon_result deepCopy() {
3203
      return new getCoupon_result(this);
3204
    }
3205
 
3206
    @Override
3207
    public void clear() {
3208
      this.success = null;
3209
      this.pex = null;
3210
    }
3211
 
3212
    public Coupon getSuccess() {
3213
      return this.success;
3214
    }
3215
 
3216
    public void setSuccess(Coupon success) {
3217
      this.success = success;
3218
    }
3219
 
3220
    public void unsetSuccess() {
3221
      this.success = null;
3222
    }
3223
 
3224
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3225
    public boolean isSetSuccess() {
3226
      return this.success != null;
3227
    }
3228
 
3229
    public void setSuccessIsSet(boolean value) {
3230
      if (!value) {
3231
        this.success = null;
3232
      }
3233
    }
3234
 
3235
    public PromotionException getPex() {
3236
      return this.pex;
3237
    }
3238
 
3239
    public void setPex(PromotionException pex) {
3240
      this.pex = pex;
3241
    }
3242
 
3243
    public void unsetPex() {
3244
      this.pex = null;
3245
    }
3246
 
3247
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3248
    public boolean isSetPex() {
3249
      return this.pex != null;
3250
    }
3251
 
3252
    public void setPexIsSet(boolean value) {
3253
      if (!value) {
3254
        this.pex = null;
3255
      }
3256
    }
3257
 
3258
    public void setFieldValue(_Fields field, Object value) {
3259
      switch (field) {
3260
      case SUCCESS:
3261
        if (value == null) {
3262
          unsetSuccess();
3263
        } else {
3264
          setSuccess((Coupon)value);
3265
        }
3266
        break;
3267
 
3268
      case PEX:
3269
        if (value == null) {
3270
          unsetPex();
3271
        } else {
3272
          setPex((PromotionException)value);
3273
        }
3274
        break;
3275
 
3276
      }
3277
    }
3278
 
3279
    public Object getFieldValue(_Fields field) {
3280
      switch (field) {
3281
      case SUCCESS:
3282
        return getSuccess();
3283
 
3284
      case PEX:
3285
        return getPex();
3286
 
3287
      }
3288
      throw new IllegalStateException();
3289
    }
3290
 
3291
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3292
    public boolean isSet(_Fields field) {
3293
      if (field == null) {
3294
        throw new IllegalArgumentException();
3295
      }
3296
 
3297
      switch (field) {
3298
      case SUCCESS:
3299
        return isSetSuccess();
3300
      case PEX:
3301
        return isSetPex();
3302
      }
3303
      throw new IllegalStateException();
3304
    }
3305
 
3306
    @Override
3307
    public boolean equals(Object that) {
3308
      if (that == null)
3309
        return false;
3310
      if (that instanceof getCoupon_result)
3311
        return this.equals((getCoupon_result)that);
3312
      return false;
3313
    }
3314
 
3315
    public boolean equals(getCoupon_result that) {
3316
      if (that == null)
3317
        return false;
3318
 
3319
      boolean this_present_success = true && this.isSetSuccess();
3320
      boolean that_present_success = true && that.isSetSuccess();
3321
      if (this_present_success || that_present_success) {
3322
        if (!(this_present_success && that_present_success))
3323
          return false;
3324
        if (!this.success.equals(that.success))
3325
          return false;
3326
      }
3327
 
3328
      boolean this_present_pex = true && this.isSetPex();
3329
      boolean that_present_pex = true && that.isSetPex();
3330
      if (this_present_pex || that_present_pex) {
3331
        if (!(this_present_pex && that_present_pex))
3332
          return false;
3333
        if (!this.pex.equals(that.pex))
3334
          return false;
3335
      }
3336
 
3337
      return true;
3338
    }
3339
 
3340
    @Override
3341
    public int hashCode() {
3342
      return 0;
3343
    }
3344
 
3345
    public int compareTo(getCoupon_result other) {
3346
      if (!getClass().equals(other.getClass())) {
3347
        return getClass().getName().compareTo(other.getClass().getName());
3348
      }
3349
 
3350
      int lastComparison = 0;
3351
      getCoupon_result typedOther = (getCoupon_result)other;
3352
 
3353
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3354
      if (lastComparison != 0) {
3355
        return lastComparison;
3356
      }
3357
      if (isSetSuccess()) {
3358
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
3359
        if (lastComparison != 0) {
3360
          return lastComparison;
3361
        }
3362
      }
3363
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3364
      if (lastComparison != 0) {
3365
        return lastComparison;
3366
      }
3367
      if (isSetPex()) {
3368
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
3369
        if (lastComparison != 0) {
3370
          return lastComparison;
3371
        }
3372
      }
3373
      return 0;
3374
    }
3375
 
3376
    public _Fields fieldForId(int fieldId) {
3377
      return _Fields.findByThriftId(fieldId);
3378
    }
3379
 
3380
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3381
      org.apache.thrift.protocol.TField field;
3382
      iprot.readStructBegin();
3383
      while (true)
3384
      {
3385
        field = iprot.readFieldBegin();
3386
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3387
          break;
3388
        }
3389
        switch (field.id) {
3390
          case 0: // SUCCESS
3391
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3392
              this.success = new Coupon();
3393
              this.success.read(iprot);
3394
            } else { 
3395
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3396
            }
3397
            break;
3398
          case 1: // PEX
3399
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3400
              this.pex = new PromotionException();
3401
              this.pex.read(iprot);
3402
            } else { 
3403
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3404
            }
3405
            break;
3406
          default:
3407
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3408
        }
3409
        iprot.readFieldEnd();
3410
      }
3411
      iprot.readStructEnd();
3412
      validate();
3413
    }
3414
 
3415
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3416
      oprot.writeStructBegin(STRUCT_DESC);
3417
 
3418
      if (this.isSetSuccess()) {
3419
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
3420
        this.success.write(oprot);
3421
        oprot.writeFieldEnd();
3422
      } else if (this.isSetPex()) {
3423
        oprot.writeFieldBegin(PEX_FIELD_DESC);
3424
        this.pex.write(oprot);
3425
        oprot.writeFieldEnd();
3426
      }
3427
      oprot.writeFieldStop();
3428
      oprot.writeStructEnd();
3429
    }
3430
 
3431
    @Override
3432
    public String toString() {
3433
      StringBuilder sb = new StringBuilder("getCoupon_result(");
3434
      boolean first = true;
3435
 
3436
      sb.append("success:");
3437
      if (this.success == null) {
3438
        sb.append("null");
3439
      } else {
3440
        sb.append(this.success);
3441
      }
3442
      first = false;
3443
      if (!first) sb.append(", ");
3444
      sb.append("pex:");
3445
      if (this.pex == null) {
3446
        sb.append("null");
3447
      } else {
3448
        sb.append(this.pex);
3449
      }
3450
      first = false;
3451
      sb.append(")");
3452
      return sb.toString();
3453
    }
3454
 
3455
    public void validate() throws org.apache.thrift.TException {
3456
      // check for required fields
3457
    }
3458
 
3459
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3460
      try {
3461
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3462
      } catch (org.apache.thrift.TException te) {
3463
        throw new java.io.IOException(te);
3464
      }
3465
    }
3466
 
3467
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3468
      try {
3469
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3470
      } catch (org.apache.thrift.TException te) {
3471
        throw new java.io.IOException(te);
3472
      }
3473
    }
3474
 
3475
  }
3476
 
3477
  public static class isGiftVoucher_args implements org.apache.thrift.TBase<isGiftVoucher_args, isGiftVoucher_args._Fields>, java.io.Serializable, Cloneable   {
3478
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isGiftVoucher_args");
3479
 
3480
    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);
3481
 
3482
    private String couponCode; // required
3483
 
3484
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3485
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3486
      COUPON_CODE((short)1, "couponCode");
3487
 
3488
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3489
 
3490
      static {
3491
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3492
          byName.put(field.getFieldName(), field);
3493
        }
3494
      }
3495
 
3496
      /**
3497
       * Find the _Fields constant that matches fieldId, or null if its not found.
3498
       */
3499
      public static _Fields findByThriftId(int fieldId) {
3500
        switch(fieldId) {
3501
          case 1: // COUPON_CODE
3502
            return COUPON_CODE;
3503
          default:
3504
            return null;
3505
        }
3506
      }
3507
 
3508
      /**
3509
       * Find the _Fields constant that matches fieldId, throwing an exception
3510
       * if it is not found.
3511
       */
3512
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3513
        _Fields fields = findByThriftId(fieldId);
3514
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3515
        return fields;
3516
      }
3517
 
3518
      /**
3519
       * Find the _Fields constant that matches name, or null if its not found.
3520
       */
3521
      public static _Fields findByName(String name) {
3522
        return byName.get(name);
3523
      }
3524
 
3525
      private final short _thriftId;
3526
      private final String _fieldName;
3527
 
3528
      _Fields(short thriftId, String fieldName) {
3529
        _thriftId = thriftId;
3530
        _fieldName = fieldName;
3531
      }
3532
 
3533
      public short getThriftFieldId() {
3534
        return _thriftId;
3535
      }
3536
 
3537
      public String getFieldName() {
3538
        return _fieldName;
3539
      }
3540
    }
3541
 
3542
    // isset id assignments
3543
 
3544
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3545
    static {
3546
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3547
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3548
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
3549
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3550
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isGiftVoucher_args.class, metaDataMap);
3551
    }
3552
 
3553
    public isGiftVoucher_args() {
3554
    }
3555
 
3556
    public isGiftVoucher_args(
3557
      String couponCode)
3558
    {
3559
      this();
3560
      this.couponCode = couponCode;
3561
    }
3562
 
3563
    /**
3564
     * Performs a deep copy on <i>other</i>.
3565
     */
3566
    public isGiftVoucher_args(isGiftVoucher_args other) {
3567
      if (other.isSetCouponCode()) {
3568
        this.couponCode = other.couponCode;
3569
      }
3570
    }
3571
 
3572
    public isGiftVoucher_args deepCopy() {
3573
      return new isGiftVoucher_args(this);
3574
    }
3575
 
3576
    @Override
3577
    public void clear() {
3578
      this.couponCode = null;
3579
    }
3580
 
3581
    public String getCouponCode() {
3582
      return this.couponCode;
3583
    }
3584
 
3585
    public void setCouponCode(String couponCode) {
3586
      this.couponCode = couponCode;
3587
    }
3588
 
3589
    public void unsetCouponCode() {
3590
      this.couponCode = null;
3591
    }
3592
 
3593
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3594
    public boolean isSetCouponCode() {
3595
      return this.couponCode != null;
3596
    }
3597
 
3598
    public void setCouponCodeIsSet(boolean value) {
3599
      if (!value) {
3600
        this.couponCode = null;
3601
      }
3602
    }
3603
 
3604
    public void setFieldValue(_Fields field, Object value) {
3605
      switch (field) {
3606
      case COUPON_CODE:
3607
        if (value == null) {
3608
          unsetCouponCode();
3609
        } else {
3610
          setCouponCode((String)value);
3611
        }
3612
        break;
3613
 
3614
      }
3615
    }
3616
 
3617
    public Object getFieldValue(_Fields field) {
3618
      switch (field) {
3619
      case COUPON_CODE:
3620
        return getCouponCode();
3621
 
3622
      }
3623
      throw new IllegalStateException();
3624
    }
3625
 
3626
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3627
    public boolean isSet(_Fields field) {
3628
      if (field == null) {
3629
        throw new IllegalArgumentException();
3630
      }
3631
 
3632
      switch (field) {
3633
      case COUPON_CODE:
3634
        return isSetCouponCode();
3635
      }
3636
      throw new IllegalStateException();
3637
    }
3638
 
3639
    @Override
3640
    public boolean equals(Object that) {
3641
      if (that == null)
3642
        return false;
3643
      if (that instanceof isGiftVoucher_args)
3644
        return this.equals((isGiftVoucher_args)that);
3645
      return false;
3646
    }
3647
 
3648
    public boolean equals(isGiftVoucher_args that) {
3649
      if (that == null)
3650
        return false;
3651
 
3652
      boolean this_present_couponCode = true && this.isSetCouponCode();
3653
      boolean that_present_couponCode = true && that.isSetCouponCode();
3654
      if (this_present_couponCode || that_present_couponCode) {
3655
        if (!(this_present_couponCode && that_present_couponCode))
3656
          return false;
3657
        if (!this.couponCode.equals(that.couponCode))
3658
          return false;
3659
      }
3660
 
3661
      return true;
3662
    }
3663
 
3664
    @Override
3665
    public int hashCode() {
3666
      return 0;
3667
    }
3668
 
3669
    public int compareTo(isGiftVoucher_args other) {
3670
      if (!getClass().equals(other.getClass())) {
3671
        return getClass().getName().compareTo(other.getClass().getName());
3672
      }
3673
 
3674
      int lastComparison = 0;
3675
      isGiftVoucher_args typedOther = (isGiftVoucher_args)other;
3676
 
3677
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3678
      if (lastComparison != 0) {
3679
        return lastComparison;
3680
      }
3681
      if (isSetCouponCode()) {
3682
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
3683
        if (lastComparison != 0) {
3684
          return lastComparison;
3685
        }
3686
      }
3687
      return 0;
3688
    }
3689
 
3690
    public _Fields fieldForId(int fieldId) {
3691
      return _Fields.findByThriftId(fieldId);
3692
    }
3693
 
3694
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3695
      org.apache.thrift.protocol.TField field;
3696
      iprot.readStructBegin();
3697
      while (true)
3698
      {
3699
        field = iprot.readFieldBegin();
3700
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3701
          break;
3702
        }
3703
        switch (field.id) {
3704
          case 1: // COUPON_CODE
3705
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
3706
              this.couponCode = iprot.readString();
3707
            } else { 
3708
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3709
            }
3710
            break;
3711
          default:
3712
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3713
        }
3714
        iprot.readFieldEnd();
3715
      }
3716
      iprot.readStructEnd();
3717
      validate();
3718
    }
3719
 
3720
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3721
      validate();
3722
 
3723
      oprot.writeStructBegin(STRUCT_DESC);
3724
      if (this.couponCode != null) {
3725
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
3726
        oprot.writeString(this.couponCode);
3727
        oprot.writeFieldEnd();
3728
      }
3729
      oprot.writeFieldStop();
3730
      oprot.writeStructEnd();
3731
    }
3732
 
3733
    @Override
3734
    public String toString() {
3735
      StringBuilder sb = new StringBuilder("isGiftVoucher_args(");
3736
      boolean first = true;
3737
 
3738
      sb.append("couponCode:");
3739
      if (this.couponCode == null) {
3740
        sb.append("null");
3741
      } else {
3742
        sb.append(this.couponCode);
3743
      }
3744
      first = false;
3745
      sb.append(")");
3746
      return sb.toString();
3747
    }
3748
 
3749
    public void validate() throws org.apache.thrift.TException {
3750
      // check for required fields
3751
    }
3752
 
3753
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3754
      try {
3755
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3756
      } catch (org.apache.thrift.TException te) {
3757
        throw new java.io.IOException(te);
3758
      }
3759
    }
3760
 
3761
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3762
      try {
3763
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3764
      } catch (org.apache.thrift.TException te) {
3765
        throw new java.io.IOException(te);
3766
      }
3767
    }
3768
 
3769
  }
3770
 
3771
  public static class isGiftVoucher_result implements org.apache.thrift.TBase<isGiftVoucher_result, isGiftVoucher_result._Fields>, java.io.Serializable, Cloneable   {
3772
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isGiftVoucher_result");
3773
 
3774
    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);
3775
    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);
3776
 
3777
    private boolean success; // required
3778
    private PromotionException pex; // required
3779
 
3780
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3781
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3782
      SUCCESS((short)0, "success"),
3783
      PEX((short)1, "pex");
3784
 
3785
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3786
 
3787
      static {
3788
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3789
          byName.put(field.getFieldName(), field);
3790
        }
3791
      }
3792
 
3793
      /**
3794
       * Find the _Fields constant that matches fieldId, or null if its not found.
3795
       */
3796
      public static _Fields findByThriftId(int fieldId) {
3797
        switch(fieldId) {
3798
          case 0: // SUCCESS
3799
            return SUCCESS;
3800
          case 1: // PEX
3801
            return PEX;
3802
          default:
3803
            return null;
3804
        }
3805
      }
3806
 
3807
      /**
3808
       * Find the _Fields constant that matches fieldId, throwing an exception
3809
       * if it is not found.
3810
       */
3811
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3812
        _Fields fields = findByThriftId(fieldId);
3813
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3814
        return fields;
3815
      }
3816
 
3817
      /**
3818
       * Find the _Fields constant that matches name, or null if its not found.
3819
       */
3820
      public static _Fields findByName(String name) {
3821
        return byName.get(name);
3822
      }
3823
 
3824
      private final short _thriftId;
3825
      private final String _fieldName;
3826
 
3827
      _Fields(short thriftId, String fieldName) {
3828
        _thriftId = thriftId;
3829
        _fieldName = fieldName;
3830
      }
3831
 
3832
      public short getThriftFieldId() {
3833
        return _thriftId;
3834
      }
3835
 
3836
      public String getFieldName() {
3837
        return _fieldName;
3838
      }
3839
    }
3840
 
3841
    // isset id assignments
3842
    private static final int __SUCCESS_ISSET_ID = 0;
3843
    private BitSet __isset_bit_vector = new BitSet(1);
3844
 
3845
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3846
    static {
3847
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3848
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3849
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
3850
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3851
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
3852
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3853
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isGiftVoucher_result.class, metaDataMap);
3854
    }
3855
 
3856
    public isGiftVoucher_result() {
3857
    }
3858
 
3859
    public isGiftVoucher_result(
3860
      boolean success,
3861
      PromotionException pex)
3862
    {
3863
      this();
3864
      this.success = success;
3865
      setSuccessIsSet(true);
3866
      this.pex = pex;
3867
    }
3868
 
3869
    /**
3870
     * Performs a deep copy on <i>other</i>.
3871
     */
3872
    public isGiftVoucher_result(isGiftVoucher_result other) {
3873
      __isset_bit_vector.clear();
3874
      __isset_bit_vector.or(other.__isset_bit_vector);
3875
      this.success = other.success;
3876
      if (other.isSetPex()) {
3877
        this.pex = new PromotionException(other.pex);
3878
      }
3879
    }
3880
 
3881
    public isGiftVoucher_result deepCopy() {
3882
      return new isGiftVoucher_result(this);
3883
    }
3884
 
3885
    @Override
3886
    public void clear() {
3887
      setSuccessIsSet(false);
3888
      this.success = false;
3889
      this.pex = null;
3890
    }
3891
 
3892
    public boolean isSuccess() {
3893
      return this.success;
3894
    }
3895
 
3896
    public void setSuccess(boolean success) {
3897
      this.success = success;
3898
      setSuccessIsSet(true);
3899
    }
3900
 
3901
    public void unsetSuccess() {
3902
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
3903
    }
3904
 
3905
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3906
    public boolean isSetSuccess() {
3907
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
3908
    }
3909
 
3910
    public void setSuccessIsSet(boolean value) {
3911
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
3912
    }
3913
 
3914
    public PromotionException getPex() {
3915
      return this.pex;
3916
    }
3917
 
3918
    public void setPex(PromotionException pex) {
3919
      this.pex = pex;
3920
    }
3921
 
3922
    public void unsetPex() {
3923
      this.pex = null;
3924
    }
3925
 
3926
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3927
    public boolean isSetPex() {
3928
      return this.pex != null;
3929
    }
3930
 
3931
    public void setPexIsSet(boolean value) {
3932
      if (!value) {
3933
        this.pex = null;
3934
      }
3935
    }
3936
 
3937
    public void setFieldValue(_Fields field, Object value) {
3938
      switch (field) {
3939
      case SUCCESS:
3940
        if (value == null) {
3941
          unsetSuccess();
3942
        } else {
3943
          setSuccess((Boolean)value);
3944
        }
3945
        break;
3946
 
3947
      case PEX:
3948
        if (value == null) {
3949
          unsetPex();
3950
        } else {
3951
          setPex((PromotionException)value);
3952
        }
3953
        break;
3954
 
3955
      }
3956
    }
3957
 
3958
    public Object getFieldValue(_Fields field) {
3959
      switch (field) {
3960
      case SUCCESS:
3961
        return Boolean.valueOf(isSuccess());
3962
 
3963
      case PEX:
3964
        return getPex();
3965
 
3966
      }
3967
      throw new IllegalStateException();
3968
    }
3969
 
3970
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3971
    public boolean isSet(_Fields field) {
3972
      if (field == null) {
3973
        throw new IllegalArgumentException();
3974
      }
3975
 
3976
      switch (field) {
3977
      case SUCCESS:
3978
        return isSetSuccess();
3979
      case PEX:
3980
        return isSetPex();
3981
      }
3982
      throw new IllegalStateException();
3983
    }
3984
 
3985
    @Override
3986
    public boolean equals(Object that) {
3987
      if (that == null)
3988
        return false;
3989
      if (that instanceof isGiftVoucher_result)
3990
        return this.equals((isGiftVoucher_result)that);
3991
      return false;
3992
    }
3993
 
3994
    public boolean equals(isGiftVoucher_result that) {
3995
      if (that == null)
3996
        return false;
3997
 
3998
      boolean this_present_success = true;
3999
      boolean that_present_success = true;
4000
      if (this_present_success || that_present_success) {
4001
        if (!(this_present_success && that_present_success))
4002
          return false;
4003
        if (this.success != that.success)
4004
          return false;
4005
      }
4006
 
4007
      boolean this_present_pex = true && this.isSetPex();
4008
      boolean that_present_pex = true && that.isSetPex();
4009
      if (this_present_pex || that_present_pex) {
4010
        if (!(this_present_pex && that_present_pex))
4011
          return false;
4012
        if (!this.pex.equals(that.pex))
4013
          return false;
4014
      }
4015
 
4016
      return true;
4017
    }
4018
 
4019
    @Override
4020
    public int hashCode() {
4021
      return 0;
4022
    }
4023
 
4024
    public int compareTo(isGiftVoucher_result other) {
4025
      if (!getClass().equals(other.getClass())) {
4026
        return getClass().getName().compareTo(other.getClass().getName());
4027
      }
4028
 
4029
      int lastComparison = 0;
4030
      isGiftVoucher_result typedOther = (isGiftVoucher_result)other;
4031
 
4032
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
4033
      if (lastComparison != 0) {
4034
        return lastComparison;
4035
      }
4036
      if (isSetSuccess()) {
4037
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4038
        if (lastComparison != 0) {
4039
          return lastComparison;
4040
        }
4041
      }
4042
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
4043
      if (lastComparison != 0) {
4044
        return lastComparison;
4045
      }
4046
      if (isSetPex()) {
4047
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
4048
        if (lastComparison != 0) {
4049
          return lastComparison;
4050
        }
4051
      }
4052
      return 0;
4053
    }
4054
 
4055
    public _Fields fieldForId(int fieldId) {
4056
      return _Fields.findByThriftId(fieldId);
4057
    }
4058
 
4059
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4060
      org.apache.thrift.protocol.TField field;
4061
      iprot.readStructBegin();
4062
      while (true)
4063
      {
4064
        field = iprot.readFieldBegin();
4065
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4066
          break;
4067
        }
4068
        switch (field.id) {
4069
          case 0: // SUCCESS
4070
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
4071
              this.success = iprot.readBool();
4072
              setSuccessIsSet(true);
4073
            } else { 
4074
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4075
            }
4076
            break;
4077
          case 1: // PEX
4078
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4079
              this.pex = new PromotionException();
4080
              this.pex.read(iprot);
4081
            } else { 
4082
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4083
            }
4084
            break;
4085
          default:
4086
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4087
        }
4088
        iprot.readFieldEnd();
4089
      }
4090
      iprot.readStructEnd();
4091
      validate();
4092
    }
4093
 
4094
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4095
      oprot.writeStructBegin(STRUCT_DESC);
4096
 
4097
      if (this.isSetSuccess()) {
4098
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4099
        oprot.writeBool(this.success);
4100
        oprot.writeFieldEnd();
4101
      } else if (this.isSetPex()) {
4102
        oprot.writeFieldBegin(PEX_FIELD_DESC);
4103
        this.pex.write(oprot);
4104
        oprot.writeFieldEnd();
4105
      }
4106
      oprot.writeFieldStop();
4107
      oprot.writeStructEnd();
4108
    }
4109
 
4110
    @Override
4111
    public String toString() {
4112
      StringBuilder sb = new StringBuilder("isGiftVoucher_result(");
4113
      boolean first = true;
4114
 
4115
      sb.append("success:");
4116
      sb.append(this.success);
4117
      first = false;
4118
      if (!first) sb.append(", ");
4119
      sb.append("pex:");
4120
      if (this.pex == null) {
4121
        sb.append("null");
4122
      } else {
4123
        sb.append(this.pex);
4124
      }
4125
      first = false;
4126
      sb.append(")");
4127
      return sb.toString();
4128
    }
4129
 
4130
    public void validate() throws org.apache.thrift.TException {
4131
      // check for required fields
4132
    }
4133
 
4134
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4135
      try {
4136
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4137
      } catch (org.apache.thrift.TException te) {
4138
        throw new java.io.IOException(te);
4139
      }
4140
    }
4141
 
4142
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4143
      try {
4144
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4145
      } catch (org.apache.thrift.TException te) {
4146
        throw new java.io.IOException(te);
4147
      }
4148
    }
4149
 
4150
  }
4151
 
6356 amit.gupta 4152
  public static class isCodApplicable_args implements org.apache.thrift.TBase<isCodApplicable_args, isCodApplicable_args._Fields>, java.io.Serializable, Cloneable   {
4153
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isCodApplicable_args");
4154
 
4155
    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);
4156
 
4157
    private String couponCode; // required
4158
 
4159
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4160
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4161
      COUPON_CODE((short)1, "couponCode");
4162
 
4163
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4164
 
4165
      static {
4166
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4167
          byName.put(field.getFieldName(), field);
4168
        }
4169
      }
4170
 
4171
      /**
4172
       * Find the _Fields constant that matches fieldId, or null if its not found.
4173
       */
4174
      public static _Fields findByThriftId(int fieldId) {
4175
        switch(fieldId) {
4176
          case 1: // COUPON_CODE
4177
            return COUPON_CODE;
4178
          default:
4179
            return null;
4180
        }
4181
      }
4182
 
4183
      /**
4184
       * Find the _Fields constant that matches fieldId, throwing an exception
4185
       * if it is not found.
4186
       */
4187
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4188
        _Fields fields = findByThriftId(fieldId);
4189
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4190
        return fields;
4191
      }
4192
 
4193
      /**
4194
       * Find the _Fields constant that matches name, or null if its not found.
4195
       */
4196
      public static _Fields findByName(String name) {
4197
        return byName.get(name);
4198
      }
4199
 
4200
      private final short _thriftId;
4201
      private final String _fieldName;
4202
 
4203
      _Fields(short thriftId, String fieldName) {
4204
        _thriftId = thriftId;
4205
        _fieldName = fieldName;
4206
      }
4207
 
4208
      public short getThriftFieldId() {
4209
        return _thriftId;
4210
      }
4211
 
4212
      public String getFieldName() {
4213
        return _fieldName;
4214
      }
4215
    }
4216
 
4217
    // isset id assignments
4218
 
4219
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4220
    static {
4221
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4222
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4223
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
4224
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4225
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isCodApplicable_args.class, metaDataMap);
4226
    }
4227
 
4228
    public isCodApplicable_args() {
4229
    }
4230
 
4231
    public isCodApplicable_args(
4232
      String couponCode)
4233
    {
4234
      this();
4235
      this.couponCode = couponCode;
4236
    }
4237
 
4238
    /**
4239
     * Performs a deep copy on <i>other</i>.
4240
     */
4241
    public isCodApplicable_args(isCodApplicable_args other) {
4242
      if (other.isSetCouponCode()) {
4243
        this.couponCode = other.couponCode;
4244
      }
4245
    }
4246
 
4247
    public isCodApplicable_args deepCopy() {
4248
      return new isCodApplicable_args(this);
4249
    }
4250
 
4251
    @Override
4252
    public void clear() {
4253
      this.couponCode = null;
4254
    }
4255
 
4256
    public String getCouponCode() {
4257
      return this.couponCode;
4258
    }
4259
 
4260
    public void setCouponCode(String couponCode) {
4261
      this.couponCode = couponCode;
4262
    }
4263
 
4264
    public void unsetCouponCode() {
4265
      this.couponCode = null;
4266
    }
4267
 
4268
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
4269
    public boolean isSetCouponCode() {
4270
      return this.couponCode != null;
4271
    }
4272
 
4273
    public void setCouponCodeIsSet(boolean value) {
4274
      if (!value) {
4275
        this.couponCode = null;
4276
      }
4277
    }
4278
 
4279
    public void setFieldValue(_Fields field, Object value) {
4280
      switch (field) {
4281
      case COUPON_CODE:
4282
        if (value == null) {
4283
          unsetCouponCode();
4284
        } else {
4285
          setCouponCode((String)value);
4286
        }
4287
        break;
4288
 
4289
      }
4290
    }
4291
 
4292
    public Object getFieldValue(_Fields field) {
4293
      switch (field) {
4294
      case COUPON_CODE:
4295
        return getCouponCode();
4296
 
4297
      }
4298
      throw new IllegalStateException();
4299
    }
4300
 
4301
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4302
    public boolean isSet(_Fields field) {
4303
      if (field == null) {
4304
        throw new IllegalArgumentException();
4305
      }
4306
 
4307
      switch (field) {
4308
      case COUPON_CODE:
4309
        return isSetCouponCode();
4310
      }
4311
      throw new IllegalStateException();
4312
    }
4313
 
4314
    @Override
4315
    public boolean equals(Object that) {
4316
      if (that == null)
4317
        return false;
4318
      if (that instanceof isCodApplicable_args)
4319
        return this.equals((isCodApplicable_args)that);
4320
      return false;
4321
    }
4322
 
4323
    public boolean equals(isCodApplicable_args that) {
4324
      if (that == null)
4325
        return false;
4326
 
4327
      boolean this_present_couponCode = true && this.isSetCouponCode();
4328
      boolean that_present_couponCode = true && that.isSetCouponCode();
4329
      if (this_present_couponCode || that_present_couponCode) {
4330
        if (!(this_present_couponCode && that_present_couponCode))
4331
          return false;
4332
        if (!this.couponCode.equals(that.couponCode))
4333
          return false;
4334
      }
4335
 
4336
      return true;
4337
    }
4338
 
4339
    @Override
4340
    public int hashCode() {
4341
      return 0;
4342
    }
4343
 
4344
    public int compareTo(isCodApplicable_args other) {
4345
      if (!getClass().equals(other.getClass())) {
4346
        return getClass().getName().compareTo(other.getClass().getName());
4347
      }
4348
 
4349
      int lastComparison = 0;
4350
      isCodApplicable_args typedOther = (isCodApplicable_args)other;
4351
 
4352
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
4353
      if (lastComparison != 0) {
4354
        return lastComparison;
4355
      }
4356
      if (isSetCouponCode()) {
4357
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
4358
        if (lastComparison != 0) {
4359
          return lastComparison;
4360
        }
4361
      }
4362
      return 0;
4363
    }
4364
 
4365
    public _Fields fieldForId(int fieldId) {
4366
      return _Fields.findByThriftId(fieldId);
4367
    }
4368
 
4369
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4370
      org.apache.thrift.protocol.TField field;
4371
      iprot.readStructBegin();
4372
      while (true)
4373
      {
4374
        field = iprot.readFieldBegin();
4375
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4376
          break;
4377
        }
4378
        switch (field.id) {
4379
          case 1: // COUPON_CODE
4380
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
4381
              this.couponCode = iprot.readString();
4382
            } else { 
4383
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4384
            }
4385
            break;
4386
          default:
4387
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4388
        }
4389
        iprot.readFieldEnd();
4390
      }
4391
      iprot.readStructEnd();
4392
      validate();
4393
    }
4394
 
4395
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4396
      validate();
4397
 
4398
      oprot.writeStructBegin(STRUCT_DESC);
4399
      if (this.couponCode != null) {
4400
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
4401
        oprot.writeString(this.couponCode);
4402
        oprot.writeFieldEnd();
4403
      }
4404
      oprot.writeFieldStop();
4405
      oprot.writeStructEnd();
4406
    }
4407
 
4408
    @Override
4409
    public String toString() {
4410
      StringBuilder sb = new StringBuilder("isCodApplicable_args(");
4411
      boolean first = true;
4412
 
4413
      sb.append("couponCode:");
4414
      if (this.couponCode == null) {
4415
        sb.append("null");
4416
      } else {
4417
        sb.append(this.couponCode);
4418
      }
4419
      first = false;
4420
      sb.append(")");
4421
      return sb.toString();
4422
    }
4423
 
4424
    public void validate() throws org.apache.thrift.TException {
4425
      // check for required fields
4426
    }
4427
 
4428
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4429
      try {
4430
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4431
      } catch (org.apache.thrift.TException te) {
4432
        throw new java.io.IOException(te);
4433
      }
4434
    }
4435
 
4436
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4437
      try {
4438
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4439
      } catch (org.apache.thrift.TException te) {
4440
        throw new java.io.IOException(te);
4441
      }
4442
    }
4443
 
4444
  }
4445
 
4446
  public static class isCodApplicable_result implements org.apache.thrift.TBase<isCodApplicable_result, isCodApplicable_result._Fields>, java.io.Serializable, Cloneable   {
4447
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isCodApplicable_result");
4448
 
4449
    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);
4450
    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);
4451
 
4452
    private boolean success; // required
4453
    private PromotionException pex; // required
4454
 
4455
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4456
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4457
      SUCCESS((short)0, "success"),
4458
      PEX((short)1, "pex");
4459
 
4460
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4461
 
4462
      static {
4463
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4464
          byName.put(field.getFieldName(), field);
4465
        }
4466
      }
4467
 
4468
      /**
4469
       * Find the _Fields constant that matches fieldId, or null if its not found.
4470
       */
4471
      public static _Fields findByThriftId(int fieldId) {
4472
        switch(fieldId) {
4473
          case 0: // SUCCESS
4474
            return SUCCESS;
4475
          case 1: // PEX
4476
            return PEX;
4477
          default:
4478
            return null;
4479
        }
4480
      }
4481
 
4482
      /**
4483
       * Find the _Fields constant that matches fieldId, throwing an exception
4484
       * if it is not found.
4485
       */
4486
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4487
        _Fields fields = findByThriftId(fieldId);
4488
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4489
        return fields;
4490
      }
4491
 
4492
      /**
4493
       * Find the _Fields constant that matches name, or null if its not found.
4494
       */
4495
      public static _Fields findByName(String name) {
4496
        return byName.get(name);
4497
      }
4498
 
4499
      private final short _thriftId;
4500
      private final String _fieldName;
4501
 
4502
      _Fields(short thriftId, String fieldName) {
4503
        _thriftId = thriftId;
4504
        _fieldName = fieldName;
4505
      }
4506
 
4507
      public short getThriftFieldId() {
4508
        return _thriftId;
4509
      }
4510
 
4511
      public String getFieldName() {
4512
        return _fieldName;
4513
      }
4514
    }
4515
 
4516
    // isset id assignments
4517
    private static final int __SUCCESS_ISSET_ID = 0;
4518
    private BitSet __isset_bit_vector = new BitSet(1);
4519
 
4520
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4521
    static {
4522
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4523
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4524
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
4525
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4526
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4527
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4528
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isCodApplicable_result.class, metaDataMap);
4529
    }
4530
 
4531
    public isCodApplicable_result() {
4532
    }
4533
 
4534
    public isCodApplicable_result(
4535
      boolean success,
4536
      PromotionException pex)
4537
    {
4538
      this();
4539
      this.success = success;
4540
      setSuccessIsSet(true);
4541
      this.pex = pex;
4542
    }
4543
 
4544
    /**
4545
     * Performs a deep copy on <i>other</i>.
4546
     */
4547
    public isCodApplicable_result(isCodApplicable_result other) {
4548
      __isset_bit_vector.clear();
4549
      __isset_bit_vector.or(other.__isset_bit_vector);
4550
      this.success = other.success;
4551
      if (other.isSetPex()) {
4552
        this.pex = new PromotionException(other.pex);
4553
      }
4554
    }
4555
 
4556
    public isCodApplicable_result deepCopy() {
4557
      return new isCodApplicable_result(this);
4558
    }
4559
 
4560
    @Override
4561
    public void clear() {
4562
      setSuccessIsSet(false);
4563
      this.success = false;
4564
      this.pex = null;
4565
    }
4566
 
4567
    public boolean isSuccess() {
4568
      return this.success;
4569
    }
4570
 
4571
    public void setSuccess(boolean success) {
4572
      this.success = success;
4573
      setSuccessIsSet(true);
4574
    }
4575
 
4576
    public void unsetSuccess() {
4577
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
4578
    }
4579
 
4580
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
4581
    public boolean isSetSuccess() {
4582
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
4583
    }
4584
 
4585
    public void setSuccessIsSet(boolean value) {
4586
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
4587
    }
4588
 
4589
    public PromotionException getPex() {
4590
      return this.pex;
4591
    }
4592
 
4593
    public void setPex(PromotionException pex) {
4594
      this.pex = pex;
4595
    }
4596
 
4597
    public void unsetPex() {
4598
      this.pex = null;
4599
    }
4600
 
4601
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
4602
    public boolean isSetPex() {
4603
      return this.pex != null;
4604
    }
4605
 
4606
    public void setPexIsSet(boolean value) {
4607
      if (!value) {
4608
        this.pex = null;
4609
      }
4610
    }
4611
 
4612
    public void setFieldValue(_Fields field, Object value) {
4613
      switch (field) {
4614
      case SUCCESS:
4615
        if (value == null) {
4616
          unsetSuccess();
4617
        } else {
4618
          setSuccess((Boolean)value);
4619
        }
4620
        break;
4621
 
4622
      case PEX:
4623
        if (value == null) {
4624
          unsetPex();
4625
        } else {
4626
          setPex((PromotionException)value);
4627
        }
4628
        break;
4629
 
4630
      }
4631
    }
4632
 
4633
    public Object getFieldValue(_Fields field) {
4634
      switch (field) {
4635
      case SUCCESS:
4636
        return Boolean.valueOf(isSuccess());
4637
 
4638
      case PEX:
4639
        return getPex();
4640
 
4641
      }
4642
      throw new IllegalStateException();
4643
    }
4644
 
4645
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4646
    public boolean isSet(_Fields field) {
4647
      if (field == null) {
4648
        throw new IllegalArgumentException();
4649
      }
4650
 
4651
      switch (field) {
4652
      case SUCCESS:
4653
        return isSetSuccess();
4654
      case PEX:
4655
        return isSetPex();
4656
      }
4657
      throw new IllegalStateException();
4658
    }
4659
 
4660
    @Override
4661
    public boolean equals(Object that) {
4662
      if (that == null)
4663
        return false;
4664
      if (that instanceof isCodApplicable_result)
4665
        return this.equals((isCodApplicable_result)that);
4666
      return false;
4667
    }
4668
 
4669
    public boolean equals(isCodApplicable_result that) {
4670
      if (that == null)
4671
        return false;
4672
 
4673
      boolean this_present_success = true;
4674
      boolean that_present_success = true;
4675
      if (this_present_success || that_present_success) {
4676
        if (!(this_present_success && that_present_success))
4677
          return false;
4678
        if (this.success != that.success)
4679
          return false;
4680
      }
4681
 
4682
      boolean this_present_pex = true && this.isSetPex();
4683
      boolean that_present_pex = true && that.isSetPex();
4684
      if (this_present_pex || that_present_pex) {
4685
        if (!(this_present_pex && that_present_pex))
4686
          return false;
4687
        if (!this.pex.equals(that.pex))
4688
          return false;
4689
      }
4690
 
4691
      return true;
4692
    }
4693
 
4694
    @Override
4695
    public int hashCode() {
4696
      return 0;
4697
    }
4698
 
4699
    public int compareTo(isCodApplicable_result other) {
4700
      if (!getClass().equals(other.getClass())) {
4701
        return getClass().getName().compareTo(other.getClass().getName());
4702
      }
4703
 
4704
      int lastComparison = 0;
4705
      isCodApplicable_result typedOther = (isCodApplicable_result)other;
4706
 
4707
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
4708
      if (lastComparison != 0) {
4709
        return lastComparison;
4710
      }
4711
      if (isSetSuccess()) {
4712
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4713
        if (lastComparison != 0) {
4714
          return lastComparison;
4715
        }
4716
      }
4717
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
4718
      if (lastComparison != 0) {
4719
        return lastComparison;
4720
      }
4721
      if (isSetPex()) {
4722
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
4723
        if (lastComparison != 0) {
4724
          return lastComparison;
4725
        }
4726
      }
4727
      return 0;
4728
    }
4729
 
4730
    public _Fields fieldForId(int fieldId) {
4731
      return _Fields.findByThriftId(fieldId);
4732
    }
4733
 
4734
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4735
      org.apache.thrift.protocol.TField field;
4736
      iprot.readStructBegin();
4737
      while (true)
4738
      {
4739
        field = iprot.readFieldBegin();
4740
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4741
          break;
4742
        }
4743
        switch (field.id) {
4744
          case 0: // SUCCESS
4745
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
4746
              this.success = iprot.readBool();
4747
              setSuccessIsSet(true);
4748
            } else { 
4749
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4750
            }
4751
            break;
4752
          case 1: // PEX
4753
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4754
              this.pex = new PromotionException();
4755
              this.pex.read(iprot);
4756
            } else { 
4757
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4758
            }
4759
            break;
4760
          default:
4761
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4762
        }
4763
        iprot.readFieldEnd();
4764
      }
4765
      iprot.readStructEnd();
4766
      validate();
4767
    }
4768
 
4769
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4770
      oprot.writeStructBegin(STRUCT_DESC);
4771
 
4772
      if (this.isSetSuccess()) {
4773
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4774
        oprot.writeBool(this.success);
4775
        oprot.writeFieldEnd();
4776
      } else if (this.isSetPex()) {
4777
        oprot.writeFieldBegin(PEX_FIELD_DESC);
4778
        this.pex.write(oprot);
4779
        oprot.writeFieldEnd();
4780
      }
4781
      oprot.writeFieldStop();
4782
      oprot.writeStructEnd();
4783
    }
4784
 
4785
    @Override
4786
    public String toString() {
4787
      StringBuilder sb = new StringBuilder("isCodApplicable_result(");
4788
      boolean first = true;
4789
 
4790
      sb.append("success:");
4791
      sb.append(this.success);
4792
      first = false;
4793
      if (!first) sb.append(", ");
4794
      sb.append("pex:");
4795
      if (this.pex == null) {
4796
        sb.append("null");
4797
      } else {
4798
        sb.append(this.pex);
4799
      }
4800
      first = false;
4801
      sb.append(")");
4802
      return sb.toString();
4803
    }
4804
 
4805
    public void validate() throws org.apache.thrift.TException {
4806
      // check for required fields
4807
    }
4808
 
4809
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4810
      try {
4811
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4812
      } catch (org.apache.thrift.TException te) {
4813
        throw new java.io.IOException(te);
4814
      }
4815
    }
4816
 
4817
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4818
      try {
4819
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4820
      } catch (org.apache.thrift.TException te) {
4821
        throw new java.io.IOException(te);
4822
      }
4823
    }
4824
 
4825
  }
4826
 
3430 rajveer 4827
  public static class getAllPromotions_args implements org.apache.thrift.TBase<getAllPromotions_args, getAllPromotions_args._Fields>, java.io.Serializable, Cloneable   {
4828
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_args");
1982 varun.gupt 4829
 
4830
 
4831
 
4832
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 4833
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 4834
;
4835
 
4836
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4837
 
4838
      static {
4839
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4840
          byName.put(field.getFieldName(), field);
4841
        }
4842
      }
4843
 
4844
      /**
4845
       * Find the _Fields constant that matches fieldId, or null if its not found.
4846
       */
4847
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 4848
        switch(fieldId) {
4849
          default:
4850
            return null;
4851
        }
1982 varun.gupt 4852
      }
4853
 
4854
      /**
4855
       * Find the _Fields constant that matches fieldId, throwing an exception
4856
       * if it is not found.
4857
       */
4858
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4859
        _Fields fields = findByThriftId(fieldId);
4860
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4861
        return fields;
4862
      }
4863
 
4864
      /**
4865
       * Find the _Fields constant that matches name, or null if its not found.
4866
       */
4867
      public static _Fields findByName(String name) {
4868
        return byName.get(name);
4869
      }
4870
 
4871
      private final short _thriftId;
4872
      private final String _fieldName;
4873
 
4874
      _Fields(short thriftId, String fieldName) {
4875
        _thriftId = thriftId;
4876
        _fieldName = fieldName;
4877
      }
4878
 
4879
      public short getThriftFieldId() {
4880
        return _thriftId;
4881
      }
4882
 
4883
      public String getFieldName() {
4884
        return _fieldName;
4885
      }
4886
    }
3430 rajveer 4887
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 4888
    static {
3430 rajveer 4889
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4890
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4891
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_args.class, metaDataMap);
1982 varun.gupt 4892
    }
4893
 
4894
    public getAllPromotions_args() {
4895
    }
4896
 
4897
    /**
4898
     * Performs a deep copy on <i>other</i>.
4899
     */
4900
    public getAllPromotions_args(getAllPromotions_args other) {
4901
    }
4902
 
4903
    public getAllPromotions_args deepCopy() {
4904
      return new getAllPromotions_args(this);
4905
    }
4906
 
3430 rajveer 4907
    @Override
4908
    public void clear() {
1982 varun.gupt 4909
    }
4910
 
4911
    public void setFieldValue(_Fields field, Object value) {
4912
      switch (field) {
4913
      }
4914
    }
4915
 
4916
    public Object getFieldValue(_Fields field) {
4917
      switch (field) {
4918
      }
4919
      throw new IllegalStateException();
4920
    }
4921
 
3430 rajveer 4922
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4923
    public boolean isSet(_Fields field) {
4924
      if (field == null) {
4925
        throw new IllegalArgumentException();
4926
      }
1982 varun.gupt 4927
 
4928
      switch (field) {
4929
      }
4930
      throw new IllegalStateException();
4931
    }
4932
 
4933
    @Override
4934
    public boolean equals(Object that) {
4935
      if (that == null)
4936
        return false;
4937
      if (that instanceof getAllPromotions_args)
4938
        return this.equals((getAllPromotions_args)that);
4939
      return false;
4940
    }
4941
 
4942
    public boolean equals(getAllPromotions_args that) {
4943
      if (that == null)
4944
        return false;
4945
 
4946
      return true;
4947
    }
4948
 
4949
    @Override
4950
    public int hashCode() {
4951
      return 0;
4952
    }
4953
 
4954
    public int compareTo(getAllPromotions_args other) {
4955
      if (!getClass().equals(other.getClass())) {
4956
        return getClass().getName().compareTo(other.getClass().getName());
4957
      }
4958
 
4959
      int lastComparison = 0;
4960
      getAllPromotions_args typedOther = (getAllPromotions_args)other;
4961
 
4962
      return 0;
4963
    }
4964
 
3430 rajveer 4965
    public _Fields fieldForId(int fieldId) {
4966
      return _Fields.findByThriftId(fieldId);
4967
    }
4968
 
4969
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4970
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 4971
      iprot.readStructBegin();
4972
      while (true)
4973
      {
4974
        field = iprot.readFieldBegin();
3430 rajveer 4975
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 4976
          break;
4977
        }
3430 rajveer 4978
        switch (field.id) {
4979
          default:
4980
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 4981
        }
3430 rajveer 4982
        iprot.readFieldEnd();
1982 varun.gupt 4983
      }
4984
      iprot.readStructEnd();
4985
      validate();
4986
    }
4987
 
3430 rajveer 4988
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 4989
      validate();
4990
 
4991
      oprot.writeStructBegin(STRUCT_DESC);
4992
      oprot.writeFieldStop();
4993
      oprot.writeStructEnd();
4994
    }
4995
 
4996
    @Override
4997
    public String toString() {
4998
      StringBuilder sb = new StringBuilder("getAllPromotions_args(");
4999
      boolean first = true;
5000
 
5001
      sb.append(")");
5002
      return sb.toString();
5003
    }
5004
 
3430 rajveer 5005
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5006
      // check for required fields
5007
    }
5008
 
3430 rajveer 5009
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5010
      try {
5011
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5012
      } catch (org.apache.thrift.TException te) {
5013
        throw new java.io.IOException(te);
5014
      }
5015
    }
5016
 
5017
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5018
      try {
5019
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5020
      } catch (org.apache.thrift.TException te) {
5021
        throw new java.io.IOException(te);
5022
      }
5023
    }
5024
 
1982 varun.gupt 5025
  }
5026
 
3430 rajveer 5027
  public static class getAllPromotions_result implements org.apache.thrift.TBase<getAllPromotions_result, getAllPromotions_result._Fields>, java.io.Serializable, Cloneable   {
5028
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_result");
1982 varun.gupt 5029
 
3430 rajveer 5030
    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);
5031
    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 5032
 
3430 rajveer 5033
    private List<Promotion> success; // required
5034
    private PromotionException pex; // required
1982 varun.gupt 5035
 
5036
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5037
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5038
      SUCCESS((short)0, "success"),
5039
      PEX((short)1, "pex");
5040
 
5041
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5042
 
5043
      static {
5044
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5045
          byName.put(field.getFieldName(), field);
5046
        }
5047
      }
5048
 
5049
      /**
5050
       * Find the _Fields constant that matches fieldId, or null if its not found.
5051
       */
5052
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5053
        switch(fieldId) {
5054
          case 0: // SUCCESS
5055
            return SUCCESS;
5056
          case 1: // PEX
5057
            return PEX;
5058
          default:
5059
            return null;
5060
        }
1982 varun.gupt 5061
      }
5062
 
5063
      /**
5064
       * Find the _Fields constant that matches fieldId, throwing an exception
5065
       * if it is not found.
5066
       */
5067
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5068
        _Fields fields = findByThriftId(fieldId);
5069
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5070
        return fields;
5071
      }
5072
 
5073
      /**
5074
       * Find the _Fields constant that matches name, or null if its not found.
5075
       */
5076
      public static _Fields findByName(String name) {
5077
        return byName.get(name);
5078
      }
5079
 
5080
      private final short _thriftId;
5081
      private final String _fieldName;
5082
 
5083
      _Fields(short thriftId, String fieldName) {
5084
        _thriftId = thriftId;
5085
        _fieldName = fieldName;
5086
      }
5087
 
5088
      public short getThriftFieldId() {
5089
        return _thriftId;
5090
      }
5091
 
5092
      public String getFieldName() {
5093
        return _fieldName;
5094
      }
5095
    }
5096
 
5097
    // isset id assignments
5098
 
3430 rajveer 5099
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5100
    static {
3430 rajveer 5101
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5102
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5103
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
5104
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class))));
5105
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5106
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
5107
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5108
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_result.class, metaDataMap);
1982 varun.gupt 5109
    }
5110
 
5111
    public getAllPromotions_result() {
5112
    }
5113
 
5114
    public getAllPromotions_result(
5115
      List<Promotion> success,
5116
      PromotionException pex)
5117
    {
5118
      this();
5119
      this.success = success;
5120
      this.pex = pex;
5121
    }
5122
 
5123
    /**
5124
     * Performs a deep copy on <i>other</i>.
5125
     */
5126
    public getAllPromotions_result(getAllPromotions_result other) {
5127
      if (other.isSetSuccess()) {
5128
        List<Promotion> __this__success = new ArrayList<Promotion>();
5129
        for (Promotion other_element : other.success) {
5130
          __this__success.add(new Promotion(other_element));
5131
        }
5132
        this.success = __this__success;
5133
      }
5134
      if (other.isSetPex()) {
5135
        this.pex = new PromotionException(other.pex);
5136
      }
5137
    }
5138
 
5139
    public getAllPromotions_result deepCopy() {
5140
      return new getAllPromotions_result(this);
5141
    }
5142
 
3430 rajveer 5143
    @Override
5144
    public void clear() {
5145
      this.success = null;
5146
      this.pex = null;
1982 varun.gupt 5147
    }
5148
 
5149
    public int getSuccessSize() {
5150
      return (this.success == null) ? 0 : this.success.size();
5151
    }
5152
 
5153
    public java.util.Iterator<Promotion> getSuccessIterator() {
5154
      return (this.success == null) ? null : this.success.iterator();
5155
    }
5156
 
5157
    public void addToSuccess(Promotion elem) {
5158
      if (this.success == null) {
5159
        this.success = new ArrayList<Promotion>();
5160
      }
5161
      this.success.add(elem);
5162
    }
5163
 
5164
    public List<Promotion> getSuccess() {
5165
      return this.success;
5166
    }
5167
 
3430 rajveer 5168
    public void setSuccess(List<Promotion> success) {
1982 varun.gupt 5169
      this.success = success;
5170
    }
5171
 
5172
    public void unsetSuccess() {
5173
      this.success = null;
5174
    }
5175
 
3430 rajveer 5176
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5177
    public boolean isSetSuccess() {
5178
      return this.success != null;
5179
    }
5180
 
5181
    public void setSuccessIsSet(boolean value) {
5182
      if (!value) {
5183
        this.success = null;
5184
      }
5185
    }
5186
 
5187
    public PromotionException getPex() {
5188
      return this.pex;
5189
    }
5190
 
3430 rajveer 5191
    public void setPex(PromotionException pex) {
1982 varun.gupt 5192
      this.pex = pex;
5193
    }
5194
 
5195
    public void unsetPex() {
5196
      this.pex = null;
5197
    }
5198
 
3430 rajveer 5199
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5200
    public boolean isSetPex() {
5201
      return this.pex != null;
5202
    }
5203
 
5204
    public void setPexIsSet(boolean value) {
5205
      if (!value) {
5206
        this.pex = null;
5207
      }
5208
    }
5209
 
5210
    public void setFieldValue(_Fields field, Object value) {
5211
      switch (field) {
5212
      case SUCCESS:
5213
        if (value == null) {
5214
          unsetSuccess();
5215
        } else {
5216
          setSuccess((List<Promotion>)value);
5217
        }
5218
        break;
5219
 
5220
      case PEX:
5221
        if (value == null) {
5222
          unsetPex();
5223
        } else {
5224
          setPex((PromotionException)value);
5225
        }
5226
        break;
5227
 
5228
      }
5229
    }
5230
 
5231
    public Object getFieldValue(_Fields field) {
5232
      switch (field) {
5233
      case SUCCESS:
5234
        return getSuccess();
5235
 
5236
      case PEX:
5237
        return getPex();
5238
 
5239
      }
5240
      throw new IllegalStateException();
5241
    }
5242
 
3430 rajveer 5243
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5244
    public boolean isSet(_Fields field) {
5245
      if (field == null) {
5246
        throw new IllegalArgumentException();
5247
      }
1982 varun.gupt 5248
 
5249
      switch (field) {
5250
      case SUCCESS:
5251
        return isSetSuccess();
5252
      case PEX:
5253
        return isSetPex();
5254
      }
5255
      throw new IllegalStateException();
5256
    }
5257
 
5258
    @Override
5259
    public boolean equals(Object that) {
5260
      if (that == null)
5261
        return false;
5262
      if (that instanceof getAllPromotions_result)
5263
        return this.equals((getAllPromotions_result)that);
5264
      return false;
5265
    }
5266
 
5267
    public boolean equals(getAllPromotions_result that) {
5268
      if (that == null)
5269
        return false;
5270
 
5271
      boolean this_present_success = true && this.isSetSuccess();
5272
      boolean that_present_success = true && that.isSetSuccess();
5273
      if (this_present_success || that_present_success) {
5274
        if (!(this_present_success && that_present_success))
5275
          return false;
5276
        if (!this.success.equals(that.success))
5277
          return false;
5278
      }
5279
 
5280
      boolean this_present_pex = true && this.isSetPex();
5281
      boolean that_present_pex = true && that.isSetPex();
5282
      if (this_present_pex || that_present_pex) {
5283
        if (!(this_present_pex && that_present_pex))
5284
          return false;
5285
        if (!this.pex.equals(that.pex))
5286
          return false;
5287
      }
5288
 
5289
      return true;
5290
    }
5291
 
5292
    @Override
5293
    public int hashCode() {
5294
      return 0;
5295
    }
5296
 
5297
    public int compareTo(getAllPromotions_result other) {
5298
      if (!getClass().equals(other.getClass())) {
5299
        return getClass().getName().compareTo(other.getClass().getName());
5300
      }
5301
 
5302
      int lastComparison = 0;
5303
      getAllPromotions_result typedOther = (getAllPromotions_result)other;
5304
 
3430 rajveer 5305
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 5306
      if (lastComparison != 0) {
5307
        return lastComparison;
5308
      }
3430 rajveer 5309
      if (isSetSuccess()) {
5310
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
5311
        if (lastComparison != 0) {
5312
          return lastComparison;
5313
        }
1982 varun.gupt 5314
      }
3430 rajveer 5315
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 5316
      if (lastComparison != 0) {
5317
        return lastComparison;
5318
      }
3430 rajveer 5319
      if (isSetPex()) {
5320
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
5321
        if (lastComparison != 0) {
5322
          return lastComparison;
5323
        }
1982 varun.gupt 5324
      }
5325
      return 0;
5326
    }
5327
 
3430 rajveer 5328
    public _Fields fieldForId(int fieldId) {
5329
      return _Fields.findByThriftId(fieldId);
5330
    }
5331
 
5332
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5333
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5334
      iprot.readStructBegin();
5335
      while (true)
5336
      {
5337
        field = iprot.readFieldBegin();
3430 rajveer 5338
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5339
          break;
5340
        }
3430 rajveer 5341
        switch (field.id) {
5342
          case 0: // SUCCESS
5343
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
5344
              {
5327 rajveer 5345
                org.apache.thrift.protocol.TList _list12 = iprot.readListBegin();
5346
                this.success = new ArrayList<Promotion>(_list12.size);
5347
                for (int _i13 = 0; _i13 < _list12.size; ++_i13)
1982 varun.gupt 5348
                {
5327 rajveer 5349
                  Promotion _elem14; // required
5350
                  _elem14 = new Promotion();
5351
                  _elem14.read(iprot);
5352
                  this.success.add(_elem14);
1982 varun.gupt 5353
                }
3430 rajveer 5354
                iprot.readListEnd();
1982 varun.gupt 5355
              }
3430 rajveer 5356
            } else { 
5357
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5358
            }
5359
            break;
5360
          case 1: // PEX
5361
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5362
              this.pex = new PromotionException();
5363
              this.pex.read(iprot);
5364
            } else { 
5365
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5366
            }
5367
            break;
5368
          default:
5369
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5370
        }
3430 rajveer 5371
        iprot.readFieldEnd();
1982 varun.gupt 5372
      }
5373
      iprot.readStructEnd();
5374
      validate();
5375
    }
5376
 
3430 rajveer 5377
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5378
      oprot.writeStructBegin(STRUCT_DESC);
5379
 
5380
      if (this.isSetSuccess()) {
5381
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
5382
        {
3430 rajveer 5383
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
5327 rajveer 5384
          for (Promotion _iter15 : this.success)
1982 varun.gupt 5385
          {
5327 rajveer 5386
            _iter15.write(oprot);
1982 varun.gupt 5387
          }
5388
          oprot.writeListEnd();
5389
        }
5390
        oprot.writeFieldEnd();
5391
      } else if (this.isSetPex()) {
5392
        oprot.writeFieldBegin(PEX_FIELD_DESC);
5393
        this.pex.write(oprot);
5394
        oprot.writeFieldEnd();
5395
      }
5396
      oprot.writeFieldStop();
5397
      oprot.writeStructEnd();
5398
    }
5399
 
5400
    @Override
5401
    public String toString() {
5402
      StringBuilder sb = new StringBuilder("getAllPromotions_result(");
5403
      boolean first = true;
5404
 
5405
      sb.append("success:");
5406
      if (this.success == null) {
5407
        sb.append("null");
5408
      } else {
5409
        sb.append(this.success);
5410
      }
5411
      first = false;
5412
      if (!first) sb.append(", ");
5413
      sb.append("pex:");
5414
      if (this.pex == null) {
5415
        sb.append("null");
5416
      } else {
5417
        sb.append(this.pex);
5418
      }
5419
      first = false;
5420
      sb.append(")");
5421
      return sb.toString();
5422
    }
5423
 
3430 rajveer 5424
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5425
      // check for required fields
5426
    }
5427
 
3430 rajveer 5428
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5429
      try {
5430
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5431
      } catch (org.apache.thrift.TException te) {
5432
        throw new java.io.IOException(te);
5433
      }
5434
    }
5435
 
5436
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5437
      try {
5438
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5439
      } catch (org.apache.thrift.TException te) {
5440
        throw new java.io.IOException(te);
5441
      }
5442
    }
5443
 
1982 varun.gupt 5444
  }
5445
 
3430 rajveer 5446
  public static class getPromotionById_args implements org.apache.thrift.TBase<getPromotionById_args, getPromotionById_args._Fields>, java.io.Serializable, Cloneable   {
5447
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_args");
1982 varun.gupt 5448
 
3430 rajveer 5449
    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 5450
 
3430 rajveer 5451
    private long promotionId; // required
1982 varun.gupt 5452
 
5453
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5454
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5455
      PROMOTION_ID((short)1, "promotionId");
5456
 
5457
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5458
 
5459
      static {
5460
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5461
          byName.put(field.getFieldName(), field);
5462
        }
5463
      }
5464
 
5465
      /**
5466
       * Find the _Fields constant that matches fieldId, or null if its not found.
5467
       */
5468
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5469
        switch(fieldId) {
5470
          case 1: // PROMOTION_ID
5471
            return PROMOTION_ID;
5472
          default:
5473
            return null;
5474
        }
1982 varun.gupt 5475
      }
5476
 
5477
      /**
5478
       * Find the _Fields constant that matches fieldId, throwing an exception
5479
       * if it is not found.
5480
       */
5481
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5482
        _Fields fields = findByThriftId(fieldId);
5483
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5484
        return fields;
5485
      }
5486
 
5487
      /**
5488
       * Find the _Fields constant that matches name, or null if its not found.
5489
       */
5490
      public static _Fields findByName(String name) {
5491
        return byName.get(name);
5492
      }
5493
 
5494
      private final short _thriftId;
5495
      private final String _fieldName;
5496
 
5497
      _Fields(short thriftId, String fieldName) {
5498
        _thriftId = thriftId;
5499
        _fieldName = fieldName;
5500
      }
5501
 
5502
      public short getThriftFieldId() {
5503
        return _thriftId;
5504
      }
5505
 
5506
      public String getFieldName() {
5507
        return _fieldName;
5508
      }
5509
    }
5510
 
5511
    // isset id assignments
5512
    private static final int __PROMOTIONID_ISSET_ID = 0;
5513
    private BitSet __isset_bit_vector = new BitSet(1);
5514
 
3430 rajveer 5515
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5516
    static {
3430 rajveer 5517
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5518
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5519
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
5520
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5521
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_args.class, metaDataMap);
1982 varun.gupt 5522
    }
5523
 
5524
    public getPromotionById_args() {
5525
    }
5526
 
5527
    public getPromotionById_args(
5528
      long promotionId)
5529
    {
5530
      this();
5531
      this.promotionId = promotionId;
5532
      setPromotionIdIsSet(true);
5533
    }
5534
 
5535
    /**
5536
     * Performs a deep copy on <i>other</i>.
5537
     */
5538
    public getPromotionById_args(getPromotionById_args other) {
5539
      __isset_bit_vector.clear();
5540
      __isset_bit_vector.or(other.__isset_bit_vector);
5541
      this.promotionId = other.promotionId;
5542
    }
5543
 
5544
    public getPromotionById_args deepCopy() {
5545
      return new getPromotionById_args(this);
5546
    }
5547
 
3430 rajveer 5548
    @Override
5549
    public void clear() {
5550
      setPromotionIdIsSet(false);
5551
      this.promotionId = 0;
1982 varun.gupt 5552
    }
5553
 
5554
    public long getPromotionId() {
5555
      return this.promotionId;
5556
    }
5557
 
3430 rajveer 5558
    public void setPromotionId(long promotionId) {
1982 varun.gupt 5559
      this.promotionId = promotionId;
5560
      setPromotionIdIsSet(true);
5561
    }
5562
 
5563
    public void unsetPromotionId() {
5564
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
5565
    }
5566
 
3430 rajveer 5567
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5568
    public boolean isSetPromotionId() {
5569
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
5570
    }
5571
 
5572
    public void setPromotionIdIsSet(boolean value) {
5573
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
5574
    }
5575
 
5576
    public void setFieldValue(_Fields field, Object value) {
5577
      switch (field) {
5578
      case PROMOTION_ID:
5579
        if (value == null) {
5580
          unsetPromotionId();
5581
        } else {
5582
          setPromotionId((Long)value);
5583
        }
5584
        break;
5585
 
5586
      }
5587
    }
5588
 
5589
    public Object getFieldValue(_Fields field) {
5590
      switch (field) {
5591
      case PROMOTION_ID:
3430 rajveer 5592
        return Long.valueOf(getPromotionId());
1982 varun.gupt 5593
 
5594
      }
5595
      throw new IllegalStateException();
5596
    }
5597
 
3430 rajveer 5598
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5599
    public boolean isSet(_Fields field) {
5600
      if (field == null) {
5601
        throw new IllegalArgumentException();
5602
      }
1982 varun.gupt 5603
 
5604
      switch (field) {
5605
      case PROMOTION_ID:
5606
        return isSetPromotionId();
5607
      }
5608
      throw new IllegalStateException();
5609
    }
5610
 
5611
    @Override
5612
    public boolean equals(Object that) {
5613
      if (that == null)
5614
        return false;
5615
      if (that instanceof getPromotionById_args)
5616
        return this.equals((getPromotionById_args)that);
5617
      return false;
5618
    }
5619
 
5620
    public boolean equals(getPromotionById_args that) {
5621
      if (that == null)
5622
        return false;
5623
 
5624
      boolean this_present_promotionId = true;
5625
      boolean that_present_promotionId = true;
5626
      if (this_present_promotionId || that_present_promotionId) {
5627
        if (!(this_present_promotionId && that_present_promotionId))
5628
          return false;
5629
        if (this.promotionId != that.promotionId)
5630
          return false;
5631
      }
5632
 
5633
      return true;
5634
    }
5635
 
5636
    @Override
5637
    public int hashCode() {
5638
      return 0;
5639
    }
5640
 
5641
    public int compareTo(getPromotionById_args other) {
5642
      if (!getClass().equals(other.getClass())) {
5643
        return getClass().getName().compareTo(other.getClass().getName());
5644
      }
5645
 
5646
      int lastComparison = 0;
5647
      getPromotionById_args typedOther = (getPromotionById_args)other;
5648
 
3430 rajveer 5649
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 5650
      if (lastComparison != 0) {
5651
        return lastComparison;
5652
      }
3430 rajveer 5653
      if (isSetPromotionId()) {
5654
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
5655
        if (lastComparison != 0) {
5656
          return lastComparison;
5657
        }
1982 varun.gupt 5658
      }
5659
      return 0;
5660
    }
5661
 
3430 rajveer 5662
    public _Fields fieldForId(int fieldId) {
5663
      return _Fields.findByThriftId(fieldId);
5664
    }
5665
 
5666
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5667
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5668
      iprot.readStructBegin();
5669
      while (true)
5670
      {
5671
        field = iprot.readFieldBegin();
3430 rajveer 5672
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5673
          break;
5674
        }
3430 rajveer 5675
        switch (field.id) {
5676
          case 1: // PROMOTION_ID
5677
            if (field.type == org.apache.thrift.protocol.TType.I64) {
5678
              this.promotionId = iprot.readI64();
5679
              setPromotionIdIsSet(true);
5680
            } else { 
5681
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5682
            }
5683
            break;
5684
          default:
5685
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5686
        }
3430 rajveer 5687
        iprot.readFieldEnd();
1982 varun.gupt 5688
      }
5689
      iprot.readStructEnd();
5690
      validate();
5691
    }
5692
 
3430 rajveer 5693
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5694
      validate();
5695
 
5696
      oprot.writeStructBegin(STRUCT_DESC);
5697
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
5698
      oprot.writeI64(this.promotionId);
5699
      oprot.writeFieldEnd();
5700
      oprot.writeFieldStop();
5701
      oprot.writeStructEnd();
5702
    }
5703
 
5704
    @Override
5705
    public String toString() {
5706
      StringBuilder sb = new StringBuilder("getPromotionById_args(");
5707
      boolean first = true;
5708
 
5709
      sb.append("promotionId:");
5710
      sb.append(this.promotionId);
5711
      first = false;
5712
      sb.append(")");
5713
      return sb.toString();
5714
    }
5715
 
3430 rajveer 5716
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5717
      // check for required fields
5718
    }
5719
 
3430 rajveer 5720
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5721
      try {
5722
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5723
      } catch (org.apache.thrift.TException te) {
5724
        throw new java.io.IOException(te);
5725
      }
5726
    }
5727
 
5728
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5729
      try {
5730
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
5731
        __isset_bit_vector = new BitSet(1);
5732
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5733
      } catch (org.apache.thrift.TException te) {
5734
        throw new java.io.IOException(te);
5735
      }
5736
    }
5737
 
1982 varun.gupt 5738
  }
5739
 
3430 rajveer 5740
  public static class getPromotionById_result implements org.apache.thrift.TBase<getPromotionById_result, getPromotionById_result._Fields>, java.io.Serializable, Cloneable   {
5741
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_result");
1982 varun.gupt 5742
 
3430 rajveer 5743
    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);
5744
    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 5745
 
3430 rajveer 5746
    private Promotion success; // required
5747
    private PromotionException pex; // required
1982 varun.gupt 5748
 
5749
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5750
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5751
      SUCCESS((short)0, "success"),
5752
      PEX((short)1, "pex");
5753
 
5754
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5755
 
5756
      static {
5757
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5758
          byName.put(field.getFieldName(), field);
5759
        }
5760
      }
5761
 
5762
      /**
5763
       * Find the _Fields constant that matches fieldId, or null if its not found.
5764
       */
5765
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5766
        switch(fieldId) {
5767
          case 0: // SUCCESS
5768
            return SUCCESS;
5769
          case 1: // PEX
5770
            return PEX;
5771
          default:
5772
            return null;
5773
        }
1982 varun.gupt 5774
      }
5775
 
5776
      /**
5777
       * Find the _Fields constant that matches fieldId, throwing an exception
5778
       * if it is not found.
5779
       */
5780
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5781
        _Fields fields = findByThriftId(fieldId);
5782
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5783
        return fields;
5784
      }
5785
 
5786
      /**
5787
       * Find the _Fields constant that matches name, or null if its not found.
5788
       */
5789
      public static _Fields findByName(String name) {
5790
        return byName.get(name);
5791
      }
5792
 
5793
      private final short _thriftId;
5794
      private final String _fieldName;
5795
 
5796
      _Fields(short thriftId, String fieldName) {
5797
        _thriftId = thriftId;
5798
        _fieldName = fieldName;
5799
      }
5800
 
5801
      public short getThriftFieldId() {
5802
        return _thriftId;
5803
      }
5804
 
5805
      public String getFieldName() {
5806
        return _fieldName;
5807
      }
5808
    }
5809
 
5810
    // isset id assignments
5811
 
3430 rajveer 5812
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5813
    static {
3430 rajveer 5814
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5815
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5816
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class)));
5817
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5818
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
5819
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5820
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_result.class, metaDataMap);
1982 varun.gupt 5821
    }
5822
 
5823
    public getPromotionById_result() {
5824
    }
5825
 
5826
    public getPromotionById_result(
5827
      Promotion success,
5828
      PromotionException pex)
5829
    {
5830
      this();
5831
      this.success = success;
5832
      this.pex = pex;
5833
    }
5834
 
5835
    /**
5836
     * Performs a deep copy on <i>other</i>.
5837
     */
5838
    public getPromotionById_result(getPromotionById_result other) {
5839
      if (other.isSetSuccess()) {
5840
        this.success = new Promotion(other.success);
5841
      }
5842
      if (other.isSetPex()) {
5843
        this.pex = new PromotionException(other.pex);
5844
      }
5845
    }
5846
 
5847
    public getPromotionById_result deepCopy() {
5848
      return new getPromotionById_result(this);
5849
    }
5850
 
3430 rajveer 5851
    @Override
5852
    public void clear() {
5853
      this.success = null;
5854
      this.pex = null;
1982 varun.gupt 5855
    }
5856
 
5857
    public Promotion getSuccess() {
5858
      return this.success;
5859
    }
5860
 
3430 rajveer 5861
    public void setSuccess(Promotion success) {
1982 varun.gupt 5862
      this.success = success;
5863
    }
5864
 
5865
    public void unsetSuccess() {
5866
      this.success = null;
5867
    }
5868
 
3430 rajveer 5869
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5870
    public boolean isSetSuccess() {
5871
      return this.success != null;
5872
    }
5873
 
5874
    public void setSuccessIsSet(boolean value) {
5875
      if (!value) {
5876
        this.success = null;
5877
      }
5878
    }
5879
 
5880
    public PromotionException getPex() {
5881
      return this.pex;
5882
    }
5883
 
3430 rajveer 5884
    public void setPex(PromotionException pex) {
1982 varun.gupt 5885
      this.pex = pex;
5886
    }
5887
 
5888
    public void unsetPex() {
5889
      this.pex = null;
5890
    }
5891
 
3430 rajveer 5892
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5893
    public boolean isSetPex() {
5894
      return this.pex != null;
5895
    }
5896
 
5897
    public void setPexIsSet(boolean value) {
5898
      if (!value) {
5899
        this.pex = null;
5900
      }
5901
    }
5902
 
5903
    public void setFieldValue(_Fields field, Object value) {
5904
      switch (field) {
5905
      case SUCCESS:
5906
        if (value == null) {
5907
          unsetSuccess();
5908
        } else {
5909
          setSuccess((Promotion)value);
5910
        }
5911
        break;
5912
 
5913
      case PEX:
5914
        if (value == null) {
5915
          unsetPex();
5916
        } else {
5917
          setPex((PromotionException)value);
5918
        }
5919
        break;
5920
 
5921
      }
5922
    }
5923
 
5924
    public Object getFieldValue(_Fields field) {
5925
      switch (field) {
5926
      case SUCCESS:
5927
        return getSuccess();
5928
 
5929
      case PEX:
5930
        return getPex();
5931
 
5932
      }
5933
      throw new IllegalStateException();
5934
    }
5935
 
3430 rajveer 5936
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5937
    public boolean isSet(_Fields field) {
5938
      if (field == null) {
5939
        throw new IllegalArgumentException();
5940
      }
1982 varun.gupt 5941
 
5942
      switch (field) {
5943
      case SUCCESS:
5944
        return isSetSuccess();
5945
      case PEX:
5946
        return isSetPex();
5947
      }
5948
      throw new IllegalStateException();
5949
    }
5950
 
5951
    @Override
5952
    public boolean equals(Object that) {
5953
      if (that == null)
5954
        return false;
5955
      if (that instanceof getPromotionById_result)
5956
        return this.equals((getPromotionById_result)that);
5957
      return false;
5958
    }
5959
 
5960
    public boolean equals(getPromotionById_result that) {
5961
      if (that == null)
5962
        return false;
5963
 
5964
      boolean this_present_success = true && this.isSetSuccess();
5965
      boolean that_present_success = true && that.isSetSuccess();
5966
      if (this_present_success || that_present_success) {
5967
        if (!(this_present_success && that_present_success))
5968
          return false;
5969
        if (!this.success.equals(that.success))
5970
          return false;
5971
      }
5972
 
5973
      boolean this_present_pex = true && this.isSetPex();
5974
      boolean that_present_pex = true && that.isSetPex();
5975
      if (this_present_pex || that_present_pex) {
5976
        if (!(this_present_pex && that_present_pex))
5977
          return false;
5978
        if (!this.pex.equals(that.pex))
5979
          return false;
5980
      }
5981
 
5982
      return true;
5983
    }
5984
 
5985
    @Override
5986
    public int hashCode() {
5987
      return 0;
5988
    }
5989
 
5990
    public int compareTo(getPromotionById_result other) {
5991
      if (!getClass().equals(other.getClass())) {
5992
        return getClass().getName().compareTo(other.getClass().getName());
5993
      }
5994
 
5995
      int lastComparison = 0;
5996
      getPromotionById_result typedOther = (getPromotionById_result)other;
5997
 
3430 rajveer 5998
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 5999
      if (lastComparison != 0) {
6000
        return lastComparison;
6001
      }
3430 rajveer 6002
      if (isSetSuccess()) {
6003
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
6004
        if (lastComparison != 0) {
6005
          return lastComparison;
6006
        }
1982 varun.gupt 6007
      }
3430 rajveer 6008
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 6009
      if (lastComparison != 0) {
6010
        return lastComparison;
6011
      }
3430 rajveer 6012
      if (isSetPex()) {
6013
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
6014
        if (lastComparison != 0) {
6015
          return lastComparison;
6016
        }
1982 varun.gupt 6017
      }
6018
      return 0;
6019
    }
6020
 
3430 rajveer 6021
    public _Fields fieldForId(int fieldId) {
6022
      return _Fields.findByThriftId(fieldId);
6023
    }
6024
 
6025
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6026
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6027
      iprot.readStructBegin();
6028
      while (true)
6029
      {
6030
        field = iprot.readFieldBegin();
3430 rajveer 6031
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6032
          break;
6033
        }
3430 rajveer 6034
        switch (field.id) {
6035
          case 0: // SUCCESS
6036
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6037
              this.success = new Promotion();
6038
              this.success.read(iprot);
6039
            } else { 
6040
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6041
            }
6042
            break;
6043
          case 1: // PEX
6044
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6045
              this.pex = new PromotionException();
6046
              this.pex.read(iprot);
6047
            } else { 
6048
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6049
            }
6050
            break;
6051
          default:
6052
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6053
        }
3430 rajveer 6054
        iprot.readFieldEnd();
1982 varun.gupt 6055
      }
6056
      iprot.readStructEnd();
6057
      validate();
6058
    }
6059
 
3430 rajveer 6060
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6061
      oprot.writeStructBegin(STRUCT_DESC);
6062
 
6063
      if (this.isSetSuccess()) {
6064
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
6065
        this.success.write(oprot);
6066
        oprot.writeFieldEnd();
6067
      } else if (this.isSetPex()) {
6068
        oprot.writeFieldBegin(PEX_FIELD_DESC);
6069
        this.pex.write(oprot);
6070
        oprot.writeFieldEnd();
6071
      }
6072
      oprot.writeFieldStop();
6073
      oprot.writeStructEnd();
6074
    }
6075
 
6076
    @Override
6077
    public String toString() {
6078
      StringBuilder sb = new StringBuilder("getPromotionById_result(");
6079
      boolean first = true;
6080
 
6081
      sb.append("success:");
6082
      if (this.success == null) {
6083
        sb.append("null");
6084
      } else {
6085
        sb.append(this.success);
6086
      }
6087
      first = false;
6088
      if (!first) sb.append(", ");
6089
      sb.append("pex:");
6090
      if (this.pex == null) {
6091
        sb.append("null");
6092
      } else {
6093
        sb.append(this.pex);
6094
      }
6095
      first = false;
6096
      sb.append(")");
6097
      return sb.toString();
6098
    }
6099
 
3430 rajveer 6100
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6101
      // check for required fields
6102
    }
6103
 
3430 rajveer 6104
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6105
      try {
6106
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6107
      } catch (org.apache.thrift.TException te) {
6108
        throw new java.io.IOException(te);
6109
      }
6110
    }
6111
 
6112
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6113
      try {
6114
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6115
      } catch (org.apache.thrift.TException te) {
6116
        throw new java.io.IOException(te);
6117
      }
6118
    }
6119
 
1982 varun.gupt 6120
  }
6121
 
3430 rajveer 6122
  public static class generateCouponsForPromotion_args implements org.apache.thrift.TBase<generateCouponsForPromotion_args, generateCouponsForPromotion_args._Fields>, java.io.Serializable, Cloneable   {
6123
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_args");
1982 varun.gupt 6124
 
3430 rajveer 6125
    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);
6126
    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 6127
 
3430 rajveer 6128
    private long promotionId; // required
6129
    private String couponCode; // required
1982 varun.gupt 6130
 
6131
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6132
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6133
      PROMOTION_ID((short)1, "promotionId"),
6134
      COUPON_CODE((short)2, "couponCode");
6135
 
6136
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6137
 
6138
      static {
6139
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6140
          byName.put(field.getFieldName(), field);
6141
        }
6142
      }
6143
 
6144
      /**
6145
       * Find the _Fields constant that matches fieldId, or null if its not found.
6146
       */
6147
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6148
        switch(fieldId) {
6149
          case 1: // PROMOTION_ID
6150
            return PROMOTION_ID;
6151
          case 2: // COUPON_CODE
6152
            return COUPON_CODE;
6153
          default:
6154
            return null;
6155
        }
1982 varun.gupt 6156
      }
6157
 
6158
      /**
6159
       * Find the _Fields constant that matches fieldId, throwing an exception
6160
       * if it is not found.
6161
       */
6162
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6163
        _Fields fields = findByThriftId(fieldId);
6164
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6165
        return fields;
6166
      }
6167
 
6168
      /**
6169
       * Find the _Fields constant that matches name, or null if its not found.
6170
       */
6171
      public static _Fields findByName(String name) {
6172
        return byName.get(name);
6173
      }
6174
 
6175
      private final short _thriftId;
6176
      private final String _fieldName;
6177
 
6178
      _Fields(short thriftId, String fieldName) {
6179
        _thriftId = thriftId;
6180
        _fieldName = fieldName;
6181
      }
6182
 
6183
      public short getThriftFieldId() {
6184
        return _thriftId;
6185
      }
6186
 
6187
      public String getFieldName() {
6188
        return _fieldName;
6189
      }
6190
    }
6191
 
6192
    // isset id assignments
6193
    private static final int __PROMOTIONID_ISSET_ID = 0;
6194
    private BitSet __isset_bit_vector = new BitSet(1);
6195
 
3430 rajveer 6196
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6197
    static {
3430 rajveer 6198
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6199
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6200
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6201
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6202
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6203
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6204
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_args.class, metaDataMap);
1982 varun.gupt 6205
    }
6206
 
6207
    public generateCouponsForPromotion_args() {
6208
    }
6209
 
6210
    public generateCouponsForPromotion_args(
6211
      long promotionId,
6212
      String couponCode)
6213
    {
6214
      this();
6215
      this.promotionId = promotionId;
6216
      setPromotionIdIsSet(true);
6217
      this.couponCode = couponCode;
6218
    }
6219
 
6220
    /**
6221
     * Performs a deep copy on <i>other</i>.
6222
     */
6223
    public generateCouponsForPromotion_args(generateCouponsForPromotion_args other) {
6224
      __isset_bit_vector.clear();
6225
      __isset_bit_vector.or(other.__isset_bit_vector);
6226
      this.promotionId = other.promotionId;
6227
      if (other.isSetCouponCode()) {
6228
        this.couponCode = other.couponCode;
6229
      }
6230
    }
6231
 
6232
    public generateCouponsForPromotion_args deepCopy() {
6233
      return new generateCouponsForPromotion_args(this);
6234
    }
6235
 
3430 rajveer 6236
    @Override
6237
    public void clear() {
6238
      setPromotionIdIsSet(false);
6239
      this.promotionId = 0;
6240
      this.couponCode = null;
1982 varun.gupt 6241
    }
6242
 
6243
    public long getPromotionId() {
6244
      return this.promotionId;
6245
    }
6246
 
3430 rajveer 6247
    public void setPromotionId(long promotionId) {
1982 varun.gupt 6248
      this.promotionId = promotionId;
6249
      setPromotionIdIsSet(true);
6250
    }
6251
 
6252
    public void unsetPromotionId() {
6253
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
6254
    }
6255
 
3430 rajveer 6256
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6257
    public boolean isSetPromotionId() {
6258
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
6259
    }
6260
 
6261
    public void setPromotionIdIsSet(boolean value) {
6262
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
6263
    }
6264
 
6265
    public String getCouponCode() {
6266
      return this.couponCode;
6267
    }
6268
 
3430 rajveer 6269
    public void setCouponCode(String couponCode) {
1982 varun.gupt 6270
      this.couponCode = couponCode;
6271
    }
6272
 
6273
    public void unsetCouponCode() {
6274
      this.couponCode = null;
6275
    }
6276
 
3430 rajveer 6277
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6278
    public boolean isSetCouponCode() {
6279
      return this.couponCode != null;
6280
    }
6281
 
6282
    public void setCouponCodeIsSet(boolean value) {
6283
      if (!value) {
6284
        this.couponCode = null;
6285
      }
6286
    }
6287
 
6288
    public void setFieldValue(_Fields field, Object value) {
6289
      switch (field) {
6290
      case PROMOTION_ID:
6291
        if (value == null) {
6292
          unsetPromotionId();
6293
        } else {
6294
          setPromotionId((Long)value);
6295
        }
6296
        break;
6297
 
6298
      case COUPON_CODE:
6299
        if (value == null) {
6300
          unsetCouponCode();
6301
        } else {
6302
          setCouponCode((String)value);
6303
        }
6304
        break;
6305
 
6306
      }
6307
    }
6308
 
6309
    public Object getFieldValue(_Fields field) {
6310
      switch (field) {
6311
      case PROMOTION_ID:
3430 rajveer 6312
        return Long.valueOf(getPromotionId());
1982 varun.gupt 6313
 
6314
      case COUPON_CODE:
6315
        return getCouponCode();
6316
 
6317
      }
6318
      throw new IllegalStateException();
6319
    }
6320
 
3430 rajveer 6321
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6322
    public boolean isSet(_Fields field) {
6323
      if (field == null) {
6324
        throw new IllegalArgumentException();
6325
      }
1982 varun.gupt 6326
 
6327
      switch (field) {
6328
      case PROMOTION_ID:
6329
        return isSetPromotionId();
6330
      case COUPON_CODE:
6331
        return isSetCouponCode();
6332
      }
6333
      throw new IllegalStateException();
6334
    }
6335
 
6336
    @Override
6337
    public boolean equals(Object that) {
6338
      if (that == null)
6339
        return false;
6340
      if (that instanceof generateCouponsForPromotion_args)
6341
        return this.equals((generateCouponsForPromotion_args)that);
6342
      return false;
6343
    }
6344
 
6345
    public boolean equals(generateCouponsForPromotion_args that) {
6346
      if (that == null)
6347
        return false;
6348
 
6349
      boolean this_present_promotionId = true;
6350
      boolean that_present_promotionId = true;
6351
      if (this_present_promotionId || that_present_promotionId) {
6352
        if (!(this_present_promotionId && that_present_promotionId))
6353
          return false;
6354
        if (this.promotionId != that.promotionId)
6355
          return false;
6356
      }
6357
 
6358
      boolean this_present_couponCode = true && this.isSetCouponCode();
6359
      boolean that_present_couponCode = true && that.isSetCouponCode();
6360
      if (this_present_couponCode || that_present_couponCode) {
6361
        if (!(this_present_couponCode && that_present_couponCode))
6362
          return false;
6363
        if (!this.couponCode.equals(that.couponCode))
6364
          return false;
6365
      }
6366
 
6367
      return true;
6368
    }
6369
 
6370
    @Override
6371
    public int hashCode() {
6372
      return 0;
6373
    }
6374
 
6375
    public int compareTo(generateCouponsForPromotion_args other) {
6376
      if (!getClass().equals(other.getClass())) {
6377
        return getClass().getName().compareTo(other.getClass().getName());
6378
      }
6379
 
6380
      int lastComparison = 0;
6381
      generateCouponsForPromotion_args typedOther = (generateCouponsForPromotion_args)other;
6382
 
3430 rajveer 6383
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 6384
      if (lastComparison != 0) {
6385
        return lastComparison;
6386
      }
3430 rajveer 6387
      if (isSetPromotionId()) {
6388
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
6389
        if (lastComparison != 0) {
6390
          return lastComparison;
6391
        }
1982 varun.gupt 6392
      }
3430 rajveer 6393
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 6394
      if (lastComparison != 0) {
6395
        return lastComparison;
6396
      }
3430 rajveer 6397
      if (isSetCouponCode()) {
6398
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
6399
        if (lastComparison != 0) {
6400
          return lastComparison;
6401
        }
1982 varun.gupt 6402
      }
6403
      return 0;
6404
    }
6405
 
3430 rajveer 6406
    public _Fields fieldForId(int fieldId) {
6407
      return _Fields.findByThriftId(fieldId);
6408
    }
6409
 
6410
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6411
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6412
      iprot.readStructBegin();
6413
      while (true)
6414
      {
6415
        field = iprot.readFieldBegin();
3430 rajveer 6416
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6417
          break;
6418
        }
3430 rajveer 6419
        switch (field.id) {
6420
          case 1: // PROMOTION_ID
6421
            if (field.type == org.apache.thrift.protocol.TType.I64) {
6422
              this.promotionId = iprot.readI64();
6423
              setPromotionIdIsSet(true);
6424
            } else { 
6425
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6426
            }
6427
            break;
6428
          case 2: // COUPON_CODE
6429
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
6430
              this.couponCode = iprot.readString();
6431
            } else { 
6432
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6433
            }
6434
            break;
6435
          default:
6436
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6437
        }
3430 rajveer 6438
        iprot.readFieldEnd();
1982 varun.gupt 6439
      }
6440
      iprot.readStructEnd();
6441
      validate();
6442
    }
6443
 
3430 rajveer 6444
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6445
      validate();
6446
 
6447
      oprot.writeStructBegin(STRUCT_DESC);
6448
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
6449
      oprot.writeI64(this.promotionId);
6450
      oprot.writeFieldEnd();
6451
      if (this.couponCode != null) {
6452
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
6453
        oprot.writeString(this.couponCode);
6454
        oprot.writeFieldEnd();
6455
      }
6456
      oprot.writeFieldStop();
6457
      oprot.writeStructEnd();
6458
    }
6459
 
6460
    @Override
6461
    public String toString() {
6462
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_args(");
6463
      boolean first = true;
6464
 
6465
      sb.append("promotionId:");
6466
      sb.append(this.promotionId);
6467
      first = false;
6468
      if (!first) sb.append(", ");
6469
      sb.append("couponCode:");
6470
      if (this.couponCode == null) {
6471
        sb.append("null");
6472
      } else {
6473
        sb.append(this.couponCode);
6474
      }
6475
      first = false;
6476
      sb.append(")");
6477
      return sb.toString();
6478
    }
6479
 
3430 rajveer 6480
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6481
      // check for required fields
6482
    }
6483
 
3430 rajveer 6484
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6485
      try {
6486
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6487
      } catch (org.apache.thrift.TException te) {
6488
        throw new java.io.IOException(te);
6489
      }
6490
    }
6491
 
6492
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6493
      try {
6494
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
6495
        __isset_bit_vector = new BitSet(1);
6496
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6497
      } catch (org.apache.thrift.TException te) {
6498
        throw new java.io.IOException(te);
6499
      }
6500
    }
6501
 
1982 varun.gupt 6502
  }
6503
 
3430 rajveer 6504
  public static class generateCouponsForPromotion_result implements org.apache.thrift.TBase<generateCouponsForPromotion_result, generateCouponsForPromotion_result._Fields>, java.io.Serializable, Cloneable   {
6505
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_result");
1982 varun.gupt 6506
 
3430 rajveer 6507
    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 6508
 
3430 rajveer 6509
    private PromotionException pex; // required
1982 varun.gupt 6510
 
6511
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6512
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6513
      PEX((short)1, "pex");
6514
 
6515
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6516
 
6517
      static {
6518
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6519
          byName.put(field.getFieldName(), field);
6520
        }
6521
      }
6522
 
6523
      /**
6524
       * Find the _Fields constant that matches fieldId, or null if its not found.
6525
       */
6526
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6527
        switch(fieldId) {
6528
          case 1: // PEX
6529
            return PEX;
6530
          default:
6531
            return null;
6532
        }
1982 varun.gupt 6533
      }
6534
 
6535
      /**
6536
       * Find the _Fields constant that matches fieldId, throwing an exception
6537
       * if it is not found.
6538
       */
6539
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6540
        _Fields fields = findByThriftId(fieldId);
6541
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6542
        return fields;
6543
      }
6544
 
6545
      /**
6546
       * Find the _Fields constant that matches name, or null if its not found.
6547
       */
6548
      public static _Fields findByName(String name) {
6549
        return byName.get(name);
6550
      }
6551
 
6552
      private final short _thriftId;
6553
      private final String _fieldName;
6554
 
6555
      _Fields(short thriftId, String fieldName) {
6556
        _thriftId = thriftId;
6557
        _fieldName = fieldName;
6558
      }
6559
 
6560
      public short getThriftFieldId() {
6561
        return _thriftId;
6562
      }
6563
 
6564
      public String getFieldName() {
6565
        return _fieldName;
6566
      }
6567
    }
6568
 
6569
    // isset id assignments
6570
 
3430 rajveer 6571
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6572
    static {
3430 rajveer 6573
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6574
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6575
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
6576
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6577
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_result.class, metaDataMap);
1982 varun.gupt 6578
    }
6579
 
6580
    public generateCouponsForPromotion_result() {
6581
    }
6582
 
6583
    public generateCouponsForPromotion_result(
6584
      PromotionException pex)
6585
    {
6586
      this();
6587
      this.pex = pex;
6588
    }
6589
 
6590
    /**
6591
     * Performs a deep copy on <i>other</i>.
6592
     */
6593
    public generateCouponsForPromotion_result(generateCouponsForPromotion_result other) {
6594
      if (other.isSetPex()) {
6595
        this.pex = new PromotionException(other.pex);
6596
      }
6597
    }
6598
 
6599
    public generateCouponsForPromotion_result deepCopy() {
6600
      return new generateCouponsForPromotion_result(this);
6601
    }
6602
 
3430 rajveer 6603
    @Override
6604
    public void clear() {
6605
      this.pex = null;
1982 varun.gupt 6606
    }
6607
 
6608
    public PromotionException getPex() {
6609
      return this.pex;
6610
    }
6611
 
3430 rajveer 6612
    public void setPex(PromotionException pex) {
1982 varun.gupt 6613
      this.pex = pex;
6614
    }
6615
 
6616
    public void unsetPex() {
6617
      this.pex = null;
6618
    }
6619
 
3430 rajveer 6620
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6621
    public boolean isSetPex() {
6622
      return this.pex != null;
6623
    }
6624
 
6625
    public void setPexIsSet(boolean value) {
6626
      if (!value) {
6627
        this.pex = null;
6628
      }
6629
    }
6630
 
6631
    public void setFieldValue(_Fields field, Object value) {
6632
      switch (field) {
6633
      case PEX:
6634
        if (value == null) {
6635
          unsetPex();
6636
        } else {
6637
          setPex((PromotionException)value);
6638
        }
6639
        break;
6640
 
6641
      }
6642
    }
6643
 
6644
    public Object getFieldValue(_Fields field) {
6645
      switch (field) {
6646
      case PEX:
6647
        return getPex();
6648
 
6649
      }
6650
      throw new IllegalStateException();
6651
    }
6652
 
3430 rajveer 6653
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6654
    public boolean isSet(_Fields field) {
6655
      if (field == null) {
6656
        throw new IllegalArgumentException();
6657
      }
1982 varun.gupt 6658
 
6659
      switch (field) {
6660
      case PEX:
6661
        return isSetPex();
6662
      }
6663
      throw new IllegalStateException();
6664
    }
6665
 
6666
    @Override
6667
    public boolean equals(Object that) {
6668
      if (that == null)
6669
        return false;
6670
      if (that instanceof generateCouponsForPromotion_result)
6671
        return this.equals((generateCouponsForPromotion_result)that);
6672
      return false;
6673
    }
6674
 
6675
    public boolean equals(generateCouponsForPromotion_result that) {
6676
      if (that == null)
6677
        return false;
6678
 
6679
      boolean this_present_pex = true && this.isSetPex();
6680
      boolean that_present_pex = true && that.isSetPex();
6681
      if (this_present_pex || that_present_pex) {
6682
        if (!(this_present_pex && that_present_pex))
6683
          return false;
6684
        if (!this.pex.equals(that.pex))
6685
          return false;
6686
      }
6687
 
6688
      return true;
6689
    }
6690
 
6691
    @Override
6692
    public int hashCode() {
6693
      return 0;
6694
    }
6695
 
6696
    public int compareTo(generateCouponsForPromotion_result other) {
6697
      if (!getClass().equals(other.getClass())) {
6698
        return getClass().getName().compareTo(other.getClass().getName());
6699
      }
6700
 
6701
      int lastComparison = 0;
6702
      generateCouponsForPromotion_result typedOther = (generateCouponsForPromotion_result)other;
6703
 
3430 rajveer 6704
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 6705
      if (lastComparison != 0) {
6706
        return lastComparison;
6707
      }
3430 rajveer 6708
      if (isSetPex()) {
6709
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
6710
        if (lastComparison != 0) {
6711
          return lastComparison;
6712
        }
1982 varun.gupt 6713
      }
6714
      return 0;
6715
    }
6716
 
3430 rajveer 6717
    public _Fields fieldForId(int fieldId) {
6718
      return _Fields.findByThriftId(fieldId);
6719
    }
6720
 
6721
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6722
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6723
      iprot.readStructBegin();
6724
      while (true)
6725
      {
6726
        field = iprot.readFieldBegin();
3430 rajveer 6727
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6728
          break;
6729
        }
3430 rajveer 6730
        switch (field.id) {
6731
          case 1: // PEX
6732
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6733
              this.pex = new PromotionException();
6734
              this.pex.read(iprot);
6735
            } else { 
6736
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6737
            }
6738
            break;
6739
          default:
6740
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6741
        }
3430 rajveer 6742
        iprot.readFieldEnd();
1982 varun.gupt 6743
      }
6744
      iprot.readStructEnd();
6745
      validate();
6746
    }
6747
 
3430 rajveer 6748
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6749
      oprot.writeStructBegin(STRUCT_DESC);
6750
 
6751
      if (this.isSetPex()) {
6752
        oprot.writeFieldBegin(PEX_FIELD_DESC);
6753
        this.pex.write(oprot);
6754
        oprot.writeFieldEnd();
6755
      }
6756
      oprot.writeFieldStop();
6757
      oprot.writeStructEnd();
6758
    }
6759
 
6760
    @Override
6761
    public String toString() {
6762
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_result(");
6763
      boolean first = true;
6764
 
6765
      sb.append("pex:");
6766
      if (this.pex == null) {
6767
        sb.append("null");
6768
      } else {
6769
        sb.append(this.pex);
6770
      }
6771
      first = false;
6772
      sb.append(")");
6773
      return sb.toString();
6774
    }
6775
 
3430 rajveer 6776
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6777
      // check for required fields
6778
    }
6779
 
3430 rajveer 6780
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6781
      try {
6782
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6783
      } catch (org.apache.thrift.TException te) {
6784
        throw new java.io.IOException(te);
6785
      }
6786
    }
6787
 
6788
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6789
      try {
6790
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6791
      } catch (org.apache.thrift.TException te) {
6792
        throw new java.io.IOException(te);
6793
      }
6794
    }
6795
 
1982 varun.gupt 6796
  }
6797
 
3430 rajveer 6798
  public static class applyCoupon_args implements org.apache.thrift.TBase<applyCoupon_args, applyCoupon_args._Fields>, java.io.Serializable, Cloneable   {
6799
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_args");
1982 varun.gupt 6800
 
3430 rajveer 6801
    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);
6802
    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 6803
 
3430 rajveer 6804
    private String couponCode; // required
6805
    private long cartId; // required
1982 varun.gupt 6806
 
6807
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6808
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6809
      COUPON_CODE((short)1, "couponCode"),
6810
      CART_ID((short)2, "cartId");
6811
 
6812
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6813
 
6814
      static {
6815
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6816
          byName.put(field.getFieldName(), field);
6817
        }
6818
      }
6819
 
6820
      /**
6821
       * Find the _Fields constant that matches fieldId, or null if its not found.
6822
       */
6823
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6824
        switch(fieldId) {
6825
          case 1: // COUPON_CODE
6826
            return COUPON_CODE;
6827
          case 2: // CART_ID
6828
            return CART_ID;
6829
          default:
6830
            return null;
6831
        }
1982 varun.gupt 6832
      }
6833
 
6834
      /**
6835
       * Find the _Fields constant that matches fieldId, throwing an exception
6836
       * if it is not found.
6837
       */
6838
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6839
        _Fields fields = findByThriftId(fieldId);
6840
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6841
        return fields;
6842
      }
6843
 
6844
      /**
6845
       * Find the _Fields constant that matches name, or null if its not found.
6846
       */
6847
      public static _Fields findByName(String name) {
6848
        return byName.get(name);
6849
      }
6850
 
6851
      private final short _thriftId;
6852
      private final String _fieldName;
6853
 
6854
      _Fields(short thriftId, String fieldName) {
6855
        _thriftId = thriftId;
6856
        _fieldName = fieldName;
6857
      }
6858
 
6859
      public short getThriftFieldId() {
6860
        return _thriftId;
6861
      }
6862
 
6863
      public String getFieldName() {
6864
        return _fieldName;
6865
      }
6866
    }
6867
 
6868
    // isset id assignments
6869
    private static final int __CARTID_ISSET_ID = 0;
6870
    private BitSet __isset_bit_vector = new BitSet(1);
6871
 
3430 rajveer 6872
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6873
    static {
3430 rajveer 6874
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6875
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6876
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6877
      tmpMap.put(_Fields.CART_ID, new org.apache.thrift.meta_data.FieldMetaData("cartId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6878
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6879
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6880
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_args.class, metaDataMap);
1982 varun.gupt 6881
    }
6882
 
6883
    public applyCoupon_args() {
6884
    }
6885
 
6886
    public applyCoupon_args(
6887
      String couponCode,
6888
      long cartId)
6889
    {
6890
      this();
6891
      this.couponCode = couponCode;
6892
      this.cartId = cartId;
6893
      setCartIdIsSet(true);
6894
    }
6895
 
6896
    /**
6897
     * Performs a deep copy on <i>other</i>.
6898
     */
6899
    public applyCoupon_args(applyCoupon_args other) {
6900
      __isset_bit_vector.clear();
6901
      __isset_bit_vector.or(other.__isset_bit_vector);
6902
      if (other.isSetCouponCode()) {
6903
        this.couponCode = other.couponCode;
6904
      }
6905
      this.cartId = other.cartId;
6906
    }
6907
 
6908
    public applyCoupon_args deepCopy() {
6909
      return new applyCoupon_args(this);
6910
    }
6911
 
3430 rajveer 6912
    @Override
6913
    public void clear() {
6914
      this.couponCode = null;
6915
      setCartIdIsSet(false);
6916
      this.cartId = 0;
1982 varun.gupt 6917
    }
6918
 
6919
    public String getCouponCode() {
6920
      return this.couponCode;
6921
    }
6922
 
3430 rajveer 6923
    public void setCouponCode(String couponCode) {
1982 varun.gupt 6924
      this.couponCode = couponCode;
6925
    }
6926
 
6927
    public void unsetCouponCode() {
6928
      this.couponCode = null;
6929
    }
6930
 
3430 rajveer 6931
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6932
    public boolean isSetCouponCode() {
6933
      return this.couponCode != null;
6934
    }
6935
 
6936
    public void setCouponCodeIsSet(boolean value) {
6937
      if (!value) {
6938
        this.couponCode = null;
6939
      }
6940
    }
6941
 
6942
    public long getCartId() {
6943
      return this.cartId;
6944
    }
6945
 
3430 rajveer 6946
    public void setCartId(long cartId) {
1982 varun.gupt 6947
      this.cartId = cartId;
6948
      setCartIdIsSet(true);
6949
    }
6950
 
6951
    public void unsetCartId() {
6952
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
6953
    }
6954
 
3430 rajveer 6955
    /** Returns true if field cartId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6956
    public boolean isSetCartId() {
6957
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
6958
    }
6959
 
6960
    public void setCartIdIsSet(boolean value) {
6961
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
6962
    }
6963
 
6964
    public void setFieldValue(_Fields field, Object value) {
6965
      switch (field) {
6966
      case COUPON_CODE:
6967
        if (value == null) {
6968
          unsetCouponCode();
6969
        } else {
6970
          setCouponCode((String)value);
6971
        }
6972
        break;
6973
 
6974
      case CART_ID:
6975
        if (value == null) {
6976
          unsetCartId();
6977
        } else {
6978
          setCartId((Long)value);
6979
        }
6980
        break;
6981
 
6982
      }
6983
    }
6984
 
6985
    public Object getFieldValue(_Fields field) {
6986
      switch (field) {
6987
      case COUPON_CODE:
6988
        return getCouponCode();
6989
 
6990
      case CART_ID:
3430 rajveer 6991
        return Long.valueOf(getCartId());
1982 varun.gupt 6992
 
6993
      }
6994
      throw new IllegalStateException();
6995
    }
6996
 
3430 rajveer 6997
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6998
    public boolean isSet(_Fields field) {
6999
      if (field == null) {
7000
        throw new IllegalArgumentException();
7001
      }
1982 varun.gupt 7002
 
7003
      switch (field) {
7004
      case COUPON_CODE:
7005
        return isSetCouponCode();
7006
      case CART_ID:
7007
        return isSetCartId();
7008
      }
7009
      throw new IllegalStateException();
7010
    }
7011
 
7012
    @Override
7013
    public boolean equals(Object that) {
7014
      if (that == null)
7015
        return false;
7016
      if (that instanceof applyCoupon_args)
7017
        return this.equals((applyCoupon_args)that);
7018
      return false;
7019
    }
7020
 
7021
    public boolean equals(applyCoupon_args that) {
7022
      if (that == null)
7023
        return false;
7024
 
7025
      boolean this_present_couponCode = true && this.isSetCouponCode();
7026
      boolean that_present_couponCode = true && that.isSetCouponCode();
7027
      if (this_present_couponCode || that_present_couponCode) {
7028
        if (!(this_present_couponCode && that_present_couponCode))
7029
          return false;
7030
        if (!this.couponCode.equals(that.couponCode))
7031
          return false;
7032
      }
7033
 
7034
      boolean this_present_cartId = true;
7035
      boolean that_present_cartId = true;
7036
      if (this_present_cartId || that_present_cartId) {
7037
        if (!(this_present_cartId && that_present_cartId))
7038
          return false;
7039
        if (this.cartId != that.cartId)
7040
          return false;
7041
      }
7042
 
7043
      return true;
7044
    }
7045
 
7046
    @Override
7047
    public int hashCode() {
7048
      return 0;
7049
    }
7050
 
7051
    public int compareTo(applyCoupon_args other) {
7052
      if (!getClass().equals(other.getClass())) {
7053
        return getClass().getName().compareTo(other.getClass().getName());
7054
      }
7055
 
7056
      int lastComparison = 0;
7057
      applyCoupon_args typedOther = (applyCoupon_args)other;
7058
 
3430 rajveer 7059
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 7060
      if (lastComparison != 0) {
7061
        return lastComparison;
7062
      }
3430 rajveer 7063
      if (isSetCouponCode()) {
7064
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
7065
        if (lastComparison != 0) {
7066
          return lastComparison;
7067
        }
1982 varun.gupt 7068
      }
3430 rajveer 7069
      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(typedOther.isSetCartId());
1982 varun.gupt 7070
      if (lastComparison != 0) {
7071
        return lastComparison;
7072
      }
3430 rajveer 7073
      if (isSetCartId()) {
7074
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cartId, typedOther.cartId);
7075
        if (lastComparison != 0) {
7076
          return lastComparison;
7077
        }
1982 varun.gupt 7078
      }
7079
      return 0;
7080
    }
7081
 
3430 rajveer 7082
    public _Fields fieldForId(int fieldId) {
7083
      return _Fields.findByThriftId(fieldId);
7084
    }
7085
 
7086
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7087
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 7088
      iprot.readStructBegin();
7089
      while (true)
7090
      {
7091
        field = iprot.readFieldBegin();
3430 rajveer 7092
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 7093
          break;
7094
        }
3430 rajveer 7095
        switch (field.id) {
7096
          case 1: // COUPON_CODE
7097
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
7098
              this.couponCode = iprot.readString();
7099
            } else { 
7100
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7101
            }
7102
            break;
7103
          case 2: // CART_ID
7104
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7105
              this.cartId = iprot.readI64();
7106
              setCartIdIsSet(true);
7107
            } else { 
7108
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7109
            }
7110
            break;
7111
          default:
7112
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 7113
        }
3430 rajveer 7114
        iprot.readFieldEnd();
1982 varun.gupt 7115
      }
7116
      iprot.readStructEnd();
7117
      validate();
7118
    }
7119
 
3430 rajveer 7120
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 7121
      validate();
7122
 
7123
      oprot.writeStructBegin(STRUCT_DESC);
7124
      if (this.couponCode != null) {
7125
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
7126
        oprot.writeString(this.couponCode);
7127
        oprot.writeFieldEnd();
7128
      }
7129
      oprot.writeFieldBegin(CART_ID_FIELD_DESC);
7130
      oprot.writeI64(this.cartId);
7131
      oprot.writeFieldEnd();
7132
      oprot.writeFieldStop();
7133
      oprot.writeStructEnd();
7134
    }
7135
 
7136
    @Override
7137
    public String toString() {
7138
      StringBuilder sb = new StringBuilder("applyCoupon_args(");
7139
      boolean first = true;
7140
 
7141
      sb.append("couponCode:");
7142
      if (this.couponCode == null) {
7143
        sb.append("null");
7144
      } else {
7145
        sb.append(this.couponCode);
7146
      }
7147
      first = false;
7148
      if (!first) sb.append(", ");
7149
      sb.append("cartId:");
7150
      sb.append(this.cartId);
7151
      first = false;
7152
      sb.append(")");
7153
      return sb.toString();
7154
    }
7155
 
3430 rajveer 7156
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7157
      // check for required fields
7158
    }
7159
 
3430 rajveer 7160
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7161
      try {
7162
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7163
      } catch (org.apache.thrift.TException te) {
7164
        throw new java.io.IOException(te);
7165
      }
7166
    }
7167
 
7168
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7169
      try {
7170
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
7171
        __isset_bit_vector = new BitSet(1);
7172
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7173
      } catch (org.apache.thrift.TException te) {
7174
        throw new java.io.IOException(te);
7175
      }
7176
    }
7177
 
1982 varun.gupt 7178
  }
7179
 
3430 rajveer 7180
  public static class applyCoupon_result implements org.apache.thrift.TBase<applyCoupon_result, applyCoupon_result._Fields>, java.io.Serializable, Cloneable   {
7181
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_result");
1982 varun.gupt 7182
 
3430 rajveer 7183
    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);
7184
    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 7185
 
3430 rajveer 7186
    private Cart success; // required
7187
    private PromotionException pex; // required
1982 varun.gupt 7188
 
7189
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7190
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 7191
      SUCCESS((short)0, "success"),
7192
      PEX((short)1, "pex");
7193
 
7194
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7195
 
7196
      static {
7197
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7198
          byName.put(field.getFieldName(), field);
7199
        }
7200
      }
7201
 
7202
      /**
7203
       * Find the _Fields constant that matches fieldId, or null if its not found.
7204
       */
7205
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7206
        switch(fieldId) {
7207
          case 0: // SUCCESS
7208
            return SUCCESS;
7209
          case 1: // PEX
7210
            return PEX;
7211
          default:
7212
            return null;
7213
        }
1982 varun.gupt 7214
      }
7215
 
7216
      /**
7217
       * Find the _Fields constant that matches fieldId, throwing an exception
7218
       * if it is not found.
7219
       */
7220
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7221
        _Fields fields = findByThriftId(fieldId);
7222
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7223
        return fields;
7224
      }
7225
 
7226
      /**
7227
       * Find the _Fields constant that matches name, or null if its not found.
7228
       */
7229
      public static _Fields findByName(String name) {
7230
        return byName.get(name);
7231
      }
7232
 
7233
      private final short _thriftId;
7234
      private final String _fieldName;
7235
 
7236
      _Fields(short thriftId, String fieldName) {
7237
        _thriftId = thriftId;
7238
        _fieldName = fieldName;
7239
      }
7240
 
7241
      public short getThriftFieldId() {
7242
        return _thriftId;
7243
      }
7244
 
7245
      public String getFieldName() {
7246
        return _fieldName;
7247
      }
7248
    }
7249
 
7250
    // isset id assignments
7251
 
3430 rajveer 7252
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 7253
    static {
3430 rajveer 7254
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7255
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7256
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Cart.class)));
7257
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7258
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
7259
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7260
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_result.class, metaDataMap);
1982 varun.gupt 7261
    }
7262
 
7263
    public applyCoupon_result() {
7264
    }
7265
 
7266
    public applyCoupon_result(
7267
      Cart success,
7268
      PromotionException pex)
7269
    {
7270
      this();
7271
      this.success = success;
7272
      this.pex = pex;
7273
    }
7274
 
7275
    /**
7276
     * Performs a deep copy on <i>other</i>.
7277
     */
7278
    public applyCoupon_result(applyCoupon_result other) {
7279
      if (other.isSetSuccess()) {
7280
        this.success = new Cart(other.success);
7281
      }
7282
      if (other.isSetPex()) {
7283
        this.pex = new PromotionException(other.pex);
7284
      }
7285
    }
7286
 
7287
    public applyCoupon_result deepCopy() {
7288
      return new applyCoupon_result(this);
7289
    }
7290
 
3430 rajveer 7291
    @Override
7292
    public void clear() {
7293
      this.success = null;
7294
      this.pex = null;
1982 varun.gupt 7295
    }
7296
 
7297
    public Cart getSuccess() {
7298
      return this.success;
7299
    }
7300
 
3430 rajveer 7301
    public void setSuccess(Cart success) {
1982 varun.gupt 7302
      this.success = success;
7303
    }
7304
 
7305
    public void unsetSuccess() {
7306
      this.success = null;
7307
    }
7308
 
3430 rajveer 7309
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7310
    public boolean isSetSuccess() {
7311
      return this.success != null;
7312
    }
7313
 
7314
    public void setSuccessIsSet(boolean value) {
7315
      if (!value) {
7316
        this.success = null;
7317
      }
7318
    }
7319
 
7320
    public PromotionException getPex() {
7321
      return this.pex;
7322
    }
7323
 
3430 rajveer 7324
    public void setPex(PromotionException pex) {
1982 varun.gupt 7325
      this.pex = pex;
7326
    }
7327
 
7328
    public void unsetPex() {
7329
      this.pex = null;
7330
    }
7331
 
3430 rajveer 7332
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7333
    public boolean isSetPex() {
7334
      return this.pex != null;
7335
    }
7336
 
7337
    public void setPexIsSet(boolean value) {
7338
      if (!value) {
7339
        this.pex = null;
7340
      }
7341
    }
7342
 
7343
    public void setFieldValue(_Fields field, Object value) {
7344
      switch (field) {
7345
      case SUCCESS:
7346
        if (value == null) {
7347
          unsetSuccess();
7348
        } else {
7349
          setSuccess((Cart)value);
7350
        }
7351
        break;
7352
 
7353
      case PEX:
7354
        if (value == null) {
7355
          unsetPex();
7356
        } else {
7357
          setPex((PromotionException)value);
7358
        }
7359
        break;
7360
 
7361
      }
7362
    }
7363
 
7364
    public Object getFieldValue(_Fields field) {
7365
      switch (field) {
7366
      case SUCCESS:
7367
        return getSuccess();
7368
 
7369
      case PEX:
7370
        return getPex();
7371
 
7372
      }
7373
      throw new IllegalStateException();
7374
    }
7375
 
3430 rajveer 7376
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7377
    public boolean isSet(_Fields field) {
7378
      if (field == null) {
7379
        throw new IllegalArgumentException();
7380
      }
1982 varun.gupt 7381
 
7382
      switch (field) {
7383
      case SUCCESS:
7384
        return isSetSuccess();
7385
      case PEX:
7386
        return isSetPex();
7387
      }
7388
      throw new IllegalStateException();
7389
    }
7390
 
7391
    @Override
7392
    public boolean equals(Object that) {
7393
      if (that == null)
7394
        return false;
7395
      if (that instanceof applyCoupon_result)
7396
        return this.equals((applyCoupon_result)that);
7397
      return false;
7398
    }
7399
 
7400
    public boolean equals(applyCoupon_result that) {
7401
      if (that == null)
7402
        return false;
7403
 
7404
      boolean this_present_success = true && this.isSetSuccess();
7405
      boolean that_present_success = true && that.isSetSuccess();
7406
      if (this_present_success || that_present_success) {
7407
        if (!(this_present_success && that_present_success))
7408
          return false;
7409
        if (!this.success.equals(that.success))
7410
          return false;
7411
      }
7412
 
7413
      boolean this_present_pex = true && this.isSetPex();
7414
      boolean that_present_pex = true && that.isSetPex();
7415
      if (this_present_pex || that_present_pex) {
7416
        if (!(this_present_pex && that_present_pex))
7417
          return false;
7418
        if (!this.pex.equals(that.pex))
7419
          return false;
7420
      }
7421
 
7422
      return true;
7423
    }
7424
 
7425
    @Override
7426
    public int hashCode() {
7427
      return 0;
7428
    }
7429
 
7430
    public int compareTo(applyCoupon_result other) {
7431
      if (!getClass().equals(other.getClass())) {
7432
        return getClass().getName().compareTo(other.getClass().getName());
7433
      }
7434
 
7435
      int lastComparison = 0;
7436
      applyCoupon_result typedOther = (applyCoupon_result)other;
7437
 
3430 rajveer 7438
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 7439
      if (lastComparison != 0) {
7440
        return lastComparison;
7441
      }
3430 rajveer 7442
      if (isSetSuccess()) {
7443
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
7444
        if (lastComparison != 0) {
7445
          return lastComparison;
7446
        }
1982 varun.gupt 7447
      }
3430 rajveer 7448
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 7449
      if (lastComparison != 0) {
7450
        return lastComparison;
7451
      }
3430 rajveer 7452
      if (isSetPex()) {
7453
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
7454
        if (lastComparison != 0) {
7455
          return lastComparison;
7456
        }
1982 varun.gupt 7457
      }
7458
      return 0;
7459
    }
7460
 
3430 rajveer 7461
    public _Fields fieldForId(int fieldId) {
7462
      return _Fields.findByThriftId(fieldId);
7463
    }
7464
 
7465
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7466
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 7467
      iprot.readStructBegin();
7468
      while (true)
7469
      {
7470
        field = iprot.readFieldBegin();
3430 rajveer 7471
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 7472
          break;
7473
        }
3430 rajveer 7474
        switch (field.id) {
7475
          case 0: // SUCCESS
7476
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
7477
              this.success = new Cart();
7478
              this.success.read(iprot);
7479
            } else { 
7480
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7481
            }
7482
            break;
7483
          case 1: // PEX
7484
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
7485
              this.pex = new PromotionException();
7486
              this.pex.read(iprot);
7487
            } else { 
7488
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7489
            }
7490
            break;
7491
          default:
7492
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 7493
        }
3430 rajveer 7494
        iprot.readFieldEnd();
1982 varun.gupt 7495
      }
7496
      iprot.readStructEnd();
7497
      validate();
7498
    }
7499
 
3430 rajveer 7500
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 7501
      oprot.writeStructBegin(STRUCT_DESC);
7502
 
7503
      if (this.isSetSuccess()) {
7504
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
7505
        this.success.write(oprot);
7506
        oprot.writeFieldEnd();
7507
      } else if (this.isSetPex()) {
7508
        oprot.writeFieldBegin(PEX_FIELD_DESC);
7509
        this.pex.write(oprot);
7510
        oprot.writeFieldEnd();
7511
      }
7512
      oprot.writeFieldStop();
7513
      oprot.writeStructEnd();
7514
    }
7515
 
7516
    @Override
7517
    public String toString() {
7518
      StringBuilder sb = new StringBuilder("applyCoupon_result(");
7519
      boolean first = true;
7520
 
7521
      sb.append("success:");
7522
      if (this.success == null) {
7523
        sb.append("null");
7524
      } else {
7525
        sb.append(this.success);
7526
      }
7527
      first = false;
7528
      if (!first) sb.append(", ");
7529
      sb.append("pex:");
7530
      if (this.pex == null) {
7531
        sb.append("null");
7532
      } else {
7533
        sb.append(this.pex);
7534
      }
7535
      first = false;
7536
      sb.append(")");
7537
      return sb.toString();
7538
    }
7539
 
3430 rajveer 7540
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7541
      // check for required fields
7542
    }
7543
 
3430 rajveer 7544
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7545
      try {
7546
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7547
      } catch (org.apache.thrift.TException te) {
7548
        throw new java.io.IOException(te);
7549
      }
7550
    }
7551
 
7552
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7553
      try {
7554
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7555
      } catch (org.apache.thrift.TException te) {
7556
        throw new java.io.IOException(te);
7557
      }
7558
    }
7559
 
1982 varun.gupt 7560
  }
7561
 
6433 anupam.sin 7562
  public static class applyRechargeCoupon_args implements org.apache.thrift.TBase<applyRechargeCoupon_args, applyRechargeCoupon_args._Fields>, java.io.Serializable, Cloneable   {
7563
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyRechargeCoupon_args");
7564
 
7565
    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);
7566
    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);
7567
    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);
7568
 
7569
    private String couponCode; // required
7570
    private long totalAmount; // required
7571
    private long userId; // required
7572
 
7573
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
7574
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
7575
      COUPON_CODE((short)1, "couponCode"),
7576
      TOTAL_AMOUNT((short)2, "totalAmount"),
7577
      USER_ID((short)3, "userId");
7578
 
7579
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7580
 
7581
      static {
7582
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7583
          byName.put(field.getFieldName(), field);
7584
        }
7585
      }
7586
 
7587
      /**
7588
       * Find the _Fields constant that matches fieldId, or null if its not found.
7589
       */
7590
      public static _Fields findByThriftId(int fieldId) {
7591
        switch(fieldId) {
7592
          case 1: // COUPON_CODE
7593
            return COUPON_CODE;
7594
          case 2: // TOTAL_AMOUNT
7595
            return TOTAL_AMOUNT;
7596
          case 3: // USER_ID
7597
            return USER_ID;
7598
          default:
7599
            return null;
7600
        }
7601
      }
7602
 
7603
      /**
7604
       * Find the _Fields constant that matches fieldId, throwing an exception
7605
       * if it is not found.
7606
       */
7607
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7608
        _Fields fields = findByThriftId(fieldId);
7609
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7610
        return fields;
7611
      }
7612
 
7613
      /**
7614
       * Find the _Fields constant that matches name, or null if its not found.
7615
       */
7616
      public static _Fields findByName(String name) {
7617
        return byName.get(name);
7618
      }
7619
 
7620
      private final short _thriftId;
7621
      private final String _fieldName;
7622
 
7623
      _Fields(short thriftId, String fieldName) {
7624
        _thriftId = thriftId;
7625
        _fieldName = fieldName;
7626
      }
7627
 
7628
      public short getThriftFieldId() {
7629
        return _thriftId;
7630
      }
7631
 
7632
      public String getFieldName() {
7633
        return _fieldName;
7634
      }
7635
    }
7636
 
7637
    // isset id assignments
7638
    private static final int __TOTALAMOUNT_ISSET_ID = 0;
7639
    private static final int __USERID_ISSET_ID = 1;
7640
    private BitSet __isset_bit_vector = new BitSet(2);
7641
 
7642
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
7643
    static {
7644
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7645
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7646
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
7647
      tmpMap.put(_Fields.TOTAL_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("totalAmount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7648
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7649
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7650
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7651
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7652
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyRechargeCoupon_args.class, metaDataMap);
7653
    }
7654
 
7655
    public applyRechargeCoupon_args() {
7656
    }
7657
 
7658
    public applyRechargeCoupon_args(
7659
      String couponCode,
7660
      long totalAmount,
7661
      long userId)
7662
    {
7663
      this();
7664
      this.couponCode = couponCode;
7665
      this.totalAmount = totalAmount;
7666
      setTotalAmountIsSet(true);
7667
      this.userId = userId;
7668
      setUserIdIsSet(true);
7669
    }
7670
 
7671
    /**
7672
     * Performs a deep copy on <i>other</i>.
7673
     */
7674
    public applyRechargeCoupon_args(applyRechargeCoupon_args other) {
7675
      __isset_bit_vector.clear();
7676
      __isset_bit_vector.or(other.__isset_bit_vector);
7677
      if (other.isSetCouponCode()) {
7678
        this.couponCode = other.couponCode;
7679
      }
7680
      this.totalAmount = other.totalAmount;
7681
      this.userId = other.userId;
7682
    }
7683
 
7684
    public applyRechargeCoupon_args deepCopy() {
7685
      return new applyRechargeCoupon_args(this);
7686
    }
7687
 
7688
    @Override
7689
    public void clear() {
7690
      this.couponCode = null;
7691
      setTotalAmountIsSet(false);
7692
      this.totalAmount = 0;
7693
      setUserIdIsSet(false);
7694
      this.userId = 0;
7695
    }
7696
 
7697
    public String getCouponCode() {
7698
      return this.couponCode;
7699
    }
7700
 
7701
    public void setCouponCode(String couponCode) {
7702
      this.couponCode = couponCode;
7703
    }
7704
 
7705
    public void unsetCouponCode() {
7706
      this.couponCode = null;
7707
    }
7708
 
7709
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
7710
    public boolean isSetCouponCode() {
7711
      return this.couponCode != null;
7712
    }
7713
 
7714
    public void setCouponCodeIsSet(boolean value) {
7715
      if (!value) {
7716
        this.couponCode = null;
7717
      }
7718
    }
7719
 
7720
    public long getTotalAmount() {
7721
      return this.totalAmount;
7722
    }
7723
 
7724
    public void setTotalAmount(long totalAmount) {
7725
      this.totalAmount = totalAmount;
7726
      setTotalAmountIsSet(true);
7727
    }
7728
 
7729
    public void unsetTotalAmount() {
7730
      __isset_bit_vector.clear(__TOTALAMOUNT_ISSET_ID);
7731
    }
7732
 
7733
    /** Returns true if field totalAmount is set (has been assigned a value) and false otherwise */
7734
    public boolean isSetTotalAmount() {
7735
      return __isset_bit_vector.get(__TOTALAMOUNT_ISSET_ID);
7736
    }
7737
 
7738
    public void setTotalAmountIsSet(boolean value) {
7739
      __isset_bit_vector.set(__TOTALAMOUNT_ISSET_ID, value);
7740
    }
7741
 
7742
    public long getUserId() {
7743
      return this.userId;
7744
    }
7745
 
7746
    public void setUserId(long userId) {
7747
      this.userId = userId;
7748
      setUserIdIsSet(true);
7749
    }
7750
 
7751
    public void unsetUserId() {
7752
      __isset_bit_vector.clear(__USERID_ISSET_ID);
7753
    }
7754
 
7755
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
7756
    public boolean isSetUserId() {
7757
      return __isset_bit_vector.get(__USERID_ISSET_ID);
7758
    }
7759
 
7760
    public void setUserIdIsSet(boolean value) {
7761
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
7762
    }
7763
 
7764
    public void setFieldValue(_Fields field, Object value) {
7765
      switch (field) {
7766
      case COUPON_CODE:
7767
        if (value == null) {
7768
          unsetCouponCode();
7769
        } else {
7770
          setCouponCode((String)value);
7771
        }
7772
        break;
7773
 
7774
      case TOTAL_AMOUNT:
7775
        if (value == null) {
7776
          unsetTotalAmount();
7777
        } else {
7778
          setTotalAmount((Long)value);
7779
        }
7780
        break;
7781
 
7782
      case USER_ID:
7783
        if (value == null) {
7784
          unsetUserId();
7785
        } else {
7786
          setUserId((Long)value);
7787
        }
7788
        break;
7789
 
7790
      }
7791
    }
7792
 
7793
    public Object getFieldValue(_Fields field) {
7794
      switch (field) {
7795
      case COUPON_CODE:
7796
        return getCouponCode();
7797
 
7798
      case TOTAL_AMOUNT:
7799
        return Long.valueOf(getTotalAmount());
7800
 
7801
      case USER_ID:
7802
        return Long.valueOf(getUserId());
7803
 
7804
      }
7805
      throw new IllegalStateException();
7806
    }
7807
 
7808
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7809
    public boolean isSet(_Fields field) {
7810
      if (field == null) {
7811
        throw new IllegalArgumentException();
7812
      }
7813
 
7814
      switch (field) {
7815
      case COUPON_CODE:
7816
        return isSetCouponCode();
7817
      case TOTAL_AMOUNT:
7818
        return isSetTotalAmount();
7819
      case USER_ID:
7820
        return isSetUserId();
7821
      }
7822
      throw new IllegalStateException();
7823
    }
7824
 
7825
    @Override
7826
    public boolean equals(Object that) {
7827
      if (that == null)
7828
        return false;
7829
      if (that instanceof applyRechargeCoupon_args)
7830
        return this.equals((applyRechargeCoupon_args)that);
7831
      return false;
7832
    }
7833
 
7834
    public boolean equals(applyRechargeCoupon_args that) {
7835
      if (that == null)
7836
        return false;
7837
 
7838
      boolean this_present_couponCode = true && this.isSetCouponCode();
7839
      boolean that_present_couponCode = true && that.isSetCouponCode();
7840
      if (this_present_couponCode || that_present_couponCode) {
7841
        if (!(this_present_couponCode && that_present_couponCode))
7842
          return false;
7843
        if (!this.couponCode.equals(that.couponCode))
7844
          return false;
7845
      }
7846
 
7847
      boolean this_present_totalAmount = true;
7848
      boolean that_present_totalAmount = true;
7849
      if (this_present_totalAmount || that_present_totalAmount) {
7850
        if (!(this_present_totalAmount && that_present_totalAmount))
7851
          return false;
7852
        if (this.totalAmount != that.totalAmount)
7853
          return false;
7854
      }
7855
 
7856
      boolean this_present_userId = true;
7857
      boolean that_present_userId = true;
7858
      if (this_present_userId || that_present_userId) {
7859
        if (!(this_present_userId && that_present_userId))
7860
          return false;
7861
        if (this.userId != that.userId)
7862
          return false;
7863
      }
7864
 
7865
      return true;
7866
    }
7867
 
7868
    @Override
7869
    public int hashCode() {
7870
      return 0;
7871
    }
7872
 
7873
    public int compareTo(applyRechargeCoupon_args other) {
7874
      if (!getClass().equals(other.getClass())) {
7875
        return getClass().getName().compareTo(other.getClass().getName());
7876
      }
7877
 
7878
      int lastComparison = 0;
7879
      applyRechargeCoupon_args typedOther = (applyRechargeCoupon_args)other;
7880
 
7881
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
7882
      if (lastComparison != 0) {
7883
        return lastComparison;
7884
      }
7885
      if (isSetCouponCode()) {
7886
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
7887
        if (lastComparison != 0) {
7888
          return lastComparison;
7889
        }
7890
      }
7891
      lastComparison = Boolean.valueOf(isSetTotalAmount()).compareTo(typedOther.isSetTotalAmount());
7892
      if (lastComparison != 0) {
7893
        return lastComparison;
7894
      }
7895
      if (isSetTotalAmount()) {
7896
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.totalAmount, typedOther.totalAmount);
7897
        if (lastComparison != 0) {
7898
          return lastComparison;
7899
        }
7900
      }
7901
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
7902
      if (lastComparison != 0) {
7903
        return lastComparison;
7904
      }
7905
      if (isSetUserId()) {
7906
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
7907
        if (lastComparison != 0) {
7908
          return lastComparison;
7909
        }
7910
      }
7911
      return 0;
7912
    }
7913
 
7914
    public _Fields fieldForId(int fieldId) {
7915
      return _Fields.findByThriftId(fieldId);
7916
    }
7917
 
7918
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7919
      org.apache.thrift.protocol.TField field;
7920
      iprot.readStructBegin();
7921
      while (true)
7922
      {
7923
        field = iprot.readFieldBegin();
7924
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
7925
          break;
7926
        }
7927
        switch (field.id) {
7928
          case 1: // COUPON_CODE
7929
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
7930
              this.couponCode = iprot.readString();
7931
            } else { 
7932
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7933
            }
7934
            break;
7935
          case 2: // TOTAL_AMOUNT
7936
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7937
              this.totalAmount = iprot.readI64();
7938
              setTotalAmountIsSet(true);
7939
            } else { 
7940
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7941
            }
7942
            break;
7943
          case 3: // USER_ID
7944
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7945
              this.userId = iprot.readI64();
7946
              setUserIdIsSet(true);
7947
            } else { 
7948
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7949
            }
7950
            break;
7951
          default:
7952
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7953
        }
7954
        iprot.readFieldEnd();
7955
      }
7956
      iprot.readStructEnd();
7957
      validate();
7958
    }
7959
 
7960
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
7961
      validate();
7962
 
7963
      oprot.writeStructBegin(STRUCT_DESC);
7964
      if (this.couponCode != null) {
7965
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
7966
        oprot.writeString(this.couponCode);
7967
        oprot.writeFieldEnd();
7968
      }
7969
      oprot.writeFieldBegin(TOTAL_AMOUNT_FIELD_DESC);
7970
      oprot.writeI64(this.totalAmount);
7971
      oprot.writeFieldEnd();
7972
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
7973
      oprot.writeI64(this.userId);
7974
      oprot.writeFieldEnd();
7975
      oprot.writeFieldStop();
7976
      oprot.writeStructEnd();
7977
    }
7978
 
7979
    @Override
7980
    public String toString() {
7981
      StringBuilder sb = new StringBuilder("applyRechargeCoupon_args(");
7982
      boolean first = true;
7983
 
7984
      sb.append("couponCode:");
7985
      if (this.couponCode == null) {
7986
        sb.append("null");
7987
      } else {
7988
        sb.append(this.couponCode);
7989
      }
7990
      first = false;
7991
      if (!first) sb.append(", ");
7992
      sb.append("totalAmount:");
7993
      sb.append(this.totalAmount);
7994
      first = false;
7995
      if (!first) sb.append(", ");
7996
      sb.append("userId:");
7997
      sb.append(this.userId);
7998
      first = false;
7999
      sb.append(")");
8000
      return sb.toString();
8001
    }
8002
 
8003
    public void validate() throws org.apache.thrift.TException {
8004
      // check for required fields
8005
    }
8006
 
8007
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8008
      try {
8009
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8010
      } catch (org.apache.thrift.TException te) {
8011
        throw new java.io.IOException(te);
8012
      }
8013
    }
8014
 
8015
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8016
      try {
8017
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
8018
        __isset_bit_vector = new BitSet(1);
8019
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8020
      } catch (org.apache.thrift.TException te) {
8021
        throw new java.io.IOException(te);
8022
      }
8023
    }
8024
 
8025
  }
8026
 
8027
  public static class applyRechargeCoupon_result implements org.apache.thrift.TBase<applyRechargeCoupon_result, applyRechargeCoupon_result._Fields>, java.io.Serializable, Cloneable   {
8028
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyRechargeCoupon_result");
8029
 
8030
    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);
8031
    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);
8032
 
8033
    private Map<Long,String> success; // required
8034
    private PromotionException pex; // required
8035
 
8036
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8037
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
8038
      SUCCESS((short)0, "success"),
8039
      PEX((short)1, "pex");
8040
 
8041
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8042
 
8043
      static {
8044
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8045
          byName.put(field.getFieldName(), field);
8046
        }
8047
      }
8048
 
8049
      /**
8050
       * Find the _Fields constant that matches fieldId, or null if its not found.
8051
       */
8052
      public static _Fields findByThriftId(int fieldId) {
8053
        switch(fieldId) {
8054
          case 0: // SUCCESS
8055
            return SUCCESS;
8056
          case 1: // PEX
8057
            return PEX;
8058
          default:
8059
            return null;
8060
        }
8061
      }
8062
 
8063
      /**
8064
       * Find the _Fields constant that matches fieldId, throwing an exception
8065
       * if it is not found.
8066
       */
8067
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8068
        _Fields fields = findByThriftId(fieldId);
8069
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8070
        return fields;
8071
      }
8072
 
8073
      /**
8074
       * Find the _Fields constant that matches name, or null if its not found.
8075
       */
8076
      public static _Fields findByName(String name) {
8077
        return byName.get(name);
8078
      }
8079
 
8080
      private final short _thriftId;
8081
      private final String _fieldName;
8082
 
8083
      _Fields(short thriftId, String fieldName) {
8084
        _thriftId = thriftId;
8085
        _fieldName = fieldName;
8086
      }
8087
 
8088
      public short getThriftFieldId() {
8089
        return _thriftId;
8090
      }
8091
 
8092
      public String getFieldName() {
8093
        return _fieldName;
8094
      }
8095
    }
8096
 
8097
    // isset id assignments
8098
 
8099
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
8100
    static {
8101
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8102
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8103
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
8104
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), 
8105
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
8106
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8107
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
8108
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8109
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyRechargeCoupon_result.class, metaDataMap);
8110
    }
8111
 
8112
    public applyRechargeCoupon_result() {
8113
    }
8114
 
8115
    public applyRechargeCoupon_result(
8116
      Map<Long,String> success,
8117
      PromotionException pex)
8118
    {
8119
      this();
8120
      this.success = success;
8121
      this.pex = pex;
8122
    }
8123
 
8124
    /**
8125
     * Performs a deep copy on <i>other</i>.
8126
     */
8127
    public applyRechargeCoupon_result(applyRechargeCoupon_result other) {
8128
      if (other.isSetSuccess()) {
8129
        Map<Long,String> __this__success = new HashMap<Long,String>();
8130
        for (Map.Entry<Long, String> other_element : other.success.entrySet()) {
8131
 
8132
          Long other_element_key = other_element.getKey();
8133
          String other_element_value = other_element.getValue();
8134
 
8135
          Long __this__success_copy_key = other_element_key;
8136
 
8137
          String __this__success_copy_value = other_element_value;
8138
 
8139
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
8140
        }
8141
        this.success = __this__success;
8142
      }
8143
      if (other.isSetPex()) {
8144
        this.pex = new PromotionException(other.pex);
8145
      }
8146
    }
8147
 
8148
    public applyRechargeCoupon_result deepCopy() {
8149
      return new applyRechargeCoupon_result(this);
8150
    }
8151
 
8152
    @Override
8153
    public void clear() {
8154
      this.success = null;
8155
      this.pex = null;
8156
    }
8157
 
8158
    public int getSuccessSize() {
8159
      return (this.success == null) ? 0 : this.success.size();
8160
    }
8161
 
8162
    public void putToSuccess(long key, String val) {
8163
      if (this.success == null) {
8164
        this.success = new HashMap<Long,String>();
8165
      }
8166
      this.success.put(key, val);
8167
    }
8168
 
8169
    public Map<Long,String> getSuccess() {
8170
      return this.success;
8171
    }
8172
 
8173
    public void setSuccess(Map<Long,String> success) {
8174
      this.success = success;
8175
    }
8176
 
8177
    public void unsetSuccess() {
8178
      this.success = null;
8179
    }
8180
 
8181
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
8182
    public boolean isSetSuccess() {
8183
      return this.success != null;
8184
    }
8185
 
8186
    public void setSuccessIsSet(boolean value) {
8187
      if (!value) {
8188
        this.success = null;
8189
      }
8190
    }
8191
 
8192
    public PromotionException getPex() {
8193
      return this.pex;
8194
    }
8195
 
8196
    public void setPex(PromotionException pex) {
8197
      this.pex = pex;
8198
    }
8199
 
8200
    public void unsetPex() {
8201
      this.pex = null;
8202
    }
8203
 
8204
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
8205
    public boolean isSetPex() {
8206
      return this.pex != null;
8207
    }
8208
 
8209
    public void setPexIsSet(boolean value) {
8210
      if (!value) {
8211
        this.pex = null;
8212
      }
8213
    }
8214
 
8215
    public void setFieldValue(_Fields field, Object value) {
8216
      switch (field) {
8217
      case SUCCESS:
8218
        if (value == null) {
8219
          unsetSuccess();
8220
        } else {
8221
          setSuccess((Map<Long,String>)value);
8222
        }
8223
        break;
8224
 
8225
      case PEX:
8226
        if (value == null) {
8227
          unsetPex();
8228
        } else {
8229
          setPex((PromotionException)value);
8230
        }
8231
        break;
8232
 
8233
      }
8234
    }
8235
 
8236
    public Object getFieldValue(_Fields field) {
8237
      switch (field) {
8238
      case SUCCESS:
8239
        return getSuccess();
8240
 
8241
      case PEX:
8242
        return getPex();
8243
 
8244
      }
8245
      throw new IllegalStateException();
8246
    }
8247
 
8248
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8249
    public boolean isSet(_Fields field) {
8250
      if (field == null) {
8251
        throw new IllegalArgumentException();
8252
      }
8253
 
8254
      switch (field) {
8255
      case SUCCESS:
8256
        return isSetSuccess();
8257
      case PEX:
8258
        return isSetPex();
8259
      }
8260
      throw new IllegalStateException();
8261
    }
8262
 
8263
    @Override
8264
    public boolean equals(Object that) {
8265
      if (that == null)
8266
        return false;
8267
      if (that instanceof applyRechargeCoupon_result)
8268
        return this.equals((applyRechargeCoupon_result)that);
8269
      return false;
8270
    }
8271
 
8272
    public boolean equals(applyRechargeCoupon_result that) {
8273
      if (that == null)
8274
        return false;
8275
 
8276
      boolean this_present_success = true && this.isSetSuccess();
8277
      boolean that_present_success = true && that.isSetSuccess();
8278
      if (this_present_success || that_present_success) {
8279
        if (!(this_present_success && that_present_success))
8280
          return false;
8281
        if (!this.success.equals(that.success))
8282
          return false;
8283
      }
8284
 
8285
      boolean this_present_pex = true && this.isSetPex();
8286
      boolean that_present_pex = true && that.isSetPex();
8287
      if (this_present_pex || that_present_pex) {
8288
        if (!(this_present_pex && that_present_pex))
8289
          return false;
8290
        if (!this.pex.equals(that.pex))
8291
          return false;
8292
      }
8293
 
8294
      return true;
8295
    }
8296
 
8297
    @Override
8298
    public int hashCode() {
8299
      return 0;
8300
    }
8301
 
8302
    public int compareTo(applyRechargeCoupon_result other) {
8303
      if (!getClass().equals(other.getClass())) {
8304
        return getClass().getName().compareTo(other.getClass().getName());
8305
      }
8306
 
8307
      int lastComparison = 0;
8308
      applyRechargeCoupon_result typedOther = (applyRechargeCoupon_result)other;
8309
 
8310
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
8311
      if (lastComparison != 0) {
8312
        return lastComparison;
8313
      }
8314
      if (isSetSuccess()) {
8315
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
8316
        if (lastComparison != 0) {
8317
          return lastComparison;
8318
        }
8319
      }
8320
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
8321
      if (lastComparison != 0) {
8322
        return lastComparison;
8323
      }
8324
      if (isSetPex()) {
8325
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
8326
        if (lastComparison != 0) {
8327
          return lastComparison;
8328
        }
8329
      }
8330
      return 0;
8331
    }
8332
 
8333
    public _Fields fieldForId(int fieldId) {
8334
      return _Fields.findByThriftId(fieldId);
8335
    }
8336
 
8337
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8338
      org.apache.thrift.protocol.TField field;
8339
      iprot.readStructBegin();
8340
      while (true)
8341
      {
8342
        field = iprot.readFieldBegin();
8343
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
8344
          break;
8345
        }
8346
        switch (field.id) {
8347
          case 0: // SUCCESS
8348
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
8349
              {
8350
                org.apache.thrift.protocol.TMap _map16 = iprot.readMapBegin();
8351
                this.success = new HashMap<Long,String>(2*_map16.size);
8352
                for (int _i17 = 0; _i17 < _map16.size; ++_i17)
8353
                {
8354
                  long _key18; // required
8355
                  String _val19; // required
8356
                  _key18 = iprot.readI64();
8357
                  _val19 = iprot.readString();
8358
                  this.success.put(_key18, _val19);
8359
                }
8360
                iprot.readMapEnd();
8361
              }
8362
            } else { 
8363
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8364
            }
8365
            break;
8366
          case 1: // PEX
8367
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
8368
              this.pex = new PromotionException();
8369
              this.pex.read(iprot);
8370
            } else { 
8371
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8372
            }
8373
            break;
8374
          default:
8375
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8376
        }
8377
        iprot.readFieldEnd();
8378
      }
8379
      iprot.readStructEnd();
8380
      validate();
8381
    }
8382
 
8383
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
8384
      oprot.writeStructBegin(STRUCT_DESC);
8385
 
8386
      if (this.isSetSuccess()) {
8387
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
8388
        {
8389
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.STRING, this.success.size()));
8390
          for (Map.Entry<Long, String> _iter20 : this.success.entrySet())
8391
          {
8392
            oprot.writeI64(_iter20.getKey());
8393
            oprot.writeString(_iter20.getValue());
8394
          }
8395
          oprot.writeMapEnd();
8396
        }
8397
        oprot.writeFieldEnd();
8398
      } else if (this.isSetPex()) {
8399
        oprot.writeFieldBegin(PEX_FIELD_DESC);
8400
        this.pex.write(oprot);
8401
        oprot.writeFieldEnd();
8402
      }
8403
      oprot.writeFieldStop();
8404
      oprot.writeStructEnd();
8405
    }
8406
 
8407
    @Override
8408
    public String toString() {
8409
      StringBuilder sb = new StringBuilder("applyRechargeCoupon_result(");
8410
      boolean first = true;
8411
 
8412
      sb.append("success:");
8413
      if (this.success == null) {
8414
        sb.append("null");
8415
      } else {
8416
        sb.append(this.success);
8417
      }
8418
      first = false;
8419
      if (!first) sb.append(", ");
8420
      sb.append("pex:");
8421
      if (this.pex == null) {
8422
        sb.append("null");
8423
      } else {
8424
        sb.append(this.pex);
8425
      }
8426
      first = false;
8427
      sb.append(")");
8428
      return sb.toString();
8429
    }
8430
 
8431
    public void validate() throws org.apache.thrift.TException {
8432
      // check for required fields
8433
    }
8434
 
8435
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8436
      try {
8437
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8438
      } catch (org.apache.thrift.TException te) {
8439
        throw new java.io.IOException(te);
8440
      }
8441
    }
8442
 
8443
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8444
      try {
8445
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8446
      } catch (org.apache.thrift.TException te) {
8447
        throw new java.io.IOException(te);
8448
      }
8449
    }
8450
 
8451
  }
8452
 
3430 rajveer 8453
  public static class trackCouponUsage_args implements org.apache.thrift.TBase<trackCouponUsage_args, trackCouponUsage_args._Fields>, java.io.Serializable, Cloneable   {
8454
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_args");
1982 varun.gupt 8455
 
3430 rajveer 8456
    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);
8457
    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);
8458
    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 8459
 
3430 rajveer 8460
    private String couponCode; // required
8461
    private long transactionId; // required
8462
    private long userId; // required
1982 varun.gupt 8463
 
8464
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 8465
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 8466
      COUPON_CODE((short)1, "couponCode"),
8467
      TRANSACTION_ID((short)2, "transactionId"),
8468
      USER_ID((short)3, "userId");
8469
 
8470
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8471
 
8472
      static {
8473
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8474
          byName.put(field.getFieldName(), field);
8475
        }
8476
      }
8477
 
8478
      /**
8479
       * Find the _Fields constant that matches fieldId, or null if its not found.
8480
       */
8481
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 8482
        switch(fieldId) {
8483
          case 1: // COUPON_CODE
8484
            return COUPON_CODE;
8485
          case 2: // TRANSACTION_ID
8486
            return TRANSACTION_ID;
8487
          case 3: // USER_ID
8488
            return USER_ID;
8489
          default:
8490
            return null;
8491
        }
1982 varun.gupt 8492
      }
8493
 
8494
      /**
8495
       * Find the _Fields constant that matches fieldId, throwing an exception
8496
       * if it is not found.
8497
       */
8498
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8499
        _Fields fields = findByThriftId(fieldId);
8500
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8501
        return fields;
8502
      }
8503
 
8504
      /**
8505
       * Find the _Fields constant that matches name, or null if its not found.
8506
       */
8507
      public static _Fields findByName(String name) {
8508
        return byName.get(name);
8509
      }
8510
 
8511
      private final short _thriftId;
8512
      private final String _fieldName;
8513
 
8514
      _Fields(short thriftId, String fieldName) {
8515
        _thriftId = thriftId;
8516
        _fieldName = fieldName;
8517
      }
8518
 
8519
      public short getThriftFieldId() {
8520
        return _thriftId;
8521
      }
8522
 
8523
      public String getFieldName() {
8524
        return _fieldName;
8525
      }
8526
    }
8527
 
8528
    // isset id assignments
8529
    private static final int __TRANSACTIONID_ISSET_ID = 0;
8530
    private static final int __USERID_ISSET_ID = 1;
8531
    private BitSet __isset_bit_vector = new BitSet(2);
8532
 
3430 rajveer 8533
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 8534
    static {
3430 rajveer 8535
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8536
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8537
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
8538
      tmpMap.put(_Fields.TRANSACTION_ID, new org.apache.thrift.meta_data.FieldMetaData("transactionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8539
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8540
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8541
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8542
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8543
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_args.class, metaDataMap);
1982 varun.gupt 8544
    }
8545
 
8546
    public trackCouponUsage_args() {
8547
    }
8548
 
8549
    public trackCouponUsage_args(
8550
      String couponCode,
8551
      long transactionId,
8552
      long userId)
8553
    {
8554
      this();
8555
      this.couponCode = couponCode;
8556
      this.transactionId = transactionId;
8557
      setTransactionIdIsSet(true);
8558
      this.userId = userId;
8559
      setUserIdIsSet(true);
8560
    }
8561
 
8562
    /**
8563
     * Performs a deep copy on <i>other</i>.
8564
     */
8565
    public trackCouponUsage_args(trackCouponUsage_args other) {
8566
      __isset_bit_vector.clear();
8567
      __isset_bit_vector.or(other.__isset_bit_vector);
8568
      if (other.isSetCouponCode()) {
8569
        this.couponCode = other.couponCode;
8570
      }
8571
      this.transactionId = other.transactionId;
8572
      this.userId = other.userId;
8573
    }
8574
 
8575
    public trackCouponUsage_args deepCopy() {
8576
      return new trackCouponUsage_args(this);
8577
    }
8578
 
3430 rajveer 8579
    @Override
8580
    public void clear() {
8581
      this.couponCode = null;
8582
      setTransactionIdIsSet(false);
8583
      this.transactionId = 0;
8584
      setUserIdIsSet(false);
8585
      this.userId = 0;
1982 varun.gupt 8586
    }
8587
 
8588
    public String getCouponCode() {
8589
      return this.couponCode;
8590
    }
8591
 
3430 rajveer 8592
    public void setCouponCode(String couponCode) {
1982 varun.gupt 8593
      this.couponCode = couponCode;
8594
    }
8595
 
8596
    public void unsetCouponCode() {
8597
      this.couponCode = null;
8598
    }
8599
 
3430 rajveer 8600
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 8601
    public boolean isSetCouponCode() {
8602
      return this.couponCode != null;
8603
    }
8604
 
8605
    public void setCouponCodeIsSet(boolean value) {
8606
      if (!value) {
8607
        this.couponCode = null;
8608
      }
8609
    }
8610
 
8611
    public long getTransactionId() {
8612
      return this.transactionId;
8613
    }
8614
 
3430 rajveer 8615
    public void setTransactionId(long transactionId) {
1982 varun.gupt 8616
      this.transactionId = transactionId;
8617
      setTransactionIdIsSet(true);
8618
    }
8619
 
8620
    public void unsetTransactionId() {
8621
      __isset_bit_vector.clear(__TRANSACTIONID_ISSET_ID);
8622
    }
8623
 
3430 rajveer 8624
    /** Returns true if field transactionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 8625
    public boolean isSetTransactionId() {
8626
      return __isset_bit_vector.get(__TRANSACTIONID_ISSET_ID);
8627
    }
8628
 
8629
    public void setTransactionIdIsSet(boolean value) {
8630
      __isset_bit_vector.set(__TRANSACTIONID_ISSET_ID, value);
8631
    }
8632
 
8633
    public long getUserId() {
8634
      return this.userId;
8635
    }
8636
 
3430 rajveer 8637
    public void setUserId(long userId) {
1982 varun.gupt 8638
      this.userId = userId;
8639
      setUserIdIsSet(true);
8640
    }
8641
 
8642
    public void unsetUserId() {
8643
      __isset_bit_vector.clear(__USERID_ISSET_ID);
8644
    }
8645
 
3430 rajveer 8646
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 8647
    public boolean isSetUserId() {
8648
      return __isset_bit_vector.get(__USERID_ISSET_ID);
8649
    }
8650
 
8651
    public void setUserIdIsSet(boolean value) {
8652
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
8653
    }
8654
 
8655
    public void setFieldValue(_Fields field, Object value) {
8656
      switch (field) {
8657
      case COUPON_CODE:
8658
        if (value == null) {
8659
          unsetCouponCode();
8660
        } else {
8661
          setCouponCode((String)value);
8662
        }
8663
        break;
8664
 
8665
      case TRANSACTION_ID:
8666
        if (value == null) {
8667
          unsetTransactionId();
8668
        } else {
8669
          setTransactionId((Long)value);
8670
        }
8671
        break;
8672
 
8673
      case USER_ID:
8674
        if (value == null) {
8675
          unsetUserId();
8676
        } else {
8677
          setUserId((Long)value);
8678
        }
8679
        break;
8680
 
8681
      }
8682
    }
8683
 
8684
    public Object getFieldValue(_Fields field) {
8685
      switch (field) {
8686
      case COUPON_CODE:
8687
        return getCouponCode();
8688
 
8689
      case TRANSACTION_ID:
3430 rajveer 8690
        return Long.valueOf(getTransactionId());
1982 varun.gupt 8691
 
8692
      case USER_ID:
3430 rajveer 8693
        return Long.valueOf(getUserId());
1982 varun.gupt 8694
 
8695
      }
8696
      throw new IllegalStateException();
8697
    }
8698
 
3430 rajveer 8699
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8700
    public boolean isSet(_Fields field) {
8701
      if (field == null) {
8702
        throw new IllegalArgumentException();
8703
      }
1982 varun.gupt 8704
 
8705
      switch (field) {
8706
      case COUPON_CODE:
8707
        return isSetCouponCode();
8708
      case TRANSACTION_ID:
8709
        return isSetTransactionId();
8710
      case USER_ID:
8711
        return isSetUserId();
8712
      }
8713
      throw new IllegalStateException();
8714
    }
8715
 
8716
    @Override
8717
    public boolean equals(Object that) {
8718
      if (that == null)
8719
        return false;
8720
      if (that instanceof trackCouponUsage_args)
8721
        return this.equals((trackCouponUsage_args)that);
8722
      return false;
8723
    }
8724
 
8725
    public boolean equals(trackCouponUsage_args that) {
8726
      if (that == null)
8727
        return false;
8728
 
8729
      boolean this_present_couponCode = true && this.isSetCouponCode();
8730
      boolean that_present_couponCode = true && that.isSetCouponCode();
8731
      if (this_present_couponCode || that_present_couponCode) {
8732
        if (!(this_present_couponCode && that_present_couponCode))
8733
          return false;
8734
        if (!this.couponCode.equals(that.couponCode))
8735
          return false;
8736
      }
8737
 
8738
      boolean this_present_transactionId = true;
8739
      boolean that_present_transactionId = true;
8740
      if (this_present_transactionId || that_present_transactionId) {
8741
        if (!(this_present_transactionId && that_present_transactionId))
8742
          return false;
8743
        if (this.transactionId != that.transactionId)
8744
          return false;
8745
      }
8746
 
8747
      boolean this_present_userId = true;
8748
      boolean that_present_userId = true;
8749
      if (this_present_userId || that_present_userId) {
8750
        if (!(this_present_userId && that_present_userId))
8751
          return false;
8752
        if (this.userId != that.userId)
8753
          return false;
8754
      }
8755
 
8756
      return true;
8757
    }
8758
 
8759
    @Override
8760
    public int hashCode() {
8761
      return 0;
8762
    }
8763
 
8764
    public int compareTo(trackCouponUsage_args other) {
8765
      if (!getClass().equals(other.getClass())) {
8766
        return getClass().getName().compareTo(other.getClass().getName());
8767
      }
8768
 
8769
      int lastComparison = 0;
8770
      trackCouponUsage_args typedOther = (trackCouponUsage_args)other;
8771
 
3430 rajveer 8772
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 8773
      if (lastComparison != 0) {
8774
        return lastComparison;
8775
      }
3430 rajveer 8776
      if (isSetCouponCode()) {
8777
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
8778
        if (lastComparison != 0) {
8779
          return lastComparison;
8780
        }
1982 varun.gupt 8781
      }
3430 rajveer 8782
      lastComparison = Boolean.valueOf(isSetTransactionId()).compareTo(typedOther.isSetTransactionId());
1982 varun.gupt 8783
      if (lastComparison != 0) {
8784
        return lastComparison;
8785
      }
3430 rajveer 8786
      if (isSetTransactionId()) {
8787
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transactionId, typedOther.transactionId);
8788
        if (lastComparison != 0) {
8789
          return lastComparison;
8790
        }
1982 varun.gupt 8791
      }
3430 rajveer 8792
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 8793
      if (lastComparison != 0) {
8794
        return lastComparison;
8795
      }
3430 rajveer 8796
      if (isSetUserId()) {
8797
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
8798
        if (lastComparison != 0) {
8799
          return lastComparison;
8800
        }
1982 varun.gupt 8801
      }
8802
      return 0;
8803
    }
8804
 
3430 rajveer 8805
    public _Fields fieldForId(int fieldId) {
8806
      return _Fields.findByThriftId(fieldId);
8807
    }
8808
 
8809
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8810
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 8811
      iprot.readStructBegin();
8812
      while (true)
8813
      {
8814
        field = iprot.readFieldBegin();
3430 rajveer 8815
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 8816
          break;
8817
        }
3430 rajveer 8818
        switch (field.id) {
8819
          case 1: // COUPON_CODE
8820
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
8821
              this.couponCode = iprot.readString();
8822
            } else { 
8823
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8824
            }
8825
            break;
8826
          case 2: // TRANSACTION_ID
8827
            if (field.type == org.apache.thrift.protocol.TType.I64) {
8828
              this.transactionId = iprot.readI64();
8829
              setTransactionIdIsSet(true);
8830
            } else { 
8831
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8832
            }
8833
            break;
8834
          case 3: // USER_ID
8835
            if (field.type == org.apache.thrift.protocol.TType.I64) {
8836
              this.userId = iprot.readI64();
8837
              setUserIdIsSet(true);
8838
            } else { 
8839
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8840
            }
8841
            break;
8842
          default:
8843
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 8844
        }
3430 rajveer 8845
        iprot.readFieldEnd();
1982 varun.gupt 8846
      }
8847
      iprot.readStructEnd();
8848
      validate();
8849
    }
8850
 
3430 rajveer 8851
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 8852
      validate();
8853
 
8854
      oprot.writeStructBegin(STRUCT_DESC);
8855
      if (this.couponCode != null) {
8856
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
8857
        oprot.writeString(this.couponCode);
8858
        oprot.writeFieldEnd();
8859
      }
8860
      oprot.writeFieldBegin(TRANSACTION_ID_FIELD_DESC);
8861
      oprot.writeI64(this.transactionId);
8862
      oprot.writeFieldEnd();
8863
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
8864
      oprot.writeI64(this.userId);
8865
      oprot.writeFieldEnd();
8866
      oprot.writeFieldStop();
8867
      oprot.writeStructEnd();
8868
    }
8869
 
8870
    @Override
8871
    public String toString() {
8872
      StringBuilder sb = new StringBuilder("trackCouponUsage_args(");
8873
      boolean first = true;
8874
 
8875
      sb.append("couponCode:");
8876
      if (this.couponCode == null) {
8877
        sb.append("null");
8878
      } else {
8879
        sb.append(this.couponCode);
8880
      }
8881
      first = false;
8882
      if (!first) sb.append(", ");
8883
      sb.append("transactionId:");
8884
      sb.append(this.transactionId);
8885
      first = false;
8886
      if (!first) sb.append(", ");
8887
      sb.append("userId:");
8888
      sb.append(this.userId);
8889
      first = false;
8890
      sb.append(")");
8891
      return sb.toString();
8892
    }
8893
 
3430 rajveer 8894
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 8895
      // check for required fields
8896
    }
8897
 
3430 rajveer 8898
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8899
      try {
8900
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8901
      } catch (org.apache.thrift.TException te) {
8902
        throw new java.io.IOException(te);
8903
      }
8904
    }
8905
 
8906
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8907
      try {
8908
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
8909
        __isset_bit_vector = new BitSet(1);
8910
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8911
      } catch (org.apache.thrift.TException te) {
8912
        throw new java.io.IOException(te);
8913
      }
8914
    }
8915
 
1982 varun.gupt 8916
  }
8917
 
3430 rajveer 8918
  public static class trackCouponUsage_result implements org.apache.thrift.TBase<trackCouponUsage_result, trackCouponUsage_result._Fields>, java.io.Serializable, Cloneable   {
8919
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_result");
1982 varun.gupt 8920
 
3430 rajveer 8921
    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 8922
 
3430 rajveer 8923
    private PromotionException pex; // required
1982 varun.gupt 8924
 
8925
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 8926
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 8927
      PEX((short)1, "pex");
8928
 
8929
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8930
 
8931
      static {
8932
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8933
          byName.put(field.getFieldName(), field);
8934
        }
8935
      }
8936
 
8937
      /**
8938
       * Find the _Fields constant that matches fieldId, or null if its not found.
8939
       */
8940
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 8941
        switch(fieldId) {
8942
          case 1: // PEX
8943
            return PEX;
8944
          default:
8945
            return null;
8946
        }
1982 varun.gupt 8947
      }
8948
 
8949
      /**
8950
       * Find the _Fields constant that matches fieldId, throwing an exception
8951
       * if it is not found.
8952
       */
8953
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8954
        _Fields fields = findByThriftId(fieldId);
8955
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8956
        return fields;
8957
      }
8958
 
8959
      /**
8960
       * Find the _Fields constant that matches name, or null if its not found.
8961
       */
8962
      public static _Fields findByName(String name) {
8963
        return byName.get(name);
8964
      }
8965
 
8966
      private final short _thriftId;
8967
      private final String _fieldName;
8968
 
8969
      _Fields(short thriftId, String fieldName) {
8970
        _thriftId = thriftId;
8971
        _fieldName = fieldName;
8972
      }
8973
 
8974
      public short getThriftFieldId() {
8975
        return _thriftId;
8976
      }
8977
 
8978
      public String getFieldName() {
8979
        return _fieldName;
8980
      }
8981
    }
8982
 
8983
    // isset id assignments
8984
 
3430 rajveer 8985
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 8986
    static {
3430 rajveer 8987
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8988
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8989
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
8990
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8991
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_result.class, metaDataMap);
1982 varun.gupt 8992
    }
8993
 
8994
    public trackCouponUsage_result() {
8995
    }
8996
 
8997
    public trackCouponUsage_result(
8998
      PromotionException pex)
8999
    {
9000
      this();
9001
      this.pex = pex;
9002
    }
9003
 
9004
    /**
9005
     * Performs a deep copy on <i>other</i>.
9006
     */
9007
    public trackCouponUsage_result(trackCouponUsage_result other) {
9008
      if (other.isSetPex()) {
9009
        this.pex = new PromotionException(other.pex);
9010
      }
9011
    }
9012
 
9013
    public trackCouponUsage_result deepCopy() {
9014
      return new trackCouponUsage_result(this);
9015
    }
9016
 
3430 rajveer 9017
    @Override
9018
    public void clear() {
9019
      this.pex = null;
1982 varun.gupt 9020
    }
9021
 
9022
    public PromotionException getPex() {
9023
      return this.pex;
9024
    }
9025
 
3430 rajveer 9026
    public void setPex(PromotionException pex) {
1982 varun.gupt 9027
      this.pex = pex;
9028
    }
9029
 
9030
    public void unsetPex() {
9031
      this.pex = null;
9032
    }
9033
 
3430 rajveer 9034
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 9035
    public boolean isSetPex() {
9036
      return this.pex != null;
9037
    }
9038
 
9039
    public void setPexIsSet(boolean value) {
9040
      if (!value) {
9041
        this.pex = null;
9042
      }
9043
    }
9044
 
9045
    public void setFieldValue(_Fields field, Object value) {
9046
      switch (field) {
9047
      case PEX:
9048
        if (value == null) {
9049
          unsetPex();
9050
        } else {
9051
          setPex((PromotionException)value);
9052
        }
9053
        break;
9054
 
9055
      }
9056
    }
9057
 
9058
    public Object getFieldValue(_Fields field) {
9059
      switch (field) {
9060
      case PEX:
9061
        return getPex();
9062
 
9063
      }
9064
      throw new IllegalStateException();
9065
    }
9066
 
3430 rajveer 9067
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9068
    public boolean isSet(_Fields field) {
9069
      if (field == null) {
9070
        throw new IllegalArgumentException();
9071
      }
1982 varun.gupt 9072
 
9073
      switch (field) {
9074
      case PEX:
9075
        return isSetPex();
9076
      }
9077
      throw new IllegalStateException();
9078
    }
9079
 
9080
    @Override
9081
    public boolean equals(Object that) {
9082
      if (that == null)
9083
        return false;
9084
      if (that instanceof trackCouponUsage_result)
9085
        return this.equals((trackCouponUsage_result)that);
9086
      return false;
9087
    }
9088
 
9089
    public boolean equals(trackCouponUsage_result that) {
9090
      if (that == null)
9091
        return false;
9092
 
9093
      boolean this_present_pex = true && this.isSetPex();
9094
      boolean that_present_pex = true && that.isSetPex();
9095
      if (this_present_pex || that_present_pex) {
9096
        if (!(this_present_pex && that_present_pex))
9097
          return false;
9098
        if (!this.pex.equals(that.pex))
9099
          return false;
9100
      }
9101
 
9102
      return true;
9103
    }
9104
 
9105
    @Override
9106
    public int hashCode() {
9107
      return 0;
9108
    }
9109
 
9110
    public int compareTo(trackCouponUsage_result other) {
9111
      if (!getClass().equals(other.getClass())) {
9112
        return getClass().getName().compareTo(other.getClass().getName());
9113
      }
9114
 
9115
      int lastComparison = 0;
9116
      trackCouponUsage_result typedOther = (trackCouponUsage_result)other;
9117
 
3430 rajveer 9118
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 9119
      if (lastComparison != 0) {
9120
        return lastComparison;
9121
      }
3430 rajveer 9122
      if (isSetPex()) {
9123
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
9124
        if (lastComparison != 0) {
9125
          return lastComparison;
9126
        }
1982 varun.gupt 9127
      }
9128
      return 0;
9129
    }
9130
 
3430 rajveer 9131
    public _Fields fieldForId(int fieldId) {
9132
      return _Fields.findByThriftId(fieldId);
9133
    }
9134
 
9135
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9136
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 9137
      iprot.readStructBegin();
9138
      while (true)
9139
      {
9140
        field = iprot.readFieldBegin();
3430 rajveer 9141
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 9142
          break;
9143
        }
3430 rajveer 9144
        switch (field.id) {
9145
          case 1: // PEX
9146
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
9147
              this.pex = new PromotionException();
9148
              this.pex.read(iprot);
9149
            } else { 
9150
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9151
            }
9152
            break;
9153
          default:
9154
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 9155
        }
3430 rajveer 9156
        iprot.readFieldEnd();
1982 varun.gupt 9157
      }
9158
      iprot.readStructEnd();
9159
      validate();
9160
    }
9161
 
3430 rajveer 9162
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 9163
      oprot.writeStructBegin(STRUCT_DESC);
9164
 
9165
      if (this.isSetPex()) {
9166
        oprot.writeFieldBegin(PEX_FIELD_DESC);
9167
        this.pex.write(oprot);
9168
        oprot.writeFieldEnd();
9169
      }
9170
      oprot.writeFieldStop();
9171
      oprot.writeStructEnd();
9172
    }
9173
 
9174
    @Override
9175
    public String toString() {
9176
      StringBuilder sb = new StringBuilder("trackCouponUsage_result(");
9177
      boolean first = true;
9178
 
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
 
3430 rajveer 9190
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 9191
      // check for required fields
9192
    }
9193
 
3430 rajveer 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
 
1982 varun.gupt 9210
  }
9211
 
3430 rajveer 9212
  public static class getCouponUsageCountByUser_args implements org.apache.thrift.TBase<getCouponUsageCountByUser_args, getCouponUsageCountByUser_args._Fields>, java.io.Serializable, Cloneable   {
9213
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_args");
1982 varun.gupt 9214
 
3430 rajveer 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 USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.I64, (short)2);
1982 varun.gupt 9217
 
3430 rajveer 9218
    private String couponCode; // required
9219
    private long userId; // required
1982 varun.gupt 9220
 
9221
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 9222
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 9223
      COUPON_CODE((short)1, "couponCode"),
9224
      USER_ID((short)2, "userId");
9225
 
9226
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9227
 
9228
      static {
9229
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9230
          byName.put(field.getFieldName(), field);
9231
        }
9232
      }
9233
 
9234
      /**
9235
       * Find the _Fields constant that matches fieldId, or null if its not found.
9236
       */
9237
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 9238
        switch(fieldId) {
9239
          case 1: // COUPON_CODE
9240
            return COUPON_CODE;
9241
          case 2: // USER_ID
9242
            return USER_ID;
9243
          default:
9244
            return null;
9245
        }
1982 varun.gupt 9246
      }
9247
 
9248
      /**
9249
       * Find the _Fields constant that matches fieldId, throwing an exception
9250
       * if it is not found.
9251
       */
9252
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9253
        _Fields fields = findByThriftId(fieldId);
9254
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9255
        return fields;
9256
      }
9257
 
9258
      /**
9259
       * Find the _Fields constant that matches name, or null if its not found.
9260
       */
9261
      public static _Fields findByName(String name) {
9262
        return byName.get(name);
9263
      }
9264
 
9265
      private final short _thriftId;
9266
      private final String _fieldName;
9267
 
9268
      _Fields(short thriftId, String fieldName) {
9269
        _thriftId = thriftId;
9270
        _fieldName = fieldName;
9271
      }
9272
 
9273
      public short getThriftFieldId() {
9274
        return _thriftId;
9275
      }
9276
 
9277
      public String getFieldName() {
9278
        return _fieldName;
9279
      }
9280
    }
9281
 
9282
    // isset id assignments
9283
    private static final int __USERID_ISSET_ID = 0;
9284
    private BitSet __isset_bit_vector = new BitSet(1);
9285
 
3430 rajveer 9286
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 9287
    static {
3430 rajveer 9288
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9289
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9290
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
9291
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9292
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9293
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9294
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_args.class, metaDataMap);
1982 varun.gupt 9295
    }
9296
 
9297
    public getCouponUsageCountByUser_args() {
9298
    }
9299
 
9300
    public getCouponUsageCountByUser_args(
9301
      String couponCode,
9302
      long userId)
9303
    {
9304
      this();
9305
      this.couponCode = couponCode;
9306
      this.userId = userId;
9307
      setUserIdIsSet(true);
9308
    }
9309
 
9310
    /**
9311
     * Performs a deep copy on <i>other</i>.
9312
     */
9313
    public getCouponUsageCountByUser_args(getCouponUsageCountByUser_args other) {
9314
      __isset_bit_vector.clear();
9315
      __isset_bit_vector.or(other.__isset_bit_vector);
9316
      if (other.isSetCouponCode()) {
9317
        this.couponCode = other.couponCode;
9318
      }
9319
      this.userId = other.userId;
9320
    }
9321
 
9322
    public getCouponUsageCountByUser_args deepCopy() {
9323
      return new getCouponUsageCountByUser_args(this);
9324
    }
9325
 
3430 rajveer 9326
    @Override
9327
    public void clear() {
9328
      this.couponCode = null;
9329
      setUserIdIsSet(false);
9330
      this.userId = 0;
1982 varun.gupt 9331
    }
9332
 
9333
    public String getCouponCode() {
9334
      return this.couponCode;
9335
    }
9336
 
3430 rajveer 9337
    public void setCouponCode(String couponCode) {
1982 varun.gupt 9338
      this.couponCode = couponCode;
9339
    }
9340
 
9341
    public void unsetCouponCode() {
9342
      this.couponCode = null;
9343
    }
9344
 
3430 rajveer 9345
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 9346
    public boolean isSetCouponCode() {
9347
      return this.couponCode != null;
9348
    }
9349
 
9350
    public void setCouponCodeIsSet(boolean value) {
9351
      if (!value) {
9352
        this.couponCode = null;
9353
      }
9354
    }
9355
 
9356
    public long getUserId() {
9357
      return this.userId;
9358
    }
9359
 
3430 rajveer 9360
    public void setUserId(long userId) {
1982 varun.gupt 9361
      this.userId = userId;
9362
      setUserIdIsSet(true);
9363
    }
9364
 
9365
    public void unsetUserId() {
9366
      __isset_bit_vector.clear(__USERID_ISSET_ID);
9367
    }
9368
 
3430 rajveer 9369
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 9370
    public boolean isSetUserId() {
9371
      return __isset_bit_vector.get(__USERID_ISSET_ID);
9372
    }
9373
 
9374
    public void setUserIdIsSet(boolean value) {
9375
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
9376
    }
9377
 
9378
    public void setFieldValue(_Fields field, Object value) {
9379
      switch (field) {
9380
      case COUPON_CODE:
9381
        if (value == null) {
9382
          unsetCouponCode();
9383
        } else {
9384
          setCouponCode((String)value);
9385
        }
9386
        break;
9387
 
9388
      case USER_ID:
9389
        if (value == null) {
9390
          unsetUserId();
9391
        } else {
9392
          setUserId((Long)value);
9393
        }
9394
        break;
9395
 
9396
      }
9397
    }
9398
 
9399
    public Object getFieldValue(_Fields field) {
9400
      switch (field) {
9401
      case COUPON_CODE:
9402
        return getCouponCode();
9403
 
9404
      case USER_ID:
3430 rajveer 9405
        return Long.valueOf(getUserId());
1982 varun.gupt 9406
 
9407
      }
9408
      throw new IllegalStateException();
9409
    }
9410
 
3430 rajveer 9411
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9412
    public boolean isSet(_Fields field) {
9413
      if (field == null) {
9414
        throw new IllegalArgumentException();
9415
      }
1982 varun.gupt 9416
 
9417
      switch (field) {
9418
      case COUPON_CODE:
9419
        return isSetCouponCode();
9420
      case USER_ID:
9421
        return isSetUserId();
9422
      }
9423
      throw new IllegalStateException();
9424
    }
9425
 
9426
    @Override
9427
    public boolean equals(Object that) {
9428
      if (that == null)
9429
        return false;
9430
      if (that instanceof getCouponUsageCountByUser_args)
9431
        return this.equals((getCouponUsageCountByUser_args)that);
9432
      return false;
9433
    }
9434
 
9435
    public boolean equals(getCouponUsageCountByUser_args that) {
9436
      if (that == null)
9437
        return false;
9438
 
9439
      boolean this_present_couponCode = true && this.isSetCouponCode();
9440
      boolean that_present_couponCode = true && that.isSetCouponCode();
9441
      if (this_present_couponCode || that_present_couponCode) {
9442
        if (!(this_present_couponCode && that_present_couponCode))
9443
          return false;
9444
        if (!this.couponCode.equals(that.couponCode))
9445
          return false;
9446
      }
9447
 
9448
      boolean this_present_userId = true;
9449
      boolean that_present_userId = true;
9450
      if (this_present_userId || that_present_userId) {
9451
        if (!(this_present_userId && that_present_userId))
9452
          return false;
9453
        if (this.userId != that.userId)
9454
          return false;
9455
      }
9456
 
9457
      return true;
9458
    }
9459
 
9460
    @Override
9461
    public int hashCode() {
9462
      return 0;
9463
    }
9464
 
9465
    public int compareTo(getCouponUsageCountByUser_args other) {
9466
      if (!getClass().equals(other.getClass())) {
9467
        return getClass().getName().compareTo(other.getClass().getName());
9468
      }
9469
 
9470
      int lastComparison = 0;
9471
      getCouponUsageCountByUser_args typedOther = (getCouponUsageCountByUser_args)other;
9472
 
3430 rajveer 9473
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 9474
      if (lastComparison != 0) {
9475
        return lastComparison;
9476
      }
3430 rajveer 9477
      if (isSetCouponCode()) {
9478
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
9479
        if (lastComparison != 0) {
9480
          return lastComparison;
9481
        }
1982 varun.gupt 9482
      }
3430 rajveer 9483
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 9484
      if (lastComparison != 0) {
9485
        return lastComparison;
9486
      }
3430 rajveer 9487
      if (isSetUserId()) {
9488
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
9489
        if (lastComparison != 0) {
9490
          return lastComparison;
9491
        }
1982 varun.gupt 9492
      }
9493
      return 0;
9494
    }
9495
 
3430 rajveer 9496
    public _Fields fieldForId(int fieldId) {
9497
      return _Fields.findByThriftId(fieldId);
9498
    }
9499
 
9500
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9501
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 9502
      iprot.readStructBegin();
9503
      while (true)
9504
      {
9505
        field = iprot.readFieldBegin();
3430 rajveer 9506
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 9507
          break;
9508
        }
3430 rajveer 9509
        switch (field.id) {
9510
          case 1: // COUPON_CODE
9511
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
9512
              this.couponCode = iprot.readString();
9513
            } else { 
9514
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9515
            }
9516
            break;
9517
          case 2: // USER_ID
9518
            if (field.type == org.apache.thrift.protocol.TType.I64) {
9519
              this.userId = iprot.readI64();
9520
              setUserIdIsSet(true);
9521
            } else { 
9522
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9523
            }
9524
            break;
9525
          default:
9526
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 9527
        }
3430 rajveer 9528
        iprot.readFieldEnd();
1982 varun.gupt 9529
      }
9530
      iprot.readStructEnd();
9531
      validate();
9532
    }
9533
 
3430 rajveer 9534
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 9535
      validate();
9536
 
9537
      oprot.writeStructBegin(STRUCT_DESC);
9538
      if (this.couponCode != null) {
9539
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
9540
        oprot.writeString(this.couponCode);
9541
        oprot.writeFieldEnd();
9542
      }
9543
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
9544
      oprot.writeI64(this.userId);
9545
      oprot.writeFieldEnd();
9546
      oprot.writeFieldStop();
9547
      oprot.writeStructEnd();
9548
    }
9549
 
9550
    @Override
9551
    public String toString() {
9552
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_args(");
9553
      boolean first = true;
9554
 
9555
      sb.append("couponCode:");
9556
      if (this.couponCode == null) {
9557
        sb.append("null");
9558
      } else {
9559
        sb.append(this.couponCode);
9560
      }
9561
      first = false;
9562
      if (!first) sb.append(", ");
9563
      sb.append("userId:");
9564
      sb.append(this.userId);
9565
      first = false;
9566
      sb.append(")");
9567
      return sb.toString();
9568
    }
9569
 
3430 rajveer 9570
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 9571
      // check for required fields
9572
    }
9573
 
3430 rajveer 9574
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9575
      try {
9576
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9577
      } catch (org.apache.thrift.TException te) {
9578
        throw new java.io.IOException(te);
9579
      }
9580
    }
9581
 
9582
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9583
      try {
9584
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
9585
        __isset_bit_vector = new BitSet(1);
9586
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9587
      } catch (org.apache.thrift.TException te) {
9588
        throw new java.io.IOException(te);
9589
      }
9590
    }
9591
 
1982 varun.gupt 9592
  }
9593
 
3430 rajveer 9594
  public static class getCouponUsageCountByUser_result implements org.apache.thrift.TBase<getCouponUsageCountByUser_result, getCouponUsageCountByUser_result._Fields>, java.io.Serializable, Cloneable   {
9595
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_result");
1982 varun.gupt 9596
 
3430 rajveer 9597
    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);
9598
    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 9599
 
3430 rajveer 9600
    private long success; // required
9601
    private PromotionException pex; // required
1982 varun.gupt 9602
 
9603
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 9604
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 9605
      SUCCESS((short)0, "success"),
9606
      PEX((short)1, "pex");
9607
 
9608
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9609
 
9610
      static {
9611
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9612
          byName.put(field.getFieldName(), field);
9613
        }
9614
      }
9615
 
9616
      /**
9617
       * Find the _Fields constant that matches fieldId, or null if its not found.
9618
       */
9619
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 9620
        switch(fieldId) {
9621
          case 0: // SUCCESS
9622
            return SUCCESS;
9623
          case 1: // PEX
9624
            return PEX;
9625
          default:
9626
            return null;
9627
        }
1982 varun.gupt 9628
      }
9629
 
9630
      /**
9631
       * Find the _Fields constant that matches fieldId, throwing an exception
9632
       * if it is not found.
9633
       */
9634
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9635
        _Fields fields = findByThriftId(fieldId);
9636
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9637
        return fields;
9638
      }
9639
 
9640
      /**
9641
       * Find the _Fields constant that matches name, or null if its not found.
9642
       */
9643
      public static _Fields findByName(String name) {
9644
        return byName.get(name);
9645
      }
9646
 
9647
      private final short _thriftId;
9648
      private final String _fieldName;
9649
 
9650
      _Fields(short thriftId, String fieldName) {
9651
        _thriftId = thriftId;
9652
        _fieldName = fieldName;
9653
      }
9654
 
9655
      public short getThriftFieldId() {
9656
        return _thriftId;
9657
      }
9658
 
9659
      public String getFieldName() {
9660
        return _fieldName;
9661
      }
9662
    }
9663
 
9664
    // isset id assignments
9665
    private static final int __SUCCESS_ISSET_ID = 0;
9666
    private BitSet __isset_bit_vector = new BitSet(1);
9667
 
3430 rajveer 9668
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 9669
    static {
3430 rajveer 9670
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9671
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9672
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9673
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9674
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
9675
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9676
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_result.class, metaDataMap);
1982 varun.gupt 9677
    }
9678
 
9679
    public getCouponUsageCountByUser_result() {
9680
    }
9681
 
9682
    public getCouponUsageCountByUser_result(
9683
      long success,
9684
      PromotionException pex)
9685
    {
9686
      this();
9687
      this.success = success;
9688
      setSuccessIsSet(true);
9689
      this.pex = pex;
9690
    }
9691
 
9692
    /**
9693
     * Performs a deep copy on <i>other</i>.
9694
     */
9695
    public getCouponUsageCountByUser_result(getCouponUsageCountByUser_result other) {
9696
      __isset_bit_vector.clear();
9697
      __isset_bit_vector.or(other.__isset_bit_vector);
9698
      this.success = other.success;
9699
      if (other.isSetPex()) {
9700
        this.pex = new PromotionException(other.pex);
9701
      }
9702
    }
9703
 
9704
    public getCouponUsageCountByUser_result deepCopy() {
9705
      return new getCouponUsageCountByUser_result(this);
9706
    }
9707
 
3430 rajveer 9708
    @Override
9709
    public void clear() {
9710
      setSuccessIsSet(false);
9711
      this.success = 0;
9712
      this.pex = null;
1982 varun.gupt 9713
    }
9714
 
9715
    public long getSuccess() {
9716
      return this.success;
9717
    }
9718
 
3430 rajveer 9719
    public void setSuccess(long success) {
1982 varun.gupt 9720
      this.success = success;
9721
      setSuccessIsSet(true);
9722
    }
9723
 
9724
    public void unsetSuccess() {
9725
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
9726
    }
9727
 
3430 rajveer 9728
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 9729
    public boolean isSetSuccess() {
9730
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
9731
    }
9732
 
9733
    public void setSuccessIsSet(boolean value) {
9734
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
9735
    }
9736
 
9737
    public PromotionException getPex() {
9738
      return this.pex;
9739
    }
9740
 
3430 rajveer 9741
    public void setPex(PromotionException pex) {
1982 varun.gupt 9742
      this.pex = pex;
9743
    }
9744
 
9745
    public void unsetPex() {
9746
      this.pex = null;
9747
    }
9748
 
3430 rajveer 9749
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 9750
    public boolean isSetPex() {
9751
      return this.pex != null;
9752
    }
9753
 
9754
    public void setPexIsSet(boolean value) {
9755
      if (!value) {
9756
        this.pex = null;
9757
      }
9758
    }
9759
 
9760
    public void setFieldValue(_Fields field, Object value) {
9761
      switch (field) {
9762
      case SUCCESS:
9763
        if (value == null) {
9764
          unsetSuccess();
9765
        } else {
9766
          setSuccess((Long)value);
9767
        }
9768
        break;
9769
 
9770
      case PEX:
9771
        if (value == null) {
9772
          unsetPex();
9773
        } else {
9774
          setPex((PromotionException)value);
9775
        }
9776
        break;
9777
 
9778
      }
9779
    }
9780
 
9781
    public Object getFieldValue(_Fields field) {
9782
      switch (field) {
9783
      case SUCCESS:
3430 rajveer 9784
        return Long.valueOf(getSuccess());
1982 varun.gupt 9785
 
9786
      case PEX:
9787
        return getPex();
9788
 
9789
      }
9790
      throw new IllegalStateException();
9791
    }
9792
 
3430 rajveer 9793
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9794
    public boolean isSet(_Fields field) {
9795
      if (field == null) {
9796
        throw new IllegalArgumentException();
9797
      }
1982 varun.gupt 9798
 
9799
      switch (field) {
9800
      case SUCCESS:
9801
        return isSetSuccess();
9802
      case PEX:
9803
        return isSetPex();
9804
      }
9805
      throw new IllegalStateException();
9806
    }
9807
 
9808
    @Override
9809
    public boolean equals(Object that) {
9810
      if (that == null)
9811
        return false;
9812
      if (that instanceof getCouponUsageCountByUser_result)
9813
        return this.equals((getCouponUsageCountByUser_result)that);
9814
      return false;
9815
    }
9816
 
9817
    public boolean equals(getCouponUsageCountByUser_result that) {
9818
      if (that == null)
9819
        return false;
9820
 
9821
      boolean this_present_success = true;
9822
      boolean that_present_success = true;
9823
      if (this_present_success || that_present_success) {
9824
        if (!(this_present_success && that_present_success))
9825
          return false;
9826
        if (this.success != that.success)
9827
          return false;
9828
      }
9829
 
9830
      boolean this_present_pex = true && this.isSetPex();
9831
      boolean that_present_pex = true && that.isSetPex();
9832
      if (this_present_pex || that_present_pex) {
9833
        if (!(this_present_pex && that_present_pex))
9834
          return false;
9835
        if (!this.pex.equals(that.pex))
9836
          return false;
9837
      }
9838
 
9839
      return true;
9840
    }
9841
 
9842
    @Override
9843
    public int hashCode() {
9844
      return 0;
9845
    }
9846
 
9847
    public int compareTo(getCouponUsageCountByUser_result other) {
9848
      if (!getClass().equals(other.getClass())) {
9849
        return getClass().getName().compareTo(other.getClass().getName());
9850
      }
9851
 
9852
      int lastComparison = 0;
9853
      getCouponUsageCountByUser_result typedOther = (getCouponUsageCountByUser_result)other;
9854
 
3430 rajveer 9855
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 9856
      if (lastComparison != 0) {
9857
        return lastComparison;
9858
      }
3430 rajveer 9859
      if (isSetSuccess()) {
9860
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
9861
        if (lastComparison != 0) {
9862
          return lastComparison;
9863
        }
1982 varun.gupt 9864
      }
3430 rajveer 9865
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 9866
      if (lastComparison != 0) {
9867
        return lastComparison;
9868
      }
3430 rajveer 9869
      if (isSetPex()) {
9870
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
9871
        if (lastComparison != 0) {
9872
          return lastComparison;
9873
        }
1982 varun.gupt 9874
      }
9875
      return 0;
9876
    }
9877
 
3430 rajveer 9878
    public _Fields fieldForId(int fieldId) {
9879
      return _Fields.findByThriftId(fieldId);
9880
    }
9881
 
9882
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9883
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 9884
      iprot.readStructBegin();
9885
      while (true)
9886
      {
9887
        field = iprot.readFieldBegin();
3430 rajveer 9888
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 9889
          break;
9890
        }
3430 rajveer 9891
        switch (field.id) {
9892
          case 0: // SUCCESS
9893
            if (field.type == org.apache.thrift.protocol.TType.I64) {
9894
              this.success = iprot.readI64();
9895
              setSuccessIsSet(true);
9896
            } else { 
9897
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9898
            }
9899
            break;
9900
          case 1: // PEX
9901
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
9902
              this.pex = new PromotionException();
9903
              this.pex.read(iprot);
9904
            } else { 
9905
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9906
            }
9907
            break;
9908
          default:
9909
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 9910
        }
3430 rajveer 9911
        iprot.readFieldEnd();
1982 varun.gupt 9912
      }
9913
      iprot.readStructEnd();
9914
      validate();
9915
    }
9916
 
3430 rajveer 9917
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 9918
      oprot.writeStructBegin(STRUCT_DESC);
9919
 
9920
      if (this.isSetSuccess()) {
9921
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
9922
        oprot.writeI64(this.success);
9923
        oprot.writeFieldEnd();
9924
      } else if (this.isSetPex()) {
9925
        oprot.writeFieldBegin(PEX_FIELD_DESC);
9926
        this.pex.write(oprot);
9927
        oprot.writeFieldEnd();
9928
      }
9929
      oprot.writeFieldStop();
9930
      oprot.writeStructEnd();
9931
    }
9932
 
9933
    @Override
9934
    public String toString() {
9935
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_result(");
9936
      boolean first = true;
9937
 
9938
      sb.append("success:");
9939
      sb.append(this.success);
9940
      first = false;
9941
      if (!first) sb.append(", ");
9942
      sb.append("pex:");
9943
      if (this.pex == null) {
9944
        sb.append("null");
9945
      } else {
9946
        sb.append(this.pex);
9947
      }
9948
      first = false;
9949
      sb.append(")");
9950
      return sb.toString();
9951
    }
9952
 
3430 rajveer 9953
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 9954
      // check for required fields
9955
    }
9956
 
3430 rajveer 9957
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9958
      try {
9959
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9960
      } catch (org.apache.thrift.TException te) {
9961
        throw new java.io.IOException(te);
9962
      }
9963
    }
9964
 
9965
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9966
      try {
9967
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9968
      } catch (org.apache.thrift.TException te) {
9969
        throw new java.io.IOException(te);
9970
      }
9971
    }
9972
 
1982 varun.gupt 9973
  }
9974
 
6497 amit.gupta 9975
  public static class getActiveCodes_args implements org.apache.thrift.TBase<getActiveCodes_args, getActiveCodes_args._Fields>, java.io.Serializable, Cloneable   {
9976
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCodes_args");
9977
 
9978
    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);
9979
 
9980
    private long promotionId; // required
9981
 
9982
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9983
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
9984
      PROMOTION_ID((short)1, "promotionId");
9985
 
9986
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9987
 
9988
      static {
9989
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9990
          byName.put(field.getFieldName(), field);
9991
        }
9992
      }
9993
 
9994
      /**
9995
       * Find the _Fields constant that matches fieldId, or null if its not found.
9996
       */
9997
      public static _Fields findByThriftId(int fieldId) {
9998
        switch(fieldId) {
9999
          case 1: // PROMOTION_ID
10000
            return PROMOTION_ID;
10001
          default:
10002
            return null;
10003
        }
10004
      }
10005
 
10006
      /**
10007
       * Find the _Fields constant that matches fieldId, throwing an exception
10008
       * if it is not found.
10009
       */
10010
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10011
        _Fields fields = findByThriftId(fieldId);
10012
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10013
        return fields;
10014
      }
10015
 
10016
      /**
10017
       * Find the _Fields constant that matches name, or null if its not found.
10018
       */
10019
      public static _Fields findByName(String name) {
10020
        return byName.get(name);
10021
      }
10022
 
10023
      private final short _thriftId;
10024
      private final String _fieldName;
10025
 
10026
      _Fields(short thriftId, String fieldName) {
10027
        _thriftId = thriftId;
10028
        _fieldName = fieldName;
10029
      }
10030
 
10031
      public short getThriftFieldId() {
10032
        return _thriftId;
10033
      }
10034
 
10035
      public String getFieldName() {
10036
        return _fieldName;
10037
      }
10038
    }
10039
 
10040
    // isset id assignments
10041
    private static final int __PROMOTIONID_ISSET_ID = 0;
10042
    private BitSet __isset_bit_vector = new BitSet(1);
10043
 
10044
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
10045
    static {
10046
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10047
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10048
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
10049
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10050
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCodes_args.class, metaDataMap);
10051
    }
10052
 
10053
    public getActiveCodes_args() {
10054
    }
10055
 
10056
    public getActiveCodes_args(
10057
      long promotionId)
10058
    {
10059
      this();
10060
      this.promotionId = promotionId;
10061
      setPromotionIdIsSet(true);
10062
    }
10063
 
10064
    /**
10065
     * Performs a deep copy on <i>other</i>.
10066
     */
10067
    public getActiveCodes_args(getActiveCodes_args other) {
10068
      __isset_bit_vector.clear();
10069
      __isset_bit_vector.or(other.__isset_bit_vector);
10070
      this.promotionId = other.promotionId;
10071
    }
10072
 
10073
    public getActiveCodes_args deepCopy() {
10074
      return new getActiveCodes_args(this);
10075
    }
10076
 
10077
    @Override
10078
    public void clear() {
10079
      setPromotionIdIsSet(false);
10080
      this.promotionId = 0;
10081
    }
10082
 
10083
    public long getPromotionId() {
10084
      return this.promotionId;
10085
    }
10086
 
10087
    public void setPromotionId(long promotionId) {
10088
      this.promotionId = promotionId;
10089
      setPromotionIdIsSet(true);
10090
    }
10091
 
10092
    public void unsetPromotionId() {
10093
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
10094
    }
10095
 
10096
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
10097
    public boolean isSetPromotionId() {
10098
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
10099
    }
10100
 
10101
    public void setPromotionIdIsSet(boolean value) {
10102
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
10103
    }
10104
 
10105
    public void setFieldValue(_Fields field, Object value) {
10106
      switch (field) {
10107
      case PROMOTION_ID:
10108
        if (value == null) {
10109
          unsetPromotionId();
10110
        } else {
10111
          setPromotionId((Long)value);
10112
        }
10113
        break;
10114
 
10115
      }
10116
    }
10117
 
10118
    public Object getFieldValue(_Fields field) {
10119
      switch (field) {
10120
      case PROMOTION_ID:
10121
        return Long.valueOf(getPromotionId());
10122
 
10123
      }
10124
      throw new IllegalStateException();
10125
    }
10126
 
10127
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10128
    public boolean isSet(_Fields field) {
10129
      if (field == null) {
10130
        throw new IllegalArgumentException();
10131
      }
10132
 
10133
      switch (field) {
10134
      case PROMOTION_ID:
10135
        return isSetPromotionId();
10136
      }
10137
      throw new IllegalStateException();
10138
    }
10139
 
10140
    @Override
10141
    public boolean equals(Object that) {
10142
      if (that == null)
10143
        return false;
10144
      if (that instanceof getActiveCodes_args)
10145
        return this.equals((getActiveCodes_args)that);
10146
      return false;
10147
    }
10148
 
10149
    public boolean equals(getActiveCodes_args that) {
10150
      if (that == null)
10151
        return false;
10152
 
10153
      boolean this_present_promotionId = true;
10154
      boolean that_present_promotionId = true;
10155
      if (this_present_promotionId || that_present_promotionId) {
10156
        if (!(this_present_promotionId && that_present_promotionId))
10157
          return false;
10158
        if (this.promotionId != that.promotionId)
10159
          return false;
10160
      }
10161
 
10162
      return true;
10163
    }
10164
 
10165
    @Override
10166
    public int hashCode() {
10167
      return 0;
10168
    }
10169
 
10170
    public int compareTo(getActiveCodes_args other) {
10171
      if (!getClass().equals(other.getClass())) {
10172
        return getClass().getName().compareTo(other.getClass().getName());
10173
      }
10174
 
10175
      int lastComparison = 0;
10176
      getActiveCodes_args typedOther = (getActiveCodes_args)other;
10177
 
10178
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
10179
      if (lastComparison != 0) {
10180
        return lastComparison;
10181
      }
10182
      if (isSetPromotionId()) {
10183
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
10184
        if (lastComparison != 0) {
10185
          return lastComparison;
10186
        }
10187
      }
10188
      return 0;
10189
    }
10190
 
10191
    public _Fields fieldForId(int fieldId) {
10192
      return _Fields.findByThriftId(fieldId);
10193
    }
10194
 
10195
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10196
      org.apache.thrift.protocol.TField field;
10197
      iprot.readStructBegin();
10198
      while (true)
10199
      {
10200
        field = iprot.readFieldBegin();
10201
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
10202
          break;
10203
        }
10204
        switch (field.id) {
10205
          case 1: // PROMOTION_ID
10206
            if (field.type == org.apache.thrift.protocol.TType.I64) {
10207
              this.promotionId = iprot.readI64();
10208
              setPromotionIdIsSet(true);
10209
            } else { 
10210
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10211
            }
10212
            break;
10213
          default:
10214
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10215
        }
10216
        iprot.readFieldEnd();
10217
      }
10218
      iprot.readStructEnd();
10219
      validate();
10220
    }
10221
 
10222
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
10223
      validate();
10224
 
10225
      oprot.writeStructBegin(STRUCT_DESC);
10226
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
10227
      oprot.writeI64(this.promotionId);
10228
      oprot.writeFieldEnd();
10229
      oprot.writeFieldStop();
10230
      oprot.writeStructEnd();
10231
    }
10232
 
10233
    @Override
10234
    public String toString() {
10235
      StringBuilder sb = new StringBuilder("getActiveCodes_args(");
10236
      boolean first = true;
10237
 
10238
      sb.append("promotionId:");
10239
      sb.append(this.promotionId);
10240
      first = false;
10241
      sb.append(")");
10242
      return sb.toString();
10243
    }
10244
 
10245
    public void validate() throws org.apache.thrift.TException {
10246
      // check for required fields
10247
    }
10248
 
10249
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10250
      try {
10251
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10252
      } catch (org.apache.thrift.TException te) {
10253
        throw new java.io.IOException(te);
10254
      }
10255
    }
10256
 
10257
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10258
      try {
10259
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
10260
        __isset_bit_vector = new BitSet(1);
10261
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10262
      } catch (org.apache.thrift.TException te) {
10263
        throw new java.io.IOException(te);
10264
      }
10265
    }
10266
 
10267
  }
10268
 
10269
  public static class getActiveCodes_result implements org.apache.thrift.TBase<getActiveCodes_result, getActiveCodes_result._Fields>, java.io.Serializable, Cloneable   {
10270
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCodes_result");
10271
 
10272
    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);
10273
    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);
10274
 
10275
    private List<Coupon> success; // required
10276
    private PromotionException pex; // required
10277
 
10278
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
10279
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
10280
      SUCCESS((short)0, "success"),
10281
      PEX((short)1, "pex");
10282
 
10283
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10284
 
10285
      static {
10286
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10287
          byName.put(field.getFieldName(), field);
10288
        }
10289
      }
10290
 
10291
      /**
10292
       * Find the _Fields constant that matches fieldId, or null if its not found.
10293
       */
10294
      public static _Fields findByThriftId(int fieldId) {
10295
        switch(fieldId) {
10296
          case 0: // SUCCESS
10297
            return SUCCESS;
10298
          case 1: // PEX
10299
            return PEX;
10300
          default:
10301
            return null;
10302
        }
10303
      }
10304
 
10305
      /**
10306
       * Find the _Fields constant that matches fieldId, throwing an exception
10307
       * if it is not found.
10308
       */
10309
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10310
        _Fields fields = findByThriftId(fieldId);
10311
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10312
        return fields;
10313
      }
10314
 
10315
      /**
10316
       * Find the _Fields constant that matches name, or null if its not found.
10317
       */
10318
      public static _Fields findByName(String name) {
10319
        return byName.get(name);
10320
      }
10321
 
10322
      private final short _thriftId;
10323
      private final String _fieldName;
10324
 
10325
      _Fields(short thriftId, String fieldName) {
10326
        _thriftId = thriftId;
10327
        _fieldName = fieldName;
10328
      }
10329
 
10330
      public short getThriftFieldId() {
10331
        return _thriftId;
10332
      }
10333
 
10334
      public String getFieldName() {
10335
        return _fieldName;
10336
      }
10337
    }
10338
 
10339
    // isset id assignments
10340
 
10341
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
10342
    static {
10343
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10344
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10345
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
10346
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
10347
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10348
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
10349
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10350
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCodes_result.class, metaDataMap);
10351
    }
10352
 
10353
    public getActiveCodes_result() {
10354
    }
10355
 
10356
    public getActiveCodes_result(
10357
      List<Coupon> success,
10358
      PromotionException pex)
10359
    {
10360
      this();
10361
      this.success = success;
10362
      this.pex = pex;
10363
    }
10364
 
10365
    /**
10366
     * Performs a deep copy on <i>other</i>.
10367
     */
10368
    public getActiveCodes_result(getActiveCodes_result other) {
10369
      if (other.isSetSuccess()) {
10370
        List<Coupon> __this__success = new ArrayList<Coupon>();
10371
        for (Coupon other_element : other.success) {
10372
          __this__success.add(new Coupon(other_element));
10373
        }
10374
        this.success = __this__success;
10375
      }
10376
      if (other.isSetPex()) {
10377
        this.pex = new PromotionException(other.pex);
10378
      }
10379
    }
10380
 
10381
    public getActiveCodes_result deepCopy() {
10382
      return new getActiveCodes_result(this);
10383
    }
10384
 
10385
    @Override
10386
    public void clear() {
10387
      this.success = null;
10388
      this.pex = null;
10389
    }
10390
 
10391
    public int getSuccessSize() {
10392
      return (this.success == null) ? 0 : this.success.size();
10393
    }
10394
 
10395
    public java.util.Iterator<Coupon> getSuccessIterator() {
10396
      return (this.success == null) ? null : this.success.iterator();
10397
    }
10398
 
10399
    public void addToSuccess(Coupon elem) {
10400
      if (this.success == null) {
10401
        this.success = new ArrayList<Coupon>();
10402
      }
10403
      this.success.add(elem);
10404
    }
10405
 
10406
    public List<Coupon> getSuccess() {
10407
      return this.success;
10408
    }
10409
 
10410
    public void setSuccess(List<Coupon> success) {
10411
      this.success = success;
10412
    }
10413
 
10414
    public void unsetSuccess() {
10415
      this.success = null;
10416
    }
10417
 
10418
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
10419
    public boolean isSetSuccess() {
10420
      return this.success != null;
10421
    }
10422
 
10423
    public void setSuccessIsSet(boolean value) {
10424
      if (!value) {
10425
        this.success = null;
10426
      }
10427
    }
10428
 
10429
    public PromotionException getPex() {
10430
      return this.pex;
10431
    }
10432
 
10433
    public void setPex(PromotionException pex) {
10434
      this.pex = pex;
10435
    }
10436
 
10437
    public void unsetPex() {
10438
      this.pex = null;
10439
    }
10440
 
10441
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
10442
    public boolean isSetPex() {
10443
      return this.pex != null;
10444
    }
10445
 
10446
    public void setPexIsSet(boolean value) {
10447
      if (!value) {
10448
        this.pex = null;
10449
      }
10450
    }
10451
 
10452
    public void setFieldValue(_Fields field, Object value) {
10453
      switch (field) {
10454
      case SUCCESS:
10455
        if (value == null) {
10456
          unsetSuccess();
10457
        } else {
10458
          setSuccess((List<Coupon>)value);
10459
        }
10460
        break;
10461
 
10462
      case PEX:
10463
        if (value == null) {
10464
          unsetPex();
10465
        } else {
10466
          setPex((PromotionException)value);
10467
        }
10468
        break;
10469
 
10470
      }
10471
    }
10472
 
10473
    public Object getFieldValue(_Fields field) {
10474
      switch (field) {
10475
      case SUCCESS:
10476
        return getSuccess();
10477
 
10478
      case PEX:
10479
        return getPex();
10480
 
10481
      }
10482
      throw new IllegalStateException();
10483
    }
10484
 
10485
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10486
    public boolean isSet(_Fields field) {
10487
      if (field == null) {
10488
        throw new IllegalArgumentException();
10489
      }
10490
 
10491
      switch (field) {
10492
      case SUCCESS:
10493
        return isSetSuccess();
10494
      case PEX:
10495
        return isSetPex();
10496
      }
10497
      throw new IllegalStateException();
10498
    }
10499
 
10500
    @Override
10501
    public boolean equals(Object that) {
10502
      if (that == null)
10503
        return false;
10504
      if (that instanceof getActiveCodes_result)
10505
        return this.equals((getActiveCodes_result)that);
10506
      return false;
10507
    }
10508
 
10509
    public boolean equals(getActiveCodes_result that) {
10510
      if (that == null)
10511
        return false;
10512
 
10513
      boolean this_present_success = true && this.isSetSuccess();
10514
      boolean that_present_success = true && that.isSetSuccess();
10515
      if (this_present_success || that_present_success) {
10516
        if (!(this_present_success && that_present_success))
10517
          return false;
10518
        if (!this.success.equals(that.success))
10519
          return false;
10520
      }
10521
 
10522
      boolean this_present_pex = true && this.isSetPex();
10523
      boolean that_present_pex = true && that.isSetPex();
10524
      if (this_present_pex || that_present_pex) {
10525
        if (!(this_present_pex && that_present_pex))
10526
          return false;
10527
        if (!this.pex.equals(that.pex))
10528
          return false;
10529
      }
10530
 
10531
      return true;
10532
    }
10533
 
10534
    @Override
10535
    public int hashCode() {
10536
      return 0;
10537
    }
10538
 
10539
    public int compareTo(getActiveCodes_result other) {
10540
      if (!getClass().equals(other.getClass())) {
10541
        return getClass().getName().compareTo(other.getClass().getName());
10542
      }
10543
 
10544
      int lastComparison = 0;
10545
      getActiveCodes_result typedOther = (getActiveCodes_result)other;
10546
 
10547
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
10548
      if (lastComparison != 0) {
10549
        return lastComparison;
10550
      }
10551
      if (isSetSuccess()) {
10552
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
10553
        if (lastComparison != 0) {
10554
          return lastComparison;
10555
        }
10556
      }
10557
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
10558
      if (lastComparison != 0) {
10559
        return lastComparison;
10560
      }
10561
      if (isSetPex()) {
10562
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
10563
        if (lastComparison != 0) {
10564
          return lastComparison;
10565
        }
10566
      }
10567
      return 0;
10568
    }
10569
 
10570
    public _Fields fieldForId(int fieldId) {
10571
      return _Fields.findByThriftId(fieldId);
10572
    }
10573
 
10574
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10575
      org.apache.thrift.protocol.TField field;
10576
      iprot.readStructBegin();
10577
      while (true)
10578
      {
10579
        field = iprot.readFieldBegin();
10580
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
10581
          break;
10582
        }
10583
        switch (field.id) {
10584
          case 0: // SUCCESS
10585
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
10586
              {
10587
                org.apache.thrift.protocol.TList _list21 = iprot.readListBegin();
10588
                this.success = new ArrayList<Coupon>(_list21.size);
10589
                for (int _i22 = 0; _i22 < _list21.size; ++_i22)
10590
                {
10591
                  Coupon _elem23; // required
10592
                  _elem23 = new Coupon();
10593
                  _elem23.read(iprot);
10594
                  this.success.add(_elem23);
10595
                }
10596
                iprot.readListEnd();
10597
              }
10598
            } else { 
10599
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10600
            }
10601
            break;
10602
          case 1: // PEX
10603
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
10604
              this.pex = new PromotionException();
10605
              this.pex.read(iprot);
10606
            } else { 
10607
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10608
            }
10609
            break;
10610
          default:
10611
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10612
        }
10613
        iprot.readFieldEnd();
10614
      }
10615
      iprot.readStructEnd();
10616
      validate();
10617
    }
10618
 
10619
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
10620
      oprot.writeStructBegin(STRUCT_DESC);
10621
 
10622
      if (this.isSetSuccess()) {
10623
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
10624
        {
10625
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
10626
          for (Coupon _iter24 : this.success)
10627
          {
10628
            _iter24.write(oprot);
10629
          }
10630
          oprot.writeListEnd();
10631
        }
10632
        oprot.writeFieldEnd();
10633
      } else if (this.isSetPex()) {
10634
        oprot.writeFieldBegin(PEX_FIELD_DESC);
10635
        this.pex.write(oprot);
10636
        oprot.writeFieldEnd();
10637
      }
10638
      oprot.writeFieldStop();
10639
      oprot.writeStructEnd();
10640
    }
10641
 
10642
    @Override
10643
    public String toString() {
10644
      StringBuilder sb = new StringBuilder("getActiveCodes_result(");
10645
      boolean first = true;
10646
 
10647
      sb.append("success:");
10648
      if (this.success == null) {
10649
        sb.append("null");
10650
      } else {
10651
        sb.append(this.success);
10652
      }
10653
      first = false;
10654
      if (!first) sb.append(", ");
10655
      sb.append("pex:");
10656
      if (this.pex == null) {
10657
        sb.append("null");
10658
      } else {
10659
        sb.append(this.pex);
10660
      }
10661
      first = false;
10662
      sb.append(")");
10663
      return sb.toString();
10664
    }
10665
 
10666
    public void validate() throws org.apache.thrift.TException {
10667
      // check for required fields
10668
    }
10669
 
10670
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10671
      try {
10672
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10673
      } catch (org.apache.thrift.TException te) {
10674
        throw new java.io.IOException(te);
10675
      }
10676
    }
10677
 
10678
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10679
      try {
10680
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10681
      } catch (org.apache.thrift.TException te) {
10682
        throw new java.io.IOException(te);
10683
      }
10684
    }
10685
 
10686
  }
10687
 
10688
  public static class deleteCoupon_args implements org.apache.thrift.TBase<deleteCoupon_args, deleteCoupon_args._Fields>, java.io.Serializable, Cloneable   {
10689
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteCoupon_args");
10690
 
10691
    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);
10692
 
10693
    private String couponCode; // required
10694
 
10695
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
10696
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
10697
      COUPON_CODE((short)1, "couponCode");
10698
 
10699
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10700
 
10701
      static {
10702
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10703
          byName.put(field.getFieldName(), field);
10704
        }
10705
      }
10706
 
10707
      /**
10708
       * Find the _Fields constant that matches fieldId, or null if its not found.
10709
       */
10710
      public static _Fields findByThriftId(int fieldId) {
10711
        switch(fieldId) {
10712
          case 1: // COUPON_CODE
10713
            return COUPON_CODE;
10714
          default:
10715
            return null;
10716
        }
10717
      }
10718
 
10719
      /**
10720
       * Find the _Fields constant that matches fieldId, throwing an exception
10721
       * if it is not found.
10722
       */
10723
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10724
        _Fields fields = findByThriftId(fieldId);
10725
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10726
        return fields;
10727
      }
10728
 
10729
      /**
10730
       * Find the _Fields constant that matches name, or null if its not found.
10731
       */
10732
      public static _Fields findByName(String name) {
10733
        return byName.get(name);
10734
      }
10735
 
10736
      private final short _thriftId;
10737
      private final String _fieldName;
10738
 
10739
      _Fields(short thriftId, String fieldName) {
10740
        _thriftId = thriftId;
10741
        _fieldName = fieldName;
10742
      }
10743
 
10744
      public short getThriftFieldId() {
10745
        return _thriftId;
10746
      }
10747
 
10748
      public String getFieldName() {
10749
        return _fieldName;
10750
      }
10751
    }
10752
 
10753
    // isset id assignments
10754
 
10755
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
10756
    static {
10757
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10758
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10759
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
10760
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10761
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteCoupon_args.class, metaDataMap);
10762
    }
10763
 
10764
    public deleteCoupon_args() {
10765
    }
10766
 
10767
    public deleteCoupon_args(
10768
      String couponCode)
10769
    {
10770
      this();
10771
      this.couponCode = couponCode;
10772
    }
10773
 
10774
    /**
10775
     * Performs a deep copy on <i>other</i>.
10776
     */
10777
    public deleteCoupon_args(deleteCoupon_args other) {
10778
      if (other.isSetCouponCode()) {
10779
        this.couponCode = other.couponCode;
10780
      }
10781
    }
10782
 
10783
    public deleteCoupon_args deepCopy() {
10784
      return new deleteCoupon_args(this);
10785
    }
10786
 
10787
    @Override
10788
    public void clear() {
10789
      this.couponCode = null;
10790
    }
10791
 
10792
    public String getCouponCode() {
10793
      return this.couponCode;
10794
    }
10795
 
10796
    public void setCouponCode(String couponCode) {
10797
      this.couponCode = couponCode;
10798
    }
10799
 
10800
    public void unsetCouponCode() {
10801
      this.couponCode = null;
10802
    }
10803
 
10804
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
10805
    public boolean isSetCouponCode() {
10806
      return this.couponCode != null;
10807
    }
10808
 
10809
    public void setCouponCodeIsSet(boolean value) {
10810
      if (!value) {
10811
        this.couponCode = null;
10812
      }
10813
    }
10814
 
10815
    public void setFieldValue(_Fields field, Object value) {
10816
      switch (field) {
10817
      case COUPON_CODE:
10818
        if (value == null) {
10819
          unsetCouponCode();
10820
        } else {
10821
          setCouponCode((String)value);
10822
        }
10823
        break;
10824
 
10825
      }
10826
    }
10827
 
10828
    public Object getFieldValue(_Fields field) {
10829
      switch (field) {
10830
      case COUPON_CODE:
10831
        return getCouponCode();
10832
 
10833
      }
10834
      throw new IllegalStateException();
10835
    }
10836
 
10837
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10838
    public boolean isSet(_Fields field) {
10839
      if (field == null) {
10840
        throw new IllegalArgumentException();
10841
      }
10842
 
10843
      switch (field) {
10844
      case COUPON_CODE:
10845
        return isSetCouponCode();
10846
      }
10847
      throw new IllegalStateException();
10848
    }
10849
 
10850
    @Override
10851
    public boolean equals(Object that) {
10852
      if (that == null)
10853
        return false;
10854
      if (that instanceof deleteCoupon_args)
10855
        return this.equals((deleteCoupon_args)that);
10856
      return false;
10857
    }
10858
 
10859
    public boolean equals(deleteCoupon_args that) {
10860
      if (that == null)
10861
        return false;
10862
 
10863
      boolean this_present_couponCode = true && this.isSetCouponCode();
10864
      boolean that_present_couponCode = true && that.isSetCouponCode();
10865
      if (this_present_couponCode || that_present_couponCode) {
10866
        if (!(this_present_couponCode && that_present_couponCode))
10867
          return false;
10868
        if (!this.couponCode.equals(that.couponCode))
10869
          return false;
10870
      }
10871
 
10872
      return true;
10873
    }
10874
 
10875
    @Override
10876
    public int hashCode() {
10877
      return 0;
10878
    }
10879
 
10880
    public int compareTo(deleteCoupon_args other) {
10881
      if (!getClass().equals(other.getClass())) {
10882
        return getClass().getName().compareTo(other.getClass().getName());
10883
      }
10884
 
10885
      int lastComparison = 0;
10886
      deleteCoupon_args typedOther = (deleteCoupon_args)other;
10887
 
10888
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
10889
      if (lastComparison != 0) {
10890
        return lastComparison;
10891
      }
10892
      if (isSetCouponCode()) {
10893
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
10894
        if (lastComparison != 0) {
10895
          return lastComparison;
10896
        }
10897
      }
10898
      return 0;
10899
    }
10900
 
10901
    public _Fields fieldForId(int fieldId) {
10902
      return _Fields.findByThriftId(fieldId);
10903
    }
10904
 
10905
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10906
      org.apache.thrift.protocol.TField field;
10907
      iprot.readStructBegin();
10908
      while (true)
10909
      {
10910
        field = iprot.readFieldBegin();
10911
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
10912
          break;
10913
        }
10914
        switch (field.id) {
10915
          case 1: // COUPON_CODE
10916
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
10917
              this.couponCode = iprot.readString();
10918
            } else { 
10919
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10920
            }
10921
            break;
10922
          default:
10923
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10924
        }
10925
        iprot.readFieldEnd();
10926
      }
10927
      iprot.readStructEnd();
10928
      validate();
10929
    }
10930
 
10931
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
10932
      validate();
10933
 
10934
      oprot.writeStructBegin(STRUCT_DESC);
10935
      if (this.couponCode != null) {
10936
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
10937
        oprot.writeString(this.couponCode);
10938
        oprot.writeFieldEnd();
10939
      }
10940
      oprot.writeFieldStop();
10941
      oprot.writeStructEnd();
10942
    }
10943
 
10944
    @Override
10945
    public String toString() {
10946
      StringBuilder sb = new StringBuilder("deleteCoupon_args(");
10947
      boolean first = true;
10948
 
10949
      sb.append("couponCode:");
10950
      if (this.couponCode == null) {
10951
        sb.append("null");
10952
      } else {
10953
        sb.append(this.couponCode);
10954
      }
10955
      first = false;
10956
      sb.append(")");
10957
      return sb.toString();
10958
    }
10959
 
10960
    public void validate() throws org.apache.thrift.TException {
10961
      // check for required fields
10962
    }
10963
 
10964
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10965
      try {
10966
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10967
      } catch (org.apache.thrift.TException te) {
10968
        throw new java.io.IOException(te);
10969
      }
10970
    }
10971
 
10972
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10973
      try {
10974
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10975
      } catch (org.apache.thrift.TException te) {
10976
        throw new java.io.IOException(te);
10977
      }
10978
    }
10979
 
10980
  }
10981
 
10982
  public static class deleteCoupon_result implements org.apache.thrift.TBase<deleteCoupon_result, deleteCoupon_result._Fields>, java.io.Serializable, Cloneable   {
10983
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteCoupon_result");
10984
 
10985
    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);
10986
 
10987
    private PromotionException pex; // required
10988
 
10989
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
10990
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
10991
      PEX((short)1, "pex");
10992
 
10993
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10994
 
10995
      static {
10996
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10997
          byName.put(field.getFieldName(), field);
10998
        }
10999
      }
11000
 
11001
      /**
11002
       * Find the _Fields constant that matches fieldId, or null if its not found.
11003
       */
11004
      public static _Fields findByThriftId(int fieldId) {
11005
        switch(fieldId) {
11006
          case 1: // PEX
11007
            return PEX;
11008
          default:
11009
            return null;
11010
        }
11011
      }
11012
 
11013
      /**
11014
       * Find the _Fields constant that matches fieldId, throwing an exception
11015
       * if it is not found.
11016
       */
11017
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11018
        _Fields fields = findByThriftId(fieldId);
11019
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11020
        return fields;
11021
      }
11022
 
11023
      /**
11024
       * Find the _Fields constant that matches name, or null if its not found.
11025
       */
11026
      public static _Fields findByName(String name) {
11027
        return byName.get(name);
11028
      }
11029
 
11030
      private final short _thriftId;
11031
      private final String _fieldName;
11032
 
11033
      _Fields(short thriftId, String fieldName) {
11034
        _thriftId = thriftId;
11035
        _fieldName = fieldName;
11036
      }
11037
 
11038
      public short getThriftFieldId() {
11039
        return _thriftId;
11040
      }
11041
 
11042
      public String getFieldName() {
11043
        return _fieldName;
11044
      }
11045
    }
11046
 
11047
    // isset id assignments
11048
 
11049
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
11050
    static {
11051
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11052
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11053
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
11054
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11055
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteCoupon_result.class, metaDataMap);
11056
    }
11057
 
11058
    public deleteCoupon_result() {
11059
    }
11060
 
11061
    public deleteCoupon_result(
11062
      PromotionException pex)
11063
    {
11064
      this();
11065
      this.pex = pex;
11066
    }
11067
 
11068
    /**
11069
     * Performs a deep copy on <i>other</i>.
11070
     */
11071
    public deleteCoupon_result(deleteCoupon_result other) {
11072
      if (other.isSetPex()) {
11073
        this.pex = new PromotionException(other.pex);
11074
      }
11075
    }
11076
 
11077
    public deleteCoupon_result deepCopy() {
11078
      return new deleteCoupon_result(this);
11079
    }
11080
 
11081
    @Override
11082
    public void clear() {
11083
      this.pex = null;
11084
    }
11085
 
11086
    public PromotionException getPex() {
11087
      return this.pex;
11088
    }
11089
 
11090
    public void setPex(PromotionException pex) {
11091
      this.pex = pex;
11092
    }
11093
 
11094
    public void unsetPex() {
11095
      this.pex = null;
11096
    }
11097
 
11098
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
11099
    public boolean isSetPex() {
11100
      return this.pex != null;
11101
    }
11102
 
11103
    public void setPexIsSet(boolean value) {
11104
      if (!value) {
11105
        this.pex = null;
11106
      }
11107
    }
11108
 
11109
    public void setFieldValue(_Fields field, Object value) {
11110
      switch (field) {
11111
      case PEX:
11112
        if (value == null) {
11113
          unsetPex();
11114
        } else {
11115
          setPex((PromotionException)value);
11116
        }
11117
        break;
11118
 
11119
      }
11120
    }
11121
 
11122
    public Object getFieldValue(_Fields field) {
11123
      switch (field) {
11124
      case PEX:
11125
        return getPex();
11126
 
11127
      }
11128
      throw new IllegalStateException();
11129
    }
11130
 
11131
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11132
    public boolean isSet(_Fields field) {
11133
      if (field == null) {
11134
        throw new IllegalArgumentException();
11135
      }
11136
 
11137
      switch (field) {
11138
      case PEX:
11139
        return isSetPex();
11140
      }
11141
      throw new IllegalStateException();
11142
    }
11143
 
11144
    @Override
11145
    public boolean equals(Object that) {
11146
      if (that == null)
11147
        return false;
11148
      if (that instanceof deleteCoupon_result)
11149
        return this.equals((deleteCoupon_result)that);
11150
      return false;
11151
    }
11152
 
11153
    public boolean equals(deleteCoupon_result that) {
11154
      if (that == null)
11155
        return false;
11156
 
11157
      boolean this_present_pex = true && this.isSetPex();
11158
      boolean that_present_pex = true && that.isSetPex();
11159
      if (this_present_pex || that_present_pex) {
11160
        if (!(this_present_pex && that_present_pex))
11161
          return false;
11162
        if (!this.pex.equals(that.pex))
11163
          return false;
11164
      }
11165
 
11166
      return true;
11167
    }
11168
 
11169
    @Override
11170
    public int hashCode() {
11171
      return 0;
11172
    }
11173
 
11174
    public int compareTo(deleteCoupon_result other) {
11175
      if (!getClass().equals(other.getClass())) {
11176
        return getClass().getName().compareTo(other.getClass().getName());
11177
      }
11178
 
11179
      int lastComparison = 0;
11180
      deleteCoupon_result typedOther = (deleteCoupon_result)other;
11181
 
11182
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
11183
      if (lastComparison != 0) {
11184
        return lastComparison;
11185
      }
11186
      if (isSetPex()) {
11187
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
11188
        if (lastComparison != 0) {
11189
          return lastComparison;
11190
        }
11191
      }
11192
      return 0;
11193
    }
11194
 
11195
    public _Fields fieldForId(int fieldId) {
11196
      return _Fields.findByThriftId(fieldId);
11197
    }
11198
 
11199
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11200
      org.apache.thrift.protocol.TField field;
11201
      iprot.readStructBegin();
11202
      while (true)
11203
      {
11204
        field = iprot.readFieldBegin();
11205
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
11206
          break;
11207
        }
11208
        switch (field.id) {
11209
          case 1: // PEX
11210
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
11211
              this.pex = new PromotionException();
11212
              this.pex.read(iprot);
11213
            } else { 
11214
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11215
            }
11216
            break;
11217
          default:
11218
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11219
        }
11220
        iprot.readFieldEnd();
11221
      }
11222
      iprot.readStructEnd();
11223
      validate();
11224
    }
11225
 
11226
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
11227
      oprot.writeStructBegin(STRUCT_DESC);
11228
 
11229
      if (this.isSetPex()) {
11230
        oprot.writeFieldBegin(PEX_FIELD_DESC);
11231
        this.pex.write(oprot);
11232
        oprot.writeFieldEnd();
11233
      }
11234
      oprot.writeFieldStop();
11235
      oprot.writeStructEnd();
11236
    }
11237
 
11238
    @Override
11239
    public String toString() {
11240
      StringBuilder sb = new StringBuilder("deleteCoupon_result(");
11241
      boolean first = true;
11242
 
11243
      sb.append("pex:");
11244
      if (this.pex == null) {
11245
        sb.append("null");
11246
      } else {
11247
        sb.append(this.pex);
11248
      }
11249
      first = false;
11250
      sb.append(")");
11251
      return sb.toString();
11252
    }
11253
 
11254
    public void validate() throws org.apache.thrift.TException {
11255
      // check for required fields
11256
    }
11257
 
11258
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11259
      try {
11260
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11261
      } catch (org.apache.thrift.TException te) {
11262
        throw new java.io.IOException(te);
11263
      }
11264
    }
11265
 
11266
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11267
      try {
11268
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11269
      } catch (org.apache.thrift.TException te) {
11270
        throw new java.io.IOException(te);
11271
      }
11272
    }
11273
 
11274
  }
11275
 
3430 rajveer 11276
  public static class getActiveCoupons_args implements org.apache.thrift.TBase<getActiveCoupons_args, getActiveCoupons_args._Fields>, java.io.Serializable, Cloneable   {
11277
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_args");
3385 varun.gupt 11278
 
11279
 
11280
 
11281
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 11282
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 11283
;
11284
 
11285
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11286
 
11287
      static {
11288
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11289
          byName.put(field.getFieldName(), field);
11290
        }
11291
      }
11292
 
11293
      /**
11294
       * Find the _Fields constant that matches fieldId, or null if its not found.
11295
       */
11296
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 11297
        switch(fieldId) {
11298
          default:
11299
            return null;
11300
        }
3385 varun.gupt 11301
      }
11302
 
11303
      /**
11304
       * Find the _Fields constant that matches fieldId, throwing an exception
11305
       * if it is not found.
11306
       */
11307
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11308
        _Fields fields = findByThriftId(fieldId);
11309
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11310
        return fields;
11311
      }
11312
 
11313
      /**
11314
       * Find the _Fields constant that matches name, or null if its not found.
11315
       */
11316
      public static _Fields findByName(String name) {
11317
        return byName.get(name);
11318
      }
11319
 
11320
      private final short _thriftId;
11321
      private final String _fieldName;
11322
 
11323
      _Fields(short thriftId, String fieldName) {
11324
        _thriftId = thriftId;
11325
        _fieldName = fieldName;
11326
      }
11327
 
11328
      public short getThriftFieldId() {
11329
        return _thriftId;
11330
      }
11331
 
11332
      public String getFieldName() {
11333
        return _fieldName;
11334
      }
11335
    }
3430 rajveer 11336
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 11337
    static {
3430 rajveer 11338
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11339
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11340
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_args.class, metaDataMap);
3385 varun.gupt 11341
    }
11342
 
11343
    public getActiveCoupons_args() {
11344
    }
11345
 
11346
    /**
11347
     * Performs a deep copy on <i>other</i>.
11348
     */
11349
    public getActiveCoupons_args(getActiveCoupons_args other) {
11350
    }
11351
 
11352
    public getActiveCoupons_args deepCopy() {
11353
      return new getActiveCoupons_args(this);
11354
    }
11355
 
3430 rajveer 11356
    @Override
11357
    public void clear() {
3385 varun.gupt 11358
    }
11359
 
11360
    public void setFieldValue(_Fields field, Object value) {
11361
      switch (field) {
11362
      }
11363
    }
11364
 
11365
    public Object getFieldValue(_Fields field) {
11366
      switch (field) {
11367
      }
11368
      throw new IllegalStateException();
11369
    }
11370
 
3430 rajveer 11371
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11372
    public boolean isSet(_Fields field) {
11373
      if (field == null) {
11374
        throw new IllegalArgumentException();
11375
      }
3385 varun.gupt 11376
 
11377
      switch (field) {
11378
      }
11379
      throw new IllegalStateException();
11380
    }
11381
 
11382
    @Override
11383
    public boolean equals(Object that) {
11384
      if (that == null)
11385
        return false;
11386
      if (that instanceof getActiveCoupons_args)
11387
        return this.equals((getActiveCoupons_args)that);
11388
      return false;
11389
    }
11390
 
11391
    public boolean equals(getActiveCoupons_args that) {
11392
      if (that == null)
11393
        return false;
11394
 
11395
      return true;
11396
    }
11397
 
11398
    @Override
11399
    public int hashCode() {
11400
      return 0;
11401
    }
11402
 
11403
    public int compareTo(getActiveCoupons_args other) {
11404
      if (!getClass().equals(other.getClass())) {
11405
        return getClass().getName().compareTo(other.getClass().getName());
11406
      }
11407
 
11408
      int lastComparison = 0;
11409
      getActiveCoupons_args typedOther = (getActiveCoupons_args)other;
11410
 
11411
      return 0;
11412
    }
11413
 
3430 rajveer 11414
    public _Fields fieldForId(int fieldId) {
11415
      return _Fields.findByThriftId(fieldId);
11416
    }
11417
 
11418
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11419
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 11420
      iprot.readStructBegin();
11421
      while (true)
11422
      {
11423
        field = iprot.readFieldBegin();
3430 rajveer 11424
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 11425
          break;
11426
        }
3430 rajveer 11427
        switch (field.id) {
11428
          default:
11429
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 11430
        }
3430 rajveer 11431
        iprot.readFieldEnd();
3385 varun.gupt 11432
      }
11433
      iprot.readStructEnd();
11434
      validate();
11435
    }
11436
 
3430 rajveer 11437
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 11438
      validate();
11439
 
11440
      oprot.writeStructBegin(STRUCT_DESC);
11441
      oprot.writeFieldStop();
11442
      oprot.writeStructEnd();
11443
    }
11444
 
11445
    @Override
11446
    public String toString() {
11447
      StringBuilder sb = new StringBuilder("getActiveCoupons_args(");
11448
      boolean first = true;
11449
 
11450
      sb.append(")");
11451
      return sb.toString();
11452
    }
11453
 
3430 rajveer 11454
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 11455
      // check for required fields
11456
    }
11457
 
3430 rajveer 11458
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11459
      try {
11460
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11461
      } catch (org.apache.thrift.TException te) {
11462
        throw new java.io.IOException(te);
11463
      }
11464
    }
11465
 
11466
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11467
      try {
11468
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11469
      } catch (org.apache.thrift.TException te) {
11470
        throw new java.io.IOException(te);
11471
      }
11472
    }
11473
 
3385 varun.gupt 11474
  }
11475
 
3430 rajveer 11476
  public static class getActiveCoupons_result implements org.apache.thrift.TBase<getActiveCoupons_result, getActiveCoupons_result._Fields>, java.io.Serializable, Cloneable   {
11477
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_result");
3385 varun.gupt 11478
 
3430 rajveer 11479
    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);
11480
    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 11481
 
3430 rajveer 11482
    private List<Coupon> success; // required
11483
    private PromotionException pex; // required
3385 varun.gupt 11484
 
11485
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 11486
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 11487
      SUCCESS((short)0, "success"),
11488
      PEX((short)1, "pex");
11489
 
11490
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11491
 
11492
      static {
11493
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11494
          byName.put(field.getFieldName(), field);
11495
        }
11496
      }
11497
 
11498
      /**
11499
       * Find the _Fields constant that matches fieldId, or null if its not found.
11500
       */
11501
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 11502
        switch(fieldId) {
11503
          case 0: // SUCCESS
11504
            return SUCCESS;
11505
          case 1: // PEX
11506
            return PEX;
11507
          default:
11508
            return null;
11509
        }
3385 varun.gupt 11510
      }
11511
 
11512
      /**
11513
       * Find the _Fields constant that matches fieldId, throwing an exception
11514
       * if it is not found.
11515
       */
11516
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11517
        _Fields fields = findByThriftId(fieldId);
11518
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11519
        return fields;
11520
      }
11521
 
11522
      /**
11523
       * Find the _Fields constant that matches name, or null if its not found.
11524
       */
11525
      public static _Fields findByName(String name) {
11526
        return byName.get(name);
11527
      }
11528
 
11529
      private final short _thriftId;
11530
      private final String _fieldName;
11531
 
11532
      _Fields(short thriftId, String fieldName) {
11533
        _thriftId = thriftId;
11534
        _fieldName = fieldName;
11535
      }
11536
 
11537
      public short getThriftFieldId() {
11538
        return _thriftId;
11539
      }
11540
 
11541
      public String getFieldName() {
11542
        return _fieldName;
11543
      }
11544
    }
11545
 
11546
    // isset id assignments
11547
 
3430 rajveer 11548
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 11549
    static {
3430 rajveer 11550
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11551
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11552
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
11553
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
11554
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11555
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
11556
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11557
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_result.class, metaDataMap);
3385 varun.gupt 11558
    }
11559
 
11560
    public getActiveCoupons_result() {
11561
    }
11562
 
11563
    public getActiveCoupons_result(
11564
      List<Coupon> success,
11565
      PromotionException pex)
11566
    {
11567
      this();
11568
      this.success = success;
11569
      this.pex = pex;
11570
    }
11571
 
11572
    /**
11573
     * Performs a deep copy on <i>other</i>.
11574
     */
11575
    public getActiveCoupons_result(getActiveCoupons_result other) {
11576
      if (other.isSetSuccess()) {
11577
        List<Coupon> __this__success = new ArrayList<Coupon>();
11578
        for (Coupon other_element : other.success) {
11579
          __this__success.add(new Coupon(other_element));
11580
        }
11581
        this.success = __this__success;
11582
      }
11583
      if (other.isSetPex()) {
11584
        this.pex = new PromotionException(other.pex);
11585
      }
11586
    }
11587
 
11588
    public getActiveCoupons_result deepCopy() {
11589
      return new getActiveCoupons_result(this);
11590
    }
11591
 
3430 rajveer 11592
    @Override
11593
    public void clear() {
11594
      this.success = null;
11595
      this.pex = null;
3385 varun.gupt 11596
    }
11597
 
11598
    public int getSuccessSize() {
11599
      return (this.success == null) ? 0 : this.success.size();
11600
    }
11601
 
11602
    public java.util.Iterator<Coupon> getSuccessIterator() {
11603
      return (this.success == null) ? null : this.success.iterator();
11604
    }
11605
 
11606
    public void addToSuccess(Coupon elem) {
11607
      if (this.success == null) {
11608
        this.success = new ArrayList<Coupon>();
11609
      }
11610
      this.success.add(elem);
11611
    }
11612
 
11613
    public List<Coupon> getSuccess() {
11614
      return this.success;
11615
    }
11616
 
3430 rajveer 11617
    public void setSuccess(List<Coupon> success) {
3385 varun.gupt 11618
      this.success = success;
11619
    }
11620
 
11621
    public void unsetSuccess() {
11622
      this.success = null;
11623
    }
11624
 
3430 rajveer 11625
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 11626
    public boolean isSetSuccess() {
11627
      return this.success != null;
11628
    }
11629
 
11630
    public void setSuccessIsSet(boolean value) {
11631
      if (!value) {
11632
        this.success = null;
11633
      }
11634
    }
11635
 
11636
    public PromotionException getPex() {
11637
      return this.pex;
11638
    }
11639
 
3430 rajveer 11640
    public void setPex(PromotionException pex) {
3385 varun.gupt 11641
      this.pex = pex;
11642
    }
11643
 
11644
    public void unsetPex() {
11645
      this.pex = null;
11646
    }
11647
 
3430 rajveer 11648
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 11649
    public boolean isSetPex() {
11650
      return this.pex != null;
11651
    }
11652
 
11653
    public void setPexIsSet(boolean value) {
11654
      if (!value) {
11655
        this.pex = null;
11656
      }
11657
    }
11658
 
11659
    public void setFieldValue(_Fields field, Object value) {
11660
      switch (field) {
11661
      case SUCCESS:
11662
        if (value == null) {
11663
          unsetSuccess();
11664
        } else {
11665
          setSuccess((List<Coupon>)value);
11666
        }
11667
        break;
11668
 
11669
      case PEX:
11670
        if (value == null) {
11671
          unsetPex();
11672
        } else {
11673
          setPex((PromotionException)value);
11674
        }
11675
        break;
11676
 
11677
      }
11678
    }
11679
 
11680
    public Object getFieldValue(_Fields field) {
11681
      switch (field) {
11682
      case SUCCESS:
11683
        return getSuccess();
11684
 
11685
      case PEX:
11686
        return getPex();
11687
 
11688
      }
11689
      throw new IllegalStateException();
11690
    }
11691
 
3430 rajveer 11692
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11693
    public boolean isSet(_Fields field) {
11694
      if (field == null) {
11695
        throw new IllegalArgumentException();
11696
      }
3385 varun.gupt 11697
 
11698
      switch (field) {
11699
      case SUCCESS:
11700
        return isSetSuccess();
11701
      case PEX:
11702
        return isSetPex();
11703
      }
11704
      throw new IllegalStateException();
11705
    }
11706
 
11707
    @Override
11708
    public boolean equals(Object that) {
11709
      if (that == null)
11710
        return false;
11711
      if (that instanceof getActiveCoupons_result)
11712
        return this.equals((getActiveCoupons_result)that);
11713
      return false;
11714
    }
11715
 
11716
    public boolean equals(getActiveCoupons_result that) {
11717
      if (that == null)
11718
        return false;
11719
 
11720
      boolean this_present_success = true && this.isSetSuccess();
11721
      boolean that_present_success = true && that.isSetSuccess();
11722
      if (this_present_success || that_present_success) {
11723
        if (!(this_present_success && that_present_success))
11724
          return false;
11725
        if (!this.success.equals(that.success))
11726
          return false;
11727
      }
11728
 
11729
      boolean this_present_pex = true && this.isSetPex();
11730
      boolean that_present_pex = true && that.isSetPex();
11731
      if (this_present_pex || that_present_pex) {
11732
        if (!(this_present_pex && that_present_pex))
11733
          return false;
11734
        if (!this.pex.equals(that.pex))
11735
          return false;
11736
      }
11737
 
11738
      return true;
11739
    }
11740
 
11741
    @Override
11742
    public int hashCode() {
11743
      return 0;
11744
    }
11745
 
11746
    public int compareTo(getActiveCoupons_result other) {
11747
      if (!getClass().equals(other.getClass())) {
11748
        return getClass().getName().compareTo(other.getClass().getName());
11749
      }
11750
 
11751
      int lastComparison = 0;
11752
      getActiveCoupons_result typedOther = (getActiveCoupons_result)other;
11753
 
3430 rajveer 11754
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 11755
      if (lastComparison != 0) {
11756
        return lastComparison;
11757
      }
3430 rajveer 11758
      if (isSetSuccess()) {
11759
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
11760
        if (lastComparison != 0) {
11761
          return lastComparison;
11762
        }
3385 varun.gupt 11763
      }
3430 rajveer 11764
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 11765
      if (lastComparison != 0) {
11766
        return lastComparison;
11767
      }
3430 rajveer 11768
      if (isSetPex()) {
11769
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
11770
        if (lastComparison != 0) {
11771
          return lastComparison;
11772
        }
3385 varun.gupt 11773
      }
11774
      return 0;
11775
    }
11776
 
3430 rajveer 11777
    public _Fields fieldForId(int fieldId) {
11778
      return _Fields.findByThriftId(fieldId);
11779
    }
11780
 
11781
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11782
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 11783
      iprot.readStructBegin();
11784
      while (true)
11785
      {
11786
        field = iprot.readFieldBegin();
3430 rajveer 11787
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 11788
          break;
11789
        }
3430 rajveer 11790
        switch (field.id) {
11791
          case 0: // SUCCESS
11792
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
11793
              {
6497 amit.gupta 11794
                org.apache.thrift.protocol.TList _list25 = iprot.readListBegin();
11795
                this.success = new ArrayList<Coupon>(_list25.size);
11796
                for (int _i26 = 0; _i26 < _list25.size; ++_i26)
3385 varun.gupt 11797
                {
6497 amit.gupta 11798
                  Coupon _elem27; // required
11799
                  _elem27 = new Coupon();
11800
                  _elem27.read(iprot);
11801
                  this.success.add(_elem27);
3385 varun.gupt 11802
                }
3430 rajveer 11803
                iprot.readListEnd();
3385 varun.gupt 11804
              }
3430 rajveer 11805
            } else { 
11806
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11807
            }
11808
            break;
11809
          case 1: // PEX
11810
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
11811
              this.pex = new PromotionException();
11812
              this.pex.read(iprot);
11813
            } else { 
11814
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11815
            }
11816
            break;
11817
          default:
11818
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 11819
        }
3430 rajveer 11820
        iprot.readFieldEnd();
3385 varun.gupt 11821
      }
11822
      iprot.readStructEnd();
11823
      validate();
11824
    }
11825
 
3430 rajveer 11826
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 11827
      oprot.writeStructBegin(STRUCT_DESC);
11828
 
11829
      if (this.isSetSuccess()) {
11830
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
11831
        {
3430 rajveer 11832
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
6497 amit.gupta 11833
          for (Coupon _iter28 : this.success)
3385 varun.gupt 11834
          {
6497 amit.gupta 11835
            _iter28.write(oprot);
3385 varun.gupt 11836
          }
11837
          oprot.writeListEnd();
11838
        }
11839
        oprot.writeFieldEnd();
11840
      } else if (this.isSetPex()) {
11841
        oprot.writeFieldBegin(PEX_FIELD_DESC);
11842
        this.pex.write(oprot);
11843
        oprot.writeFieldEnd();
11844
      }
11845
      oprot.writeFieldStop();
11846
      oprot.writeStructEnd();
11847
    }
11848
 
11849
    @Override
11850
    public String toString() {
11851
      StringBuilder sb = new StringBuilder("getActiveCoupons_result(");
11852
      boolean first = true;
11853
 
11854
      sb.append("success:");
11855
      if (this.success == null) {
11856
        sb.append("null");
11857
      } else {
11858
        sb.append(this.success);
11859
      }
11860
      first = false;
11861
      if (!first) sb.append(", ");
11862
      sb.append("pex:");
11863
      if (this.pex == null) {
11864
        sb.append("null");
11865
      } else {
11866
        sb.append(this.pex);
11867
      }
11868
      first = false;
11869
      sb.append(")");
11870
      return sb.toString();
11871
    }
11872
 
3430 rajveer 11873
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 11874
      // check for required fields
11875
    }
11876
 
3430 rajveer 11877
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11878
      try {
11879
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11880
      } catch (org.apache.thrift.TException te) {
11881
        throw new java.io.IOException(te);
11882
      }
11883
    }
11884
 
11885
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11886
      try {
11887
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11888
      } catch (org.apache.thrift.TException te) {
11889
        throw new java.io.IOException(te);
11890
      }
11891
    }
11892
 
3385 varun.gupt 11893
  }
11894
 
6250 amit.gupta 11895
  public static class createCoupon_args implements org.apache.thrift.TBase<createCoupon_args, createCoupon_args._Fields>, java.io.Serializable, Cloneable   {
11896
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_args");
11897
 
11898
    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);
6679 anupam.sin 11899
    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)2);
11900
    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)3);
11901
    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)4);
6250 amit.gupta 11902
 
11903
    private long promotionId; // required
6679 anupam.sin 11904
    private String arguments; // required
6356 amit.gupta 11905
    private boolean isCod; // required
6561 amit.gupta 11906
    private String prefix; // required
6250 amit.gupta 11907
 
11908
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11909
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11910
      PROMOTION_ID((short)1, "promotionId"),
6679 anupam.sin 11911
      ARGUMENTS((short)2, "arguments"),
11912
      IS_COD((short)3, "isCod"),
11913
      PREFIX((short)4, "prefix");
6250 amit.gupta 11914
 
11915
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11916
 
11917
      static {
11918
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11919
          byName.put(field.getFieldName(), field);
11920
        }
11921
      }
11922
 
11923
      /**
11924
       * Find the _Fields constant that matches fieldId, or null if its not found.
11925
       */
11926
      public static _Fields findByThriftId(int fieldId) {
11927
        switch(fieldId) {
11928
          case 1: // PROMOTION_ID
11929
            return PROMOTION_ID;
6679 anupam.sin 11930
          case 2: // ARGUMENTS
11931
            return ARGUMENTS;
11932
          case 3: // IS_COD
6356 amit.gupta 11933
            return IS_COD;
6679 anupam.sin 11934
          case 4: // PREFIX
6561 amit.gupta 11935
            return PREFIX;
6250 amit.gupta 11936
          default:
11937
            return null;
11938
        }
11939
      }
11940
 
11941
      /**
11942
       * Find the _Fields constant that matches fieldId, throwing an exception
11943
       * if it is not found.
11944
       */
11945
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11946
        _Fields fields = findByThriftId(fieldId);
11947
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11948
        return fields;
11949
      }
11950
 
11951
      /**
11952
       * Find the _Fields constant that matches name, or null if its not found.
11953
       */
11954
      public static _Fields findByName(String name) {
11955
        return byName.get(name);
11956
      }
11957
 
11958
      private final short _thriftId;
11959
      private final String _fieldName;
11960
 
11961
      _Fields(short thriftId, String fieldName) {
11962
        _thriftId = thriftId;
11963
        _fieldName = fieldName;
11964
      }
11965
 
11966
      public short getThriftFieldId() {
11967
        return _thriftId;
11968
      }
11969
 
11970
      public String getFieldName() {
11971
        return _fieldName;
11972
      }
11973
    }
11974
 
11975
    // isset id assignments
11976
    private static final int __PROMOTIONID_ISSET_ID = 0;
6679 anupam.sin 11977
    private static final int __ISCOD_ISSET_ID = 1;
11978
    private BitSet __isset_bit_vector = new BitSet(2);
6250 amit.gupta 11979
 
11980
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
11981
    static {
11982
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11983
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11984
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6679 anupam.sin 11985
      tmpMap.put(_Fields.ARGUMENTS, new org.apache.thrift.meta_data.FieldMetaData("arguments", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6250 amit.gupta 11986
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6356 amit.gupta 11987
      tmpMap.put(_Fields.IS_COD, new org.apache.thrift.meta_data.FieldMetaData("isCod", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11988
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
6561 amit.gupta 11989
      tmpMap.put(_Fields.PREFIX, new org.apache.thrift.meta_data.FieldMetaData("prefix", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11990
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6250 amit.gupta 11991
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11992
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_args.class, metaDataMap);
11993
    }
11994
 
11995
    public createCoupon_args() {
11996
    }
11997
 
11998
    public createCoupon_args(
11999
      long promotionId,
6679 anupam.sin 12000
      String arguments,
6356 amit.gupta 12001
      boolean isCod,
6561 amit.gupta 12002
      String prefix)
6250 amit.gupta 12003
    {
12004
      this();
12005
      this.promotionId = promotionId;
12006
      setPromotionIdIsSet(true);
6679 anupam.sin 12007
      this.arguments = arguments;
6356 amit.gupta 12008
      this.isCod = isCod;
12009
      setIsCodIsSet(true);
6561 amit.gupta 12010
      this.prefix = prefix;
6250 amit.gupta 12011
    }
12012
 
12013
    /**
12014
     * Performs a deep copy on <i>other</i>.
12015
     */
12016
    public createCoupon_args(createCoupon_args other) {
12017
      __isset_bit_vector.clear();
12018
      __isset_bit_vector.or(other.__isset_bit_vector);
12019
      this.promotionId = other.promotionId;
6679 anupam.sin 12020
      if (other.isSetArguments()) {
12021
        this.arguments = other.arguments;
6250 amit.gupta 12022
      }
6356 amit.gupta 12023
      this.isCod = other.isCod;
6561 amit.gupta 12024
      if (other.isSetPrefix()) {
12025
        this.prefix = other.prefix;
12026
      }
6250 amit.gupta 12027
    }
12028
 
12029
    public createCoupon_args deepCopy() {
12030
      return new createCoupon_args(this);
12031
    }
12032
 
12033
    @Override
12034
    public void clear() {
12035
      setPromotionIdIsSet(false);
12036
      this.promotionId = 0;
6679 anupam.sin 12037
      this.arguments = null;
6356 amit.gupta 12038
      setIsCodIsSet(false);
12039
      this.isCod = false;
6561 amit.gupta 12040
      this.prefix = null;
6250 amit.gupta 12041
    }
12042
 
12043
    public long getPromotionId() {
12044
      return this.promotionId;
12045
    }
12046
 
12047
    public void setPromotionId(long promotionId) {
12048
      this.promotionId = promotionId;
12049
      setPromotionIdIsSet(true);
12050
    }
12051
 
12052
    public void unsetPromotionId() {
12053
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
12054
    }
12055
 
12056
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
12057
    public boolean isSetPromotionId() {
12058
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
12059
    }
12060
 
12061
    public void setPromotionIdIsSet(boolean value) {
12062
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
12063
    }
12064
 
6679 anupam.sin 12065
    public String getArguments() {
12066
      return this.arguments;
6250 amit.gupta 12067
    }
12068
 
6679 anupam.sin 12069
    public void setArguments(String arguments) {
12070
      this.arguments = arguments;
6250 amit.gupta 12071
    }
12072
 
6679 anupam.sin 12073
    public void unsetArguments() {
12074
      this.arguments = null;
6250 amit.gupta 12075
    }
12076
 
6679 anupam.sin 12077
    /** Returns true if field arguments is set (has been assigned a value) and false otherwise */
12078
    public boolean isSetArguments() {
12079
      return this.arguments != null;
6250 amit.gupta 12080
    }
12081
 
6679 anupam.sin 12082
    public void setArgumentsIsSet(boolean value) {
6250 amit.gupta 12083
      if (!value) {
6679 anupam.sin 12084
        this.arguments = null;
6250 amit.gupta 12085
      }
12086
    }
12087
 
6356 amit.gupta 12088
    public boolean isIsCod() {
12089
      return this.isCod;
12090
    }
12091
 
12092
    public void setIsCod(boolean isCod) {
12093
      this.isCod = isCod;
12094
      setIsCodIsSet(true);
12095
    }
12096
 
12097
    public void unsetIsCod() {
12098
      __isset_bit_vector.clear(__ISCOD_ISSET_ID);
12099
    }
12100
 
12101
    /** Returns true if field isCod is set (has been assigned a value) and false otherwise */
12102
    public boolean isSetIsCod() {
12103
      return __isset_bit_vector.get(__ISCOD_ISSET_ID);
12104
    }
12105
 
12106
    public void setIsCodIsSet(boolean value) {
12107
      __isset_bit_vector.set(__ISCOD_ISSET_ID, value);
12108
    }
12109
 
6561 amit.gupta 12110
    public String getPrefix() {
12111
      return this.prefix;
12112
    }
12113
 
12114
    public void setPrefix(String prefix) {
12115
      this.prefix = prefix;
12116
    }
12117
 
12118
    public void unsetPrefix() {
12119
      this.prefix = null;
12120
    }
12121
 
12122
    /** Returns true if field prefix is set (has been assigned a value) and false otherwise */
12123
    public boolean isSetPrefix() {
12124
      return this.prefix != null;
12125
    }
12126
 
12127
    public void setPrefixIsSet(boolean value) {
12128
      if (!value) {
12129
        this.prefix = null;
12130
      }
12131
    }
12132
 
6250 amit.gupta 12133
    public void setFieldValue(_Fields field, Object value) {
12134
      switch (field) {
12135
      case PROMOTION_ID:
12136
        if (value == null) {
12137
          unsetPromotionId();
12138
        } else {
12139
          setPromotionId((Long)value);
12140
        }
12141
        break;
12142
 
6679 anupam.sin 12143
      case ARGUMENTS:
6250 amit.gupta 12144
        if (value == null) {
6679 anupam.sin 12145
          unsetArguments();
6250 amit.gupta 12146
        } else {
6679 anupam.sin 12147
          setArguments((String)value);
6250 amit.gupta 12148
        }
12149
        break;
12150
 
6356 amit.gupta 12151
      case IS_COD:
12152
        if (value == null) {
12153
          unsetIsCod();
12154
        } else {
12155
          setIsCod((Boolean)value);
12156
        }
12157
        break;
12158
 
6561 amit.gupta 12159
      case PREFIX:
12160
        if (value == null) {
12161
          unsetPrefix();
12162
        } else {
12163
          setPrefix((String)value);
12164
        }
12165
        break;
12166
 
6250 amit.gupta 12167
      }
12168
    }
12169
 
12170
    public Object getFieldValue(_Fields field) {
12171
      switch (field) {
12172
      case PROMOTION_ID:
12173
        return Long.valueOf(getPromotionId());
12174
 
6679 anupam.sin 12175
      case ARGUMENTS:
12176
        return getArguments();
6250 amit.gupta 12177
 
6356 amit.gupta 12178
      case IS_COD:
12179
        return Boolean.valueOf(isIsCod());
12180
 
6561 amit.gupta 12181
      case PREFIX:
12182
        return getPrefix();
12183
 
6250 amit.gupta 12184
      }
12185
      throw new IllegalStateException();
12186
    }
12187
 
12188
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12189
    public boolean isSet(_Fields field) {
12190
      if (field == null) {
12191
        throw new IllegalArgumentException();
12192
      }
12193
 
12194
      switch (field) {
12195
      case PROMOTION_ID:
12196
        return isSetPromotionId();
6679 anupam.sin 12197
      case ARGUMENTS:
12198
        return isSetArguments();
6356 amit.gupta 12199
      case IS_COD:
12200
        return isSetIsCod();
6561 amit.gupta 12201
      case PREFIX:
12202
        return isSetPrefix();
6250 amit.gupta 12203
      }
12204
      throw new IllegalStateException();
12205
    }
12206
 
12207
    @Override
12208
    public boolean equals(Object that) {
12209
      if (that == null)
12210
        return false;
12211
      if (that instanceof createCoupon_args)
12212
        return this.equals((createCoupon_args)that);
12213
      return false;
12214
    }
12215
 
12216
    public boolean equals(createCoupon_args that) {
12217
      if (that == null)
12218
        return false;
12219
 
12220
      boolean this_present_promotionId = true;
12221
      boolean that_present_promotionId = true;
12222
      if (this_present_promotionId || that_present_promotionId) {
12223
        if (!(this_present_promotionId && that_present_promotionId))
12224
          return false;
12225
        if (this.promotionId != that.promotionId)
12226
          return false;
12227
      }
12228
 
6679 anupam.sin 12229
      boolean this_present_arguments = true && this.isSetArguments();
12230
      boolean that_present_arguments = true && that.isSetArguments();
12231
      if (this_present_arguments || that_present_arguments) {
12232
        if (!(this_present_arguments && that_present_arguments))
6250 amit.gupta 12233
          return false;
6679 anupam.sin 12234
        if (!this.arguments.equals(that.arguments))
6250 amit.gupta 12235
          return false;
12236
      }
12237
 
6356 amit.gupta 12238
      boolean this_present_isCod = true;
12239
      boolean that_present_isCod = true;
12240
      if (this_present_isCod || that_present_isCod) {
12241
        if (!(this_present_isCod && that_present_isCod))
12242
          return false;
12243
        if (this.isCod != that.isCod)
12244
          return false;
12245
      }
12246
 
6561 amit.gupta 12247
      boolean this_present_prefix = true && this.isSetPrefix();
12248
      boolean that_present_prefix = true && that.isSetPrefix();
12249
      if (this_present_prefix || that_present_prefix) {
12250
        if (!(this_present_prefix && that_present_prefix))
12251
          return false;
12252
        if (!this.prefix.equals(that.prefix))
12253
          return false;
12254
      }
12255
 
6250 amit.gupta 12256
      return true;
12257
    }
12258
 
12259
    @Override
12260
    public int hashCode() {
12261
      return 0;
12262
    }
12263
 
12264
    public int compareTo(createCoupon_args other) {
12265
      if (!getClass().equals(other.getClass())) {
12266
        return getClass().getName().compareTo(other.getClass().getName());
12267
      }
12268
 
12269
      int lastComparison = 0;
12270
      createCoupon_args typedOther = (createCoupon_args)other;
12271
 
12272
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
12273
      if (lastComparison != 0) {
12274
        return lastComparison;
12275
      }
12276
      if (isSetPromotionId()) {
12277
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
12278
        if (lastComparison != 0) {
12279
          return lastComparison;
12280
        }
12281
      }
6679 anupam.sin 12282
      lastComparison = Boolean.valueOf(isSetArguments()).compareTo(typedOther.isSetArguments());
6250 amit.gupta 12283
      if (lastComparison != 0) {
12284
        return lastComparison;
12285
      }
6679 anupam.sin 12286
      if (isSetArguments()) {
12287
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.arguments, typedOther.arguments);
6250 amit.gupta 12288
        if (lastComparison != 0) {
12289
          return lastComparison;
12290
        }
12291
      }
6356 amit.gupta 12292
      lastComparison = Boolean.valueOf(isSetIsCod()).compareTo(typedOther.isSetIsCod());
12293
      if (lastComparison != 0) {
12294
        return lastComparison;
12295
      }
12296
      if (isSetIsCod()) {
12297
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isCod, typedOther.isCod);
12298
        if (lastComparison != 0) {
12299
          return lastComparison;
12300
        }
12301
      }
6561 amit.gupta 12302
      lastComparison = Boolean.valueOf(isSetPrefix()).compareTo(typedOther.isSetPrefix());
12303
      if (lastComparison != 0) {
12304
        return lastComparison;
12305
      }
12306
      if (isSetPrefix()) {
12307
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.prefix, typedOther.prefix);
12308
        if (lastComparison != 0) {
12309
          return lastComparison;
12310
        }
12311
      }
6250 amit.gupta 12312
      return 0;
12313
    }
12314
 
12315
    public _Fields fieldForId(int fieldId) {
12316
      return _Fields.findByThriftId(fieldId);
12317
    }
12318
 
12319
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12320
      org.apache.thrift.protocol.TField field;
12321
      iprot.readStructBegin();
12322
      while (true)
12323
      {
12324
        field = iprot.readFieldBegin();
12325
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12326
          break;
12327
        }
12328
        switch (field.id) {
12329
          case 1: // PROMOTION_ID
12330
            if (field.type == org.apache.thrift.protocol.TType.I64) {
12331
              this.promotionId = iprot.readI64();
12332
              setPromotionIdIsSet(true);
12333
            } else { 
12334
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12335
            }
12336
            break;
6679 anupam.sin 12337
          case 2: // ARGUMENTS
6250 amit.gupta 12338
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
6679 anupam.sin 12339
              this.arguments = iprot.readString();
6250 amit.gupta 12340
            } else { 
12341
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12342
            }
12343
            break;
6679 anupam.sin 12344
          case 3: // IS_COD
6356 amit.gupta 12345
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
12346
              this.isCod = iprot.readBool();
12347
              setIsCodIsSet(true);
12348
            } else { 
12349
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12350
            }
12351
            break;
6679 anupam.sin 12352
          case 4: // PREFIX
6561 amit.gupta 12353
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
12354
              this.prefix = iprot.readString();
12355
            } else { 
12356
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12357
            }
12358
            break;
6250 amit.gupta 12359
          default:
12360
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12361
        }
12362
        iprot.readFieldEnd();
12363
      }
12364
      iprot.readStructEnd();
12365
      validate();
12366
    }
12367
 
12368
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12369
      validate();
12370
 
12371
      oprot.writeStructBegin(STRUCT_DESC);
12372
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
12373
      oprot.writeI64(this.promotionId);
12374
      oprot.writeFieldEnd();
6679 anupam.sin 12375
      if (this.arguments != null) {
12376
        oprot.writeFieldBegin(ARGUMENTS_FIELD_DESC);
12377
        oprot.writeString(this.arguments);
6250 amit.gupta 12378
        oprot.writeFieldEnd();
12379
      }
6356 amit.gupta 12380
      oprot.writeFieldBegin(IS_COD_FIELD_DESC);
12381
      oprot.writeBool(this.isCod);
12382
      oprot.writeFieldEnd();
6561 amit.gupta 12383
      if (this.prefix != null) {
12384
        oprot.writeFieldBegin(PREFIX_FIELD_DESC);
12385
        oprot.writeString(this.prefix);
12386
        oprot.writeFieldEnd();
12387
      }
6250 amit.gupta 12388
      oprot.writeFieldStop();
12389
      oprot.writeStructEnd();
12390
    }
12391
 
12392
    @Override
12393
    public String toString() {
12394
      StringBuilder sb = new StringBuilder("createCoupon_args(");
12395
      boolean first = true;
12396
 
12397
      sb.append("promotionId:");
12398
      sb.append(this.promotionId);
12399
      first = false;
12400
      if (!first) sb.append(", ");
6679 anupam.sin 12401
      sb.append("arguments:");
12402
      if (this.arguments == null) {
6250 amit.gupta 12403
        sb.append("null");
12404
      } else {
6679 anupam.sin 12405
        sb.append(this.arguments);
6250 amit.gupta 12406
      }
12407
      first = false;
12408
      if (!first) sb.append(", ");
6356 amit.gupta 12409
      sb.append("isCod:");
12410
      sb.append(this.isCod);
12411
      first = false;
12412
      if (!first) sb.append(", ");
6561 amit.gupta 12413
      sb.append("prefix:");
12414
      if (this.prefix == null) {
12415
        sb.append("null");
12416
      } else {
12417
        sb.append(this.prefix);
12418
      }
12419
      first = false;
6250 amit.gupta 12420
      sb.append(")");
12421
      return sb.toString();
12422
    }
12423
 
12424
    public void validate() throws org.apache.thrift.TException {
12425
      // check for required fields
12426
    }
12427
 
12428
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12429
      try {
12430
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12431
      } catch (org.apache.thrift.TException te) {
12432
        throw new java.io.IOException(te);
12433
      }
12434
    }
12435
 
12436
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12437
      try {
6561 amit.gupta 12438
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
12439
        __isset_bit_vector = new BitSet(1);
6250 amit.gupta 12440
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12441
      } catch (org.apache.thrift.TException te) {
12442
        throw new java.io.IOException(te);
12443
      }
12444
    }
12445
 
12446
  }
12447
 
12448
  public static class createCoupon_result implements org.apache.thrift.TBase<createCoupon_result, createCoupon_result._Fields>, java.io.Serializable, Cloneable   {
12449
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_result");
12450
 
12451
    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);
12452
    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);
12453
 
12454
    private String success; // required
12455
    private PromotionException pex; // required
12456
 
12457
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12458
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12459
      SUCCESS((short)0, "success"),
12460
      PEX((short)1, "pex");
12461
 
12462
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12463
 
12464
      static {
12465
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12466
          byName.put(field.getFieldName(), field);
12467
        }
12468
      }
12469
 
12470
      /**
12471
       * Find the _Fields constant that matches fieldId, or null if its not found.
12472
       */
12473
      public static _Fields findByThriftId(int fieldId) {
12474
        switch(fieldId) {
12475
          case 0: // SUCCESS
12476
            return SUCCESS;
12477
          case 1: // PEX
12478
            return PEX;
12479
          default:
12480
            return null;
12481
        }
12482
      }
12483
 
12484
      /**
12485
       * Find the _Fields constant that matches fieldId, throwing an exception
12486
       * if it is not found.
12487
       */
12488
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12489
        _Fields fields = findByThriftId(fieldId);
12490
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12491
        return fields;
12492
      }
12493
 
12494
      /**
12495
       * Find the _Fields constant that matches name, or null if its not found.
12496
       */
12497
      public static _Fields findByName(String name) {
12498
        return byName.get(name);
12499
      }
12500
 
12501
      private final short _thriftId;
12502
      private final String _fieldName;
12503
 
12504
      _Fields(short thriftId, String fieldName) {
12505
        _thriftId = thriftId;
12506
        _fieldName = fieldName;
12507
      }
12508
 
12509
      public short getThriftFieldId() {
12510
        return _thriftId;
12511
      }
12512
 
12513
      public String getFieldName() {
12514
        return _fieldName;
12515
      }
12516
    }
12517
 
12518
    // isset id assignments
12519
 
12520
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12521
    static {
12522
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12523
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12524
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
12525
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12526
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
12527
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12528
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_result.class, metaDataMap);
12529
    }
12530
 
12531
    public createCoupon_result() {
12532
    }
12533
 
12534
    public createCoupon_result(
12535
      String success,
12536
      PromotionException pex)
12537
    {
12538
      this();
12539
      this.success = success;
12540
      this.pex = pex;
12541
    }
12542
 
12543
    /**
12544
     * Performs a deep copy on <i>other</i>.
12545
     */
12546
    public createCoupon_result(createCoupon_result other) {
12547
      if (other.isSetSuccess()) {
12548
        this.success = other.success;
12549
      }
12550
      if (other.isSetPex()) {
12551
        this.pex = new PromotionException(other.pex);
12552
      }
12553
    }
12554
 
12555
    public createCoupon_result deepCopy() {
12556
      return new createCoupon_result(this);
12557
    }
12558
 
12559
    @Override
12560
    public void clear() {
12561
      this.success = null;
12562
      this.pex = null;
12563
    }
12564
 
12565
    public String getSuccess() {
12566
      return this.success;
12567
    }
12568
 
12569
    public void setSuccess(String success) {
12570
      this.success = success;
12571
    }
12572
 
12573
    public void unsetSuccess() {
12574
      this.success = null;
12575
    }
12576
 
12577
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
12578
    public boolean isSetSuccess() {
12579
      return this.success != null;
12580
    }
12581
 
12582
    public void setSuccessIsSet(boolean value) {
12583
      if (!value) {
12584
        this.success = null;
12585
      }
12586
    }
12587
 
12588
    public PromotionException getPex() {
12589
      return this.pex;
12590
    }
12591
 
12592
    public void setPex(PromotionException pex) {
12593
      this.pex = pex;
12594
    }
12595
 
12596
    public void unsetPex() {
12597
      this.pex = null;
12598
    }
12599
 
12600
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
12601
    public boolean isSetPex() {
12602
      return this.pex != null;
12603
    }
12604
 
12605
    public void setPexIsSet(boolean value) {
12606
      if (!value) {
12607
        this.pex = null;
12608
      }
12609
    }
12610
 
12611
    public void setFieldValue(_Fields field, Object value) {
12612
      switch (field) {
12613
      case SUCCESS:
12614
        if (value == null) {
12615
          unsetSuccess();
12616
        } else {
12617
          setSuccess((String)value);
12618
        }
12619
        break;
12620
 
12621
      case PEX:
12622
        if (value == null) {
12623
          unsetPex();
12624
        } else {
12625
          setPex((PromotionException)value);
12626
        }
12627
        break;
12628
 
12629
      }
12630
    }
12631
 
12632
    public Object getFieldValue(_Fields field) {
12633
      switch (field) {
12634
      case SUCCESS:
12635
        return getSuccess();
12636
 
12637
      case PEX:
12638
        return getPex();
12639
 
12640
      }
12641
      throw new IllegalStateException();
12642
    }
12643
 
12644
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12645
    public boolean isSet(_Fields field) {
12646
      if (field == null) {
12647
        throw new IllegalArgumentException();
12648
      }
12649
 
12650
      switch (field) {
12651
      case SUCCESS:
12652
        return isSetSuccess();
12653
      case PEX:
12654
        return isSetPex();
12655
      }
12656
      throw new IllegalStateException();
12657
    }
12658
 
12659
    @Override
12660
    public boolean equals(Object that) {
12661
      if (that == null)
12662
        return false;
12663
      if (that instanceof createCoupon_result)
12664
        return this.equals((createCoupon_result)that);
12665
      return false;
12666
    }
12667
 
12668
    public boolean equals(createCoupon_result that) {
12669
      if (that == null)
12670
        return false;
12671
 
12672
      boolean this_present_success = true && this.isSetSuccess();
12673
      boolean that_present_success = true && that.isSetSuccess();
12674
      if (this_present_success || that_present_success) {
12675
        if (!(this_present_success && that_present_success))
12676
          return false;
12677
        if (!this.success.equals(that.success))
12678
          return false;
12679
      }
12680
 
12681
      boolean this_present_pex = true && this.isSetPex();
12682
      boolean that_present_pex = true && that.isSetPex();
12683
      if (this_present_pex || that_present_pex) {
12684
        if (!(this_present_pex && that_present_pex))
12685
          return false;
12686
        if (!this.pex.equals(that.pex))
12687
          return false;
12688
      }
12689
 
12690
      return true;
12691
    }
12692
 
12693
    @Override
12694
    public int hashCode() {
12695
      return 0;
12696
    }
12697
 
12698
    public int compareTo(createCoupon_result other) {
12699
      if (!getClass().equals(other.getClass())) {
12700
        return getClass().getName().compareTo(other.getClass().getName());
12701
      }
12702
 
12703
      int lastComparison = 0;
12704
      createCoupon_result typedOther = (createCoupon_result)other;
12705
 
12706
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
12707
      if (lastComparison != 0) {
12708
        return lastComparison;
12709
      }
12710
      if (isSetSuccess()) {
12711
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
12712
        if (lastComparison != 0) {
12713
          return lastComparison;
12714
        }
12715
      }
12716
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
12717
      if (lastComparison != 0) {
12718
        return lastComparison;
12719
      }
12720
      if (isSetPex()) {
12721
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
12722
        if (lastComparison != 0) {
12723
          return lastComparison;
12724
        }
12725
      }
12726
      return 0;
12727
    }
12728
 
12729
    public _Fields fieldForId(int fieldId) {
12730
      return _Fields.findByThriftId(fieldId);
12731
    }
12732
 
12733
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12734
      org.apache.thrift.protocol.TField field;
12735
      iprot.readStructBegin();
12736
      while (true)
12737
      {
12738
        field = iprot.readFieldBegin();
12739
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12740
          break;
12741
        }
12742
        switch (field.id) {
12743
          case 0: // SUCCESS
12744
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
12745
              this.success = iprot.readString();
12746
            } else { 
12747
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12748
            }
12749
            break;
12750
          case 1: // PEX
12751
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
12752
              this.pex = new PromotionException();
12753
              this.pex.read(iprot);
12754
            } else { 
12755
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12756
            }
12757
            break;
12758
          default:
12759
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12760
        }
12761
        iprot.readFieldEnd();
12762
      }
12763
      iprot.readStructEnd();
12764
      validate();
12765
    }
12766
 
12767
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12768
      oprot.writeStructBegin(STRUCT_DESC);
12769
 
12770
      if (this.isSetSuccess()) {
12771
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
12772
        oprot.writeString(this.success);
12773
        oprot.writeFieldEnd();
12774
      } else if (this.isSetPex()) {
12775
        oprot.writeFieldBegin(PEX_FIELD_DESC);
12776
        this.pex.write(oprot);
12777
        oprot.writeFieldEnd();
12778
      }
12779
      oprot.writeFieldStop();
12780
      oprot.writeStructEnd();
12781
    }
12782
 
12783
    @Override
12784
    public String toString() {
12785
      StringBuilder sb = new StringBuilder("createCoupon_result(");
12786
      boolean first = true;
12787
 
12788
      sb.append("success:");
12789
      if (this.success == null) {
12790
        sb.append("null");
12791
      } else {
12792
        sb.append(this.success);
12793
      }
12794
      first = false;
12795
      if (!first) sb.append(", ");
12796
      sb.append("pex:");
12797
      if (this.pex == null) {
12798
        sb.append("null");
12799
      } else {
12800
        sb.append(this.pex);
12801
      }
12802
      first = false;
12803
      sb.append(")");
12804
      return sb.toString();
12805
    }
12806
 
12807
    public void validate() throws org.apache.thrift.TException {
12808
      // check for required fields
12809
    }
12810
 
12811
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12812
      try {
12813
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12814
      } catch (org.apache.thrift.TException te) {
12815
        throw new java.io.IOException(te);
12816
      }
12817
    }
12818
 
12819
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12820
      try {
12821
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12822
      } catch (org.apache.thrift.TException te) {
12823
        throw new java.io.IOException(te);
12824
      }
12825
    }
12826
 
12827
  }
12828
 
3430 rajveer 12829
  public static class getSuccessfulPaymentCountForCoupon_args implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_args, getSuccessfulPaymentCountForCoupon_args._Fields>, java.io.Serializable, Cloneable   {
12830
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_args");
3385 varun.gupt 12831
 
3430 rajveer 12832
    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 12833
 
3430 rajveer 12834
    private String couponCode; // required
3385 varun.gupt 12835
 
12836
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 12837
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 12838
      COUPON_CODE((short)1, "couponCode");
12839
 
12840
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12841
 
12842
      static {
12843
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12844
          byName.put(field.getFieldName(), field);
12845
        }
12846
      }
12847
 
12848
      /**
12849
       * Find the _Fields constant that matches fieldId, or null if its not found.
12850
       */
12851
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 12852
        switch(fieldId) {
12853
          case 1: // COUPON_CODE
12854
            return COUPON_CODE;
12855
          default:
12856
            return null;
12857
        }
3385 varun.gupt 12858
      }
12859
 
12860
      /**
12861
       * Find the _Fields constant that matches fieldId, throwing an exception
12862
       * if it is not found.
12863
       */
12864
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12865
        _Fields fields = findByThriftId(fieldId);
12866
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12867
        return fields;
12868
      }
12869
 
12870
      /**
12871
       * Find the _Fields constant that matches name, or null if its not found.
12872
       */
12873
      public static _Fields findByName(String name) {
12874
        return byName.get(name);
12875
      }
12876
 
12877
      private final short _thriftId;
12878
      private final String _fieldName;
12879
 
12880
      _Fields(short thriftId, String fieldName) {
12881
        _thriftId = thriftId;
12882
        _fieldName = fieldName;
12883
      }
12884
 
12885
      public short getThriftFieldId() {
12886
        return _thriftId;
12887
      }
12888
 
12889
      public String getFieldName() {
12890
        return _fieldName;
12891
      }
12892
    }
12893
 
12894
    // isset id assignments
12895
 
3430 rajveer 12896
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 12897
    static {
3430 rajveer 12898
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12899
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12900
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
12901
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12902
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_args.class, metaDataMap);
3385 varun.gupt 12903
    }
12904
 
12905
    public getSuccessfulPaymentCountForCoupon_args() {
12906
    }
12907
 
12908
    public getSuccessfulPaymentCountForCoupon_args(
12909
      String couponCode)
12910
    {
12911
      this();
12912
      this.couponCode = couponCode;
12913
    }
12914
 
12915
    /**
12916
     * Performs a deep copy on <i>other</i>.
12917
     */
12918
    public getSuccessfulPaymentCountForCoupon_args(getSuccessfulPaymentCountForCoupon_args other) {
12919
      if (other.isSetCouponCode()) {
12920
        this.couponCode = other.couponCode;
12921
      }
12922
    }
12923
 
12924
    public getSuccessfulPaymentCountForCoupon_args deepCopy() {
12925
      return new getSuccessfulPaymentCountForCoupon_args(this);
12926
    }
12927
 
3430 rajveer 12928
    @Override
12929
    public void clear() {
12930
      this.couponCode = null;
3385 varun.gupt 12931
    }
12932
 
12933
    public String getCouponCode() {
12934
      return this.couponCode;
12935
    }
12936
 
3430 rajveer 12937
    public void setCouponCode(String couponCode) {
3385 varun.gupt 12938
      this.couponCode = couponCode;
12939
    }
12940
 
12941
    public void unsetCouponCode() {
12942
      this.couponCode = null;
12943
    }
12944
 
3430 rajveer 12945
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3385 varun.gupt 12946
    public boolean isSetCouponCode() {
12947
      return this.couponCode != null;
12948
    }
12949
 
12950
    public void setCouponCodeIsSet(boolean value) {
12951
      if (!value) {
12952
        this.couponCode = null;
12953
      }
12954
    }
12955
 
12956
    public void setFieldValue(_Fields field, Object value) {
12957
      switch (field) {
12958
      case COUPON_CODE:
12959
        if (value == null) {
12960
          unsetCouponCode();
12961
        } else {
12962
          setCouponCode((String)value);
12963
        }
12964
        break;
12965
 
12966
      }
12967
    }
12968
 
12969
    public Object getFieldValue(_Fields field) {
12970
      switch (field) {
12971
      case COUPON_CODE:
12972
        return getCouponCode();
12973
 
12974
      }
12975
      throw new IllegalStateException();
12976
    }
12977
 
3430 rajveer 12978
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12979
    public boolean isSet(_Fields field) {
12980
      if (field == null) {
12981
        throw new IllegalArgumentException();
12982
      }
3385 varun.gupt 12983
 
12984
      switch (field) {
12985
      case COUPON_CODE:
12986
        return isSetCouponCode();
12987
      }
12988
      throw new IllegalStateException();
12989
    }
12990
 
12991
    @Override
12992
    public boolean equals(Object that) {
12993
      if (that == null)
12994
        return false;
12995
      if (that instanceof getSuccessfulPaymentCountForCoupon_args)
12996
        return this.equals((getSuccessfulPaymentCountForCoupon_args)that);
12997
      return false;
12998
    }
12999
 
13000
    public boolean equals(getSuccessfulPaymentCountForCoupon_args that) {
13001
      if (that == null)
13002
        return false;
13003
 
13004
      boolean this_present_couponCode = true && this.isSetCouponCode();
13005
      boolean that_present_couponCode = true && that.isSetCouponCode();
13006
      if (this_present_couponCode || that_present_couponCode) {
13007
        if (!(this_present_couponCode && that_present_couponCode))
13008
          return false;
13009
        if (!this.couponCode.equals(that.couponCode))
13010
          return false;
13011
      }
13012
 
13013
      return true;
13014
    }
13015
 
13016
    @Override
13017
    public int hashCode() {
13018
      return 0;
13019
    }
13020
 
13021
    public int compareTo(getSuccessfulPaymentCountForCoupon_args other) {
13022
      if (!getClass().equals(other.getClass())) {
13023
        return getClass().getName().compareTo(other.getClass().getName());
13024
      }
13025
 
13026
      int lastComparison = 0;
13027
      getSuccessfulPaymentCountForCoupon_args typedOther = (getSuccessfulPaymentCountForCoupon_args)other;
13028
 
3430 rajveer 13029
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3385 varun.gupt 13030
      if (lastComparison != 0) {
13031
        return lastComparison;
13032
      }
3430 rajveer 13033
      if (isSetCouponCode()) {
13034
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
13035
        if (lastComparison != 0) {
13036
          return lastComparison;
13037
        }
3385 varun.gupt 13038
      }
13039
      return 0;
13040
    }
13041
 
3430 rajveer 13042
    public _Fields fieldForId(int fieldId) {
13043
      return _Fields.findByThriftId(fieldId);
13044
    }
13045
 
13046
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13047
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 13048
      iprot.readStructBegin();
13049
      while (true)
13050
      {
13051
        field = iprot.readFieldBegin();
3430 rajveer 13052
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 13053
          break;
13054
        }
3430 rajveer 13055
        switch (field.id) {
13056
          case 1: // COUPON_CODE
13057
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
13058
              this.couponCode = iprot.readString();
13059
            } else { 
13060
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13061
            }
13062
            break;
13063
          default:
13064
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 13065
        }
3430 rajveer 13066
        iprot.readFieldEnd();
3385 varun.gupt 13067
      }
13068
      iprot.readStructEnd();
13069
      validate();
13070
    }
13071
 
3430 rajveer 13072
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 13073
      validate();
13074
 
13075
      oprot.writeStructBegin(STRUCT_DESC);
13076
      if (this.couponCode != null) {
13077
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
13078
        oprot.writeString(this.couponCode);
13079
        oprot.writeFieldEnd();
13080
      }
13081
      oprot.writeFieldStop();
13082
      oprot.writeStructEnd();
13083
    }
13084
 
13085
    @Override
13086
    public String toString() {
13087
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_args(");
13088
      boolean first = true;
13089
 
13090
      sb.append("couponCode:");
13091
      if (this.couponCode == null) {
13092
        sb.append("null");
13093
      } else {
13094
        sb.append(this.couponCode);
13095
      }
13096
      first = false;
13097
      sb.append(")");
13098
      return sb.toString();
13099
    }
13100
 
3430 rajveer 13101
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 13102
      // check for required fields
13103
    }
13104
 
3430 rajveer 13105
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13106
      try {
13107
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13108
      } catch (org.apache.thrift.TException te) {
13109
        throw new java.io.IOException(te);
13110
      }
13111
    }
13112
 
13113
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13114
      try {
13115
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13116
      } catch (org.apache.thrift.TException te) {
13117
        throw new java.io.IOException(te);
13118
      }
13119
    }
13120
 
3385 varun.gupt 13121
  }
13122
 
3430 rajveer 13123
  public static class getSuccessfulPaymentCountForCoupon_result implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_result, getSuccessfulPaymentCountForCoupon_result._Fields>, java.io.Serializable, Cloneable   {
13124
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_result");
3385 varun.gupt 13125
 
3430 rajveer 13126
    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);
13127
    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 13128
 
3430 rajveer 13129
    private long success; // required
13130
    private PromotionException pex; // required
3385 varun.gupt 13131
 
13132
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 13133
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 13134
      SUCCESS((short)0, "success"),
13135
      PEX((short)1, "pex");
13136
 
13137
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13138
 
13139
      static {
13140
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13141
          byName.put(field.getFieldName(), field);
13142
        }
13143
      }
13144
 
13145
      /**
13146
       * Find the _Fields constant that matches fieldId, or null if its not found.
13147
       */
13148
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 13149
        switch(fieldId) {
13150
          case 0: // SUCCESS
13151
            return SUCCESS;
13152
          case 1: // PEX
13153
            return PEX;
13154
          default:
13155
            return null;
13156
        }
3385 varun.gupt 13157
      }
13158
 
13159
      /**
13160
       * Find the _Fields constant that matches fieldId, throwing an exception
13161
       * if it is not found.
13162
       */
13163
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13164
        _Fields fields = findByThriftId(fieldId);
13165
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13166
        return fields;
13167
      }
13168
 
13169
      /**
13170
       * Find the _Fields constant that matches name, or null if its not found.
13171
       */
13172
      public static _Fields findByName(String name) {
13173
        return byName.get(name);
13174
      }
13175
 
13176
      private final short _thriftId;
13177
      private final String _fieldName;
13178
 
13179
      _Fields(short thriftId, String fieldName) {
13180
        _thriftId = thriftId;
13181
        _fieldName = fieldName;
13182
      }
13183
 
13184
      public short getThriftFieldId() {
13185
        return _thriftId;
13186
      }
13187
 
13188
      public String getFieldName() {
13189
        return _fieldName;
13190
      }
13191
    }
13192
 
13193
    // isset id assignments
13194
    private static final int __SUCCESS_ISSET_ID = 0;
13195
    private BitSet __isset_bit_vector = new BitSet(1);
13196
 
3430 rajveer 13197
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 13198
    static {
3430 rajveer 13199
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13200
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13201
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
13202
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13203
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
13204
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13205
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_result.class, metaDataMap);
3385 varun.gupt 13206
    }
13207
 
13208
    public getSuccessfulPaymentCountForCoupon_result() {
13209
    }
13210
 
13211
    public getSuccessfulPaymentCountForCoupon_result(
13212
      long success,
13213
      PromotionException pex)
13214
    {
13215
      this();
13216
      this.success = success;
13217
      setSuccessIsSet(true);
13218
      this.pex = pex;
13219
    }
13220
 
13221
    /**
13222
     * Performs a deep copy on <i>other</i>.
13223
     */
13224
    public getSuccessfulPaymentCountForCoupon_result(getSuccessfulPaymentCountForCoupon_result other) {
13225
      __isset_bit_vector.clear();
13226
      __isset_bit_vector.or(other.__isset_bit_vector);
13227
      this.success = other.success;
13228
      if (other.isSetPex()) {
13229
        this.pex = new PromotionException(other.pex);
13230
      }
13231
    }
13232
 
13233
    public getSuccessfulPaymentCountForCoupon_result deepCopy() {
13234
      return new getSuccessfulPaymentCountForCoupon_result(this);
13235
    }
13236
 
3430 rajveer 13237
    @Override
13238
    public void clear() {
13239
      setSuccessIsSet(false);
13240
      this.success = 0;
13241
      this.pex = null;
3385 varun.gupt 13242
    }
13243
 
13244
    public long getSuccess() {
13245
      return this.success;
13246
    }
13247
 
3430 rajveer 13248
    public void setSuccess(long success) {
3385 varun.gupt 13249
      this.success = success;
13250
      setSuccessIsSet(true);
13251
    }
13252
 
13253
    public void unsetSuccess() {
13254
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
13255
    }
13256
 
3430 rajveer 13257
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 13258
    public boolean isSetSuccess() {
13259
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
13260
    }
13261
 
13262
    public void setSuccessIsSet(boolean value) {
13263
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
13264
    }
13265
 
13266
    public PromotionException getPex() {
13267
      return this.pex;
13268
    }
13269
 
3430 rajveer 13270
    public void setPex(PromotionException pex) {
3385 varun.gupt 13271
      this.pex = pex;
13272
    }
13273
 
13274
    public void unsetPex() {
13275
      this.pex = null;
13276
    }
13277
 
3430 rajveer 13278
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 13279
    public boolean isSetPex() {
13280
      return this.pex != null;
13281
    }
13282
 
13283
    public void setPexIsSet(boolean value) {
13284
      if (!value) {
13285
        this.pex = null;
13286
      }
13287
    }
13288
 
13289
    public void setFieldValue(_Fields field, Object value) {
13290
      switch (field) {
13291
      case SUCCESS:
13292
        if (value == null) {
13293
          unsetSuccess();
13294
        } else {
13295
          setSuccess((Long)value);
13296
        }
13297
        break;
13298
 
13299
      case PEX:
13300
        if (value == null) {
13301
          unsetPex();
13302
        } else {
13303
          setPex((PromotionException)value);
13304
        }
13305
        break;
13306
 
13307
      }
13308
    }
13309
 
13310
    public Object getFieldValue(_Fields field) {
13311
      switch (field) {
13312
      case SUCCESS:
3430 rajveer 13313
        return Long.valueOf(getSuccess());
3385 varun.gupt 13314
 
13315
      case PEX:
13316
        return getPex();
13317
 
13318
      }
13319
      throw new IllegalStateException();
13320
    }
13321
 
3430 rajveer 13322
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13323
    public boolean isSet(_Fields field) {
13324
      if (field == null) {
13325
        throw new IllegalArgumentException();
13326
      }
3385 varun.gupt 13327
 
13328
      switch (field) {
13329
      case SUCCESS:
13330
        return isSetSuccess();
13331
      case PEX:
13332
        return isSetPex();
13333
      }
13334
      throw new IllegalStateException();
13335
    }
13336
 
13337
    @Override
13338
    public boolean equals(Object that) {
13339
      if (that == null)
13340
        return false;
13341
      if (that instanceof getSuccessfulPaymentCountForCoupon_result)
13342
        return this.equals((getSuccessfulPaymentCountForCoupon_result)that);
13343
      return false;
13344
    }
13345
 
13346
    public boolean equals(getSuccessfulPaymentCountForCoupon_result that) {
13347
      if (that == null)
13348
        return false;
13349
 
13350
      boolean this_present_success = true;
13351
      boolean that_present_success = true;
13352
      if (this_present_success || that_present_success) {
13353
        if (!(this_present_success && that_present_success))
13354
          return false;
13355
        if (this.success != that.success)
13356
          return false;
13357
      }
13358
 
13359
      boolean this_present_pex = true && this.isSetPex();
13360
      boolean that_present_pex = true && that.isSetPex();
13361
      if (this_present_pex || that_present_pex) {
13362
        if (!(this_present_pex && that_present_pex))
13363
          return false;
13364
        if (!this.pex.equals(that.pex))
13365
          return false;
13366
      }
13367
 
13368
      return true;
13369
    }
13370
 
13371
    @Override
13372
    public int hashCode() {
13373
      return 0;
13374
    }
13375
 
13376
    public int compareTo(getSuccessfulPaymentCountForCoupon_result other) {
13377
      if (!getClass().equals(other.getClass())) {
13378
        return getClass().getName().compareTo(other.getClass().getName());
13379
      }
13380
 
13381
      int lastComparison = 0;
13382
      getSuccessfulPaymentCountForCoupon_result typedOther = (getSuccessfulPaymentCountForCoupon_result)other;
13383
 
3430 rajveer 13384
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 13385
      if (lastComparison != 0) {
13386
        return lastComparison;
13387
      }
3430 rajveer 13388
      if (isSetSuccess()) {
13389
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
13390
        if (lastComparison != 0) {
13391
          return lastComparison;
13392
        }
3385 varun.gupt 13393
      }
3430 rajveer 13394
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 13395
      if (lastComparison != 0) {
13396
        return lastComparison;
13397
      }
3430 rajveer 13398
      if (isSetPex()) {
13399
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
13400
        if (lastComparison != 0) {
13401
          return lastComparison;
13402
        }
3385 varun.gupt 13403
      }
13404
      return 0;
13405
    }
13406
 
3430 rajveer 13407
    public _Fields fieldForId(int fieldId) {
13408
      return _Fields.findByThriftId(fieldId);
13409
    }
13410
 
13411
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13412
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 13413
      iprot.readStructBegin();
13414
      while (true)
13415
      {
13416
        field = iprot.readFieldBegin();
3430 rajveer 13417
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 13418
          break;
13419
        }
3430 rajveer 13420
        switch (field.id) {
13421
          case 0: // SUCCESS
13422
            if (field.type == org.apache.thrift.protocol.TType.I64) {
13423
              this.success = iprot.readI64();
13424
              setSuccessIsSet(true);
13425
            } else { 
13426
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13427
            }
13428
            break;
13429
          case 1: // PEX
13430
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
13431
              this.pex = new PromotionException();
13432
              this.pex.read(iprot);
13433
            } else { 
13434
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13435
            }
13436
            break;
13437
          default:
13438
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 13439
        }
3430 rajveer 13440
        iprot.readFieldEnd();
3385 varun.gupt 13441
      }
13442
      iprot.readStructEnd();
13443
      validate();
13444
    }
13445
 
3430 rajveer 13446
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 13447
      oprot.writeStructBegin(STRUCT_DESC);
13448
 
13449
      if (this.isSetSuccess()) {
13450
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
13451
        oprot.writeI64(this.success);
13452
        oprot.writeFieldEnd();
13453
      } else if (this.isSetPex()) {
13454
        oprot.writeFieldBegin(PEX_FIELD_DESC);
13455
        this.pex.write(oprot);
13456
        oprot.writeFieldEnd();
13457
      }
13458
      oprot.writeFieldStop();
13459
      oprot.writeStructEnd();
13460
    }
13461
 
13462
    @Override
13463
    public String toString() {
13464
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_result(");
13465
      boolean first = true;
13466
 
13467
      sb.append("success:");
13468
      sb.append(this.success);
13469
      first = false;
13470
      if (!first) sb.append(", ");
13471
      sb.append("pex:");
13472
      if (this.pex == null) {
13473
        sb.append("null");
13474
      } else {
13475
        sb.append(this.pex);
13476
      }
13477
      first = false;
13478
      sb.append(")");
13479
      return sb.toString();
13480
    }
13481
 
3430 rajveer 13482
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 13483
      // check for required fields
13484
    }
13485
 
3430 rajveer 13486
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13487
      try {
13488
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13489
      } catch (org.apache.thrift.TException te) {
13490
        throw new java.io.IOException(te);
13491
      }
13492
    }
13493
 
13494
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13495
      try {
13496
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13497
      } catch (org.apache.thrift.TException te) {
13498
        throw new java.io.IOException(te);
13499
      }
13500
    }
13501
 
3385 varun.gupt 13502
  }
13503
 
3430 rajveer 13504
  public static class getRuleDocString_args implements org.apache.thrift.TBase<getRuleDocString_args, getRuleDocString_args._Fields>, java.io.Serializable, Cloneable   {
13505
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_args");
3385 varun.gupt 13506
 
3430 rajveer 13507
    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 13508
 
3430 rajveer 13509
    private String ruleName; // required
3385 varun.gupt 13510
 
13511
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 13512
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 13513
      RULE_NAME((short)1, "ruleName");
13514
 
13515
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13516
 
13517
      static {
13518
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13519
          byName.put(field.getFieldName(), field);
13520
        }
13521
      }
13522
 
13523
      /**
13524
       * Find the _Fields constant that matches fieldId, or null if its not found.
13525
       */
13526
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 13527
        switch(fieldId) {
13528
          case 1: // RULE_NAME
13529
            return RULE_NAME;
13530
          default:
13531
            return null;
13532
        }
3385 varun.gupt 13533
      }
13534
 
13535
      /**
13536
       * Find the _Fields constant that matches fieldId, throwing an exception
13537
       * if it is not found.
13538
       */
13539
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13540
        _Fields fields = findByThriftId(fieldId);
13541
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13542
        return fields;
13543
      }
13544
 
13545
      /**
13546
       * Find the _Fields constant that matches name, or null if its not found.
13547
       */
13548
      public static _Fields findByName(String name) {
13549
        return byName.get(name);
13550
      }
13551
 
13552
      private final short _thriftId;
13553
      private final String _fieldName;
13554
 
13555
      _Fields(short thriftId, String fieldName) {
13556
        _thriftId = thriftId;
13557
        _fieldName = fieldName;
13558
      }
13559
 
13560
      public short getThriftFieldId() {
13561
        return _thriftId;
13562
      }
13563
 
13564
      public String getFieldName() {
13565
        return _fieldName;
13566
      }
13567
    }
13568
 
13569
    // isset id assignments
13570
 
3430 rajveer 13571
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 13572
    static {
3430 rajveer 13573
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13574
      tmpMap.put(_Fields.RULE_NAME, new org.apache.thrift.meta_data.FieldMetaData("ruleName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13575
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
13576
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13577
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_args.class, metaDataMap);
3385 varun.gupt 13578
    }
13579
 
13580
    public getRuleDocString_args() {
13581
    }
13582
 
13583
    public getRuleDocString_args(
13584
      String ruleName)
13585
    {
13586
      this();
13587
      this.ruleName = ruleName;
13588
    }
13589
 
13590
    /**
13591
     * Performs a deep copy on <i>other</i>.
13592
     */
13593
    public getRuleDocString_args(getRuleDocString_args other) {
13594
      if (other.isSetRuleName()) {
13595
        this.ruleName = other.ruleName;
13596
      }
13597
    }
13598
 
13599
    public getRuleDocString_args deepCopy() {
13600
      return new getRuleDocString_args(this);
13601
    }
13602
 
3430 rajveer 13603
    @Override
13604
    public void clear() {
13605
      this.ruleName = null;
3385 varun.gupt 13606
    }
13607
 
13608
    public String getRuleName() {
13609
      return this.ruleName;
13610
    }
13611
 
3430 rajveer 13612
    public void setRuleName(String ruleName) {
3385 varun.gupt 13613
      this.ruleName = ruleName;
13614
    }
13615
 
13616
    public void unsetRuleName() {
13617
      this.ruleName = null;
13618
    }
13619
 
3430 rajveer 13620
    /** Returns true if field ruleName is set (has been assigned a value) and false otherwise */
3385 varun.gupt 13621
    public boolean isSetRuleName() {
13622
      return this.ruleName != null;
13623
    }
13624
 
13625
    public void setRuleNameIsSet(boolean value) {
13626
      if (!value) {
13627
        this.ruleName = null;
13628
      }
13629
    }
13630
 
13631
    public void setFieldValue(_Fields field, Object value) {
13632
      switch (field) {
13633
      case RULE_NAME:
13634
        if (value == null) {
13635
          unsetRuleName();
13636
        } else {
13637
          setRuleName((String)value);
13638
        }
13639
        break;
13640
 
13641
      }
13642
    }
13643
 
13644
    public Object getFieldValue(_Fields field) {
13645
      switch (field) {
13646
      case RULE_NAME:
13647
        return getRuleName();
13648
 
13649
      }
13650
      throw new IllegalStateException();
13651
    }
13652
 
3430 rajveer 13653
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13654
    public boolean isSet(_Fields field) {
13655
      if (field == null) {
13656
        throw new IllegalArgumentException();
13657
      }
3385 varun.gupt 13658
 
13659
      switch (field) {
13660
      case RULE_NAME:
13661
        return isSetRuleName();
13662
      }
13663
      throw new IllegalStateException();
13664
    }
13665
 
13666
    @Override
13667
    public boolean equals(Object that) {
13668
      if (that == null)
13669
        return false;
13670
      if (that instanceof getRuleDocString_args)
13671
        return this.equals((getRuleDocString_args)that);
13672
      return false;
13673
    }
13674
 
13675
    public boolean equals(getRuleDocString_args that) {
13676
      if (that == null)
13677
        return false;
13678
 
13679
      boolean this_present_ruleName = true && this.isSetRuleName();
13680
      boolean that_present_ruleName = true && that.isSetRuleName();
13681
      if (this_present_ruleName || that_present_ruleName) {
13682
        if (!(this_present_ruleName && that_present_ruleName))
13683
          return false;
13684
        if (!this.ruleName.equals(that.ruleName))
13685
          return false;
13686
      }
13687
 
13688
      return true;
13689
    }
13690
 
13691
    @Override
13692
    public int hashCode() {
13693
      return 0;
13694
    }
13695
 
13696
    public int compareTo(getRuleDocString_args other) {
13697
      if (!getClass().equals(other.getClass())) {
13698
        return getClass().getName().compareTo(other.getClass().getName());
13699
      }
13700
 
13701
      int lastComparison = 0;
13702
      getRuleDocString_args typedOther = (getRuleDocString_args)other;
13703
 
3430 rajveer 13704
      lastComparison = Boolean.valueOf(isSetRuleName()).compareTo(typedOther.isSetRuleName());
3385 varun.gupt 13705
      if (lastComparison != 0) {
13706
        return lastComparison;
13707
      }
3430 rajveer 13708
      if (isSetRuleName()) {
13709
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleName, typedOther.ruleName);
13710
        if (lastComparison != 0) {
13711
          return lastComparison;
13712
        }
3385 varun.gupt 13713
      }
13714
      return 0;
13715
    }
13716
 
3430 rajveer 13717
    public _Fields fieldForId(int fieldId) {
13718
      return _Fields.findByThriftId(fieldId);
13719
    }
13720
 
13721
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13722
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 13723
      iprot.readStructBegin();
13724
      while (true)
13725
      {
13726
        field = iprot.readFieldBegin();
3430 rajveer 13727
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 13728
          break;
13729
        }
3430 rajveer 13730
        switch (field.id) {
13731
          case 1: // RULE_NAME
13732
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
13733
              this.ruleName = iprot.readString();
13734
            } else { 
13735
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13736
            }
13737
            break;
13738
          default:
13739
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 13740
        }
3430 rajveer 13741
        iprot.readFieldEnd();
3385 varun.gupt 13742
      }
13743
      iprot.readStructEnd();
13744
      validate();
13745
    }
13746
 
3430 rajveer 13747
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 13748
      validate();
13749
 
13750
      oprot.writeStructBegin(STRUCT_DESC);
13751
      if (this.ruleName != null) {
13752
        oprot.writeFieldBegin(RULE_NAME_FIELD_DESC);
13753
        oprot.writeString(this.ruleName);
13754
        oprot.writeFieldEnd();
13755
      }
13756
      oprot.writeFieldStop();
13757
      oprot.writeStructEnd();
13758
    }
13759
 
13760
    @Override
13761
    public String toString() {
13762
      StringBuilder sb = new StringBuilder("getRuleDocString_args(");
13763
      boolean first = true;
13764
 
13765
      sb.append("ruleName:");
13766
      if (this.ruleName == null) {
13767
        sb.append("null");
13768
      } else {
13769
        sb.append(this.ruleName);
13770
      }
13771
      first = false;
13772
      sb.append(")");
13773
      return sb.toString();
13774
    }
13775
 
3430 rajveer 13776
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 13777
      // check for required fields
13778
    }
13779
 
3430 rajveer 13780
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13781
      try {
13782
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13783
      } catch (org.apache.thrift.TException te) {
13784
        throw new java.io.IOException(te);
13785
      }
13786
    }
13787
 
13788
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13789
      try {
13790
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13791
      } catch (org.apache.thrift.TException te) {
13792
        throw new java.io.IOException(te);
13793
      }
13794
    }
13795
 
3385 varun.gupt 13796
  }
13797
 
3430 rajveer 13798
  public static class getRuleDocString_result implements org.apache.thrift.TBase<getRuleDocString_result, getRuleDocString_result._Fields>, java.io.Serializable, Cloneable   {
13799
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_result");
3385 varun.gupt 13800
 
3430 rajveer 13801
    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 13802
 
3430 rajveer 13803
    private String success; // required
3385 varun.gupt 13804
 
13805
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 13806
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 13807
      SUCCESS((short)0, "success");
13808
 
13809
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13810
 
13811
      static {
13812
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13813
          byName.put(field.getFieldName(), field);
13814
        }
13815
      }
13816
 
13817
      /**
13818
       * Find the _Fields constant that matches fieldId, or null if its not found.
13819
       */
13820
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 13821
        switch(fieldId) {
13822
          case 0: // SUCCESS
13823
            return SUCCESS;
13824
          default:
13825
            return null;
13826
        }
3385 varun.gupt 13827
      }
13828
 
13829
      /**
13830
       * Find the _Fields constant that matches fieldId, throwing an exception
13831
       * if it is not found.
13832
       */
13833
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13834
        _Fields fields = findByThriftId(fieldId);
13835
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13836
        return fields;
13837
      }
13838
 
13839
      /**
13840
       * Find the _Fields constant that matches name, or null if its not found.
13841
       */
13842
      public static _Fields findByName(String name) {
13843
        return byName.get(name);
13844
      }
13845
 
13846
      private final short _thriftId;
13847
      private final String _fieldName;
13848
 
13849
      _Fields(short thriftId, String fieldName) {
13850
        _thriftId = thriftId;
13851
        _fieldName = fieldName;
13852
      }
13853
 
13854
      public short getThriftFieldId() {
13855
        return _thriftId;
13856
      }
13857
 
13858
      public String getFieldName() {
13859
        return _fieldName;
13860
      }
13861
    }
13862
 
13863
    // isset id assignments
13864
 
3430 rajveer 13865
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 13866
    static {
3430 rajveer 13867
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13868
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13869
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
13870
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13871
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_result.class, metaDataMap);
3385 varun.gupt 13872
    }
13873
 
13874
    public getRuleDocString_result() {
13875
    }
13876
 
13877
    public getRuleDocString_result(
13878
      String success)
13879
    {
13880
      this();
13881
      this.success = success;
13882
    }
13883
 
13884
    /**
13885
     * Performs a deep copy on <i>other</i>.
13886
     */
13887
    public getRuleDocString_result(getRuleDocString_result other) {
13888
      if (other.isSetSuccess()) {
13889
        this.success = other.success;
13890
      }
13891
    }
13892
 
13893
    public getRuleDocString_result deepCopy() {
13894
      return new getRuleDocString_result(this);
13895
    }
13896
 
3430 rajveer 13897
    @Override
13898
    public void clear() {
13899
      this.success = null;
3385 varun.gupt 13900
    }
13901
 
13902
    public String getSuccess() {
13903
      return this.success;
13904
    }
13905
 
3430 rajveer 13906
    public void setSuccess(String success) {
3385 varun.gupt 13907
      this.success = success;
13908
    }
13909
 
13910
    public void unsetSuccess() {
13911
      this.success = null;
13912
    }
13913
 
3430 rajveer 13914
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 13915
    public boolean isSetSuccess() {
13916
      return this.success != null;
13917
    }
13918
 
13919
    public void setSuccessIsSet(boolean value) {
13920
      if (!value) {
13921
        this.success = null;
13922
      }
13923
    }
13924
 
13925
    public void setFieldValue(_Fields field, Object value) {
13926
      switch (field) {
13927
      case SUCCESS:
13928
        if (value == null) {
13929
          unsetSuccess();
13930
        } else {
13931
          setSuccess((String)value);
13932
        }
13933
        break;
13934
 
13935
      }
13936
    }
13937
 
13938
    public Object getFieldValue(_Fields field) {
13939
      switch (field) {
13940
      case SUCCESS:
13941
        return getSuccess();
13942
 
13943
      }
13944
      throw new IllegalStateException();
13945
    }
13946
 
3430 rajveer 13947
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13948
    public boolean isSet(_Fields field) {
13949
      if (field == null) {
13950
        throw new IllegalArgumentException();
13951
      }
3385 varun.gupt 13952
 
13953
      switch (field) {
13954
      case SUCCESS:
13955
        return isSetSuccess();
13956
      }
13957
      throw new IllegalStateException();
13958
    }
13959
 
13960
    @Override
13961
    public boolean equals(Object that) {
13962
      if (that == null)
13963
        return false;
13964
      if (that instanceof getRuleDocString_result)
13965
        return this.equals((getRuleDocString_result)that);
13966
      return false;
13967
    }
13968
 
13969
    public boolean equals(getRuleDocString_result that) {
13970
      if (that == null)
13971
        return false;
13972
 
13973
      boolean this_present_success = true && this.isSetSuccess();
13974
      boolean that_present_success = true && that.isSetSuccess();
13975
      if (this_present_success || that_present_success) {
13976
        if (!(this_present_success && that_present_success))
13977
          return false;
13978
        if (!this.success.equals(that.success))
13979
          return false;
13980
      }
13981
 
13982
      return true;
13983
    }
13984
 
13985
    @Override
13986
    public int hashCode() {
13987
      return 0;
13988
    }
13989
 
13990
    public int compareTo(getRuleDocString_result other) {
13991
      if (!getClass().equals(other.getClass())) {
13992
        return getClass().getName().compareTo(other.getClass().getName());
13993
      }
13994
 
13995
      int lastComparison = 0;
13996
      getRuleDocString_result typedOther = (getRuleDocString_result)other;
13997
 
3430 rajveer 13998
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 13999
      if (lastComparison != 0) {
14000
        return lastComparison;
14001
      }
3430 rajveer 14002
      if (isSetSuccess()) {
14003
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
14004
        if (lastComparison != 0) {
14005
          return lastComparison;
14006
        }
3385 varun.gupt 14007
      }
14008
      return 0;
14009
    }
14010
 
3430 rajveer 14011
    public _Fields fieldForId(int fieldId) {
14012
      return _Fields.findByThriftId(fieldId);
14013
    }
14014
 
14015
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14016
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 14017
      iprot.readStructBegin();
14018
      while (true)
14019
      {
14020
        field = iprot.readFieldBegin();
3430 rajveer 14021
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 14022
          break;
14023
        }
3430 rajveer 14024
        switch (field.id) {
14025
          case 0: // SUCCESS
14026
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
14027
              this.success = iprot.readString();
14028
            } else { 
14029
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14030
            }
14031
            break;
14032
          default:
14033
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 14034
        }
3430 rajveer 14035
        iprot.readFieldEnd();
3385 varun.gupt 14036
      }
14037
      iprot.readStructEnd();
14038
      validate();
14039
    }
14040
 
3430 rajveer 14041
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 14042
      oprot.writeStructBegin(STRUCT_DESC);
14043
 
14044
      if (this.isSetSuccess()) {
14045
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
14046
        oprot.writeString(this.success);
14047
        oprot.writeFieldEnd();
14048
      }
14049
      oprot.writeFieldStop();
14050
      oprot.writeStructEnd();
14051
    }
14052
 
14053
    @Override
14054
    public String toString() {
14055
      StringBuilder sb = new StringBuilder("getRuleDocString_result(");
14056
      boolean first = true;
14057
 
14058
      sb.append("success:");
14059
      if (this.success == null) {
14060
        sb.append("null");
14061
      } else {
14062
        sb.append(this.success);
14063
      }
14064
      first = false;
14065
      sb.append(")");
14066
      return sb.toString();
14067
    }
14068
 
3430 rajveer 14069
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 14070
      // check for required fields
14071
    }
14072
 
3430 rajveer 14073
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14074
      try {
14075
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14076
      } catch (org.apache.thrift.TException te) {
14077
        throw new java.io.IOException(te);
14078
      }
14079
    }
14080
 
14081
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14082
      try {
14083
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14084
      } catch (org.apache.thrift.TException te) {
14085
        throw new java.io.IOException(te);
14086
      }
14087
    }
14088
 
3385 varun.gupt 14089
  }
14090
 
4189 varun.gupt 14091
  public static class getItemDiscountMap_args implements org.apache.thrift.TBase<getItemDiscountMap_args, getItemDiscountMap_args._Fields>, java.io.Serializable, Cloneable   {
14092
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_args");
14093
 
14094
    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);
14095
 
14096
    private List<Long> itemIds; // required
14097
 
14098
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14099
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
14100
      ITEM_IDS((short)1, "itemIds");
14101
 
14102
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14103
 
14104
      static {
14105
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14106
          byName.put(field.getFieldName(), field);
14107
        }
14108
      }
14109
 
14110
      /**
14111
       * Find the _Fields constant that matches fieldId, or null if its not found.
14112
       */
14113
      public static _Fields findByThriftId(int fieldId) {
14114
        switch(fieldId) {
14115
          case 1: // ITEM_IDS
14116
            return ITEM_IDS;
14117
          default:
14118
            return null;
14119
        }
14120
      }
14121
 
14122
      /**
14123
       * Find the _Fields constant that matches fieldId, throwing an exception
14124
       * if it is not found.
14125
       */
14126
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14127
        _Fields fields = findByThriftId(fieldId);
14128
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14129
        return fields;
14130
      }
14131
 
14132
      /**
14133
       * Find the _Fields constant that matches name, or null if its not found.
14134
       */
14135
      public static _Fields findByName(String name) {
14136
        return byName.get(name);
14137
      }
14138
 
14139
      private final short _thriftId;
14140
      private final String _fieldName;
14141
 
14142
      _Fields(short thriftId, String fieldName) {
14143
        _thriftId = thriftId;
14144
        _fieldName = fieldName;
14145
      }
14146
 
14147
      public short getThriftFieldId() {
14148
        return _thriftId;
14149
      }
14150
 
14151
      public String getFieldName() {
14152
        return _fieldName;
14153
      }
14154
    }
14155
 
14156
    // isset id assignments
14157
 
14158
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
14159
    static {
14160
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
14161
      tmpMap.put(_Fields.ITEM_IDS, new org.apache.thrift.meta_data.FieldMetaData("itemIds", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14162
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
14163
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
14164
      metaDataMap = Collections.unmodifiableMap(tmpMap);
14165
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_args.class, metaDataMap);
14166
    }
14167
 
14168
    public getItemDiscountMap_args() {
14169
    }
14170
 
14171
    public getItemDiscountMap_args(
14172
      List<Long> itemIds)
14173
    {
14174
      this();
14175
      this.itemIds = itemIds;
14176
    }
14177
 
14178
    /**
14179
     * Performs a deep copy on <i>other</i>.
14180
     */
14181
    public getItemDiscountMap_args(getItemDiscountMap_args other) {
14182
      if (other.isSetItemIds()) {
14183
        List<Long> __this__itemIds = new ArrayList<Long>();
14184
        for (Long other_element : other.itemIds) {
14185
          __this__itemIds.add(other_element);
14186
        }
14187
        this.itemIds = __this__itemIds;
14188
      }
14189
    }
14190
 
14191
    public getItemDiscountMap_args deepCopy() {
14192
      return new getItemDiscountMap_args(this);
14193
    }
14194
 
14195
    @Override
14196
    public void clear() {
14197
      this.itemIds = null;
14198
    }
14199
 
14200
    public int getItemIdsSize() {
14201
      return (this.itemIds == null) ? 0 : this.itemIds.size();
14202
    }
14203
 
14204
    public java.util.Iterator<Long> getItemIdsIterator() {
14205
      return (this.itemIds == null) ? null : this.itemIds.iterator();
14206
    }
14207
 
14208
    public void addToItemIds(long elem) {
14209
      if (this.itemIds == null) {
14210
        this.itemIds = new ArrayList<Long>();
14211
      }
14212
      this.itemIds.add(elem);
14213
    }
14214
 
14215
    public List<Long> getItemIds() {
14216
      return this.itemIds;
14217
    }
14218
 
14219
    public void setItemIds(List<Long> itemIds) {
14220
      this.itemIds = itemIds;
14221
    }
14222
 
14223
    public void unsetItemIds() {
14224
      this.itemIds = null;
14225
    }
14226
 
14227
    /** Returns true if field itemIds is set (has been assigned a value) and false otherwise */
14228
    public boolean isSetItemIds() {
14229
      return this.itemIds != null;
14230
    }
14231
 
14232
    public void setItemIdsIsSet(boolean value) {
14233
      if (!value) {
14234
        this.itemIds = null;
14235
      }
14236
    }
14237
 
14238
    public void setFieldValue(_Fields field, Object value) {
14239
      switch (field) {
14240
      case ITEM_IDS:
14241
        if (value == null) {
14242
          unsetItemIds();
14243
        } else {
14244
          setItemIds((List<Long>)value);
14245
        }
14246
        break;
14247
 
14248
      }
14249
    }
14250
 
14251
    public Object getFieldValue(_Fields field) {
14252
      switch (field) {
14253
      case ITEM_IDS:
14254
        return getItemIds();
14255
 
14256
      }
14257
      throw new IllegalStateException();
14258
    }
14259
 
14260
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14261
    public boolean isSet(_Fields field) {
14262
      if (field == null) {
14263
        throw new IllegalArgumentException();
14264
      }
14265
 
14266
      switch (field) {
14267
      case ITEM_IDS:
14268
        return isSetItemIds();
14269
      }
14270
      throw new IllegalStateException();
14271
    }
14272
 
14273
    @Override
14274
    public boolean equals(Object that) {
14275
      if (that == null)
14276
        return false;
14277
      if (that instanceof getItemDiscountMap_args)
14278
        return this.equals((getItemDiscountMap_args)that);
14279
      return false;
14280
    }
14281
 
14282
    public boolean equals(getItemDiscountMap_args that) {
14283
      if (that == null)
14284
        return false;
14285
 
14286
      boolean this_present_itemIds = true && this.isSetItemIds();
14287
      boolean that_present_itemIds = true && that.isSetItemIds();
14288
      if (this_present_itemIds || that_present_itemIds) {
14289
        if (!(this_present_itemIds && that_present_itemIds))
14290
          return false;
14291
        if (!this.itemIds.equals(that.itemIds))
14292
          return false;
14293
      }
14294
 
14295
      return true;
14296
    }
14297
 
14298
    @Override
14299
    public int hashCode() {
14300
      return 0;
14301
    }
14302
 
14303
    public int compareTo(getItemDiscountMap_args other) {
14304
      if (!getClass().equals(other.getClass())) {
14305
        return getClass().getName().compareTo(other.getClass().getName());
14306
      }
14307
 
14308
      int lastComparison = 0;
14309
      getItemDiscountMap_args typedOther = (getItemDiscountMap_args)other;
14310
 
14311
      lastComparison = Boolean.valueOf(isSetItemIds()).compareTo(typedOther.isSetItemIds());
14312
      if (lastComparison != 0) {
14313
        return lastComparison;
14314
      }
14315
      if (isSetItemIds()) {
14316
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemIds, typedOther.itemIds);
14317
        if (lastComparison != 0) {
14318
          return lastComparison;
14319
        }
14320
      }
14321
      return 0;
14322
    }
14323
 
14324
    public _Fields fieldForId(int fieldId) {
14325
      return _Fields.findByThriftId(fieldId);
14326
    }
14327
 
14328
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14329
      org.apache.thrift.protocol.TField field;
14330
      iprot.readStructBegin();
14331
      while (true)
14332
      {
14333
        field = iprot.readFieldBegin();
14334
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
14335
          break;
14336
        }
14337
        switch (field.id) {
14338
          case 1: // ITEM_IDS
14339
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
14340
              {
6497 amit.gupta 14341
                org.apache.thrift.protocol.TList _list29 = iprot.readListBegin();
14342
                this.itemIds = new ArrayList<Long>(_list29.size);
14343
                for (int _i30 = 0; _i30 < _list29.size; ++_i30)
4189 varun.gupt 14344
                {
6497 amit.gupta 14345
                  long _elem31; // required
14346
                  _elem31 = iprot.readI64();
14347
                  this.itemIds.add(_elem31);
4189 varun.gupt 14348
                }
14349
                iprot.readListEnd();
14350
              }
14351
            } else { 
14352
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14353
            }
14354
            break;
14355
          default:
14356
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14357
        }
14358
        iprot.readFieldEnd();
14359
      }
14360
      iprot.readStructEnd();
14361
      validate();
14362
    }
14363
 
14364
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
14365
      validate();
14366
 
14367
      oprot.writeStructBegin(STRUCT_DESC);
14368
      if (this.itemIds != null) {
14369
        oprot.writeFieldBegin(ITEM_IDS_FIELD_DESC);
14370
        {
14371
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.itemIds.size()));
6497 amit.gupta 14372
          for (long _iter32 : this.itemIds)
4189 varun.gupt 14373
          {
6497 amit.gupta 14374
            oprot.writeI64(_iter32);
4189 varun.gupt 14375
          }
14376
          oprot.writeListEnd();
14377
        }
14378
        oprot.writeFieldEnd();
14379
      }
14380
      oprot.writeFieldStop();
14381
      oprot.writeStructEnd();
14382
    }
14383
 
14384
    @Override
14385
    public String toString() {
14386
      StringBuilder sb = new StringBuilder("getItemDiscountMap_args(");
14387
      boolean first = true;
14388
 
14389
      sb.append("itemIds:");
14390
      if (this.itemIds == null) {
14391
        sb.append("null");
14392
      } else {
14393
        sb.append(this.itemIds);
14394
      }
14395
      first = false;
14396
      sb.append(")");
14397
      return sb.toString();
14398
    }
14399
 
14400
    public void validate() throws org.apache.thrift.TException {
14401
      // check for required fields
14402
    }
14403
 
14404
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14405
      try {
14406
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14407
      } catch (org.apache.thrift.TException te) {
14408
        throw new java.io.IOException(te);
14409
      }
14410
    }
14411
 
14412
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14413
      try {
14414
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14415
      } catch (org.apache.thrift.TException te) {
14416
        throw new java.io.IOException(te);
14417
      }
14418
    }
14419
 
14420
  }
14421
 
14422
  public static class getItemDiscountMap_result implements org.apache.thrift.TBase<getItemDiscountMap_result, getItemDiscountMap_result._Fields>, java.io.Serializable, Cloneable   {
14423
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_result");
14424
 
14425
    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);
14426
    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);
14427
 
14428
    private List<ItemCouponDiscount> success; // required
14429
    private PromotionException pex; // required
14430
 
14431
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14432
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
14433
      SUCCESS((short)0, "success"),
14434
      PEX((short)1, "pex");
14435
 
14436
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14437
 
14438
      static {
14439
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14440
          byName.put(field.getFieldName(), field);
14441
        }
14442
      }
14443
 
14444
      /**
14445
       * Find the _Fields constant that matches fieldId, or null if its not found.
14446
       */
14447
      public static _Fields findByThriftId(int fieldId) {
14448
        switch(fieldId) {
14449
          case 0: // SUCCESS
14450
            return SUCCESS;
14451
          case 1: // PEX
14452
            return PEX;
14453
          default:
14454
            return null;
14455
        }
14456
      }
14457
 
14458
      /**
14459
       * Find the _Fields constant that matches fieldId, throwing an exception
14460
       * if it is not found.
14461
       */
14462
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14463
        _Fields fields = findByThriftId(fieldId);
14464
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14465
        return fields;
14466
      }
14467
 
14468
      /**
14469
       * Find the _Fields constant that matches name, or null if its not found.
14470
       */
14471
      public static _Fields findByName(String name) {
14472
        return byName.get(name);
14473
      }
14474
 
14475
      private final short _thriftId;
14476
      private final String _fieldName;
14477
 
14478
      _Fields(short thriftId, String fieldName) {
14479
        _thriftId = thriftId;
14480
        _fieldName = fieldName;
14481
      }
14482
 
14483
      public short getThriftFieldId() {
14484
        return _thriftId;
14485
      }
14486
 
14487
      public String getFieldName() {
14488
        return _fieldName;
14489
      }
14490
    }
14491
 
14492
    // isset id assignments
14493
 
14494
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
14495
    static {
14496
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
14497
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14498
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
14499
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ItemCouponDiscount.class))));
14500
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14501
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
14502
      metaDataMap = Collections.unmodifiableMap(tmpMap);
14503
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_result.class, metaDataMap);
14504
    }
14505
 
14506
    public getItemDiscountMap_result() {
14507
    }
14508
 
14509
    public getItemDiscountMap_result(
14510
      List<ItemCouponDiscount> success,
14511
      PromotionException pex)
14512
    {
14513
      this();
14514
      this.success = success;
14515
      this.pex = pex;
14516
    }
14517
 
14518
    /**
14519
     * Performs a deep copy on <i>other</i>.
14520
     */
14521
    public getItemDiscountMap_result(getItemDiscountMap_result other) {
14522
      if (other.isSetSuccess()) {
14523
        List<ItemCouponDiscount> __this__success = new ArrayList<ItemCouponDiscount>();
14524
        for (ItemCouponDiscount other_element : other.success) {
14525
          __this__success.add(new ItemCouponDiscount(other_element));
14526
        }
14527
        this.success = __this__success;
14528
      }
14529
      if (other.isSetPex()) {
14530
        this.pex = new PromotionException(other.pex);
14531
      }
14532
    }
14533
 
14534
    public getItemDiscountMap_result deepCopy() {
14535
      return new getItemDiscountMap_result(this);
14536
    }
14537
 
14538
    @Override
14539
    public void clear() {
14540
      this.success = null;
14541
      this.pex = null;
14542
    }
14543
 
14544
    public int getSuccessSize() {
14545
      return (this.success == null) ? 0 : this.success.size();
14546
    }
14547
 
14548
    public java.util.Iterator<ItemCouponDiscount> getSuccessIterator() {
14549
      return (this.success == null) ? null : this.success.iterator();
14550
    }
14551
 
14552
    public void addToSuccess(ItemCouponDiscount elem) {
14553
      if (this.success == null) {
14554
        this.success = new ArrayList<ItemCouponDiscount>();
14555
      }
14556
      this.success.add(elem);
14557
    }
14558
 
14559
    public List<ItemCouponDiscount> getSuccess() {
14560
      return this.success;
14561
    }
14562
 
14563
    public void setSuccess(List<ItemCouponDiscount> success) {
14564
      this.success = success;
14565
    }
14566
 
14567
    public void unsetSuccess() {
14568
      this.success = null;
14569
    }
14570
 
14571
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
14572
    public boolean isSetSuccess() {
14573
      return this.success != null;
14574
    }
14575
 
14576
    public void setSuccessIsSet(boolean value) {
14577
      if (!value) {
14578
        this.success = null;
14579
      }
14580
    }
14581
 
14582
    public PromotionException getPex() {
14583
      return this.pex;
14584
    }
14585
 
14586
    public void setPex(PromotionException pex) {
14587
      this.pex = pex;
14588
    }
14589
 
14590
    public void unsetPex() {
14591
      this.pex = null;
14592
    }
14593
 
14594
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
14595
    public boolean isSetPex() {
14596
      return this.pex != null;
14597
    }
14598
 
14599
    public void setPexIsSet(boolean value) {
14600
      if (!value) {
14601
        this.pex = null;
14602
      }
14603
    }
14604
 
14605
    public void setFieldValue(_Fields field, Object value) {
14606
      switch (field) {
14607
      case SUCCESS:
14608
        if (value == null) {
14609
          unsetSuccess();
14610
        } else {
14611
          setSuccess((List<ItemCouponDiscount>)value);
14612
        }
14613
        break;
14614
 
14615
      case PEX:
14616
        if (value == null) {
14617
          unsetPex();
14618
        } else {
14619
          setPex((PromotionException)value);
14620
        }
14621
        break;
14622
 
14623
      }
14624
    }
14625
 
14626
    public Object getFieldValue(_Fields field) {
14627
      switch (field) {
14628
      case SUCCESS:
14629
        return getSuccess();
14630
 
14631
      case PEX:
14632
        return getPex();
14633
 
14634
      }
14635
      throw new IllegalStateException();
14636
    }
14637
 
14638
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14639
    public boolean isSet(_Fields field) {
14640
      if (field == null) {
14641
        throw new IllegalArgumentException();
14642
      }
14643
 
14644
      switch (field) {
14645
      case SUCCESS:
14646
        return isSetSuccess();
14647
      case PEX:
14648
        return isSetPex();
14649
      }
14650
      throw new IllegalStateException();
14651
    }
14652
 
14653
    @Override
14654
    public boolean equals(Object that) {
14655
      if (that == null)
14656
        return false;
14657
      if (that instanceof getItemDiscountMap_result)
14658
        return this.equals((getItemDiscountMap_result)that);
14659
      return false;
14660
    }
14661
 
14662
    public boolean equals(getItemDiscountMap_result that) {
14663
      if (that == null)
14664
        return false;
14665
 
14666
      boolean this_present_success = true && this.isSetSuccess();
14667
      boolean that_present_success = true && that.isSetSuccess();
14668
      if (this_present_success || that_present_success) {
14669
        if (!(this_present_success && that_present_success))
14670
          return false;
14671
        if (!this.success.equals(that.success))
14672
          return false;
14673
      }
14674
 
14675
      boolean this_present_pex = true && this.isSetPex();
14676
      boolean that_present_pex = true && that.isSetPex();
14677
      if (this_present_pex || that_present_pex) {
14678
        if (!(this_present_pex && that_present_pex))
14679
          return false;
14680
        if (!this.pex.equals(that.pex))
14681
          return false;
14682
      }
14683
 
14684
      return true;
14685
    }
14686
 
14687
    @Override
14688
    public int hashCode() {
14689
      return 0;
14690
    }
14691
 
14692
    public int compareTo(getItemDiscountMap_result other) {
14693
      if (!getClass().equals(other.getClass())) {
14694
        return getClass().getName().compareTo(other.getClass().getName());
14695
      }
14696
 
14697
      int lastComparison = 0;
14698
      getItemDiscountMap_result typedOther = (getItemDiscountMap_result)other;
14699
 
14700
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
14701
      if (lastComparison != 0) {
14702
        return lastComparison;
14703
      }
14704
      if (isSetSuccess()) {
14705
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
14706
        if (lastComparison != 0) {
14707
          return lastComparison;
14708
        }
14709
      }
14710
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
14711
      if (lastComparison != 0) {
14712
        return lastComparison;
14713
      }
14714
      if (isSetPex()) {
14715
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
14716
        if (lastComparison != 0) {
14717
          return lastComparison;
14718
        }
14719
      }
14720
      return 0;
14721
    }
14722
 
14723
    public _Fields fieldForId(int fieldId) {
14724
      return _Fields.findByThriftId(fieldId);
14725
    }
14726
 
14727
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14728
      org.apache.thrift.protocol.TField field;
14729
      iprot.readStructBegin();
14730
      while (true)
14731
      {
14732
        field = iprot.readFieldBegin();
14733
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
14734
          break;
14735
        }
14736
        switch (field.id) {
14737
          case 0: // SUCCESS
14738
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
14739
              {
6497 amit.gupta 14740
                org.apache.thrift.protocol.TList _list33 = iprot.readListBegin();
14741
                this.success = new ArrayList<ItemCouponDiscount>(_list33.size);
14742
                for (int _i34 = 0; _i34 < _list33.size; ++_i34)
4189 varun.gupt 14743
                {
6497 amit.gupta 14744
                  ItemCouponDiscount _elem35; // required
14745
                  _elem35 = new ItemCouponDiscount();
14746
                  _elem35.read(iprot);
14747
                  this.success.add(_elem35);
4189 varun.gupt 14748
                }
14749
                iprot.readListEnd();
14750
              }
14751
            } else { 
14752
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14753
            }
14754
            break;
14755
          case 1: // PEX
14756
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
14757
              this.pex = new PromotionException();
14758
              this.pex.read(iprot);
14759
            } else { 
14760
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14761
            }
14762
            break;
14763
          default:
14764
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14765
        }
14766
        iprot.readFieldEnd();
14767
      }
14768
      iprot.readStructEnd();
14769
      validate();
14770
    }
14771
 
14772
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
14773
      oprot.writeStructBegin(STRUCT_DESC);
14774
 
14775
      if (this.isSetSuccess()) {
14776
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
14777
        {
14778
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
6497 amit.gupta 14779
          for (ItemCouponDiscount _iter36 : this.success)
4189 varun.gupt 14780
          {
6497 amit.gupta 14781
            _iter36.write(oprot);
4189 varun.gupt 14782
          }
14783
          oprot.writeListEnd();
14784
        }
14785
        oprot.writeFieldEnd();
14786
      } else if (this.isSetPex()) {
14787
        oprot.writeFieldBegin(PEX_FIELD_DESC);
14788
        this.pex.write(oprot);
14789
        oprot.writeFieldEnd();
14790
      }
14791
      oprot.writeFieldStop();
14792
      oprot.writeStructEnd();
14793
    }
14794
 
14795
    @Override
14796
    public String toString() {
14797
      StringBuilder sb = new StringBuilder("getItemDiscountMap_result(");
14798
      boolean first = true;
14799
 
14800
      sb.append("success:");
14801
      if (this.success == null) {
14802
        sb.append("null");
14803
      } else {
14804
        sb.append(this.success);
14805
      }
14806
      first = false;
14807
      if (!first) sb.append(", ");
14808
      sb.append("pex:");
14809
      if (this.pex == null) {
14810
        sb.append("null");
14811
      } else {
14812
        sb.append(this.pex);
14813
      }
14814
      first = false;
14815
      sb.append(")");
14816
      return sb.toString();
14817
    }
14818
 
14819
    public void validate() throws org.apache.thrift.TException {
14820
      // check for required fields
14821
    }
14822
 
14823
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14824
      try {
14825
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14826
      } catch (org.apache.thrift.TException te) {
14827
        throw new java.io.IOException(te);
14828
      }
14829
    }
14830
 
14831
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14832
      try {
14833
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14834
      } catch (org.apache.thrift.TException te) {
14835
        throw new java.io.IOException(te);
14836
      }
14837
    }
14838
 
14839
  }
14840
 
4494 varun.gupt 14841
  public static class getDiscountsForEntity_args implements org.apache.thrift.TBase<getDiscountsForEntity_args, getDiscountsForEntity_args._Fields>, java.io.Serializable, Cloneable   {
14842
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_args");
14843
 
14844
    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);
14845
 
14846
    private long entityId; // required
14847
 
14848
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14849
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
14850
      ENTITY_ID((short)1, "entityId");
14851
 
14852
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14853
 
14854
      static {
14855
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14856
          byName.put(field.getFieldName(), field);
14857
        }
14858
      }
14859
 
14860
      /**
14861
       * Find the _Fields constant that matches fieldId, or null if its not found.
14862
       */
14863
      public static _Fields findByThriftId(int fieldId) {
14864
        switch(fieldId) {
14865
          case 1: // ENTITY_ID
14866
            return ENTITY_ID;
14867
          default:
14868
            return null;
14869
        }
14870
      }
14871
 
14872
      /**
14873
       * Find the _Fields constant that matches fieldId, throwing an exception
14874
       * if it is not found.
14875
       */
14876
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14877
        _Fields fields = findByThriftId(fieldId);
14878
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14879
        return fields;
14880
      }
14881
 
14882
      /**
14883
       * Find the _Fields constant that matches name, or null if its not found.
14884
       */
14885
      public static _Fields findByName(String name) {
14886
        return byName.get(name);
14887
      }
14888
 
14889
      private final short _thriftId;
14890
      private final String _fieldName;
14891
 
14892
      _Fields(short thriftId, String fieldName) {
14893
        _thriftId = thriftId;
14894
        _fieldName = fieldName;
14895
      }
14896
 
14897
      public short getThriftFieldId() {
14898
        return _thriftId;
14899
      }
14900
 
14901
      public String getFieldName() {
14902
        return _fieldName;
14903
      }
14904
    }
14905
 
14906
    // isset id assignments
14907
    private static final int __ENTITYID_ISSET_ID = 0;
14908
    private BitSet __isset_bit_vector = new BitSet(1);
14909
 
14910
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
14911
    static {
14912
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
14913
      tmpMap.put(_Fields.ENTITY_ID, new org.apache.thrift.meta_data.FieldMetaData("entityId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14914
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
14915
      metaDataMap = Collections.unmodifiableMap(tmpMap);
14916
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_args.class, metaDataMap);
14917
    }
14918
 
14919
    public getDiscountsForEntity_args() {
14920
    }
14921
 
14922
    public getDiscountsForEntity_args(
14923
      long entityId)
14924
    {
14925
      this();
14926
      this.entityId = entityId;
14927
      setEntityIdIsSet(true);
14928
    }
14929
 
14930
    /**
14931
     * Performs a deep copy on <i>other</i>.
14932
     */
14933
    public getDiscountsForEntity_args(getDiscountsForEntity_args other) {
14934
      __isset_bit_vector.clear();
14935
      __isset_bit_vector.or(other.__isset_bit_vector);
14936
      this.entityId = other.entityId;
14937
    }
14938
 
14939
    public getDiscountsForEntity_args deepCopy() {
14940
      return new getDiscountsForEntity_args(this);
14941
    }
14942
 
14943
    @Override
14944
    public void clear() {
14945
      setEntityIdIsSet(false);
14946
      this.entityId = 0;
14947
    }
14948
 
14949
    public long getEntityId() {
14950
      return this.entityId;
14951
    }
14952
 
14953
    public void setEntityId(long entityId) {
14954
      this.entityId = entityId;
14955
      setEntityIdIsSet(true);
14956
    }
14957
 
14958
    public void unsetEntityId() {
14959
      __isset_bit_vector.clear(__ENTITYID_ISSET_ID);
14960
    }
14961
 
14962
    /** Returns true if field entityId is set (has been assigned a value) and false otherwise */
14963
    public boolean isSetEntityId() {
14964
      return __isset_bit_vector.get(__ENTITYID_ISSET_ID);
14965
    }
14966
 
14967
    public void setEntityIdIsSet(boolean value) {
14968
      __isset_bit_vector.set(__ENTITYID_ISSET_ID, value);
14969
    }
14970
 
14971
    public void setFieldValue(_Fields field, Object value) {
14972
      switch (field) {
14973
      case ENTITY_ID:
14974
        if (value == null) {
14975
          unsetEntityId();
14976
        } else {
14977
          setEntityId((Long)value);
14978
        }
14979
        break;
14980
 
14981
      }
14982
    }
14983
 
14984
    public Object getFieldValue(_Fields field) {
14985
      switch (field) {
14986
      case ENTITY_ID:
14987
        return Long.valueOf(getEntityId());
14988
 
14989
      }
14990
      throw new IllegalStateException();
14991
    }
14992
 
14993
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14994
    public boolean isSet(_Fields field) {
14995
      if (field == null) {
14996
        throw new IllegalArgumentException();
14997
      }
14998
 
14999
      switch (field) {
15000
      case ENTITY_ID:
15001
        return isSetEntityId();
15002
      }
15003
      throw new IllegalStateException();
15004
    }
15005
 
15006
    @Override
15007
    public boolean equals(Object that) {
15008
      if (that == null)
15009
        return false;
15010
      if (that instanceof getDiscountsForEntity_args)
15011
        return this.equals((getDiscountsForEntity_args)that);
15012
      return false;
15013
    }
15014
 
15015
    public boolean equals(getDiscountsForEntity_args that) {
15016
      if (that == null)
15017
        return false;
15018
 
15019
      boolean this_present_entityId = true;
15020
      boolean that_present_entityId = true;
15021
      if (this_present_entityId || that_present_entityId) {
15022
        if (!(this_present_entityId && that_present_entityId))
15023
          return false;
15024
        if (this.entityId != that.entityId)
15025
          return false;
15026
      }
15027
 
15028
      return true;
15029
    }
15030
 
15031
    @Override
15032
    public int hashCode() {
15033
      return 0;
15034
    }
15035
 
15036
    public int compareTo(getDiscountsForEntity_args other) {
15037
      if (!getClass().equals(other.getClass())) {
15038
        return getClass().getName().compareTo(other.getClass().getName());
15039
      }
15040
 
15041
      int lastComparison = 0;
15042
      getDiscountsForEntity_args typedOther = (getDiscountsForEntity_args)other;
15043
 
15044
      lastComparison = Boolean.valueOf(isSetEntityId()).compareTo(typedOther.isSetEntityId());
15045
      if (lastComparison != 0) {
15046
        return lastComparison;
15047
      }
15048
      if (isSetEntityId()) {
15049
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityId, typedOther.entityId);
15050
        if (lastComparison != 0) {
15051
          return lastComparison;
15052
        }
15053
      }
15054
      return 0;
15055
    }
15056
 
15057
    public _Fields fieldForId(int fieldId) {
15058
      return _Fields.findByThriftId(fieldId);
15059
    }
15060
 
15061
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15062
      org.apache.thrift.protocol.TField field;
15063
      iprot.readStructBegin();
15064
      while (true)
15065
      {
15066
        field = iprot.readFieldBegin();
15067
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
15068
          break;
15069
        }
15070
        switch (field.id) {
15071
          case 1: // ENTITY_ID
15072
            if (field.type == org.apache.thrift.protocol.TType.I64) {
15073
              this.entityId = iprot.readI64();
15074
              setEntityIdIsSet(true);
15075
            } else { 
15076
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15077
            }
15078
            break;
15079
          default:
15080
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15081
        }
15082
        iprot.readFieldEnd();
15083
      }
15084
      iprot.readStructEnd();
15085
      validate();
15086
    }
15087
 
15088
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
15089
      validate();
15090
 
15091
      oprot.writeStructBegin(STRUCT_DESC);
15092
      oprot.writeFieldBegin(ENTITY_ID_FIELD_DESC);
15093
      oprot.writeI64(this.entityId);
15094
      oprot.writeFieldEnd();
15095
      oprot.writeFieldStop();
15096
      oprot.writeStructEnd();
15097
    }
15098
 
15099
    @Override
15100
    public String toString() {
15101
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_args(");
15102
      boolean first = true;
15103
 
15104
      sb.append("entityId:");
15105
      sb.append(this.entityId);
15106
      first = false;
15107
      sb.append(")");
15108
      return sb.toString();
15109
    }
15110
 
15111
    public void validate() throws org.apache.thrift.TException {
15112
      // check for required fields
15113
    }
15114
 
15115
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15116
      try {
15117
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15118
      } catch (org.apache.thrift.TException te) {
15119
        throw new java.io.IOException(te);
15120
      }
15121
    }
15122
 
15123
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15124
      try {
15125
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
15126
        __isset_bit_vector = new BitSet(1);
15127
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15128
      } catch (org.apache.thrift.TException te) {
15129
        throw new java.io.IOException(te);
15130
      }
15131
    }
15132
 
15133
  }
15134
 
15135
  public static class getDiscountsForEntity_result implements org.apache.thrift.TBase<getDiscountsForEntity_result, getDiscountsForEntity_result._Fields>, java.io.Serializable, Cloneable   {
15136
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_result");
15137
 
15138
    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);
15139
 
15140
    private Map<String,Double> success; // required
15141
 
15142
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
15143
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
15144
      SUCCESS((short)0, "success");
15145
 
15146
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15147
 
15148
      static {
15149
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15150
          byName.put(field.getFieldName(), field);
15151
        }
15152
      }
15153
 
15154
      /**
15155
       * Find the _Fields constant that matches fieldId, or null if its not found.
15156
       */
15157
      public static _Fields findByThriftId(int fieldId) {
15158
        switch(fieldId) {
15159
          case 0: // SUCCESS
15160
            return SUCCESS;
15161
          default:
15162
            return null;
15163
        }
15164
      }
15165
 
15166
      /**
15167
       * Find the _Fields constant that matches fieldId, throwing an exception
15168
       * if it is not found.
15169
       */
15170
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15171
        _Fields fields = findByThriftId(fieldId);
15172
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15173
        return fields;
15174
      }
15175
 
15176
      /**
15177
       * Find the _Fields constant that matches name, or null if its not found.
15178
       */
15179
      public static _Fields findByName(String name) {
15180
        return byName.get(name);
15181
      }
15182
 
15183
      private final short _thriftId;
15184
      private final String _fieldName;
15185
 
15186
      _Fields(short thriftId, String fieldName) {
15187
        _thriftId = thriftId;
15188
        _fieldName = fieldName;
15189
      }
15190
 
15191
      public short getThriftFieldId() {
15192
        return _thriftId;
15193
      }
15194
 
15195
      public String getFieldName() {
15196
        return _fieldName;
15197
      }
15198
    }
15199
 
15200
    // isset id assignments
15201
 
15202
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
15203
    static {
15204
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15205
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15206
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
15207
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
15208
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
15209
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15210
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_result.class, metaDataMap);
15211
    }
15212
 
15213
    public getDiscountsForEntity_result() {
15214
    }
15215
 
15216
    public getDiscountsForEntity_result(
15217
      Map<String,Double> success)
15218
    {
15219
      this();
15220
      this.success = success;
15221
    }
15222
 
15223
    /**
15224
     * Performs a deep copy on <i>other</i>.
15225
     */
15226
    public getDiscountsForEntity_result(getDiscountsForEntity_result other) {
15227
      if (other.isSetSuccess()) {
15228
        Map<String,Double> __this__success = new HashMap<String,Double>();
15229
        for (Map.Entry<String, Double> other_element : other.success.entrySet()) {
15230
 
15231
          String other_element_key = other_element.getKey();
15232
          Double other_element_value = other_element.getValue();
15233
 
15234
          String __this__success_copy_key = other_element_key;
15235
 
15236
          Double __this__success_copy_value = other_element_value;
15237
 
15238
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
15239
        }
15240
        this.success = __this__success;
15241
      }
15242
    }
15243
 
15244
    public getDiscountsForEntity_result deepCopy() {
15245
      return new getDiscountsForEntity_result(this);
15246
    }
15247
 
15248
    @Override
15249
    public void clear() {
15250
      this.success = null;
15251
    }
15252
 
15253
    public int getSuccessSize() {
15254
      return (this.success == null) ? 0 : this.success.size();
15255
    }
15256
 
15257
    public void putToSuccess(String key, double val) {
15258
      if (this.success == null) {
15259
        this.success = new HashMap<String,Double>();
15260
      }
15261
      this.success.put(key, val);
15262
    }
15263
 
15264
    public Map<String,Double> getSuccess() {
15265
      return this.success;
15266
    }
15267
 
15268
    public void setSuccess(Map<String,Double> success) {
15269
      this.success = success;
15270
    }
15271
 
15272
    public void unsetSuccess() {
15273
      this.success = null;
15274
    }
15275
 
15276
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
15277
    public boolean isSetSuccess() {
15278
      return this.success != null;
15279
    }
15280
 
15281
    public void setSuccessIsSet(boolean value) {
15282
      if (!value) {
15283
        this.success = null;
15284
      }
15285
    }
15286
 
15287
    public void setFieldValue(_Fields field, Object value) {
15288
      switch (field) {
15289
      case SUCCESS:
15290
        if (value == null) {
15291
          unsetSuccess();
15292
        } else {
15293
          setSuccess((Map<String,Double>)value);
15294
        }
15295
        break;
15296
 
15297
      }
15298
    }
15299
 
15300
    public Object getFieldValue(_Fields field) {
15301
      switch (field) {
15302
      case SUCCESS:
15303
        return getSuccess();
15304
 
15305
      }
15306
      throw new IllegalStateException();
15307
    }
15308
 
15309
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15310
    public boolean isSet(_Fields field) {
15311
      if (field == null) {
15312
        throw new IllegalArgumentException();
15313
      }
15314
 
15315
      switch (field) {
15316
      case SUCCESS:
15317
        return isSetSuccess();
15318
      }
15319
      throw new IllegalStateException();
15320
    }
15321
 
15322
    @Override
15323
    public boolean equals(Object that) {
15324
      if (that == null)
15325
        return false;
15326
      if (that instanceof getDiscountsForEntity_result)
15327
        return this.equals((getDiscountsForEntity_result)that);
15328
      return false;
15329
    }
15330
 
15331
    public boolean equals(getDiscountsForEntity_result that) {
15332
      if (that == null)
15333
        return false;
15334
 
15335
      boolean this_present_success = true && this.isSetSuccess();
15336
      boolean that_present_success = true && that.isSetSuccess();
15337
      if (this_present_success || that_present_success) {
15338
        if (!(this_present_success && that_present_success))
15339
          return false;
15340
        if (!this.success.equals(that.success))
15341
          return false;
15342
      }
15343
 
15344
      return true;
15345
    }
15346
 
15347
    @Override
15348
    public int hashCode() {
15349
      return 0;
15350
    }
15351
 
15352
    public int compareTo(getDiscountsForEntity_result other) {
15353
      if (!getClass().equals(other.getClass())) {
15354
        return getClass().getName().compareTo(other.getClass().getName());
15355
      }
15356
 
15357
      int lastComparison = 0;
15358
      getDiscountsForEntity_result typedOther = (getDiscountsForEntity_result)other;
15359
 
15360
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
15361
      if (lastComparison != 0) {
15362
        return lastComparison;
15363
      }
15364
      if (isSetSuccess()) {
15365
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
15366
        if (lastComparison != 0) {
15367
          return lastComparison;
15368
        }
15369
      }
15370
      return 0;
15371
    }
15372
 
15373
    public _Fields fieldForId(int fieldId) {
15374
      return _Fields.findByThriftId(fieldId);
15375
    }
15376
 
15377
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15378
      org.apache.thrift.protocol.TField field;
15379
      iprot.readStructBegin();
15380
      while (true)
15381
      {
15382
        field = iprot.readFieldBegin();
15383
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
15384
          break;
15385
        }
15386
        switch (field.id) {
15387
          case 0: // SUCCESS
15388
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
15389
              {
6497 amit.gupta 15390
                org.apache.thrift.protocol.TMap _map37 = iprot.readMapBegin();
15391
                this.success = new HashMap<String,Double>(2*_map37.size);
15392
                for (int _i38 = 0; _i38 < _map37.size; ++_i38)
4494 varun.gupt 15393
                {
6497 amit.gupta 15394
                  String _key39; // required
15395
                  double _val40; // required
15396
                  _key39 = iprot.readString();
15397
                  _val40 = iprot.readDouble();
15398
                  this.success.put(_key39, _val40);
4494 varun.gupt 15399
                }
15400
                iprot.readMapEnd();
15401
              }
15402
            } else { 
15403
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15404
            }
15405
            break;
15406
          default:
15407
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15408
        }
15409
        iprot.readFieldEnd();
15410
      }
15411
      iprot.readStructEnd();
15412
      validate();
15413
    }
15414
 
15415
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
15416
      oprot.writeStructBegin(STRUCT_DESC);
15417
 
15418
      if (this.isSetSuccess()) {
15419
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
15420
        {
15421
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, this.success.size()));
6497 amit.gupta 15422
          for (Map.Entry<String, Double> _iter41 : this.success.entrySet())
4494 varun.gupt 15423
          {
6497 amit.gupta 15424
            oprot.writeString(_iter41.getKey());
15425
            oprot.writeDouble(_iter41.getValue());
4494 varun.gupt 15426
          }
15427
          oprot.writeMapEnd();
15428
        }
15429
        oprot.writeFieldEnd();
15430
      }
15431
      oprot.writeFieldStop();
15432
      oprot.writeStructEnd();
15433
    }
15434
 
15435
    @Override
15436
    public String toString() {
15437
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_result(");
15438
      boolean first = true;
15439
 
15440
      sb.append("success:");
15441
      if (this.success == null) {
15442
        sb.append("null");
15443
      } else {
15444
        sb.append(this.success);
15445
      }
15446
      first = false;
15447
      sb.append(")");
15448
      return sb.toString();
15449
    }
15450
 
15451
    public void validate() throws org.apache.thrift.TException {
15452
      // check for required fields
15453
    }
15454
 
15455
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15456
      try {
15457
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15458
      } catch (org.apache.thrift.TException te) {
15459
        throw new java.io.IOException(te);
15460
      }
15461
    }
15462
 
15463
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15464
      try {
15465
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15466
      } catch (org.apache.thrift.TException te) {
15467
        throw new java.io.IOException(te);
15468
      }
15469
    }
15470
 
15471
  }
15472
 
5469 rajveer 15473
  public static class addVoucher_args implements org.apache.thrift.TBase<addVoucher_args, addVoucher_args._Fields>, java.io.Serializable, Cloneable   {
15474
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_args");
15475
 
15476
    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);
15477
 
15478
    private Voucher voucher; // required
15479
 
15480
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
15481
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
15482
      VOUCHER((short)1, "voucher");
15483
 
15484
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15485
 
15486
      static {
15487
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15488
          byName.put(field.getFieldName(), field);
15489
        }
15490
      }
15491
 
15492
      /**
15493
       * Find the _Fields constant that matches fieldId, or null if its not found.
15494
       */
15495
      public static _Fields findByThriftId(int fieldId) {
15496
        switch(fieldId) {
15497
          case 1: // VOUCHER
15498
            return VOUCHER;
15499
          default:
15500
            return null;
15501
        }
15502
      }
15503
 
15504
      /**
15505
       * Find the _Fields constant that matches fieldId, throwing an exception
15506
       * if it is not found.
15507
       */
15508
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15509
        _Fields fields = findByThriftId(fieldId);
15510
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15511
        return fields;
15512
      }
15513
 
15514
      /**
15515
       * Find the _Fields constant that matches name, or null if its not found.
15516
       */
15517
      public static _Fields findByName(String name) {
15518
        return byName.get(name);
15519
      }
15520
 
15521
      private final short _thriftId;
15522
      private final String _fieldName;
15523
 
15524
      _Fields(short thriftId, String fieldName) {
15525
        _thriftId = thriftId;
15526
        _fieldName = fieldName;
15527
      }
15528
 
15529
      public short getThriftFieldId() {
15530
        return _thriftId;
15531
      }
15532
 
15533
      public String getFieldName() {
15534
        return _fieldName;
15535
      }
15536
    }
15537
 
15538
    // isset id assignments
15539
 
15540
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
15541
    static {
15542
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15543
      tmpMap.put(_Fields.VOUCHER, new org.apache.thrift.meta_data.FieldMetaData("voucher", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15544
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
15545
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15546
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_args.class, metaDataMap);
15547
    }
15548
 
15549
    public addVoucher_args() {
15550
    }
15551
 
15552
    public addVoucher_args(
15553
      Voucher voucher)
15554
    {
15555
      this();
15556
      this.voucher = voucher;
15557
    }
15558
 
15559
    /**
15560
     * Performs a deep copy on <i>other</i>.
15561
     */
15562
    public addVoucher_args(addVoucher_args other) {
15563
      if (other.isSetVoucher()) {
15564
        this.voucher = new Voucher(other.voucher);
15565
      }
15566
    }
15567
 
15568
    public addVoucher_args deepCopy() {
15569
      return new addVoucher_args(this);
15570
    }
15571
 
15572
    @Override
15573
    public void clear() {
15574
      this.voucher = null;
15575
    }
15576
 
15577
    public Voucher getVoucher() {
15578
      return this.voucher;
15579
    }
15580
 
15581
    public void setVoucher(Voucher voucher) {
15582
      this.voucher = voucher;
15583
    }
15584
 
15585
    public void unsetVoucher() {
15586
      this.voucher = null;
15587
    }
15588
 
15589
    /** Returns true if field voucher is set (has been assigned a value) and false otherwise */
15590
    public boolean isSetVoucher() {
15591
      return this.voucher != null;
15592
    }
15593
 
15594
    public void setVoucherIsSet(boolean value) {
15595
      if (!value) {
15596
        this.voucher = null;
15597
      }
15598
    }
15599
 
15600
    public void setFieldValue(_Fields field, Object value) {
15601
      switch (field) {
15602
      case VOUCHER:
15603
        if (value == null) {
15604
          unsetVoucher();
15605
        } else {
15606
          setVoucher((Voucher)value);
15607
        }
15608
        break;
15609
 
15610
      }
15611
    }
15612
 
15613
    public Object getFieldValue(_Fields field) {
15614
      switch (field) {
15615
      case VOUCHER:
15616
        return getVoucher();
15617
 
15618
      }
15619
      throw new IllegalStateException();
15620
    }
15621
 
15622
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15623
    public boolean isSet(_Fields field) {
15624
      if (field == null) {
15625
        throw new IllegalArgumentException();
15626
      }
15627
 
15628
      switch (field) {
15629
      case VOUCHER:
15630
        return isSetVoucher();
15631
      }
15632
      throw new IllegalStateException();
15633
    }
15634
 
15635
    @Override
15636
    public boolean equals(Object that) {
15637
      if (that == null)
15638
        return false;
15639
      if (that instanceof addVoucher_args)
15640
        return this.equals((addVoucher_args)that);
15641
      return false;
15642
    }
15643
 
15644
    public boolean equals(addVoucher_args that) {
15645
      if (that == null)
15646
        return false;
15647
 
15648
      boolean this_present_voucher = true && this.isSetVoucher();
15649
      boolean that_present_voucher = true && that.isSetVoucher();
15650
      if (this_present_voucher || that_present_voucher) {
15651
        if (!(this_present_voucher && that_present_voucher))
15652
          return false;
15653
        if (!this.voucher.equals(that.voucher))
15654
          return false;
15655
      }
15656
 
15657
      return true;
15658
    }
15659
 
15660
    @Override
15661
    public int hashCode() {
15662
      return 0;
15663
    }
15664
 
15665
    public int compareTo(addVoucher_args other) {
15666
      if (!getClass().equals(other.getClass())) {
15667
        return getClass().getName().compareTo(other.getClass().getName());
15668
      }
15669
 
15670
      int lastComparison = 0;
15671
      addVoucher_args typedOther = (addVoucher_args)other;
15672
 
15673
      lastComparison = Boolean.valueOf(isSetVoucher()).compareTo(typedOther.isSetVoucher());
15674
      if (lastComparison != 0) {
15675
        return lastComparison;
15676
      }
15677
      if (isSetVoucher()) {
15678
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucher, typedOther.voucher);
15679
        if (lastComparison != 0) {
15680
          return lastComparison;
15681
        }
15682
      }
15683
      return 0;
15684
    }
15685
 
15686
    public _Fields fieldForId(int fieldId) {
15687
      return _Fields.findByThriftId(fieldId);
15688
    }
15689
 
15690
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15691
      org.apache.thrift.protocol.TField field;
15692
      iprot.readStructBegin();
15693
      while (true)
15694
      {
15695
        field = iprot.readFieldBegin();
15696
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
15697
          break;
15698
        }
15699
        switch (field.id) {
15700
          case 1: // VOUCHER
15701
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
15702
              this.voucher = new Voucher();
15703
              this.voucher.read(iprot);
15704
            } else { 
15705
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15706
            }
15707
            break;
15708
          default:
15709
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15710
        }
15711
        iprot.readFieldEnd();
15712
      }
15713
      iprot.readStructEnd();
15714
      validate();
15715
    }
15716
 
15717
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
15718
      validate();
15719
 
15720
      oprot.writeStructBegin(STRUCT_DESC);
15721
      if (this.voucher != null) {
15722
        oprot.writeFieldBegin(VOUCHER_FIELD_DESC);
15723
        this.voucher.write(oprot);
15724
        oprot.writeFieldEnd();
15725
      }
15726
      oprot.writeFieldStop();
15727
      oprot.writeStructEnd();
15728
    }
15729
 
15730
    @Override
15731
    public String toString() {
15732
      StringBuilder sb = new StringBuilder("addVoucher_args(");
15733
      boolean first = true;
15734
 
15735
      sb.append("voucher:");
15736
      if (this.voucher == null) {
15737
        sb.append("null");
15738
      } else {
15739
        sb.append(this.voucher);
15740
      }
15741
      first = false;
15742
      sb.append(")");
15743
      return sb.toString();
15744
    }
15745
 
15746
    public void validate() throws org.apache.thrift.TException {
15747
      // check for required fields
15748
    }
15749
 
15750
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15751
      try {
15752
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15753
      } catch (org.apache.thrift.TException te) {
15754
        throw new java.io.IOException(te);
15755
      }
15756
    }
15757
 
15758
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15759
      try {
15760
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15761
      } catch (org.apache.thrift.TException te) {
15762
        throw new java.io.IOException(te);
15763
      }
15764
    }
15765
 
15766
  }
15767
 
15768
  public static class addVoucher_result implements org.apache.thrift.TBase<addVoucher_result, addVoucher_result._Fields>, java.io.Serializable, Cloneable   {
15769
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_result");
15770
 
15771
 
15772
 
15773
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
15774
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
15775
;
15776
 
15777
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15778
 
15779
      static {
15780
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15781
          byName.put(field.getFieldName(), field);
15782
        }
15783
      }
15784
 
15785
      /**
15786
       * Find the _Fields constant that matches fieldId, or null if its not found.
15787
       */
15788
      public static _Fields findByThriftId(int fieldId) {
15789
        switch(fieldId) {
15790
          default:
15791
            return null;
15792
        }
15793
      }
15794
 
15795
      /**
15796
       * Find the _Fields constant that matches fieldId, throwing an exception
15797
       * if it is not found.
15798
       */
15799
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15800
        _Fields fields = findByThriftId(fieldId);
15801
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15802
        return fields;
15803
      }
15804
 
15805
      /**
15806
       * Find the _Fields constant that matches name, or null if its not found.
15807
       */
15808
      public static _Fields findByName(String name) {
15809
        return byName.get(name);
15810
      }
15811
 
15812
      private final short _thriftId;
15813
      private final String _fieldName;
15814
 
15815
      _Fields(short thriftId, String fieldName) {
15816
        _thriftId = thriftId;
15817
        _fieldName = fieldName;
15818
      }
15819
 
15820
      public short getThriftFieldId() {
15821
        return _thriftId;
15822
      }
15823
 
15824
      public String getFieldName() {
15825
        return _fieldName;
15826
      }
15827
    }
15828
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
15829
    static {
15830
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15831
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15832
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_result.class, metaDataMap);
15833
    }
15834
 
15835
    public addVoucher_result() {
15836
    }
15837
 
15838
    /**
15839
     * Performs a deep copy on <i>other</i>.
15840
     */
15841
    public addVoucher_result(addVoucher_result other) {
15842
    }
15843
 
15844
    public addVoucher_result deepCopy() {
15845
      return new addVoucher_result(this);
15846
    }
15847
 
15848
    @Override
15849
    public void clear() {
15850
    }
15851
 
15852
    public void setFieldValue(_Fields field, Object value) {
15853
      switch (field) {
15854
      }
15855
    }
15856
 
15857
    public Object getFieldValue(_Fields field) {
15858
      switch (field) {
15859
      }
15860
      throw new IllegalStateException();
15861
    }
15862
 
15863
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15864
    public boolean isSet(_Fields field) {
15865
      if (field == null) {
15866
        throw new IllegalArgumentException();
15867
      }
15868
 
15869
      switch (field) {
15870
      }
15871
      throw new IllegalStateException();
15872
    }
15873
 
15874
    @Override
15875
    public boolean equals(Object that) {
15876
      if (that == null)
15877
        return false;
15878
      if (that instanceof addVoucher_result)
15879
        return this.equals((addVoucher_result)that);
15880
      return false;
15881
    }
15882
 
15883
    public boolean equals(addVoucher_result that) {
15884
      if (that == null)
15885
        return false;
15886
 
15887
      return true;
15888
    }
15889
 
15890
    @Override
15891
    public int hashCode() {
15892
      return 0;
15893
    }
15894
 
15895
    public int compareTo(addVoucher_result other) {
15896
      if (!getClass().equals(other.getClass())) {
15897
        return getClass().getName().compareTo(other.getClass().getName());
15898
      }
15899
 
15900
      int lastComparison = 0;
15901
      addVoucher_result typedOther = (addVoucher_result)other;
15902
 
15903
      return 0;
15904
    }
15905
 
15906
    public _Fields fieldForId(int fieldId) {
15907
      return _Fields.findByThriftId(fieldId);
15908
    }
15909
 
15910
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15911
      org.apache.thrift.protocol.TField field;
15912
      iprot.readStructBegin();
15913
      while (true)
15914
      {
15915
        field = iprot.readFieldBegin();
15916
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
15917
          break;
15918
        }
15919
        switch (field.id) {
15920
          default:
15921
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15922
        }
15923
        iprot.readFieldEnd();
15924
      }
15925
      iprot.readStructEnd();
15926
      validate();
15927
    }
15928
 
15929
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
15930
      oprot.writeStructBegin(STRUCT_DESC);
15931
 
15932
      oprot.writeFieldStop();
15933
      oprot.writeStructEnd();
15934
    }
15935
 
15936
    @Override
15937
    public String toString() {
15938
      StringBuilder sb = new StringBuilder("addVoucher_result(");
15939
      boolean first = true;
15940
 
15941
      sb.append(")");
15942
      return sb.toString();
15943
    }
15944
 
15945
    public void validate() throws org.apache.thrift.TException {
15946
      // check for required fields
15947
    }
15948
 
15949
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15950
      try {
15951
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15952
      } catch (org.apache.thrift.TException te) {
15953
        throw new java.io.IOException(te);
15954
      }
15955
    }
15956
 
15957
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15958
      try {
15959
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15960
      } catch (org.apache.thrift.TException te) {
15961
        throw new java.io.IOException(te);
15962
      }
15963
    }
15964
 
15965
  }
15966
 
15967
  public static class assignVoucher_args implements org.apache.thrift.TBase<assignVoucher_args, assignVoucher_args._Fields>, java.io.Serializable, Cloneable   {
15968
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_args");
15969
 
15970
    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);
15971
    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);
15972
    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);
15973
    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);
15974
 
15975
    private long userId; // required
15976
    private String userEmail; // required
15977
    private VoucherType voucherType; // required
15978
    private long amount; // required
15979
 
15980
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
15981
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
15982
      USER_ID((short)1, "userId"),
15983
      USER_EMAIL((short)2, "userEmail"),
15984
      /**
15985
       * 
15986
       * @see VoucherType
15987
       */
15988
      VOUCHER_TYPE((short)3, "voucherType"),
15989
      AMOUNT((short)4, "amount");
15990
 
15991
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15992
 
15993
      static {
15994
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15995
          byName.put(field.getFieldName(), field);
15996
        }
15997
      }
15998
 
15999
      /**
16000
       * Find the _Fields constant that matches fieldId, or null if its not found.
16001
       */
16002
      public static _Fields findByThriftId(int fieldId) {
16003
        switch(fieldId) {
16004
          case 1: // USER_ID
16005
            return USER_ID;
16006
          case 2: // USER_EMAIL
16007
            return USER_EMAIL;
16008
          case 3: // VOUCHER_TYPE
16009
            return VOUCHER_TYPE;
16010
          case 4: // AMOUNT
16011
            return AMOUNT;
16012
          default:
16013
            return null;
16014
        }
16015
      }
16016
 
16017
      /**
16018
       * Find the _Fields constant that matches fieldId, throwing an exception
16019
       * if it is not found.
16020
       */
16021
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16022
        _Fields fields = findByThriftId(fieldId);
16023
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16024
        return fields;
16025
      }
16026
 
16027
      /**
16028
       * Find the _Fields constant that matches name, or null if its not found.
16029
       */
16030
      public static _Fields findByName(String name) {
16031
        return byName.get(name);
16032
      }
16033
 
16034
      private final short _thriftId;
16035
      private final String _fieldName;
16036
 
16037
      _Fields(short thriftId, String fieldName) {
16038
        _thriftId = thriftId;
16039
        _fieldName = fieldName;
16040
      }
16041
 
16042
      public short getThriftFieldId() {
16043
        return _thriftId;
16044
      }
16045
 
16046
      public String getFieldName() {
16047
        return _fieldName;
16048
      }
16049
    }
16050
 
16051
    // isset id assignments
16052
    private static final int __USERID_ISSET_ID = 0;
16053
    private static final int __AMOUNT_ISSET_ID = 1;
16054
    private BitSet __isset_bit_vector = new BitSet(2);
16055
 
16056
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
16057
    static {
16058
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16059
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16060
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
16061
      tmpMap.put(_Fields.USER_EMAIL, new org.apache.thrift.meta_data.FieldMetaData("userEmail", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16062
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
16063
      tmpMap.put(_Fields.VOUCHER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("voucherType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16064
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, VoucherType.class)));
16065
      tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16066
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
16067
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16068
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_args.class, metaDataMap);
16069
    }
16070
 
16071
    public assignVoucher_args() {
16072
    }
16073
 
16074
    public assignVoucher_args(
16075
      long userId,
16076
      String userEmail,
16077
      VoucherType voucherType,
16078
      long amount)
16079
    {
16080
      this();
16081
      this.userId = userId;
16082
      setUserIdIsSet(true);
16083
      this.userEmail = userEmail;
16084
      this.voucherType = voucherType;
16085
      this.amount = amount;
16086
      setAmountIsSet(true);
16087
    }
16088
 
16089
    /**
16090
     * Performs a deep copy on <i>other</i>.
16091
     */
16092
    public assignVoucher_args(assignVoucher_args other) {
16093
      __isset_bit_vector.clear();
16094
      __isset_bit_vector.or(other.__isset_bit_vector);
16095
      this.userId = other.userId;
16096
      if (other.isSetUserEmail()) {
16097
        this.userEmail = other.userEmail;
16098
      }
16099
      if (other.isSetVoucherType()) {
16100
        this.voucherType = other.voucherType;
16101
      }
16102
      this.amount = other.amount;
16103
    }
16104
 
16105
    public assignVoucher_args deepCopy() {
16106
      return new assignVoucher_args(this);
16107
    }
16108
 
16109
    @Override
16110
    public void clear() {
16111
      setUserIdIsSet(false);
16112
      this.userId = 0;
16113
      this.userEmail = null;
16114
      this.voucherType = null;
16115
      setAmountIsSet(false);
16116
      this.amount = 0;
16117
    }
16118
 
16119
    public long getUserId() {
16120
      return this.userId;
16121
    }
16122
 
16123
    public void setUserId(long userId) {
16124
      this.userId = userId;
16125
      setUserIdIsSet(true);
16126
    }
16127
 
16128
    public void unsetUserId() {
16129
      __isset_bit_vector.clear(__USERID_ISSET_ID);
16130
    }
16131
 
16132
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
16133
    public boolean isSetUserId() {
16134
      return __isset_bit_vector.get(__USERID_ISSET_ID);
16135
    }
16136
 
16137
    public void setUserIdIsSet(boolean value) {
16138
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
16139
    }
16140
 
16141
    public String getUserEmail() {
16142
      return this.userEmail;
16143
    }
16144
 
16145
    public void setUserEmail(String userEmail) {
16146
      this.userEmail = userEmail;
16147
    }
16148
 
16149
    public void unsetUserEmail() {
16150
      this.userEmail = null;
16151
    }
16152
 
16153
    /** Returns true if field userEmail is set (has been assigned a value) and false otherwise */
16154
    public boolean isSetUserEmail() {
16155
      return this.userEmail != null;
16156
    }
16157
 
16158
    public void setUserEmailIsSet(boolean value) {
16159
      if (!value) {
16160
        this.userEmail = null;
16161
      }
16162
    }
16163
 
16164
    /**
16165
     * 
16166
     * @see VoucherType
16167
     */
16168
    public VoucherType getVoucherType() {
16169
      return this.voucherType;
16170
    }
16171
 
16172
    /**
16173
     * 
16174
     * @see VoucherType
16175
     */
16176
    public void setVoucherType(VoucherType voucherType) {
16177
      this.voucherType = voucherType;
16178
    }
16179
 
16180
    public void unsetVoucherType() {
16181
      this.voucherType = null;
16182
    }
16183
 
16184
    /** Returns true if field voucherType is set (has been assigned a value) and false otherwise */
16185
    public boolean isSetVoucherType() {
16186
      return this.voucherType != null;
16187
    }
16188
 
16189
    public void setVoucherTypeIsSet(boolean value) {
16190
      if (!value) {
16191
        this.voucherType = null;
16192
      }
16193
    }
16194
 
16195
    public long getAmount() {
16196
      return this.amount;
16197
    }
16198
 
16199
    public void setAmount(long amount) {
16200
      this.amount = amount;
16201
      setAmountIsSet(true);
16202
    }
16203
 
16204
    public void unsetAmount() {
16205
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
16206
    }
16207
 
16208
    /** Returns true if field amount is set (has been assigned a value) and false otherwise */
16209
    public boolean isSetAmount() {
16210
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
16211
    }
16212
 
16213
    public void setAmountIsSet(boolean value) {
16214
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
16215
    }
16216
 
16217
    public void setFieldValue(_Fields field, Object value) {
16218
      switch (field) {
16219
      case USER_ID:
16220
        if (value == null) {
16221
          unsetUserId();
16222
        } else {
16223
          setUserId((Long)value);
16224
        }
16225
        break;
16226
 
16227
      case USER_EMAIL:
16228
        if (value == null) {
16229
          unsetUserEmail();
16230
        } else {
16231
          setUserEmail((String)value);
16232
        }
16233
        break;
16234
 
16235
      case VOUCHER_TYPE:
16236
        if (value == null) {
16237
          unsetVoucherType();
16238
        } else {
16239
          setVoucherType((VoucherType)value);
16240
        }
16241
        break;
16242
 
16243
      case AMOUNT:
16244
        if (value == null) {
16245
          unsetAmount();
16246
        } else {
16247
          setAmount((Long)value);
16248
        }
16249
        break;
16250
 
16251
      }
16252
    }
16253
 
16254
    public Object getFieldValue(_Fields field) {
16255
      switch (field) {
16256
      case USER_ID:
16257
        return Long.valueOf(getUserId());
16258
 
16259
      case USER_EMAIL:
16260
        return getUserEmail();
16261
 
16262
      case VOUCHER_TYPE:
16263
        return getVoucherType();
16264
 
16265
      case AMOUNT:
16266
        return Long.valueOf(getAmount());
16267
 
16268
      }
16269
      throw new IllegalStateException();
16270
    }
16271
 
16272
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16273
    public boolean isSet(_Fields field) {
16274
      if (field == null) {
16275
        throw new IllegalArgumentException();
16276
      }
16277
 
16278
      switch (field) {
16279
      case USER_ID:
16280
        return isSetUserId();
16281
      case USER_EMAIL:
16282
        return isSetUserEmail();
16283
      case VOUCHER_TYPE:
16284
        return isSetVoucherType();
16285
      case AMOUNT:
16286
        return isSetAmount();
16287
      }
16288
      throw new IllegalStateException();
16289
    }
16290
 
16291
    @Override
16292
    public boolean equals(Object that) {
16293
      if (that == null)
16294
        return false;
16295
      if (that instanceof assignVoucher_args)
16296
        return this.equals((assignVoucher_args)that);
16297
      return false;
16298
    }
16299
 
16300
    public boolean equals(assignVoucher_args that) {
16301
      if (that == null)
16302
        return false;
16303
 
16304
      boolean this_present_userId = true;
16305
      boolean that_present_userId = true;
16306
      if (this_present_userId || that_present_userId) {
16307
        if (!(this_present_userId && that_present_userId))
16308
          return false;
16309
        if (this.userId != that.userId)
16310
          return false;
16311
      }
16312
 
16313
      boolean this_present_userEmail = true && this.isSetUserEmail();
16314
      boolean that_present_userEmail = true && that.isSetUserEmail();
16315
      if (this_present_userEmail || that_present_userEmail) {
16316
        if (!(this_present_userEmail && that_present_userEmail))
16317
          return false;
16318
        if (!this.userEmail.equals(that.userEmail))
16319
          return false;
16320
      }
16321
 
16322
      boolean this_present_voucherType = true && this.isSetVoucherType();
16323
      boolean that_present_voucherType = true && that.isSetVoucherType();
16324
      if (this_present_voucherType || that_present_voucherType) {
16325
        if (!(this_present_voucherType && that_present_voucherType))
16326
          return false;
16327
        if (!this.voucherType.equals(that.voucherType))
16328
          return false;
16329
      }
16330
 
16331
      boolean this_present_amount = true;
16332
      boolean that_present_amount = true;
16333
      if (this_present_amount || that_present_amount) {
16334
        if (!(this_present_amount && that_present_amount))
16335
          return false;
16336
        if (this.amount != that.amount)
16337
          return false;
16338
      }
16339
 
16340
      return true;
16341
    }
16342
 
16343
    @Override
16344
    public int hashCode() {
16345
      return 0;
16346
    }
16347
 
16348
    public int compareTo(assignVoucher_args other) {
16349
      if (!getClass().equals(other.getClass())) {
16350
        return getClass().getName().compareTo(other.getClass().getName());
16351
      }
16352
 
16353
      int lastComparison = 0;
16354
      assignVoucher_args typedOther = (assignVoucher_args)other;
16355
 
16356
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
16357
      if (lastComparison != 0) {
16358
        return lastComparison;
16359
      }
16360
      if (isSetUserId()) {
16361
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
16362
        if (lastComparison != 0) {
16363
          return lastComparison;
16364
        }
16365
      }
16366
      lastComparison = Boolean.valueOf(isSetUserEmail()).compareTo(typedOther.isSetUserEmail());
16367
      if (lastComparison != 0) {
16368
        return lastComparison;
16369
      }
16370
      if (isSetUserEmail()) {
16371
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userEmail, typedOther.userEmail);
16372
        if (lastComparison != 0) {
16373
          return lastComparison;
16374
        }
16375
      }
16376
      lastComparison = Boolean.valueOf(isSetVoucherType()).compareTo(typedOther.isSetVoucherType());
16377
      if (lastComparison != 0) {
16378
        return lastComparison;
16379
      }
16380
      if (isSetVoucherType()) {
16381
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherType, typedOther.voucherType);
16382
        if (lastComparison != 0) {
16383
          return lastComparison;
16384
        }
16385
      }
16386
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
16387
      if (lastComparison != 0) {
16388
        return lastComparison;
16389
      }
16390
      if (isSetAmount()) {
16391
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
16392
        if (lastComparison != 0) {
16393
          return lastComparison;
16394
        }
16395
      }
16396
      return 0;
16397
    }
16398
 
16399
    public _Fields fieldForId(int fieldId) {
16400
      return _Fields.findByThriftId(fieldId);
16401
    }
16402
 
16403
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16404
      org.apache.thrift.protocol.TField field;
16405
      iprot.readStructBegin();
16406
      while (true)
16407
      {
16408
        field = iprot.readFieldBegin();
16409
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
16410
          break;
16411
        }
16412
        switch (field.id) {
16413
          case 1: // USER_ID
16414
            if (field.type == org.apache.thrift.protocol.TType.I64) {
16415
              this.userId = iprot.readI64();
16416
              setUserIdIsSet(true);
16417
            } else { 
16418
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16419
            }
16420
            break;
16421
          case 2: // USER_EMAIL
16422
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
16423
              this.userEmail = iprot.readString();
16424
            } else { 
16425
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16426
            }
16427
            break;
16428
          case 3: // VOUCHER_TYPE
16429
            if (field.type == org.apache.thrift.protocol.TType.I32) {
16430
              this.voucherType = VoucherType.findByValue(iprot.readI32());
16431
            } else { 
16432
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16433
            }
16434
            break;
16435
          case 4: // AMOUNT
16436
            if (field.type == org.apache.thrift.protocol.TType.I64) {
16437
              this.amount = iprot.readI64();
16438
              setAmountIsSet(true);
16439
            } else { 
16440
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16441
            }
16442
            break;
16443
          default:
16444
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16445
        }
16446
        iprot.readFieldEnd();
16447
      }
16448
      iprot.readStructEnd();
16449
      validate();
16450
    }
16451
 
16452
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
16453
      validate();
16454
 
16455
      oprot.writeStructBegin(STRUCT_DESC);
16456
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
16457
      oprot.writeI64(this.userId);
16458
      oprot.writeFieldEnd();
16459
      if (this.userEmail != null) {
16460
        oprot.writeFieldBegin(USER_EMAIL_FIELD_DESC);
16461
        oprot.writeString(this.userEmail);
16462
        oprot.writeFieldEnd();
16463
      }
16464
      if (this.voucherType != null) {
16465
        oprot.writeFieldBegin(VOUCHER_TYPE_FIELD_DESC);
16466
        oprot.writeI32(this.voucherType.getValue());
16467
        oprot.writeFieldEnd();
16468
      }
16469
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
16470
      oprot.writeI64(this.amount);
16471
      oprot.writeFieldEnd();
16472
      oprot.writeFieldStop();
16473
      oprot.writeStructEnd();
16474
    }
16475
 
16476
    @Override
16477
    public String toString() {
16478
      StringBuilder sb = new StringBuilder("assignVoucher_args(");
16479
      boolean first = true;
16480
 
16481
      sb.append("userId:");
16482
      sb.append(this.userId);
16483
      first = false;
16484
      if (!first) sb.append(", ");
16485
      sb.append("userEmail:");
16486
      if (this.userEmail == null) {
16487
        sb.append("null");
16488
      } else {
16489
        sb.append(this.userEmail);
16490
      }
16491
      first = false;
16492
      if (!first) sb.append(", ");
16493
      sb.append("voucherType:");
16494
      if (this.voucherType == null) {
16495
        sb.append("null");
16496
      } else {
16497
        sb.append(this.voucherType);
16498
      }
16499
      first = false;
16500
      if (!first) sb.append(", ");
16501
      sb.append("amount:");
16502
      sb.append(this.amount);
16503
      first = false;
16504
      sb.append(")");
16505
      return sb.toString();
16506
    }
16507
 
16508
    public void validate() throws org.apache.thrift.TException {
16509
      // check for required fields
16510
    }
16511
 
16512
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16513
      try {
16514
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16515
      } catch (org.apache.thrift.TException te) {
16516
        throw new java.io.IOException(te);
16517
      }
16518
    }
16519
 
16520
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16521
      try {
16522
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
16523
        __isset_bit_vector = new BitSet(1);
16524
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16525
      } catch (org.apache.thrift.TException te) {
16526
        throw new java.io.IOException(te);
16527
      }
16528
    }
16529
 
16530
  }
16531
 
16532
  public static class assignVoucher_result implements org.apache.thrift.TBase<assignVoucher_result, assignVoucher_result._Fields>, java.io.Serializable, Cloneable   {
16533
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_result");
16534
 
16535
    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);
16536
 
16537
    private Voucher success; // required
16538
 
16539
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
16540
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
16541
      SUCCESS((short)0, "success");
16542
 
16543
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16544
 
16545
      static {
16546
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16547
          byName.put(field.getFieldName(), field);
16548
        }
16549
      }
16550
 
16551
      /**
16552
       * Find the _Fields constant that matches fieldId, or null if its not found.
16553
       */
16554
      public static _Fields findByThriftId(int fieldId) {
16555
        switch(fieldId) {
16556
          case 0: // SUCCESS
16557
            return SUCCESS;
16558
          default:
16559
            return null;
16560
        }
16561
      }
16562
 
16563
      /**
16564
       * Find the _Fields constant that matches fieldId, throwing an exception
16565
       * if it is not found.
16566
       */
16567
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16568
        _Fields fields = findByThriftId(fieldId);
16569
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16570
        return fields;
16571
      }
16572
 
16573
      /**
16574
       * Find the _Fields constant that matches name, or null if its not found.
16575
       */
16576
      public static _Fields findByName(String name) {
16577
        return byName.get(name);
16578
      }
16579
 
16580
      private final short _thriftId;
16581
      private final String _fieldName;
16582
 
16583
      _Fields(short thriftId, String fieldName) {
16584
        _thriftId = thriftId;
16585
        _fieldName = fieldName;
16586
      }
16587
 
16588
      public short getThriftFieldId() {
16589
        return _thriftId;
16590
      }
16591
 
16592
      public String getFieldName() {
16593
        return _fieldName;
16594
      }
16595
    }
16596
 
16597
    // isset id assignments
16598
 
16599
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
16600
    static {
16601
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16602
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16603
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
16604
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16605
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_result.class, metaDataMap);
16606
    }
16607
 
16608
    public assignVoucher_result() {
16609
    }
16610
 
16611
    public assignVoucher_result(
16612
      Voucher success)
16613
    {
16614
      this();
16615
      this.success = success;
16616
    }
16617
 
16618
    /**
16619
     * Performs a deep copy on <i>other</i>.
16620
     */
16621
    public assignVoucher_result(assignVoucher_result other) {
16622
      if (other.isSetSuccess()) {
16623
        this.success = new Voucher(other.success);
16624
      }
16625
    }
16626
 
16627
    public assignVoucher_result deepCopy() {
16628
      return new assignVoucher_result(this);
16629
    }
16630
 
16631
    @Override
16632
    public void clear() {
16633
      this.success = null;
16634
    }
16635
 
16636
    public Voucher getSuccess() {
16637
      return this.success;
16638
    }
16639
 
16640
    public void setSuccess(Voucher success) {
16641
      this.success = success;
16642
    }
16643
 
16644
    public void unsetSuccess() {
16645
      this.success = null;
16646
    }
16647
 
16648
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
16649
    public boolean isSetSuccess() {
16650
      return this.success != null;
16651
    }
16652
 
16653
    public void setSuccessIsSet(boolean value) {
16654
      if (!value) {
16655
        this.success = null;
16656
      }
16657
    }
16658
 
16659
    public void setFieldValue(_Fields field, Object value) {
16660
      switch (field) {
16661
      case SUCCESS:
16662
        if (value == null) {
16663
          unsetSuccess();
16664
        } else {
16665
          setSuccess((Voucher)value);
16666
        }
16667
        break;
16668
 
16669
      }
16670
    }
16671
 
16672
    public Object getFieldValue(_Fields field) {
16673
      switch (field) {
16674
      case SUCCESS:
16675
        return getSuccess();
16676
 
16677
      }
16678
      throw new IllegalStateException();
16679
    }
16680
 
16681
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16682
    public boolean isSet(_Fields field) {
16683
      if (field == null) {
16684
        throw new IllegalArgumentException();
16685
      }
16686
 
16687
      switch (field) {
16688
      case SUCCESS:
16689
        return isSetSuccess();
16690
      }
16691
      throw new IllegalStateException();
16692
    }
16693
 
16694
    @Override
16695
    public boolean equals(Object that) {
16696
      if (that == null)
16697
        return false;
16698
      if (that instanceof assignVoucher_result)
16699
        return this.equals((assignVoucher_result)that);
16700
      return false;
16701
    }
16702
 
16703
    public boolean equals(assignVoucher_result that) {
16704
      if (that == null)
16705
        return false;
16706
 
16707
      boolean this_present_success = true && this.isSetSuccess();
16708
      boolean that_present_success = true && that.isSetSuccess();
16709
      if (this_present_success || that_present_success) {
16710
        if (!(this_present_success && that_present_success))
16711
          return false;
16712
        if (!this.success.equals(that.success))
16713
          return false;
16714
      }
16715
 
16716
      return true;
16717
    }
16718
 
16719
    @Override
16720
    public int hashCode() {
16721
      return 0;
16722
    }
16723
 
16724
    public int compareTo(assignVoucher_result other) {
16725
      if (!getClass().equals(other.getClass())) {
16726
        return getClass().getName().compareTo(other.getClass().getName());
16727
      }
16728
 
16729
      int lastComparison = 0;
16730
      assignVoucher_result typedOther = (assignVoucher_result)other;
16731
 
16732
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
16733
      if (lastComparison != 0) {
16734
        return lastComparison;
16735
      }
16736
      if (isSetSuccess()) {
16737
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
16738
        if (lastComparison != 0) {
16739
          return lastComparison;
16740
        }
16741
      }
16742
      return 0;
16743
    }
16744
 
16745
    public _Fields fieldForId(int fieldId) {
16746
      return _Fields.findByThriftId(fieldId);
16747
    }
16748
 
16749
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16750
      org.apache.thrift.protocol.TField field;
16751
      iprot.readStructBegin();
16752
      while (true)
16753
      {
16754
        field = iprot.readFieldBegin();
16755
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
16756
          break;
16757
        }
16758
        switch (field.id) {
16759
          case 0: // SUCCESS
16760
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
16761
              this.success = new Voucher();
16762
              this.success.read(iprot);
16763
            } else { 
16764
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16765
            }
16766
            break;
16767
          default:
16768
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16769
        }
16770
        iprot.readFieldEnd();
16771
      }
16772
      iprot.readStructEnd();
16773
      validate();
16774
    }
16775
 
16776
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
16777
      oprot.writeStructBegin(STRUCT_DESC);
16778
 
16779
      if (this.isSetSuccess()) {
16780
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
16781
        this.success.write(oprot);
16782
        oprot.writeFieldEnd();
16783
      }
16784
      oprot.writeFieldStop();
16785
      oprot.writeStructEnd();
16786
    }
16787
 
16788
    @Override
16789
    public String toString() {
16790
      StringBuilder sb = new StringBuilder("assignVoucher_result(");
16791
      boolean first = true;
16792
 
16793
      sb.append("success:");
16794
      if (this.success == null) {
16795
        sb.append("null");
16796
      } else {
16797
        sb.append(this.success);
16798
      }
16799
      first = false;
16800
      sb.append(")");
16801
      return sb.toString();
16802
    }
16803
 
16804
    public void validate() throws org.apache.thrift.TException {
16805
      // check for required fields
16806
    }
16807
 
16808
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16809
      try {
16810
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16811
      } catch (org.apache.thrift.TException te) {
16812
        throw new java.io.IOException(te);
16813
      }
16814
    }
16815
 
16816
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16817
      try {
16818
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16819
      } catch (org.apache.thrift.TException te) {
16820
        throw new java.io.IOException(te);
16821
      }
16822
    }
16823
 
16824
  }
16825
 
16826
  public static class markVoucherAsRedeemed_args implements org.apache.thrift.TBase<markVoucherAsRedeemed_args, markVoucherAsRedeemed_args._Fields>, java.io.Serializable, Cloneable   {
16827
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_args");
16828
 
16829
    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);
16830
    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);
16831
 
16832
    private String voucherCode; // required
16833
    private long redeemedOn; // required
16834
 
16835
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
16836
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
16837
      VOUCHER_CODE((short)1, "voucherCode"),
16838
      REDEEMED_ON((short)2, "redeemedOn");
16839
 
16840
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16841
 
16842
      static {
16843
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16844
          byName.put(field.getFieldName(), field);
16845
        }
16846
      }
16847
 
16848
      /**
16849
       * Find the _Fields constant that matches fieldId, or null if its not found.
16850
       */
16851
      public static _Fields findByThriftId(int fieldId) {
16852
        switch(fieldId) {
16853
          case 1: // VOUCHER_CODE
16854
            return VOUCHER_CODE;
16855
          case 2: // REDEEMED_ON
16856
            return REDEEMED_ON;
16857
          default:
16858
            return null;
16859
        }
16860
      }
16861
 
16862
      /**
16863
       * Find the _Fields constant that matches fieldId, throwing an exception
16864
       * if it is not found.
16865
       */
16866
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16867
        _Fields fields = findByThriftId(fieldId);
16868
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16869
        return fields;
16870
      }
16871
 
16872
      /**
16873
       * Find the _Fields constant that matches name, or null if its not found.
16874
       */
16875
      public static _Fields findByName(String name) {
16876
        return byName.get(name);
16877
      }
16878
 
16879
      private final short _thriftId;
16880
      private final String _fieldName;
16881
 
16882
      _Fields(short thriftId, String fieldName) {
16883
        _thriftId = thriftId;
16884
        _fieldName = fieldName;
16885
      }
16886
 
16887
      public short getThriftFieldId() {
16888
        return _thriftId;
16889
      }
16890
 
16891
      public String getFieldName() {
16892
        return _fieldName;
16893
      }
16894
    }
16895
 
16896
    // isset id assignments
16897
    private static final int __REDEEMEDON_ISSET_ID = 0;
16898
    private BitSet __isset_bit_vector = new BitSet(1);
16899
 
16900
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
16901
    static {
16902
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16903
      tmpMap.put(_Fields.VOUCHER_CODE, new org.apache.thrift.meta_data.FieldMetaData("voucherCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16904
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
16905
      tmpMap.put(_Fields.REDEEMED_ON, new org.apache.thrift.meta_data.FieldMetaData("redeemedOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16906
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
16907
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16908
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_args.class, metaDataMap);
16909
    }
16910
 
16911
    public markVoucherAsRedeemed_args() {
16912
    }
16913
 
16914
    public markVoucherAsRedeemed_args(
16915
      String voucherCode,
16916
      long redeemedOn)
16917
    {
16918
      this();
16919
      this.voucherCode = voucherCode;
16920
      this.redeemedOn = redeemedOn;
16921
      setRedeemedOnIsSet(true);
16922
    }
16923
 
16924
    /**
16925
     * Performs a deep copy on <i>other</i>.
16926
     */
16927
    public markVoucherAsRedeemed_args(markVoucherAsRedeemed_args other) {
16928
      __isset_bit_vector.clear();
16929
      __isset_bit_vector.or(other.__isset_bit_vector);
16930
      if (other.isSetVoucherCode()) {
16931
        this.voucherCode = other.voucherCode;
16932
      }
16933
      this.redeemedOn = other.redeemedOn;
16934
    }
16935
 
16936
    public markVoucherAsRedeemed_args deepCopy() {
16937
      return new markVoucherAsRedeemed_args(this);
16938
    }
16939
 
16940
    @Override
16941
    public void clear() {
16942
      this.voucherCode = null;
16943
      setRedeemedOnIsSet(false);
16944
      this.redeemedOn = 0;
16945
    }
16946
 
16947
    public String getVoucherCode() {
16948
      return this.voucherCode;
16949
    }
16950
 
16951
    public void setVoucherCode(String voucherCode) {
16952
      this.voucherCode = voucherCode;
16953
    }
16954
 
16955
    public void unsetVoucherCode() {
16956
      this.voucherCode = null;
16957
    }
16958
 
16959
    /** Returns true if field voucherCode is set (has been assigned a value) and false otherwise */
16960
    public boolean isSetVoucherCode() {
16961
      return this.voucherCode != null;
16962
    }
16963
 
16964
    public void setVoucherCodeIsSet(boolean value) {
16965
      if (!value) {
16966
        this.voucherCode = null;
16967
      }
16968
    }
16969
 
16970
    public long getRedeemedOn() {
16971
      return this.redeemedOn;
16972
    }
16973
 
16974
    public void setRedeemedOn(long redeemedOn) {
16975
      this.redeemedOn = redeemedOn;
16976
      setRedeemedOnIsSet(true);
16977
    }
16978
 
16979
    public void unsetRedeemedOn() {
16980
      __isset_bit_vector.clear(__REDEEMEDON_ISSET_ID);
16981
    }
16982
 
16983
    /** Returns true if field redeemedOn is set (has been assigned a value) and false otherwise */
16984
    public boolean isSetRedeemedOn() {
16985
      return __isset_bit_vector.get(__REDEEMEDON_ISSET_ID);
16986
    }
16987
 
16988
    public void setRedeemedOnIsSet(boolean value) {
16989
      __isset_bit_vector.set(__REDEEMEDON_ISSET_ID, value);
16990
    }
16991
 
16992
    public void setFieldValue(_Fields field, Object value) {
16993
      switch (field) {
16994
      case VOUCHER_CODE:
16995
        if (value == null) {
16996
          unsetVoucherCode();
16997
        } else {
16998
          setVoucherCode((String)value);
16999
        }
17000
        break;
17001
 
17002
      case REDEEMED_ON:
17003
        if (value == null) {
17004
          unsetRedeemedOn();
17005
        } else {
17006
          setRedeemedOn((Long)value);
17007
        }
17008
        break;
17009
 
17010
      }
17011
    }
17012
 
17013
    public Object getFieldValue(_Fields field) {
17014
      switch (field) {
17015
      case VOUCHER_CODE:
17016
        return getVoucherCode();
17017
 
17018
      case REDEEMED_ON:
17019
        return Long.valueOf(getRedeemedOn());
17020
 
17021
      }
17022
      throw new IllegalStateException();
17023
    }
17024
 
17025
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
17026
    public boolean isSet(_Fields field) {
17027
      if (field == null) {
17028
        throw new IllegalArgumentException();
17029
      }
17030
 
17031
      switch (field) {
17032
      case VOUCHER_CODE:
17033
        return isSetVoucherCode();
17034
      case REDEEMED_ON:
17035
        return isSetRedeemedOn();
17036
      }
17037
      throw new IllegalStateException();
17038
    }
17039
 
17040
    @Override
17041
    public boolean equals(Object that) {
17042
      if (that == null)
17043
        return false;
17044
      if (that instanceof markVoucherAsRedeemed_args)
17045
        return this.equals((markVoucherAsRedeemed_args)that);
17046
      return false;
17047
    }
17048
 
17049
    public boolean equals(markVoucherAsRedeemed_args that) {
17050
      if (that == null)
17051
        return false;
17052
 
17053
      boolean this_present_voucherCode = true && this.isSetVoucherCode();
17054
      boolean that_present_voucherCode = true && that.isSetVoucherCode();
17055
      if (this_present_voucherCode || that_present_voucherCode) {
17056
        if (!(this_present_voucherCode && that_present_voucherCode))
17057
          return false;
17058
        if (!this.voucherCode.equals(that.voucherCode))
17059
          return false;
17060
      }
17061
 
17062
      boolean this_present_redeemedOn = true;
17063
      boolean that_present_redeemedOn = true;
17064
      if (this_present_redeemedOn || that_present_redeemedOn) {
17065
        if (!(this_present_redeemedOn && that_present_redeemedOn))
17066
          return false;
17067
        if (this.redeemedOn != that.redeemedOn)
17068
          return false;
17069
      }
17070
 
17071
      return true;
17072
    }
17073
 
17074
    @Override
17075
    public int hashCode() {
17076
      return 0;
17077
    }
17078
 
17079
    public int compareTo(markVoucherAsRedeemed_args other) {
17080
      if (!getClass().equals(other.getClass())) {
17081
        return getClass().getName().compareTo(other.getClass().getName());
17082
      }
17083
 
17084
      int lastComparison = 0;
17085
      markVoucherAsRedeemed_args typedOther = (markVoucherAsRedeemed_args)other;
17086
 
17087
      lastComparison = Boolean.valueOf(isSetVoucherCode()).compareTo(typedOther.isSetVoucherCode());
17088
      if (lastComparison != 0) {
17089
        return lastComparison;
17090
      }
17091
      if (isSetVoucherCode()) {
17092
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherCode, typedOther.voucherCode);
17093
        if (lastComparison != 0) {
17094
          return lastComparison;
17095
        }
17096
      }
17097
      lastComparison = Boolean.valueOf(isSetRedeemedOn()).compareTo(typedOther.isSetRedeemedOn());
17098
      if (lastComparison != 0) {
17099
        return lastComparison;
17100
      }
17101
      if (isSetRedeemedOn()) {
17102
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.redeemedOn, typedOther.redeemedOn);
17103
        if (lastComparison != 0) {
17104
          return lastComparison;
17105
        }
17106
      }
17107
      return 0;
17108
    }
17109
 
17110
    public _Fields fieldForId(int fieldId) {
17111
      return _Fields.findByThriftId(fieldId);
17112
    }
17113
 
17114
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17115
      org.apache.thrift.protocol.TField field;
17116
      iprot.readStructBegin();
17117
      while (true)
17118
      {
17119
        field = iprot.readFieldBegin();
17120
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17121
          break;
17122
        }
17123
        switch (field.id) {
17124
          case 1: // VOUCHER_CODE
17125
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
17126
              this.voucherCode = iprot.readString();
17127
            } else { 
17128
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17129
            }
17130
            break;
17131
          case 2: // REDEEMED_ON
17132
            if (field.type == org.apache.thrift.protocol.TType.I64) {
17133
              this.redeemedOn = iprot.readI64();
17134
              setRedeemedOnIsSet(true);
17135
            } else { 
17136
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17137
            }
17138
            break;
17139
          default:
17140
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17141
        }
17142
        iprot.readFieldEnd();
17143
      }
17144
      iprot.readStructEnd();
17145
      validate();
17146
    }
17147
 
17148
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17149
      validate();
17150
 
17151
      oprot.writeStructBegin(STRUCT_DESC);
17152
      if (this.voucherCode != null) {
17153
        oprot.writeFieldBegin(VOUCHER_CODE_FIELD_DESC);
17154
        oprot.writeString(this.voucherCode);
17155
        oprot.writeFieldEnd();
17156
      }
17157
      oprot.writeFieldBegin(REDEEMED_ON_FIELD_DESC);
17158
      oprot.writeI64(this.redeemedOn);
17159
      oprot.writeFieldEnd();
17160
      oprot.writeFieldStop();
17161
      oprot.writeStructEnd();
17162
    }
17163
 
17164
    @Override
17165
    public String toString() {
17166
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_args(");
17167
      boolean first = true;
17168
 
17169
      sb.append("voucherCode:");
17170
      if (this.voucherCode == null) {
17171
        sb.append("null");
17172
      } else {
17173
        sb.append(this.voucherCode);
17174
      }
17175
      first = false;
17176
      if (!first) sb.append(", ");
17177
      sb.append("redeemedOn:");
17178
      sb.append(this.redeemedOn);
17179
      first = false;
17180
      sb.append(")");
17181
      return sb.toString();
17182
    }
17183
 
17184
    public void validate() throws org.apache.thrift.TException {
17185
      // check for required fields
17186
    }
17187
 
17188
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17189
      try {
17190
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17191
      } catch (org.apache.thrift.TException te) {
17192
        throw new java.io.IOException(te);
17193
      }
17194
    }
17195
 
17196
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
17197
      try {
17198
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
17199
        __isset_bit_vector = new BitSet(1);
17200
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
17201
      } catch (org.apache.thrift.TException te) {
17202
        throw new java.io.IOException(te);
17203
      }
17204
    }
17205
 
17206
  }
17207
 
17208
  public static class markVoucherAsRedeemed_result implements org.apache.thrift.TBase<markVoucherAsRedeemed_result, markVoucherAsRedeemed_result._Fields>, java.io.Serializable, Cloneable   {
17209
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_result");
17210
 
17211
    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);
17212
 
17213
    private boolean success; // required
17214
 
17215
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
17216
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
17217
      SUCCESS((short)0, "success");
17218
 
17219
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
17220
 
17221
      static {
17222
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
17223
          byName.put(field.getFieldName(), field);
17224
        }
17225
      }
17226
 
17227
      /**
17228
       * Find the _Fields constant that matches fieldId, or null if its not found.
17229
       */
17230
      public static _Fields findByThriftId(int fieldId) {
17231
        switch(fieldId) {
17232
          case 0: // SUCCESS
17233
            return SUCCESS;
17234
          default:
17235
            return null;
17236
        }
17237
      }
17238
 
17239
      /**
17240
       * Find the _Fields constant that matches fieldId, throwing an exception
17241
       * if it is not found.
17242
       */
17243
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17244
        _Fields fields = findByThriftId(fieldId);
17245
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17246
        return fields;
17247
      }
17248
 
17249
      /**
17250
       * Find the _Fields constant that matches name, or null if its not found.
17251
       */
17252
      public static _Fields findByName(String name) {
17253
        return byName.get(name);
17254
      }
17255
 
17256
      private final short _thriftId;
17257
      private final String _fieldName;
17258
 
17259
      _Fields(short thriftId, String fieldName) {
17260
        _thriftId = thriftId;
17261
        _fieldName = fieldName;
17262
      }
17263
 
17264
      public short getThriftFieldId() {
17265
        return _thriftId;
17266
      }
17267
 
17268
      public String getFieldName() {
17269
        return _fieldName;
17270
      }
17271
    }
17272
 
17273
    // isset id assignments
17274
    private static final int __SUCCESS_ISSET_ID = 0;
17275
    private BitSet __isset_bit_vector = new BitSet(1);
17276
 
17277
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
17278
    static {
17279
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
17280
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17281
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
17282
      metaDataMap = Collections.unmodifiableMap(tmpMap);
17283
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_result.class, metaDataMap);
17284
    }
17285
 
17286
    public markVoucherAsRedeemed_result() {
17287
    }
17288
 
17289
    public markVoucherAsRedeemed_result(
17290
      boolean success)
17291
    {
17292
      this();
17293
      this.success = success;
17294
      setSuccessIsSet(true);
17295
    }
17296
 
17297
    /**
17298
     * Performs a deep copy on <i>other</i>.
17299
     */
17300
    public markVoucherAsRedeemed_result(markVoucherAsRedeemed_result other) {
17301
      __isset_bit_vector.clear();
17302
      __isset_bit_vector.or(other.__isset_bit_vector);
17303
      this.success = other.success;
17304
    }
17305
 
17306
    public markVoucherAsRedeemed_result deepCopy() {
17307
      return new markVoucherAsRedeemed_result(this);
17308
    }
17309
 
17310
    @Override
17311
    public void clear() {
17312
      setSuccessIsSet(false);
17313
      this.success = false;
17314
    }
17315
 
17316
    public boolean isSuccess() {
17317
      return this.success;
17318
    }
17319
 
17320
    public void setSuccess(boolean success) {
17321
      this.success = success;
17322
      setSuccessIsSet(true);
17323
    }
17324
 
17325
    public void unsetSuccess() {
17326
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
17327
    }
17328
 
17329
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
17330
    public boolean isSetSuccess() {
17331
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
17332
    }
17333
 
17334
    public void setSuccessIsSet(boolean value) {
17335
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
17336
    }
17337
 
17338
    public void setFieldValue(_Fields field, Object value) {
17339
      switch (field) {
17340
      case SUCCESS:
17341
        if (value == null) {
17342
          unsetSuccess();
17343
        } else {
17344
          setSuccess((Boolean)value);
17345
        }
17346
        break;
17347
 
17348
      }
17349
    }
17350
 
17351
    public Object getFieldValue(_Fields field) {
17352
      switch (field) {
17353
      case SUCCESS:
17354
        return Boolean.valueOf(isSuccess());
17355
 
17356
      }
17357
      throw new IllegalStateException();
17358
    }
17359
 
17360
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
17361
    public boolean isSet(_Fields field) {
17362
      if (field == null) {
17363
        throw new IllegalArgumentException();
17364
      }
17365
 
17366
      switch (field) {
17367
      case SUCCESS:
17368
        return isSetSuccess();
17369
      }
17370
      throw new IllegalStateException();
17371
    }
17372
 
17373
    @Override
17374
    public boolean equals(Object that) {
17375
      if (that == null)
17376
        return false;
17377
      if (that instanceof markVoucherAsRedeemed_result)
17378
        return this.equals((markVoucherAsRedeemed_result)that);
17379
      return false;
17380
    }
17381
 
17382
    public boolean equals(markVoucherAsRedeemed_result that) {
17383
      if (that == null)
17384
        return false;
17385
 
17386
      boolean this_present_success = true;
17387
      boolean that_present_success = true;
17388
      if (this_present_success || that_present_success) {
17389
        if (!(this_present_success && that_present_success))
17390
          return false;
17391
        if (this.success != that.success)
17392
          return false;
17393
      }
17394
 
17395
      return true;
17396
    }
17397
 
17398
    @Override
17399
    public int hashCode() {
17400
      return 0;
17401
    }
17402
 
17403
    public int compareTo(markVoucherAsRedeemed_result other) {
17404
      if (!getClass().equals(other.getClass())) {
17405
        return getClass().getName().compareTo(other.getClass().getName());
17406
      }
17407
 
17408
      int lastComparison = 0;
17409
      markVoucherAsRedeemed_result typedOther = (markVoucherAsRedeemed_result)other;
17410
 
17411
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
17412
      if (lastComparison != 0) {
17413
        return lastComparison;
17414
      }
17415
      if (isSetSuccess()) {
17416
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
17417
        if (lastComparison != 0) {
17418
          return lastComparison;
17419
        }
17420
      }
17421
      return 0;
17422
    }
17423
 
17424
    public _Fields fieldForId(int fieldId) {
17425
      return _Fields.findByThriftId(fieldId);
17426
    }
17427
 
17428
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17429
      org.apache.thrift.protocol.TField field;
17430
      iprot.readStructBegin();
17431
      while (true)
17432
      {
17433
        field = iprot.readFieldBegin();
17434
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17435
          break;
17436
        }
17437
        switch (field.id) {
17438
          case 0: // SUCCESS
17439
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
17440
              this.success = iprot.readBool();
17441
              setSuccessIsSet(true);
17442
            } else { 
17443
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17444
            }
17445
            break;
17446
          default:
17447
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17448
        }
17449
        iprot.readFieldEnd();
17450
      }
17451
      iprot.readStructEnd();
17452
      validate();
17453
    }
17454
 
17455
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17456
      oprot.writeStructBegin(STRUCT_DESC);
17457
 
17458
      if (this.isSetSuccess()) {
17459
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
17460
        oprot.writeBool(this.success);
17461
        oprot.writeFieldEnd();
17462
      }
17463
      oprot.writeFieldStop();
17464
      oprot.writeStructEnd();
17465
    }
17466
 
17467
    @Override
17468
    public String toString() {
17469
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_result(");
17470
      boolean first = true;
17471
 
17472
      sb.append("success:");
17473
      sb.append(this.success);
17474
      first = false;
17475
      sb.append(")");
17476
      return sb.toString();
17477
    }
17478
 
17479
    public void validate() throws org.apache.thrift.TException {
17480
      // check for required fields
17481
    }
17482
 
17483
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17484
      try {
17485
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17486
      } catch (org.apache.thrift.TException te) {
17487
        throw new java.io.IOException(te);
17488
      }
17489
    }
17490
 
17491
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
17492
      try {
17493
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
17494
      } catch (org.apache.thrift.TException te) {
17495
        throw new java.io.IOException(te);
17496
      }
17497
    }
17498
 
17499
  }
17500
 
1982 varun.gupt 17501
}