Subversion Repositories SmartDukaan

Rev

Rev 6679 | Rev 6736 | 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
6730 anupam.sin 65
     * @param couponCode
6679 anupam.sin 66
     * @param arguments
6356 amit.gupta 67
     * @param isCod
6561 amit.gupta 68
     * @param prefix
6250 amit.gupta 69
     */
6730 anupam.sin 70
    public String createCoupon(long promotionId, String couponCode, String arguments, boolean isCod, String prefix) throws PromotionException, org.apache.thrift.TException;
6250 amit.gupta 71
 
72
    /**
3385 varun.gupt 73
     * Returns the count of successful payments done using a given coupon
74
     * 
75
     * @param couponCode
76
     */
3430 rajveer 77
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
3385 varun.gupt 78
 
79
    /**
80
     * Returns the doc string of the rule module
81
     * 
82
     * @param ruleName
83
     */
3430 rajveer 84
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException;
3385 varun.gupt 85
 
4189 varun.gupt 86
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException;
87
 
4494 varun.gupt 88
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException;
89
 
5469 rajveer 90
    public void addVoucher(Voucher voucher) throws org.apache.thrift.TException;
91
 
92
    public Voucher assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException;
93
 
94
    public boolean markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException;
95
 
1982 varun.gupt 96
  }
97
 
3430 rajveer 98
  public interface AsyncIface extends in.shop2020.generic.GenericService .AsyncIface {
1982 varun.gupt 99
 
3430 rajveer 100
    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 101
 
6301 amit.gupta 102
    public void getCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCoupon_call> resultHandler) throws org.apache.thrift.TException;
103
 
104
    public void isGiftVoucher(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.isGiftVoucher_call> resultHandler) throws org.apache.thrift.TException;
105
 
6356 amit.gupta 106
    public void isCodApplicable(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.isCodApplicable_call> resultHandler) throws org.apache.thrift.TException;
107
 
3430 rajveer 108
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllPromotions_call> resultHandler) throws org.apache.thrift.TException;
109
 
110
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPromotionById_call> resultHandler) throws org.apache.thrift.TException;
111
 
112
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException;
113
 
114
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyCoupon_call> resultHandler) throws org.apache.thrift.TException;
115
 
6433 anupam.sin 116
    public void applyRechargeCoupon(String couponCode, long totalAmount, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyRechargeCoupon_call> resultHandler) throws org.apache.thrift.TException;
117
 
3430 rajveer 118
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException;
119
 
120
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException;
121
 
6497 amit.gupta 122
    public void getActiveCodes(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getActiveCodes_call> resultHandler) throws org.apache.thrift.TException;
123
 
124
    public void deleteCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.deleteCoupon_call> resultHandler) throws org.apache.thrift.TException;
125
 
3430 rajveer 126
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException;
127
 
6730 anupam.sin 128
    public void createCoupon(long promotionId, String couponCode, String arguments, boolean isCod, String prefix, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.createCoupon_call> resultHandler) throws org.apache.thrift.TException;
6250 amit.gupta 129
 
3430 rajveer 130
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException;
131
 
132
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getRuleDocString_call> resultHandler) throws org.apache.thrift.TException;
133
 
4189 varun.gupt 134
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException;
135
 
4494 varun.gupt 136
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException;
137
 
5469 rajveer 138
    public void addVoucher(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.addVoucher_call> resultHandler) throws org.apache.thrift.TException;
139
 
140
    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;
141
 
142
    public void markVoucherAsRedeemed(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.markVoucherAsRedeemed_call> resultHandler) throws org.apache.thrift.TException;
143
 
3430 rajveer 144
  }
145
 
146
  public static class Client extends in.shop2020.generic.GenericService.Client implements Iface {
147
    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
148
      public Factory() {}
149
      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
150
        return new Client(prot);
151
      }
152
      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
153
        return new Client(iprot, oprot);
154
      }
1982 varun.gupt 155
    }
156
 
3430 rajveer 157
    public Client(org.apache.thrift.protocol.TProtocol prot)
1982 varun.gupt 158
    {
3430 rajveer 159
      super(prot, prot);
1982 varun.gupt 160
    }
161
 
3430 rajveer 162
    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
163
      super(iprot, oprot);
1982 varun.gupt 164
    }
165
 
3430 rajveer 166
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 167
    {
168
      send_createPromotion(name, ruleExecutionSrc, startOn, endOn);
169
      recv_createPromotion();
170
    }
171
 
3430 rajveer 172
    public void send_createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws org.apache.thrift.TException
1982 varun.gupt 173
    {
174
      createPromotion_args args = new createPromotion_args();
3430 rajveer 175
      args.setName(name);
176
      args.setRuleExecutionSrc(ruleExecutionSrc);
177
      args.setStartOn(startOn);
178
      args.setEndOn(endOn);
179
      sendBase("createPromotion", args);
1982 varun.gupt 180
    }
181
 
3430 rajveer 182
    public void recv_createPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 183
    {
184
      createPromotion_result result = new createPromotion_result();
3430 rajveer 185
      receiveBase(result, "createPromotion");
1982 varun.gupt 186
      if (result.pex != null) {
187
        throw result.pex;
188
      }
189
      return;
190
    }
191
 
6301 amit.gupta 192
    public Coupon getCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
193
    {
194
      send_getCoupon(couponCode);
195
      return recv_getCoupon();
196
    }
197
 
198
    public void send_getCoupon(String couponCode) throws org.apache.thrift.TException
199
    {
200
      getCoupon_args args = new getCoupon_args();
201
      args.setCouponCode(couponCode);
202
      sendBase("getCoupon", args);
203
    }
204
 
205
    public Coupon recv_getCoupon() throws PromotionException, org.apache.thrift.TException
206
    {
207
      getCoupon_result result = new getCoupon_result();
208
      receiveBase(result, "getCoupon");
209
      if (result.isSetSuccess()) {
210
        return result.success;
211
      }
212
      if (result.pex != null) {
213
        throw result.pex;
214
      }
215
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCoupon failed: unknown result");
216
    }
217
 
218
    public boolean isGiftVoucher(String couponCode) throws PromotionException, org.apache.thrift.TException
219
    {
220
      send_isGiftVoucher(couponCode);
221
      return recv_isGiftVoucher();
222
    }
223
 
224
    public void send_isGiftVoucher(String couponCode) throws org.apache.thrift.TException
225
    {
226
      isGiftVoucher_args args = new isGiftVoucher_args();
227
      args.setCouponCode(couponCode);
228
      sendBase("isGiftVoucher", args);
229
    }
230
 
231
    public boolean recv_isGiftVoucher() throws PromotionException, org.apache.thrift.TException
232
    {
233
      isGiftVoucher_result result = new isGiftVoucher_result();
234
      receiveBase(result, "isGiftVoucher");
235
      if (result.isSetSuccess()) {
236
        return result.success;
237
      }
238
      if (result.pex != null) {
239
        throw result.pex;
240
      }
241
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isGiftVoucher failed: unknown result");
242
    }
243
 
6356 amit.gupta 244
    public boolean isCodApplicable(String couponCode) throws PromotionException, org.apache.thrift.TException
245
    {
246
      send_isCodApplicable(couponCode);
247
      return recv_isCodApplicable();
248
    }
249
 
250
    public void send_isCodApplicable(String couponCode) throws org.apache.thrift.TException
251
    {
252
      isCodApplicable_args args = new isCodApplicable_args();
253
      args.setCouponCode(couponCode);
254
      sendBase("isCodApplicable", args);
255
    }
256
 
257
    public boolean recv_isCodApplicable() throws PromotionException, org.apache.thrift.TException
258
    {
259
      isCodApplicable_result result = new isCodApplicable_result();
260
      receiveBase(result, "isCodApplicable");
261
      if (result.isSetSuccess()) {
262
        return result.success;
263
      }
264
      if (result.pex != null) {
265
        throw result.pex;
266
      }
267
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isCodApplicable failed: unknown result");
268
    }
269
 
3430 rajveer 270
    public List<Promotion> getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 271
    {
272
      send_getAllPromotions();
273
      return recv_getAllPromotions();
274
    }
275
 
3430 rajveer 276
    public void send_getAllPromotions() throws org.apache.thrift.TException
1982 varun.gupt 277
    {
278
      getAllPromotions_args args = new getAllPromotions_args();
3430 rajveer 279
      sendBase("getAllPromotions", args);
1982 varun.gupt 280
    }
281
 
3430 rajveer 282
    public List<Promotion> recv_getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 283
    {
284
      getAllPromotions_result result = new getAllPromotions_result();
3430 rajveer 285
      receiveBase(result, "getAllPromotions");
1982 varun.gupt 286
      if (result.isSetSuccess()) {
287
        return result.success;
288
      }
289
      if (result.pex != null) {
290
        throw result.pex;
291
      }
3430 rajveer 292
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllPromotions failed: unknown result");
1982 varun.gupt 293
    }
294
 
3430 rajveer 295
    public Promotion getPromotionById(long promotionId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 296
    {
297
      send_getPromotionById(promotionId);
298
      return recv_getPromotionById();
299
    }
300
 
3430 rajveer 301
    public void send_getPromotionById(long promotionId) throws org.apache.thrift.TException
1982 varun.gupt 302
    {
303
      getPromotionById_args args = new getPromotionById_args();
3430 rajveer 304
      args.setPromotionId(promotionId);
305
      sendBase("getPromotionById", args);
1982 varun.gupt 306
    }
307
 
3430 rajveer 308
    public Promotion recv_getPromotionById() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 309
    {
310
      getPromotionById_result result = new getPromotionById_result();
3430 rajveer 311
      receiveBase(result, "getPromotionById");
1982 varun.gupt 312
      if (result.isSetSuccess()) {
313
        return result.success;
314
      }
315
      if (result.pex != null) {
316
        throw result.pex;
317
      }
3430 rajveer 318
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPromotionById failed: unknown result");
1982 varun.gupt 319
    }
320
 
3430 rajveer 321
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 322
    {
323
      send_generateCouponsForPromotion(promotionId, couponCode);
324
      recv_generateCouponsForPromotion();
325
    }
326
 
3430 rajveer 327
    public void send_generateCouponsForPromotion(long promotionId, String couponCode) throws org.apache.thrift.TException
1982 varun.gupt 328
    {
329
      generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
3430 rajveer 330
      args.setPromotionId(promotionId);
331
      args.setCouponCode(couponCode);
332
      sendBase("generateCouponsForPromotion", args);
1982 varun.gupt 333
    }
334
 
3430 rajveer 335
    public void recv_generateCouponsForPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 336
    {
337
      generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
3430 rajveer 338
      receiveBase(result, "generateCouponsForPromotion");
1982 varun.gupt 339
      if (result.pex != null) {
340
        throw result.pex;
341
      }
342
      return;
343
    }
344
 
3430 rajveer 345
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 346
    {
347
      send_applyCoupon(couponCode, cartId);
348
      return recv_applyCoupon();
349
    }
350
 
3430 rajveer 351
    public void send_applyCoupon(String couponCode, long cartId) throws org.apache.thrift.TException
1982 varun.gupt 352
    {
353
      applyCoupon_args args = new applyCoupon_args();
3430 rajveer 354
      args.setCouponCode(couponCode);
355
      args.setCartId(cartId);
356
      sendBase("applyCoupon", args);
1982 varun.gupt 357
    }
358
 
3430 rajveer 359
    public Cart recv_applyCoupon() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 360
    {
361
      applyCoupon_result result = new applyCoupon_result();
3430 rajveer 362
      receiveBase(result, "applyCoupon");
1982 varun.gupt 363
      if (result.isSetSuccess()) {
364
        return result.success;
365
      }
366
      if (result.pex != null) {
367
        throw result.pex;
368
      }
3430 rajveer 369
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "applyCoupon failed: unknown result");
1982 varun.gupt 370
    }
371
 
6433 anupam.sin 372
    public Map<Long,String> applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws PromotionException, org.apache.thrift.TException
373
    {
374
      send_applyRechargeCoupon(couponCode, totalAmount, userId);
375
      return recv_applyRechargeCoupon();
376
    }
377
 
378
    public void send_applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws org.apache.thrift.TException
379
    {
380
      applyRechargeCoupon_args args = new applyRechargeCoupon_args();
381
      args.setCouponCode(couponCode);
382
      args.setTotalAmount(totalAmount);
383
      args.setUserId(userId);
384
      sendBase("applyRechargeCoupon", args);
385
    }
386
 
387
    public Map<Long,String> recv_applyRechargeCoupon() throws PromotionException, org.apache.thrift.TException
388
    {
389
      applyRechargeCoupon_result result = new applyRechargeCoupon_result();
390
      receiveBase(result, "applyRechargeCoupon");
391
      if (result.isSetSuccess()) {
392
        return result.success;
393
      }
394
      if (result.pex != null) {
395
        throw result.pex;
396
      }
397
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "applyRechargeCoupon failed: unknown result");
398
    }
399
 
3430 rajveer 400
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 401
    {
402
      send_trackCouponUsage(couponCode, transactionId, userId);
403
      recv_trackCouponUsage();
404
    }
405
 
3430 rajveer 406
    public void send_trackCouponUsage(String couponCode, long transactionId, long userId) throws org.apache.thrift.TException
1982 varun.gupt 407
    {
408
      trackCouponUsage_args args = new trackCouponUsage_args();
3430 rajveer 409
      args.setCouponCode(couponCode);
410
      args.setTransactionId(transactionId);
411
      args.setUserId(userId);
412
      sendBase("trackCouponUsage", args);
1982 varun.gupt 413
    }
414
 
3430 rajveer 415
    public void recv_trackCouponUsage() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 416
    {
417
      trackCouponUsage_result result = new trackCouponUsage_result();
3430 rajveer 418
      receiveBase(result, "trackCouponUsage");
1982 varun.gupt 419
      if (result.pex != null) {
420
        throw result.pex;
421
      }
422
      return;
423
    }
424
 
3430 rajveer 425
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 426
    {
427
      send_getCouponUsageCountByUser(couponCode, userId);
428
      return recv_getCouponUsageCountByUser();
429
    }
430
 
3430 rajveer 431
    public void send_getCouponUsageCountByUser(String couponCode, long userId) throws org.apache.thrift.TException
1982 varun.gupt 432
    {
433
      getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
3430 rajveer 434
      args.setCouponCode(couponCode);
435
      args.setUserId(userId);
436
      sendBase("getCouponUsageCountByUser", args);
1982 varun.gupt 437
    }
438
 
3430 rajveer 439
    public long recv_getCouponUsageCountByUser() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 440
    {
441
      getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
3430 rajveer 442
      receiveBase(result, "getCouponUsageCountByUser");
1982 varun.gupt 443
      if (result.isSetSuccess()) {
444
        return result.success;
445
      }
446
      if (result.pex != null) {
447
        throw result.pex;
448
      }
3430 rajveer 449
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCouponUsageCountByUser failed: unknown result");
1982 varun.gupt 450
    }
451
 
6497 amit.gupta 452
    public List<Coupon> getActiveCodes(long promotionId) throws PromotionException, org.apache.thrift.TException
453
    {
454
      send_getActiveCodes(promotionId);
455
      return recv_getActiveCodes();
456
    }
457
 
458
    public void send_getActiveCodes(long promotionId) throws org.apache.thrift.TException
459
    {
460
      getActiveCodes_args args = new getActiveCodes_args();
461
      args.setPromotionId(promotionId);
462
      sendBase("getActiveCodes", args);
463
    }
464
 
465
    public List<Coupon> recv_getActiveCodes() throws PromotionException, org.apache.thrift.TException
466
    {
467
      getActiveCodes_result result = new getActiveCodes_result();
468
      receiveBase(result, "getActiveCodes");
469
      if (result.isSetSuccess()) {
470
        return result.success;
471
      }
472
      if (result.pex != null) {
473
        throw result.pex;
474
      }
475
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getActiveCodes failed: unknown result");
476
    }
477
 
478
    public void deleteCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
479
    {
480
      send_deleteCoupon(couponCode);
481
      recv_deleteCoupon();
482
    }
483
 
484
    public void send_deleteCoupon(String couponCode) throws org.apache.thrift.TException
485
    {
486
      deleteCoupon_args args = new deleteCoupon_args();
487
      args.setCouponCode(couponCode);
488
      sendBase("deleteCoupon", args);
489
    }
490
 
491
    public void recv_deleteCoupon() throws PromotionException, org.apache.thrift.TException
492
    {
493
      deleteCoupon_result result = new deleteCoupon_result();
494
      receiveBase(result, "deleteCoupon");
495
      if (result.pex != null) {
496
        throw result.pex;
497
      }
498
      return;
499
    }
500
 
3430 rajveer 501
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 502
    {
503
      send_getActiveCoupons();
504
      return recv_getActiveCoupons();
505
    }
506
 
3430 rajveer 507
    public void send_getActiveCoupons() throws org.apache.thrift.TException
3385 varun.gupt 508
    {
509
      getActiveCoupons_args args = new getActiveCoupons_args();
3430 rajveer 510
      sendBase("getActiveCoupons", args);
3385 varun.gupt 511
    }
512
 
3430 rajveer 513
    public List<Coupon> recv_getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 514
    {
515
      getActiveCoupons_result result = new getActiveCoupons_result();
3430 rajveer 516
      receiveBase(result, "getActiveCoupons");
3385 varun.gupt 517
      if (result.isSetSuccess()) {
518
        return result.success;
519
      }
520
      if (result.pex != null) {
521
        throw result.pex;
522
      }
3430 rajveer 523
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getActiveCoupons failed: unknown result");
3385 varun.gupt 524
    }
525
 
6730 anupam.sin 526
    public String createCoupon(long promotionId, String couponCode, String arguments, boolean isCod, String prefix) throws PromotionException, org.apache.thrift.TException
6250 amit.gupta 527
    {
6730 anupam.sin 528
      send_createCoupon(promotionId, couponCode, arguments, isCod, prefix);
6250 amit.gupta 529
      return recv_createCoupon();
530
    }
531
 
6730 anupam.sin 532
    public void send_createCoupon(long promotionId, String couponCode, String arguments, boolean isCod, String prefix) throws org.apache.thrift.TException
6250 amit.gupta 533
    {
534
      createCoupon_args args = new createCoupon_args();
535
      args.setPromotionId(promotionId);
6730 anupam.sin 536
      args.setCouponCode(couponCode);
6679 anupam.sin 537
      args.setArguments(arguments);
6356 amit.gupta 538
      args.setIsCod(isCod);
6561 amit.gupta 539
      args.setPrefix(prefix);
6250 amit.gupta 540
      sendBase("createCoupon", args);
541
    }
542
 
543
    public String recv_createCoupon() throws PromotionException, org.apache.thrift.TException
544
    {
545
      createCoupon_result result = new createCoupon_result();
546
      receiveBase(result, "createCoupon");
547
      if (result.isSetSuccess()) {
548
        return result.success;
549
      }
550
      if (result.pex != null) {
551
        throw result.pex;
552
      }
553
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createCoupon failed: unknown result");
554
    }
555
 
3430 rajveer 556
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 557
    {
558
      send_getSuccessfulPaymentCountForCoupon(couponCode);
559
      return recv_getSuccessfulPaymentCountForCoupon();
560
    }
561
 
3430 rajveer 562
    public void send_getSuccessfulPaymentCountForCoupon(String couponCode) throws org.apache.thrift.TException
3385 varun.gupt 563
    {
564
      getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
3430 rajveer 565
      args.setCouponCode(couponCode);
566
      sendBase("getSuccessfulPaymentCountForCoupon", args);
3385 varun.gupt 567
    }
568
 
3430 rajveer 569
    public long recv_getSuccessfulPaymentCountForCoupon() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 570
    {
571
      getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
3430 rajveer 572
      receiveBase(result, "getSuccessfulPaymentCountForCoupon");
3385 varun.gupt 573
      if (result.isSetSuccess()) {
574
        return result.success;
575
      }
576
      if (result.pex != null) {
577
        throw result.pex;
578
      }
3430 rajveer 579
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSuccessfulPaymentCountForCoupon failed: unknown result");
3385 varun.gupt 580
    }
581
 
3430 rajveer 582
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 583
    {
584
      send_getRuleDocString(ruleName);
585
      return recv_getRuleDocString();
586
    }
587
 
3430 rajveer 588
    public void send_getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 589
    {
590
      getRuleDocString_args args = new getRuleDocString_args();
3430 rajveer 591
      args.setRuleName(ruleName);
592
      sendBase("getRuleDocString", args);
3385 varun.gupt 593
    }
594
 
3430 rajveer 595
    public String recv_getRuleDocString() throws org.apache.thrift.TException
3385 varun.gupt 596
    {
597
      getRuleDocString_result result = new getRuleDocString_result();
3430 rajveer 598
      receiveBase(result, "getRuleDocString");
3385 varun.gupt 599
      if (result.isSetSuccess()) {
600
        return result.success;
601
      }
3430 rajveer 602
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRuleDocString failed: unknown result");
3385 varun.gupt 603
    }
604
 
4189 varun.gupt 605
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException
606
    {
607
      send_getItemDiscountMap(itemIds);
608
      return recv_getItemDiscountMap();
609
    }
610
 
611
    public void send_getItemDiscountMap(List<Long> itemIds) throws org.apache.thrift.TException
612
    {
613
      getItemDiscountMap_args args = new getItemDiscountMap_args();
614
      args.setItemIds(itemIds);
615
      sendBase("getItemDiscountMap", args);
616
    }
617
 
618
    public List<ItemCouponDiscount> recv_getItemDiscountMap() throws PromotionException, org.apache.thrift.TException
619
    {
620
      getItemDiscountMap_result result = new getItemDiscountMap_result();
621
      receiveBase(result, "getItemDiscountMap");
622
      if (result.isSetSuccess()) {
623
        return result.success;
624
      }
625
      if (result.pex != null) {
626
        throw result.pex;
627
      }
628
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemDiscountMap failed: unknown result");
629
    }
630
 
4494 varun.gupt 631
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
632
    {
633
      send_getDiscountsForEntity(entityId);
634
      return recv_getDiscountsForEntity();
635
    }
636
 
637
    public void send_getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
638
    {
639
      getDiscountsForEntity_args args = new getDiscountsForEntity_args();
640
      args.setEntityId(entityId);
641
      sendBase("getDiscountsForEntity", args);
642
    }
643
 
644
    public Map<String,Double> recv_getDiscountsForEntity() throws org.apache.thrift.TException
645
    {
646
      getDiscountsForEntity_result result = new getDiscountsForEntity_result();
647
      receiveBase(result, "getDiscountsForEntity");
648
      if (result.isSetSuccess()) {
649
        return result.success;
650
      }
651
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getDiscountsForEntity failed: unknown result");
652
    }
653
 
5469 rajveer 654
    public void addVoucher(Voucher voucher) throws org.apache.thrift.TException
655
    {
656
      send_addVoucher(voucher);
657
      recv_addVoucher();
658
    }
659
 
660
    public void send_addVoucher(Voucher voucher) throws org.apache.thrift.TException
661
    {
662
      addVoucher_args args = new addVoucher_args();
663
      args.setVoucher(voucher);
664
      sendBase("addVoucher", args);
665
    }
666
 
667
    public void recv_addVoucher() throws org.apache.thrift.TException
668
    {
669
      addVoucher_result result = new addVoucher_result();
670
      receiveBase(result, "addVoucher");
671
      return;
672
    }
673
 
674
    public Voucher assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException
675
    {
676
      send_assignVoucher(userId, userEmail, voucherType, amount);
677
      return recv_assignVoucher();
678
    }
679
 
680
    public void send_assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException
681
    {
682
      assignVoucher_args args = new assignVoucher_args();
683
      args.setUserId(userId);
684
      args.setUserEmail(userEmail);
685
      args.setVoucherType(voucherType);
686
      args.setAmount(amount);
687
      sendBase("assignVoucher", args);
688
    }
689
 
690
    public Voucher recv_assignVoucher() throws org.apache.thrift.TException
691
    {
692
      assignVoucher_result result = new assignVoucher_result();
693
      receiveBase(result, "assignVoucher");
694
      if (result.isSetSuccess()) {
695
        return result.success;
696
      }
697
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "assignVoucher failed: unknown result");
698
    }
699
 
700
    public boolean markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException
701
    {
702
      send_markVoucherAsRedeemed(voucherCode, redeemedOn);
703
      return recv_markVoucherAsRedeemed();
704
    }
705
 
706
    public void send_markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException
707
    {
708
      markVoucherAsRedeemed_args args = new markVoucherAsRedeemed_args();
709
      args.setVoucherCode(voucherCode);
710
      args.setRedeemedOn(redeemedOn);
711
      sendBase("markVoucherAsRedeemed", args);
712
    }
713
 
714
    public boolean recv_markVoucherAsRedeemed() throws org.apache.thrift.TException
715
    {
716
      markVoucherAsRedeemed_result result = new markVoucherAsRedeemed_result();
717
      receiveBase(result, "markVoucherAsRedeemed");
718
      if (result.isSetSuccess()) {
719
        return result.success;
720
      }
721
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "markVoucherAsRedeemed failed: unknown result");
722
    }
723
 
1982 varun.gupt 724
  }
3430 rajveer 725
  public static class AsyncClient extends in.shop2020.generic.GenericService.AsyncClient implements AsyncIface {
726
    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
727
      private org.apache.thrift.async.TAsyncClientManager clientManager;
728
      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
729
      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
730
        this.clientManager = clientManager;
731
        this.protocolFactory = protocolFactory;
732
      }
733
      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
734
        return new AsyncClient(protocolFactory, clientManager, transport);
735
      }
1982 varun.gupt 736
    }
737
 
3430 rajveer 738
    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
739
      super(protocolFactory, clientManager, transport);
740
    }
1982 varun.gupt 741
 
3430 rajveer 742
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn, org.apache.thrift.async.AsyncMethodCallback<createPromotion_call> resultHandler) throws org.apache.thrift.TException {
743
      checkReady();
744
      createPromotion_call method_call = new createPromotion_call(name, ruleExecutionSrc, startOn, endOn, resultHandler, this, ___protocolFactory, ___transport);
745
      this.___currentMethod = method_call;
746
      ___manager.call(method_call);
1982 varun.gupt 747
    }
748
 
3430 rajveer 749
    public static class createPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
750
      private String name;
751
      private String ruleExecutionSrc;
752
      private long startOn;
753
      private long endOn;
754
      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 {
755
        super(client, protocolFactory, transport, resultHandler, false);
756
        this.name = name;
757
        this.ruleExecutionSrc = ruleExecutionSrc;
758
        this.startOn = startOn;
759
        this.endOn = endOn;
1982 varun.gupt 760
      }
761
 
3430 rajveer 762
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
763
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
1982 varun.gupt 764
        createPromotion_args args = new createPromotion_args();
3430 rajveer 765
        args.setName(name);
766
        args.setRuleExecutionSrc(ruleExecutionSrc);
767
        args.setStartOn(startOn);
768
        args.setEndOn(endOn);
769
        args.write(prot);
770
        prot.writeMessageEnd();
1982 varun.gupt 771
      }
772
 
3430 rajveer 773
      public void getResult() throws PromotionException, org.apache.thrift.TException {
774
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
775
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 776
        }
3430 rajveer 777
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
778
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
779
        (new Client(prot)).recv_createPromotion();
1982 varun.gupt 780
      }
3430 rajveer 781
    }
1982 varun.gupt 782
 
6301 amit.gupta 783
    public void getCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getCoupon_call> resultHandler) throws org.apache.thrift.TException {
784
      checkReady();
785
      getCoupon_call method_call = new getCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
786
      this.___currentMethod = method_call;
787
      ___manager.call(method_call);
788
    }
789
 
790
    public static class getCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
791
      private String couponCode;
792
      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 {
793
        super(client, protocolFactory, transport, resultHandler, false);
794
        this.couponCode = couponCode;
795
      }
796
 
797
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
798
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
799
        getCoupon_args args = new getCoupon_args();
800
        args.setCouponCode(couponCode);
801
        args.write(prot);
802
        prot.writeMessageEnd();
803
      }
804
 
805
      public Coupon getResult() throws PromotionException, org.apache.thrift.TException {
806
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
807
          throw new IllegalStateException("Method call not finished!");
808
        }
809
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
810
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
811
        return (new Client(prot)).recv_getCoupon();
812
      }
813
    }
814
 
815
    public void isGiftVoucher(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isGiftVoucher_call> resultHandler) throws org.apache.thrift.TException {
816
      checkReady();
817
      isGiftVoucher_call method_call = new isGiftVoucher_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
818
      this.___currentMethod = method_call;
819
      ___manager.call(method_call);
820
    }
821
 
822
    public static class isGiftVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
823
      private String couponCode;
824
      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 {
825
        super(client, protocolFactory, transport, resultHandler, false);
826
        this.couponCode = couponCode;
827
      }
828
 
829
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
830
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isGiftVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
831
        isGiftVoucher_args args = new isGiftVoucher_args();
832
        args.setCouponCode(couponCode);
833
        args.write(prot);
834
        prot.writeMessageEnd();
835
      }
836
 
837
      public boolean getResult() throws PromotionException, org.apache.thrift.TException {
838
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
839
          throw new IllegalStateException("Method call not finished!");
840
        }
841
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
842
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
843
        return (new Client(prot)).recv_isGiftVoucher();
844
      }
845
    }
846
 
6356 amit.gupta 847
    public void isCodApplicable(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isCodApplicable_call> resultHandler) throws org.apache.thrift.TException {
848
      checkReady();
849
      isCodApplicable_call method_call = new isCodApplicable_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
850
      this.___currentMethod = method_call;
851
      ___manager.call(method_call);
852
    }
853
 
854
    public static class isCodApplicable_call extends org.apache.thrift.async.TAsyncMethodCall {
855
      private String couponCode;
856
      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 {
857
        super(client, protocolFactory, transport, resultHandler, false);
858
        this.couponCode = couponCode;
859
      }
860
 
861
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
862
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isCodApplicable", org.apache.thrift.protocol.TMessageType.CALL, 0));
863
        isCodApplicable_args args = new isCodApplicable_args();
864
        args.setCouponCode(couponCode);
865
        args.write(prot);
866
        prot.writeMessageEnd();
867
      }
868
 
869
      public boolean getResult() throws PromotionException, org.apache.thrift.TException {
870
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
871
          throw new IllegalStateException("Method call not finished!");
872
        }
873
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
874
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
875
        return (new Client(prot)).recv_isCodApplicable();
876
      }
877
    }
878
 
3430 rajveer 879
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<getAllPromotions_call> resultHandler) throws org.apache.thrift.TException {
880
      checkReady();
881
      getAllPromotions_call method_call = new getAllPromotions_call(resultHandler, this, ___protocolFactory, ___transport);
882
      this.___currentMethod = method_call;
883
      ___manager.call(method_call);
1982 varun.gupt 884
    }
885
 
3430 rajveer 886
    public static class getAllPromotions_call extends org.apache.thrift.async.TAsyncMethodCall {
887
      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 {
888
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 889
      }
890
 
3430 rajveer 891
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
892
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllPromotions", org.apache.thrift.protocol.TMessageType.CALL, 0));
893
        getAllPromotions_args args = new getAllPromotions_args();
894
        args.write(prot);
895
        prot.writeMessageEnd();
896
      }
1982 varun.gupt 897
 
3430 rajveer 898
      public List<Promotion> getResult() throws PromotionException, org.apache.thrift.TException {
899
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
900
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 901
        }
3430 rajveer 902
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
903
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
904
        return (new Client(prot)).recv_getAllPromotions();
1982 varun.gupt 905
      }
3430 rajveer 906
    }
1982 varun.gupt 907
 
3430 rajveer 908
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getPromotionById_call> resultHandler) throws org.apache.thrift.TException {
909
      checkReady();
910
      getPromotionById_call method_call = new getPromotionById_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
911
      this.___currentMethod = method_call;
912
      ___manager.call(method_call);
1982 varun.gupt 913
    }
914
 
3430 rajveer 915
    public static class getPromotionById_call extends org.apache.thrift.async.TAsyncMethodCall {
916
      private long promotionId;
917
      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 {
918
        super(client, protocolFactory, transport, resultHandler, false);
919
        this.promotionId = promotionId;
1982 varun.gupt 920
      }
921
 
3430 rajveer 922
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
923
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPromotionById", org.apache.thrift.protocol.TMessageType.CALL, 0));
924
        getPromotionById_args args = new getPromotionById_args();
925
        args.setPromotionId(promotionId);
926
        args.write(prot);
927
        prot.writeMessageEnd();
928
      }
1982 varun.gupt 929
 
3430 rajveer 930
      public Promotion getResult() throws PromotionException, org.apache.thrift.TException {
931
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
932
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 933
        }
3430 rajveer 934
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
935
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
936
        return (new Client(prot)).recv_getPromotionById();
1982 varun.gupt 937
      }
3430 rajveer 938
    }
1982 varun.gupt 939
 
3430 rajveer 940
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException {
941
      checkReady();
942
      generateCouponsForPromotion_call method_call = new generateCouponsForPromotion_call(promotionId, couponCode, resultHandler, this, ___protocolFactory, ___transport);
943
      this.___currentMethod = method_call;
944
      ___manager.call(method_call);
1982 varun.gupt 945
    }
946
 
3430 rajveer 947
    public static class generateCouponsForPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
948
      private long promotionId;
949
      private String couponCode;
950
      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 {
951
        super(client, protocolFactory, transport, resultHandler, false);
952
        this.promotionId = promotionId;
953
        this.couponCode = couponCode;
1982 varun.gupt 954
      }
955
 
3430 rajveer 956
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
957
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("generateCouponsForPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
958
        generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
959
        args.setPromotionId(promotionId);
960
        args.setCouponCode(couponCode);
961
        args.write(prot);
962
        prot.writeMessageEnd();
3385 varun.gupt 963
      }
964
 
3430 rajveer 965
      public void getResult() throws PromotionException, org.apache.thrift.TException {
966
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
967
          throw new IllegalStateException("Method call not finished!");
3385 varun.gupt 968
        }
3430 rajveer 969
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
970
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
971
        (new Client(prot)).recv_generateCouponsForPromotion();
3385 varun.gupt 972
      }
973
    }
974
 
3430 rajveer 975
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<applyCoupon_call> resultHandler) throws org.apache.thrift.TException {
976
      checkReady();
977
      applyCoupon_call method_call = new applyCoupon_call(couponCode, cartId, resultHandler, this, ___protocolFactory, ___transport);
978
      this.___currentMethod = method_call;
979
      ___manager.call(method_call);
3385 varun.gupt 980
    }
981
 
3430 rajveer 982
    public static class applyCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
983
      private String couponCode;
984
      private long cartId;
985
      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 {
986
        super(client, protocolFactory, transport, resultHandler, false);
987
        this.couponCode = couponCode;
988
        this.cartId = cartId;
1982 varun.gupt 989
      }
990
 
3430 rajveer 991
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
992
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("applyCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
993
        applyCoupon_args args = new applyCoupon_args();
994
        args.setCouponCode(couponCode);
995
        args.setCartId(cartId);
996
        args.write(prot);
997
        prot.writeMessageEnd();
1982 varun.gupt 998
      }
999
 
3430 rajveer 1000
      public Cart getResult() throws PromotionException, org.apache.thrift.TException {
1001
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1002
          throw new IllegalStateException("Method call not finished!");
1003
        }
1004
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1005
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1006
        return (new Client(prot)).recv_applyCoupon();
1982 varun.gupt 1007
      }
3430 rajveer 1008
    }
1982 varun.gupt 1009
 
6433 anupam.sin 1010
    public void applyRechargeCoupon(String couponCode, long totalAmount, long userId, org.apache.thrift.async.AsyncMethodCallback<applyRechargeCoupon_call> resultHandler) throws org.apache.thrift.TException {
1011
      checkReady();
1012
      applyRechargeCoupon_call method_call = new applyRechargeCoupon_call(couponCode, totalAmount, userId, resultHandler, this, ___protocolFactory, ___transport);
1013
      this.___currentMethod = method_call;
1014
      ___manager.call(method_call);
1015
    }
1016
 
1017
    public static class applyRechargeCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1018
      private String couponCode;
1019
      private long totalAmount;
1020
      private long userId;
1021
      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 {
1022
        super(client, protocolFactory, transport, resultHandler, false);
1023
        this.couponCode = couponCode;
1024
        this.totalAmount = totalAmount;
1025
        this.userId = userId;
1026
      }
1027
 
1028
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1029
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("applyRechargeCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1030
        applyRechargeCoupon_args args = new applyRechargeCoupon_args();
1031
        args.setCouponCode(couponCode);
1032
        args.setTotalAmount(totalAmount);
1033
        args.setUserId(userId);
1034
        args.write(prot);
1035
        prot.writeMessageEnd();
1036
      }
1037
 
1038
      public Map<Long,String> getResult() throws PromotionException, org.apache.thrift.TException {
1039
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1040
          throw new IllegalStateException("Method call not finished!");
1041
        }
1042
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1043
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1044
        return (new Client(prot)).recv_applyRechargeCoupon();
1045
      }
1046
    }
1047
 
3430 rajveer 1048
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException {
1049
      checkReady();
1050
      trackCouponUsage_call method_call = new trackCouponUsage_call(couponCode, transactionId, userId, resultHandler, this, ___protocolFactory, ___transport);
1051
      this.___currentMethod = method_call;
1052
      ___manager.call(method_call);
1053
    }
1982 varun.gupt 1054
 
3430 rajveer 1055
    public static class trackCouponUsage_call extends org.apache.thrift.async.TAsyncMethodCall {
1056
      private String couponCode;
1057
      private long transactionId;
1058
      private long userId;
1059
      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 {
1060
        super(client, protocolFactory, transport, resultHandler, false);
1061
        this.couponCode = couponCode;
1062
        this.transactionId = transactionId;
1063
        this.userId = userId;
1982 varun.gupt 1064
      }
1065
 
3430 rajveer 1066
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1067
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("trackCouponUsage", org.apache.thrift.protocol.TMessageType.CALL, 0));
1068
        trackCouponUsage_args args = new trackCouponUsage_args();
1069
        args.setCouponCode(couponCode);
1070
        args.setTransactionId(transactionId);
1071
        args.setUserId(userId);
1072
        args.write(prot);
1073
        prot.writeMessageEnd();
1982 varun.gupt 1074
      }
1075
 
3430 rajveer 1076
      public void getResult() throws PromotionException, org.apache.thrift.TException {
1077
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1078
          throw new IllegalStateException("Method call not finished!");
1079
        }
1080
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1081
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1082
        (new Client(prot)).recv_trackCouponUsage();
1982 varun.gupt 1083
      }
1084
    }
1085
 
3430 rajveer 1086
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException {
1087
      checkReady();
1088
      getCouponUsageCountByUser_call method_call = new getCouponUsageCountByUser_call(couponCode, userId, resultHandler, this, ___protocolFactory, ___transport);
1089
      this.___currentMethod = method_call;
1090
      ___manager.call(method_call);
1982 varun.gupt 1091
    }
1092
 
3430 rajveer 1093
    public static class getCouponUsageCountByUser_call extends org.apache.thrift.async.TAsyncMethodCall {
1094
      private String couponCode;
1095
      private long userId;
1096
      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 {
1097
        super(client, protocolFactory, transport, resultHandler, false);
1098
        this.couponCode = couponCode;
1099
        this.userId = userId;
1100
      }
1982 varun.gupt 1101
 
3430 rajveer 1102
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1103
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCouponUsageCountByUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
1104
        getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
1105
        args.setCouponCode(couponCode);
1106
        args.setUserId(userId);
1107
        args.write(prot);
1108
        prot.writeMessageEnd();
1109
      }
1982 varun.gupt 1110
 
3430 rajveer 1111
      public long getResult() throws PromotionException, org.apache.thrift.TException {
1112
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1113
          throw new IllegalStateException("Method call not finished!");
1114
        }
1115
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1116
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1117
        return (new Client(prot)).recv_getCouponUsageCountByUser();
1118
      }
1982 varun.gupt 1119
    }
1120
 
6497 amit.gupta 1121
    public void getActiveCodes(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getActiveCodes_call> resultHandler) throws org.apache.thrift.TException {
1122
      checkReady();
1123
      getActiveCodes_call method_call = new getActiveCodes_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
1124
      this.___currentMethod = method_call;
1125
      ___manager.call(method_call);
1126
    }
1127
 
1128
    public static class getActiveCodes_call extends org.apache.thrift.async.TAsyncMethodCall {
1129
      private long promotionId;
1130
      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 {
1131
        super(client, protocolFactory, transport, resultHandler, false);
1132
        this.promotionId = promotionId;
1133
      }
1134
 
1135
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1136
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getActiveCodes", org.apache.thrift.protocol.TMessageType.CALL, 0));
1137
        getActiveCodes_args args = new getActiveCodes_args();
1138
        args.setPromotionId(promotionId);
1139
        args.write(prot);
1140
        prot.writeMessageEnd();
1141
      }
1142
 
1143
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
1144
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1145
          throw new IllegalStateException("Method call not finished!");
1146
        }
1147
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1148
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1149
        return (new Client(prot)).recv_getActiveCodes();
1150
      }
1151
    }
1152
 
1153
    public void deleteCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<deleteCoupon_call> resultHandler) throws org.apache.thrift.TException {
1154
      checkReady();
1155
      deleteCoupon_call method_call = new deleteCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
1156
      this.___currentMethod = method_call;
1157
      ___manager.call(method_call);
1158
    }
1159
 
1160
    public static class deleteCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1161
      private String couponCode;
1162
      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 {
1163
        super(client, protocolFactory, transport, resultHandler, false);
1164
        this.couponCode = couponCode;
1165
      }
1166
 
1167
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1168
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1169
        deleteCoupon_args args = new deleteCoupon_args();
1170
        args.setCouponCode(couponCode);
1171
        args.write(prot);
1172
        prot.writeMessageEnd();
1173
      }
1174
 
1175
      public void getResult() throws PromotionException, org.apache.thrift.TException {
1176
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1177
          throw new IllegalStateException("Method call not finished!");
1178
        }
1179
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1180
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1181
        (new Client(prot)).recv_deleteCoupon();
1182
      }
1183
    }
1184
 
3430 rajveer 1185
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException {
1186
      checkReady();
1187
      getActiveCoupons_call method_call = new getActiveCoupons_call(resultHandler, this, ___protocolFactory, ___transport);
1188
      this.___currentMethod = method_call;
1189
      ___manager.call(method_call);
1982 varun.gupt 1190
    }
1191
 
3430 rajveer 1192
    public static class getActiveCoupons_call extends org.apache.thrift.async.TAsyncMethodCall {
1193
      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 {
1194
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 1195
      }
1196
 
3430 rajveer 1197
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1198
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getActiveCoupons", org.apache.thrift.protocol.TMessageType.CALL, 0));
1199
        getActiveCoupons_args args = new getActiveCoupons_args();
1200
        args.write(prot);
1201
        prot.writeMessageEnd();
1202
      }
1982 varun.gupt 1203
 
3430 rajveer 1204
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
1205
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1206
          throw new IllegalStateException("Method call not finished!");
1207
        }
1208
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1209
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1210
        return (new Client(prot)).recv_getActiveCoupons();
1982 varun.gupt 1211
      }
1212
    }
1213
 
6730 anupam.sin 1214
    public void createCoupon(long promotionId, String couponCode, String arguments, boolean isCod, String prefix, org.apache.thrift.async.AsyncMethodCallback<createCoupon_call> resultHandler) throws org.apache.thrift.TException {
6250 amit.gupta 1215
      checkReady();
6730 anupam.sin 1216
      createCoupon_call method_call = new createCoupon_call(promotionId, couponCode, arguments, isCod, prefix, resultHandler, this, ___protocolFactory, ___transport);
6250 amit.gupta 1217
      this.___currentMethod = method_call;
1218
      ___manager.call(method_call);
1219
    }
1220
 
1221
    public static class createCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1222
      private long promotionId;
6730 anupam.sin 1223
      private String couponCode;
6679 anupam.sin 1224
      private String arguments;
6356 amit.gupta 1225
      private boolean isCod;
6561 amit.gupta 1226
      private String prefix;
6730 anupam.sin 1227
      public createCoupon_call(long promotionId, String couponCode, String arguments, boolean isCod, String prefix, org.apache.thrift.async.AsyncMethodCallback<createCoupon_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
6250 amit.gupta 1228
        super(client, protocolFactory, transport, resultHandler, false);
1229
        this.promotionId = promotionId;
6730 anupam.sin 1230
        this.couponCode = couponCode;
6679 anupam.sin 1231
        this.arguments = arguments;
6356 amit.gupta 1232
        this.isCod = isCod;
6561 amit.gupta 1233
        this.prefix = prefix;
6250 amit.gupta 1234
      }
1235
 
1236
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1237
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1238
        createCoupon_args args = new createCoupon_args();
1239
        args.setPromotionId(promotionId);
6730 anupam.sin 1240
        args.setCouponCode(couponCode);
6679 anupam.sin 1241
        args.setArguments(arguments);
6356 amit.gupta 1242
        args.setIsCod(isCod);
6561 amit.gupta 1243
        args.setPrefix(prefix);
6250 amit.gupta 1244
        args.write(prot);
1245
        prot.writeMessageEnd();
1246
      }
1247
 
1248
      public String getResult() throws PromotionException, org.apache.thrift.TException {
1249
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1250
          throw new IllegalStateException("Method call not finished!");
1251
        }
1252
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1253
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1254
        return (new Client(prot)).recv_createCoupon();
1255
      }
1256
    }
1257
 
3430 rajveer 1258
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException {
1259
      checkReady();
1260
      getSuccessfulPaymentCountForCoupon_call method_call = new getSuccessfulPaymentCountForCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
1261
      this.___currentMethod = method_call;
1262
      ___manager.call(method_call);
1982 varun.gupt 1263
    }
1264
 
3430 rajveer 1265
    public static class getSuccessfulPaymentCountForCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1266
      private String couponCode;
1267
      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 {
1268
        super(client, protocolFactory, transport, resultHandler, false);
1269
        this.couponCode = couponCode;
1982 varun.gupt 1270
      }
1271
 
3430 rajveer 1272
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1273
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSuccessfulPaymentCountForCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1274
        getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
1275
        args.setCouponCode(couponCode);
1276
        args.write(prot);
1277
        prot.writeMessageEnd();
1278
      }
1982 varun.gupt 1279
 
3430 rajveer 1280
      public long getResult() throws PromotionException, org.apache.thrift.TException {
1281
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1282
          throw new IllegalStateException("Method call not finished!");
1283
        }
1284
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1285
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1286
        return (new Client(prot)).recv_getSuccessfulPaymentCountForCoupon();
1287
      }
1982 varun.gupt 1288
    }
1289
 
3430 rajveer 1290
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<getRuleDocString_call> resultHandler) throws org.apache.thrift.TException {
1291
      checkReady();
1292
      getRuleDocString_call method_call = new getRuleDocString_call(ruleName, resultHandler, this, ___protocolFactory, ___transport);
1293
      this.___currentMethod = method_call;
1294
      ___manager.call(method_call);
1982 varun.gupt 1295
    }
1296
 
3430 rajveer 1297
    public static class getRuleDocString_call extends org.apache.thrift.async.TAsyncMethodCall {
1298
      private String ruleName;
1299
      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 {
1300
        super(client, protocolFactory, transport, resultHandler, false);
1301
        this.ruleName = ruleName;
1302
      }
1982 varun.gupt 1303
 
3430 rajveer 1304
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1305
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRuleDocString", org.apache.thrift.protocol.TMessageType.CALL, 0));
1306
        getRuleDocString_args args = new getRuleDocString_args();
1307
        args.setRuleName(ruleName);
1308
        args.write(prot);
1309
        prot.writeMessageEnd();
1982 varun.gupt 1310
      }
1311
 
3430 rajveer 1312
      public String getResult() throws org.apache.thrift.TException {
1313
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1314
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 1315
        }
3430 rajveer 1316
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1317
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1318
        return (new Client(prot)).recv_getRuleDocString();
1982 varun.gupt 1319
      }
1320
    }
1321
 
4189 varun.gupt 1322
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException {
1323
      checkReady();
1324
      getItemDiscountMap_call method_call = new getItemDiscountMap_call(itemIds, resultHandler, this, ___protocolFactory, ___transport);
1325
      this.___currentMethod = method_call;
1326
      ___manager.call(method_call);
1327
    }
1328
 
1329
    public static class getItemDiscountMap_call extends org.apache.thrift.async.TAsyncMethodCall {
1330
      private List<Long> itemIds;
1331
      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 {
1332
        super(client, protocolFactory, transport, resultHandler, false);
1333
        this.itemIds = itemIds;
1334
      }
1335
 
1336
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1337
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getItemDiscountMap", org.apache.thrift.protocol.TMessageType.CALL, 0));
1338
        getItemDiscountMap_args args = new getItemDiscountMap_args();
1339
        args.setItemIds(itemIds);
1340
        args.write(prot);
1341
        prot.writeMessageEnd();
1342
      }
1343
 
1344
      public List<ItemCouponDiscount> getResult() throws PromotionException, org.apache.thrift.TException {
1345
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1346
          throw new IllegalStateException("Method call not finished!");
1347
        }
1348
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1349
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1350
        return (new Client(prot)).recv_getItemDiscountMap();
1351
      }
1352
    }
1353
 
4494 varun.gupt 1354
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException {
1355
      checkReady();
1356
      getDiscountsForEntity_call method_call = new getDiscountsForEntity_call(entityId, resultHandler, this, ___protocolFactory, ___transport);
1357
      this.___currentMethod = method_call;
1358
      ___manager.call(method_call);
1359
    }
1360
 
1361
    public static class getDiscountsForEntity_call extends org.apache.thrift.async.TAsyncMethodCall {
1362
      private long entityId;
1363
      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 {
1364
        super(client, protocolFactory, transport, resultHandler, false);
1365
        this.entityId = entityId;
1366
      }
1367
 
1368
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1369
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getDiscountsForEntity", org.apache.thrift.protocol.TMessageType.CALL, 0));
1370
        getDiscountsForEntity_args args = new getDiscountsForEntity_args();
1371
        args.setEntityId(entityId);
1372
        args.write(prot);
1373
        prot.writeMessageEnd();
1374
      }
1375
 
1376
      public Map<String,Double> getResult() throws org.apache.thrift.TException {
1377
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1378
          throw new IllegalStateException("Method call not finished!");
1379
        }
1380
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1381
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1382
        return (new Client(prot)).recv_getDiscountsForEntity();
1383
      }
1384
    }
1385
 
5469 rajveer 1386
    public void addVoucher(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<addVoucher_call> resultHandler) throws org.apache.thrift.TException {
1387
      checkReady();
1388
      addVoucher_call method_call = new addVoucher_call(voucher, resultHandler, this, ___protocolFactory, ___transport);
1389
      this.___currentMethod = method_call;
1390
      ___manager.call(method_call);
1391
    }
1392
 
1393
    public static class addVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
1394
      private Voucher voucher;
1395
      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 {
1396
        super(client, protocolFactory, transport, resultHandler, false);
1397
        this.voucher = voucher;
1398
      }
1399
 
1400
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1401
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
1402
        addVoucher_args args = new addVoucher_args();
1403
        args.setVoucher(voucher);
1404
        args.write(prot);
1405
        prot.writeMessageEnd();
1406
      }
1407
 
1408
      public void getResult() throws org.apache.thrift.TException {
1409
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1410
          throw new IllegalStateException("Method call not finished!");
1411
        }
1412
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1413
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1414
        (new Client(prot)).recv_addVoucher();
1415
      }
1416
    }
1417
 
1418
    public void assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount, org.apache.thrift.async.AsyncMethodCallback<assignVoucher_call> resultHandler) throws org.apache.thrift.TException {
1419
      checkReady();
1420
      assignVoucher_call method_call = new assignVoucher_call(userId, userEmail, voucherType, amount, resultHandler, this, ___protocolFactory, ___transport);
1421
      this.___currentMethod = method_call;
1422
      ___manager.call(method_call);
1423
    }
1424
 
1425
    public static class assignVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
1426
      private long userId;
1427
      private String userEmail;
1428
      private VoucherType voucherType;
1429
      private long amount;
1430
      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 {
1431
        super(client, protocolFactory, transport, resultHandler, false);
1432
        this.userId = userId;
1433
        this.userEmail = userEmail;
1434
        this.voucherType = voucherType;
1435
        this.amount = amount;
1436
      }
1437
 
1438
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1439
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("assignVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
1440
        assignVoucher_args args = new assignVoucher_args();
1441
        args.setUserId(userId);
1442
        args.setUserEmail(userEmail);
1443
        args.setVoucherType(voucherType);
1444
        args.setAmount(amount);
1445
        args.write(prot);
1446
        prot.writeMessageEnd();
1447
      }
1448
 
1449
      public Voucher getResult() throws org.apache.thrift.TException {
1450
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1451
          throw new IllegalStateException("Method call not finished!");
1452
        }
1453
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1454
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1455
        return (new Client(prot)).recv_assignVoucher();
1456
      }
1457
    }
1458
 
1459
    public void markVoucherAsRedeemed(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<markVoucherAsRedeemed_call> resultHandler) throws org.apache.thrift.TException {
1460
      checkReady();
1461
      markVoucherAsRedeemed_call method_call = new markVoucherAsRedeemed_call(voucherCode, redeemedOn, resultHandler, this, ___protocolFactory, ___transport);
1462
      this.___currentMethod = method_call;
1463
      ___manager.call(method_call);
1464
    }
1465
 
1466
    public static class markVoucherAsRedeemed_call extends org.apache.thrift.async.TAsyncMethodCall {
1467
      private String voucherCode;
1468
      private long redeemedOn;
1469
      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 {
1470
        super(client, protocolFactory, transport, resultHandler, false);
1471
        this.voucherCode = voucherCode;
1472
        this.redeemedOn = redeemedOn;
1473
      }
1474
 
1475
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1476
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("markVoucherAsRedeemed", org.apache.thrift.protocol.TMessageType.CALL, 0));
1477
        markVoucherAsRedeemed_args args = new markVoucherAsRedeemed_args();
1478
        args.setVoucherCode(voucherCode);
1479
        args.setRedeemedOn(redeemedOn);
1480
        args.write(prot);
1481
        prot.writeMessageEnd();
1482
      }
1483
 
1484
      public boolean getResult() throws org.apache.thrift.TException {
1485
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1486
          throw new IllegalStateException("Method call not finished!");
1487
        }
1488
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1489
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1490
        return (new Client(prot)).recv_markVoucherAsRedeemed();
1491
      }
1492
    }
1493
 
3430 rajveer 1494
  }
1982 varun.gupt 1495
 
3430 rajveer 1496
  public static class Processor<I extends Iface> extends in.shop2020.generic.GenericService.Processor implements org.apache.thrift.TProcessor {
1497
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
1498
    public Processor(I iface) {
1499
      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
1982 varun.gupt 1500
    }
1501
 
3430 rajveer 1502
    protected Processor(I iface, Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
1503
      super(iface, getProcessMap(processMap));
1982 varun.gupt 1504
    }
1505
 
3430 rajveer 1506
    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) {
1507
      processMap.put("createPromotion", new createPromotion());
6301 amit.gupta 1508
      processMap.put("getCoupon", new getCoupon());
1509
      processMap.put("isGiftVoucher", new isGiftVoucher());
6356 amit.gupta 1510
      processMap.put("isCodApplicable", new isCodApplicable());
3430 rajveer 1511
      processMap.put("getAllPromotions", new getAllPromotions());
1512
      processMap.put("getPromotionById", new getPromotionById());
1513
      processMap.put("generateCouponsForPromotion", new generateCouponsForPromotion());
1514
      processMap.put("applyCoupon", new applyCoupon());
6433 anupam.sin 1515
      processMap.put("applyRechargeCoupon", new applyRechargeCoupon());
3430 rajveer 1516
      processMap.put("trackCouponUsage", new trackCouponUsage());
1517
      processMap.put("getCouponUsageCountByUser", new getCouponUsageCountByUser());
6497 amit.gupta 1518
      processMap.put("getActiveCodes", new getActiveCodes());
1519
      processMap.put("deleteCoupon", new deleteCoupon());
3430 rajveer 1520
      processMap.put("getActiveCoupons", new getActiveCoupons());
6250 amit.gupta 1521
      processMap.put("createCoupon", new createCoupon());
3430 rajveer 1522
      processMap.put("getSuccessfulPaymentCountForCoupon", new getSuccessfulPaymentCountForCoupon());
1523
      processMap.put("getRuleDocString", new getRuleDocString());
4189 varun.gupt 1524
      processMap.put("getItemDiscountMap", new getItemDiscountMap());
4494 varun.gupt 1525
      processMap.put("getDiscountsForEntity", new getDiscountsForEntity());
5469 rajveer 1526
      processMap.put("addVoucher", new addVoucher());
1527
      processMap.put("assignVoucher", new assignVoucher());
1528
      processMap.put("markVoucherAsRedeemed", new markVoucherAsRedeemed());
3430 rajveer 1529
      return processMap;
1982 varun.gupt 1530
    }
1531
 
3430 rajveer 1532
    private static class createPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createPromotion_args> {
1533
      public createPromotion() {
1534
        super("createPromotion");
1535
      }
1982 varun.gupt 1536
 
3430 rajveer 1537
      protected createPromotion_args getEmptyArgsInstance() {
1538
        return new createPromotion_args();
1539
      }
1982 varun.gupt 1540
 
3430 rajveer 1541
      protected createPromotion_result getResult(I iface, createPromotion_args args) throws org.apache.thrift.TException {
1542
        createPromotion_result result = new createPromotion_result();
1543
        try {
1544
          iface.createPromotion(args.name, args.ruleExecutionSrc, args.startOn, args.endOn);
1545
        } catch (PromotionException pex) {
1546
          result.pex = pex;
1982 varun.gupt 1547
        }
3430 rajveer 1548
        return result;
1982 varun.gupt 1549
      }
3430 rajveer 1550
    }
1982 varun.gupt 1551
 
6301 amit.gupta 1552
    private static class getCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCoupon_args> {
1553
      public getCoupon() {
1554
        super("getCoupon");
1555
      }
1556
 
1557
      protected getCoupon_args getEmptyArgsInstance() {
1558
        return new getCoupon_args();
1559
      }
1560
 
1561
      protected getCoupon_result getResult(I iface, getCoupon_args args) throws org.apache.thrift.TException {
1562
        getCoupon_result result = new getCoupon_result();
1563
        try {
1564
          result.success = iface.getCoupon(args.couponCode);
1565
        } catch (PromotionException pex) {
1566
          result.pex = pex;
1567
        }
1568
        return result;
1569
      }
1570
    }
1571
 
1572
    private static class isGiftVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isGiftVoucher_args> {
1573
      public isGiftVoucher() {
1574
        super("isGiftVoucher");
1575
      }
1576
 
1577
      protected isGiftVoucher_args getEmptyArgsInstance() {
1578
        return new isGiftVoucher_args();
1579
      }
1580
 
1581
      protected isGiftVoucher_result getResult(I iface, isGiftVoucher_args args) throws org.apache.thrift.TException {
1582
        isGiftVoucher_result result = new isGiftVoucher_result();
1583
        try {
1584
          result.success = iface.isGiftVoucher(args.couponCode);
1585
          result.setSuccessIsSet(true);
1586
        } catch (PromotionException pex) {
1587
          result.pex = pex;
1588
        }
1589
        return result;
1590
      }
1591
    }
1592
 
6356 amit.gupta 1593
    private static class isCodApplicable<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isCodApplicable_args> {
1594
      public isCodApplicable() {
1595
        super("isCodApplicable");
1596
      }
1597
 
1598
      protected isCodApplicable_args getEmptyArgsInstance() {
1599
        return new isCodApplicable_args();
1600
      }
1601
 
1602
      protected isCodApplicable_result getResult(I iface, isCodApplicable_args args) throws org.apache.thrift.TException {
1603
        isCodApplicable_result result = new isCodApplicable_result();
1604
        try {
1605
          result.success = iface.isCodApplicable(args.couponCode);
1606
          result.setSuccessIsSet(true);
1607
        } catch (PromotionException pex) {
1608
          result.pex = pex;
1609
        }
1610
        return result;
1611
      }
1612
    }
1613
 
3430 rajveer 1614
    private static class getAllPromotions<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllPromotions_args> {
1615
      public getAllPromotions() {
1616
        super("getAllPromotions");
1982 varun.gupt 1617
      }
1618
 
3430 rajveer 1619
      protected getAllPromotions_args getEmptyArgsInstance() {
1620
        return new getAllPromotions_args();
1982 varun.gupt 1621
      }
1622
 
3430 rajveer 1623
      protected getAllPromotions_result getResult(I iface, getAllPromotions_args args) throws org.apache.thrift.TException {
1624
        getAllPromotions_result result = new getAllPromotions_result();
1625
        try {
1626
          result.success = iface.getAllPromotions();
1627
        } catch (PromotionException pex) {
1628
          result.pex = pex;
1629
        }
1630
        return result;
1982 varun.gupt 1631
      }
3430 rajveer 1632
    }
1982 varun.gupt 1633
 
3430 rajveer 1634
    private static class getPromotionById<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPromotionById_args> {
1635
      public getPromotionById() {
1636
        super("getPromotionById");
1982 varun.gupt 1637
      }
1638
 
3430 rajveer 1639
      protected getPromotionById_args getEmptyArgsInstance() {
1640
        return new getPromotionById_args();
1982 varun.gupt 1641
      }
1642
 
3430 rajveer 1643
      protected getPromotionById_result getResult(I iface, getPromotionById_args args) throws org.apache.thrift.TException {
1644
        getPromotionById_result result = new getPromotionById_result();
1645
        try {
1646
          result.success = iface.getPromotionById(args.promotionId);
1647
        } catch (PromotionException pex) {
1648
          result.pex = pex;
1649
        }
1650
        return result;
1982 varun.gupt 1651
      }
1652
    }
1653
 
3430 rajveer 1654
    private static class generateCouponsForPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, generateCouponsForPromotion_args> {
1655
      public generateCouponsForPromotion() {
1656
        super("generateCouponsForPromotion");
1657
      }
1982 varun.gupt 1658
 
3430 rajveer 1659
      protected generateCouponsForPromotion_args getEmptyArgsInstance() {
1660
        return new generateCouponsForPromotion_args();
1661
      }
1982 varun.gupt 1662
 
3430 rajveer 1663
      protected generateCouponsForPromotion_result getResult(I iface, generateCouponsForPromotion_args args) throws org.apache.thrift.TException {
1664
        generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
1665
        try {
1666
          iface.generateCouponsForPromotion(args.promotionId, args.couponCode);
1667
        } catch (PromotionException pex) {
1668
          result.pex = pex;
1669
        }
1670
        return result;
1671
      }
1982 varun.gupt 1672
    }
1673
 
3430 rajveer 1674
    private static class applyCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, applyCoupon_args> {
1675
      public applyCoupon() {
1676
        super("applyCoupon");
1677
      }
1982 varun.gupt 1678
 
3430 rajveer 1679
      protected applyCoupon_args getEmptyArgsInstance() {
1680
        return new applyCoupon_args();
1681
      }
1982 varun.gupt 1682
 
3430 rajveer 1683
      protected applyCoupon_result getResult(I iface, applyCoupon_args args) throws org.apache.thrift.TException {
1684
        applyCoupon_result result = new applyCoupon_result();
1685
        try {
1686
          result.success = iface.applyCoupon(args.couponCode, args.cartId);
1687
        } catch (PromotionException pex) {
1688
          result.pex = pex;
1689
        }
1690
        return result;
1982 varun.gupt 1691
      }
1692
    }
1693
 
6433 anupam.sin 1694
    private static class applyRechargeCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, applyRechargeCoupon_args> {
1695
      public applyRechargeCoupon() {
1696
        super("applyRechargeCoupon");
1697
      }
1698
 
1699
      protected applyRechargeCoupon_args getEmptyArgsInstance() {
1700
        return new applyRechargeCoupon_args();
1701
      }
1702
 
1703
      protected applyRechargeCoupon_result getResult(I iface, applyRechargeCoupon_args args) throws org.apache.thrift.TException {
1704
        applyRechargeCoupon_result result = new applyRechargeCoupon_result();
1705
        try {
1706
          result.success = iface.applyRechargeCoupon(args.couponCode, args.totalAmount, args.userId);
1707
        } catch (PromotionException pex) {
1708
          result.pex = pex;
1709
        }
1710
        return result;
1711
      }
1712
    }
1713
 
3430 rajveer 1714
    private static class trackCouponUsage<I extends Iface> extends org.apache.thrift.ProcessFunction<I, trackCouponUsage_args> {
1715
      public trackCouponUsage() {
1716
        super("trackCouponUsage");
1717
      }
1982 varun.gupt 1718
 
3430 rajveer 1719
      protected trackCouponUsage_args getEmptyArgsInstance() {
1720
        return new trackCouponUsage_args();
1982 varun.gupt 1721
      }
1722
 
3430 rajveer 1723
      protected trackCouponUsage_result getResult(I iface, trackCouponUsage_args args) throws org.apache.thrift.TException {
1724
        trackCouponUsage_result result = new trackCouponUsage_result();
1725
        try {
1726
          iface.trackCouponUsage(args.couponCode, args.transactionId, args.userId);
1727
        } catch (PromotionException pex) {
1728
          result.pex = pex;
1729
        }
1730
        return result;
1731
      }
1982 varun.gupt 1732
    }
1733
 
3430 rajveer 1734
    private static class getCouponUsageCountByUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCouponUsageCountByUser_args> {
1735
      public getCouponUsageCountByUser() {
1736
        super("getCouponUsageCountByUser");
1982 varun.gupt 1737
      }
1738
 
3430 rajveer 1739
      protected getCouponUsageCountByUser_args getEmptyArgsInstance() {
1740
        return new getCouponUsageCountByUser_args();
1741
      }
1982 varun.gupt 1742
 
3430 rajveer 1743
      protected getCouponUsageCountByUser_result getResult(I iface, getCouponUsageCountByUser_args args) throws org.apache.thrift.TException {
1744
        getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
1745
        try {
1746
          result.success = iface.getCouponUsageCountByUser(args.couponCode, args.userId);
1747
          result.setSuccessIsSet(true);
1748
        } catch (PromotionException pex) {
1749
          result.pex = pex;
1750
        }
1751
        return result;
1752
      }
1982 varun.gupt 1753
    }
1754
 
6497 amit.gupta 1755
    private static class getActiveCodes<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getActiveCodes_args> {
1756
      public getActiveCodes() {
1757
        super("getActiveCodes");
1758
      }
1759
 
1760
      protected getActiveCodes_args getEmptyArgsInstance() {
1761
        return new getActiveCodes_args();
1762
      }
1763
 
1764
      protected getActiveCodes_result getResult(I iface, getActiveCodes_args args) throws org.apache.thrift.TException {
1765
        getActiveCodes_result result = new getActiveCodes_result();
1766
        try {
1767
          result.success = iface.getActiveCodes(args.promotionId);
1768
        } catch (PromotionException pex) {
1769
          result.pex = pex;
1770
        }
1771
        return result;
1772
      }
1773
    }
1774
 
1775
    private static class deleteCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, deleteCoupon_args> {
1776
      public deleteCoupon() {
1777
        super("deleteCoupon");
1778
      }
1779
 
1780
      protected deleteCoupon_args getEmptyArgsInstance() {
1781
        return new deleteCoupon_args();
1782
      }
1783
 
1784
      protected deleteCoupon_result getResult(I iface, deleteCoupon_args args) throws org.apache.thrift.TException {
1785
        deleteCoupon_result result = new deleteCoupon_result();
1786
        try {
1787
          iface.deleteCoupon(args.couponCode);
1788
        } catch (PromotionException pex) {
1789
          result.pex = pex;
1790
        }
1791
        return result;
1792
      }
1793
    }
1794
 
3430 rajveer 1795
    private static class getActiveCoupons<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getActiveCoupons_args> {
1796
      public getActiveCoupons() {
1797
        super("getActiveCoupons");
1798
      }
1982 varun.gupt 1799
 
3430 rajveer 1800
      protected getActiveCoupons_args getEmptyArgsInstance() {
1801
        return new getActiveCoupons_args();
1802
      }
1982 varun.gupt 1803
 
3430 rajveer 1804
      protected getActiveCoupons_result getResult(I iface, getActiveCoupons_args args) throws org.apache.thrift.TException {
1805
        getActiveCoupons_result result = new getActiveCoupons_result();
1806
        try {
1807
          result.success = iface.getActiveCoupons();
1808
        } catch (PromotionException pex) {
1809
          result.pex = pex;
1810
        }
1811
        return result;
1812
      }
1982 varun.gupt 1813
    }
1814
 
6250 amit.gupta 1815
    private static class createCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createCoupon_args> {
1816
      public createCoupon() {
1817
        super("createCoupon");
1818
      }
1819
 
1820
      protected createCoupon_args getEmptyArgsInstance() {
1821
        return new createCoupon_args();
1822
      }
1823
 
1824
      protected createCoupon_result getResult(I iface, createCoupon_args args) throws org.apache.thrift.TException {
1825
        createCoupon_result result = new createCoupon_result();
1826
        try {
6730 anupam.sin 1827
          result.success = iface.createCoupon(args.promotionId, args.couponCode, args.arguments, args.isCod, args.prefix);
6250 amit.gupta 1828
        } catch (PromotionException pex) {
1829
          result.pex = pex;
1830
        }
1831
        return result;
1832
      }
1833
    }
1834
 
3430 rajveer 1835
    private static class getSuccessfulPaymentCountForCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSuccessfulPaymentCountForCoupon_args> {
1836
      public getSuccessfulPaymentCountForCoupon() {
1837
        super("getSuccessfulPaymentCountForCoupon");
1982 varun.gupt 1838
      }
1839
 
3430 rajveer 1840
      protected getSuccessfulPaymentCountForCoupon_args getEmptyArgsInstance() {
1841
        return new getSuccessfulPaymentCountForCoupon_args();
1842
      }
1982 varun.gupt 1843
 
3430 rajveer 1844
      protected getSuccessfulPaymentCountForCoupon_result getResult(I iface, getSuccessfulPaymentCountForCoupon_args args) throws org.apache.thrift.TException {
1845
        getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
1846
        try {
1847
          result.success = iface.getSuccessfulPaymentCountForCoupon(args.couponCode);
1848
          result.setSuccessIsSet(true);
1849
        } catch (PromotionException pex) {
1850
          result.pex = pex;
1982 varun.gupt 1851
        }
3430 rajveer 1852
        return result;
1982 varun.gupt 1853
      }
1854
    }
1855
 
3430 rajveer 1856
    private static class getRuleDocString<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getRuleDocString_args> {
1857
      public getRuleDocString() {
1858
        super("getRuleDocString");
1859
      }
1982 varun.gupt 1860
 
3430 rajveer 1861
      protected getRuleDocString_args getEmptyArgsInstance() {
1862
        return new getRuleDocString_args();
1863
      }
1982 varun.gupt 1864
 
3430 rajveer 1865
      protected getRuleDocString_result getResult(I iface, getRuleDocString_args args) throws org.apache.thrift.TException {
1866
        getRuleDocString_result result = new getRuleDocString_result();
1867
        result.success = iface.getRuleDocString(args.ruleName);
1868
        return result;
1869
      }
1982 varun.gupt 1870
    }
1871
 
4189 varun.gupt 1872
    private static class getItemDiscountMap<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getItemDiscountMap_args> {
1873
      public getItemDiscountMap() {
1874
        super("getItemDiscountMap");
1875
      }
1876
 
1877
      protected getItemDiscountMap_args getEmptyArgsInstance() {
1878
        return new getItemDiscountMap_args();
1879
      }
1880
 
1881
      protected getItemDiscountMap_result getResult(I iface, getItemDiscountMap_args args) throws org.apache.thrift.TException {
1882
        getItemDiscountMap_result result = new getItemDiscountMap_result();
1883
        try {
1884
          result.success = iface.getItemDiscountMap(args.itemIds);
1885
        } catch (PromotionException pex) {
1886
          result.pex = pex;
1887
        }
1888
        return result;
1889
      }
1890
    }
1891
 
4494 varun.gupt 1892
    private static class getDiscountsForEntity<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getDiscountsForEntity_args> {
1893
      public getDiscountsForEntity() {
1894
        super("getDiscountsForEntity");
1895
      }
1896
 
1897
      protected getDiscountsForEntity_args getEmptyArgsInstance() {
1898
        return new getDiscountsForEntity_args();
1899
      }
1900
 
1901
      protected getDiscountsForEntity_result getResult(I iface, getDiscountsForEntity_args args) throws org.apache.thrift.TException {
1902
        getDiscountsForEntity_result result = new getDiscountsForEntity_result();
1903
        result.success = iface.getDiscountsForEntity(args.entityId);
1904
        return result;
1905
      }
1906
    }
1907
 
5469 rajveer 1908
    private static class addVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addVoucher_args> {
1909
      public addVoucher() {
1910
        super("addVoucher");
1911
      }
1912
 
1913
      protected addVoucher_args getEmptyArgsInstance() {
1914
        return new addVoucher_args();
1915
      }
1916
 
1917
      protected addVoucher_result getResult(I iface, addVoucher_args args) throws org.apache.thrift.TException {
1918
        addVoucher_result result = new addVoucher_result();
1919
        iface.addVoucher(args.voucher);
1920
        return result;
1921
      }
1922
    }
1923
 
1924
    private static class assignVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, assignVoucher_args> {
1925
      public assignVoucher() {
1926
        super("assignVoucher");
1927
      }
1928
 
1929
      protected assignVoucher_args getEmptyArgsInstance() {
1930
        return new assignVoucher_args();
1931
      }
1932
 
1933
      protected assignVoucher_result getResult(I iface, assignVoucher_args args) throws org.apache.thrift.TException {
1934
        assignVoucher_result result = new assignVoucher_result();
1935
        result.success = iface.assignVoucher(args.userId, args.userEmail, args.voucherType, args.amount);
1936
        return result;
1937
      }
1938
    }
1939
 
1940
    private static class markVoucherAsRedeemed<I extends Iface> extends org.apache.thrift.ProcessFunction<I, markVoucherAsRedeemed_args> {
1941
      public markVoucherAsRedeemed() {
1942
        super("markVoucherAsRedeemed");
1943
      }
1944
 
1945
      protected markVoucherAsRedeemed_args getEmptyArgsInstance() {
1946
        return new markVoucherAsRedeemed_args();
1947
      }
1948
 
1949
      protected markVoucherAsRedeemed_result getResult(I iface, markVoucherAsRedeemed_args args) throws org.apache.thrift.TException {
1950
        markVoucherAsRedeemed_result result = new markVoucherAsRedeemed_result();
1951
        result.success = iface.markVoucherAsRedeemed(args.voucherCode, args.redeemedOn);
1952
        result.setSuccessIsSet(true);
1953
        return result;
1954
      }
1955
    }
1956
 
1982 varun.gupt 1957
  }
1958
 
3430 rajveer 1959
  public static class createPromotion_args implements org.apache.thrift.TBase<createPromotion_args, createPromotion_args._Fields>, java.io.Serializable, Cloneable   {
1960
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_args");
1982 varun.gupt 1961
 
3430 rajveer 1962
    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);
1963
    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);
1964
    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);
1965
    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 1966
 
3430 rajveer 1967
    private String name; // required
1968
    private String ruleExecutionSrc; // required
1969
    private long startOn; // required
1970
    private long endOn; // required
1982 varun.gupt 1971
 
1972
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 1973
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 1974
      NAME((short)1, "name"),
1975
      RULE_EXECUTION_SRC((short)2, "ruleExecutionSrc"),
1976
      START_ON((short)3, "startOn"),
1977
      END_ON((short)4, "endOn");
1978
 
1979
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
1980
 
1981
      static {
1982
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1983
          byName.put(field.getFieldName(), field);
1984
        }
1985
      }
1986
 
1987
      /**
1988
       * Find the _Fields constant that matches fieldId, or null if its not found.
1989
       */
1990
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 1991
        switch(fieldId) {
1992
          case 1: // NAME
1993
            return NAME;
1994
          case 2: // RULE_EXECUTION_SRC
1995
            return RULE_EXECUTION_SRC;
1996
          case 3: // START_ON
1997
            return START_ON;
1998
          case 4: // END_ON
1999
            return END_ON;
2000
          default:
2001
            return null;
2002
        }
1982 varun.gupt 2003
      }
2004
 
2005
      /**
2006
       * Find the _Fields constant that matches fieldId, throwing an exception
2007
       * if it is not found.
2008
       */
2009
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2010
        _Fields fields = findByThriftId(fieldId);
2011
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2012
        return fields;
2013
      }
2014
 
2015
      /**
2016
       * Find the _Fields constant that matches name, or null if its not found.
2017
       */
2018
      public static _Fields findByName(String name) {
2019
        return byName.get(name);
2020
      }
2021
 
2022
      private final short _thriftId;
2023
      private final String _fieldName;
2024
 
2025
      _Fields(short thriftId, String fieldName) {
2026
        _thriftId = thriftId;
2027
        _fieldName = fieldName;
2028
      }
2029
 
2030
      public short getThriftFieldId() {
2031
        return _thriftId;
2032
      }
2033
 
2034
      public String getFieldName() {
2035
        return _fieldName;
2036
      }
2037
    }
2038
 
2039
    // isset id assignments
2040
    private static final int __STARTON_ISSET_ID = 0;
2041
    private static final int __ENDON_ISSET_ID = 1;
2042
    private BitSet __isset_bit_vector = new BitSet(2);
2043
 
3430 rajveer 2044
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2045
    static {
3430 rajveer 2046
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2047
      tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2048
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
2049
      tmpMap.put(_Fields.RULE_EXECUTION_SRC, new org.apache.thrift.meta_data.FieldMetaData("ruleExecutionSrc", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2050
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
2051
      tmpMap.put(_Fields.START_ON, new org.apache.thrift.meta_data.FieldMetaData("startOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2052
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
2053
      tmpMap.put(_Fields.END_ON, new org.apache.thrift.meta_data.FieldMetaData("endOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2054
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
2055
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2056
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_args.class, metaDataMap);
1982 varun.gupt 2057
    }
2058
 
2059
    public createPromotion_args() {
2060
    }
2061
 
2062
    public createPromotion_args(
2063
      String name,
2064
      String ruleExecutionSrc,
2065
      long startOn,
2066
      long endOn)
2067
    {
2068
      this();
2069
      this.name = name;
2070
      this.ruleExecutionSrc = ruleExecutionSrc;
2071
      this.startOn = startOn;
2072
      setStartOnIsSet(true);
2073
      this.endOn = endOn;
2074
      setEndOnIsSet(true);
2075
    }
2076
 
2077
    /**
2078
     * Performs a deep copy on <i>other</i>.
2079
     */
2080
    public createPromotion_args(createPromotion_args other) {
2081
      __isset_bit_vector.clear();
2082
      __isset_bit_vector.or(other.__isset_bit_vector);
2083
      if (other.isSetName()) {
2084
        this.name = other.name;
2085
      }
2086
      if (other.isSetRuleExecutionSrc()) {
2087
        this.ruleExecutionSrc = other.ruleExecutionSrc;
2088
      }
2089
      this.startOn = other.startOn;
2090
      this.endOn = other.endOn;
2091
    }
2092
 
2093
    public createPromotion_args deepCopy() {
2094
      return new createPromotion_args(this);
2095
    }
2096
 
3430 rajveer 2097
    @Override
2098
    public void clear() {
2099
      this.name = null;
2100
      this.ruleExecutionSrc = null;
2101
      setStartOnIsSet(false);
2102
      this.startOn = 0;
2103
      setEndOnIsSet(false);
2104
      this.endOn = 0;
1982 varun.gupt 2105
    }
2106
 
2107
    public String getName() {
2108
      return this.name;
2109
    }
2110
 
3430 rajveer 2111
    public void setName(String name) {
1982 varun.gupt 2112
      this.name = name;
2113
    }
2114
 
2115
    public void unsetName() {
2116
      this.name = null;
2117
    }
2118
 
3430 rajveer 2119
    /** Returns true if field name is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2120
    public boolean isSetName() {
2121
      return this.name != null;
2122
    }
2123
 
2124
    public void setNameIsSet(boolean value) {
2125
      if (!value) {
2126
        this.name = null;
2127
      }
2128
    }
2129
 
2130
    public String getRuleExecutionSrc() {
2131
      return this.ruleExecutionSrc;
2132
    }
2133
 
3430 rajveer 2134
    public void setRuleExecutionSrc(String ruleExecutionSrc) {
1982 varun.gupt 2135
      this.ruleExecutionSrc = ruleExecutionSrc;
2136
    }
2137
 
2138
    public void unsetRuleExecutionSrc() {
2139
      this.ruleExecutionSrc = null;
2140
    }
2141
 
3430 rajveer 2142
    /** Returns true if field ruleExecutionSrc is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2143
    public boolean isSetRuleExecutionSrc() {
2144
      return this.ruleExecutionSrc != null;
2145
    }
2146
 
2147
    public void setRuleExecutionSrcIsSet(boolean value) {
2148
      if (!value) {
2149
        this.ruleExecutionSrc = null;
2150
      }
2151
    }
2152
 
2153
    public long getStartOn() {
2154
      return this.startOn;
2155
    }
2156
 
3430 rajveer 2157
    public void setStartOn(long startOn) {
1982 varun.gupt 2158
      this.startOn = startOn;
2159
      setStartOnIsSet(true);
2160
    }
2161
 
2162
    public void unsetStartOn() {
2163
      __isset_bit_vector.clear(__STARTON_ISSET_ID);
2164
    }
2165
 
3430 rajveer 2166
    /** Returns true if field startOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2167
    public boolean isSetStartOn() {
2168
      return __isset_bit_vector.get(__STARTON_ISSET_ID);
2169
    }
2170
 
2171
    public void setStartOnIsSet(boolean value) {
2172
      __isset_bit_vector.set(__STARTON_ISSET_ID, value);
2173
    }
2174
 
2175
    public long getEndOn() {
2176
      return this.endOn;
2177
    }
2178
 
3430 rajveer 2179
    public void setEndOn(long endOn) {
1982 varun.gupt 2180
      this.endOn = endOn;
2181
      setEndOnIsSet(true);
2182
    }
2183
 
2184
    public void unsetEndOn() {
2185
      __isset_bit_vector.clear(__ENDON_ISSET_ID);
2186
    }
2187
 
3430 rajveer 2188
    /** Returns true if field endOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2189
    public boolean isSetEndOn() {
2190
      return __isset_bit_vector.get(__ENDON_ISSET_ID);
2191
    }
2192
 
2193
    public void setEndOnIsSet(boolean value) {
2194
      __isset_bit_vector.set(__ENDON_ISSET_ID, value);
2195
    }
2196
 
2197
    public void setFieldValue(_Fields field, Object value) {
2198
      switch (field) {
2199
      case NAME:
2200
        if (value == null) {
2201
          unsetName();
2202
        } else {
2203
          setName((String)value);
2204
        }
2205
        break;
2206
 
2207
      case RULE_EXECUTION_SRC:
2208
        if (value == null) {
2209
          unsetRuleExecutionSrc();
2210
        } else {
2211
          setRuleExecutionSrc((String)value);
2212
        }
2213
        break;
2214
 
2215
      case START_ON:
2216
        if (value == null) {
2217
          unsetStartOn();
2218
        } else {
2219
          setStartOn((Long)value);
2220
        }
2221
        break;
2222
 
2223
      case END_ON:
2224
        if (value == null) {
2225
          unsetEndOn();
2226
        } else {
2227
          setEndOn((Long)value);
2228
        }
2229
        break;
2230
 
2231
      }
2232
    }
2233
 
2234
    public Object getFieldValue(_Fields field) {
2235
      switch (field) {
2236
      case NAME:
2237
        return getName();
2238
 
2239
      case RULE_EXECUTION_SRC:
2240
        return getRuleExecutionSrc();
2241
 
2242
      case START_ON:
3430 rajveer 2243
        return Long.valueOf(getStartOn());
1982 varun.gupt 2244
 
2245
      case END_ON:
3430 rajveer 2246
        return Long.valueOf(getEndOn());
1982 varun.gupt 2247
 
2248
      }
2249
      throw new IllegalStateException();
2250
    }
2251
 
3430 rajveer 2252
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2253
    public boolean isSet(_Fields field) {
2254
      if (field == null) {
2255
        throw new IllegalArgumentException();
2256
      }
1982 varun.gupt 2257
 
2258
      switch (field) {
2259
      case NAME:
2260
        return isSetName();
2261
      case RULE_EXECUTION_SRC:
2262
        return isSetRuleExecutionSrc();
2263
      case START_ON:
2264
        return isSetStartOn();
2265
      case END_ON:
2266
        return isSetEndOn();
2267
      }
2268
      throw new IllegalStateException();
2269
    }
2270
 
2271
    @Override
2272
    public boolean equals(Object that) {
2273
      if (that == null)
2274
        return false;
2275
      if (that instanceof createPromotion_args)
2276
        return this.equals((createPromotion_args)that);
2277
      return false;
2278
    }
2279
 
2280
    public boolean equals(createPromotion_args that) {
2281
      if (that == null)
2282
        return false;
2283
 
2284
      boolean this_present_name = true && this.isSetName();
2285
      boolean that_present_name = true && that.isSetName();
2286
      if (this_present_name || that_present_name) {
2287
        if (!(this_present_name && that_present_name))
2288
          return false;
2289
        if (!this.name.equals(that.name))
2290
          return false;
2291
      }
2292
 
2293
      boolean this_present_ruleExecutionSrc = true && this.isSetRuleExecutionSrc();
2294
      boolean that_present_ruleExecutionSrc = true && that.isSetRuleExecutionSrc();
2295
      if (this_present_ruleExecutionSrc || that_present_ruleExecutionSrc) {
2296
        if (!(this_present_ruleExecutionSrc && that_present_ruleExecutionSrc))
2297
          return false;
2298
        if (!this.ruleExecutionSrc.equals(that.ruleExecutionSrc))
2299
          return false;
2300
      }
2301
 
2302
      boolean this_present_startOn = true;
2303
      boolean that_present_startOn = true;
2304
      if (this_present_startOn || that_present_startOn) {
2305
        if (!(this_present_startOn && that_present_startOn))
2306
          return false;
2307
        if (this.startOn != that.startOn)
2308
          return false;
2309
      }
2310
 
2311
      boolean this_present_endOn = true;
2312
      boolean that_present_endOn = true;
2313
      if (this_present_endOn || that_present_endOn) {
2314
        if (!(this_present_endOn && that_present_endOn))
2315
          return false;
2316
        if (this.endOn != that.endOn)
2317
          return false;
2318
      }
2319
 
2320
      return true;
2321
    }
2322
 
2323
    @Override
2324
    public int hashCode() {
2325
      return 0;
2326
    }
2327
 
2328
    public int compareTo(createPromotion_args other) {
2329
      if (!getClass().equals(other.getClass())) {
2330
        return getClass().getName().compareTo(other.getClass().getName());
2331
      }
2332
 
2333
      int lastComparison = 0;
2334
      createPromotion_args typedOther = (createPromotion_args)other;
2335
 
3430 rajveer 2336
      lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
1982 varun.gupt 2337
      if (lastComparison != 0) {
2338
        return lastComparison;
2339
      }
3430 rajveer 2340
      if (isSetName()) {
2341
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
2342
        if (lastComparison != 0) {
2343
          return lastComparison;
2344
        }
1982 varun.gupt 2345
      }
3430 rajveer 2346
      lastComparison = Boolean.valueOf(isSetRuleExecutionSrc()).compareTo(typedOther.isSetRuleExecutionSrc());
1982 varun.gupt 2347
      if (lastComparison != 0) {
2348
        return lastComparison;
2349
      }
3430 rajveer 2350
      if (isSetRuleExecutionSrc()) {
2351
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleExecutionSrc, typedOther.ruleExecutionSrc);
2352
        if (lastComparison != 0) {
2353
          return lastComparison;
2354
        }
1982 varun.gupt 2355
      }
3430 rajveer 2356
      lastComparison = Boolean.valueOf(isSetStartOn()).compareTo(typedOther.isSetStartOn());
1982 varun.gupt 2357
      if (lastComparison != 0) {
2358
        return lastComparison;
2359
      }
3430 rajveer 2360
      if (isSetStartOn()) {
2361
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startOn, typedOther.startOn);
2362
        if (lastComparison != 0) {
2363
          return lastComparison;
2364
        }
1982 varun.gupt 2365
      }
3430 rajveer 2366
      lastComparison = Boolean.valueOf(isSetEndOn()).compareTo(typedOther.isSetEndOn());
1982 varun.gupt 2367
      if (lastComparison != 0) {
2368
        return lastComparison;
2369
      }
3430 rajveer 2370
      if (isSetEndOn()) {
2371
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endOn, typedOther.endOn);
2372
        if (lastComparison != 0) {
2373
          return lastComparison;
2374
        }
1982 varun.gupt 2375
      }
2376
      return 0;
2377
    }
2378
 
3430 rajveer 2379
    public _Fields fieldForId(int fieldId) {
2380
      return _Fields.findByThriftId(fieldId);
2381
    }
2382
 
2383
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2384
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2385
      iprot.readStructBegin();
2386
      while (true)
2387
      {
2388
        field = iprot.readFieldBegin();
3430 rajveer 2389
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2390
          break;
2391
        }
3430 rajveer 2392
        switch (field.id) {
2393
          case 1: // NAME
2394
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
2395
              this.name = iprot.readString();
2396
            } else { 
2397
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2398
            }
2399
            break;
2400
          case 2: // RULE_EXECUTION_SRC
2401
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
2402
              this.ruleExecutionSrc = iprot.readString();
2403
            } else { 
2404
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2405
            }
2406
            break;
2407
          case 3: // START_ON
2408
            if (field.type == org.apache.thrift.protocol.TType.I64) {
2409
              this.startOn = iprot.readI64();
2410
              setStartOnIsSet(true);
2411
            } else { 
2412
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2413
            }
2414
            break;
2415
          case 4: // END_ON
2416
            if (field.type == org.apache.thrift.protocol.TType.I64) {
2417
              this.endOn = iprot.readI64();
2418
              setEndOnIsSet(true);
2419
            } else { 
2420
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2421
            }
2422
            break;
2423
          default:
2424
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2425
        }
3430 rajveer 2426
        iprot.readFieldEnd();
1982 varun.gupt 2427
      }
2428
      iprot.readStructEnd();
2429
      validate();
2430
    }
2431
 
3430 rajveer 2432
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2433
      validate();
2434
 
2435
      oprot.writeStructBegin(STRUCT_DESC);
2436
      if (this.name != null) {
2437
        oprot.writeFieldBegin(NAME_FIELD_DESC);
2438
        oprot.writeString(this.name);
2439
        oprot.writeFieldEnd();
2440
      }
2441
      if (this.ruleExecutionSrc != null) {
2442
        oprot.writeFieldBegin(RULE_EXECUTION_SRC_FIELD_DESC);
2443
        oprot.writeString(this.ruleExecutionSrc);
2444
        oprot.writeFieldEnd();
2445
      }
2446
      oprot.writeFieldBegin(START_ON_FIELD_DESC);
2447
      oprot.writeI64(this.startOn);
2448
      oprot.writeFieldEnd();
2449
      oprot.writeFieldBegin(END_ON_FIELD_DESC);
2450
      oprot.writeI64(this.endOn);
2451
      oprot.writeFieldEnd();
2452
      oprot.writeFieldStop();
2453
      oprot.writeStructEnd();
2454
    }
2455
 
2456
    @Override
2457
    public String toString() {
2458
      StringBuilder sb = new StringBuilder("createPromotion_args(");
2459
      boolean first = true;
2460
 
2461
      sb.append("name:");
2462
      if (this.name == null) {
2463
        sb.append("null");
2464
      } else {
2465
        sb.append(this.name);
2466
      }
2467
      first = false;
2468
      if (!first) sb.append(", ");
2469
      sb.append("ruleExecutionSrc:");
2470
      if (this.ruleExecutionSrc == null) {
2471
        sb.append("null");
2472
      } else {
2473
        sb.append(this.ruleExecutionSrc);
2474
      }
2475
      first = false;
2476
      if (!first) sb.append(", ");
2477
      sb.append("startOn:");
2478
      sb.append(this.startOn);
2479
      first = false;
2480
      if (!first) sb.append(", ");
2481
      sb.append("endOn:");
2482
      sb.append(this.endOn);
2483
      first = false;
2484
      sb.append(")");
2485
      return sb.toString();
2486
    }
2487
 
3430 rajveer 2488
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2489
      // check for required fields
2490
    }
2491
 
3430 rajveer 2492
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2493
      try {
2494
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2495
      } catch (org.apache.thrift.TException te) {
2496
        throw new java.io.IOException(te);
2497
      }
2498
    }
2499
 
2500
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2501
      try {
2502
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
2503
        __isset_bit_vector = new BitSet(1);
2504
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2505
      } catch (org.apache.thrift.TException te) {
2506
        throw new java.io.IOException(te);
2507
      }
2508
    }
2509
 
1982 varun.gupt 2510
  }
2511
 
3430 rajveer 2512
  public static class createPromotion_result implements org.apache.thrift.TBase<createPromotion_result, createPromotion_result._Fields>, java.io.Serializable, Cloneable   {
2513
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_result");
1982 varun.gupt 2514
 
3430 rajveer 2515
    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 2516
 
3430 rajveer 2517
    private PromotionException pex; // required
1982 varun.gupt 2518
 
2519
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2520
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2521
      PEX((short)1, "pex");
2522
 
2523
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2524
 
2525
      static {
2526
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2527
          byName.put(field.getFieldName(), field);
2528
        }
2529
      }
2530
 
2531
      /**
2532
       * Find the _Fields constant that matches fieldId, or null if its not found.
2533
       */
2534
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2535
        switch(fieldId) {
2536
          case 1: // PEX
2537
            return PEX;
2538
          default:
2539
            return null;
2540
        }
1982 varun.gupt 2541
      }
2542
 
2543
      /**
2544
       * Find the _Fields constant that matches fieldId, throwing an exception
2545
       * if it is not found.
2546
       */
2547
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2548
        _Fields fields = findByThriftId(fieldId);
2549
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2550
        return fields;
2551
      }
2552
 
2553
      /**
2554
       * Find the _Fields constant that matches name, or null if its not found.
2555
       */
2556
      public static _Fields findByName(String name) {
2557
        return byName.get(name);
2558
      }
2559
 
2560
      private final short _thriftId;
2561
      private final String _fieldName;
2562
 
2563
      _Fields(short thriftId, String fieldName) {
2564
        _thriftId = thriftId;
2565
        _fieldName = fieldName;
2566
      }
2567
 
2568
      public short getThriftFieldId() {
2569
        return _thriftId;
2570
      }
2571
 
2572
      public String getFieldName() {
2573
        return _fieldName;
2574
      }
2575
    }
2576
 
2577
    // isset id assignments
2578
 
3430 rajveer 2579
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2580
    static {
3430 rajveer 2581
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2582
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2583
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
2584
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2585
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_result.class, metaDataMap);
1982 varun.gupt 2586
    }
2587
 
2588
    public createPromotion_result() {
2589
    }
2590
 
2591
    public createPromotion_result(
2592
      PromotionException pex)
2593
    {
2594
      this();
2595
      this.pex = pex;
2596
    }
2597
 
2598
    /**
2599
     * Performs a deep copy on <i>other</i>.
2600
     */
2601
    public createPromotion_result(createPromotion_result other) {
2602
      if (other.isSetPex()) {
2603
        this.pex = new PromotionException(other.pex);
2604
      }
2605
    }
2606
 
2607
    public createPromotion_result deepCopy() {
2608
      return new createPromotion_result(this);
2609
    }
2610
 
3430 rajveer 2611
    @Override
2612
    public void clear() {
2613
      this.pex = null;
1982 varun.gupt 2614
    }
2615
 
2616
    public PromotionException getPex() {
2617
      return this.pex;
2618
    }
2619
 
3430 rajveer 2620
    public void setPex(PromotionException pex) {
1982 varun.gupt 2621
      this.pex = pex;
2622
    }
2623
 
2624
    public void unsetPex() {
2625
      this.pex = null;
2626
    }
2627
 
3430 rajveer 2628
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2629
    public boolean isSetPex() {
2630
      return this.pex != null;
2631
    }
2632
 
2633
    public void setPexIsSet(boolean value) {
2634
      if (!value) {
2635
        this.pex = null;
2636
      }
2637
    }
2638
 
2639
    public void setFieldValue(_Fields field, Object value) {
2640
      switch (field) {
2641
      case PEX:
2642
        if (value == null) {
2643
          unsetPex();
2644
        } else {
2645
          setPex((PromotionException)value);
2646
        }
2647
        break;
2648
 
2649
      }
2650
    }
2651
 
2652
    public Object getFieldValue(_Fields field) {
2653
      switch (field) {
2654
      case PEX:
2655
        return getPex();
2656
 
2657
      }
2658
      throw new IllegalStateException();
2659
    }
2660
 
3430 rajveer 2661
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2662
    public boolean isSet(_Fields field) {
2663
      if (field == null) {
2664
        throw new IllegalArgumentException();
2665
      }
1982 varun.gupt 2666
 
2667
      switch (field) {
2668
      case PEX:
2669
        return isSetPex();
2670
      }
2671
      throw new IllegalStateException();
2672
    }
2673
 
2674
    @Override
2675
    public boolean equals(Object that) {
2676
      if (that == null)
2677
        return false;
2678
      if (that instanceof createPromotion_result)
2679
        return this.equals((createPromotion_result)that);
2680
      return false;
2681
    }
2682
 
2683
    public boolean equals(createPromotion_result that) {
2684
      if (that == null)
2685
        return false;
2686
 
2687
      boolean this_present_pex = true && this.isSetPex();
2688
      boolean that_present_pex = true && that.isSetPex();
2689
      if (this_present_pex || that_present_pex) {
2690
        if (!(this_present_pex && that_present_pex))
2691
          return false;
2692
        if (!this.pex.equals(that.pex))
2693
          return false;
2694
      }
2695
 
2696
      return true;
2697
    }
2698
 
2699
    @Override
2700
    public int hashCode() {
2701
      return 0;
2702
    }
2703
 
2704
    public int compareTo(createPromotion_result other) {
2705
      if (!getClass().equals(other.getClass())) {
2706
        return getClass().getName().compareTo(other.getClass().getName());
2707
      }
2708
 
2709
      int lastComparison = 0;
2710
      createPromotion_result typedOther = (createPromotion_result)other;
2711
 
3430 rajveer 2712
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 2713
      if (lastComparison != 0) {
2714
        return lastComparison;
2715
      }
3430 rajveer 2716
      if (isSetPex()) {
2717
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
2718
        if (lastComparison != 0) {
2719
          return lastComparison;
2720
        }
1982 varun.gupt 2721
      }
2722
      return 0;
2723
    }
2724
 
3430 rajveer 2725
    public _Fields fieldForId(int fieldId) {
2726
      return _Fields.findByThriftId(fieldId);
2727
    }
2728
 
2729
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2730
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2731
      iprot.readStructBegin();
2732
      while (true)
2733
      {
2734
        field = iprot.readFieldBegin();
3430 rajveer 2735
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2736
          break;
2737
        }
3430 rajveer 2738
        switch (field.id) {
2739
          case 1: // PEX
2740
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
2741
              this.pex = new PromotionException();
2742
              this.pex.read(iprot);
2743
            } else { 
2744
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2745
            }
2746
            break;
2747
          default:
2748
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2749
        }
3430 rajveer 2750
        iprot.readFieldEnd();
1982 varun.gupt 2751
      }
2752
      iprot.readStructEnd();
2753
      validate();
2754
    }
2755
 
3430 rajveer 2756
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2757
      oprot.writeStructBegin(STRUCT_DESC);
2758
 
2759
      if (this.isSetPex()) {
2760
        oprot.writeFieldBegin(PEX_FIELD_DESC);
2761
        this.pex.write(oprot);
2762
        oprot.writeFieldEnd();
2763
      }
2764
      oprot.writeFieldStop();
2765
      oprot.writeStructEnd();
2766
    }
2767
 
2768
    @Override
2769
    public String toString() {
2770
      StringBuilder sb = new StringBuilder("createPromotion_result(");
2771
      boolean first = true;
2772
 
2773
      sb.append("pex:");
2774
      if (this.pex == null) {
2775
        sb.append("null");
2776
      } else {
2777
        sb.append(this.pex);
2778
      }
2779
      first = false;
2780
      sb.append(")");
2781
      return sb.toString();
2782
    }
2783
 
3430 rajveer 2784
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2785
      // check for required fields
2786
    }
2787
 
3430 rajveer 2788
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2789
      try {
2790
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2791
      } catch (org.apache.thrift.TException te) {
2792
        throw new java.io.IOException(te);
2793
      }
2794
    }
2795
 
2796
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2797
      try {
2798
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2799
      } catch (org.apache.thrift.TException te) {
2800
        throw new java.io.IOException(te);
2801
      }
2802
    }
2803
 
1982 varun.gupt 2804
  }
2805
 
6301 amit.gupta 2806
  public static class getCoupon_args implements org.apache.thrift.TBase<getCoupon_args, getCoupon_args._Fields>, java.io.Serializable, Cloneable   {
2807
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCoupon_args");
2808
 
2809
    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);
2810
 
2811
    private String couponCode; // required
2812
 
2813
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2814
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
2815
      COUPON_CODE((short)1, "couponCode");
2816
 
2817
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2818
 
2819
      static {
2820
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2821
          byName.put(field.getFieldName(), field);
2822
        }
2823
      }
2824
 
2825
      /**
2826
       * Find the _Fields constant that matches fieldId, or null if its not found.
2827
       */
2828
      public static _Fields findByThriftId(int fieldId) {
2829
        switch(fieldId) {
2830
          case 1: // COUPON_CODE
2831
            return COUPON_CODE;
2832
          default:
2833
            return null;
2834
        }
2835
      }
2836
 
2837
      /**
2838
       * Find the _Fields constant that matches fieldId, throwing an exception
2839
       * if it is not found.
2840
       */
2841
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2842
        _Fields fields = findByThriftId(fieldId);
2843
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2844
        return fields;
2845
      }
2846
 
2847
      /**
2848
       * Find the _Fields constant that matches name, or null if its not found.
2849
       */
2850
      public static _Fields findByName(String name) {
2851
        return byName.get(name);
2852
      }
2853
 
2854
      private final short _thriftId;
2855
      private final String _fieldName;
2856
 
2857
      _Fields(short thriftId, String fieldName) {
2858
        _thriftId = thriftId;
2859
        _fieldName = fieldName;
2860
      }
2861
 
2862
      public short getThriftFieldId() {
2863
        return _thriftId;
2864
      }
2865
 
2866
      public String getFieldName() {
2867
        return _fieldName;
2868
      }
2869
    }
2870
 
2871
    // isset id assignments
2872
 
2873
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
2874
    static {
2875
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2876
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2877
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
2878
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2879
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCoupon_args.class, metaDataMap);
2880
    }
2881
 
2882
    public getCoupon_args() {
2883
    }
2884
 
2885
    public getCoupon_args(
2886
      String couponCode)
2887
    {
2888
      this();
2889
      this.couponCode = couponCode;
2890
    }
2891
 
2892
    /**
2893
     * Performs a deep copy on <i>other</i>.
2894
     */
2895
    public getCoupon_args(getCoupon_args other) {
2896
      if (other.isSetCouponCode()) {
2897
        this.couponCode = other.couponCode;
2898
      }
2899
    }
2900
 
2901
    public getCoupon_args deepCopy() {
2902
      return new getCoupon_args(this);
2903
    }
2904
 
2905
    @Override
2906
    public void clear() {
2907
      this.couponCode = null;
2908
    }
2909
 
2910
    public String getCouponCode() {
2911
      return this.couponCode;
2912
    }
2913
 
2914
    public void setCouponCode(String couponCode) {
2915
      this.couponCode = couponCode;
2916
    }
2917
 
2918
    public void unsetCouponCode() {
2919
      this.couponCode = null;
2920
    }
2921
 
2922
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
2923
    public boolean isSetCouponCode() {
2924
      return this.couponCode != null;
2925
    }
2926
 
2927
    public void setCouponCodeIsSet(boolean value) {
2928
      if (!value) {
2929
        this.couponCode = null;
2930
      }
2931
    }
2932
 
2933
    public void setFieldValue(_Fields field, Object value) {
2934
      switch (field) {
2935
      case COUPON_CODE:
2936
        if (value == null) {
2937
          unsetCouponCode();
2938
        } else {
2939
          setCouponCode((String)value);
2940
        }
2941
        break;
2942
 
2943
      }
2944
    }
2945
 
2946
    public Object getFieldValue(_Fields field) {
2947
      switch (field) {
2948
      case COUPON_CODE:
2949
        return getCouponCode();
2950
 
2951
      }
2952
      throw new IllegalStateException();
2953
    }
2954
 
2955
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2956
    public boolean isSet(_Fields field) {
2957
      if (field == null) {
2958
        throw new IllegalArgumentException();
2959
      }
2960
 
2961
      switch (field) {
2962
      case COUPON_CODE:
2963
        return isSetCouponCode();
2964
      }
2965
      throw new IllegalStateException();
2966
    }
2967
 
2968
    @Override
2969
    public boolean equals(Object that) {
2970
      if (that == null)
2971
        return false;
2972
      if (that instanceof getCoupon_args)
2973
        return this.equals((getCoupon_args)that);
2974
      return false;
2975
    }
2976
 
2977
    public boolean equals(getCoupon_args that) {
2978
      if (that == null)
2979
        return false;
2980
 
2981
      boolean this_present_couponCode = true && this.isSetCouponCode();
2982
      boolean that_present_couponCode = true && that.isSetCouponCode();
2983
      if (this_present_couponCode || that_present_couponCode) {
2984
        if (!(this_present_couponCode && that_present_couponCode))
2985
          return false;
2986
        if (!this.couponCode.equals(that.couponCode))
2987
          return false;
2988
      }
2989
 
2990
      return true;
2991
    }
2992
 
2993
    @Override
2994
    public int hashCode() {
2995
      return 0;
2996
    }
2997
 
2998
    public int compareTo(getCoupon_args other) {
2999
      if (!getClass().equals(other.getClass())) {
3000
        return getClass().getName().compareTo(other.getClass().getName());
3001
      }
3002
 
3003
      int lastComparison = 0;
3004
      getCoupon_args typedOther = (getCoupon_args)other;
3005
 
3006
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3007
      if (lastComparison != 0) {
3008
        return lastComparison;
3009
      }
3010
      if (isSetCouponCode()) {
3011
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
3012
        if (lastComparison != 0) {
3013
          return lastComparison;
3014
        }
3015
      }
3016
      return 0;
3017
    }
3018
 
3019
    public _Fields fieldForId(int fieldId) {
3020
      return _Fields.findByThriftId(fieldId);
3021
    }
3022
 
3023
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3024
      org.apache.thrift.protocol.TField field;
3025
      iprot.readStructBegin();
3026
      while (true)
3027
      {
3028
        field = iprot.readFieldBegin();
3029
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3030
          break;
3031
        }
3032
        switch (field.id) {
3033
          case 1: // COUPON_CODE
3034
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
3035
              this.couponCode = iprot.readString();
3036
            } else { 
3037
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3038
            }
3039
            break;
3040
          default:
3041
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3042
        }
3043
        iprot.readFieldEnd();
3044
      }
3045
      iprot.readStructEnd();
3046
      validate();
3047
    }
3048
 
3049
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3050
      validate();
3051
 
3052
      oprot.writeStructBegin(STRUCT_DESC);
3053
      if (this.couponCode != null) {
3054
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
3055
        oprot.writeString(this.couponCode);
3056
        oprot.writeFieldEnd();
3057
      }
3058
      oprot.writeFieldStop();
3059
      oprot.writeStructEnd();
3060
    }
3061
 
3062
    @Override
3063
    public String toString() {
3064
      StringBuilder sb = new StringBuilder("getCoupon_args(");
3065
      boolean first = true;
3066
 
3067
      sb.append("couponCode:");
3068
      if (this.couponCode == null) {
3069
        sb.append("null");
3070
      } else {
3071
        sb.append(this.couponCode);
3072
      }
3073
      first = false;
3074
      sb.append(")");
3075
      return sb.toString();
3076
    }
3077
 
3078
    public void validate() throws org.apache.thrift.TException {
3079
      // check for required fields
3080
    }
3081
 
3082
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3083
      try {
3084
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3085
      } catch (org.apache.thrift.TException te) {
3086
        throw new java.io.IOException(te);
3087
      }
3088
    }
3089
 
3090
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3091
      try {
3092
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3093
      } catch (org.apache.thrift.TException te) {
3094
        throw new java.io.IOException(te);
3095
      }
3096
    }
3097
 
3098
  }
3099
 
3100
  public static class getCoupon_result implements org.apache.thrift.TBase<getCoupon_result, getCoupon_result._Fields>, java.io.Serializable, Cloneable   {
3101
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCoupon_result");
3102
 
3103
    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);
3104
    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);
3105
 
3106
    private Coupon success; // required
3107
    private PromotionException pex; // required
3108
 
3109
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3110
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3111
      SUCCESS((short)0, "success"),
3112
      PEX((short)1, "pex");
3113
 
3114
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3115
 
3116
      static {
3117
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3118
          byName.put(field.getFieldName(), field);
3119
        }
3120
      }
3121
 
3122
      /**
3123
       * Find the _Fields constant that matches fieldId, or null if its not found.
3124
       */
3125
      public static _Fields findByThriftId(int fieldId) {
3126
        switch(fieldId) {
3127
          case 0: // SUCCESS
3128
            return SUCCESS;
3129
          case 1: // PEX
3130
            return PEX;
3131
          default:
3132
            return null;
3133
        }
3134
      }
3135
 
3136
      /**
3137
       * Find the _Fields constant that matches fieldId, throwing an exception
3138
       * if it is not found.
3139
       */
3140
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3141
        _Fields fields = findByThriftId(fieldId);
3142
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3143
        return fields;
3144
      }
3145
 
3146
      /**
3147
       * Find the _Fields constant that matches name, or null if its not found.
3148
       */
3149
      public static _Fields findByName(String name) {
3150
        return byName.get(name);
3151
      }
3152
 
3153
      private final short _thriftId;
3154
      private final String _fieldName;
3155
 
3156
      _Fields(short thriftId, String fieldName) {
3157
        _thriftId = thriftId;
3158
        _fieldName = fieldName;
3159
      }
3160
 
3161
      public short getThriftFieldId() {
3162
        return _thriftId;
3163
      }
3164
 
3165
      public String getFieldName() {
3166
        return _fieldName;
3167
      }
3168
    }
3169
 
3170
    // isset id assignments
3171
 
3172
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3173
    static {
3174
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3175
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3176
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class)));
3177
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3178
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
3179
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3180
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCoupon_result.class, metaDataMap);
3181
    }
3182
 
3183
    public getCoupon_result() {
3184
    }
3185
 
3186
    public getCoupon_result(
3187
      Coupon success,
3188
      PromotionException pex)
3189
    {
3190
      this();
3191
      this.success = success;
3192
      this.pex = pex;
3193
    }
3194
 
3195
    /**
3196
     * Performs a deep copy on <i>other</i>.
3197
     */
3198
    public getCoupon_result(getCoupon_result other) {
3199
      if (other.isSetSuccess()) {
3200
        this.success = new Coupon(other.success);
3201
      }
3202
      if (other.isSetPex()) {
3203
        this.pex = new PromotionException(other.pex);
3204
      }
3205
    }
3206
 
3207
    public getCoupon_result deepCopy() {
3208
      return new getCoupon_result(this);
3209
    }
3210
 
3211
    @Override
3212
    public void clear() {
3213
      this.success = null;
3214
      this.pex = null;
3215
    }
3216
 
3217
    public Coupon getSuccess() {
3218
      return this.success;
3219
    }
3220
 
3221
    public void setSuccess(Coupon success) {
3222
      this.success = success;
3223
    }
3224
 
3225
    public void unsetSuccess() {
3226
      this.success = null;
3227
    }
3228
 
3229
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3230
    public boolean isSetSuccess() {
3231
      return this.success != null;
3232
    }
3233
 
3234
    public void setSuccessIsSet(boolean value) {
3235
      if (!value) {
3236
        this.success = null;
3237
      }
3238
    }
3239
 
3240
    public PromotionException getPex() {
3241
      return this.pex;
3242
    }
3243
 
3244
    public void setPex(PromotionException pex) {
3245
      this.pex = pex;
3246
    }
3247
 
3248
    public void unsetPex() {
3249
      this.pex = null;
3250
    }
3251
 
3252
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3253
    public boolean isSetPex() {
3254
      return this.pex != null;
3255
    }
3256
 
3257
    public void setPexIsSet(boolean value) {
3258
      if (!value) {
3259
        this.pex = null;
3260
      }
3261
    }
3262
 
3263
    public void setFieldValue(_Fields field, Object value) {
3264
      switch (field) {
3265
      case SUCCESS:
3266
        if (value == null) {
3267
          unsetSuccess();
3268
        } else {
3269
          setSuccess((Coupon)value);
3270
        }
3271
        break;
3272
 
3273
      case PEX:
3274
        if (value == null) {
3275
          unsetPex();
3276
        } else {
3277
          setPex((PromotionException)value);
3278
        }
3279
        break;
3280
 
3281
      }
3282
    }
3283
 
3284
    public Object getFieldValue(_Fields field) {
3285
      switch (field) {
3286
      case SUCCESS:
3287
        return getSuccess();
3288
 
3289
      case PEX:
3290
        return getPex();
3291
 
3292
      }
3293
      throw new IllegalStateException();
3294
    }
3295
 
3296
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3297
    public boolean isSet(_Fields field) {
3298
      if (field == null) {
3299
        throw new IllegalArgumentException();
3300
      }
3301
 
3302
      switch (field) {
3303
      case SUCCESS:
3304
        return isSetSuccess();
3305
      case PEX:
3306
        return isSetPex();
3307
      }
3308
      throw new IllegalStateException();
3309
    }
3310
 
3311
    @Override
3312
    public boolean equals(Object that) {
3313
      if (that == null)
3314
        return false;
3315
      if (that instanceof getCoupon_result)
3316
        return this.equals((getCoupon_result)that);
3317
      return false;
3318
    }
3319
 
3320
    public boolean equals(getCoupon_result that) {
3321
      if (that == null)
3322
        return false;
3323
 
3324
      boolean this_present_success = true && this.isSetSuccess();
3325
      boolean that_present_success = true && that.isSetSuccess();
3326
      if (this_present_success || that_present_success) {
3327
        if (!(this_present_success && that_present_success))
3328
          return false;
3329
        if (!this.success.equals(that.success))
3330
          return false;
3331
      }
3332
 
3333
      boolean this_present_pex = true && this.isSetPex();
3334
      boolean that_present_pex = true && that.isSetPex();
3335
      if (this_present_pex || that_present_pex) {
3336
        if (!(this_present_pex && that_present_pex))
3337
          return false;
3338
        if (!this.pex.equals(that.pex))
3339
          return false;
3340
      }
3341
 
3342
      return true;
3343
    }
3344
 
3345
    @Override
3346
    public int hashCode() {
3347
      return 0;
3348
    }
3349
 
3350
    public int compareTo(getCoupon_result other) {
3351
      if (!getClass().equals(other.getClass())) {
3352
        return getClass().getName().compareTo(other.getClass().getName());
3353
      }
3354
 
3355
      int lastComparison = 0;
3356
      getCoupon_result typedOther = (getCoupon_result)other;
3357
 
3358
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3359
      if (lastComparison != 0) {
3360
        return lastComparison;
3361
      }
3362
      if (isSetSuccess()) {
3363
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
3364
        if (lastComparison != 0) {
3365
          return lastComparison;
3366
        }
3367
      }
3368
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3369
      if (lastComparison != 0) {
3370
        return lastComparison;
3371
      }
3372
      if (isSetPex()) {
3373
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
3374
        if (lastComparison != 0) {
3375
          return lastComparison;
3376
        }
3377
      }
3378
      return 0;
3379
    }
3380
 
3381
    public _Fields fieldForId(int fieldId) {
3382
      return _Fields.findByThriftId(fieldId);
3383
    }
3384
 
3385
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3386
      org.apache.thrift.protocol.TField field;
3387
      iprot.readStructBegin();
3388
      while (true)
3389
      {
3390
        field = iprot.readFieldBegin();
3391
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3392
          break;
3393
        }
3394
        switch (field.id) {
3395
          case 0: // SUCCESS
3396
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3397
              this.success = new Coupon();
3398
              this.success.read(iprot);
3399
            } else { 
3400
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3401
            }
3402
            break;
3403
          case 1: // PEX
3404
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3405
              this.pex = new PromotionException();
3406
              this.pex.read(iprot);
3407
            } else { 
3408
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3409
            }
3410
            break;
3411
          default:
3412
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3413
        }
3414
        iprot.readFieldEnd();
3415
      }
3416
      iprot.readStructEnd();
3417
      validate();
3418
    }
3419
 
3420
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3421
      oprot.writeStructBegin(STRUCT_DESC);
3422
 
3423
      if (this.isSetSuccess()) {
3424
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
3425
        this.success.write(oprot);
3426
        oprot.writeFieldEnd();
3427
      } else if (this.isSetPex()) {
3428
        oprot.writeFieldBegin(PEX_FIELD_DESC);
3429
        this.pex.write(oprot);
3430
        oprot.writeFieldEnd();
3431
      }
3432
      oprot.writeFieldStop();
3433
      oprot.writeStructEnd();
3434
    }
3435
 
3436
    @Override
3437
    public String toString() {
3438
      StringBuilder sb = new StringBuilder("getCoupon_result(");
3439
      boolean first = true;
3440
 
3441
      sb.append("success:");
3442
      if (this.success == null) {
3443
        sb.append("null");
3444
      } else {
3445
        sb.append(this.success);
3446
      }
3447
      first = false;
3448
      if (!first) sb.append(", ");
3449
      sb.append("pex:");
3450
      if (this.pex == null) {
3451
        sb.append("null");
3452
      } else {
3453
        sb.append(this.pex);
3454
      }
3455
      first = false;
3456
      sb.append(")");
3457
      return sb.toString();
3458
    }
3459
 
3460
    public void validate() throws org.apache.thrift.TException {
3461
      // check for required fields
3462
    }
3463
 
3464
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3465
      try {
3466
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3467
      } catch (org.apache.thrift.TException te) {
3468
        throw new java.io.IOException(te);
3469
      }
3470
    }
3471
 
3472
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3473
      try {
3474
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3475
      } catch (org.apache.thrift.TException te) {
3476
        throw new java.io.IOException(te);
3477
      }
3478
    }
3479
 
3480
  }
3481
 
3482
  public static class isGiftVoucher_args implements org.apache.thrift.TBase<isGiftVoucher_args, isGiftVoucher_args._Fields>, java.io.Serializable, Cloneable   {
3483
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isGiftVoucher_args");
3484
 
3485
    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);
3486
 
3487
    private String couponCode; // required
3488
 
3489
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3490
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3491
      COUPON_CODE((short)1, "couponCode");
3492
 
3493
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3494
 
3495
      static {
3496
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3497
          byName.put(field.getFieldName(), field);
3498
        }
3499
      }
3500
 
3501
      /**
3502
       * Find the _Fields constant that matches fieldId, or null if its not found.
3503
       */
3504
      public static _Fields findByThriftId(int fieldId) {
3505
        switch(fieldId) {
3506
          case 1: // COUPON_CODE
3507
            return COUPON_CODE;
3508
          default:
3509
            return null;
3510
        }
3511
      }
3512
 
3513
      /**
3514
       * Find the _Fields constant that matches fieldId, throwing an exception
3515
       * if it is not found.
3516
       */
3517
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3518
        _Fields fields = findByThriftId(fieldId);
3519
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3520
        return fields;
3521
      }
3522
 
3523
      /**
3524
       * Find the _Fields constant that matches name, or null if its not found.
3525
       */
3526
      public static _Fields findByName(String name) {
3527
        return byName.get(name);
3528
      }
3529
 
3530
      private final short _thriftId;
3531
      private final String _fieldName;
3532
 
3533
      _Fields(short thriftId, String fieldName) {
3534
        _thriftId = thriftId;
3535
        _fieldName = fieldName;
3536
      }
3537
 
3538
      public short getThriftFieldId() {
3539
        return _thriftId;
3540
      }
3541
 
3542
      public String getFieldName() {
3543
        return _fieldName;
3544
      }
3545
    }
3546
 
3547
    // isset id assignments
3548
 
3549
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3550
    static {
3551
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3552
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3553
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
3554
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3555
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isGiftVoucher_args.class, metaDataMap);
3556
    }
3557
 
3558
    public isGiftVoucher_args() {
3559
    }
3560
 
3561
    public isGiftVoucher_args(
3562
      String couponCode)
3563
    {
3564
      this();
3565
      this.couponCode = couponCode;
3566
    }
3567
 
3568
    /**
3569
     * Performs a deep copy on <i>other</i>.
3570
     */
3571
    public isGiftVoucher_args(isGiftVoucher_args other) {
3572
      if (other.isSetCouponCode()) {
3573
        this.couponCode = other.couponCode;
3574
      }
3575
    }
3576
 
3577
    public isGiftVoucher_args deepCopy() {
3578
      return new isGiftVoucher_args(this);
3579
    }
3580
 
3581
    @Override
3582
    public void clear() {
3583
      this.couponCode = null;
3584
    }
3585
 
3586
    public String getCouponCode() {
3587
      return this.couponCode;
3588
    }
3589
 
3590
    public void setCouponCode(String couponCode) {
3591
      this.couponCode = couponCode;
3592
    }
3593
 
3594
    public void unsetCouponCode() {
3595
      this.couponCode = null;
3596
    }
3597
 
3598
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3599
    public boolean isSetCouponCode() {
3600
      return this.couponCode != null;
3601
    }
3602
 
3603
    public void setCouponCodeIsSet(boolean value) {
3604
      if (!value) {
3605
        this.couponCode = null;
3606
      }
3607
    }
3608
 
3609
    public void setFieldValue(_Fields field, Object value) {
3610
      switch (field) {
3611
      case COUPON_CODE:
3612
        if (value == null) {
3613
          unsetCouponCode();
3614
        } else {
3615
          setCouponCode((String)value);
3616
        }
3617
        break;
3618
 
3619
      }
3620
    }
3621
 
3622
    public Object getFieldValue(_Fields field) {
3623
      switch (field) {
3624
      case COUPON_CODE:
3625
        return getCouponCode();
3626
 
3627
      }
3628
      throw new IllegalStateException();
3629
    }
3630
 
3631
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3632
    public boolean isSet(_Fields field) {
3633
      if (field == null) {
3634
        throw new IllegalArgumentException();
3635
      }
3636
 
3637
      switch (field) {
3638
      case COUPON_CODE:
3639
        return isSetCouponCode();
3640
      }
3641
      throw new IllegalStateException();
3642
    }
3643
 
3644
    @Override
3645
    public boolean equals(Object that) {
3646
      if (that == null)
3647
        return false;
3648
      if (that instanceof isGiftVoucher_args)
3649
        return this.equals((isGiftVoucher_args)that);
3650
      return false;
3651
    }
3652
 
3653
    public boolean equals(isGiftVoucher_args that) {
3654
      if (that == null)
3655
        return false;
3656
 
3657
      boolean this_present_couponCode = true && this.isSetCouponCode();
3658
      boolean that_present_couponCode = true && that.isSetCouponCode();
3659
      if (this_present_couponCode || that_present_couponCode) {
3660
        if (!(this_present_couponCode && that_present_couponCode))
3661
          return false;
3662
        if (!this.couponCode.equals(that.couponCode))
3663
          return false;
3664
      }
3665
 
3666
      return true;
3667
    }
3668
 
3669
    @Override
3670
    public int hashCode() {
3671
      return 0;
3672
    }
3673
 
3674
    public int compareTo(isGiftVoucher_args other) {
3675
      if (!getClass().equals(other.getClass())) {
3676
        return getClass().getName().compareTo(other.getClass().getName());
3677
      }
3678
 
3679
      int lastComparison = 0;
3680
      isGiftVoucher_args typedOther = (isGiftVoucher_args)other;
3681
 
3682
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3683
      if (lastComparison != 0) {
3684
        return lastComparison;
3685
      }
3686
      if (isSetCouponCode()) {
3687
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
3688
        if (lastComparison != 0) {
3689
          return lastComparison;
3690
        }
3691
      }
3692
      return 0;
3693
    }
3694
 
3695
    public _Fields fieldForId(int fieldId) {
3696
      return _Fields.findByThriftId(fieldId);
3697
    }
3698
 
3699
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3700
      org.apache.thrift.protocol.TField field;
3701
      iprot.readStructBegin();
3702
      while (true)
3703
      {
3704
        field = iprot.readFieldBegin();
3705
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3706
          break;
3707
        }
3708
        switch (field.id) {
3709
          case 1: // COUPON_CODE
3710
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
3711
              this.couponCode = iprot.readString();
3712
            } else { 
3713
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3714
            }
3715
            break;
3716
          default:
3717
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3718
        }
3719
        iprot.readFieldEnd();
3720
      }
3721
      iprot.readStructEnd();
3722
      validate();
3723
    }
3724
 
3725
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3726
      validate();
3727
 
3728
      oprot.writeStructBegin(STRUCT_DESC);
3729
      if (this.couponCode != null) {
3730
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
3731
        oprot.writeString(this.couponCode);
3732
        oprot.writeFieldEnd();
3733
      }
3734
      oprot.writeFieldStop();
3735
      oprot.writeStructEnd();
3736
    }
3737
 
3738
    @Override
3739
    public String toString() {
3740
      StringBuilder sb = new StringBuilder("isGiftVoucher_args(");
3741
      boolean first = true;
3742
 
3743
      sb.append("couponCode:");
3744
      if (this.couponCode == null) {
3745
        sb.append("null");
3746
      } else {
3747
        sb.append(this.couponCode);
3748
      }
3749
      first = false;
3750
      sb.append(")");
3751
      return sb.toString();
3752
    }
3753
 
3754
    public void validate() throws org.apache.thrift.TException {
3755
      // check for required fields
3756
    }
3757
 
3758
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3759
      try {
3760
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3761
      } catch (org.apache.thrift.TException te) {
3762
        throw new java.io.IOException(te);
3763
      }
3764
    }
3765
 
3766
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3767
      try {
3768
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3769
      } catch (org.apache.thrift.TException te) {
3770
        throw new java.io.IOException(te);
3771
      }
3772
    }
3773
 
3774
  }
3775
 
3776
  public static class isGiftVoucher_result implements org.apache.thrift.TBase<isGiftVoucher_result, isGiftVoucher_result._Fields>, java.io.Serializable, Cloneable   {
3777
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isGiftVoucher_result");
3778
 
3779
    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);
3780
    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);
3781
 
3782
    private boolean success; // required
3783
    private PromotionException pex; // required
3784
 
3785
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3786
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3787
      SUCCESS((short)0, "success"),
3788
      PEX((short)1, "pex");
3789
 
3790
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3791
 
3792
      static {
3793
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3794
          byName.put(field.getFieldName(), field);
3795
        }
3796
      }
3797
 
3798
      /**
3799
       * Find the _Fields constant that matches fieldId, or null if its not found.
3800
       */
3801
      public static _Fields findByThriftId(int fieldId) {
3802
        switch(fieldId) {
3803
          case 0: // SUCCESS
3804
            return SUCCESS;
3805
          case 1: // PEX
3806
            return PEX;
3807
          default:
3808
            return null;
3809
        }
3810
      }
3811
 
3812
      /**
3813
       * Find the _Fields constant that matches fieldId, throwing an exception
3814
       * if it is not found.
3815
       */
3816
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3817
        _Fields fields = findByThriftId(fieldId);
3818
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3819
        return fields;
3820
      }
3821
 
3822
      /**
3823
       * Find the _Fields constant that matches name, or null if its not found.
3824
       */
3825
      public static _Fields findByName(String name) {
3826
        return byName.get(name);
3827
      }
3828
 
3829
      private final short _thriftId;
3830
      private final String _fieldName;
3831
 
3832
      _Fields(short thriftId, String fieldName) {
3833
        _thriftId = thriftId;
3834
        _fieldName = fieldName;
3835
      }
3836
 
3837
      public short getThriftFieldId() {
3838
        return _thriftId;
3839
      }
3840
 
3841
      public String getFieldName() {
3842
        return _fieldName;
3843
      }
3844
    }
3845
 
3846
    // isset id assignments
3847
    private static final int __SUCCESS_ISSET_ID = 0;
3848
    private BitSet __isset_bit_vector = new BitSet(1);
3849
 
3850
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3851
    static {
3852
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3853
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3854
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
3855
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3856
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
3857
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3858
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isGiftVoucher_result.class, metaDataMap);
3859
    }
3860
 
3861
    public isGiftVoucher_result() {
3862
    }
3863
 
3864
    public isGiftVoucher_result(
3865
      boolean success,
3866
      PromotionException pex)
3867
    {
3868
      this();
3869
      this.success = success;
3870
      setSuccessIsSet(true);
3871
      this.pex = pex;
3872
    }
3873
 
3874
    /**
3875
     * Performs a deep copy on <i>other</i>.
3876
     */
3877
    public isGiftVoucher_result(isGiftVoucher_result other) {
3878
      __isset_bit_vector.clear();
3879
      __isset_bit_vector.or(other.__isset_bit_vector);
3880
      this.success = other.success;
3881
      if (other.isSetPex()) {
3882
        this.pex = new PromotionException(other.pex);
3883
      }
3884
    }
3885
 
3886
    public isGiftVoucher_result deepCopy() {
3887
      return new isGiftVoucher_result(this);
3888
    }
3889
 
3890
    @Override
3891
    public void clear() {
3892
      setSuccessIsSet(false);
3893
      this.success = false;
3894
      this.pex = null;
3895
    }
3896
 
3897
    public boolean isSuccess() {
3898
      return this.success;
3899
    }
3900
 
3901
    public void setSuccess(boolean success) {
3902
      this.success = success;
3903
      setSuccessIsSet(true);
3904
    }
3905
 
3906
    public void unsetSuccess() {
3907
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
3908
    }
3909
 
3910
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3911
    public boolean isSetSuccess() {
3912
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
3913
    }
3914
 
3915
    public void setSuccessIsSet(boolean value) {
3916
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
3917
    }
3918
 
3919
    public PromotionException getPex() {
3920
      return this.pex;
3921
    }
3922
 
3923
    public void setPex(PromotionException pex) {
3924
      this.pex = pex;
3925
    }
3926
 
3927
    public void unsetPex() {
3928
      this.pex = null;
3929
    }
3930
 
3931
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3932
    public boolean isSetPex() {
3933
      return this.pex != null;
3934
    }
3935
 
3936
    public void setPexIsSet(boolean value) {
3937
      if (!value) {
3938
        this.pex = null;
3939
      }
3940
    }
3941
 
3942
    public void setFieldValue(_Fields field, Object value) {
3943
      switch (field) {
3944
      case SUCCESS:
3945
        if (value == null) {
3946
          unsetSuccess();
3947
        } else {
3948
          setSuccess((Boolean)value);
3949
        }
3950
        break;
3951
 
3952
      case PEX:
3953
        if (value == null) {
3954
          unsetPex();
3955
        } else {
3956
          setPex((PromotionException)value);
3957
        }
3958
        break;
3959
 
3960
      }
3961
    }
3962
 
3963
    public Object getFieldValue(_Fields field) {
3964
      switch (field) {
3965
      case SUCCESS:
3966
        return Boolean.valueOf(isSuccess());
3967
 
3968
      case PEX:
3969
        return getPex();
3970
 
3971
      }
3972
      throw new IllegalStateException();
3973
    }
3974
 
3975
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3976
    public boolean isSet(_Fields field) {
3977
      if (field == null) {
3978
        throw new IllegalArgumentException();
3979
      }
3980
 
3981
      switch (field) {
3982
      case SUCCESS:
3983
        return isSetSuccess();
3984
      case PEX:
3985
        return isSetPex();
3986
      }
3987
      throw new IllegalStateException();
3988
    }
3989
 
3990
    @Override
3991
    public boolean equals(Object that) {
3992
      if (that == null)
3993
        return false;
3994
      if (that instanceof isGiftVoucher_result)
3995
        return this.equals((isGiftVoucher_result)that);
3996
      return false;
3997
    }
3998
 
3999
    public boolean equals(isGiftVoucher_result that) {
4000
      if (that == null)
4001
        return false;
4002
 
4003
      boolean this_present_success = true;
4004
      boolean that_present_success = true;
4005
      if (this_present_success || that_present_success) {
4006
        if (!(this_present_success && that_present_success))
4007
          return false;
4008
        if (this.success != that.success)
4009
          return false;
4010
      }
4011
 
4012
      boolean this_present_pex = true && this.isSetPex();
4013
      boolean that_present_pex = true && that.isSetPex();
4014
      if (this_present_pex || that_present_pex) {
4015
        if (!(this_present_pex && that_present_pex))
4016
          return false;
4017
        if (!this.pex.equals(that.pex))
4018
          return false;
4019
      }
4020
 
4021
      return true;
4022
    }
4023
 
4024
    @Override
4025
    public int hashCode() {
4026
      return 0;
4027
    }
4028
 
4029
    public int compareTo(isGiftVoucher_result other) {
4030
      if (!getClass().equals(other.getClass())) {
4031
        return getClass().getName().compareTo(other.getClass().getName());
4032
      }
4033
 
4034
      int lastComparison = 0;
4035
      isGiftVoucher_result typedOther = (isGiftVoucher_result)other;
4036
 
4037
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
4038
      if (lastComparison != 0) {
4039
        return lastComparison;
4040
      }
4041
      if (isSetSuccess()) {
4042
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4043
        if (lastComparison != 0) {
4044
          return lastComparison;
4045
        }
4046
      }
4047
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
4048
      if (lastComparison != 0) {
4049
        return lastComparison;
4050
      }
4051
      if (isSetPex()) {
4052
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
4053
        if (lastComparison != 0) {
4054
          return lastComparison;
4055
        }
4056
      }
4057
      return 0;
4058
    }
4059
 
4060
    public _Fields fieldForId(int fieldId) {
4061
      return _Fields.findByThriftId(fieldId);
4062
    }
4063
 
4064
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4065
      org.apache.thrift.protocol.TField field;
4066
      iprot.readStructBegin();
4067
      while (true)
4068
      {
4069
        field = iprot.readFieldBegin();
4070
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4071
          break;
4072
        }
4073
        switch (field.id) {
4074
          case 0: // SUCCESS
4075
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
4076
              this.success = iprot.readBool();
4077
              setSuccessIsSet(true);
4078
            } else { 
4079
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4080
            }
4081
            break;
4082
          case 1: // PEX
4083
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4084
              this.pex = new PromotionException();
4085
              this.pex.read(iprot);
4086
            } else { 
4087
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4088
            }
4089
            break;
4090
          default:
4091
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4092
        }
4093
        iprot.readFieldEnd();
4094
      }
4095
      iprot.readStructEnd();
4096
      validate();
4097
    }
4098
 
4099
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4100
      oprot.writeStructBegin(STRUCT_DESC);
4101
 
4102
      if (this.isSetSuccess()) {
4103
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4104
        oprot.writeBool(this.success);
4105
        oprot.writeFieldEnd();
4106
      } else if (this.isSetPex()) {
4107
        oprot.writeFieldBegin(PEX_FIELD_DESC);
4108
        this.pex.write(oprot);
4109
        oprot.writeFieldEnd();
4110
      }
4111
      oprot.writeFieldStop();
4112
      oprot.writeStructEnd();
4113
    }
4114
 
4115
    @Override
4116
    public String toString() {
4117
      StringBuilder sb = new StringBuilder("isGiftVoucher_result(");
4118
      boolean first = true;
4119
 
4120
      sb.append("success:");
4121
      sb.append(this.success);
4122
      first = false;
4123
      if (!first) sb.append(", ");
4124
      sb.append("pex:");
4125
      if (this.pex == null) {
4126
        sb.append("null");
4127
      } else {
4128
        sb.append(this.pex);
4129
      }
4130
      first = false;
4131
      sb.append(")");
4132
      return sb.toString();
4133
    }
4134
 
4135
    public void validate() throws org.apache.thrift.TException {
4136
      // check for required fields
4137
    }
4138
 
4139
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4140
      try {
4141
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4142
      } catch (org.apache.thrift.TException te) {
4143
        throw new java.io.IOException(te);
4144
      }
4145
    }
4146
 
4147
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4148
      try {
4149
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4150
      } catch (org.apache.thrift.TException te) {
4151
        throw new java.io.IOException(te);
4152
      }
4153
    }
4154
 
4155
  }
4156
 
6356 amit.gupta 4157
  public static class isCodApplicable_args implements org.apache.thrift.TBase<isCodApplicable_args, isCodApplicable_args._Fields>, java.io.Serializable, Cloneable   {
4158
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isCodApplicable_args");
4159
 
4160
    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);
4161
 
4162
    private String couponCode; // required
4163
 
4164
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4165
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4166
      COUPON_CODE((short)1, "couponCode");
4167
 
4168
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4169
 
4170
      static {
4171
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4172
          byName.put(field.getFieldName(), field);
4173
        }
4174
      }
4175
 
4176
      /**
4177
       * Find the _Fields constant that matches fieldId, or null if its not found.
4178
       */
4179
      public static _Fields findByThriftId(int fieldId) {
4180
        switch(fieldId) {
4181
          case 1: // COUPON_CODE
4182
            return COUPON_CODE;
4183
          default:
4184
            return null;
4185
        }
4186
      }
4187
 
4188
      /**
4189
       * Find the _Fields constant that matches fieldId, throwing an exception
4190
       * if it is not found.
4191
       */
4192
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4193
        _Fields fields = findByThriftId(fieldId);
4194
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4195
        return fields;
4196
      }
4197
 
4198
      /**
4199
       * Find the _Fields constant that matches name, or null if its not found.
4200
       */
4201
      public static _Fields findByName(String name) {
4202
        return byName.get(name);
4203
      }
4204
 
4205
      private final short _thriftId;
4206
      private final String _fieldName;
4207
 
4208
      _Fields(short thriftId, String fieldName) {
4209
        _thriftId = thriftId;
4210
        _fieldName = fieldName;
4211
      }
4212
 
4213
      public short getThriftFieldId() {
4214
        return _thriftId;
4215
      }
4216
 
4217
      public String getFieldName() {
4218
        return _fieldName;
4219
      }
4220
    }
4221
 
4222
    // isset id assignments
4223
 
4224
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4225
    static {
4226
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4227
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4228
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
4229
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4230
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isCodApplicable_args.class, metaDataMap);
4231
    }
4232
 
4233
    public isCodApplicable_args() {
4234
    }
4235
 
4236
    public isCodApplicable_args(
4237
      String couponCode)
4238
    {
4239
      this();
4240
      this.couponCode = couponCode;
4241
    }
4242
 
4243
    /**
4244
     * Performs a deep copy on <i>other</i>.
4245
     */
4246
    public isCodApplicable_args(isCodApplicable_args other) {
4247
      if (other.isSetCouponCode()) {
4248
        this.couponCode = other.couponCode;
4249
      }
4250
    }
4251
 
4252
    public isCodApplicable_args deepCopy() {
4253
      return new isCodApplicable_args(this);
4254
    }
4255
 
4256
    @Override
4257
    public void clear() {
4258
      this.couponCode = null;
4259
    }
4260
 
4261
    public String getCouponCode() {
4262
      return this.couponCode;
4263
    }
4264
 
4265
    public void setCouponCode(String couponCode) {
4266
      this.couponCode = couponCode;
4267
    }
4268
 
4269
    public void unsetCouponCode() {
4270
      this.couponCode = null;
4271
    }
4272
 
4273
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
4274
    public boolean isSetCouponCode() {
4275
      return this.couponCode != null;
4276
    }
4277
 
4278
    public void setCouponCodeIsSet(boolean value) {
4279
      if (!value) {
4280
        this.couponCode = null;
4281
      }
4282
    }
4283
 
4284
    public void setFieldValue(_Fields field, Object value) {
4285
      switch (field) {
4286
      case COUPON_CODE:
4287
        if (value == null) {
4288
          unsetCouponCode();
4289
        } else {
4290
          setCouponCode((String)value);
4291
        }
4292
        break;
4293
 
4294
      }
4295
    }
4296
 
4297
    public Object getFieldValue(_Fields field) {
4298
      switch (field) {
4299
      case COUPON_CODE:
4300
        return getCouponCode();
4301
 
4302
      }
4303
      throw new IllegalStateException();
4304
    }
4305
 
4306
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4307
    public boolean isSet(_Fields field) {
4308
      if (field == null) {
4309
        throw new IllegalArgumentException();
4310
      }
4311
 
4312
      switch (field) {
4313
      case COUPON_CODE:
4314
        return isSetCouponCode();
4315
      }
4316
      throw new IllegalStateException();
4317
    }
4318
 
4319
    @Override
4320
    public boolean equals(Object that) {
4321
      if (that == null)
4322
        return false;
4323
      if (that instanceof isCodApplicable_args)
4324
        return this.equals((isCodApplicable_args)that);
4325
      return false;
4326
    }
4327
 
4328
    public boolean equals(isCodApplicable_args that) {
4329
      if (that == null)
4330
        return false;
4331
 
4332
      boolean this_present_couponCode = true && this.isSetCouponCode();
4333
      boolean that_present_couponCode = true && that.isSetCouponCode();
4334
      if (this_present_couponCode || that_present_couponCode) {
4335
        if (!(this_present_couponCode && that_present_couponCode))
4336
          return false;
4337
        if (!this.couponCode.equals(that.couponCode))
4338
          return false;
4339
      }
4340
 
4341
      return true;
4342
    }
4343
 
4344
    @Override
4345
    public int hashCode() {
4346
      return 0;
4347
    }
4348
 
4349
    public int compareTo(isCodApplicable_args other) {
4350
      if (!getClass().equals(other.getClass())) {
4351
        return getClass().getName().compareTo(other.getClass().getName());
4352
      }
4353
 
4354
      int lastComparison = 0;
4355
      isCodApplicable_args typedOther = (isCodApplicable_args)other;
4356
 
4357
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
4358
      if (lastComparison != 0) {
4359
        return lastComparison;
4360
      }
4361
      if (isSetCouponCode()) {
4362
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
4363
        if (lastComparison != 0) {
4364
          return lastComparison;
4365
        }
4366
      }
4367
      return 0;
4368
    }
4369
 
4370
    public _Fields fieldForId(int fieldId) {
4371
      return _Fields.findByThriftId(fieldId);
4372
    }
4373
 
4374
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4375
      org.apache.thrift.protocol.TField field;
4376
      iprot.readStructBegin();
4377
      while (true)
4378
      {
4379
        field = iprot.readFieldBegin();
4380
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4381
          break;
4382
        }
4383
        switch (field.id) {
4384
          case 1: // COUPON_CODE
4385
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
4386
              this.couponCode = iprot.readString();
4387
            } else { 
4388
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4389
            }
4390
            break;
4391
          default:
4392
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4393
        }
4394
        iprot.readFieldEnd();
4395
      }
4396
      iprot.readStructEnd();
4397
      validate();
4398
    }
4399
 
4400
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4401
      validate();
4402
 
4403
      oprot.writeStructBegin(STRUCT_DESC);
4404
      if (this.couponCode != null) {
4405
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
4406
        oprot.writeString(this.couponCode);
4407
        oprot.writeFieldEnd();
4408
      }
4409
      oprot.writeFieldStop();
4410
      oprot.writeStructEnd();
4411
    }
4412
 
4413
    @Override
4414
    public String toString() {
4415
      StringBuilder sb = new StringBuilder("isCodApplicable_args(");
4416
      boolean first = true;
4417
 
4418
      sb.append("couponCode:");
4419
      if (this.couponCode == null) {
4420
        sb.append("null");
4421
      } else {
4422
        sb.append(this.couponCode);
4423
      }
4424
      first = false;
4425
      sb.append(")");
4426
      return sb.toString();
4427
    }
4428
 
4429
    public void validate() throws org.apache.thrift.TException {
4430
      // check for required fields
4431
    }
4432
 
4433
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4434
      try {
4435
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4436
      } catch (org.apache.thrift.TException te) {
4437
        throw new java.io.IOException(te);
4438
      }
4439
    }
4440
 
4441
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4442
      try {
4443
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4444
      } catch (org.apache.thrift.TException te) {
4445
        throw new java.io.IOException(te);
4446
      }
4447
    }
4448
 
4449
  }
4450
 
4451
  public static class isCodApplicable_result implements org.apache.thrift.TBase<isCodApplicable_result, isCodApplicable_result._Fields>, java.io.Serializable, Cloneable   {
4452
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isCodApplicable_result");
4453
 
4454
    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);
4455
    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);
4456
 
4457
    private boolean success; // required
4458
    private PromotionException pex; // required
4459
 
4460
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4461
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4462
      SUCCESS((short)0, "success"),
4463
      PEX((short)1, "pex");
4464
 
4465
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4466
 
4467
      static {
4468
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4469
          byName.put(field.getFieldName(), field);
4470
        }
4471
      }
4472
 
4473
      /**
4474
       * Find the _Fields constant that matches fieldId, or null if its not found.
4475
       */
4476
      public static _Fields findByThriftId(int fieldId) {
4477
        switch(fieldId) {
4478
          case 0: // SUCCESS
4479
            return SUCCESS;
4480
          case 1: // PEX
4481
            return PEX;
4482
          default:
4483
            return null;
4484
        }
4485
      }
4486
 
4487
      /**
4488
       * Find the _Fields constant that matches fieldId, throwing an exception
4489
       * if it is not found.
4490
       */
4491
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4492
        _Fields fields = findByThriftId(fieldId);
4493
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4494
        return fields;
4495
      }
4496
 
4497
      /**
4498
       * Find the _Fields constant that matches name, or null if its not found.
4499
       */
4500
      public static _Fields findByName(String name) {
4501
        return byName.get(name);
4502
      }
4503
 
4504
      private final short _thriftId;
4505
      private final String _fieldName;
4506
 
4507
      _Fields(short thriftId, String fieldName) {
4508
        _thriftId = thriftId;
4509
        _fieldName = fieldName;
4510
      }
4511
 
4512
      public short getThriftFieldId() {
4513
        return _thriftId;
4514
      }
4515
 
4516
      public String getFieldName() {
4517
        return _fieldName;
4518
      }
4519
    }
4520
 
4521
    // isset id assignments
4522
    private static final int __SUCCESS_ISSET_ID = 0;
4523
    private BitSet __isset_bit_vector = new BitSet(1);
4524
 
4525
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4526
    static {
4527
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4528
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4529
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
4530
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4531
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4532
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4533
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isCodApplicable_result.class, metaDataMap);
4534
    }
4535
 
4536
    public isCodApplicable_result() {
4537
    }
4538
 
4539
    public isCodApplicable_result(
4540
      boolean success,
4541
      PromotionException pex)
4542
    {
4543
      this();
4544
      this.success = success;
4545
      setSuccessIsSet(true);
4546
      this.pex = pex;
4547
    }
4548
 
4549
    /**
4550
     * Performs a deep copy on <i>other</i>.
4551
     */
4552
    public isCodApplicable_result(isCodApplicable_result other) {
4553
      __isset_bit_vector.clear();
4554
      __isset_bit_vector.or(other.__isset_bit_vector);
4555
      this.success = other.success;
4556
      if (other.isSetPex()) {
4557
        this.pex = new PromotionException(other.pex);
4558
      }
4559
    }
4560
 
4561
    public isCodApplicable_result deepCopy() {
4562
      return new isCodApplicable_result(this);
4563
    }
4564
 
4565
    @Override
4566
    public void clear() {
4567
      setSuccessIsSet(false);
4568
      this.success = false;
4569
      this.pex = null;
4570
    }
4571
 
4572
    public boolean isSuccess() {
4573
      return this.success;
4574
    }
4575
 
4576
    public void setSuccess(boolean success) {
4577
      this.success = success;
4578
      setSuccessIsSet(true);
4579
    }
4580
 
4581
    public void unsetSuccess() {
4582
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
4583
    }
4584
 
4585
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
4586
    public boolean isSetSuccess() {
4587
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
4588
    }
4589
 
4590
    public void setSuccessIsSet(boolean value) {
4591
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
4592
    }
4593
 
4594
    public PromotionException getPex() {
4595
      return this.pex;
4596
    }
4597
 
4598
    public void setPex(PromotionException pex) {
4599
      this.pex = pex;
4600
    }
4601
 
4602
    public void unsetPex() {
4603
      this.pex = null;
4604
    }
4605
 
4606
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
4607
    public boolean isSetPex() {
4608
      return this.pex != null;
4609
    }
4610
 
4611
    public void setPexIsSet(boolean value) {
4612
      if (!value) {
4613
        this.pex = null;
4614
      }
4615
    }
4616
 
4617
    public void setFieldValue(_Fields field, Object value) {
4618
      switch (field) {
4619
      case SUCCESS:
4620
        if (value == null) {
4621
          unsetSuccess();
4622
        } else {
4623
          setSuccess((Boolean)value);
4624
        }
4625
        break;
4626
 
4627
      case PEX:
4628
        if (value == null) {
4629
          unsetPex();
4630
        } else {
4631
          setPex((PromotionException)value);
4632
        }
4633
        break;
4634
 
4635
      }
4636
    }
4637
 
4638
    public Object getFieldValue(_Fields field) {
4639
      switch (field) {
4640
      case SUCCESS:
4641
        return Boolean.valueOf(isSuccess());
4642
 
4643
      case PEX:
4644
        return getPex();
4645
 
4646
      }
4647
      throw new IllegalStateException();
4648
    }
4649
 
4650
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4651
    public boolean isSet(_Fields field) {
4652
      if (field == null) {
4653
        throw new IllegalArgumentException();
4654
      }
4655
 
4656
      switch (field) {
4657
      case SUCCESS:
4658
        return isSetSuccess();
4659
      case PEX:
4660
        return isSetPex();
4661
      }
4662
      throw new IllegalStateException();
4663
    }
4664
 
4665
    @Override
4666
    public boolean equals(Object that) {
4667
      if (that == null)
4668
        return false;
4669
      if (that instanceof isCodApplicable_result)
4670
        return this.equals((isCodApplicable_result)that);
4671
      return false;
4672
    }
4673
 
4674
    public boolean equals(isCodApplicable_result that) {
4675
      if (that == null)
4676
        return false;
4677
 
4678
      boolean this_present_success = true;
4679
      boolean that_present_success = true;
4680
      if (this_present_success || that_present_success) {
4681
        if (!(this_present_success && that_present_success))
4682
          return false;
4683
        if (this.success != that.success)
4684
          return false;
4685
      }
4686
 
4687
      boolean this_present_pex = true && this.isSetPex();
4688
      boolean that_present_pex = true && that.isSetPex();
4689
      if (this_present_pex || that_present_pex) {
4690
        if (!(this_present_pex && that_present_pex))
4691
          return false;
4692
        if (!this.pex.equals(that.pex))
4693
          return false;
4694
      }
4695
 
4696
      return true;
4697
    }
4698
 
4699
    @Override
4700
    public int hashCode() {
4701
      return 0;
4702
    }
4703
 
4704
    public int compareTo(isCodApplicable_result other) {
4705
      if (!getClass().equals(other.getClass())) {
4706
        return getClass().getName().compareTo(other.getClass().getName());
4707
      }
4708
 
4709
      int lastComparison = 0;
4710
      isCodApplicable_result typedOther = (isCodApplicable_result)other;
4711
 
4712
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
4713
      if (lastComparison != 0) {
4714
        return lastComparison;
4715
      }
4716
      if (isSetSuccess()) {
4717
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4718
        if (lastComparison != 0) {
4719
          return lastComparison;
4720
        }
4721
      }
4722
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
4723
      if (lastComparison != 0) {
4724
        return lastComparison;
4725
      }
4726
      if (isSetPex()) {
4727
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
4728
        if (lastComparison != 0) {
4729
          return lastComparison;
4730
        }
4731
      }
4732
      return 0;
4733
    }
4734
 
4735
    public _Fields fieldForId(int fieldId) {
4736
      return _Fields.findByThriftId(fieldId);
4737
    }
4738
 
4739
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4740
      org.apache.thrift.protocol.TField field;
4741
      iprot.readStructBegin();
4742
      while (true)
4743
      {
4744
        field = iprot.readFieldBegin();
4745
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4746
          break;
4747
        }
4748
        switch (field.id) {
4749
          case 0: // SUCCESS
4750
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
4751
              this.success = iprot.readBool();
4752
              setSuccessIsSet(true);
4753
            } else { 
4754
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4755
            }
4756
            break;
4757
          case 1: // PEX
4758
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4759
              this.pex = new PromotionException();
4760
              this.pex.read(iprot);
4761
            } else { 
4762
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4763
            }
4764
            break;
4765
          default:
4766
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4767
        }
4768
        iprot.readFieldEnd();
4769
      }
4770
      iprot.readStructEnd();
4771
      validate();
4772
    }
4773
 
4774
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4775
      oprot.writeStructBegin(STRUCT_DESC);
4776
 
4777
      if (this.isSetSuccess()) {
4778
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4779
        oprot.writeBool(this.success);
4780
        oprot.writeFieldEnd();
4781
      } else if (this.isSetPex()) {
4782
        oprot.writeFieldBegin(PEX_FIELD_DESC);
4783
        this.pex.write(oprot);
4784
        oprot.writeFieldEnd();
4785
      }
4786
      oprot.writeFieldStop();
4787
      oprot.writeStructEnd();
4788
    }
4789
 
4790
    @Override
4791
    public String toString() {
4792
      StringBuilder sb = new StringBuilder("isCodApplicable_result(");
4793
      boolean first = true;
4794
 
4795
      sb.append("success:");
4796
      sb.append(this.success);
4797
      first = false;
4798
      if (!first) sb.append(", ");
4799
      sb.append("pex:");
4800
      if (this.pex == null) {
4801
        sb.append("null");
4802
      } else {
4803
        sb.append(this.pex);
4804
      }
4805
      first = false;
4806
      sb.append(")");
4807
      return sb.toString();
4808
    }
4809
 
4810
    public void validate() throws org.apache.thrift.TException {
4811
      // check for required fields
4812
    }
4813
 
4814
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4815
      try {
4816
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4817
      } catch (org.apache.thrift.TException te) {
4818
        throw new java.io.IOException(te);
4819
      }
4820
    }
4821
 
4822
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4823
      try {
4824
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4825
      } catch (org.apache.thrift.TException te) {
4826
        throw new java.io.IOException(te);
4827
      }
4828
    }
4829
 
4830
  }
4831
 
3430 rajveer 4832
  public static class getAllPromotions_args implements org.apache.thrift.TBase<getAllPromotions_args, getAllPromotions_args._Fields>, java.io.Serializable, Cloneable   {
4833
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_args");
1982 varun.gupt 4834
 
4835
 
4836
 
4837
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 4838
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 4839
;
4840
 
4841
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4842
 
4843
      static {
4844
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4845
          byName.put(field.getFieldName(), field);
4846
        }
4847
      }
4848
 
4849
      /**
4850
       * Find the _Fields constant that matches fieldId, or null if its not found.
4851
       */
4852
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 4853
        switch(fieldId) {
4854
          default:
4855
            return null;
4856
        }
1982 varun.gupt 4857
      }
4858
 
4859
      /**
4860
       * Find the _Fields constant that matches fieldId, throwing an exception
4861
       * if it is not found.
4862
       */
4863
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4864
        _Fields fields = findByThriftId(fieldId);
4865
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4866
        return fields;
4867
      }
4868
 
4869
      /**
4870
       * Find the _Fields constant that matches name, or null if its not found.
4871
       */
4872
      public static _Fields findByName(String name) {
4873
        return byName.get(name);
4874
      }
4875
 
4876
      private final short _thriftId;
4877
      private final String _fieldName;
4878
 
4879
      _Fields(short thriftId, String fieldName) {
4880
        _thriftId = thriftId;
4881
        _fieldName = fieldName;
4882
      }
4883
 
4884
      public short getThriftFieldId() {
4885
        return _thriftId;
4886
      }
4887
 
4888
      public String getFieldName() {
4889
        return _fieldName;
4890
      }
4891
    }
3430 rajveer 4892
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 4893
    static {
3430 rajveer 4894
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4895
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4896
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_args.class, metaDataMap);
1982 varun.gupt 4897
    }
4898
 
4899
    public getAllPromotions_args() {
4900
    }
4901
 
4902
    /**
4903
     * Performs a deep copy on <i>other</i>.
4904
     */
4905
    public getAllPromotions_args(getAllPromotions_args other) {
4906
    }
4907
 
4908
    public getAllPromotions_args deepCopy() {
4909
      return new getAllPromotions_args(this);
4910
    }
4911
 
3430 rajveer 4912
    @Override
4913
    public void clear() {
1982 varun.gupt 4914
    }
4915
 
4916
    public void setFieldValue(_Fields field, Object value) {
4917
      switch (field) {
4918
      }
4919
    }
4920
 
4921
    public Object getFieldValue(_Fields field) {
4922
      switch (field) {
4923
      }
4924
      throw new IllegalStateException();
4925
    }
4926
 
3430 rajveer 4927
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4928
    public boolean isSet(_Fields field) {
4929
      if (field == null) {
4930
        throw new IllegalArgumentException();
4931
      }
1982 varun.gupt 4932
 
4933
      switch (field) {
4934
      }
4935
      throw new IllegalStateException();
4936
    }
4937
 
4938
    @Override
4939
    public boolean equals(Object that) {
4940
      if (that == null)
4941
        return false;
4942
      if (that instanceof getAllPromotions_args)
4943
        return this.equals((getAllPromotions_args)that);
4944
      return false;
4945
    }
4946
 
4947
    public boolean equals(getAllPromotions_args that) {
4948
      if (that == null)
4949
        return false;
4950
 
4951
      return true;
4952
    }
4953
 
4954
    @Override
4955
    public int hashCode() {
4956
      return 0;
4957
    }
4958
 
4959
    public int compareTo(getAllPromotions_args other) {
4960
      if (!getClass().equals(other.getClass())) {
4961
        return getClass().getName().compareTo(other.getClass().getName());
4962
      }
4963
 
4964
      int lastComparison = 0;
4965
      getAllPromotions_args typedOther = (getAllPromotions_args)other;
4966
 
4967
      return 0;
4968
    }
4969
 
3430 rajveer 4970
    public _Fields fieldForId(int fieldId) {
4971
      return _Fields.findByThriftId(fieldId);
4972
    }
4973
 
4974
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4975
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 4976
      iprot.readStructBegin();
4977
      while (true)
4978
      {
4979
        field = iprot.readFieldBegin();
3430 rajveer 4980
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 4981
          break;
4982
        }
3430 rajveer 4983
        switch (field.id) {
4984
          default:
4985
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 4986
        }
3430 rajveer 4987
        iprot.readFieldEnd();
1982 varun.gupt 4988
      }
4989
      iprot.readStructEnd();
4990
      validate();
4991
    }
4992
 
3430 rajveer 4993
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 4994
      validate();
4995
 
4996
      oprot.writeStructBegin(STRUCT_DESC);
4997
      oprot.writeFieldStop();
4998
      oprot.writeStructEnd();
4999
    }
5000
 
5001
    @Override
5002
    public String toString() {
5003
      StringBuilder sb = new StringBuilder("getAllPromotions_args(");
5004
      boolean first = true;
5005
 
5006
      sb.append(")");
5007
      return sb.toString();
5008
    }
5009
 
3430 rajveer 5010
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5011
      // check for required fields
5012
    }
5013
 
3430 rajveer 5014
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5015
      try {
5016
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5017
      } catch (org.apache.thrift.TException te) {
5018
        throw new java.io.IOException(te);
5019
      }
5020
    }
5021
 
5022
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5023
      try {
5024
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5025
      } catch (org.apache.thrift.TException te) {
5026
        throw new java.io.IOException(te);
5027
      }
5028
    }
5029
 
1982 varun.gupt 5030
  }
5031
 
3430 rajveer 5032
  public static class getAllPromotions_result implements org.apache.thrift.TBase<getAllPromotions_result, getAllPromotions_result._Fields>, java.io.Serializable, Cloneable   {
5033
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_result");
1982 varun.gupt 5034
 
3430 rajveer 5035
    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);
5036
    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 5037
 
3430 rajveer 5038
    private List<Promotion> success; // required
5039
    private PromotionException pex; // required
1982 varun.gupt 5040
 
5041
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5042
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5043
      SUCCESS((short)0, "success"),
5044
      PEX((short)1, "pex");
5045
 
5046
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5047
 
5048
      static {
5049
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5050
          byName.put(field.getFieldName(), field);
5051
        }
5052
      }
5053
 
5054
      /**
5055
       * Find the _Fields constant that matches fieldId, or null if its not found.
5056
       */
5057
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5058
        switch(fieldId) {
5059
          case 0: // SUCCESS
5060
            return SUCCESS;
5061
          case 1: // PEX
5062
            return PEX;
5063
          default:
5064
            return null;
5065
        }
1982 varun.gupt 5066
      }
5067
 
5068
      /**
5069
       * Find the _Fields constant that matches fieldId, throwing an exception
5070
       * if it is not found.
5071
       */
5072
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5073
        _Fields fields = findByThriftId(fieldId);
5074
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5075
        return fields;
5076
      }
5077
 
5078
      /**
5079
       * Find the _Fields constant that matches name, or null if its not found.
5080
       */
5081
      public static _Fields findByName(String name) {
5082
        return byName.get(name);
5083
      }
5084
 
5085
      private final short _thriftId;
5086
      private final String _fieldName;
5087
 
5088
      _Fields(short thriftId, String fieldName) {
5089
        _thriftId = thriftId;
5090
        _fieldName = fieldName;
5091
      }
5092
 
5093
      public short getThriftFieldId() {
5094
        return _thriftId;
5095
      }
5096
 
5097
      public String getFieldName() {
5098
        return _fieldName;
5099
      }
5100
    }
5101
 
5102
    // isset id assignments
5103
 
3430 rajveer 5104
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5105
    static {
3430 rajveer 5106
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5107
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5108
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
5109
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class))));
5110
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5111
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
5112
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5113
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_result.class, metaDataMap);
1982 varun.gupt 5114
    }
5115
 
5116
    public getAllPromotions_result() {
5117
    }
5118
 
5119
    public getAllPromotions_result(
5120
      List<Promotion> success,
5121
      PromotionException pex)
5122
    {
5123
      this();
5124
      this.success = success;
5125
      this.pex = pex;
5126
    }
5127
 
5128
    /**
5129
     * Performs a deep copy on <i>other</i>.
5130
     */
5131
    public getAllPromotions_result(getAllPromotions_result other) {
5132
      if (other.isSetSuccess()) {
5133
        List<Promotion> __this__success = new ArrayList<Promotion>();
5134
        for (Promotion other_element : other.success) {
5135
          __this__success.add(new Promotion(other_element));
5136
        }
5137
        this.success = __this__success;
5138
      }
5139
      if (other.isSetPex()) {
5140
        this.pex = new PromotionException(other.pex);
5141
      }
5142
    }
5143
 
5144
    public getAllPromotions_result deepCopy() {
5145
      return new getAllPromotions_result(this);
5146
    }
5147
 
3430 rajveer 5148
    @Override
5149
    public void clear() {
5150
      this.success = null;
5151
      this.pex = null;
1982 varun.gupt 5152
    }
5153
 
5154
    public int getSuccessSize() {
5155
      return (this.success == null) ? 0 : this.success.size();
5156
    }
5157
 
5158
    public java.util.Iterator<Promotion> getSuccessIterator() {
5159
      return (this.success == null) ? null : this.success.iterator();
5160
    }
5161
 
5162
    public void addToSuccess(Promotion elem) {
5163
      if (this.success == null) {
5164
        this.success = new ArrayList<Promotion>();
5165
      }
5166
      this.success.add(elem);
5167
    }
5168
 
5169
    public List<Promotion> getSuccess() {
5170
      return this.success;
5171
    }
5172
 
3430 rajveer 5173
    public void setSuccess(List<Promotion> success) {
1982 varun.gupt 5174
      this.success = success;
5175
    }
5176
 
5177
    public void unsetSuccess() {
5178
      this.success = null;
5179
    }
5180
 
3430 rajveer 5181
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5182
    public boolean isSetSuccess() {
5183
      return this.success != null;
5184
    }
5185
 
5186
    public void setSuccessIsSet(boolean value) {
5187
      if (!value) {
5188
        this.success = null;
5189
      }
5190
    }
5191
 
5192
    public PromotionException getPex() {
5193
      return this.pex;
5194
    }
5195
 
3430 rajveer 5196
    public void setPex(PromotionException pex) {
1982 varun.gupt 5197
      this.pex = pex;
5198
    }
5199
 
5200
    public void unsetPex() {
5201
      this.pex = null;
5202
    }
5203
 
3430 rajveer 5204
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5205
    public boolean isSetPex() {
5206
      return this.pex != null;
5207
    }
5208
 
5209
    public void setPexIsSet(boolean value) {
5210
      if (!value) {
5211
        this.pex = null;
5212
      }
5213
    }
5214
 
5215
    public void setFieldValue(_Fields field, Object value) {
5216
      switch (field) {
5217
      case SUCCESS:
5218
        if (value == null) {
5219
          unsetSuccess();
5220
        } else {
5221
          setSuccess((List<Promotion>)value);
5222
        }
5223
        break;
5224
 
5225
      case PEX:
5226
        if (value == null) {
5227
          unsetPex();
5228
        } else {
5229
          setPex((PromotionException)value);
5230
        }
5231
        break;
5232
 
5233
      }
5234
    }
5235
 
5236
    public Object getFieldValue(_Fields field) {
5237
      switch (field) {
5238
      case SUCCESS:
5239
        return getSuccess();
5240
 
5241
      case PEX:
5242
        return getPex();
5243
 
5244
      }
5245
      throw new IllegalStateException();
5246
    }
5247
 
3430 rajveer 5248
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5249
    public boolean isSet(_Fields field) {
5250
      if (field == null) {
5251
        throw new IllegalArgumentException();
5252
      }
1982 varun.gupt 5253
 
5254
      switch (field) {
5255
      case SUCCESS:
5256
        return isSetSuccess();
5257
      case PEX:
5258
        return isSetPex();
5259
      }
5260
      throw new IllegalStateException();
5261
    }
5262
 
5263
    @Override
5264
    public boolean equals(Object that) {
5265
      if (that == null)
5266
        return false;
5267
      if (that instanceof getAllPromotions_result)
5268
        return this.equals((getAllPromotions_result)that);
5269
      return false;
5270
    }
5271
 
5272
    public boolean equals(getAllPromotions_result that) {
5273
      if (that == null)
5274
        return false;
5275
 
5276
      boolean this_present_success = true && this.isSetSuccess();
5277
      boolean that_present_success = true && that.isSetSuccess();
5278
      if (this_present_success || that_present_success) {
5279
        if (!(this_present_success && that_present_success))
5280
          return false;
5281
        if (!this.success.equals(that.success))
5282
          return false;
5283
      }
5284
 
5285
      boolean this_present_pex = true && this.isSetPex();
5286
      boolean that_present_pex = true && that.isSetPex();
5287
      if (this_present_pex || that_present_pex) {
5288
        if (!(this_present_pex && that_present_pex))
5289
          return false;
5290
        if (!this.pex.equals(that.pex))
5291
          return false;
5292
      }
5293
 
5294
      return true;
5295
    }
5296
 
5297
    @Override
5298
    public int hashCode() {
5299
      return 0;
5300
    }
5301
 
5302
    public int compareTo(getAllPromotions_result other) {
5303
      if (!getClass().equals(other.getClass())) {
5304
        return getClass().getName().compareTo(other.getClass().getName());
5305
      }
5306
 
5307
      int lastComparison = 0;
5308
      getAllPromotions_result typedOther = (getAllPromotions_result)other;
5309
 
3430 rajveer 5310
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 5311
      if (lastComparison != 0) {
5312
        return lastComparison;
5313
      }
3430 rajveer 5314
      if (isSetSuccess()) {
5315
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
5316
        if (lastComparison != 0) {
5317
          return lastComparison;
5318
        }
1982 varun.gupt 5319
      }
3430 rajveer 5320
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 5321
      if (lastComparison != 0) {
5322
        return lastComparison;
5323
      }
3430 rajveer 5324
      if (isSetPex()) {
5325
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
5326
        if (lastComparison != 0) {
5327
          return lastComparison;
5328
        }
1982 varun.gupt 5329
      }
5330
      return 0;
5331
    }
5332
 
3430 rajveer 5333
    public _Fields fieldForId(int fieldId) {
5334
      return _Fields.findByThriftId(fieldId);
5335
    }
5336
 
5337
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5338
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5339
      iprot.readStructBegin();
5340
      while (true)
5341
      {
5342
        field = iprot.readFieldBegin();
3430 rajveer 5343
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5344
          break;
5345
        }
3430 rajveer 5346
        switch (field.id) {
5347
          case 0: // SUCCESS
5348
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
5349
              {
5327 rajveer 5350
                org.apache.thrift.protocol.TList _list12 = iprot.readListBegin();
5351
                this.success = new ArrayList<Promotion>(_list12.size);
5352
                for (int _i13 = 0; _i13 < _list12.size; ++_i13)
1982 varun.gupt 5353
                {
5327 rajveer 5354
                  Promotion _elem14; // required
5355
                  _elem14 = new Promotion();
5356
                  _elem14.read(iprot);
5357
                  this.success.add(_elem14);
1982 varun.gupt 5358
                }
3430 rajveer 5359
                iprot.readListEnd();
1982 varun.gupt 5360
              }
3430 rajveer 5361
            } else { 
5362
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5363
            }
5364
            break;
5365
          case 1: // PEX
5366
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5367
              this.pex = new PromotionException();
5368
              this.pex.read(iprot);
5369
            } else { 
5370
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5371
            }
5372
            break;
5373
          default:
5374
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5375
        }
3430 rajveer 5376
        iprot.readFieldEnd();
1982 varun.gupt 5377
      }
5378
      iprot.readStructEnd();
5379
      validate();
5380
    }
5381
 
3430 rajveer 5382
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5383
      oprot.writeStructBegin(STRUCT_DESC);
5384
 
5385
      if (this.isSetSuccess()) {
5386
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
5387
        {
3430 rajveer 5388
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
5327 rajveer 5389
          for (Promotion _iter15 : this.success)
1982 varun.gupt 5390
          {
5327 rajveer 5391
            _iter15.write(oprot);
1982 varun.gupt 5392
          }
5393
          oprot.writeListEnd();
5394
        }
5395
        oprot.writeFieldEnd();
5396
      } else if (this.isSetPex()) {
5397
        oprot.writeFieldBegin(PEX_FIELD_DESC);
5398
        this.pex.write(oprot);
5399
        oprot.writeFieldEnd();
5400
      }
5401
      oprot.writeFieldStop();
5402
      oprot.writeStructEnd();
5403
    }
5404
 
5405
    @Override
5406
    public String toString() {
5407
      StringBuilder sb = new StringBuilder("getAllPromotions_result(");
5408
      boolean first = true;
5409
 
5410
      sb.append("success:");
5411
      if (this.success == null) {
5412
        sb.append("null");
5413
      } else {
5414
        sb.append(this.success);
5415
      }
5416
      first = false;
5417
      if (!first) sb.append(", ");
5418
      sb.append("pex:");
5419
      if (this.pex == null) {
5420
        sb.append("null");
5421
      } else {
5422
        sb.append(this.pex);
5423
      }
5424
      first = false;
5425
      sb.append(")");
5426
      return sb.toString();
5427
    }
5428
 
3430 rajveer 5429
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5430
      // check for required fields
5431
    }
5432
 
3430 rajveer 5433
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5434
      try {
5435
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5436
      } catch (org.apache.thrift.TException te) {
5437
        throw new java.io.IOException(te);
5438
      }
5439
    }
5440
 
5441
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5442
      try {
5443
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5444
      } catch (org.apache.thrift.TException te) {
5445
        throw new java.io.IOException(te);
5446
      }
5447
    }
5448
 
1982 varun.gupt 5449
  }
5450
 
3430 rajveer 5451
  public static class getPromotionById_args implements org.apache.thrift.TBase<getPromotionById_args, getPromotionById_args._Fields>, java.io.Serializable, Cloneable   {
5452
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_args");
1982 varun.gupt 5453
 
3430 rajveer 5454
    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 5455
 
3430 rajveer 5456
    private long promotionId; // required
1982 varun.gupt 5457
 
5458
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5459
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5460
      PROMOTION_ID((short)1, "promotionId");
5461
 
5462
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5463
 
5464
      static {
5465
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5466
          byName.put(field.getFieldName(), field);
5467
        }
5468
      }
5469
 
5470
      /**
5471
       * Find the _Fields constant that matches fieldId, or null if its not found.
5472
       */
5473
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5474
        switch(fieldId) {
5475
          case 1: // PROMOTION_ID
5476
            return PROMOTION_ID;
5477
          default:
5478
            return null;
5479
        }
1982 varun.gupt 5480
      }
5481
 
5482
      /**
5483
       * Find the _Fields constant that matches fieldId, throwing an exception
5484
       * if it is not found.
5485
       */
5486
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5487
        _Fields fields = findByThriftId(fieldId);
5488
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5489
        return fields;
5490
      }
5491
 
5492
      /**
5493
       * Find the _Fields constant that matches name, or null if its not found.
5494
       */
5495
      public static _Fields findByName(String name) {
5496
        return byName.get(name);
5497
      }
5498
 
5499
      private final short _thriftId;
5500
      private final String _fieldName;
5501
 
5502
      _Fields(short thriftId, String fieldName) {
5503
        _thriftId = thriftId;
5504
        _fieldName = fieldName;
5505
      }
5506
 
5507
      public short getThriftFieldId() {
5508
        return _thriftId;
5509
      }
5510
 
5511
      public String getFieldName() {
5512
        return _fieldName;
5513
      }
5514
    }
5515
 
5516
    // isset id assignments
5517
    private static final int __PROMOTIONID_ISSET_ID = 0;
5518
    private BitSet __isset_bit_vector = new BitSet(1);
5519
 
3430 rajveer 5520
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5521
    static {
3430 rajveer 5522
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5523
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5524
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
5525
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5526
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_args.class, metaDataMap);
1982 varun.gupt 5527
    }
5528
 
5529
    public getPromotionById_args() {
5530
    }
5531
 
5532
    public getPromotionById_args(
5533
      long promotionId)
5534
    {
5535
      this();
5536
      this.promotionId = promotionId;
5537
      setPromotionIdIsSet(true);
5538
    }
5539
 
5540
    /**
5541
     * Performs a deep copy on <i>other</i>.
5542
     */
5543
    public getPromotionById_args(getPromotionById_args other) {
5544
      __isset_bit_vector.clear();
5545
      __isset_bit_vector.or(other.__isset_bit_vector);
5546
      this.promotionId = other.promotionId;
5547
    }
5548
 
5549
    public getPromotionById_args deepCopy() {
5550
      return new getPromotionById_args(this);
5551
    }
5552
 
3430 rajveer 5553
    @Override
5554
    public void clear() {
5555
      setPromotionIdIsSet(false);
5556
      this.promotionId = 0;
1982 varun.gupt 5557
    }
5558
 
5559
    public long getPromotionId() {
5560
      return this.promotionId;
5561
    }
5562
 
3430 rajveer 5563
    public void setPromotionId(long promotionId) {
1982 varun.gupt 5564
      this.promotionId = promotionId;
5565
      setPromotionIdIsSet(true);
5566
    }
5567
 
5568
    public void unsetPromotionId() {
5569
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
5570
    }
5571
 
3430 rajveer 5572
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5573
    public boolean isSetPromotionId() {
5574
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
5575
    }
5576
 
5577
    public void setPromotionIdIsSet(boolean value) {
5578
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
5579
    }
5580
 
5581
    public void setFieldValue(_Fields field, Object value) {
5582
      switch (field) {
5583
      case PROMOTION_ID:
5584
        if (value == null) {
5585
          unsetPromotionId();
5586
        } else {
5587
          setPromotionId((Long)value);
5588
        }
5589
        break;
5590
 
5591
      }
5592
    }
5593
 
5594
    public Object getFieldValue(_Fields field) {
5595
      switch (field) {
5596
      case PROMOTION_ID:
3430 rajveer 5597
        return Long.valueOf(getPromotionId());
1982 varun.gupt 5598
 
5599
      }
5600
      throw new IllegalStateException();
5601
    }
5602
 
3430 rajveer 5603
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5604
    public boolean isSet(_Fields field) {
5605
      if (field == null) {
5606
        throw new IllegalArgumentException();
5607
      }
1982 varun.gupt 5608
 
5609
      switch (field) {
5610
      case PROMOTION_ID:
5611
        return isSetPromotionId();
5612
      }
5613
      throw new IllegalStateException();
5614
    }
5615
 
5616
    @Override
5617
    public boolean equals(Object that) {
5618
      if (that == null)
5619
        return false;
5620
      if (that instanceof getPromotionById_args)
5621
        return this.equals((getPromotionById_args)that);
5622
      return false;
5623
    }
5624
 
5625
    public boolean equals(getPromotionById_args that) {
5626
      if (that == null)
5627
        return false;
5628
 
5629
      boolean this_present_promotionId = true;
5630
      boolean that_present_promotionId = true;
5631
      if (this_present_promotionId || that_present_promotionId) {
5632
        if (!(this_present_promotionId && that_present_promotionId))
5633
          return false;
5634
        if (this.promotionId != that.promotionId)
5635
          return false;
5636
      }
5637
 
5638
      return true;
5639
    }
5640
 
5641
    @Override
5642
    public int hashCode() {
5643
      return 0;
5644
    }
5645
 
5646
    public int compareTo(getPromotionById_args other) {
5647
      if (!getClass().equals(other.getClass())) {
5648
        return getClass().getName().compareTo(other.getClass().getName());
5649
      }
5650
 
5651
      int lastComparison = 0;
5652
      getPromotionById_args typedOther = (getPromotionById_args)other;
5653
 
3430 rajveer 5654
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 5655
      if (lastComparison != 0) {
5656
        return lastComparison;
5657
      }
3430 rajveer 5658
      if (isSetPromotionId()) {
5659
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
5660
        if (lastComparison != 0) {
5661
          return lastComparison;
5662
        }
1982 varun.gupt 5663
      }
5664
      return 0;
5665
    }
5666
 
3430 rajveer 5667
    public _Fields fieldForId(int fieldId) {
5668
      return _Fields.findByThriftId(fieldId);
5669
    }
5670
 
5671
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5672
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5673
      iprot.readStructBegin();
5674
      while (true)
5675
      {
5676
        field = iprot.readFieldBegin();
3430 rajveer 5677
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5678
          break;
5679
        }
3430 rajveer 5680
        switch (field.id) {
5681
          case 1: // PROMOTION_ID
5682
            if (field.type == org.apache.thrift.protocol.TType.I64) {
5683
              this.promotionId = iprot.readI64();
5684
              setPromotionIdIsSet(true);
5685
            } else { 
5686
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5687
            }
5688
            break;
5689
          default:
5690
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5691
        }
3430 rajveer 5692
        iprot.readFieldEnd();
1982 varun.gupt 5693
      }
5694
      iprot.readStructEnd();
5695
      validate();
5696
    }
5697
 
3430 rajveer 5698
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5699
      validate();
5700
 
5701
      oprot.writeStructBegin(STRUCT_DESC);
5702
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
5703
      oprot.writeI64(this.promotionId);
5704
      oprot.writeFieldEnd();
5705
      oprot.writeFieldStop();
5706
      oprot.writeStructEnd();
5707
    }
5708
 
5709
    @Override
5710
    public String toString() {
5711
      StringBuilder sb = new StringBuilder("getPromotionById_args(");
5712
      boolean first = true;
5713
 
5714
      sb.append("promotionId:");
5715
      sb.append(this.promotionId);
5716
      first = false;
5717
      sb.append(")");
5718
      return sb.toString();
5719
    }
5720
 
3430 rajveer 5721
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5722
      // check for required fields
5723
    }
5724
 
3430 rajveer 5725
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5726
      try {
5727
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5728
      } catch (org.apache.thrift.TException te) {
5729
        throw new java.io.IOException(te);
5730
      }
5731
    }
5732
 
5733
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5734
      try {
5735
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
5736
        __isset_bit_vector = new BitSet(1);
5737
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5738
      } catch (org.apache.thrift.TException te) {
5739
        throw new java.io.IOException(te);
5740
      }
5741
    }
5742
 
1982 varun.gupt 5743
  }
5744
 
3430 rajveer 5745
  public static class getPromotionById_result implements org.apache.thrift.TBase<getPromotionById_result, getPromotionById_result._Fields>, java.io.Serializable, Cloneable   {
5746
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_result");
1982 varun.gupt 5747
 
3430 rajveer 5748
    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);
5749
    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 5750
 
3430 rajveer 5751
    private Promotion success; // required
5752
    private PromotionException pex; // required
1982 varun.gupt 5753
 
5754
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5755
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5756
      SUCCESS((short)0, "success"),
5757
      PEX((short)1, "pex");
5758
 
5759
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5760
 
5761
      static {
5762
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5763
          byName.put(field.getFieldName(), field);
5764
        }
5765
      }
5766
 
5767
      /**
5768
       * Find the _Fields constant that matches fieldId, or null if its not found.
5769
       */
5770
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5771
        switch(fieldId) {
5772
          case 0: // SUCCESS
5773
            return SUCCESS;
5774
          case 1: // PEX
5775
            return PEX;
5776
          default:
5777
            return null;
5778
        }
1982 varun.gupt 5779
      }
5780
 
5781
      /**
5782
       * Find the _Fields constant that matches fieldId, throwing an exception
5783
       * if it is not found.
5784
       */
5785
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5786
        _Fields fields = findByThriftId(fieldId);
5787
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5788
        return fields;
5789
      }
5790
 
5791
      /**
5792
       * Find the _Fields constant that matches name, or null if its not found.
5793
       */
5794
      public static _Fields findByName(String name) {
5795
        return byName.get(name);
5796
      }
5797
 
5798
      private final short _thriftId;
5799
      private final String _fieldName;
5800
 
5801
      _Fields(short thriftId, String fieldName) {
5802
        _thriftId = thriftId;
5803
        _fieldName = fieldName;
5804
      }
5805
 
5806
      public short getThriftFieldId() {
5807
        return _thriftId;
5808
      }
5809
 
5810
      public String getFieldName() {
5811
        return _fieldName;
5812
      }
5813
    }
5814
 
5815
    // isset id assignments
5816
 
3430 rajveer 5817
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5818
    static {
3430 rajveer 5819
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5820
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5821
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class)));
5822
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5823
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
5824
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5825
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_result.class, metaDataMap);
1982 varun.gupt 5826
    }
5827
 
5828
    public getPromotionById_result() {
5829
    }
5830
 
5831
    public getPromotionById_result(
5832
      Promotion success,
5833
      PromotionException pex)
5834
    {
5835
      this();
5836
      this.success = success;
5837
      this.pex = pex;
5838
    }
5839
 
5840
    /**
5841
     * Performs a deep copy on <i>other</i>.
5842
     */
5843
    public getPromotionById_result(getPromotionById_result other) {
5844
      if (other.isSetSuccess()) {
5845
        this.success = new Promotion(other.success);
5846
      }
5847
      if (other.isSetPex()) {
5848
        this.pex = new PromotionException(other.pex);
5849
      }
5850
    }
5851
 
5852
    public getPromotionById_result deepCopy() {
5853
      return new getPromotionById_result(this);
5854
    }
5855
 
3430 rajveer 5856
    @Override
5857
    public void clear() {
5858
      this.success = null;
5859
      this.pex = null;
1982 varun.gupt 5860
    }
5861
 
5862
    public Promotion getSuccess() {
5863
      return this.success;
5864
    }
5865
 
3430 rajveer 5866
    public void setSuccess(Promotion success) {
1982 varun.gupt 5867
      this.success = success;
5868
    }
5869
 
5870
    public void unsetSuccess() {
5871
      this.success = null;
5872
    }
5873
 
3430 rajveer 5874
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5875
    public boolean isSetSuccess() {
5876
      return this.success != null;
5877
    }
5878
 
5879
    public void setSuccessIsSet(boolean value) {
5880
      if (!value) {
5881
        this.success = null;
5882
      }
5883
    }
5884
 
5885
    public PromotionException getPex() {
5886
      return this.pex;
5887
    }
5888
 
3430 rajveer 5889
    public void setPex(PromotionException pex) {
1982 varun.gupt 5890
      this.pex = pex;
5891
    }
5892
 
5893
    public void unsetPex() {
5894
      this.pex = null;
5895
    }
5896
 
3430 rajveer 5897
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5898
    public boolean isSetPex() {
5899
      return this.pex != null;
5900
    }
5901
 
5902
    public void setPexIsSet(boolean value) {
5903
      if (!value) {
5904
        this.pex = null;
5905
      }
5906
    }
5907
 
5908
    public void setFieldValue(_Fields field, Object value) {
5909
      switch (field) {
5910
      case SUCCESS:
5911
        if (value == null) {
5912
          unsetSuccess();
5913
        } else {
5914
          setSuccess((Promotion)value);
5915
        }
5916
        break;
5917
 
5918
      case PEX:
5919
        if (value == null) {
5920
          unsetPex();
5921
        } else {
5922
          setPex((PromotionException)value);
5923
        }
5924
        break;
5925
 
5926
      }
5927
    }
5928
 
5929
    public Object getFieldValue(_Fields field) {
5930
      switch (field) {
5931
      case SUCCESS:
5932
        return getSuccess();
5933
 
5934
      case PEX:
5935
        return getPex();
5936
 
5937
      }
5938
      throw new IllegalStateException();
5939
    }
5940
 
3430 rajveer 5941
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5942
    public boolean isSet(_Fields field) {
5943
      if (field == null) {
5944
        throw new IllegalArgumentException();
5945
      }
1982 varun.gupt 5946
 
5947
      switch (field) {
5948
      case SUCCESS:
5949
        return isSetSuccess();
5950
      case PEX:
5951
        return isSetPex();
5952
      }
5953
      throw new IllegalStateException();
5954
    }
5955
 
5956
    @Override
5957
    public boolean equals(Object that) {
5958
      if (that == null)
5959
        return false;
5960
      if (that instanceof getPromotionById_result)
5961
        return this.equals((getPromotionById_result)that);
5962
      return false;
5963
    }
5964
 
5965
    public boolean equals(getPromotionById_result that) {
5966
      if (that == null)
5967
        return false;
5968
 
5969
      boolean this_present_success = true && this.isSetSuccess();
5970
      boolean that_present_success = true && that.isSetSuccess();
5971
      if (this_present_success || that_present_success) {
5972
        if (!(this_present_success && that_present_success))
5973
          return false;
5974
        if (!this.success.equals(that.success))
5975
          return false;
5976
      }
5977
 
5978
      boolean this_present_pex = true && this.isSetPex();
5979
      boolean that_present_pex = true && that.isSetPex();
5980
      if (this_present_pex || that_present_pex) {
5981
        if (!(this_present_pex && that_present_pex))
5982
          return false;
5983
        if (!this.pex.equals(that.pex))
5984
          return false;
5985
      }
5986
 
5987
      return true;
5988
    }
5989
 
5990
    @Override
5991
    public int hashCode() {
5992
      return 0;
5993
    }
5994
 
5995
    public int compareTo(getPromotionById_result other) {
5996
      if (!getClass().equals(other.getClass())) {
5997
        return getClass().getName().compareTo(other.getClass().getName());
5998
      }
5999
 
6000
      int lastComparison = 0;
6001
      getPromotionById_result typedOther = (getPromotionById_result)other;
6002
 
3430 rajveer 6003
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 6004
      if (lastComparison != 0) {
6005
        return lastComparison;
6006
      }
3430 rajveer 6007
      if (isSetSuccess()) {
6008
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
6009
        if (lastComparison != 0) {
6010
          return lastComparison;
6011
        }
1982 varun.gupt 6012
      }
3430 rajveer 6013
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 6014
      if (lastComparison != 0) {
6015
        return lastComparison;
6016
      }
3430 rajveer 6017
      if (isSetPex()) {
6018
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
6019
        if (lastComparison != 0) {
6020
          return lastComparison;
6021
        }
1982 varun.gupt 6022
      }
6023
      return 0;
6024
    }
6025
 
3430 rajveer 6026
    public _Fields fieldForId(int fieldId) {
6027
      return _Fields.findByThriftId(fieldId);
6028
    }
6029
 
6030
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6031
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6032
      iprot.readStructBegin();
6033
      while (true)
6034
      {
6035
        field = iprot.readFieldBegin();
3430 rajveer 6036
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6037
          break;
6038
        }
3430 rajveer 6039
        switch (field.id) {
6040
          case 0: // SUCCESS
6041
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6042
              this.success = new Promotion();
6043
              this.success.read(iprot);
6044
            } else { 
6045
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6046
            }
6047
            break;
6048
          case 1: // PEX
6049
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6050
              this.pex = new PromotionException();
6051
              this.pex.read(iprot);
6052
            } else { 
6053
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6054
            }
6055
            break;
6056
          default:
6057
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6058
        }
3430 rajveer 6059
        iprot.readFieldEnd();
1982 varun.gupt 6060
      }
6061
      iprot.readStructEnd();
6062
      validate();
6063
    }
6064
 
3430 rajveer 6065
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6066
      oprot.writeStructBegin(STRUCT_DESC);
6067
 
6068
      if (this.isSetSuccess()) {
6069
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
6070
        this.success.write(oprot);
6071
        oprot.writeFieldEnd();
6072
      } else if (this.isSetPex()) {
6073
        oprot.writeFieldBegin(PEX_FIELD_DESC);
6074
        this.pex.write(oprot);
6075
        oprot.writeFieldEnd();
6076
      }
6077
      oprot.writeFieldStop();
6078
      oprot.writeStructEnd();
6079
    }
6080
 
6081
    @Override
6082
    public String toString() {
6083
      StringBuilder sb = new StringBuilder("getPromotionById_result(");
6084
      boolean first = true;
6085
 
6086
      sb.append("success:");
6087
      if (this.success == null) {
6088
        sb.append("null");
6089
      } else {
6090
        sb.append(this.success);
6091
      }
6092
      first = false;
6093
      if (!first) sb.append(", ");
6094
      sb.append("pex:");
6095
      if (this.pex == null) {
6096
        sb.append("null");
6097
      } else {
6098
        sb.append(this.pex);
6099
      }
6100
      first = false;
6101
      sb.append(")");
6102
      return sb.toString();
6103
    }
6104
 
3430 rajveer 6105
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6106
      // check for required fields
6107
    }
6108
 
3430 rajveer 6109
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6110
      try {
6111
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6112
      } catch (org.apache.thrift.TException te) {
6113
        throw new java.io.IOException(te);
6114
      }
6115
    }
6116
 
6117
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6118
      try {
6119
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6120
      } catch (org.apache.thrift.TException te) {
6121
        throw new java.io.IOException(te);
6122
      }
6123
    }
6124
 
1982 varun.gupt 6125
  }
6126
 
3430 rajveer 6127
  public static class generateCouponsForPromotion_args implements org.apache.thrift.TBase<generateCouponsForPromotion_args, generateCouponsForPromotion_args._Fields>, java.io.Serializable, Cloneable   {
6128
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_args");
1982 varun.gupt 6129
 
3430 rajveer 6130
    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);
6131
    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 6132
 
3430 rajveer 6133
    private long promotionId; // required
6134
    private String couponCode; // required
1982 varun.gupt 6135
 
6136
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6137
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6138
      PROMOTION_ID((short)1, "promotionId"),
6139
      COUPON_CODE((short)2, "couponCode");
6140
 
6141
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6142
 
6143
      static {
6144
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6145
          byName.put(field.getFieldName(), field);
6146
        }
6147
      }
6148
 
6149
      /**
6150
       * Find the _Fields constant that matches fieldId, or null if its not found.
6151
       */
6152
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6153
        switch(fieldId) {
6154
          case 1: // PROMOTION_ID
6155
            return PROMOTION_ID;
6156
          case 2: // COUPON_CODE
6157
            return COUPON_CODE;
6158
          default:
6159
            return null;
6160
        }
1982 varun.gupt 6161
      }
6162
 
6163
      /**
6164
       * Find the _Fields constant that matches fieldId, throwing an exception
6165
       * if it is not found.
6166
       */
6167
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6168
        _Fields fields = findByThriftId(fieldId);
6169
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6170
        return fields;
6171
      }
6172
 
6173
      /**
6174
       * Find the _Fields constant that matches name, or null if its not found.
6175
       */
6176
      public static _Fields findByName(String name) {
6177
        return byName.get(name);
6178
      }
6179
 
6180
      private final short _thriftId;
6181
      private final String _fieldName;
6182
 
6183
      _Fields(short thriftId, String fieldName) {
6184
        _thriftId = thriftId;
6185
        _fieldName = fieldName;
6186
      }
6187
 
6188
      public short getThriftFieldId() {
6189
        return _thriftId;
6190
      }
6191
 
6192
      public String getFieldName() {
6193
        return _fieldName;
6194
      }
6195
    }
6196
 
6197
    // isset id assignments
6198
    private static final int __PROMOTIONID_ISSET_ID = 0;
6199
    private BitSet __isset_bit_vector = new BitSet(1);
6200
 
3430 rajveer 6201
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6202
    static {
3430 rajveer 6203
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6204
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6205
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6206
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6207
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6208
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6209
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_args.class, metaDataMap);
1982 varun.gupt 6210
    }
6211
 
6212
    public generateCouponsForPromotion_args() {
6213
    }
6214
 
6215
    public generateCouponsForPromotion_args(
6216
      long promotionId,
6217
      String couponCode)
6218
    {
6219
      this();
6220
      this.promotionId = promotionId;
6221
      setPromotionIdIsSet(true);
6222
      this.couponCode = couponCode;
6223
    }
6224
 
6225
    /**
6226
     * Performs a deep copy on <i>other</i>.
6227
     */
6228
    public generateCouponsForPromotion_args(generateCouponsForPromotion_args other) {
6229
      __isset_bit_vector.clear();
6230
      __isset_bit_vector.or(other.__isset_bit_vector);
6231
      this.promotionId = other.promotionId;
6232
      if (other.isSetCouponCode()) {
6233
        this.couponCode = other.couponCode;
6234
      }
6235
    }
6236
 
6237
    public generateCouponsForPromotion_args deepCopy() {
6238
      return new generateCouponsForPromotion_args(this);
6239
    }
6240
 
3430 rajveer 6241
    @Override
6242
    public void clear() {
6243
      setPromotionIdIsSet(false);
6244
      this.promotionId = 0;
6245
      this.couponCode = null;
1982 varun.gupt 6246
    }
6247
 
6248
    public long getPromotionId() {
6249
      return this.promotionId;
6250
    }
6251
 
3430 rajveer 6252
    public void setPromotionId(long promotionId) {
1982 varun.gupt 6253
      this.promotionId = promotionId;
6254
      setPromotionIdIsSet(true);
6255
    }
6256
 
6257
    public void unsetPromotionId() {
6258
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
6259
    }
6260
 
3430 rajveer 6261
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6262
    public boolean isSetPromotionId() {
6263
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
6264
    }
6265
 
6266
    public void setPromotionIdIsSet(boolean value) {
6267
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
6268
    }
6269
 
6270
    public String getCouponCode() {
6271
      return this.couponCode;
6272
    }
6273
 
3430 rajveer 6274
    public void setCouponCode(String couponCode) {
1982 varun.gupt 6275
      this.couponCode = couponCode;
6276
    }
6277
 
6278
    public void unsetCouponCode() {
6279
      this.couponCode = null;
6280
    }
6281
 
3430 rajveer 6282
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6283
    public boolean isSetCouponCode() {
6284
      return this.couponCode != null;
6285
    }
6286
 
6287
    public void setCouponCodeIsSet(boolean value) {
6288
      if (!value) {
6289
        this.couponCode = null;
6290
      }
6291
    }
6292
 
6293
    public void setFieldValue(_Fields field, Object value) {
6294
      switch (field) {
6295
      case PROMOTION_ID:
6296
        if (value == null) {
6297
          unsetPromotionId();
6298
        } else {
6299
          setPromotionId((Long)value);
6300
        }
6301
        break;
6302
 
6303
      case COUPON_CODE:
6304
        if (value == null) {
6305
          unsetCouponCode();
6306
        } else {
6307
          setCouponCode((String)value);
6308
        }
6309
        break;
6310
 
6311
      }
6312
    }
6313
 
6314
    public Object getFieldValue(_Fields field) {
6315
      switch (field) {
6316
      case PROMOTION_ID:
3430 rajveer 6317
        return Long.valueOf(getPromotionId());
1982 varun.gupt 6318
 
6319
      case COUPON_CODE:
6320
        return getCouponCode();
6321
 
6322
      }
6323
      throw new IllegalStateException();
6324
    }
6325
 
3430 rajveer 6326
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6327
    public boolean isSet(_Fields field) {
6328
      if (field == null) {
6329
        throw new IllegalArgumentException();
6330
      }
1982 varun.gupt 6331
 
6332
      switch (field) {
6333
      case PROMOTION_ID:
6334
        return isSetPromotionId();
6335
      case COUPON_CODE:
6336
        return isSetCouponCode();
6337
      }
6338
      throw new IllegalStateException();
6339
    }
6340
 
6341
    @Override
6342
    public boolean equals(Object that) {
6343
      if (that == null)
6344
        return false;
6345
      if (that instanceof generateCouponsForPromotion_args)
6346
        return this.equals((generateCouponsForPromotion_args)that);
6347
      return false;
6348
    }
6349
 
6350
    public boolean equals(generateCouponsForPromotion_args that) {
6351
      if (that == null)
6352
        return false;
6353
 
6354
      boolean this_present_promotionId = true;
6355
      boolean that_present_promotionId = true;
6356
      if (this_present_promotionId || that_present_promotionId) {
6357
        if (!(this_present_promotionId && that_present_promotionId))
6358
          return false;
6359
        if (this.promotionId != that.promotionId)
6360
          return false;
6361
      }
6362
 
6363
      boolean this_present_couponCode = true && this.isSetCouponCode();
6364
      boolean that_present_couponCode = true && that.isSetCouponCode();
6365
      if (this_present_couponCode || that_present_couponCode) {
6366
        if (!(this_present_couponCode && that_present_couponCode))
6367
          return false;
6368
        if (!this.couponCode.equals(that.couponCode))
6369
          return false;
6370
      }
6371
 
6372
      return true;
6373
    }
6374
 
6375
    @Override
6376
    public int hashCode() {
6377
      return 0;
6378
    }
6379
 
6380
    public int compareTo(generateCouponsForPromotion_args other) {
6381
      if (!getClass().equals(other.getClass())) {
6382
        return getClass().getName().compareTo(other.getClass().getName());
6383
      }
6384
 
6385
      int lastComparison = 0;
6386
      generateCouponsForPromotion_args typedOther = (generateCouponsForPromotion_args)other;
6387
 
3430 rajveer 6388
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 6389
      if (lastComparison != 0) {
6390
        return lastComparison;
6391
      }
3430 rajveer 6392
      if (isSetPromotionId()) {
6393
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
6394
        if (lastComparison != 0) {
6395
          return lastComparison;
6396
        }
1982 varun.gupt 6397
      }
3430 rajveer 6398
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 6399
      if (lastComparison != 0) {
6400
        return lastComparison;
6401
      }
3430 rajveer 6402
      if (isSetCouponCode()) {
6403
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
6404
        if (lastComparison != 0) {
6405
          return lastComparison;
6406
        }
1982 varun.gupt 6407
      }
6408
      return 0;
6409
    }
6410
 
3430 rajveer 6411
    public _Fields fieldForId(int fieldId) {
6412
      return _Fields.findByThriftId(fieldId);
6413
    }
6414
 
6415
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6416
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6417
      iprot.readStructBegin();
6418
      while (true)
6419
      {
6420
        field = iprot.readFieldBegin();
3430 rajveer 6421
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6422
          break;
6423
        }
3430 rajveer 6424
        switch (field.id) {
6425
          case 1: // PROMOTION_ID
6426
            if (field.type == org.apache.thrift.protocol.TType.I64) {
6427
              this.promotionId = iprot.readI64();
6428
              setPromotionIdIsSet(true);
6429
            } else { 
6430
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6431
            }
6432
            break;
6433
          case 2: // COUPON_CODE
6434
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
6435
              this.couponCode = iprot.readString();
6436
            } else { 
6437
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6438
            }
6439
            break;
6440
          default:
6441
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6442
        }
3430 rajveer 6443
        iprot.readFieldEnd();
1982 varun.gupt 6444
      }
6445
      iprot.readStructEnd();
6446
      validate();
6447
    }
6448
 
3430 rajveer 6449
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6450
      validate();
6451
 
6452
      oprot.writeStructBegin(STRUCT_DESC);
6453
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
6454
      oprot.writeI64(this.promotionId);
6455
      oprot.writeFieldEnd();
6456
      if (this.couponCode != null) {
6457
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
6458
        oprot.writeString(this.couponCode);
6459
        oprot.writeFieldEnd();
6460
      }
6461
      oprot.writeFieldStop();
6462
      oprot.writeStructEnd();
6463
    }
6464
 
6465
    @Override
6466
    public String toString() {
6467
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_args(");
6468
      boolean first = true;
6469
 
6470
      sb.append("promotionId:");
6471
      sb.append(this.promotionId);
6472
      first = false;
6473
      if (!first) sb.append(", ");
6474
      sb.append("couponCode:");
6475
      if (this.couponCode == null) {
6476
        sb.append("null");
6477
      } else {
6478
        sb.append(this.couponCode);
6479
      }
6480
      first = false;
6481
      sb.append(")");
6482
      return sb.toString();
6483
    }
6484
 
3430 rajveer 6485
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6486
      // check for required fields
6487
    }
6488
 
3430 rajveer 6489
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6490
      try {
6491
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6492
      } catch (org.apache.thrift.TException te) {
6493
        throw new java.io.IOException(te);
6494
      }
6495
    }
6496
 
6497
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6498
      try {
6499
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
6500
        __isset_bit_vector = new BitSet(1);
6501
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6502
      } catch (org.apache.thrift.TException te) {
6503
        throw new java.io.IOException(te);
6504
      }
6505
    }
6506
 
1982 varun.gupt 6507
  }
6508
 
3430 rajveer 6509
  public static class generateCouponsForPromotion_result implements org.apache.thrift.TBase<generateCouponsForPromotion_result, generateCouponsForPromotion_result._Fields>, java.io.Serializable, Cloneable   {
6510
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_result");
1982 varun.gupt 6511
 
3430 rajveer 6512
    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 6513
 
3430 rajveer 6514
    private PromotionException pex; // required
1982 varun.gupt 6515
 
6516
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6517
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6518
      PEX((short)1, "pex");
6519
 
6520
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6521
 
6522
      static {
6523
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6524
          byName.put(field.getFieldName(), field);
6525
        }
6526
      }
6527
 
6528
      /**
6529
       * Find the _Fields constant that matches fieldId, or null if its not found.
6530
       */
6531
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6532
        switch(fieldId) {
6533
          case 1: // PEX
6534
            return PEX;
6535
          default:
6536
            return null;
6537
        }
1982 varun.gupt 6538
      }
6539
 
6540
      /**
6541
       * Find the _Fields constant that matches fieldId, throwing an exception
6542
       * if it is not found.
6543
       */
6544
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6545
        _Fields fields = findByThriftId(fieldId);
6546
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6547
        return fields;
6548
      }
6549
 
6550
      /**
6551
       * Find the _Fields constant that matches name, or null if its not found.
6552
       */
6553
      public static _Fields findByName(String name) {
6554
        return byName.get(name);
6555
      }
6556
 
6557
      private final short _thriftId;
6558
      private final String _fieldName;
6559
 
6560
      _Fields(short thriftId, String fieldName) {
6561
        _thriftId = thriftId;
6562
        _fieldName = fieldName;
6563
      }
6564
 
6565
      public short getThriftFieldId() {
6566
        return _thriftId;
6567
      }
6568
 
6569
      public String getFieldName() {
6570
        return _fieldName;
6571
      }
6572
    }
6573
 
6574
    // isset id assignments
6575
 
3430 rajveer 6576
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6577
    static {
3430 rajveer 6578
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6579
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6580
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
6581
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6582
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_result.class, metaDataMap);
1982 varun.gupt 6583
    }
6584
 
6585
    public generateCouponsForPromotion_result() {
6586
    }
6587
 
6588
    public generateCouponsForPromotion_result(
6589
      PromotionException pex)
6590
    {
6591
      this();
6592
      this.pex = pex;
6593
    }
6594
 
6595
    /**
6596
     * Performs a deep copy on <i>other</i>.
6597
     */
6598
    public generateCouponsForPromotion_result(generateCouponsForPromotion_result other) {
6599
      if (other.isSetPex()) {
6600
        this.pex = new PromotionException(other.pex);
6601
      }
6602
    }
6603
 
6604
    public generateCouponsForPromotion_result deepCopy() {
6605
      return new generateCouponsForPromotion_result(this);
6606
    }
6607
 
3430 rajveer 6608
    @Override
6609
    public void clear() {
6610
      this.pex = null;
1982 varun.gupt 6611
    }
6612
 
6613
    public PromotionException getPex() {
6614
      return this.pex;
6615
    }
6616
 
3430 rajveer 6617
    public void setPex(PromotionException pex) {
1982 varun.gupt 6618
      this.pex = pex;
6619
    }
6620
 
6621
    public void unsetPex() {
6622
      this.pex = null;
6623
    }
6624
 
3430 rajveer 6625
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6626
    public boolean isSetPex() {
6627
      return this.pex != null;
6628
    }
6629
 
6630
    public void setPexIsSet(boolean value) {
6631
      if (!value) {
6632
        this.pex = null;
6633
      }
6634
    }
6635
 
6636
    public void setFieldValue(_Fields field, Object value) {
6637
      switch (field) {
6638
      case PEX:
6639
        if (value == null) {
6640
          unsetPex();
6641
        } else {
6642
          setPex((PromotionException)value);
6643
        }
6644
        break;
6645
 
6646
      }
6647
    }
6648
 
6649
    public Object getFieldValue(_Fields field) {
6650
      switch (field) {
6651
      case PEX:
6652
        return getPex();
6653
 
6654
      }
6655
      throw new IllegalStateException();
6656
    }
6657
 
3430 rajveer 6658
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6659
    public boolean isSet(_Fields field) {
6660
      if (field == null) {
6661
        throw new IllegalArgumentException();
6662
      }
1982 varun.gupt 6663
 
6664
      switch (field) {
6665
      case PEX:
6666
        return isSetPex();
6667
      }
6668
      throw new IllegalStateException();
6669
    }
6670
 
6671
    @Override
6672
    public boolean equals(Object that) {
6673
      if (that == null)
6674
        return false;
6675
      if (that instanceof generateCouponsForPromotion_result)
6676
        return this.equals((generateCouponsForPromotion_result)that);
6677
      return false;
6678
    }
6679
 
6680
    public boolean equals(generateCouponsForPromotion_result that) {
6681
      if (that == null)
6682
        return false;
6683
 
6684
      boolean this_present_pex = true && this.isSetPex();
6685
      boolean that_present_pex = true && that.isSetPex();
6686
      if (this_present_pex || that_present_pex) {
6687
        if (!(this_present_pex && that_present_pex))
6688
          return false;
6689
        if (!this.pex.equals(that.pex))
6690
          return false;
6691
      }
6692
 
6693
      return true;
6694
    }
6695
 
6696
    @Override
6697
    public int hashCode() {
6698
      return 0;
6699
    }
6700
 
6701
    public int compareTo(generateCouponsForPromotion_result other) {
6702
      if (!getClass().equals(other.getClass())) {
6703
        return getClass().getName().compareTo(other.getClass().getName());
6704
      }
6705
 
6706
      int lastComparison = 0;
6707
      generateCouponsForPromotion_result typedOther = (generateCouponsForPromotion_result)other;
6708
 
3430 rajveer 6709
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 6710
      if (lastComparison != 0) {
6711
        return lastComparison;
6712
      }
3430 rajveer 6713
      if (isSetPex()) {
6714
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
6715
        if (lastComparison != 0) {
6716
          return lastComparison;
6717
        }
1982 varun.gupt 6718
      }
6719
      return 0;
6720
    }
6721
 
3430 rajveer 6722
    public _Fields fieldForId(int fieldId) {
6723
      return _Fields.findByThriftId(fieldId);
6724
    }
6725
 
6726
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6727
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6728
      iprot.readStructBegin();
6729
      while (true)
6730
      {
6731
        field = iprot.readFieldBegin();
3430 rajveer 6732
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6733
          break;
6734
        }
3430 rajveer 6735
        switch (field.id) {
6736
          case 1: // PEX
6737
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6738
              this.pex = new PromotionException();
6739
              this.pex.read(iprot);
6740
            } else { 
6741
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6742
            }
6743
            break;
6744
          default:
6745
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6746
        }
3430 rajveer 6747
        iprot.readFieldEnd();
1982 varun.gupt 6748
      }
6749
      iprot.readStructEnd();
6750
      validate();
6751
    }
6752
 
3430 rajveer 6753
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6754
      oprot.writeStructBegin(STRUCT_DESC);
6755
 
6756
      if (this.isSetPex()) {
6757
        oprot.writeFieldBegin(PEX_FIELD_DESC);
6758
        this.pex.write(oprot);
6759
        oprot.writeFieldEnd();
6760
      }
6761
      oprot.writeFieldStop();
6762
      oprot.writeStructEnd();
6763
    }
6764
 
6765
    @Override
6766
    public String toString() {
6767
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_result(");
6768
      boolean first = true;
6769
 
6770
      sb.append("pex:");
6771
      if (this.pex == null) {
6772
        sb.append("null");
6773
      } else {
6774
        sb.append(this.pex);
6775
      }
6776
      first = false;
6777
      sb.append(")");
6778
      return sb.toString();
6779
    }
6780
 
3430 rajveer 6781
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6782
      // check for required fields
6783
    }
6784
 
3430 rajveer 6785
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6786
      try {
6787
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6788
      } catch (org.apache.thrift.TException te) {
6789
        throw new java.io.IOException(te);
6790
      }
6791
    }
6792
 
6793
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6794
      try {
6795
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6796
      } catch (org.apache.thrift.TException te) {
6797
        throw new java.io.IOException(te);
6798
      }
6799
    }
6800
 
1982 varun.gupt 6801
  }
6802
 
3430 rajveer 6803
  public static class applyCoupon_args implements org.apache.thrift.TBase<applyCoupon_args, applyCoupon_args._Fields>, java.io.Serializable, Cloneable   {
6804
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_args");
1982 varun.gupt 6805
 
3430 rajveer 6806
    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);
6807
    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 6808
 
3430 rajveer 6809
    private String couponCode; // required
6810
    private long cartId; // required
1982 varun.gupt 6811
 
6812
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6813
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6814
      COUPON_CODE((short)1, "couponCode"),
6815
      CART_ID((short)2, "cartId");
6816
 
6817
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6818
 
6819
      static {
6820
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6821
          byName.put(field.getFieldName(), field);
6822
        }
6823
      }
6824
 
6825
      /**
6826
       * Find the _Fields constant that matches fieldId, or null if its not found.
6827
       */
6828
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6829
        switch(fieldId) {
6830
          case 1: // COUPON_CODE
6831
            return COUPON_CODE;
6832
          case 2: // CART_ID
6833
            return CART_ID;
6834
          default:
6835
            return null;
6836
        }
1982 varun.gupt 6837
      }
6838
 
6839
      /**
6840
       * Find the _Fields constant that matches fieldId, throwing an exception
6841
       * if it is not found.
6842
       */
6843
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6844
        _Fields fields = findByThriftId(fieldId);
6845
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6846
        return fields;
6847
      }
6848
 
6849
      /**
6850
       * Find the _Fields constant that matches name, or null if its not found.
6851
       */
6852
      public static _Fields findByName(String name) {
6853
        return byName.get(name);
6854
      }
6855
 
6856
      private final short _thriftId;
6857
      private final String _fieldName;
6858
 
6859
      _Fields(short thriftId, String fieldName) {
6860
        _thriftId = thriftId;
6861
        _fieldName = fieldName;
6862
      }
6863
 
6864
      public short getThriftFieldId() {
6865
        return _thriftId;
6866
      }
6867
 
6868
      public String getFieldName() {
6869
        return _fieldName;
6870
      }
6871
    }
6872
 
6873
    // isset id assignments
6874
    private static final int __CARTID_ISSET_ID = 0;
6875
    private BitSet __isset_bit_vector = new BitSet(1);
6876
 
3430 rajveer 6877
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6878
    static {
3430 rajveer 6879
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6880
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6881
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6882
      tmpMap.put(_Fields.CART_ID, new org.apache.thrift.meta_data.FieldMetaData("cartId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6883
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6884
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6885
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_args.class, metaDataMap);
1982 varun.gupt 6886
    }
6887
 
6888
    public applyCoupon_args() {
6889
    }
6890
 
6891
    public applyCoupon_args(
6892
      String couponCode,
6893
      long cartId)
6894
    {
6895
      this();
6896
      this.couponCode = couponCode;
6897
      this.cartId = cartId;
6898
      setCartIdIsSet(true);
6899
    }
6900
 
6901
    /**
6902
     * Performs a deep copy on <i>other</i>.
6903
     */
6904
    public applyCoupon_args(applyCoupon_args other) {
6905
      __isset_bit_vector.clear();
6906
      __isset_bit_vector.or(other.__isset_bit_vector);
6907
      if (other.isSetCouponCode()) {
6908
        this.couponCode = other.couponCode;
6909
      }
6910
      this.cartId = other.cartId;
6911
    }
6912
 
6913
    public applyCoupon_args deepCopy() {
6914
      return new applyCoupon_args(this);
6915
    }
6916
 
3430 rajveer 6917
    @Override
6918
    public void clear() {
6919
      this.couponCode = null;
6920
      setCartIdIsSet(false);
6921
      this.cartId = 0;
1982 varun.gupt 6922
    }
6923
 
6924
    public String getCouponCode() {
6925
      return this.couponCode;
6926
    }
6927
 
3430 rajveer 6928
    public void setCouponCode(String couponCode) {
1982 varun.gupt 6929
      this.couponCode = couponCode;
6930
    }
6931
 
6932
    public void unsetCouponCode() {
6933
      this.couponCode = null;
6934
    }
6935
 
3430 rajveer 6936
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6937
    public boolean isSetCouponCode() {
6938
      return this.couponCode != null;
6939
    }
6940
 
6941
    public void setCouponCodeIsSet(boolean value) {
6942
      if (!value) {
6943
        this.couponCode = null;
6944
      }
6945
    }
6946
 
6947
    public long getCartId() {
6948
      return this.cartId;
6949
    }
6950
 
3430 rajveer 6951
    public void setCartId(long cartId) {
1982 varun.gupt 6952
      this.cartId = cartId;
6953
      setCartIdIsSet(true);
6954
    }
6955
 
6956
    public void unsetCartId() {
6957
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
6958
    }
6959
 
3430 rajveer 6960
    /** Returns true if field cartId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6961
    public boolean isSetCartId() {
6962
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
6963
    }
6964
 
6965
    public void setCartIdIsSet(boolean value) {
6966
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
6967
    }
6968
 
6969
    public void setFieldValue(_Fields field, Object value) {
6970
      switch (field) {
6971
      case COUPON_CODE:
6972
        if (value == null) {
6973
          unsetCouponCode();
6974
        } else {
6975
          setCouponCode((String)value);
6976
        }
6977
        break;
6978
 
6979
      case CART_ID:
6980
        if (value == null) {
6981
          unsetCartId();
6982
        } else {
6983
          setCartId((Long)value);
6984
        }
6985
        break;
6986
 
6987
      }
6988
    }
6989
 
6990
    public Object getFieldValue(_Fields field) {
6991
      switch (field) {
6992
      case COUPON_CODE:
6993
        return getCouponCode();
6994
 
6995
      case CART_ID:
3430 rajveer 6996
        return Long.valueOf(getCartId());
1982 varun.gupt 6997
 
6998
      }
6999
      throw new IllegalStateException();
7000
    }
7001
 
3430 rajveer 7002
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7003
    public boolean isSet(_Fields field) {
7004
      if (field == null) {
7005
        throw new IllegalArgumentException();
7006
      }
1982 varun.gupt 7007
 
7008
      switch (field) {
7009
      case COUPON_CODE:
7010
        return isSetCouponCode();
7011
      case CART_ID:
7012
        return isSetCartId();
7013
      }
7014
      throw new IllegalStateException();
7015
    }
7016
 
7017
    @Override
7018
    public boolean equals(Object that) {
7019
      if (that == null)
7020
        return false;
7021
      if (that instanceof applyCoupon_args)
7022
        return this.equals((applyCoupon_args)that);
7023
      return false;
7024
    }
7025
 
7026
    public boolean equals(applyCoupon_args that) {
7027
      if (that == null)
7028
        return false;
7029
 
7030
      boolean this_present_couponCode = true && this.isSetCouponCode();
7031
      boolean that_present_couponCode = true && that.isSetCouponCode();
7032
      if (this_present_couponCode || that_present_couponCode) {
7033
        if (!(this_present_couponCode && that_present_couponCode))
7034
          return false;
7035
        if (!this.couponCode.equals(that.couponCode))
7036
          return false;
7037
      }
7038
 
7039
      boolean this_present_cartId = true;
7040
      boolean that_present_cartId = true;
7041
      if (this_present_cartId || that_present_cartId) {
7042
        if (!(this_present_cartId && that_present_cartId))
7043
          return false;
7044
        if (this.cartId != that.cartId)
7045
          return false;
7046
      }
7047
 
7048
      return true;
7049
    }
7050
 
7051
    @Override
7052
    public int hashCode() {
7053
      return 0;
7054
    }
7055
 
7056
    public int compareTo(applyCoupon_args other) {
7057
      if (!getClass().equals(other.getClass())) {
7058
        return getClass().getName().compareTo(other.getClass().getName());
7059
      }
7060
 
7061
      int lastComparison = 0;
7062
      applyCoupon_args typedOther = (applyCoupon_args)other;
7063
 
3430 rajveer 7064
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 7065
      if (lastComparison != 0) {
7066
        return lastComparison;
7067
      }
3430 rajveer 7068
      if (isSetCouponCode()) {
7069
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
7070
        if (lastComparison != 0) {
7071
          return lastComparison;
7072
        }
1982 varun.gupt 7073
      }
3430 rajveer 7074
      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(typedOther.isSetCartId());
1982 varun.gupt 7075
      if (lastComparison != 0) {
7076
        return lastComparison;
7077
      }
3430 rajveer 7078
      if (isSetCartId()) {
7079
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cartId, typedOther.cartId);
7080
        if (lastComparison != 0) {
7081
          return lastComparison;
7082
        }
1982 varun.gupt 7083
      }
7084
      return 0;
7085
    }
7086
 
3430 rajveer 7087
    public _Fields fieldForId(int fieldId) {
7088
      return _Fields.findByThriftId(fieldId);
7089
    }
7090
 
7091
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7092
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 7093
      iprot.readStructBegin();
7094
      while (true)
7095
      {
7096
        field = iprot.readFieldBegin();
3430 rajveer 7097
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 7098
          break;
7099
        }
3430 rajveer 7100
        switch (field.id) {
7101
          case 1: // COUPON_CODE
7102
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
7103
              this.couponCode = iprot.readString();
7104
            } else { 
7105
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7106
            }
7107
            break;
7108
          case 2: // CART_ID
7109
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7110
              this.cartId = iprot.readI64();
7111
              setCartIdIsSet(true);
7112
            } else { 
7113
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7114
            }
7115
            break;
7116
          default:
7117
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 7118
        }
3430 rajveer 7119
        iprot.readFieldEnd();
1982 varun.gupt 7120
      }
7121
      iprot.readStructEnd();
7122
      validate();
7123
    }
7124
 
3430 rajveer 7125
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 7126
      validate();
7127
 
7128
      oprot.writeStructBegin(STRUCT_DESC);
7129
      if (this.couponCode != null) {
7130
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
7131
        oprot.writeString(this.couponCode);
7132
        oprot.writeFieldEnd();
7133
      }
7134
      oprot.writeFieldBegin(CART_ID_FIELD_DESC);
7135
      oprot.writeI64(this.cartId);
7136
      oprot.writeFieldEnd();
7137
      oprot.writeFieldStop();
7138
      oprot.writeStructEnd();
7139
    }
7140
 
7141
    @Override
7142
    public String toString() {
7143
      StringBuilder sb = new StringBuilder("applyCoupon_args(");
7144
      boolean first = true;
7145
 
7146
      sb.append("couponCode:");
7147
      if (this.couponCode == null) {
7148
        sb.append("null");
7149
      } else {
7150
        sb.append(this.couponCode);
7151
      }
7152
      first = false;
7153
      if (!first) sb.append(", ");
7154
      sb.append("cartId:");
7155
      sb.append(this.cartId);
7156
      first = false;
7157
      sb.append(")");
7158
      return sb.toString();
7159
    }
7160
 
3430 rajveer 7161
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7162
      // check for required fields
7163
    }
7164
 
3430 rajveer 7165
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7166
      try {
7167
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7168
      } catch (org.apache.thrift.TException te) {
7169
        throw new java.io.IOException(te);
7170
      }
7171
    }
7172
 
7173
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7174
      try {
7175
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
7176
        __isset_bit_vector = new BitSet(1);
7177
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7178
      } catch (org.apache.thrift.TException te) {
7179
        throw new java.io.IOException(te);
7180
      }
7181
    }
7182
 
1982 varun.gupt 7183
  }
7184
 
3430 rajveer 7185
  public static class applyCoupon_result implements org.apache.thrift.TBase<applyCoupon_result, applyCoupon_result._Fields>, java.io.Serializable, Cloneable   {
7186
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_result");
1982 varun.gupt 7187
 
3430 rajveer 7188
    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);
7189
    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 7190
 
3430 rajveer 7191
    private Cart success; // required
7192
    private PromotionException pex; // required
1982 varun.gupt 7193
 
7194
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7195
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 7196
      SUCCESS((short)0, "success"),
7197
      PEX((short)1, "pex");
7198
 
7199
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7200
 
7201
      static {
7202
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7203
          byName.put(field.getFieldName(), field);
7204
        }
7205
      }
7206
 
7207
      /**
7208
       * Find the _Fields constant that matches fieldId, or null if its not found.
7209
       */
7210
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7211
        switch(fieldId) {
7212
          case 0: // SUCCESS
7213
            return SUCCESS;
7214
          case 1: // PEX
7215
            return PEX;
7216
          default:
7217
            return null;
7218
        }
1982 varun.gupt 7219
      }
7220
 
7221
      /**
7222
       * Find the _Fields constant that matches fieldId, throwing an exception
7223
       * if it is not found.
7224
       */
7225
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7226
        _Fields fields = findByThriftId(fieldId);
7227
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7228
        return fields;
7229
      }
7230
 
7231
      /**
7232
       * Find the _Fields constant that matches name, or null if its not found.
7233
       */
7234
      public static _Fields findByName(String name) {
7235
        return byName.get(name);
7236
      }
7237
 
7238
      private final short _thriftId;
7239
      private final String _fieldName;
7240
 
7241
      _Fields(short thriftId, String fieldName) {
7242
        _thriftId = thriftId;
7243
        _fieldName = fieldName;
7244
      }
7245
 
7246
      public short getThriftFieldId() {
7247
        return _thriftId;
7248
      }
7249
 
7250
      public String getFieldName() {
7251
        return _fieldName;
7252
      }
7253
    }
7254
 
7255
    // isset id assignments
7256
 
3430 rajveer 7257
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 7258
    static {
3430 rajveer 7259
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7260
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7261
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Cart.class)));
7262
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7263
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
7264
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7265
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_result.class, metaDataMap);
1982 varun.gupt 7266
    }
7267
 
7268
    public applyCoupon_result() {
7269
    }
7270
 
7271
    public applyCoupon_result(
7272
      Cart success,
7273
      PromotionException pex)
7274
    {
7275
      this();
7276
      this.success = success;
7277
      this.pex = pex;
7278
    }
7279
 
7280
    /**
7281
     * Performs a deep copy on <i>other</i>.
7282
     */
7283
    public applyCoupon_result(applyCoupon_result other) {
7284
      if (other.isSetSuccess()) {
7285
        this.success = new Cart(other.success);
7286
      }
7287
      if (other.isSetPex()) {
7288
        this.pex = new PromotionException(other.pex);
7289
      }
7290
    }
7291
 
7292
    public applyCoupon_result deepCopy() {
7293
      return new applyCoupon_result(this);
7294
    }
7295
 
3430 rajveer 7296
    @Override
7297
    public void clear() {
7298
      this.success = null;
7299
      this.pex = null;
1982 varun.gupt 7300
    }
7301
 
7302
    public Cart getSuccess() {
7303
      return this.success;
7304
    }
7305
 
3430 rajveer 7306
    public void setSuccess(Cart success) {
1982 varun.gupt 7307
      this.success = success;
7308
    }
7309
 
7310
    public void unsetSuccess() {
7311
      this.success = null;
7312
    }
7313
 
3430 rajveer 7314
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7315
    public boolean isSetSuccess() {
7316
      return this.success != null;
7317
    }
7318
 
7319
    public void setSuccessIsSet(boolean value) {
7320
      if (!value) {
7321
        this.success = null;
7322
      }
7323
    }
7324
 
7325
    public PromotionException getPex() {
7326
      return this.pex;
7327
    }
7328
 
3430 rajveer 7329
    public void setPex(PromotionException pex) {
1982 varun.gupt 7330
      this.pex = pex;
7331
    }
7332
 
7333
    public void unsetPex() {
7334
      this.pex = null;
7335
    }
7336
 
3430 rajveer 7337
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7338
    public boolean isSetPex() {
7339
      return this.pex != null;
7340
    }
7341
 
7342
    public void setPexIsSet(boolean value) {
7343
      if (!value) {
7344
        this.pex = null;
7345
      }
7346
    }
7347
 
7348
    public void setFieldValue(_Fields field, Object value) {
7349
      switch (field) {
7350
      case SUCCESS:
7351
        if (value == null) {
7352
          unsetSuccess();
7353
        } else {
7354
          setSuccess((Cart)value);
7355
        }
7356
        break;
7357
 
7358
      case PEX:
7359
        if (value == null) {
7360
          unsetPex();
7361
        } else {
7362
          setPex((PromotionException)value);
7363
        }
7364
        break;
7365
 
7366
      }
7367
    }
7368
 
7369
    public Object getFieldValue(_Fields field) {
7370
      switch (field) {
7371
      case SUCCESS:
7372
        return getSuccess();
7373
 
7374
      case PEX:
7375
        return getPex();
7376
 
7377
      }
7378
      throw new IllegalStateException();
7379
    }
7380
 
3430 rajveer 7381
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7382
    public boolean isSet(_Fields field) {
7383
      if (field == null) {
7384
        throw new IllegalArgumentException();
7385
      }
1982 varun.gupt 7386
 
7387
      switch (field) {
7388
      case SUCCESS:
7389
        return isSetSuccess();
7390
      case PEX:
7391
        return isSetPex();
7392
      }
7393
      throw new IllegalStateException();
7394
    }
7395
 
7396
    @Override
7397
    public boolean equals(Object that) {
7398
      if (that == null)
7399
        return false;
7400
      if (that instanceof applyCoupon_result)
7401
        return this.equals((applyCoupon_result)that);
7402
      return false;
7403
    }
7404
 
7405
    public boolean equals(applyCoupon_result that) {
7406
      if (that == null)
7407
        return false;
7408
 
7409
      boolean this_present_success = true && this.isSetSuccess();
7410
      boolean that_present_success = true && that.isSetSuccess();
7411
      if (this_present_success || that_present_success) {
7412
        if (!(this_present_success && that_present_success))
7413
          return false;
7414
        if (!this.success.equals(that.success))
7415
          return false;
7416
      }
7417
 
7418
      boolean this_present_pex = true && this.isSetPex();
7419
      boolean that_present_pex = true && that.isSetPex();
7420
      if (this_present_pex || that_present_pex) {
7421
        if (!(this_present_pex && that_present_pex))
7422
          return false;
7423
        if (!this.pex.equals(that.pex))
7424
          return false;
7425
      }
7426
 
7427
      return true;
7428
    }
7429
 
7430
    @Override
7431
    public int hashCode() {
7432
      return 0;
7433
    }
7434
 
7435
    public int compareTo(applyCoupon_result other) {
7436
      if (!getClass().equals(other.getClass())) {
7437
        return getClass().getName().compareTo(other.getClass().getName());
7438
      }
7439
 
7440
      int lastComparison = 0;
7441
      applyCoupon_result typedOther = (applyCoupon_result)other;
7442
 
3430 rajveer 7443
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 7444
      if (lastComparison != 0) {
7445
        return lastComparison;
7446
      }
3430 rajveer 7447
      if (isSetSuccess()) {
7448
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
7449
        if (lastComparison != 0) {
7450
          return lastComparison;
7451
        }
1982 varun.gupt 7452
      }
3430 rajveer 7453
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 7454
      if (lastComparison != 0) {
7455
        return lastComparison;
7456
      }
3430 rajveer 7457
      if (isSetPex()) {
7458
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
7459
        if (lastComparison != 0) {
7460
          return lastComparison;
7461
        }
1982 varun.gupt 7462
      }
7463
      return 0;
7464
    }
7465
 
3430 rajveer 7466
    public _Fields fieldForId(int fieldId) {
7467
      return _Fields.findByThriftId(fieldId);
7468
    }
7469
 
7470
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7471
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 7472
      iprot.readStructBegin();
7473
      while (true)
7474
      {
7475
        field = iprot.readFieldBegin();
3430 rajveer 7476
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 7477
          break;
7478
        }
3430 rajveer 7479
        switch (field.id) {
7480
          case 0: // SUCCESS
7481
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
7482
              this.success = new Cart();
7483
              this.success.read(iprot);
7484
            } else { 
7485
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7486
            }
7487
            break;
7488
          case 1: // PEX
7489
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
7490
              this.pex = new PromotionException();
7491
              this.pex.read(iprot);
7492
            } else { 
7493
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7494
            }
7495
            break;
7496
          default:
7497
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 7498
        }
3430 rajveer 7499
        iprot.readFieldEnd();
1982 varun.gupt 7500
      }
7501
      iprot.readStructEnd();
7502
      validate();
7503
    }
7504
 
3430 rajveer 7505
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 7506
      oprot.writeStructBegin(STRUCT_DESC);
7507
 
7508
      if (this.isSetSuccess()) {
7509
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
7510
        this.success.write(oprot);
7511
        oprot.writeFieldEnd();
7512
      } else if (this.isSetPex()) {
7513
        oprot.writeFieldBegin(PEX_FIELD_DESC);
7514
        this.pex.write(oprot);
7515
        oprot.writeFieldEnd();
7516
      }
7517
      oprot.writeFieldStop();
7518
      oprot.writeStructEnd();
7519
    }
7520
 
7521
    @Override
7522
    public String toString() {
7523
      StringBuilder sb = new StringBuilder("applyCoupon_result(");
7524
      boolean first = true;
7525
 
7526
      sb.append("success:");
7527
      if (this.success == null) {
7528
        sb.append("null");
7529
      } else {
7530
        sb.append(this.success);
7531
      }
7532
      first = false;
7533
      if (!first) sb.append(", ");
7534
      sb.append("pex:");
7535
      if (this.pex == null) {
7536
        sb.append("null");
7537
      } else {
7538
        sb.append(this.pex);
7539
      }
7540
      first = false;
7541
      sb.append(")");
7542
      return sb.toString();
7543
    }
7544
 
3430 rajveer 7545
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7546
      // check for required fields
7547
    }
7548
 
3430 rajveer 7549
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7550
      try {
7551
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7552
      } catch (org.apache.thrift.TException te) {
7553
        throw new java.io.IOException(te);
7554
      }
7555
    }
7556
 
7557
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7558
      try {
7559
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7560
      } catch (org.apache.thrift.TException te) {
7561
        throw new java.io.IOException(te);
7562
      }
7563
    }
7564
 
1982 varun.gupt 7565
  }
7566
 
6433 anupam.sin 7567
  public static class applyRechargeCoupon_args implements org.apache.thrift.TBase<applyRechargeCoupon_args, applyRechargeCoupon_args._Fields>, java.io.Serializable, Cloneable   {
7568
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyRechargeCoupon_args");
7569
 
7570
    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);
7571
    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);
7572
    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);
7573
 
7574
    private String couponCode; // required
7575
    private long totalAmount; // required
7576
    private long userId; // required
7577
 
7578
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
7579
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
7580
      COUPON_CODE((short)1, "couponCode"),
7581
      TOTAL_AMOUNT((short)2, "totalAmount"),
7582
      USER_ID((short)3, "userId");
7583
 
7584
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7585
 
7586
      static {
7587
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7588
          byName.put(field.getFieldName(), field);
7589
        }
7590
      }
7591
 
7592
      /**
7593
       * Find the _Fields constant that matches fieldId, or null if its not found.
7594
       */
7595
      public static _Fields findByThriftId(int fieldId) {
7596
        switch(fieldId) {
7597
          case 1: // COUPON_CODE
7598
            return COUPON_CODE;
7599
          case 2: // TOTAL_AMOUNT
7600
            return TOTAL_AMOUNT;
7601
          case 3: // USER_ID
7602
            return USER_ID;
7603
          default:
7604
            return null;
7605
        }
7606
      }
7607
 
7608
      /**
7609
       * Find the _Fields constant that matches fieldId, throwing an exception
7610
       * if it is not found.
7611
       */
7612
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7613
        _Fields fields = findByThriftId(fieldId);
7614
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7615
        return fields;
7616
      }
7617
 
7618
      /**
7619
       * Find the _Fields constant that matches name, or null if its not found.
7620
       */
7621
      public static _Fields findByName(String name) {
7622
        return byName.get(name);
7623
      }
7624
 
7625
      private final short _thriftId;
7626
      private final String _fieldName;
7627
 
7628
      _Fields(short thriftId, String fieldName) {
7629
        _thriftId = thriftId;
7630
        _fieldName = fieldName;
7631
      }
7632
 
7633
      public short getThriftFieldId() {
7634
        return _thriftId;
7635
      }
7636
 
7637
      public String getFieldName() {
7638
        return _fieldName;
7639
      }
7640
    }
7641
 
7642
    // isset id assignments
7643
    private static final int __TOTALAMOUNT_ISSET_ID = 0;
7644
    private static final int __USERID_ISSET_ID = 1;
7645
    private BitSet __isset_bit_vector = new BitSet(2);
7646
 
7647
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
7648
    static {
7649
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7650
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7651
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
7652
      tmpMap.put(_Fields.TOTAL_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("totalAmount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7653
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7654
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7655
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7656
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7657
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyRechargeCoupon_args.class, metaDataMap);
7658
    }
7659
 
7660
    public applyRechargeCoupon_args() {
7661
    }
7662
 
7663
    public applyRechargeCoupon_args(
7664
      String couponCode,
7665
      long totalAmount,
7666
      long userId)
7667
    {
7668
      this();
7669
      this.couponCode = couponCode;
7670
      this.totalAmount = totalAmount;
7671
      setTotalAmountIsSet(true);
7672
      this.userId = userId;
7673
      setUserIdIsSet(true);
7674
    }
7675
 
7676
    /**
7677
     * Performs a deep copy on <i>other</i>.
7678
     */
7679
    public applyRechargeCoupon_args(applyRechargeCoupon_args other) {
7680
      __isset_bit_vector.clear();
7681
      __isset_bit_vector.or(other.__isset_bit_vector);
7682
      if (other.isSetCouponCode()) {
7683
        this.couponCode = other.couponCode;
7684
      }
7685
      this.totalAmount = other.totalAmount;
7686
      this.userId = other.userId;
7687
    }
7688
 
7689
    public applyRechargeCoupon_args deepCopy() {
7690
      return new applyRechargeCoupon_args(this);
7691
    }
7692
 
7693
    @Override
7694
    public void clear() {
7695
      this.couponCode = null;
7696
      setTotalAmountIsSet(false);
7697
      this.totalAmount = 0;
7698
      setUserIdIsSet(false);
7699
      this.userId = 0;
7700
    }
7701
 
7702
    public String getCouponCode() {
7703
      return this.couponCode;
7704
    }
7705
 
7706
    public void setCouponCode(String couponCode) {
7707
      this.couponCode = couponCode;
7708
    }
7709
 
7710
    public void unsetCouponCode() {
7711
      this.couponCode = null;
7712
    }
7713
 
7714
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
7715
    public boolean isSetCouponCode() {
7716
      return this.couponCode != null;
7717
    }
7718
 
7719
    public void setCouponCodeIsSet(boolean value) {
7720
      if (!value) {
7721
        this.couponCode = null;
7722
      }
7723
    }
7724
 
7725
    public long getTotalAmount() {
7726
      return this.totalAmount;
7727
    }
7728
 
7729
    public void setTotalAmount(long totalAmount) {
7730
      this.totalAmount = totalAmount;
7731
      setTotalAmountIsSet(true);
7732
    }
7733
 
7734
    public void unsetTotalAmount() {
7735
      __isset_bit_vector.clear(__TOTALAMOUNT_ISSET_ID);
7736
    }
7737
 
7738
    /** Returns true if field totalAmount is set (has been assigned a value) and false otherwise */
7739
    public boolean isSetTotalAmount() {
7740
      return __isset_bit_vector.get(__TOTALAMOUNT_ISSET_ID);
7741
    }
7742
 
7743
    public void setTotalAmountIsSet(boolean value) {
7744
      __isset_bit_vector.set(__TOTALAMOUNT_ISSET_ID, value);
7745
    }
7746
 
7747
    public long getUserId() {
7748
      return this.userId;
7749
    }
7750
 
7751
    public void setUserId(long userId) {
7752
      this.userId = userId;
7753
      setUserIdIsSet(true);
7754
    }
7755
 
7756
    public void unsetUserId() {
7757
      __isset_bit_vector.clear(__USERID_ISSET_ID);
7758
    }
7759
 
7760
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
7761
    public boolean isSetUserId() {
7762
      return __isset_bit_vector.get(__USERID_ISSET_ID);
7763
    }
7764
 
7765
    public void setUserIdIsSet(boolean value) {
7766
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
7767
    }
7768
 
7769
    public void setFieldValue(_Fields field, Object value) {
7770
      switch (field) {
7771
      case COUPON_CODE:
7772
        if (value == null) {
7773
          unsetCouponCode();
7774
        } else {
7775
          setCouponCode((String)value);
7776
        }
7777
        break;
7778
 
7779
      case TOTAL_AMOUNT:
7780
        if (value == null) {
7781
          unsetTotalAmount();
7782
        } else {
7783
          setTotalAmount((Long)value);
7784
        }
7785
        break;
7786
 
7787
      case USER_ID:
7788
        if (value == null) {
7789
          unsetUserId();
7790
        } else {
7791
          setUserId((Long)value);
7792
        }
7793
        break;
7794
 
7795
      }
7796
    }
7797
 
7798
    public Object getFieldValue(_Fields field) {
7799
      switch (field) {
7800
      case COUPON_CODE:
7801
        return getCouponCode();
7802
 
7803
      case TOTAL_AMOUNT:
7804
        return Long.valueOf(getTotalAmount());
7805
 
7806
      case USER_ID:
7807
        return Long.valueOf(getUserId());
7808
 
7809
      }
7810
      throw new IllegalStateException();
7811
    }
7812
 
7813
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7814
    public boolean isSet(_Fields field) {
7815
      if (field == null) {
7816
        throw new IllegalArgumentException();
7817
      }
7818
 
7819
      switch (field) {
7820
      case COUPON_CODE:
7821
        return isSetCouponCode();
7822
      case TOTAL_AMOUNT:
7823
        return isSetTotalAmount();
7824
      case USER_ID:
7825
        return isSetUserId();
7826
      }
7827
      throw new IllegalStateException();
7828
    }
7829
 
7830
    @Override
7831
    public boolean equals(Object that) {
7832
      if (that == null)
7833
        return false;
7834
      if (that instanceof applyRechargeCoupon_args)
7835
        return this.equals((applyRechargeCoupon_args)that);
7836
      return false;
7837
    }
7838
 
7839
    public boolean equals(applyRechargeCoupon_args that) {
7840
      if (that == null)
7841
        return false;
7842
 
7843
      boolean this_present_couponCode = true && this.isSetCouponCode();
7844
      boolean that_present_couponCode = true && that.isSetCouponCode();
7845
      if (this_present_couponCode || that_present_couponCode) {
7846
        if (!(this_present_couponCode && that_present_couponCode))
7847
          return false;
7848
        if (!this.couponCode.equals(that.couponCode))
7849
          return false;
7850
      }
7851
 
7852
      boolean this_present_totalAmount = true;
7853
      boolean that_present_totalAmount = true;
7854
      if (this_present_totalAmount || that_present_totalAmount) {
7855
        if (!(this_present_totalAmount && that_present_totalAmount))
7856
          return false;
7857
        if (this.totalAmount != that.totalAmount)
7858
          return false;
7859
      }
7860
 
7861
      boolean this_present_userId = true;
7862
      boolean that_present_userId = true;
7863
      if (this_present_userId || that_present_userId) {
7864
        if (!(this_present_userId && that_present_userId))
7865
          return false;
7866
        if (this.userId != that.userId)
7867
          return false;
7868
      }
7869
 
7870
      return true;
7871
    }
7872
 
7873
    @Override
7874
    public int hashCode() {
7875
      return 0;
7876
    }
7877
 
7878
    public int compareTo(applyRechargeCoupon_args other) {
7879
      if (!getClass().equals(other.getClass())) {
7880
        return getClass().getName().compareTo(other.getClass().getName());
7881
      }
7882
 
7883
      int lastComparison = 0;
7884
      applyRechargeCoupon_args typedOther = (applyRechargeCoupon_args)other;
7885
 
7886
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
7887
      if (lastComparison != 0) {
7888
        return lastComparison;
7889
      }
7890
      if (isSetCouponCode()) {
7891
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
7892
        if (lastComparison != 0) {
7893
          return lastComparison;
7894
        }
7895
      }
7896
      lastComparison = Boolean.valueOf(isSetTotalAmount()).compareTo(typedOther.isSetTotalAmount());
7897
      if (lastComparison != 0) {
7898
        return lastComparison;
7899
      }
7900
      if (isSetTotalAmount()) {
7901
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.totalAmount, typedOther.totalAmount);
7902
        if (lastComparison != 0) {
7903
          return lastComparison;
7904
        }
7905
      }
7906
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
7907
      if (lastComparison != 0) {
7908
        return lastComparison;
7909
      }
7910
      if (isSetUserId()) {
7911
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
7912
        if (lastComparison != 0) {
7913
          return lastComparison;
7914
        }
7915
      }
7916
      return 0;
7917
    }
7918
 
7919
    public _Fields fieldForId(int fieldId) {
7920
      return _Fields.findByThriftId(fieldId);
7921
    }
7922
 
7923
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7924
      org.apache.thrift.protocol.TField field;
7925
      iprot.readStructBegin();
7926
      while (true)
7927
      {
7928
        field = iprot.readFieldBegin();
7929
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
7930
          break;
7931
        }
7932
        switch (field.id) {
7933
          case 1: // COUPON_CODE
7934
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
7935
              this.couponCode = iprot.readString();
7936
            } else { 
7937
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7938
            }
7939
            break;
7940
          case 2: // TOTAL_AMOUNT
7941
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7942
              this.totalAmount = iprot.readI64();
7943
              setTotalAmountIsSet(true);
7944
            } else { 
7945
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7946
            }
7947
            break;
7948
          case 3: // USER_ID
7949
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7950
              this.userId = iprot.readI64();
7951
              setUserIdIsSet(true);
7952
            } else { 
7953
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7954
            }
7955
            break;
7956
          default:
7957
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7958
        }
7959
        iprot.readFieldEnd();
7960
      }
7961
      iprot.readStructEnd();
7962
      validate();
7963
    }
7964
 
7965
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
7966
      validate();
7967
 
7968
      oprot.writeStructBegin(STRUCT_DESC);
7969
      if (this.couponCode != null) {
7970
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
7971
        oprot.writeString(this.couponCode);
7972
        oprot.writeFieldEnd();
7973
      }
7974
      oprot.writeFieldBegin(TOTAL_AMOUNT_FIELD_DESC);
7975
      oprot.writeI64(this.totalAmount);
7976
      oprot.writeFieldEnd();
7977
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
7978
      oprot.writeI64(this.userId);
7979
      oprot.writeFieldEnd();
7980
      oprot.writeFieldStop();
7981
      oprot.writeStructEnd();
7982
    }
7983
 
7984
    @Override
7985
    public String toString() {
7986
      StringBuilder sb = new StringBuilder("applyRechargeCoupon_args(");
7987
      boolean first = true;
7988
 
7989
      sb.append("couponCode:");
7990
      if (this.couponCode == null) {
7991
        sb.append("null");
7992
      } else {
7993
        sb.append(this.couponCode);
7994
      }
7995
      first = false;
7996
      if (!first) sb.append(", ");
7997
      sb.append("totalAmount:");
7998
      sb.append(this.totalAmount);
7999
      first = false;
8000
      if (!first) sb.append(", ");
8001
      sb.append("userId:");
8002
      sb.append(this.userId);
8003
      first = false;
8004
      sb.append(")");
8005
      return sb.toString();
8006
    }
8007
 
8008
    public void validate() throws org.apache.thrift.TException {
8009
      // check for required fields
8010
    }
8011
 
8012
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8013
      try {
8014
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8015
      } catch (org.apache.thrift.TException te) {
8016
        throw new java.io.IOException(te);
8017
      }
8018
    }
8019
 
8020
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8021
      try {
8022
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
8023
        __isset_bit_vector = new BitSet(1);
8024
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8025
      } catch (org.apache.thrift.TException te) {
8026
        throw new java.io.IOException(te);
8027
      }
8028
    }
8029
 
8030
  }
8031
 
8032
  public static class applyRechargeCoupon_result implements org.apache.thrift.TBase<applyRechargeCoupon_result, applyRechargeCoupon_result._Fields>, java.io.Serializable, Cloneable   {
8033
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyRechargeCoupon_result");
8034
 
8035
    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);
8036
    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);
8037
 
8038
    private Map<Long,String> success; // required
8039
    private PromotionException pex; // required
8040
 
8041
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8042
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
8043
      SUCCESS((short)0, "success"),
8044
      PEX((short)1, "pex");
8045
 
8046
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8047
 
8048
      static {
8049
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8050
          byName.put(field.getFieldName(), field);
8051
        }
8052
      }
8053
 
8054
      /**
8055
       * Find the _Fields constant that matches fieldId, or null if its not found.
8056
       */
8057
      public static _Fields findByThriftId(int fieldId) {
8058
        switch(fieldId) {
8059
          case 0: // SUCCESS
8060
            return SUCCESS;
8061
          case 1: // PEX
8062
            return PEX;
8063
          default:
8064
            return null;
8065
        }
8066
      }
8067
 
8068
      /**
8069
       * Find the _Fields constant that matches fieldId, throwing an exception
8070
       * if it is not found.
8071
       */
8072
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8073
        _Fields fields = findByThriftId(fieldId);
8074
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8075
        return fields;
8076
      }
8077
 
8078
      /**
8079
       * Find the _Fields constant that matches name, or null if its not found.
8080
       */
8081
      public static _Fields findByName(String name) {
8082
        return byName.get(name);
8083
      }
8084
 
8085
      private final short _thriftId;
8086
      private final String _fieldName;
8087
 
8088
      _Fields(short thriftId, String fieldName) {
8089
        _thriftId = thriftId;
8090
        _fieldName = fieldName;
8091
      }
8092
 
8093
      public short getThriftFieldId() {
8094
        return _thriftId;
8095
      }
8096
 
8097
      public String getFieldName() {
8098
        return _fieldName;
8099
      }
8100
    }
8101
 
8102
    // isset id assignments
8103
 
8104
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
8105
    static {
8106
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8107
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8108
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
8109
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), 
8110
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
8111
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8112
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
8113
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8114
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyRechargeCoupon_result.class, metaDataMap);
8115
    }
8116
 
8117
    public applyRechargeCoupon_result() {
8118
    }
8119
 
8120
    public applyRechargeCoupon_result(
8121
      Map<Long,String> success,
8122
      PromotionException pex)
8123
    {
8124
      this();
8125
      this.success = success;
8126
      this.pex = pex;
8127
    }
8128
 
8129
    /**
8130
     * Performs a deep copy on <i>other</i>.
8131
     */
8132
    public applyRechargeCoupon_result(applyRechargeCoupon_result other) {
8133
      if (other.isSetSuccess()) {
8134
        Map<Long,String> __this__success = new HashMap<Long,String>();
8135
        for (Map.Entry<Long, String> other_element : other.success.entrySet()) {
8136
 
8137
          Long other_element_key = other_element.getKey();
8138
          String other_element_value = other_element.getValue();
8139
 
8140
          Long __this__success_copy_key = other_element_key;
8141
 
8142
          String __this__success_copy_value = other_element_value;
8143
 
8144
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
8145
        }
8146
        this.success = __this__success;
8147
      }
8148
      if (other.isSetPex()) {
8149
        this.pex = new PromotionException(other.pex);
8150
      }
8151
    }
8152
 
8153
    public applyRechargeCoupon_result deepCopy() {
8154
      return new applyRechargeCoupon_result(this);
8155
    }
8156
 
8157
    @Override
8158
    public void clear() {
8159
      this.success = null;
8160
      this.pex = null;
8161
    }
8162
 
8163
    public int getSuccessSize() {
8164
      return (this.success == null) ? 0 : this.success.size();
8165
    }
8166
 
8167
    public void putToSuccess(long key, String val) {
8168
      if (this.success == null) {
8169
        this.success = new HashMap<Long,String>();
8170
      }
8171
      this.success.put(key, val);
8172
    }
8173
 
8174
    public Map<Long,String> getSuccess() {
8175
      return this.success;
8176
    }
8177
 
8178
    public void setSuccess(Map<Long,String> success) {
8179
      this.success = success;
8180
    }
8181
 
8182
    public void unsetSuccess() {
8183
      this.success = null;
8184
    }
8185
 
8186
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
8187
    public boolean isSetSuccess() {
8188
      return this.success != null;
8189
    }
8190
 
8191
    public void setSuccessIsSet(boolean value) {
8192
      if (!value) {
8193
        this.success = null;
8194
      }
8195
    }
8196
 
8197
    public PromotionException getPex() {
8198
      return this.pex;
8199
    }
8200
 
8201
    public void setPex(PromotionException pex) {
8202
      this.pex = pex;
8203
    }
8204
 
8205
    public void unsetPex() {
8206
      this.pex = null;
8207
    }
8208
 
8209
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
8210
    public boolean isSetPex() {
8211
      return this.pex != null;
8212
    }
8213
 
8214
    public void setPexIsSet(boolean value) {
8215
      if (!value) {
8216
        this.pex = null;
8217
      }
8218
    }
8219
 
8220
    public void setFieldValue(_Fields field, Object value) {
8221
      switch (field) {
8222
      case SUCCESS:
8223
        if (value == null) {
8224
          unsetSuccess();
8225
        } else {
8226
          setSuccess((Map<Long,String>)value);
8227
        }
8228
        break;
8229
 
8230
      case PEX:
8231
        if (value == null) {
8232
          unsetPex();
8233
        } else {
8234
          setPex((PromotionException)value);
8235
        }
8236
        break;
8237
 
8238
      }
8239
    }
8240
 
8241
    public Object getFieldValue(_Fields field) {
8242
      switch (field) {
8243
      case SUCCESS:
8244
        return getSuccess();
8245
 
8246
      case PEX:
8247
        return getPex();
8248
 
8249
      }
8250
      throw new IllegalStateException();
8251
    }
8252
 
8253
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8254
    public boolean isSet(_Fields field) {
8255
      if (field == null) {
8256
        throw new IllegalArgumentException();
8257
      }
8258
 
8259
      switch (field) {
8260
      case SUCCESS:
8261
        return isSetSuccess();
8262
      case PEX:
8263
        return isSetPex();
8264
      }
8265
      throw new IllegalStateException();
8266
    }
8267
 
8268
    @Override
8269
    public boolean equals(Object that) {
8270
      if (that == null)
8271
        return false;
8272
      if (that instanceof applyRechargeCoupon_result)
8273
        return this.equals((applyRechargeCoupon_result)that);
8274
      return false;
8275
    }
8276
 
8277
    public boolean equals(applyRechargeCoupon_result that) {
8278
      if (that == null)
8279
        return false;
8280
 
8281
      boolean this_present_success = true && this.isSetSuccess();
8282
      boolean that_present_success = true && that.isSetSuccess();
8283
      if (this_present_success || that_present_success) {
8284
        if (!(this_present_success && that_present_success))
8285
          return false;
8286
        if (!this.success.equals(that.success))
8287
          return false;
8288
      }
8289
 
8290
      boolean this_present_pex = true && this.isSetPex();
8291
      boolean that_present_pex = true && that.isSetPex();
8292
      if (this_present_pex || that_present_pex) {
8293
        if (!(this_present_pex && that_present_pex))
8294
          return false;
8295
        if (!this.pex.equals(that.pex))
8296
          return false;
8297
      }
8298
 
8299
      return true;
8300
    }
8301
 
8302
    @Override
8303
    public int hashCode() {
8304
      return 0;
8305
    }
8306
 
8307
    public int compareTo(applyRechargeCoupon_result other) {
8308
      if (!getClass().equals(other.getClass())) {
8309
        return getClass().getName().compareTo(other.getClass().getName());
8310
      }
8311
 
8312
      int lastComparison = 0;
8313
      applyRechargeCoupon_result typedOther = (applyRechargeCoupon_result)other;
8314
 
8315
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
8316
      if (lastComparison != 0) {
8317
        return lastComparison;
8318
      }
8319
      if (isSetSuccess()) {
8320
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
8321
        if (lastComparison != 0) {
8322
          return lastComparison;
8323
        }
8324
      }
8325
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
8326
      if (lastComparison != 0) {
8327
        return lastComparison;
8328
      }
8329
      if (isSetPex()) {
8330
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
8331
        if (lastComparison != 0) {
8332
          return lastComparison;
8333
        }
8334
      }
8335
      return 0;
8336
    }
8337
 
8338
    public _Fields fieldForId(int fieldId) {
8339
      return _Fields.findByThriftId(fieldId);
8340
    }
8341
 
8342
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8343
      org.apache.thrift.protocol.TField field;
8344
      iprot.readStructBegin();
8345
      while (true)
8346
      {
8347
        field = iprot.readFieldBegin();
8348
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
8349
          break;
8350
        }
8351
        switch (field.id) {
8352
          case 0: // SUCCESS
8353
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
8354
              {
8355
                org.apache.thrift.protocol.TMap _map16 = iprot.readMapBegin();
8356
                this.success = new HashMap<Long,String>(2*_map16.size);
8357
                for (int _i17 = 0; _i17 < _map16.size; ++_i17)
8358
                {
8359
                  long _key18; // required
8360
                  String _val19; // required
8361
                  _key18 = iprot.readI64();
8362
                  _val19 = iprot.readString();
8363
                  this.success.put(_key18, _val19);
8364
                }
8365
                iprot.readMapEnd();
8366
              }
8367
            } else { 
8368
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8369
            }
8370
            break;
8371
          case 1: // PEX
8372
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
8373
              this.pex = new PromotionException();
8374
              this.pex.read(iprot);
8375
            } else { 
8376
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8377
            }
8378
            break;
8379
          default:
8380
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8381
        }
8382
        iprot.readFieldEnd();
8383
      }
8384
      iprot.readStructEnd();
8385
      validate();
8386
    }
8387
 
8388
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
8389
      oprot.writeStructBegin(STRUCT_DESC);
8390
 
8391
      if (this.isSetSuccess()) {
8392
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
8393
        {
8394
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.STRING, this.success.size()));
8395
          for (Map.Entry<Long, String> _iter20 : this.success.entrySet())
8396
          {
8397
            oprot.writeI64(_iter20.getKey());
8398
            oprot.writeString(_iter20.getValue());
8399
          }
8400
          oprot.writeMapEnd();
8401
        }
8402
        oprot.writeFieldEnd();
8403
      } else if (this.isSetPex()) {
8404
        oprot.writeFieldBegin(PEX_FIELD_DESC);
8405
        this.pex.write(oprot);
8406
        oprot.writeFieldEnd();
8407
      }
8408
      oprot.writeFieldStop();
8409
      oprot.writeStructEnd();
8410
    }
8411
 
8412
    @Override
8413
    public String toString() {
8414
      StringBuilder sb = new StringBuilder("applyRechargeCoupon_result(");
8415
      boolean first = true;
8416
 
8417
      sb.append("success:");
8418
      if (this.success == null) {
8419
        sb.append("null");
8420
      } else {
8421
        sb.append(this.success);
8422
      }
8423
      first = false;
8424
      if (!first) sb.append(", ");
8425
      sb.append("pex:");
8426
      if (this.pex == null) {
8427
        sb.append("null");
8428
      } else {
8429
        sb.append(this.pex);
8430
      }
8431
      first = false;
8432
      sb.append(")");
8433
      return sb.toString();
8434
    }
8435
 
8436
    public void validate() throws org.apache.thrift.TException {
8437
      // check for required fields
8438
    }
8439
 
8440
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8441
      try {
8442
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8443
      } catch (org.apache.thrift.TException te) {
8444
        throw new java.io.IOException(te);
8445
      }
8446
    }
8447
 
8448
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8449
      try {
8450
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8451
      } catch (org.apache.thrift.TException te) {
8452
        throw new java.io.IOException(te);
8453
      }
8454
    }
8455
 
8456
  }
8457
 
3430 rajveer 8458
  public static class trackCouponUsage_args implements org.apache.thrift.TBase<trackCouponUsage_args, trackCouponUsage_args._Fields>, java.io.Serializable, Cloneable   {
8459
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_args");
1982 varun.gupt 8460
 
3430 rajveer 8461
    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);
8462
    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);
8463
    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 8464
 
3430 rajveer 8465
    private String couponCode; // required
8466
    private long transactionId; // required
8467
    private long userId; // required
1982 varun.gupt 8468
 
8469
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 8470
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 8471
      COUPON_CODE((short)1, "couponCode"),
8472
      TRANSACTION_ID((short)2, "transactionId"),
8473
      USER_ID((short)3, "userId");
8474
 
8475
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8476
 
8477
      static {
8478
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8479
          byName.put(field.getFieldName(), field);
8480
        }
8481
      }
8482
 
8483
      /**
8484
       * Find the _Fields constant that matches fieldId, or null if its not found.
8485
       */
8486
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 8487
        switch(fieldId) {
8488
          case 1: // COUPON_CODE
8489
            return COUPON_CODE;
8490
          case 2: // TRANSACTION_ID
8491
            return TRANSACTION_ID;
8492
          case 3: // USER_ID
8493
            return USER_ID;
8494
          default:
8495
            return null;
8496
        }
1982 varun.gupt 8497
      }
8498
 
8499
      /**
8500
       * Find the _Fields constant that matches fieldId, throwing an exception
8501
       * if it is not found.
8502
       */
8503
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8504
        _Fields fields = findByThriftId(fieldId);
8505
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8506
        return fields;
8507
      }
8508
 
8509
      /**
8510
       * Find the _Fields constant that matches name, or null if its not found.
8511
       */
8512
      public static _Fields findByName(String name) {
8513
        return byName.get(name);
8514
      }
8515
 
8516
      private final short _thriftId;
8517
      private final String _fieldName;
8518
 
8519
      _Fields(short thriftId, String fieldName) {
8520
        _thriftId = thriftId;
8521
        _fieldName = fieldName;
8522
      }
8523
 
8524
      public short getThriftFieldId() {
8525
        return _thriftId;
8526
      }
8527
 
8528
      public String getFieldName() {
8529
        return _fieldName;
8530
      }
8531
    }
8532
 
8533
    // isset id assignments
8534
    private static final int __TRANSACTIONID_ISSET_ID = 0;
8535
    private static final int __USERID_ISSET_ID = 1;
8536
    private BitSet __isset_bit_vector = new BitSet(2);
8537
 
3430 rajveer 8538
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 8539
    static {
3430 rajveer 8540
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8541
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8542
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
8543
      tmpMap.put(_Fields.TRANSACTION_ID, new org.apache.thrift.meta_data.FieldMetaData("transactionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8544
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8545
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8546
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8547
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8548
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_args.class, metaDataMap);
1982 varun.gupt 8549
    }
8550
 
8551
    public trackCouponUsage_args() {
8552
    }
8553
 
8554
    public trackCouponUsage_args(
8555
      String couponCode,
8556
      long transactionId,
8557
      long userId)
8558
    {
8559
      this();
8560
      this.couponCode = couponCode;
8561
      this.transactionId = transactionId;
8562
      setTransactionIdIsSet(true);
8563
      this.userId = userId;
8564
      setUserIdIsSet(true);
8565
    }
8566
 
8567
    /**
8568
     * Performs a deep copy on <i>other</i>.
8569
     */
8570
    public trackCouponUsage_args(trackCouponUsage_args other) {
8571
      __isset_bit_vector.clear();
8572
      __isset_bit_vector.or(other.__isset_bit_vector);
8573
      if (other.isSetCouponCode()) {
8574
        this.couponCode = other.couponCode;
8575
      }
8576
      this.transactionId = other.transactionId;
8577
      this.userId = other.userId;
8578
    }
8579
 
8580
    public trackCouponUsage_args deepCopy() {
8581
      return new trackCouponUsage_args(this);
8582
    }
8583
 
3430 rajveer 8584
    @Override
8585
    public void clear() {
8586
      this.couponCode = null;
8587
      setTransactionIdIsSet(false);
8588
      this.transactionId = 0;
8589
      setUserIdIsSet(false);
8590
      this.userId = 0;
1982 varun.gupt 8591
    }
8592
 
8593
    public String getCouponCode() {
8594
      return this.couponCode;
8595
    }
8596
 
3430 rajveer 8597
    public void setCouponCode(String couponCode) {
1982 varun.gupt 8598
      this.couponCode = couponCode;
8599
    }
8600
 
8601
    public void unsetCouponCode() {
8602
      this.couponCode = null;
8603
    }
8604
 
3430 rajveer 8605
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 8606
    public boolean isSetCouponCode() {
8607
      return this.couponCode != null;
8608
    }
8609
 
8610
    public void setCouponCodeIsSet(boolean value) {
8611
      if (!value) {
8612
        this.couponCode = null;
8613
      }
8614
    }
8615
 
8616
    public long getTransactionId() {
8617
      return this.transactionId;
8618
    }
8619
 
3430 rajveer 8620
    public void setTransactionId(long transactionId) {
1982 varun.gupt 8621
      this.transactionId = transactionId;
8622
      setTransactionIdIsSet(true);
8623
    }
8624
 
8625
    public void unsetTransactionId() {
8626
      __isset_bit_vector.clear(__TRANSACTIONID_ISSET_ID);
8627
    }
8628
 
3430 rajveer 8629
    /** Returns true if field transactionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 8630
    public boolean isSetTransactionId() {
8631
      return __isset_bit_vector.get(__TRANSACTIONID_ISSET_ID);
8632
    }
8633
 
8634
    public void setTransactionIdIsSet(boolean value) {
8635
      __isset_bit_vector.set(__TRANSACTIONID_ISSET_ID, value);
8636
    }
8637
 
8638
    public long getUserId() {
8639
      return this.userId;
8640
    }
8641
 
3430 rajveer 8642
    public void setUserId(long userId) {
1982 varun.gupt 8643
      this.userId = userId;
8644
      setUserIdIsSet(true);
8645
    }
8646
 
8647
    public void unsetUserId() {
8648
      __isset_bit_vector.clear(__USERID_ISSET_ID);
8649
    }
8650
 
3430 rajveer 8651
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 8652
    public boolean isSetUserId() {
8653
      return __isset_bit_vector.get(__USERID_ISSET_ID);
8654
    }
8655
 
8656
    public void setUserIdIsSet(boolean value) {
8657
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
8658
    }
8659
 
8660
    public void setFieldValue(_Fields field, Object value) {
8661
      switch (field) {
8662
      case COUPON_CODE:
8663
        if (value == null) {
8664
          unsetCouponCode();
8665
        } else {
8666
          setCouponCode((String)value);
8667
        }
8668
        break;
8669
 
8670
      case TRANSACTION_ID:
8671
        if (value == null) {
8672
          unsetTransactionId();
8673
        } else {
8674
          setTransactionId((Long)value);
8675
        }
8676
        break;
8677
 
8678
      case USER_ID:
8679
        if (value == null) {
8680
          unsetUserId();
8681
        } else {
8682
          setUserId((Long)value);
8683
        }
8684
        break;
8685
 
8686
      }
8687
    }
8688
 
8689
    public Object getFieldValue(_Fields field) {
8690
      switch (field) {
8691
      case COUPON_CODE:
8692
        return getCouponCode();
8693
 
8694
      case TRANSACTION_ID:
3430 rajveer 8695
        return Long.valueOf(getTransactionId());
1982 varun.gupt 8696
 
8697
      case USER_ID:
3430 rajveer 8698
        return Long.valueOf(getUserId());
1982 varun.gupt 8699
 
8700
      }
8701
      throw new IllegalStateException();
8702
    }
8703
 
3430 rajveer 8704
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8705
    public boolean isSet(_Fields field) {
8706
      if (field == null) {
8707
        throw new IllegalArgumentException();
8708
      }
1982 varun.gupt 8709
 
8710
      switch (field) {
8711
      case COUPON_CODE:
8712
        return isSetCouponCode();
8713
      case TRANSACTION_ID:
8714
        return isSetTransactionId();
8715
      case USER_ID:
8716
        return isSetUserId();
8717
      }
8718
      throw new IllegalStateException();
8719
    }
8720
 
8721
    @Override
8722
    public boolean equals(Object that) {
8723
      if (that == null)
8724
        return false;
8725
      if (that instanceof trackCouponUsage_args)
8726
        return this.equals((trackCouponUsage_args)that);
8727
      return false;
8728
    }
8729
 
8730
    public boolean equals(trackCouponUsage_args that) {
8731
      if (that == null)
8732
        return false;
8733
 
8734
      boolean this_present_couponCode = true && this.isSetCouponCode();
8735
      boolean that_present_couponCode = true && that.isSetCouponCode();
8736
      if (this_present_couponCode || that_present_couponCode) {
8737
        if (!(this_present_couponCode && that_present_couponCode))
8738
          return false;
8739
        if (!this.couponCode.equals(that.couponCode))
8740
          return false;
8741
      }
8742
 
8743
      boolean this_present_transactionId = true;
8744
      boolean that_present_transactionId = true;
8745
      if (this_present_transactionId || that_present_transactionId) {
8746
        if (!(this_present_transactionId && that_present_transactionId))
8747
          return false;
8748
        if (this.transactionId != that.transactionId)
8749
          return false;
8750
      }
8751
 
8752
      boolean this_present_userId = true;
8753
      boolean that_present_userId = true;
8754
      if (this_present_userId || that_present_userId) {
8755
        if (!(this_present_userId && that_present_userId))
8756
          return false;
8757
        if (this.userId != that.userId)
8758
          return false;
8759
      }
8760
 
8761
      return true;
8762
    }
8763
 
8764
    @Override
8765
    public int hashCode() {
8766
      return 0;
8767
    }
8768
 
8769
    public int compareTo(trackCouponUsage_args other) {
8770
      if (!getClass().equals(other.getClass())) {
8771
        return getClass().getName().compareTo(other.getClass().getName());
8772
      }
8773
 
8774
      int lastComparison = 0;
8775
      trackCouponUsage_args typedOther = (trackCouponUsage_args)other;
8776
 
3430 rajveer 8777
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 8778
      if (lastComparison != 0) {
8779
        return lastComparison;
8780
      }
3430 rajveer 8781
      if (isSetCouponCode()) {
8782
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
8783
        if (lastComparison != 0) {
8784
          return lastComparison;
8785
        }
1982 varun.gupt 8786
      }
3430 rajveer 8787
      lastComparison = Boolean.valueOf(isSetTransactionId()).compareTo(typedOther.isSetTransactionId());
1982 varun.gupt 8788
      if (lastComparison != 0) {
8789
        return lastComparison;
8790
      }
3430 rajveer 8791
      if (isSetTransactionId()) {
8792
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transactionId, typedOther.transactionId);
8793
        if (lastComparison != 0) {
8794
          return lastComparison;
8795
        }
1982 varun.gupt 8796
      }
3430 rajveer 8797
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 8798
      if (lastComparison != 0) {
8799
        return lastComparison;
8800
      }
3430 rajveer 8801
      if (isSetUserId()) {
8802
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
8803
        if (lastComparison != 0) {
8804
          return lastComparison;
8805
        }
1982 varun.gupt 8806
      }
8807
      return 0;
8808
    }
8809
 
3430 rajveer 8810
    public _Fields fieldForId(int fieldId) {
8811
      return _Fields.findByThriftId(fieldId);
8812
    }
8813
 
8814
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8815
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 8816
      iprot.readStructBegin();
8817
      while (true)
8818
      {
8819
        field = iprot.readFieldBegin();
3430 rajveer 8820
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 8821
          break;
8822
        }
3430 rajveer 8823
        switch (field.id) {
8824
          case 1: // COUPON_CODE
8825
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
8826
              this.couponCode = iprot.readString();
8827
            } else { 
8828
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8829
            }
8830
            break;
8831
          case 2: // TRANSACTION_ID
8832
            if (field.type == org.apache.thrift.protocol.TType.I64) {
8833
              this.transactionId = iprot.readI64();
8834
              setTransactionIdIsSet(true);
8835
            } else { 
8836
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8837
            }
8838
            break;
8839
          case 3: // USER_ID
8840
            if (field.type == org.apache.thrift.protocol.TType.I64) {
8841
              this.userId = iprot.readI64();
8842
              setUserIdIsSet(true);
8843
            } else { 
8844
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8845
            }
8846
            break;
8847
          default:
8848
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 8849
        }
3430 rajveer 8850
        iprot.readFieldEnd();
1982 varun.gupt 8851
      }
8852
      iprot.readStructEnd();
8853
      validate();
8854
    }
8855
 
3430 rajveer 8856
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 8857
      validate();
8858
 
8859
      oprot.writeStructBegin(STRUCT_DESC);
8860
      if (this.couponCode != null) {
8861
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
8862
        oprot.writeString(this.couponCode);
8863
        oprot.writeFieldEnd();
8864
      }
8865
      oprot.writeFieldBegin(TRANSACTION_ID_FIELD_DESC);
8866
      oprot.writeI64(this.transactionId);
8867
      oprot.writeFieldEnd();
8868
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
8869
      oprot.writeI64(this.userId);
8870
      oprot.writeFieldEnd();
8871
      oprot.writeFieldStop();
8872
      oprot.writeStructEnd();
8873
    }
8874
 
8875
    @Override
8876
    public String toString() {
8877
      StringBuilder sb = new StringBuilder("trackCouponUsage_args(");
8878
      boolean first = true;
8879
 
8880
      sb.append("couponCode:");
8881
      if (this.couponCode == null) {
8882
        sb.append("null");
8883
      } else {
8884
        sb.append(this.couponCode);
8885
      }
8886
      first = false;
8887
      if (!first) sb.append(", ");
8888
      sb.append("transactionId:");
8889
      sb.append(this.transactionId);
8890
      first = false;
8891
      if (!first) sb.append(", ");
8892
      sb.append("userId:");
8893
      sb.append(this.userId);
8894
      first = false;
8895
      sb.append(")");
8896
      return sb.toString();
8897
    }
8898
 
3430 rajveer 8899
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 8900
      // check for required fields
8901
    }
8902
 
3430 rajveer 8903
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8904
      try {
8905
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8906
      } catch (org.apache.thrift.TException te) {
8907
        throw new java.io.IOException(te);
8908
      }
8909
    }
8910
 
8911
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8912
      try {
8913
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
8914
        __isset_bit_vector = new BitSet(1);
8915
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8916
      } catch (org.apache.thrift.TException te) {
8917
        throw new java.io.IOException(te);
8918
      }
8919
    }
8920
 
1982 varun.gupt 8921
  }
8922
 
3430 rajveer 8923
  public static class trackCouponUsage_result implements org.apache.thrift.TBase<trackCouponUsage_result, trackCouponUsage_result._Fields>, java.io.Serializable, Cloneable   {
8924
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_result");
1982 varun.gupt 8925
 
3430 rajveer 8926
    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 8927
 
3430 rajveer 8928
    private PromotionException pex; // required
1982 varun.gupt 8929
 
8930
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 8931
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 8932
      PEX((short)1, "pex");
8933
 
8934
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8935
 
8936
      static {
8937
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8938
          byName.put(field.getFieldName(), field);
8939
        }
8940
      }
8941
 
8942
      /**
8943
       * Find the _Fields constant that matches fieldId, or null if its not found.
8944
       */
8945
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 8946
        switch(fieldId) {
8947
          case 1: // PEX
8948
            return PEX;
8949
          default:
8950
            return null;
8951
        }
1982 varun.gupt 8952
      }
8953
 
8954
      /**
8955
       * Find the _Fields constant that matches fieldId, throwing an exception
8956
       * if it is not found.
8957
       */
8958
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8959
        _Fields fields = findByThriftId(fieldId);
8960
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8961
        return fields;
8962
      }
8963
 
8964
      /**
8965
       * Find the _Fields constant that matches name, or null if its not found.
8966
       */
8967
      public static _Fields findByName(String name) {
8968
        return byName.get(name);
8969
      }
8970
 
8971
      private final short _thriftId;
8972
      private final String _fieldName;
8973
 
8974
      _Fields(short thriftId, String fieldName) {
8975
        _thriftId = thriftId;
8976
        _fieldName = fieldName;
8977
      }
8978
 
8979
      public short getThriftFieldId() {
8980
        return _thriftId;
8981
      }
8982
 
8983
      public String getFieldName() {
8984
        return _fieldName;
8985
      }
8986
    }
8987
 
8988
    // isset id assignments
8989
 
3430 rajveer 8990
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 8991
    static {
3430 rajveer 8992
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8993
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8994
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
8995
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8996
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_result.class, metaDataMap);
1982 varun.gupt 8997
    }
8998
 
8999
    public trackCouponUsage_result() {
9000
    }
9001
 
9002
    public trackCouponUsage_result(
9003
      PromotionException pex)
9004
    {
9005
      this();
9006
      this.pex = pex;
9007
    }
9008
 
9009
    /**
9010
     * Performs a deep copy on <i>other</i>.
9011
     */
9012
    public trackCouponUsage_result(trackCouponUsage_result other) {
9013
      if (other.isSetPex()) {
9014
        this.pex = new PromotionException(other.pex);
9015
      }
9016
    }
9017
 
9018
    public trackCouponUsage_result deepCopy() {
9019
      return new trackCouponUsage_result(this);
9020
    }
9021
 
3430 rajveer 9022
    @Override
9023
    public void clear() {
9024
      this.pex = null;
1982 varun.gupt 9025
    }
9026
 
9027
    public PromotionException getPex() {
9028
      return this.pex;
9029
    }
9030
 
3430 rajveer 9031
    public void setPex(PromotionException pex) {
1982 varun.gupt 9032
      this.pex = pex;
9033
    }
9034
 
9035
    public void unsetPex() {
9036
      this.pex = null;
9037
    }
9038
 
3430 rajveer 9039
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 9040
    public boolean isSetPex() {
9041
      return this.pex != null;
9042
    }
9043
 
9044
    public void setPexIsSet(boolean value) {
9045
      if (!value) {
9046
        this.pex = null;
9047
      }
9048
    }
9049
 
9050
    public void setFieldValue(_Fields field, Object value) {
9051
      switch (field) {
9052
      case PEX:
9053
        if (value == null) {
9054
          unsetPex();
9055
        } else {
9056
          setPex((PromotionException)value);
9057
        }
9058
        break;
9059
 
9060
      }
9061
    }
9062
 
9063
    public Object getFieldValue(_Fields field) {
9064
      switch (field) {
9065
      case PEX:
9066
        return getPex();
9067
 
9068
      }
9069
      throw new IllegalStateException();
9070
    }
9071
 
3430 rajveer 9072
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9073
    public boolean isSet(_Fields field) {
9074
      if (field == null) {
9075
        throw new IllegalArgumentException();
9076
      }
1982 varun.gupt 9077
 
9078
      switch (field) {
9079
      case PEX:
9080
        return isSetPex();
9081
      }
9082
      throw new IllegalStateException();
9083
    }
9084
 
9085
    @Override
9086
    public boolean equals(Object that) {
9087
      if (that == null)
9088
        return false;
9089
      if (that instanceof trackCouponUsage_result)
9090
        return this.equals((trackCouponUsage_result)that);
9091
      return false;
9092
    }
9093
 
9094
    public boolean equals(trackCouponUsage_result that) {
9095
      if (that == null)
9096
        return false;
9097
 
9098
      boolean this_present_pex = true && this.isSetPex();
9099
      boolean that_present_pex = true && that.isSetPex();
9100
      if (this_present_pex || that_present_pex) {
9101
        if (!(this_present_pex && that_present_pex))
9102
          return false;
9103
        if (!this.pex.equals(that.pex))
9104
          return false;
9105
      }
9106
 
9107
      return true;
9108
    }
9109
 
9110
    @Override
9111
    public int hashCode() {
9112
      return 0;
9113
    }
9114
 
9115
    public int compareTo(trackCouponUsage_result other) {
9116
      if (!getClass().equals(other.getClass())) {
9117
        return getClass().getName().compareTo(other.getClass().getName());
9118
      }
9119
 
9120
      int lastComparison = 0;
9121
      trackCouponUsage_result typedOther = (trackCouponUsage_result)other;
9122
 
3430 rajveer 9123
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 9124
      if (lastComparison != 0) {
9125
        return lastComparison;
9126
      }
3430 rajveer 9127
      if (isSetPex()) {
9128
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
9129
        if (lastComparison != 0) {
9130
          return lastComparison;
9131
        }
1982 varun.gupt 9132
      }
9133
      return 0;
9134
    }
9135
 
3430 rajveer 9136
    public _Fields fieldForId(int fieldId) {
9137
      return _Fields.findByThriftId(fieldId);
9138
    }
9139
 
9140
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9141
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 9142
      iprot.readStructBegin();
9143
      while (true)
9144
      {
9145
        field = iprot.readFieldBegin();
3430 rajveer 9146
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 9147
          break;
9148
        }
3430 rajveer 9149
        switch (field.id) {
9150
          case 1: // PEX
9151
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
9152
              this.pex = new PromotionException();
9153
              this.pex.read(iprot);
9154
            } else { 
9155
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9156
            }
9157
            break;
9158
          default:
9159
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 9160
        }
3430 rajveer 9161
        iprot.readFieldEnd();
1982 varun.gupt 9162
      }
9163
      iprot.readStructEnd();
9164
      validate();
9165
    }
9166
 
3430 rajveer 9167
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 9168
      oprot.writeStructBegin(STRUCT_DESC);
9169
 
9170
      if (this.isSetPex()) {
9171
        oprot.writeFieldBegin(PEX_FIELD_DESC);
9172
        this.pex.write(oprot);
9173
        oprot.writeFieldEnd();
9174
      }
9175
      oprot.writeFieldStop();
9176
      oprot.writeStructEnd();
9177
    }
9178
 
9179
    @Override
9180
    public String toString() {
9181
      StringBuilder sb = new StringBuilder("trackCouponUsage_result(");
9182
      boolean first = true;
9183
 
9184
      sb.append("pex:");
9185
      if (this.pex == null) {
9186
        sb.append("null");
9187
      } else {
9188
        sb.append(this.pex);
9189
      }
9190
      first = false;
9191
      sb.append(")");
9192
      return sb.toString();
9193
    }
9194
 
3430 rajveer 9195
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 9196
      // check for required fields
9197
    }
9198
 
3430 rajveer 9199
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9200
      try {
9201
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9202
      } catch (org.apache.thrift.TException te) {
9203
        throw new java.io.IOException(te);
9204
      }
9205
    }
9206
 
9207
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9208
      try {
9209
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9210
      } catch (org.apache.thrift.TException te) {
9211
        throw new java.io.IOException(te);
9212
      }
9213
    }
9214
 
1982 varun.gupt 9215
  }
9216
 
3430 rajveer 9217
  public static class getCouponUsageCountByUser_args implements org.apache.thrift.TBase<getCouponUsageCountByUser_args, getCouponUsageCountByUser_args._Fields>, java.io.Serializable, Cloneable   {
9218
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_args");
1982 varun.gupt 9219
 
3430 rajveer 9220
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)1);
9221
    private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.I64, (short)2);
1982 varun.gupt 9222
 
3430 rajveer 9223
    private String couponCode; // required
9224
    private long userId; // required
1982 varun.gupt 9225
 
9226
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 9227
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 9228
      COUPON_CODE((short)1, "couponCode"),
9229
      USER_ID((short)2, "userId");
9230
 
9231
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9232
 
9233
      static {
9234
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9235
          byName.put(field.getFieldName(), field);
9236
        }
9237
      }
9238
 
9239
      /**
9240
       * Find the _Fields constant that matches fieldId, or null if its not found.
9241
       */
9242
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 9243
        switch(fieldId) {
9244
          case 1: // COUPON_CODE
9245
            return COUPON_CODE;
9246
          case 2: // USER_ID
9247
            return USER_ID;
9248
          default:
9249
            return null;
9250
        }
1982 varun.gupt 9251
      }
9252
 
9253
      /**
9254
       * Find the _Fields constant that matches fieldId, throwing an exception
9255
       * if it is not found.
9256
       */
9257
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9258
        _Fields fields = findByThriftId(fieldId);
9259
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9260
        return fields;
9261
      }
9262
 
9263
      /**
9264
       * Find the _Fields constant that matches name, or null if its not found.
9265
       */
9266
      public static _Fields findByName(String name) {
9267
        return byName.get(name);
9268
      }
9269
 
9270
      private final short _thriftId;
9271
      private final String _fieldName;
9272
 
9273
      _Fields(short thriftId, String fieldName) {
9274
        _thriftId = thriftId;
9275
        _fieldName = fieldName;
9276
      }
9277
 
9278
      public short getThriftFieldId() {
9279
        return _thriftId;
9280
      }
9281
 
9282
      public String getFieldName() {
9283
        return _fieldName;
9284
      }
9285
    }
9286
 
9287
    // isset id assignments
9288
    private static final int __USERID_ISSET_ID = 0;
9289
    private BitSet __isset_bit_vector = new BitSet(1);
9290
 
3430 rajveer 9291
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 9292
    static {
3430 rajveer 9293
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9294
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9295
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
9296
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9297
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9298
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9299
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_args.class, metaDataMap);
1982 varun.gupt 9300
    }
9301
 
9302
    public getCouponUsageCountByUser_args() {
9303
    }
9304
 
9305
    public getCouponUsageCountByUser_args(
9306
      String couponCode,
9307
      long userId)
9308
    {
9309
      this();
9310
      this.couponCode = couponCode;
9311
      this.userId = userId;
9312
      setUserIdIsSet(true);
9313
    }
9314
 
9315
    /**
9316
     * Performs a deep copy on <i>other</i>.
9317
     */
9318
    public getCouponUsageCountByUser_args(getCouponUsageCountByUser_args other) {
9319
      __isset_bit_vector.clear();
9320
      __isset_bit_vector.or(other.__isset_bit_vector);
9321
      if (other.isSetCouponCode()) {
9322
        this.couponCode = other.couponCode;
9323
      }
9324
      this.userId = other.userId;
9325
    }
9326
 
9327
    public getCouponUsageCountByUser_args deepCopy() {
9328
      return new getCouponUsageCountByUser_args(this);
9329
    }
9330
 
3430 rajveer 9331
    @Override
9332
    public void clear() {
9333
      this.couponCode = null;
9334
      setUserIdIsSet(false);
9335
      this.userId = 0;
1982 varun.gupt 9336
    }
9337
 
9338
    public String getCouponCode() {
9339
      return this.couponCode;
9340
    }
9341
 
3430 rajveer 9342
    public void setCouponCode(String couponCode) {
1982 varun.gupt 9343
      this.couponCode = couponCode;
9344
    }
9345
 
9346
    public void unsetCouponCode() {
9347
      this.couponCode = null;
9348
    }
9349
 
3430 rajveer 9350
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 9351
    public boolean isSetCouponCode() {
9352
      return this.couponCode != null;
9353
    }
9354
 
9355
    public void setCouponCodeIsSet(boolean value) {
9356
      if (!value) {
9357
        this.couponCode = null;
9358
      }
9359
    }
9360
 
9361
    public long getUserId() {
9362
      return this.userId;
9363
    }
9364
 
3430 rajveer 9365
    public void setUserId(long userId) {
1982 varun.gupt 9366
      this.userId = userId;
9367
      setUserIdIsSet(true);
9368
    }
9369
 
9370
    public void unsetUserId() {
9371
      __isset_bit_vector.clear(__USERID_ISSET_ID);
9372
    }
9373
 
3430 rajveer 9374
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 9375
    public boolean isSetUserId() {
9376
      return __isset_bit_vector.get(__USERID_ISSET_ID);
9377
    }
9378
 
9379
    public void setUserIdIsSet(boolean value) {
9380
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
9381
    }
9382
 
9383
    public void setFieldValue(_Fields field, Object value) {
9384
      switch (field) {
9385
      case COUPON_CODE:
9386
        if (value == null) {
9387
          unsetCouponCode();
9388
        } else {
9389
          setCouponCode((String)value);
9390
        }
9391
        break;
9392
 
9393
      case USER_ID:
9394
        if (value == null) {
9395
          unsetUserId();
9396
        } else {
9397
          setUserId((Long)value);
9398
        }
9399
        break;
9400
 
9401
      }
9402
    }
9403
 
9404
    public Object getFieldValue(_Fields field) {
9405
      switch (field) {
9406
      case COUPON_CODE:
9407
        return getCouponCode();
9408
 
9409
      case USER_ID:
3430 rajveer 9410
        return Long.valueOf(getUserId());
1982 varun.gupt 9411
 
9412
      }
9413
      throw new IllegalStateException();
9414
    }
9415
 
3430 rajveer 9416
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9417
    public boolean isSet(_Fields field) {
9418
      if (field == null) {
9419
        throw new IllegalArgumentException();
9420
      }
1982 varun.gupt 9421
 
9422
      switch (field) {
9423
      case COUPON_CODE:
9424
        return isSetCouponCode();
9425
      case USER_ID:
9426
        return isSetUserId();
9427
      }
9428
      throw new IllegalStateException();
9429
    }
9430
 
9431
    @Override
9432
    public boolean equals(Object that) {
9433
      if (that == null)
9434
        return false;
9435
      if (that instanceof getCouponUsageCountByUser_args)
9436
        return this.equals((getCouponUsageCountByUser_args)that);
9437
      return false;
9438
    }
9439
 
9440
    public boolean equals(getCouponUsageCountByUser_args that) {
9441
      if (that == null)
9442
        return false;
9443
 
9444
      boolean this_present_couponCode = true && this.isSetCouponCode();
9445
      boolean that_present_couponCode = true && that.isSetCouponCode();
9446
      if (this_present_couponCode || that_present_couponCode) {
9447
        if (!(this_present_couponCode && that_present_couponCode))
9448
          return false;
9449
        if (!this.couponCode.equals(that.couponCode))
9450
          return false;
9451
      }
9452
 
9453
      boolean this_present_userId = true;
9454
      boolean that_present_userId = true;
9455
      if (this_present_userId || that_present_userId) {
9456
        if (!(this_present_userId && that_present_userId))
9457
          return false;
9458
        if (this.userId != that.userId)
9459
          return false;
9460
      }
9461
 
9462
      return true;
9463
    }
9464
 
9465
    @Override
9466
    public int hashCode() {
9467
      return 0;
9468
    }
9469
 
9470
    public int compareTo(getCouponUsageCountByUser_args other) {
9471
      if (!getClass().equals(other.getClass())) {
9472
        return getClass().getName().compareTo(other.getClass().getName());
9473
      }
9474
 
9475
      int lastComparison = 0;
9476
      getCouponUsageCountByUser_args typedOther = (getCouponUsageCountByUser_args)other;
9477
 
3430 rajveer 9478
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 9479
      if (lastComparison != 0) {
9480
        return lastComparison;
9481
      }
3430 rajveer 9482
      if (isSetCouponCode()) {
9483
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
9484
        if (lastComparison != 0) {
9485
          return lastComparison;
9486
        }
1982 varun.gupt 9487
      }
3430 rajveer 9488
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 9489
      if (lastComparison != 0) {
9490
        return lastComparison;
9491
      }
3430 rajveer 9492
      if (isSetUserId()) {
9493
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
9494
        if (lastComparison != 0) {
9495
          return lastComparison;
9496
        }
1982 varun.gupt 9497
      }
9498
      return 0;
9499
    }
9500
 
3430 rajveer 9501
    public _Fields fieldForId(int fieldId) {
9502
      return _Fields.findByThriftId(fieldId);
9503
    }
9504
 
9505
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9506
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 9507
      iprot.readStructBegin();
9508
      while (true)
9509
      {
9510
        field = iprot.readFieldBegin();
3430 rajveer 9511
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 9512
          break;
9513
        }
3430 rajveer 9514
        switch (field.id) {
9515
          case 1: // COUPON_CODE
9516
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
9517
              this.couponCode = iprot.readString();
9518
            } else { 
9519
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9520
            }
9521
            break;
9522
          case 2: // USER_ID
9523
            if (field.type == org.apache.thrift.protocol.TType.I64) {
9524
              this.userId = iprot.readI64();
9525
              setUserIdIsSet(true);
9526
            } else { 
9527
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9528
            }
9529
            break;
9530
          default:
9531
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 9532
        }
3430 rajveer 9533
        iprot.readFieldEnd();
1982 varun.gupt 9534
      }
9535
      iprot.readStructEnd();
9536
      validate();
9537
    }
9538
 
3430 rajveer 9539
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 9540
      validate();
9541
 
9542
      oprot.writeStructBegin(STRUCT_DESC);
9543
      if (this.couponCode != null) {
9544
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
9545
        oprot.writeString(this.couponCode);
9546
        oprot.writeFieldEnd();
9547
      }
9548
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
9549
      oprot.writeI64(this.userId);
9550
      oprot.writeFieldEnd();
9551
      oprot.writeFieldStop();
9552
      oprot.writeStructEnd();
9553
    }
9554
 
9555
    @Override
9556
    public String toString() {
9557
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_args(");
9558
      boolean first = true;
9559
 
9560
      sb.append("couponCode:");
9561
      if (this.couponCode == null) {
9562
        sb.append("null");
9563
      } else {
9564
        sb.append(this.couponCode);
9565
      }
9566
      first = false;
9567
      if (!first) sb.append(", ");
9568
      sb.append("userId:");
9569
      sb.append(this.userId);
9570
      first = false;
9571
      sb.append(")");
9572
      return sb.toString();
9573
    }
9574
 
3430 rajveer 9575
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 9576
      // check for required fields
9577
    }
9578
 
3430 rajveer 9579
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9580
      try {
9581
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9582
      } catch (org.apache.thrift.TException te) {
9583
        throw new java.io.IOException(te);
9584
      }
9585
    }
9586
 
9587
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9588
      try {
9589
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
9590
        __isset_bit_vector = new BitSet(1);
9591
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9592
      } catch (org.apache.thrift.TException te) {
9593
        throw new java.io.IOException(te);
9594
      }
9595
    }
9596
 
1982 varun.gupt 9597
  }
9598
 
3430 rajveer 9599
  public static class getCouponUsageCountByUser_result implements org.apache.thrift.TBase<getCouponUsageCountByUser_result, getCouponUsageCountByUser_result._Fields>, java.io.Serializable, Cloneable   {
9600
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_result");
1982 varun.gupt 9601
 
3430 rajveer 9602
    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);
9603
    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 9604
 
3430 rajveer 9605
    private long success; // required
9606
    private PromotionException pex; // required
1982 varun.gupt 9607
 
9608
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 9609
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 9610
      SUCCESS((short)0, "success"),
9611
      PEX((short)1, "pex");
9612
 
9613
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9614
 
9615
      static {
9616
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9617
          byName.put(field.getFieldName(), field);
9618
        }
9619
      }
9620
 
9621
      /**
9622
       * Find the _Fields constant that matches fieldId, or null if its not found.
9623
       */
9624
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 9625
        switch(fieldId) {
9626
          case 0: // SUCCESS
9627
            return SUCCESS;
9628
          case 1: // PEX
9629
            return PEX;
9630
          default:
9631
            return null;
9632
        }
1982 varun.gupt 9633
      }
9634
 
9635
      /**
9636
       * Find the _Fields constant that matches fieldId, throwing an exception
9637
       * if it is not found.
9638
       */
9639
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9640
        _Fields fields = findByThriftId(fieldId);
9641
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9642
        return fields;
9643
      }
9644
 
9645
      /**
9646
       * Find the _Fields constant that matches name, or null if its not found.
9647
       */
9648
      public static _Fields findByName(String name) {
9649
        return byName.get(name);
9650
      }
9651
 
9652
      private final short _thriftId;
9653
      private final String _fieldName;
9654
 
9655
      _Fields(short thriftId, String fieldName) {
9656
        _thriftId = thriftId;
9657
        _fieldName = fieldName;
9658
      }
9659
 
9660
      public short getThriftFieldId() {
9661
        return _thriftId;
9662
      }
9663
 
9664
      public String getFieldName() {
9665
        return _fieldName;
9666
      }
9667
    }
9668
 
9669
    // isset id assignments
9670
    private static final int __SUCCESS_ISSET_ID = 0;
9671
    private BitSet __isset_bit_vector = new BitSet(1);
9672
 
3430 rajveer 9673
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 9674
    static {
3430 rajveer 9675
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9676
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9677
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9678
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9679
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
9680
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9681
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_result.class, metaDataMap);
1982 varun.gupt 9682
    }
9683
 
9684
    public getCouponUsageCountByUser_result() {
9685
    }
9686
 
9687
    public getCouponUsageCountByUser_result(
9688
      long success,
9689
      PromotionException pex)
9690
    {
9691
      this();
9692
      this.success = success;
9693
      setSuccessIsSet(true);
9694
      this.pex = pex;
9695
    }
9696
 
9697
    /**
9698
     * Performs a deep copy on <i>other</i>.
9699
     */
9700
    public getCouponUsageCountByUser_result(getCouponUsageCountByUser_result other) {
9701
      __isset_bit_vector.clear();
9702
      __isset_bit_vector.or(other.__isset_bit_vector);
9703
      this.success = other.success;
9704
      if (other.isSetPex()) {
9705
        this.pex = new PromotionException(other.pex);
9706
      }
9707
    }
9708
 
9709
    public getCouponUsageCountByUser_result deepCopy() {
9710
      return new getCouponUsageCountByUser_result(this);
9711
    }
9712
 
3430 rajveer 9713
    @Override
9714
    public void clear() {
9715
      setSuccessIsSet(false);
9716
      this.success = 0;
9717
      this.pex = null;
1982 varun.gupt 9718
    }
9719
 
9720
    public long getSuccess() {
9721
      return this.success;
9722
    }
9723
 
3430 rajveer 9724
    public void setSuccess(long success) {
1982 varun.gupt 9725
      this.success = success;
9726
      setSuccessIsSet(true);
9727
    }
9728
 
9729
    public void unsetSuccess() {
9730
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
9731
    }
9732
 
3430 rajveer 9733
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 9734
    public boolean isSetSuccess() {
9735
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
9736
    }
9737
 
9738
    public void setSuccessIsSet(boolean value) {
9739
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
9740
    }
9741
 
9742
    public PromotionException getPex() {
9743
      return this.pex;
9744
    }
9745
 
3430 rajveer 9746
    public void setPex(PromotionException pex) {
1982 varun.gupt 9747
      this.pex = pex;
9748
    }
9749
 
9750
    public void unsetPex() {
9751
      this.pex = null;
9752
    }
9753
 
3430 rajveer 9754
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 9755
    public boolean isSetPex() {
9756
      return this.pex != null;
9757
    }
9758
 
9759
    public void setPexIsSet(boolean value) {
9760
      if (!value) {
9761
        this.pex = null;
9762
      }
9763
    }
9764
 
9765
    public void setFieldValue(_Fields field, Object value) {
9766
      switch (field) {
9767
      case SUCCESS:
9768
        if (value == null) {
9769
          unsetSuccess();
9770
        } else {
9771
          setSuccess((Long)value);
9772
        }
9773
        break;
9774
 
9775
      case PEX:
9776
        if (value == null) {
9777
          unsetPex();
9778
        } else {
9779
          setPex((PromotionException)value);
9780
        }
9781
        break;
9782
 
9783
      }
9784
    }
9785
 
9786
    public Object getFieldValue(_Fields field) {
9787
      switch (field) {
9788
      case SUCCESS:
3430 rajveer 9789
        return Long.valueOf(getSuccess());
1982 varun.gupt 9790
 
9791
      case PEX:
9792
        return getPex();
9793
 
9794
      }
9795
      throw new IllegalStateException();
9796
    }
9797
 
3430 rajveer 9798
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9799
    public boolean isSet(_Fields field) {
9800
      if (field == null) {
9801
        throw new IllegalArgumentException();
9802
      }
1982 varun.gupt 9803
 
9804
      switch (field) {
9805
      case SUCCESS:
9806
        return isSetSuccess();
9807
      case PEX:
9808
        return isSetPex();
9809
      }
9810
      throw new IllegalStateException();
9811
    }
9812
 
9813
    @Override
9814
    public boolean equals(Object that) {
9815
      if (that == null)
9816
        return false;
9817
      if (that instanceof getCouponUsageCountByUser_result)
9818
        return this.equals((getCouponUsageCountByUser_result)that);
9819
      return false;
9820
    }
9821
 
9822
    public boolean equals(getCouponUsageCountByUser_result that) {
9823
      if (that == null)
9824
        return false;
9825
 
9826
      boolean this_present_success = true;
9827
      boolean that_present_success = true;
9828
      if (this_present_success || that_present_success) {
9829
        if (!(this_present_success && that_present_success))
9830
          return false;
9831
        if (this.success != that.success)
9832
          return false;
9833
      }
9834
 
9835
      boolean this_present_pex = true && this.isSetPex();
9836
      boolean that_present_pex = true && that.isSetPex();
9837
      if (this_present_pex || that_present_pex) {
9838
        if (!(this_present_pex && that_present_pex))
9839
          return false;
9840
        if (!this.pex.equals(that.pex))
9841
          return false;
9842
      }
9843
 
9844
      return true;
9845
    }
9846
 
9847
    @Override
9848
    public int hashCode() {
9849
      return 0;
9850
    }
9851
 
9852
    public int compareTo(getCouponUsageCountByUser_result other) {
9853
      if (!getClass().equals(other.getClass())) {
9854
        return getClass().getName().compareTo(other.getClass().getName());
9855
      }
9856
 
9857
      int lastComparison = 0;
9858
      getCouponUsageCountByUser_result typedOther = (getCouponUsageCountByUser_result)other;
9859
 
3430 rajveer 9860
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 9861
      if (lastComparison != 0) {
9862
        return lastComparison;
9863
      }
3430 rajveer 9864
      if (isSetSuccess()) {
9865
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
9866
        if (lastComparison != 0) {
9867
          return lastComparison;
9868
        }
1982 varun.gupt 9869
      }
3430 rajveer 9870
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 9871
      if (lastComparison != 0) {
9872
        return lastComparison;
9873
      }
3430 rajveer 9874
      if (isSetPex()) {
9875
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
9876
        if (lastComparison != 0) {
9877
          return lastComparison;
9878
        }
1982 varun.gupt 9879
      }
9880
      return 0;
9881
    }
9882
 
3430 rajveer 9883
    public _Fields fieldForId(int fieldId) {
9884
      return _Fields.findByThriftId(fieldId);
9885
    }
9886
 
9887
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9888
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 9889
      iprot.readStructBegin();
9890
      while (true)
9891
      {
9892
        field = iprot.readFieldBegin();
3430 rajveer 9893
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 9894
          break;
9895
        }
3430 rajveer 9896
        switch (field.id) {
9897
          case 0: // SUCCESS
9898
            if (field.type == org.apache.thrift.protocol.TType.I64) {
9899
              this.success = iprot.readI64();
9900
              setSuccessIsSet(true);
9901
            } else { 
9902
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9903
            }
9904
            break;
9905
          case 1: // PEX
9906
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
9907
              this.pex = new PromotionException();
9908
              this.pex.read(iprot);
9909
            } else { 
9910
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9911
            }
9912
            break;
9913
          default:
9914
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 9915
        }
3430 rajveer 9916
        iprot.readFieldEnd();
1982 varun.gupt 9917
      }
9918
      iprot.readStructEnd();
9919
      validate();
9920
    }
9921
 
3430 rajveer 9922
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 9923
      oprot.writeStructBegin(STRUCT_DESC);
9924
 
9925
      if (this.isSetSuccess()) {
9926
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
9927
        oprot.writeI64(this.success);
9928
        oprot.writeFieldEnd();
9929
      } else if (this.isSetPex()) {
9930
        oprot.writeFieldBegin(PEX_FIELD_DESC);
9931
        this.pex.write(oprot);
9932
        oprot.writeFieldEnd();
9933
      }
9934
      oprot.writeFieldStop();
9935
      oprot.writeStructEnd();
9936
    }
9937
 
9938
    @Override
9939
    public String toString() {
9940
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_result(");
9941
      boolean first = true;
9942
 
9943
      sb.append("success:");
9944
      sb.append(this.success);
9945
      first = false;
9946
      if (!first) sb.append(", ");
9947
      sb.append("pex:");
9948
      if (this.pex == null) {
9949
        sb.append("null");
9950
      } else {
9951
        sb.append(this.pex);
9952
      }
9953
      first = false;
9954
      sb.append(")");
9955
      return sb.toString();
9956
    }
9957
 
3430 rajveer 9958
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 9959
      // check for required fields
9960
    }
9961
 
3430 rajveer 9962
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9963
      try {
9964
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9965
      } catch (org.apache.thrift.TException te) {
9966
        throw new java.io.IOException(te);
9967
      }
9968
    }
9969
 
9970
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9971
      try {
9972
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9973
      } catch (org.apache.thrift.TException te) {
9974
        throw new java.io.IOException(te);
9975
      }
9976
    }
9977
 
1982 varun.gupt 9978
  }
9979
 
6497 amit.gupta 9980
  public static class getActiveCodes_args implements org.apache.thrift.TBase<getActiveCodes_args, getActiveCodes_args._Fields>, java.io.Serializable, Cloneable   {
9981
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCodes_args");
9982
 
9983
    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);
9984
 
9985
    private long promotionId; // required
9986
 
9987
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9988
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
9989
      PROMOTION_ID((short)1, "promotionId");
9990
 
9991
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9992
 
9993
      static {
9994
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9995
          byName.put(field.getFieldName(), field);
9996
        }
9997
      }
9998
 
9999
      /**
10000
       * Find the _Fields constant that matches fieldId, or null if its not found.
10001
       */
10002
      public static _Fields findByThriftId(int fieldId) {
10003
        switch(fieldId) {
10004
          case 1: // PROMOTION_ID
10005
            return PROMOTION_ID;
10006
          default:
10007
            return null;
10008
        }
10009
      }
10010
 
10011
      /**
10012
       * Find the _Fields constant that matches fieldId, throwing an exception
10013
       * if it is not found.
10014
       */
10015
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10016
        _Fields fields = findByThriftId(fieldId);
10017
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10018
        return fields;
10019
      }
10020
 
10021
      /**
10022
       * Find the _Fields constant that matches name, or null if its not found.
10023
       */
10024
      public static _Fields findByName(String name) {
10025
        return byName.get(name);
10026
      }
10027
 
10028
      private final short _thriftId;
10029
      private final String _fieldName;
10030
 
10031
      _Fields(short thriftId, String fieldName) {
10032
        _thriftId = thriftId;
10033
        _fieldName = fieldName;
10034
      }
10035
 
10036
      public short getThriftFieldId() {
10037
        return _thriftId;
10038
      }
10039
 
10040
      public String getFieldName() {
10041
        return _fieldName;
10042
      }
10043
    }
10044
 
10045
    // isset id assignments
10046
    private static final int __PROMOTIONID_ISSET_ID = 0;
10047
    private BitSet __isset_bit_vector = new BitSet(1);
10048
 
10049
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
10050
    static {
10051
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10052
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10053
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
10054
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10055
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCodes_args.class, metaDataMap);
10056
    }
10057
 
10058
    public getActiveCodes_args() {
10059
    }
10060
 
10061
    public getActiveCodes_args(
10062
      long promotionId)
10063
    {
10064
      this();
10065
      this.promotionId = promotionId;
10066
      setPromotionIdIsSet(true);
10067
    }
10068
 
10069
    /**
10070
     * Performs a deep copy on <i>other</i>.
10071
     */
10072
    public getActiveCodes_args(getActiveCodes_args other) {
10073
      __isset_bit_vector.clear();
10074
      __isset_bit_vector.or(other.__isset_bit_vector);
10075
      this.promotionId = other.promotionId;
10076
    }
10077
 
10078
    public getActiveCodes_args deepCopy() {
10079
      return new getActiveCodes_args(this);
10080
    }
10081
 
10082
    @Override
10083
    public void clear() {
10084
      setPromotionIdIsSet(false);
10085
      this.promotionId = 0;
10086
    }
10087
 
10088
    public long getPromotionId() {
10089
      return this.promotionId;
10090
    }
10091
 
10092
    public void setPromotionId(long promotionId) {
10093
      this.promotionId = promotionId;
10094
      setPromotionIdIsSet(true);
10095
    }
10096
 
10097
    public void unsetPromotionId() {
10098
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
10099
    }
10100
 
10101
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
10102
    public boolean isSetPromotionId() {
10103
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
10104
    }
10105
 
10106
    public void setPromotionIdIsSet(boolean value) {
10107
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
10108
    }
10109
 
10110
    public void setFieldValue(_Fields field, Object value) {
10111
      switch (field) {
10112
      case PROMOTION_ID:
10113
        if (value == null) {
10114
          unsetPromotionId();
10115
        } else {
10116
          setPromotionId((Long)value);
10117
        }
10118
        break;
10119
 
10120
      }
10121
    }
10122
 
10123
    public Object getFieldValue(_Fields field) {
10124
      switch (field) {
10125
      case PROMOTION_ID:
10126
        return Long.valueOf(getPromotionId());
10127
 
10128
      }
10129
      throw new IllegalStateException();
10130
    }
10131
 
10132
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10133
    public boolean isSet(_Fields field) {
10134
      if (field == null) {
10135
        throw new IllegalArgumentException();
10136
      }
10137
 
10138
      switch (field) {
10139
      case PROMOTION_ID:
10140
        return isSetPromotionId();
10141
      }
10142
      throw new IllegalStateException();
10143
    }
10144
 
10145
    @Override
10146
    public boolean equals(Object that) {
10147
      if (that == null)
10148
        return false;
10149
      if (that instanceof getActiveCodes_args)
10150
        return this.equals((getActiveCodes_args)that);
10151
      return false;
10152
    }
10153
 
10154
    public boolean equals(getActiveCodes_args that) {
10155
      if (that == null)
10156
        return false;
10157
 
10158
      boolean this_present_promotionId = true;
10159
      boolean that_present_promotionId = true;
10160
      if (this_present_promotionId || that_present_promotionId) {
10161
        if (!(this_present_promotionId && that_present_promotionId))
10162
          return false;
10163
        if (this.promotionId != that.promotionId)
10164
          return false;
10165
      }
10166
 
10167
      return true;
10168
    }
10169
 
10170
    @Override
10171
    public int hashCode() {
10172
      return 0;
10173
    }
10174
 
10175
    public int compareTo(getActiveCodes_args other) {
10176
      if (!getClass().equals(other.getClass())) {
10177
        return getClass().getName().compareTo(other.getClass().getName());
10178
      }
10179
 
10180
      int lastComparison = 0;
10181
      getActiveCodes_args typedOther = (getActiveCodes_args)other;
10182
 
10183
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
10184
      if (lastComparison != 0) {
10185
        return lastComparison;
10186
      }
10187
      if (isSetPromotionId()) {
10188
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
10189
        if (lastComparison != 0) {
10190
          return lastComparison;
10191
        }
10192
      }
10193
      return 0;
10194
    }
10195
 
10196
    public _Fields fieldForId(int fieldId) {
10197
      return _Fields.findByThriftId(fieldId);
10198
    }
10199
 
10200
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10201
      org.apache.thrift.protocol.TField field;
10202
      iprot.readStructBegin();
10203
      while (true)
10204
      {
10205
        field = iprot.readFieldBegin();
10206
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
10207
          break;
10208
        }
10209
        switch (field.id) {
10210
          case 1: // PROMOTION_ID
10211
            if (field.type == org.apache.thrift.protocol.TType.I64) {
10212
              this.promotionId = iprot.readI64();
10213
              setPromotionIdIsSet(true);
10214
            } else { 
10215
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10216
            }
10217
            break;
10218
          default:
10219
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10220
        }
10221
        iprot.readFieldEnd();
10222
      }
10223
      iprot.readStructEnd();
10224
      validate();
10225
    }
10226
 
10227
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
10228
      validate();
10229
 
10230
      oprot.writeStructBegin(STRUCT_DESC);
10231
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
10232
      oprot.writeI64(this.promotionId);
10233
      oprot.writeFieldEnd();
10234
      oprot.writeFieldStop();
10235
      oprot.writeStructEnd();
10236
    }
10237
 
10238
    @Override
10239
    public String toString() {
10240
      StringBuilder sb = new StringBuilder("getActiveCodes_args(");
10241
      boolean first = true;
10242
 
10243
      sb.append("promotionId:");
10244
      sb.append(this.promotionId);
10245
      first = false;
10246
      sb.append(")");
10247
      return sb.toString();
10248
    }
10249
 
10250
    public void validate() throws org.apache.thrift.TException {
10251
      // check for required fields
10252
    }
10253
 
10254
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10255
      try {
10256
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10257
      } catch (org.apache.thrift.TException te) {
10258
        throw new java.io.IOException(te);
10259
      }
10260
    }
10261
 
10262
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10263
      try {
10264
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
10265
        __isset_bit_vector = new BitSet(1);
10266
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10267
      } catch (org.apache.thrift.TException te) {
10268
        throw new java.io.IOException(te);
10269
      }
10270
    }
10271
 
10272
  }
10273
 
10274
  public static class getActiveCodes_result implements org.apache.thrift.TBase<getActiveCodes_result, getActiveCodes_result._Fields>, java.io.Serializable, Cloneable   {
10275
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCodes_result");
10276
 
10277
    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);
10278
    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);
10279
 
10280
    private List<Coupon> success; // required
10281
    private PromotionException pex; // required
10282
 
10283
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
10284
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
10285
      SUCCESS((short)0, "success"),
10286
      PEX((short)1, "pex");
10287
 
10288
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10289
 
10290
      static {
10291
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10292
          byName.put(field.getFieldName(), field);
10293
        }
10294
      }
10295
 
10296
      /**
10297
       * Find the _Fields constant that matches fieldId, or null if its not found.
10298
       */
10299
      public static _Fields findByThriftId(int fieldId) {
10300
        switch(fieldId) {
10301
          case 0: // SUCCESS
10302
            return SUCCESS;
10303
          case 1: // PEX
10304
            return PEX;
10305
          default:
10306
            return null;
10307
        }
10308
      }
10309
 
10310
      /**
10311
       * Find the _Fields constant that matches fieldId, throwing an exception
10312
       * if it is not found.
10313
       */
10314
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10315
        _Fields fields = findByThriftId(fieldId);
10316
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10317
        return fields;
10318
      }
10319
 
10320
      /**
10321
       * Find the _Fields constant that matches name, or null if its not found.
10322
       */
10323
      public static _Fields findByName(String name) {
10324
        return byName.get(name);
10325
      }
10326
 
10327
      private final short _thriftId;
10328
      private final String _fieldName;
10329
 
10330
      _Fields(short thriftId, String fieldName) {
10331
        _thriftId = thriftId;
10332
        _fieldName = fieldName;
10333
      }
10334
 
10335
      public short getThriftFieldId() {
10336
        return _thriftId;
10337
      }
10338
 
10339
      public String getFieldName() {
10340
        return _fieldName;
10341
      }
10342
    }
10343
 
10344
    // isset id assignments
10345
 
10346
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
10347
    static {
10348
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10349
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10350
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
10351
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
10352
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10353
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
10354
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10355
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCodes_result.class, metaDataMap);
10356
    }
10357
 
10358
    public getActiveCodes_result() {
10359
    }
10360
 
10361
    public getActiveCodes_result(
10362
      List<Coupon> success,
10363
      PromotionException pex)
10364
    {
10365
      this();
10366
      this.success = success;
10367
      this.pex = pex;
10368
    }
10369
 
10370
    /**
10371
     * Performs a deep copy on <i>other</i>.
10372
     */
10373
    public getActiveCodes_result(getActiveCodes_result other) {
10374
      if (other.isSetSuccess()) {
10375
        List<Coupon> __this__success = new ArrayList<Coupon>();
10376
        for (Coupon other_element : other.success) {
10377
          __this__success.add(new Coupon(other_element));
10378
        }
10379
        this.success = __this__success;
10380
      }
10381
      if (other.isSetPex()) {
10382
        this.pex = new PromotionException(other.pex);
10383
      }
10384
    }
10385
 
10386
    public getActiveCodes_result deepCopy() {
10387
      return new getActiveCodes_result(this);
10388
    }
10389
 
10390
    @Override
10391
    public void clear() {
10392
      this.success = null;
10393
      this.pex = null;
10394
    }
10395
 
10396
    public int getSuccessSize() {
10397
      return (this.success == null) ? 0 : this.success.size();
10398
    }
10399
 
10400
    public java.util.Iterator<Coupon> getSuccessIterator() {
10401
      return (this.success == null) ? null : this.success.iterator();
10402
    }
10403
 
10404
    public void addToSuccess(Coupon elem) {
10405
      if (this.success == null) {
10406
        this.success = new ArrayList<Coupon>();
10407
      }
10408
      this.success.add(elem);
10409
    }
10410
 
10411
    public List<Coupon> getSuccess() {
10412
      return this.success;
10413
    }
10414
 
10415
    public void setSuccess(List<Coupon> success) {
10416
      this.success = success;
10417
    }
10418
 
10419
    public void unsetSuccess() {
10420
      this.success = null;
10421
    }
10422
 
10423
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
10424
    public boolean isSetSuccess() {
10425
      return this.success != null;
10426
    }
10427
 
10428
    public void setSuccessIsSet(boolean value) {
10429
      if (!value) {
10430
        this.success = null;
10431
      }
10432
    }
10433
 
10434
    public PromotionException getPex() {
10435
      return this.pex;
10436
    }
10437
 
10438
    public void setPex(PromotionException pex) {
10439
      this.pex = pex;
10440
    }
10441
 
10442
    public void unsetPex() {
10443
      this.pex = null;
10444
    }
10445
 
10446
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
10447
    public boolean isSetPex() {
10448
      return this.pex != null;
10449
    }
10450
 
10451
    public void setPexIsSet(boolean value) {
10452
      if (!value) {
10453
        this.pex = null;
10454
      }
10455
    }
10456
 
10457
    public void setFieldValue(_Fields field, Object value) {
10458
      switch (field) {
10459
      case SUCCESS:
10460
        if (value == null) {
10461
          unsetSuccess();
10462
        } else {
10463
          setSuccess((List<Coupon>)value);
10464
        }
10465
        break;
10466
 
10467
      case PEX:
10468
        if (value == null) {
10469
          unsetPex();
10470
        } else {
10471
          setPex((PromotionException)value);
10472
        }
10473
        break;
10474
 
10475
      }
10476
    }
10477
 
10478
    public Object getFieldValue(_Fields field) {
10479
      switch (field) {
10480
      case SUCCESS:
10481
        return getSuccess();
10482
 
10483
      case PEX:
10484
        return getPex();
10485
 
10486
      }
10487
      throw new IllegalStateException();
10488
    }
10489
 
10490
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10491
    public boolean isSet(_Fields field) {
10492
      if (field == null) {
10493
        throw new IllegalArgumentException();
10494
      }
10495
 
10496
      switch (field) {
10497
      case SUCCESS:
10498
        return isSetSuccess();
10499
      case PEX:
10500
        return isSetPex();
10501
      }
10502
      throw new IllegalStateException();
10503
    }
10504
 
10505
    @Override
10506
    public boolean equals(Object that) {
10507
      if (that == null)
10508
        return false;
10509
      if (that instanceof getActiveCodes_result)
10510
        return this.equals((getActiveCodes_result)that);
10511
      return false;
10512
    }
10513
 
10514
    public boolean equals(getActiveCodes_result that) {
10515
      if (that == null)
10516
        return false;
10517
 
10518
      boolean this_present_success = true && this.isSetSuccess();
10519
      boolean that_present_success = true && that.isSetSuccess();
10520
      if (this_present_success || that_present_success) {
10521
        if (!(this_present_success && that_present_success))
10522
          return false;
10523
        if (!this.success.equals(that.success))
10524
          return false;
10525
      }
10526
 
10527
      boolean this_present_pex = true && this.isSetPex();
10528
      boolean that_present_pex = true && that.isSetPex();
10529
      if (this_present_pex || that_present_pex) {
10530
        if (!(this_present_pex && that_present_pex))
10531
          return false;
10532
        if (!this.pex.equals(that.pex))
10533
          return false;
10534
      }
10535
 
10536
      return true;
10537
    }
10538
 
10539
    @Override
10540
    public int hashCode() {
10541
      return 0;
10542
    }
10543
 
10544
    public int compareTo(getActiveCodes_result other) {
10545
      if (!getClass().equals(other.getClass())) {
10546
        return getClass().getName().compareTo(other.getClass().getName());
10547
      }
10548
 
10549
      int lastComparison = 0;
10550
      getActiveCodes_result typedOther = (getActiveCodes_result)other;
10551
 
10552
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
10553
      if (lastComparison != 0) {
10554
        return lastComparison;
10555
      }
10556
      if (isSetSuccess()) {
10557
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
10558
        if (lastComparison != 0) {
10559
          return lastComparison;
10560
        }
10561
      }
10562
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
10563
      if (lastComparison != 0) {
10564
        return lastComparison;
10565
      }
10566
      if (isSetPex()) {
10567
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
10568
        if (lastComparison != 0) {
10569
          return lastComparison;
10570
        }
10571
      }
10572
      return 0;
10573
    }
10574
 
10575
    public _Fields fieldForId(int fieldId) {
10576
      return _Fields.findByThriftId(fieldId);
10577
    }
10578
 
10579
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10580
      org.apache.thrift.protocol.TField field;
10581
      iprot.readStructBegin();
10582
      while (true)
10583
      {
10584
        field = iprot.readFieldBegin();
10585
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
10586
          break;
10587
        }
10588
        switch (field.id) {
10589
          case 0: // SUCCESS
10590
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
10591
              {
10592
                org.apache.thrift.protocol.TList _list21 = iprot.readListBegin();
10593
                this.success = new ArrayList<Coupon>(_list21.size);
10594
                for (int _i22 = 0; _i22 < _list21.size; ++_i22)
10595
                {
10596
                  Coupon _elem23; // required
10597
                  _elem23 = new Coupon();
10598
                  _elem23.read(iprot);
10599
                  this.success.add(_elem23);
10600
                }
10601
                iprot.readListEnd();
10602
              }
10603
            } else { 
10604
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10605
            }
10606
            break;
10607
          case 1: // PEX
10608
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
10609
              this.pex = new PromotionException();
10610
              this.pex.read(iprot);
10611
            } else { 
10612
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10613
            }
10614
            break;
10615
          default:
10616
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10617
        }
10618
        iprot.readFieldEnd();
10619
      }
10620
      iprot.readStructEnd();
10621
      validate();
10622
    }
10623
 
10624
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
10625
      oprot.writeStructBegin(STRUCT_DESC);
10626
 
10627
      if (this.isSetSuccess()) {
10628
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
10629
        {
10630
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
10631
          for (Coupon _iter24 : this.success)
10632
          {
10633
            _iter24.write(oprot);
10634
          }
10635
          oprot.writeListEnd();
10636
        }
10637
        oprot.writeFieldEnd();
10638
      } else if (this.isSetPex()) {
10639
        oprot.writeFieldBegin(PEX_FIELD_DESC);
10640
        this.pex.write(oprot);
10641
        oprot.writeFieldEnd();
10642
      }
10643
      oprot.writeFieldStop();
10644
      oprot.writeStructEnd();
10645
    }
10646
 
10647
    @Override
10648
    public String toString() {
10649
      StringBuilder sb = new StringBuilder("getActiveCodes_result(");
10650
      boolean first = true;
10651
 
10652
      sb.append("success:");
10653
      if (this.success == null) {
10654
        sb.append("null");
10655
      } else {
10656
        sb.append(this.success);
10657
      }
10658
      first = false;
10659
      if (!first) sb.append(", ");
10660
      sb.append("pex:");
10661
      if (this.pex == null) {
10662
        sb.append("null");
10663
      } else {
10664
        sb.append(this.pex);
10665
      }
10666
      first = false;
10667
      sb.append(")");
10668
      return sb.toString();
10669
    }
10670
 
10671
    public void validate() throws org.apache.thrift.TException {
10672
      // check for required fields
10673
    }
10674
 
10675
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10676
      try {
10677
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10678
      } catch (org.apache.thrift.TException te) {
10679
        throw new java.io.IOException(te);
10680
      }
10681
    }
10682
 
10683
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10684
      try {
10685
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10686
      } catch (org.apache.thrift.TException te) {
10687
        throw new java.io.IOException(te);
10688
      }
10689
    }
10690
 
10691
  }
10692
 
10693
  public static class deleteCoupon_args implements org.apache.thrift.TBase<deleteCoupon_args, deleteCoupon_args._Fields>, java.io.Serializable, Cloneable   {
10694
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteCoupon_args");
10695
 
10696
    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);
10697
 
10698
    private String couponCode; // required
10699
 
10700
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
10701
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
10702
      COUPON_CODE((short)1, "couponCode");
10703
 
10704
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10705
 
10706
      static {
10707
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10708
          byName.put(field.getFieldName(), field);
10709
        }
10710
      }
10711
 
10712
      /**
10713
       * Find the _Fields constant that matches fieldId, or null if its not found.
10714
       */
10715
      public static _Fields findByThriftId(int fieldId) {
10716
        switch(fieldId) {
10717
          case 1: // COUPON_CODE
10718
            return COUPON_CODE;
10719
          default:
10720
            return null;
10721
        }
10722
      }
10723
 
10724
      /**
10725
       * Find the _Fields constant that matches fieldId, throwing an exception
10726
       * if it is not found.
10727
       */
10728
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10729
        _Fields fields = findByThriftId(fieldId);
10730
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10731
        return fields;
10732
      }
10733
 
10734
      /**
10735
       * Find the _Fields constant that matches name, or null if its not found.
10736
       */
10737
      public static _Fields findByName(String name) {
10738
        return byName.get(name);
10739
      }
10740
 
10741
      private final short _thriftId;
10742
      private final String _fieldName;
10743
 
10744
      _Fields(short thriftId, String fieldName) {
10745
        _thriftId = thriftId;
10746
        _fieldName = fieldName;
10747
      }
10748
 
10749
      public short getThriftFieldId() {
10750
        return _thriftId;
10751
      }
10752
 
10753
      public String getFieldName() {
10754
        return _fieldName;
10755
      }
10756
    }
10757
 
10758
    // isset id assignments
10759
 
10760
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
10761
    static {
10762
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10763
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10764
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
10765
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10766
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteCoupon_args.class, metaDataMap);
10767
    }
10768
 
10769
    public deleteCoupon_args() {
10770
    }
10771
 
10772
    public deleteCoupon_args(
10773
      String couponCode)
10774
    {
10775
      this();
10776
      this.couponCode = couponCode;
10777
    }
10778
 
10779
    /**
10780
     * Performs a deep copy on <i>other</i>.
10781
     */
10782
    public deleteCoupon_args(deleteCoupon_args other) {
10783
      if (other.isSetCouponCode()) {
10784
        this.couponCode = other.couponCode;
10785
      }
10786
    }
10787
 
10788
    public deleteCoupon_args deepCopy() {
10789
      return new deleteCoupon_args(this);
10790
    }
10791
 
10792
    @Override
10793
    public void clear() {
10794
      this.couponCode = null;
10795
    }
10796
 
10797
    public String getCouponCode() {
10798
      return this.couponCode;
10799
    }
10800
 
10801
    public void setCouponCode(String couponCode) {
10802
      this.couponCode = couponCode;
10803
    }
10804
 
10805
    public void unsetCouponCode() {
10806
      this.couponCode = null;
10807
    }
10808
 
10809
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
10810
    public boolean isSetCouponCode() {
10811
      return this.couponCode != null;
10812
    }
10813
 
10814
    public void setCouponCodeIsSet(boolean value) {
10815
      if (!value) {
10816
        this.couponCode = null;
10817
      }
10818
    }
10819
 
10820
    public void setFieldValue(_Fields field, Object value) {
10821
      switch (field) {
10822
      case COUPON_CODE:
10823
        if (value == null) {
10824
          unsetCouponCode();
10825
        } else {
10826
          setCouponCode((String)value);
10827
        }
10828
        break;
10829
 
10830
      }
10831
    }
10832
 
10833
    public Object getFieldValue(_Fields field) {
10834
      switch (field) {
10835
      case COUPON_CODE:
10836
        return getCouponCode();
10837
 
10838
      }
10839
      throw new IllegalStateException();
10840
    }
10841
 
10842
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10843
    public boolean isSet(_Fields field) {
10844
      if (field == null) {
10845
        throw new IllegalArgumentException();
10846
      }
10847
 
10848
      switch (field) {
10849
      case COUPON_CODE:
10850
        return isSetCouponCode();
10851
      }
10852
      throw new IllegalStateException();
10853
    }
10854
 
10855
    @Override
10856
    public boolean equals(Object that) {
10857
      if (that == null)
10858
        return false;
10859
      if (that instanceof deleteCoupon_args)
10860
        return this.equals((deleteCoupon_args)that);
10861
      return false;
10862
    }
10863
 
10864
    public boolean equals(deleteCoupon_args that) {
10865
      if (that == null)
10866
        return false;
10867
 
10868
      boolean this_present_couponCode = true && this.isSetCouponCode();
10869
      boolean that_present_couponCode = true && that.isSetCouponCode();
10870
      if (this_present_couponCode || that_present_couponCode) {
10871
        if (!(this_present_couponCode && that_present_couponCode))
10872
          return false;
10873
        if (!this.couponCode.equals(that.couponCode))
10874
          return false;
10875
      }
10876
 
10877
      return true;
10878
    }
10879
 
10880
    @Override
10881
    public int hashCode() {
10882
      return 0;
10883
    }
10884
 
10885
    public int compareTo(deleteCoupon_args other) {
10886
      if (!getClass().equals(other.getClass())) {
10887
        return getClass().getName().compareTo(other.getClass().getName());
10888
      }
10889
 
10890
      int lastComparison = 0;
10891
      deleteCoupon_args typedOther = (deleteCoupon_args)other;
10892
 
10893
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
10894
      if (lastComparison != 0) {
10895
        return lastComparison;
10896
      }
10897
      if (isSetCouponCode()) {
10898
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
10899
        if (lastComparison != 0) {
10900
          return lastComparison;
10901
        }
10902
      }
10903
      return 0;
10904
    }
10905
 
10906
    public _Fields fieldForId(int fieldId) {
10907
      return _Fields.findByThriftId(fieldId);
10908
    }
10909
 
10910
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10911
      org.apache.thrift.protocol.TField field;
10912
      iprot.readStructBegin();
10913
      while (true)
10914
      {
10915
        field = iprot.readFieldBegin();
10916
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
10917
          break;
10918
        }
10919
        switch (field.id) {
10920
          case 1: // COUPON_CODE
10921
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
10922
              this.couponCode = iprot.readString();
10923
            } else { 
10924
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10925
            }
10926
            break;
10927
          default:
10928
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10929
        }
10930
        iprot.readFieldEnd();
10931
      }
10932
      iprot.readStructEnd();
10933
      validate();
10934
    }
10935
 
10936
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
10937
      validate();
10938
 
10939
      oprot.writeStructBegin(STRUCT_DESC);
10940
      if (this.couponCode != null) {
10941
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
10942
        oprot.writeString(this.couponCode);
10943
        oprot.writeFieldEnd();
10944
      }
10945
      oprot.writeFieldStop();
10946
      oprot.writeStructEnd();
10947
    }
10948
 
10949
    @Override
10950
    public String toString() {
10951
      StringBuilder sb = new StringBuilder("deleteCoupon_args(");
10952
      boolean first = true;
10953
 
10954
      sb.append("couponCode:");
10955
      if (this.couponCode == null) {
10956
        sb.append("null");
10957
      } else {
10958
        sb.append(this.couponCode);
10959
      }
10960
      first = false;
10961
      sb.append(")");
10962
      return sb.toString();
10963
    }
10964
 
10965
    public void validate() throws org.apache.thrift.TException {
10966
      // check for required fields
10967
    }
10968
 
10969
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10970
      try {
10971
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10972
      } catch (org.apache.thrift.TException te) {
10973
        throw new java.io.IOException(te);
10974
      }
10975
    }
10976
 
10977
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10978
      try {
10979
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10980
      } catch (org.apache.thrift.TException te) {
10981
        throw new java.io.IOException(te);
10982
      }
10983
    }
10984
 
10985
  }
10986
 
10987
  public static class deleteCoupon_result implements org.apache.thrift.TBase<deleteCoupon_result, deleteCoupon_result._Fields>, java.io.Serializable, Cloneable   {
10988
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteCoupon_result");
10989
 
10990
    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);
10991
 
10992
    private PromotionException pex; // required
10993
 
10994
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
10995
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
10996
      PEX((short)1, "pex");
10997
 
10998
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10999
 
11000
      static {
11001
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11002
          byName.put(field.getFieldName(), field);
11003
        }
11004
      }
11005
 
11006
      /**
11007
       * Find the _Fields constant that matches fieldId, or null if its not found.
11008
       */
11009
      public static _Fields findByThriftId(int fieldId) {
11010
        switch(fieldId) {
11011
          case 1: // PEX
11012
            return PEX;
11013
          default:
11014
            return null;
11015
        }
11016
      }
11017
 
11018
      /**
11019
       * Find the _Fields constant that matches fieldId, throwing an exception
11020
       * if it is not found.
11021
       */
11022
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11023
        _Fields fields = findByThriftId(fieldId);
11024
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11025
        return fields;
11026
      }
11027
 
11028
      /**
11029
       * Find the _Fields constant that matches name, or null if its not found.
11030
       */
11031
      public static _Fields findByName(String name) {
11032
        return byName.get(name);
11033
      }
11034
 
11035
      private final short _thriftId;
11036
      private final String _fieldName;
11037
 
11038
      _Fields(short thriftId, String fieldName) {
11039
        _thriftId = thriftId;
11040
        _fieldName = fieldName;
11041
      }
11042
 
11043
      public short getThriftFieldId() {
11044
        return _thriftId;
11045
      }
11046
 
11047
      public String getFieldName() {
11048
        return _fieldName;
11049
      }
11050
    }
11051
 
11052
    // isset id assignments
11053
 
11054
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
11055
    static {
11056
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11057
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11058
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
11059
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11060
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteCoupon_result.class, metaDataMap);
11061
    }
11062
 
11063
    public deleteCoupon_result() {
11064
    }
11065
 
11066
    public deleteCoupon_result(
11067
      PromotionException pex)
11068
    {
11069
      this();
11070
      this.pex = pex;
11071
    }
11072
 
11073
    /**
11074
     * Performs a deep copy on <i>other</i>.
11075
     */
11076
    public deleteCoupon_result(deleteCoupon_result other) {
11077
      if (other.isSetPex()) {
11078
        this.pex = new PromotionException(other.pex);
11079
      }
11080
    }
11081
 
11082
    public deleteCoupon_result deepCopy() {
11083
      return new deleteCoupon_result(this);
11084
    }
11085
 
11086
    @Override
11087
    public void clear() {
11088
      this.pex = null;
11089
    }
11090
 
11091
    public PromotionException getPex() {
11092
      return this.pex;
11093
    }
11094
 
11095
    public void setPex(PromotionException pex) {
11096
      this.pex = pex;
11097
    }
11098
 
11099
    public void unsetPex() {
11100
      this.pex = null;
11101
    }
11102
 
11103
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
11104
    public boolean isSetPex() {
11105
      return this.pex != null;
11106
    }
11107
 
11108
    public void setPexIsSet(boolean value) {
11109
      if (!value) {
11110
        this.pex = null;
11111
      }
11112
    }
11113
 
11114
    public void setFieldValue(_Fields field, Object value) {
11115
      switch (field) {
11116
      case PEX:
11117
        if (value == null) {
11118
          unsetPex();
11119
        } else {
11120
          setPex((PromotionException)value);
11121
        }
11122
        break;
11123
 
11124
      }
11125
    }
11126
 
11127
    public Object getFieldValue(_Fields field) {
11128
      switch (field) {
11129
      case PEX:
11130
        return getPex();
11131
 
11132
      }
11133
      throw new IllegalStateException();
11134
    }
11135
 
11136
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11137
    public boolean isSet(_Fields field) {
11138
      if (field == null) {
11139
        throw new IllegalArgumentException();
11140
      }
11141
 
11142
      switch (field) {
11143
      case PEX:
11144
        return isSetPex();
11145
      }
11146
      throw new IllegalStateException();
11147
    }
11148
 
11149
    @Override
11150
    public boolean equals(Object that) {
11151
      if (that == null)
11152
        return false;
11153
      if (that instanceof deleteCoupon_result)
11154
        return this.equals((deleteCoupon_result)that);
11155
      return false;
11156
    }
11157
 
11158
    public boolean equals(deleteCoupon_result that) {
11159
      if (that == null)
11160
        return false;
11161
 
11162
      boolean this_present_pex = true && this.isSetPex();
11163
      boolean that_present_pex = true && that.isSetPex();
11164
      if (this_present_pex || that_present_pex) {
11165
        if (!(this_present_pex && that_present_pex))
11166
          return false;
11167
        if (!this.pex.equals(that.pex))
11168
          return false;
11169
      }
11170
 
11171
      return true;
11172
    }
11173
 
11174
    @Override
11175
    public int hashCode() {
11176
      return 0;
11177
    }
11178
 
11179
    public int compareTo(deleteCoupon_result other) {
11180
      if (!getClass().equals(other.getClass())) {
11181
        return getClass().getName().compareTo(other.getClass().getName());
11182
      }
11183
 
11184
      int lastComparison = 0;
11185
      deleteCoupon_result typedOther = (deleteCoupon_result)other;
11186
 
11187
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
11188
      if (lastComparison != 0) {
11189
        return lastComparison;
11190
      }
11191
      if (isSetPex()) {
11192
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
11193
        if (lastComparison != 0) {
11194
          return lastComparison;
11195
        }
11196
      }
11197
      return 0;
11198
    }
11199
 
11200
    public _Fields fieldForId(int fieldId) {
11201
      return _Fields.findByThriftId(fieldId);
11202
    }
11203
 
11204
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11205
      org.apache.thrift.protocol.TField field;
11206
      iprot.readStructBegin();
11207
      while (true)
11208
      {
11209
        field = iprot.readFieldBegin();
11210
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
11211
          break;
11212
        }
11213
        switch (field.id) {
11214
          case 1: // PEX
11215
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
11216
              this.pex = new PromotionException();
11217
              this.pex.read(iprot);
11218
            } else { 
11219
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11220
            }
11221
            break;
11222
          default:
11223
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11224
        }
11225
        iprot.readFieldEnd();
11226
      }
11227
      iprot.readStructEnd();
11228
      validate();
11229
    }
11230
 
11231
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
11232
      oprot.writeStructBegin(STRUCT_DESC);
11233
 
11234
      if (this.isSetPex()) {
11235
        oprot.writeFieldBegin(PEX_FIELD_DESC);
11236
        this.pex.write(oprot);
11237
        oprot.writeFieldEnd();
11238
      }
11239
      oprot.writeFieldStop();
11240
      oprot.writeStructEnd();
11241
    }
11242
 
11243
    @Override
11244
    public String toString() {
11245
      StringBuilder sb = new StringBuilder("deleteCoupon_result(");
11246
      boolean first = true;
11247
 
11248
      sb.append("pex:");
11249
      if (this.pex == null) {
11250
        sb.append("null");
11251
      } else {
11252
        sb.append(this.pex);
11253
      }
11254
      first = false;
11255
      sb.append(")");
11256
      return sb.toString();
11257
    }
11258
 
11259
    public void validate() throws org.apache.thrift.TException {
11260
      // check for required fields
11261
    }
11262
 
11263
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11264
      try {
11265
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11266
      } catch (org.apache.thrift.TException te) {
11267
        throw new java.io.IOException(te);
11268
      }
11269
    }
11270
 
11271
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11272
      try {
11273
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11274
      } catch (org.apache.thrift.TException te) {
11275
        throw new java.io.IOException(te);
11276
      }
11277
    }
11278
 
11279
  }
11280
 
3430 rajveer 11281
  public static class getActiveCoupons_args implements org.apache.thrift.TBase<getActiveCoupons_args, getActiveCoupons_args._Fields>, java.io.Serializable, Cloneable   {
11282
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_args");
3385 varun.gupt 11283
 
11284
 
11285
 
11286
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 11287
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 11288
;
11289
 
11290
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11291
 
11292
      static {
11293
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11294
          byName.put(field.getFieldName(), field);
11295
        }
11296
      }
11297
 
11298
      /**
11299
       * Find the _Fields constant that matches fieldId, or null if its not found.
11300
       */
11301
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 11302
        switch(fieldId) {
11303
          default:
11304
            return null;
11305
        }
3385 varun.gupt 11306
      }
11307
 
11308
      /**
11309
       * Find the _Fields constant that matches fieldId, throwing an exception
11310
       * if it is not found.
11311
       */
11312
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11313
        _Fields fields = findByThriftId(fieldId);
11314
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11315
        return fields;
11316
      }
11317
 
11318
      /**
11319
       * Find the _Fields constant that matches name, or null if its not found.
11320
       */
11321
      public static _Fields findByName(String name) {
11322
        return byName.get(name);
11323
      }
11324
 
11325
      private final short _thriftId;
11326
      private final String _fieldName;
11327
 
11328
      _Fields(short thriftId, String fieldName) {
11329
        _thriftId = thriftId;
11330
        _fieldName = fieldName;
11331
      }
11332
 
11333
      public short getThriftFieldId() {
11334
        return _thriftId;
11335
      }
11336
 
11337
      public String getFieldName() {
11338
        return _fieldName;
11339
      }
11340
    }
3430 rajveer 11341
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 11342
    static {
3430 rajveer 11343
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11344
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11345
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_args.class, metaDataMap);
3385 varun.gupt 11346
    }
11347
 
11348
    public getActiveCoupons_args() {
11349
    }
11350
 
11351
    /**
11352
     * Performs a deep copy on <i>other</i>.
11353
     */
11354
    public getActiveCoupons_args(getActiveCoupons_args other) {
11355
    }
11356
 
11357
    public getActiveCoupons_args deepCopy() {
11358
      return new getActiveCoupons_args(this);
11359
    }
11360
 
3430 rajveer 11361
    @Override
11362
    public void clear() {
3385 varun.gupt 11363
    }
11364
 
11365
    public void setFieldValue(_Fields field, Object value) {
11366
      switch (field) {
11367
      }
11368
    }
11369
 
11370
    public Object getFieldValue(_Fields field) {
11371
      switch (field) {
11372
      }
11373
      throw new IllegalStateException();
11374
    }
11375
 
3430 rajveer 11376
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11377
    public boolean isSet(_Fields field) {
11378
      if (field == null) {
11379
        throw new IllegalArgumentException();
11380
      }
3385 varun.gupt 11381
 
11382
      switch (field) {
11383
      }
11384
      throw new IllegalStateException();
11385
    }
11386
 
11387
    @Override
11388
    public boolean equals(Object that) {
11389
      if (that == null)
11390
        return false;
11391
      if (that instanceof getActiveCoupons_args)
11392
        return this.equals((getActiveCoupons_args)that);
11393
      return false;
11394
    }
11395
 
11396
    public boolean equals(getActiveCoupons_args that) {
11397
      if (that == null)
11398
        return false;
11399
 
11400
      return true;
11401
    }
11402
 
11403
    @Override
11404
    public int hashCode() {
11405
      return 0;
11406
    }
11407
 
11408
    public int compareTo(getActiveCoupons_args other) {
11409
      if (!getClass().equals(other.getClass())) {
11410
        return getClass().getName().compareTo(other.getClass().getName());
11411
      }
11412
 
11413
      int lastComparison = 0;
11414
      getActiveCoupons_args typedOther = (getActiveCoupons_args)other;
11415
 
11416
      return 0;
11417
    }
11418
 
3430 rajveer 11419
    public _Fields fieldForId(int fieldId) {
11420
      return _Fields.findByThriftId(fieldId);
11421
    }
11422
 
11423
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11424
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 11425
      iprot.readStructBegin();
11426
      while (true)
11427
      {
11428
        field = iprot.readFieldBegin();
3430 rajveer 11429
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 11430
          break;
11431
        }
3430 rajveer 11432
        switch (field.id) {
11433
          default:
11434
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 11435
        }
3430 rajveer 11436
        iprot.readFieldEnd();
3385 varun.gupt 11437
      }
11438
      iprot.readStructEnd();
11439
      validate();
11440
    }
11441
 
3430 rajveer 11442
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 11443
      validate();
11444
 
11445
      oprot.writeStructBegin(STRUCT_DESC);
11446
      oprot.writeFieldStop();
11447
      oprot.writeStructEnd();
11448
    }
11449
 
11450
    @Override
11451
    public String toString() {
11452
      StringBuilder sb = new StringBuilder("getActiveCoupons_args(");
11453
      boolean first = true;
11454
 
11455
      sb.append(")");
11456
      return sb.toString();
11457
    }
11458
 
3430 rajveer 11459
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 11460
      // check for required fields
11461
    }
11462
 
3430 rajveer 11463
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11464
      try {
11465
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11466
      } catch (org.apache.thrift.TException te) {
11467
        throw new java.io.IOException(te);
11468
      }
11469
    }
11470
 
11471
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11472
      try {
11473
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11474
      } catch (org.apache.thrift.TException te) {
11475
        throw new java.io.IOException(te);
11476
      }
11477
    }
11478
 
3385 varun.gupt 11479
  }
11480
 
3430 rajveer 11481
  public static class getActiveCoupons_result implements org.apache.thrift.TBase<getActiveCoupons_result, getActiveCoupons_result._Fields>, java.io.Serializable, Cloneable   {
11482
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_result");
3385 varun.gupt 11483
 
3430 rajveer 11484
    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);
11485
    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 11486
 
3430 rajveer 11487
    private List<Coupon> success; // required
11488
    private PromotionException pex; // required
3385 varun.gupt 11489
 
11490
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 11491
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 11492
      SUCCESS((short)0, "success"),
11493
      PEX((short)1, "pex");
11494
 
11495
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11496
 
11497
      static {
11498
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11499
          byName.put(field.getFieldName(), field);
11500
        }
11501
      }
11502
 
11503
      /**
11504
       * Find the _Fields constant that matches fieldId, or null if its not found.
11505
       */
11506
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 11507
        switch(fieldId) {
11508
          case 0: // SUCCESS
11509
            return SUCCESS;
11510
          case 1: // PEX
11511
            return PEX;
11512
          default:
11513
            return null;
11514
        }
3385 varun.gupt 11515
      }
11516
 
11517
      /**
11518
       * Find the _Fields constant that matches fieldId, throwing an exception
11519
       * if it is not found.
11520
       */
11521
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11522
        _Fields fields = findByThriftId(fieldId);
11523
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11524
        return fields;
11525
      }
11526
 
11527
      /**
11528
       * Find the _Fields constant that matches name, or null if its not found.
11529
       */
11530
      public static _Fields findByName(String name) {
11531
        return byName.get(name);
11532
      }
11533
 
11534
      private final short _thriftId;
11535
      private final String _fieldName;
11536
 
11537
      _Fields(short thriftId, String fieldName) {
11538
        _thriftId = thriftId;
11539
        _fieldName = fieldName;
11540
      }
11541
 
11542
      public short getThriftFieldId() {
11543
        return _thriftId;
11544
      }
11545
 
11546
      public String getFieldName() {
11547
        return _fieldName;
11548
      }
11549
    }
11550
 
11551
    // isset id assignments
11552
 
3430 rajveer 11553
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 11554
    static {
3430 rajveer 11555
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11556
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11557
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
11558
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
11559
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11560
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
11561
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11562
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_result.class, metaDataMap);
3385 varun.gupt 11563
    }
11564
 
11565
    public getActiveCoupons_result() {
11566
    }
11567
 
11568
    public getActiveCoupons_result(
11569
      List<Coupon> success,
11570
      PromotionException pex)
11571
    {
11572
      this();
11573
      this.success = success;
11574
      this.pex = pex;
11575
    }
11576
 
11577
    /**
11578
     * Performs a deep copy on <i>other</i>.
11579
     */
11580
    public getActiveCoupons_result(getActiveCoupons_result other) {
11581
      if (other.isSetSuccess()) {
11582
        List<Coupon> __this__success = new ArrayList<Coupon>();
11583
        for (Coupon other_element : other.success) {
11584
          __this__success.add(new Coupon(other_element));
11585
        }
11586
        this.success = __this__success;
11587
      }
11588
      if (other.isSetPex()) {
11589
        this.pex = new PromotionException(other.pex);
11590
      }
11591
    }
11592
 
11593
    public getActiveCoupons_result deepCopy() {
11594
      return new getActiveCoupons_result(this);
11595
    }
11596
 
3430 rajveer 11597
    @Override
11598
    public void clear() {
11599
      this.success = null;
11600
      this.pex = null;
3385 varun.gupt 11601
    }
11602
 
11603
    public int getSuccessSize() {
11604
      return (this.success == null) ? 0 : this.success.size();
11605
    }
11606
 
11607
    public java.util.Iterator<Coupon> getSuccessIterator() {
11608
      return (this.success == null) ? null : this.success.iterator();
11609
    }
11610
 
11611
    public void addToSuccess(Coupon elem) {
11612
      if (this.success == null) {
11613
        this.success = new ArrayList<Coupon>();
11614
      }
11615
      this.success.add(elem);
11616
    }
11617
 
11618
    public List<Coupon> getSuccess() {
11619
      return this.success;
11620
    }
11621
 
3430 rajveer 11622
    public void setSuccess(List<Coupon> success) {
3385 varun.gupt 11623
      this.success = success;
11624
    }
11625
 
11626
    public void unsetSuccess() {
11627
      this.success = null;
11628
    }
11629
 
3430 rajveer 11630
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 11631
    public boolean isSetSuccess() {
11632
      return this.success != null;
11633
    }
11634
 
11635
    public void setSuccessIsSet(boolean value) {
11636
      if (!value) {
11637
        this.success = null;
11638
      }
11639
    }
11640
 
11641
    public PromotionException getPex() {
11642
      return this.pex;
11643
    }
11644
 
3430 rajveer 11645
    public void setPex(PromotionException pex) {
3385 varun.gupt 11646
      this.pex = pex;
11647
    }
11648
 
11649
    public void unsetPex() {
11650
      this.pex = null;
11651
    }
11652
 
3430 rajveer 11653
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 11654
    public boolean isSetPex() {
11655
      return this.pex != null;
11656
    }
11657
 
11658
    public void setPexIsSet(boolean value) {
11659
      if (!value) {
11660
        this.pex = null;
11661
      }
11662
    }
11663
 
11664
    public void setFieldValue(_Fields field, Object value) {
11665
      switch (field) {
11666
      case SUCCESS:
11667
        if (value == null) {
11668
          unsetSuccess();
11669
        } else {
11670
          setSuccess((List<Coupon>)value);
11671
        }
11672
        break;
11673
 
11674
      case PEX:
11675
        if (value == null) {
11676
          unsetPex();
11677
        } else {
11678
          setPex((PromotionException)value);
11679
        }
11680
        break;
11681
 
11682
      }
11683
    }
11684
 
11685
    public Object getFieldValue(_Fields field) {
11686
      switch (field) {
11687
      case SUCCESS:
11688
        return getSuccess();
11689
 
11690
      case PEX:
11691
        return getPex();
11692
 
11693
      }
11694
      throw new IllegalStateException();
11695
    }
11696
 
3430 rajveer 11697
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11698
    public boolean isSet(_Fields field) {
11699
      if (field == null) {
11700
        throw new IllegalArgumentException();
11701
      }
3385 varun.gupt 11702
 
11703
      switch (field) {
11704
      case SUCCESS:
11705
        return isSetSuccess();
11706
      case PEX:
11707
        return isSetPex();
11708
      }
11709
      throw new IllegalStateException();
11710
    }
11711
 
11712
    @Override
11713
    public boolean equals(Object that) {
11714
      if (that == null)
11715
        return false;
11716
      if (that instanceof getActiveCoupons_result)
11717
        return this.equals((getActiveCoupons_result)that);
11718
      return false;
11719
    }
11720
 
11721
    public boolean equals(getActiveCoupons_result that) {
11722
      if (that == null)
11723
        return false;
11724
 
11725
      boolean this_present_success = true && this.isSetSuccess();
11726
      boolean that_present_success = true && that.isSetSuccess();
11727
      if (this_present_success || that_present_success) {
11728
        if (!(this_present_success && that_present_success))
11729
          return false;
11730
        if (!this.success.equals(that.success))
11731
          return false;
11732
      }
11733
 
11734
      boolean this_present_pex = true && this.isSetPex();
11735
      boolean that_present_pex = true && that.isSetPex();
11736
      if (this_present_pex || that_present_pex) {
11737
        if (!(this_present_pex && that_present_pex))
11738
          return false;
11739
        if (!this.pex.equals(that.pex))
11740
          return false;
11741
      }
11742
 
11743
      return true;
11744
    }
11745
 
11746
    @Override
11747
    public int hashCode() {
11748
      return 0;
11749
    }
11750
 
11751
    public int compareTo(getActiveCoupons_result other) {
11752
      if (!getClass().equals(other.getClass())) {
11753
        return getClass().getName().compareTo(other.getClass().getName());
11754
      }
11755
 
11756
      int lastComparison = 0;
11757
      getActiveCoupons_result typedOther = (getActiveCoupons_result)other;
11758
 
3430 rajveer 11759
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 11760
      if (lastComparison != 0) {
11761
        return lastComparison;
11762
      }
3430 rajveer 11763
      if (isSetSuccess()) {
11764
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
11765
        if (lastComparison != 0) {
11766
          return lastComparison;
11767
        }
3385 varun.gupt 11768
      }
3430 rajveer 11769
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 11770
      if (lastComparison != 0) {
11771
        return lastComparison;
11772
      }
3430 rajveer 11773
      if (isSetPex()) {
11774
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
11775
        if (lastComparison != 0) {
11776
          return lastComparison;
11777
        }
3385 varun.gupt 11778
      }
11779
      return 0;
11780
    }
11781
 
3430 rajveer 11782
    public _Fields fieldForId(int fieldId) {
11783
      return _Fields.findByThriftId(fieldId);
11784
    }
11785
 
11786
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11787
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 11788
      iprot.readStructBegin();
11789
      while (true)
11790
      {
11791
        field = iprot.readFieldBegin();
3430 rajveer 11792
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 11793
          break;
11794
        }
3430 rajveer 11795
        switch (field.id) {
11796
          case 0: // SUCCESS
11797
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
11798
              {
6497 amit.gupta 11799
                org.apache.thrift.protocol.TList _list25 = iprot.readListBegin();
11800
                this.success = new ArrayList<Coupon>(_list25.size);
11801
                for (int _i26 = 0; _i26 < _list25.size; ++_i26)
3385 varun.gupt 11802
                {
6497 amit.gupta 11803
                  Coupon _elem27; // required
11804
                  _elem27 = new Coupon();
11805
                  _elem27.read(iprot);
11806
                  this.success.add(_elem27);
3385 varun.gupt 11807
                }
3430 rajveer 11808
                iprot.readListEnd();
3385 varun.gupt 11809
              }
3430 rajveer 11810
            } else { 
11811
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11812
            }
11813
            break;
11814
          case 1: // PEX
11815
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
11816
              this.pex = new PromotionException();
11817
              this.pex.read(iprot);
11818
            } else { 
11819
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11820
            }
11821
            break;
11822
          default:
11823
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 11824
        }
3430 rajveer 11825
        iprot.readFieldEnd();
3385 varun.gupt 11826
      }
11827
      iprot.readStructEnd();
11828
      validate();
11829
    }
11830
 
3430 rajveer 11831
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 11832
      oprot.writeStructBegin(STRUCT_DESC);
11833
 
11834
      if (this.isSetSuccess()) {
11835
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
11836
        {
3430 rajveer 11837
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
6497 amit.gupta 11838
          for (Coupon _iter28 : this.success)
3385 varun.gupt 11839
          {
6497 amit.gupta 11840
            _iter28.write(oprot);
3385 varun.gupt 11841
          }
11842
          oprot.writeListEnd();
11843
        }
11844
        oprot.writeFieldEnd();
11845
      } else if (this.isSetPex()) {
11846
        oprot.writeFieldBegin(PEX_FIELD_DESC);
11847
        this.pex.write(oprot);
11848
        oprot.writeFieldEnd();
11849
      }
11850
      oprot.writeFieldStop();
11851
      oprot.writeStructEnd();
11852
    }
11853
 
11854
    @Override
11855
    public String toString() {
11856
      StringBuilder sb = new StringBuilder("getActiveCoupons_result(");
11857
      boolean first = true;
11858
 
11859
      sb.append("success:");
11860
      if (this.success == null) {
11861
        sb.append("null");
11862
      } else {
11863
        sb.append(this.success);
11864
      }
11865
      first = false;
11866
      if (!first) sb.append(", ");
11867
      sb.append("pex:");
11868
      if (this.pex == null) {
11869
        sb.append("null");
11870
      } else {
11871
        sb.append(this.pex);
11872
      }
11873
      first = false;
11874
      sb.append(")");
11875
      return sb.toString();
11876
    }
11877
 
3430 rajveer 11878
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 11879
      // check for required fields
11880
    }
11881
 
3430 rajveer 11882
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11883
      try {
11884
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11885
      } catch (org.apache.thrift.TException te) {
11886
        throw new java.io.IOException(te);
11887
      }
11888
    }
11889
 
11890
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11891
      try {
11892
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11893
      } catch (org.apache.thrift.TException te) {
11894
        throw new java.io.IOException(te);
11895
      }
11896
    }
11897
 
3385 varun.gupt 11898
  }
11899
 
6250 amit.gupta 11900
  public static class createCoupon_args implements org.apache.thrift.TBase<createCoupon_args, createCoupon_args._Fields>, java.io.Serializable, Cloneable   {
11901
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_args");
11902
 
11903
    private static final org.apache.thrift.protocol.TField PROMOTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("promotionId", org.apache.thrift.protocol.TType.I64, (short)1);
6730 anupam.sin 11904
    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);
11905
    private static final org.apache.thrift.protocol.TField ARGUMENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("arguments", org.apache.thrift.protocol.TType.STRING, (short)3);
11906
    private static final org.apache.thrift.protocol.TField IS_COD_FIELD_DESC = new org.apache.thrift.protocol.TField("isCod", org.apache.thrift.protocol.TType.BOOL, (short)4);
11907
    private static final org.apache.thrift.protocol.TField PREFIX_FIELD_DESC = new org.apache.thrift.protocol.TField("prefix", org.apache.thrift.protocol.TType.STRING, (short)5);
6250 amit.gupta 11908
 
11909
    private long promotionId; // required
6730 anupam.sin 11910
    private String couponCode; // required
6679 anupam.sin 11911
    private String arguments; // required
6356 amit.gupta 11912
    private boolean isCod; // required
6561 amit.gupta 11913
    private String prefix; // required
6250 amit.gupta 11914
 
11915
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11916
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11917
      PROMOTION_ID((short)1, "promotionId"),
6730 anupam.sin 11918
      COUPON_CODE((short)2, "couponCode"),
11919
      ARGUMENTS((short)3, "arguments"),
11920
      IS_COD((short)4, "isCod"),
11921
      PREFIX((short)5, "prefix");
6250 amit.gupta 11922
 
11923
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11924
 
11925
      static {
11926
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11927
          byName.put(field.getFieldName(), field);
11928
        }
11929
      }
11930
 
11931
      /**
11932
       * Find the _Fields constant that matches fieldId, or null if its not found.
11933
       */
11934
      public static _Fields findByThriftId(int fieldId) {
11935
        switch(fieldId) {
11936
          case 1: // PROMOTION_ID
11937
            return PROMOTION_ID;
6730 anupam.sin 11938
          case 2: // COUPON_CODE
11939
            return COUPON_CODE;
11940
          case 3: // ARGUMENTS
6679 anupam.sin 11941
            return ARGUMENTS;
6730 anupam.sin 11942
          case 4: // IS_COD
6356 amit.gupta 11943
            return IS_COD;
6730 anupam.sin 11944
          case 5: // PREFIX
6561 amit.gupta 11945
            return PREFIX;
6250 amit.gupta 11946
          default:
11947
            return null;
11948
        }
11949
      }
11950
 
11951
      /**
11952
       * Find the _Fields constant that matches fieldId, throwing an exception
11953
       * if it is not found.
11954
       */
11955
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11956
        _Fields fields = findByThriftId(fieldId);
11957
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11958
        return fields;
11959
      }
11960
 
11961
      /**
11962
       * Find the _Fields constant that matches name, or null if its not found.
11963
       */
11964
      public static _Fields findByName(String name) {
11965
        return byName.get(name);
11966
      }
11967
 
11968
      private final short _thriftId;
11969
      private final String _fieldName;
11970
 
11971
      _Fields(short thriftId, String fieldName) {
11972
        _thriftId = thriftId;
11973
        _fieldName = fieldName;
11974
      }
11975
 
11976
      public short getThriftFieldId() {
11977
        return _thriftId;
11978
      }
11979
 
11980
      public String getFieldName() {
11981
        return _fieldName;
11982
      }
11983
    }
11984
 
11985
    // isset id assignments
11986
    private static final int __PROMOTIONID_ISSET_ID = 0;
6679 anupam.sin 11987
    private static final int __ISCOD_ISSET_ID = 1;
11988
    private BitSet __isset_bit_vector = new BitSet(2);
6250 amit.gupta 11989
 
11990
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
11991
    static {
11992
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11993
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11994
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6730 anupam.sin 11995
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11996
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6679 anupam.sin 11997
      tmpMap.put(_Fields.ARGUMENTS, new org.apache.thrift.meta_data.FieldMetaData("arguments", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6250 amit.gupta 11998
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6356 amit.gupta 11999
      tmpMap.put(_Fields.IS_COD, new org.apache.thrift.meta_data.FieldMetaData("isCod", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12000
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
6561 amit.gupta 12001
      tmpMap.put(_Fields.PREFIX, new org.apache.thrift.meta_data.FieldMetaData("prefix", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12002
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6250 amit.gupta 12003
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12004
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_args.class, metaDataMap);
12005
    }
12006
 
12007
    public createCoupon_args() {
12008
    }
12009
 
12010
    public createCoupon_args(
12011
      long promotionId,
6730 anupam.sin 12012
      String couponCode,
6679 anupam.sin 12013
      String arguments,
6356 amit.gupta 12014
      boolean isCod,
6561 amit.gupta 12015
      String prefix)
6250 amit.gupta 12016
    {
12017
      this();
12018
      this.promotionId = promotionId;
12019
      setPromotionIdIsSet(true);
6730 anupam.sin 12020
      this.couponCode = couponCode;
6679 anupam.sin 12021
      this.arguments = arguments;
6356 amit.gupta 12022
      this.isCod = isCod;
12023
      setIsCodIsSet(true);
6561 amit.gupta 12024
      this.prefix = prefix;
6250 amit.gupta 12025
    }
12026
 
12027
    /**
12028
     * Performs a deep copy on <i>other</i>.
12029
     */
12030
    public createCoupon_args(createCoupon_args other) {
12031
      __isset_bit_vector.clear();
12032
      __isset_bit_vector.or(other.__isset_bit_vector);
12033
      this.promotionId = other.promotionId;
6730 anupam.sin 12034
      if (other.isSetCouponCode()) {
12035
        this.couponCode = other.couponCode;
12036
      }
6679 anupam.sin 12037
      if (other.isSetArguments()) {
12038
        this.arguments = other.arguments;
6250 amit.gupta 12039
      }
6356 amit.gupta 12040
      this.isCod = other.isCod;
6561 amit.gupta 12041
      if (other.isSetPrefix()) {
12042
        this.prefix = other.prefix;
12043
      }
6250 amit.gupta 12044
    }
12045
 
12046
    public createCoupon_args deepCopy() {
12047
      return new createCoupon_args(this);
12048
    }
12049
 
12050
    @Override
12051
    public void clear() {
12052
      setPromotionIdIsSet(false);
12053
      this.promotionId = 0;
6730 anupam.sin 12054
      this.couponCode = null;
6679 anupam.sin 12055
      this.arguments = null;
6356 amit.gupta 12056
      setIsCodIsSet(false);
12057
      this.isCod = false;
6561 amit.gupta 12058
      this.prefix = null;
6250 amit.gupta 12059
    }
12060
 
12061
    public long getPromotionId() {
12062
      return this.promotionId;
12063
    }
12064
 
12065
    public void setPromotionId(long promotionId) {
12066
      this.promotionId = promotionId;
12067
      setPromotionIdIsSet(true);
12068
    }
12069
 
12070
    public void unsetPromotionId() {
12071
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
12072
    }
12073
 
12074
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
12075
    public boolean isSetPromotionId() {
12076
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
12077
    }
12078
 
12079
    public void setPromotionIdIsSet(boolean value) {
12080
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
12081
    }
12082
 
6730 anupam.sin 12083
    public String getCouponCode() {
12084
      return this.couponCode;
12085
    }
12086
 
12087
    public void setCouponCode(String couponCode) {
12088
      this.couponCode = couponCode;
12089
    }
12090
 
12091
    public void unsetCouponCode() {
12092
      this.couponCode = null;
12093
    }
12094
 
12095
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
12096
    public boolean isSetCouponCode() {
12097
      return this.couponCode != null;
12098
    }
12099
 
12100
    public void setCouponCodeIsSet(boolean value) {
12101
      if (!value) {
12102
        this.couponCode = null;
12103
      }
12104
    }
12105
 
6679 anupam.sin 12106
    public String getArguments() {
12107
      return this.arguments;
6250 amit.gupta 12108
    }
12109
 
6679 anupam.sin 12110
    public void setArguments(String arguments) {
12111
      this.arguments = arguments;
6250 amit.gupta 12112
    }
12113
 
6679 anupam.sin 12114
    public void unsetArguments() {
12115
      this.arguments = null;
6250 amit.gupta 12116
    }
12117
 
6679 anupam.sin 12118
    /** Returns true if field arguments is set (has been assigned a value) and false otherwise */
12119
    public boolean isSetArguments() {
12120
      return this.arguments != null;
6250 amit.gupta 12121
    }
12122
 
6679 anupam.sin 12123
    public void setArgumentsIsSet(boolean value) {
6250 amit.gupta 12124
      if (!value) {
6679 anupam.sin 12125
        this.arguments = null;
6250 amit.gupta 12126
      }
12127
    }
12128
 
6356 amit.gupta 12129
    public boolean isIsCod() {
12130
      return this.isCod;
12131
    }
12132
 
12133
    public void setIsCod(boolean isCod) {
12134
      this.isCod = isCod;
12135
      setIsCodIsSet(true);
12136
    }
12137
 
12138
    public void unsetIsCod() {
12139
      __isset_bit_vector.clear(__ISCOD_ISSET_ID);
12140
    }
12141
 
12142
    /** Returns true if field isCod is set (has been assigned a value) and false otherwise */
12143
    public boolean isSetIsCod() {
12144
      return __isset_bit_vector.get(__ISCOD_ISSET_ID);
12145
    }
12146
 
12147
    public void setIsCodIsSet(boolean value) {
12148
      __isset_bit_vector.set(__ISCOD_ISSET_ID, value);
12149
    }
12150
 
6561 amit.gupta 12151
    public String getPrefix() {
12152
      return this.prefix;
12153
    }
12154
 
12155
    public void setPrefix(String prefix) {
12156
      this.prefix = prefix;
12157
    }
12158
 
12159
    public void unsetPrefix() {
12160
      this.prefix = null;
12161
    }
12162
 
12163
    /** Returns true if field prefix is set (has been assigned a value) and false otherwise */
12164
    public boolean isSetPrefix() {
12165
      return this.prefix != null;
12166
    }
12167
 
12168
    public void setPrefixIsSet(boolean value) {
12169
      if (!value) {
12170
        this.prefix = null;
12171
      }
12172
    }
12173
 
6250 amit.gupta 12174
    public void setFieldValue(_Fields field, Object value) {
12175
      switch (field) {
12176
      case PROMOTION_ID:
12177
        if (value == null) {
12178
          unsetPromotionId();
12179
        } else {
12180
          setPromotionId((Long)value);
12181
        }
12182
        break;
12183
 
6730 anupam.sin 12184
      case COUPON_CODE:
12185
        if (value == null) {
12186
          unsetCouponCode();
12187
        } else {
12188
          setCouponCode((String)value);
12189
        }
12190
        break;
12191
 
6679 anupam.sin 12192
      case ARGUMENTS:
6250 amit.gupta 12193
        if (value == null) {
6679 anupam.sin 12194
          unsetArguments();
6250 amit.gupta 12195
        } else {
6679 anupam.sin 12196
          setArguments((String)value);
6250 amit.gupta 12197
        }
12198
        break;
12199
 
6356 amit.gupta 12200
      case IS_COD:
12201
        if (value == null) {
12202
          unsetIsCod();
12203
        } else {
12204
          setIsCod((Boolean)value);
12205
        }
12206
        break;
12207
 
6561 amit.gupta 12208
      case PREFIX:
12209
        if (value == null) {
12210
          unsetPrefix();
12211
        } else {
12212
          setPrefix((String)value);
12213
        }
12214
        break;
12215
 
6250 amit.gupta 12216
      }
12217
    }
12218
 
12219
    public Object getFieldValue(_Fields field) {
12220
      switch (field) {
12221
      case PROMOTION_ID:
12222
        return Long.valueOf(getPromotionId());
12223
 
6730 anupam.sin 12224
      case COUPON_CODE:
12225
        return getCouponCode();
12226
 
6679 anupam.sin 12227
      case ARGUMENTS:
12228
        return getArguments();
6250 amit.gupta 12229
 
6356 amit.gupta 12230
      case IS_COD:
12231
        return Boolean.valueOf(isIsCod());
12232
 
6561 amit.gupta 12233
      case PREFIX:
12234
        return getPrefix();
12235
 
6250 amit.gupta 12236
      }
12237
      throw new IllegalStateException();
12238
    }
12239
 
12240
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12241
    public boolean isSet(_Fields field) {
12242
      if (field == null) {
12243
        throw new IllegalArgumentException();
12244
      }
12245
 
12246
      switch (field) {
12247
      case PROMOTION_ID:
12248
        return isSetPromotionId();
6730 anupam.sin 12249
      case COUPON_CODE:
12250
        return isSetCouponCode();
6679 anupam.sin 12251
      case ARGUMENTS:
12252
        return isSetArguments();
6356 amit.gupta 12253
      case IS_COD:
12254
        return isSetIsCod();
6561 amit.gupta 12255
      case PREFIX:
12256
        return isSetPrefix();
6250 amit.gupta 12257
      }
12258
      throw new IllegalStateException();
12259
    }
12260
 
12261
    @Override
12262
    public boolean equals(Object that) {
12263
      if (that == null)
12264
        return false;
12265
      if (that instanceof createCoupon_args)
12266
        return this.equals((createCoupon_args)that);
12267
      return false;
12268
    }
12269
 
12270
    public boolean equals(createCoupon_args that) {
12271
      if (that == null)
12272
        return false;
12273
 
12274
      boolean this_present_promotionId = true;
12275
      boolean that_present_promotionId = true;
12276
      if (this_present_promotionId || that_present_promotionId) {
12277
        if (!(this_present_promotionId && that_present_promotionId))
12278
          return false;
12279
        if (this.promotionId != that.promotionId)
12280
          return false;
12281
      }
12282
 
6730 anupam.sin 12283
      boolean this_present_couponCode = true && this.isSetCouponCode();
12284
      boolean that_present_couponCode = true && that.isSetCouponCode();
12285
      if (this_present_couponCode || that_present_couponCode) {
12286
        if (!(this_present_couponCode && that_present_couponCode))
12287
          return false;
12288
        if (!this.couponCode.equals(that.couponCode))
12289
          return false;
12290
      }
12291
 
6679 anupam.sin 12292
      boolean this_present_arguments = true && this.isSetArguments();
12293
      boolean that_present_arguments = true && that.isSetArguments();
12294
      if (this_present_arguments || that_present_arguments) {
12295
        if (!(this_present_arguments && that_present_arguments))
6250 amit.gupta 12296
          return false;
6679 anupam.sin 12297
        if (!this.arguments.equals(that.arguments))
6250 amit.gupta 12298
          return false;
12299
      }
12300
 
6356 amit.gupta 12301
      boolean this_present_isCod = true;
12302
      boolean that_present_isCod = true;
12303
      if (this_present_isCod || that_present_isCod) {
12304
        if (!(this_present_isCod && that_present_isCod))
12305
          return false;
12306
        if (this.isCod != that.isCod)
12307
          return false;
12308
      }
12309
 
6561 amit.gupta 12310
      boolean this_present_prefix = true && this.isSetPrefix();
12311
      boolean that_present_prefix = true && that.isSetPrefix();
12312
      if (this_present_prefix || that_present_prefix) {
12313
        if (!(this_present_prefix && that_present_prefix))
12314
          return false;
12315
        if (!this.prefix.equals(that.prefix))
12316
          return false;
12317
      }
12318
 
6250 amit.gupta 12319
      return true;
12320
    }
12321
 
12322
    @Override
12323
    public int hashCode() {
12324
      return 0;
12325
    }
12326
 
12327
    public int compareTo(createCoupon_args other) {
12328
      if (!getClass().equals(other.getClass())) {
12329
        return getClass().getName().compareTo(other.getClass().getName());
12330
      }
12331
 
12332
      int lastComparison = 0;
12333
      createCoupon_args typedOther = (createCoupon_args)other;
12334
 
12335
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
12336
      if (lastComparison != 0) {
12337
        return lastComparison;
12338
      }
12339
      if (isSetPromotionId()) {
12340
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
12341
        if (lastComparison != 0) {
12342
          return lastComparison;
12343
        }
12344
      }
6730 anupam.sin 12345
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
12346
      if (lastComparison != 0) {
12347
        return lastComparison;
12348
      }
12349
      if (isSetCouponCode()) {
12350
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
12351
        if (lastComparison != 0) {
12352
          return lastComparison;
12353
        }
12354
      }
6679 anupam.sin 12355
      lastComparison = Boolean.valueOf(isSetArguments()).compareTo(typedOther.isSetArguments());
6250 amit.gupta 12356
      if (lastComparison != 0) {
12357
        return lastComparison;
12358
      }
6679 anupam.sin 12359
      if (isSetArguments()) {
12360
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.arguments, typedOther.arguments);
6250 amit.gupta 12361
        if (lastComparison != 0) {
12362
          return lastComparison;
12363
        }
12364
      }
6356 amit.gupta 12365
      lastComparison = Boolean.valueOf(isSetIsCod()).compareTo(typedOther.isSetIsCod());
12366
      if (lastComparison != 0) {
12367
        return lastComparison;
12368
      }
12369
      if (isSetIsCod()) {
12370
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isCod, typedOther.isCod);
12371
        if (lastComparison != 0) {
12372
          return lastComparison;
12373
        }
12374
      }
6561 amit.gupta 12375
      lastComparison = Boolean.valueOf(isSetPrefix()).compareTo(typedOther.isSetPrefix());
12376
      if (lastComparison != 0) {
12377
        return lastComparison;
12378
      }
12379
      if (isSetPrefix()) {
12380
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.prefix, typedOther.prefix);
12381
        if (lastComparison != 0) {
12382
          return lastComparison;
12383
        }
12384
      }
6250 amit.gupta 12385
      return 0;
12386
    }
12387
 
12388
    public _Fields fieldForId(int fieldId) {
12389
      return _Fields.findByThriftId(fieldId);
12390
    }
12391
 
12392
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12393
      org.apache.thrift.protocol.TField field;
12394
      iprot.readStructBegin();
12395
      while (true)
12396
      {
12397
        field = iprot.readFieldBegin();
12398
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12399
          break;
12400
        }
12401
        switch (field.id) {
12402
          case 1: // PROMOTION_ID
12403
            if (field.type == org.apache.thrift.protocol.TType.I64) {
12404
              this.promotionId = iprot.readI64();
12405
              setPromotionIdIsSet(true);
12406
            } else { 
12407
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12408
            }
12409
            break;
6730 anupam.sin 12410
          case 2: // COUPON_CODE
6250 amit.gupta 12411
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
6730 anupam.sin 12412
              this.couponCode = iprot.readString();
12413
            } else { 
12414
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12415
            }
12416
            break;
12417
          case 3: // ARGUMENTS
12418
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
6679 anupam.sin 12419
              this.arguments = iprot.readString();
6250 amit.gupta 12420
            } else { 
12421
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12422
            }
12423
            break;
6730 anupam.sin 12424
          case 4: // IS_COD
6356 amit.gupta 12425
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
12426
              this.isCod = iprot.readBool();
12427
              setIsCodIsSet(true);
12428
            } else { 
12429
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12430
            }
12431
            break;
6730 anupam.sin 12432
          case 5: // PREFIX
6561 amit.gupta 12433
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
12434
              this.prefix = iprot.readString();
12435
            } else { 
12436
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12437
            }
12438
            break;
6250 amit.gupta 12439
          default:
12440
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12441
        }
12442
        iprot.readFieldEnd();
12443
      }
12444
      iprot.readStructEnd();
12445
      validate();
12446
    }
12447
 
12448
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12449
      validate();
12450
 
12451
      oprot.writeStructBegin(STRUCT_DESC);
12452
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
12453
      oprot.writeI64(this.promotionId);
12454
      oprot.writeFieldEnd();
6730 anupam.sin 12455
      if (this.couponCode != null) {
12456
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
12457
        oprot.writeString(this.couponCode);
12458
        oprot.writeFieldEnd();
12459
      }
6679 anupam.sin 12460
      if (this.arguments != null) {
12461
        oprot.writeFieldBegin(ARGUMENTS_FIELD_DESC);
12462
        oprot.writeString(this.arguments);
6250 amit.gupta 12463
        oprot.writeFieldEnd();
12464
      }
6356 amit.gupta 12465
      oprot.writeFieldBegin(IS_COD_FIELD_DESC);
12466
      oprot.writeBool(this.isCod);
12467
      oprot.writeFieldEnd();
6561 amit.gupta 12468
      if (this.prefix != null) {
12469
        oprot.writeFieldBegin(PREFIX_FIELD_DESC);
12470
        oprot.writeString(this.prefix);
12471
        oprot.writeFieldEnd();
12472
      }
6250 amit.gupta 12473
      oprot.writeFieldStop();
12474
      oprot.writeStructEnd();
12475
    }
12476
 
12477
    @Override
12478
    public String toString() {
12479
      StringBuilder sb = new StringBuilder("createCoupon_args(");
12480
      boolean first = true;
12481
 
12482
      sb.append("promotionId:");
12483
      sb.append(this.promotionId);
12484
      first = false;
12485
      if (!first) sb.append(", ");
6730 anupam.sin 12486
      sb.append("couponCode:");
12487
      if (this.couponCode == null) {
12488
        sb.append("null");
12489
      } else {
12490
        sb.append(this.couponCode);
12491
      }
12492
      first = false;
12493
      if (!first) sb.append(", ");
6679 anupam.sin 12494
      sb.append("arguments:");
12495
      if (this.arguments == null) {
6250 amit.gupta 12496
        sb.append("null");
12497
      } else {
6679 anupam.sin 12498
        sb.append(this.arguments);
6250 amit.gupta 12499
      }
12500
      first = false;
12501
      if (!first) sb.append(", ");
6356 amit.gupta 12502
      sb.append("isCod:");
12503
      sb.append(this.isCod);
12504
      first = false;
12505
      if (!first) sb.append(", ");
6561 amit.gupta 12506
      sb.append("prefix:");
12507
      if (this.prefix == null) {
12508
        sb.append("null");
12509
      } else {
12510
        sb.append(this.prefix);
12511
      }
12512
      first = false;
6250 amit.gupta 12513
      sb.append(")");
12514
      return sb.toString();
12515
    }
12516
 
12517
    public void validate() throws org.apache.thrift.TException {
12518
      // check for required fields
12519
    }
12520
 
12521
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12522
      try {
12523
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12524
      } catch (org.apache.thrift.TException te) {
12525
        throw new java.io.IOException(te);
12526
      }
12527
    }
12528
 
12529
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12530
      try {
6561 amit.gupta 12531
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
12532
        __isset_bit_vector = new BitSet(1);
6250 amit.gupta 12533
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12534
      } catch (org.apache.thrift.TException te) {
12535
        throw new java.io.IOException(te);
12536
      }
12537
    }
12538
 
12539
  }
12540
 
12541
  public static class createCoupon_result implements org.apache.thrift.TBase<createCoupon_result, createCoupon_result._Fields>, java.io.Serializable, Cloneable   {
12542
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_result");
12543
 
12544
    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);
12545
    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);
12546
 
12547
    private String success; // required
12548
    private PromotionException pex; // required
12549
 
12550
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12551
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12552
      SUCCESS((short)0, "success"),
12553
      PEX((short)1, "pex");
12554
 
12555
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12556
 
12557
      static {
12558
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12559
          byName.put(field.getFieldName(), field);
12560
        }
12561
      }
12562
 
12563
      /**
12564
       * Find the _Fields constant that matches fieldId, or null if its not found.
12565
       */
12566
      public static _Fields findByThriftId(int fieldId) {
12567
        switch(fieldId) {
12568
          case 0: // SUCCESS
12569
            return SUCCESS;
12570
          case 1: // PEX
12571
            return PEX;
12572
          default:
12573
            return null;
12574
        }
12575
      }
12576
 
12577
      /**
12578
       * Find the _Fields constant that matches fieldId, throwing an exception
12579
       * if it is not found.
12580
       */
12581
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12582
        _Fields fields = findByThriftId(fieldId);
12583
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12584
        return fields;
12585
      }
12586
 
12587
      /**
12588
       * Find the _Fields constant that matches name, or null if its not found.
12589
       */
12590
      public static _Fields findByName(String name) {
12591
        return byName.get(name);
12592
      }
12593
 
12594
      private final short _thriftId;
12595
      private final String _fieldName;
12596
 
12597
      _Fields(short thriftId, String fieldName) {
12598
        _thriftId = thriftId;
12599
        _fieldName = fieldName;
12600
      }
12601
 
12602
      public short getThriftFieldId() {
12603
        return _thriftId;
12604
      }
12605
 
12606
      public String getFieldName() {
12607
        return _fieldName;
12608
      }
12609
    }
12610
 
12611
    // isset id assignments
12612
 
12613
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12614
    static {
12615
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12616
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12617
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
12618
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12619
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
12620
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12621
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_result.class, metaDataMap);
12622
    }
12623
 
12624
    public createCoupon_result() {
12625
    }
12626
 
12627
    public createCoupon_result(
12628
      String success,
12629
      PromotionException pex)
12630
    {
12631
      this();
12632
      this.success = success;
12633
      this.pex = pex;
12634
    }
12635
 
12636
    /**
12637
     * Performs a deep copy on <i>other</i>.
12638
     */
12639
    public createCoupon_result(createCoupon_result other) {
12640
      if (other.isSetSuccess()) {
12641
        this.success = other.success;
12642
      }
12643
      if (other.isSetPex()) {
12644
        this.pex = new PromotionException(other.pex);
12645
      }
12646
    }
12647
 
12648
    public createCoupon_result deepCopy() {
12649
      return new createCoupon_result(this);
12650
    }
12651
 
12652
    @Override
12653
    public void clear() {
12654
      this.success = null;
12655
      this.pex = null;
12656
    }
12657
 
12658
    public String getSuccess() {
12659
      return this.success;
12660
    }
12661
 
12662
    public void setSuccess(String success) {
12663
      this.success = success;
12664
    }
12665
 
12666
    public void unsetSuccess() {
12667
      this.success = null;
12668
    }
12669
 
12670
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
12671
    public boolean isSetSuccess() {
12672
      return this.success != null;
12673
    }
12674
 
12675
    public void setSuccessIsSet(boolean value) {
12676
      if (!value) {
12677
        this.success = null;
12678
      }
12679
    }
12680
 
12681
    public PromotionException getPex() {
12682
      return this.pex;
12683
    }
12684
 
12685
    public void setPex(PromotionException pex) {
12686
      this.pex = pex;
12687
    }
12688
 
12689
    public void unsetPex() {
12690
      this.pex = null;
12691
    }
12692
 
12693
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
12694
    public boolean isSetPex() {
12695
      return this.pex != null;
12696
    }
12697
 
12698
    public void setPexIsSet(boolean value) {
12699
      if (!value) {
12700
        this.pex = null;
12701
      }
12702
    }
12703
 
12704
    public void setFieldValue(_Fields field, Object value) {
12705
      switch (field) {
12706
      case SUCCESS:
12707
        if (value == null) {
12708
          unsetSuccess();
12709
        } else {
12710
          setSuccess((String)value);
12711
        }
12712
        break;
12713
 
12714
      case PEX:
12715
        if (value == null) {
12716
          unsetPex();
12717
        } else {
12718
          setPex((PromotionException)value);
12719
        }
12720
        break;
12721
 
12722
      }
12723
    }
12724
 
12725
    public Object getFieldValue(_Fields field) {
12726
      switch (field) {
12727
      case SUCCESS:
12728
        return getSuccess();
12729
 
12730
      case PEX:
12731
        return getPex();
12732
 
12733
      }
12734
      throw new IllegalStateException();
12735
    }
12736
 
12737
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12738
    public boolean isSet(_Fields field) {
12739
      if (field == null) {
12740
        throw new IllegalArgumentException();
12741
      }
12742
 
12743
      switch (field) {
12744
      case SUCCESS:
12745
        return isSetSuccess();
12746
      case PEX:
12747
        return isSetPex();
12748
      }
12749
      throw new IllegalStateException();
12750
    }
12751
 
12752
    @Override
12753
    public boolean equals(Object that) {
12754
      if (that == null)
12755
        return false;
12756
      if (that instanceof createCoupon_result)
12757
        return this.equals((createCoupon_result)that);
12758
      return false;
12759
    }
12760
 
12761
    public boolean equals(createCoupon_result that) {
12762
      if (that == null)
12763
        return false;
12764
 
12765
      boolean this_present_success = true && this.isSetSuccess();
12766
      boolean that_present_success = true && that.isSetSuccess();
12767
      if (this_present_success || that_present_success) {
12768
        if (!(this_present_success && that_present_success))
12769
          return false;
12770
        if (!this.success.equals(that.success))
12771
          return false;
12772
      }
12773
 
12774
      boolean this_present_pex = true && this.isSetPex();
12775
      boolean that_present_pex = true && that.isSetPex();
12776
      if (this_present_pex || that_present_pex) {
12777
        if (!(this_present_pex && that_present_pex))
12778
          return false;
12779
        if (!this.pex.equals(that.pex))
12780
          return false;
12781
      }
12782
 
12783
      return true;
12784
    }
12785
 
12786
    @Override
12787
    public int hashCode() {
12788
      return 0;
12789
    }
12790
 
12791
    public int compareTo(createCoupon_result other) {
12792
      if (!getClass().equals(other.getClass())) {
12793
        return getClass().getName().compareTo(other.getClass().getName());
12794
      }
12795
 
12796
      int lastComparison = 0;
12797
      createCoupon_result typedOther = (createCoupon_result)other;
12798
 
12799
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
12800
      if (lastComparison != 0) {
12801
        return lastComparison;
12802
      }
12803
      if (isSetSuccess()) {
12804
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
12805
        if (lastComparison != 0) {
12806
          return lastComparison;
12807
        }
12808
      }
12809
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
12810
      if (lastComparison != 0) {
12811
        return lastComparison;
12812
      }
12813
      if (isSetPex()) {
12814
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
12815
        if (lastComparison != 0) {
12816
          return lastComparison;
12817
        }
12818
      }
12819
      return 0;
12820
    }
12821
 
12822
    public _Fields fieldForId(int fieldId) {
12823
      return _Fields.findByThriftId(fieldId);
12824
    }
12825
 
12826
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12827
      org.apache.thrift.protocol.TField field;
12828
      iprot.readStructBegin();
12829
      while (true)
12830
      {
12831
        field = iprot.readFieldBegin();
12832
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12833
          break;
12834
        }
12835
        switch (field.id) {
12836
          case 0: // SUCCESS
12837
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
12838
              this.success = iprot.readString();
12839
            } else { 
12840
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12841
            }
12842
            break;
12843
          case 1: // PEX
12844
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
12845
              this.pex = new PromotionException();
12846
              this.pex.read(iprot);
12847
            } else { 
12848
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12849
            }
12850
            break;
12851
          default:
12852
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12853
        }
12854
        iprot.readFieldEnd();
12855
      }
12856
      iprot.readStructEnd();
12857
      validate();
12858
    }
12859
 
12860
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12861
      oprot.writeStructBegin(STRUCT_DESC);
12862
 
12863
      if (this.isSetSuccess()) {
12864
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
12865
        oprot.writeString(this.success);
12866
        oprot.writeFieldEnd();
12867
      } else if (this.isSetPex()) {
12868
        oprot.writeFieldBegin(PEX_FIELD_DESC);
12869
        this.pex.write(oprot);
12870
        oprot.writeFieldEnd();
12871
      }
12872
      oprot.writeFieldStop();
12873
      oprot.writeStructEnd();
12874
    }
12875
 
12876
    @Override
12877
    public String toString() {
12878
      StringBuilder sb = new StringBuilder("createCoupon_result(");
12879
      boolean first = true;
12880
 
12881
      sb.append("success:");
12882
      if (this.success == null) {
12883
        sb.append("null");
12884
      } else {
12885
        sb.append(this.success);
12886
      }
12887
      first = false;
12888
      if (!first) sb.append(", ");
12889
      sb.append("pex:");
12890
      if (this.pex == null) {
12891
        sb.append("null");
12892
      } else {
12893
        sb.append(this.pex);
12894
      }
12895
      first = false;
12896
      sb.append(")");
12897
      return sb.toString();
12898
    }
12899
 
12900
    public void validate() throws org.apache.thrift.TException {
12901
      // check for required fields
12902
    }
12903
 
12904
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12905
      try {
12906
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12907
      } catch (org.apache.thrift.TException te) {
12908
        throw new java.io.IOException(te);
12909
      }
12910
    }
12911
 
12912
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12913
      try {
12914
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12915
      } catch (org.apache.thrift.TException te) {
12916
        throw new java.io.IOException(te);
12917
      }
12918
    }
12919
 
12920
  }
12921
 
3430 rajveer 12922
  public static class getSuccessfulPaymentCountForCoupon_args implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_args, getSuccessfulPaymentCountForCoupon_args._Fields>, java.io.Serializable, Cloneable   {
12923
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_args");
3385 varun.gupt 12924
 
3430 rajveer 12925
    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 12926
 
3430 rajveer 12927
    private String couponCode; // required
3385 varun.gupt 12928
 
12929
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 12930
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 12931
      COUPON_CODE((short)1, "couponCode");
12932
 
12933
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12934
 
12935
      static {
12936
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12937
          byName.put(field.getFieldName(), field);
12938
        }
12939
      }
12940
 
12941
      /**
12942
       * Find the _Fields constant that matches fieldId, or null if its not found.
12943
       */
12944
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 12945
        switch(fieldId) {
12946
          case 1: // COUPON_CODE
12947
            return COUPON_CODE;
12948
          default:
12949
            return null;
12950
        }
3385 varun.gupt 12951
      }
12952
 
12953
      /**
12954
       * Find the _Fields constant that matches fieldId, throwing an exception
12955
       * if it is not found.
12956
       */
12957
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12958
        _Fields fields = findByThriftId(fieldId);
12959
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12960
        return fields;
12961
      }
12962
 
12963
      /**
12964
       * Find the _Fields constant that matches name, or null if its not found.
12965
       */
12966
      public static _Fields findByName(String name) {
12967
        return byName.get(name);
12968
      }
12969
 
12970
      private final short _thriftId;
12971
      private final String _fieldName;
12972
 
12973
      _Fields(short thriftId, String fieldName) {
12974
        _thriftId = thriftId;
12975
        _fieldName = fieldName;
12976
      }
12977
 
12978
      public short getThriftFieldId() {
12979
        return _thriftId;
12980
      }
12981
 
12982
      public String getFieldName() {
12983
        return _fieldName;
12984
      }
12985
    }
12986
 
12987
    // isset id assignments
12988
 
3430 rajveer 12989
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 12990
    static {
3430 rajveer 12991
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12992
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12993
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
12994
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12995
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_args.class, metaDataMap);
3385 varun.gupt 12996
    }
12997
 
12998
    public getSuccessfulPaymentCountForCoupon_args() {
12999
    }
13000
 
13001
    public getSuccessfulPaymentCountForCoupon_args(
13002
      String couponCode)
13003
    {
13004
      this();
13005
      this.couponCode = couponCode;
13006
    }
13007
 
13008
    /**
13009
     * Performs a deep copy on <i>other</i>.
13010
     */
13011
    public getSuccessfulPaymentCountForCoupon_args(getSuccessfulPaymentCountForCoupon_args other) {
13012
      if (other.isSetCouponCode()) {
13013
        this.couponCode = other.couponCode;
13014
      }
13015
    }
13016
 
13017
    public getSuccessfulPaymentCountForCoupon_args deepCopy() {
13018
      return new getSuccessfulPaymentCountForCoupon_args(this);
13019
    }
13020
 
3430 rajveer 13021
    @Override
13022
    public void clear() {
13023
      this.couponCode = null;
3385 varun.gupt 13024
    }
13025
 
13026
    public String getCouponCode() {
13027
      return this.couponCode;
13028
    }
13029
 
3430 rajveer 13030
    public void setCouponCode(String couponCode) {
3385 varun.gupt 13031
      this.couponCode = couponCode;
13032
    }
13033
 
13034
    public void unsetCouponCode() {
13035
      this.couponCode = null;
13036
    }
13037
 
3430 rajveer 13038
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3385 varun.gupt 13039
    public boolean isSetCouponCode() {
13040
      return this.couponCode != null;
13041
    }
13042
 
13043
    public void setCouponCodeIsSet(boolean value) {
13044
      if (!value) {
13045
        this.couponCode = null;
13046
      }
13047
    }
13048
 
13049
    public void setFieldValue(_Fields field, Object value) {
13050
      switch (field) {
13051
      case COUPON_CODE:
13052
        if (value == null) {
13053
          unsetCouponCode();
13054
        } else {
13055
          setCouponCode((String)value);
13056
        }
13057
        break;
13058
 
13059
      }
13060
    }
13061
 
13062
    public Object getFieldValue(_Fields field) {
13063
      switch (field) {
13064
      case COUPON_CODE:
13065
        return getCouponCode();
13066
 
13067
      }
13068
      throw new IllegalStateException();
13069
    }
13070
 
3430 rajveer 13071
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13072
    public boolean isSet(_Fields field) {
13073
      if (field == null) {
13074
        throw new IllegalArgumentException();
13075
      }
3385 varun.gupt 13076
 
13077
      switch (field) {
13078
      case COUPON_CODE:
13079
        return isSetCouponCode();
13080
      }
13081
      throw new IllegalStateException();
13082
    }
13083
 
13084
    @Override
13085
    public boolean equals(Object that) {
13086
      if (that == null)
13087
        return false;
13088
      if (that instanceof getSuccessfulPaymentCountForCoupon_args)
13089
        return this.equals((getSuccessfulPaymentCountForCoupon_args)that);
13090
      return false;
13091
    }
13092
 
13093
    public boolean equals(getSuccessfulPaymentCountForCoupon_args that) {
13094
      if (that == null)
13095
        return false;
13096
 
13097
      boolean this_present_couponCode = true && this.isSetCouponCode();
13098
      boolean that_present_couponCode = true && that.isSetCouponCode();
13099
      if (this_present_couponCode || that_present_couponCode) {
13100
        if (!(this_present_couponCode && that_present_couponCode))
13101
          return false;
13102
        if (!this.couponCode.equals(that.couponCode))
13103
          return false;
13104
      }
13105
 
13106
      return true;
13107
    }
13108
 
13109
    @Override
13110
    public int hashCode() {
13111
      return 0;
13112
    }
13113
 
13114
    public int compareTo(getSuccessfulPaymentCountForCoupon_args other) {
13115
      if (!getClass().equals(other.getClass())) {
13116
        return getClass().getName().compareTo(other.getClass().getName());
13117
      }
13118
 
13119
      int lastComparison = 0;
13120
      getSuccessfulPaymentCountForCoupon_args typedOther = (getSuccessfulPaymentCountForCoupon_args)other;
13121
 
3430 rajveer 13122
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3385 varun.gupt 13123
      if (lastComparison != 0) {
13124
        return lastComparison;
13125
      }
3430 rajveer 13126
      if (isSetCouponCode()) {
13127
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
13128
        if (lastComparison != 0) {
13129
          return lastComparison;
13130
        }
3385 varun.gupt 13131
      }
13132
      return 0;
13133
    }
13134
 
3430 rajveer 13135
    public _Fields fieldForId(int fieldId) {
13136
      return _Fields.findByThriftId(fieldId);
13137
    }
13138
 
13139
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13140
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 13141
      iprot.readStructBegin();
13142
      while (true)
13143
      {
13144
        field = iprot.readFieldBegin();
3430 rajveer 13145
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 13146
          break;
13147
        }
3430 rajveer 13148
        switch (field.id) {
13149
          case 1: // COUPON_CODE
13150
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
13151
              this.couponCode = iprot.readString();
13152
            } else { 
13153
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13154
            }
13155
            break;
13156
          default:
13157
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 13158
        }
3430 rajveer 13159
        iprot.readFieldEnd();
3385 varun.gupt 13160
      }
13161
      iprot.readStructEnd();
13162
      validate();
13163
    }
13164
 
3430 rajveer 13165
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 13166
      validate();
13167
 
13168
      oprot.writeStructBegin(STRUCT_DESC);
13169
      if (this.couponCode != null) {
13170
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
13171
        oprot.writeString(this.couponCode);
13172
        oprot.writeFieldEnd();
13173
      }
13174
      oprot.writeFieldStop();
13175
      oprot.writeStructEnd();
13176
    }
13177
 
13178
    @Override
13179
    public String toString() {
13180
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_args(");
13181
      boolean first = true;
13182
 
13183
      sb.append("couponCode:");
13184
      if (this.couponCode == null) {
13185
        sb.append("null");
13186
      } else {
13187
        sb.append(this.couponCode);
13188
      }
13189
      first = false;
13190
      sb.append(")");
13191
      return sb.toString();
13192
    }
13193
 
3430 rajveer 13194
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 13195
      // check for required fields
13196
    }
13197
 
3430 rajveer 13198
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13199
      try {
13200
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13201
      } catch (org.apache.thrift.TException te) {
13202
        throw new java.io.IOException(te);
13203
      }
13204
    }
13205
 
13206
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13207
      try {
13208
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13209
      } catch (org.apache.thrift.TException te) {
13210
        throw new java.io.IOException(te);
13211
      }
13212
    }
13213
 
3385 varun.gupt 13214
  }
13215
 
3430 rajveer 13216
  public static class getSuccessfulPaymentCountForCoupon_result implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_result, getSuccessfulPaymentCountForCoupon_result._Fields>, java.io.Serializable, Cloneable   {
13217
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_result");
3385 varun.gupt 13218
 
3430 rajveer 13219
    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);
13220
    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 13221
 
3430 rajveer 13222
    private long success; // required
13223
    private PromotionException pex; // required
3385 varun.gupt 13224
 
13225
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 13226
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 13227
      SUCCESS((short)0, "success"),
13228
      PEX((short)1, "pex");
13229
 
13230
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13231
 
13232
      static {
13233
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13234
          byName.put(field.getFieldName(), field);
13235
        }
13236
      }
13237
 
13238
      /**
13239
       * Find the _Fields constant that matches fieldId, or null if its not found.
13240
       */
13241
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 13242
        switch(fieldId) {
13243
          case 0: // SUCCESS
13244
            return SUCCESS;
13245
          case 1: // PEX
13246
            return PEX;
13247
          default:
13248
            return null;
13249
        }
3385 varun.gupt 13250
      }
13251
 
13252
      /**
13253
       * Find the _Fields constant that matches fieldId, throwing an exception
13254
       * if it is not found.
13255
       */
13256
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13257
        _Fields fields = findByThriftId(fieldId);
13258
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13259
        return fields;
13260
      }
13261
 
13262
      /**
13263
       * Find the _Fields constant that matches name, or null if its not found.
13264
       */
13265
      public static _Fields findByName(String name) {
13266
        return byName.get(name);
13267
      }
13268
 
13269
      private final short _thriftId;
13270
      private final String _fieldName;
13271
 
13272
      _Fields(short thriftId, String fieldName) {
13273
        _thriftId = thriftId;
13274
        _fieldName = fieldName;
13275
      }
13276
 
13277
      public short getThriftFieldId() {
13278
        return _thriftId;
13279
      }
13280
 
13281
      public String getFieldName() {
13282
        return _fieldName;
13283
      }
13284
    }
13285
 
13286
    // isset id assignments
13287
    private static final int __SUCCESS_ISSET_ID = 0;
13288
    private BitSet __isset_bit_vector = new BitSet(1);
13289
 
3430 rajveer 13290
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 13291
    static {
3430 rajveer 13292
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13293
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13294
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
13295
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13296
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
13297
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13298
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_result.class, metaDataMap);
3385 varun.gupt 13299
    }
13300
 
13301
    public getSuccessfulPaymentCountForCoupon_result() {
13302
    }
13303
 
13304
    public getSuccessfulPaymentCountForCoupon_result(
13305
      long success,
13306
      PromotionException pex)
13307
    {
13308
      this();
13309
      this.success = success;
13310
      setSuccessIsSet(true);
13311
      this.pex = pex;
13312
    }
13313
 
13314
    /**
13315
     * Performs a deep copy on <i>other</i>.
13316
     */
13317
    public getSuccessfulPaymentCountForCoupon_result(getSuccessfulPaymentCountForCoupon_result other) {
13318
      __isset_bit_vector.clear();
13319
      __isset_bit_vector.or(other.__isset_bit_vector);
13320
      this.success = other.success;
13321
      if (other.isSetPex()) {
13322
        this.pex = new PromotionException(other.pex);
13323
      }
13324
    }
13325
 
13326
    public getSuccessfulPaymentCountForCoupon_result deepCopy() {
13327
      return new getSuccessfulPaymentCountForCoupon_result(this);
13328
    }
13329
 
3430 rajveer 13330
    @Override
13331
    public void clear() {
13332
      setSuccessIsSet(false);
13333
      this.success = 0;
13334
      this.pex = null;
3385 varun.gupt 13335
    }
13336
 
13337
    public long getSuccess() {
13338
      return this.success;
13339
    }
13340
 
3430 rajveer 13341
    public void setSuccess(long success) {
3385 varun.gupt 13342
      this.success = success;
13343
      setSuccessIsSet(true);
13344
    }
13345
 
13346
    public void unsetSuccess() {
13347
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
13348
    }
13349
 
3430 rajveer 13350
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 13351
    public boolean isSetSuccess() {
13352
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
13353
    }
13354
 
13355
    public void setSuccessIsSet(boolean value) {
13356
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
13357
    }
13358
 
13359
    public PromotionException getPex() {
13360
      return this.pex;
13361
    }
13362
 
3430 rajveer 13363
    public void setPex(PromotionException pex) {
3385 varun.gupt 13364
      this.pex = pex;
13365
    }
13366
 
13367
    public void unsetPex() {
13368
      this.pex = null;
13369
    }
13370
 
3430 rajveer 13371
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 13372
    public boolean isSetPex() {
13373
      return this.pex != null;
13374
    }
13375
 
13376
    public void setPexIsSet(boolean value) {
13377
      if (!value) {
13378
        this.pex = null;
13379
      }
13380
    }
13381
 
13382
    public void setFieldValue(_Fields field, Object value) {
13383
      switch (field) {
13384
      case SUCCESS:
13385
        if (value == null) {
13386
          unsetSuccess();
13387
        } else {
13388
          setSuccess((Long)value);
13389
        }
13390
        break;
13391
 
13392
      case PEX:
13393
        if (value == null) {
13394
          unsetPex();
13395
        } else {
13396
          setPex((PromotionException)value);
13397
        }
13398
        break;
13399
 
13400
      }
13401
    }
13402
 
13403
    public Object getFieldValue(_Fields field) {
13404
      switch (field) {
13405
      case SUCCESS:
3430 rajveer 13406
        return Long.valueOf(getSuccess());
3385 varun.gupt 13407
 
13408
      case PEX:
13409
        return getPex();
13410
 
13411
      }
13412
      throw new IllegalStateException();
13413
    }
13414
 
3430 rajveer 13415
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13416
    public boolean isSet(_Fields field) {
13417
      if (field == null) {
13418
        throw new IllegalArgumentException();
13419
      }
3385 varun.gupt 13420
 
13421
      switch (field) {
13422
      case SUCCESS:
13423
        return isSetSuccess();
13424
      case PEX:
13425
        return isSetPex();
13426
      }
13427
      throw new IllegalStateException();
13428
    }
13429
 
13430
    @Override
13431
    public boolean equals(Object that) {
13432
      if (that == null)
13433
        return false;
13434
      if (that instanceof getSuccessfulPaymentCountForCoupon_result)
13435
        return this.equals((getSuccessfulPaymentCountForCoupon_result)that);
13436
      return false;
13437
    }
13438
 
13439
    public boolean equals(getSuccessfulPaymentCountForCoupon_result that) {
13440
      if (that == null)
13441
        return false;
13442
 
13443
      boolean this_present_success = true;
13444
      boolean that_present_success = true;
13445
      if (this_present_success || that_present_success) {
13446
        if (!(this_present_success && that_present_success))
13447
          return false;
13448
        if (this.success != that.success)
13449
          return false;
13450
      }
13451
 
13452
      boolean this_present_pex = true && this.isSetPex();
13453
      boolean that_present_pex = true && that.isSetPex();
13454
      if (this_present_pex || that_present_pex) {
13455
        if (!(this_present_pex && that_present_pex))
13456
          return false;
13457
        if (!this.pex.equals(that.pex))
13458
          return false;
13459
      }
13460
 
13461
      return true;
13462
    }
13463
 
13464
    @Override
13465
    public int hashCode() {
13466
      return 0;
13467
    }
13468
 
13469
    public int compareTo(getSuccessfulPaymentCountForCoupon_result other) {
13470
      if (!getClass().equals(other.getClass())) {
13471
        return getClass().getName().compareTo(other.getClass().getName());
13472
      }
13473
 
13474
      int lastComparison = 0;
13475
      getSuccessfulPaymentCountForCoupon_result typedOther = (getSuccessfulPaymentCountForCoupon_result)other;
13476
 
3430 rajveer 13477
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 13478
      if (lastComparison != 0) {
13479
        return lastComparison;
13480
      }
3430 rajveer 13481
      if (isSetSuccess()) {
13482
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
13483
        if (lastComparison != 0) {
13484
          return lastComparison;
13485
        }
3385 varun.gupt 13486
      }
3430 rajveer 13487
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 13488
      if (lastComparison != 0) {
13489
        return lastComparison;
13490
      }
3430 rajveer 13491
      if (isSetPex()) {
13492
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
13493
        if (lastComparison != 0) {
13494
          return lastComparison;
13495
        }
3385 varun.gupt 13496
      }
13497
      return 0;
13498
    }
13499
 
3430 rajveer 13500
    public _Fields fieldForId(int fieldId) {
13501
      return _Fields.findByThriftId(fieldId);
13502
    }
13503
 
13504
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13505
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 13506
      iprot.readStructBegin();
13507
      while (true)
13508
      {
13509
        field = iprot.readFieldBegin();
3430 rajveer 13510
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 13511
          break;
13512
        }
3430 rajveer 13513
        switch (field.id) {
13514
          case 0: // SUCCESS
13515
            if (field.type == org.apache.thrift.protocol.TType.I64) {
13516
              this.success = iprot.readI64();
13517
              setSuccessIsSet(true);
13518
            } else { 
13519
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13520
            }
13521
            break;
13522
          case 1: // PEX
13523
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
13524
              this.pex = new PromotionException();
13525
              this.pex.read(iprot);
13526
            } else { 
13527
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13528
            }
13529
            break;
13530
          default:
13531
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 13532
        }
3430 rajveer 13533
        iprot.readFieldEnd();
3385 varun.gupt 13534
      }
13535
      iprot.readStructEnd();
13536
      validate();
13537
    }
13538
 
3430 rajveer 13539
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 13540
      oprot.writeStructBegin(STRUCT_DESC);
13541
 
13542
      if (this.isSetSuccess()) {
13543
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
13544
        oprot.writeI64(this.success);
13545
        oprot.writeFieldEnd();
13546
      } else if (this.isSetPex()) {
13547
        oprot.writeFieldBegin(PEX_FIELD_DESC);
13548
        this.pex.write(oprot);
13549
        oprot.writeFieldEnd();
13550
      }
13551
      oprot.writeFieldStop();
13552
      oprot.writeStructEnd();
13553
    }
13554
 
13555
    @Override
13556
    public String toString() {
13557
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_result(");
13558
      boolean first = true;
13559
 
13560
      sb.append("success:");
13561
      sb.append(this.success);
13562
      first = false;
13563
      if (!first) sb.append(", ");
13564
      sb.append("pex:");
13565
      if (this.pex == null) {
13566
        sb.append("null");
13567
      } else {
13568
        sb.append(this.pex);
13569
      }
13570
      first = false;
13571
      sb.append(")");
13572
      return sb.toString();
13573
    }
13574
 
3430 rajveer 13575
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 13576
      // check for required fields
13577
    }
13578
 
3430 rajveer 13579
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13580
      try {
13581
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13582
      } catch (org.apache.thrift.TException te) {
13583
        throw new java.io.IOException(te);
13584
      }
13585
    }
13586
 
13587
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13588
      try {
13589
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13590
      } catch (org.apache.thrift.TException te) {
13591
        throw new java.io.IOException(te);
13592
      }
13593
    }
13594
 
3385 varun.gupt 13595
  }
13596
 
3430 rajveer 13597
  public static class getRuleDocString_args implements org.apache.thrift.TBase<getRuleDocString_args, getRuleDocString_args._Fields>, java.io.Serializable, Cloneable   {
13598
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_args");
3385 varun.gupt 13599
 
3430 rajveer 13600
    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 13601
 
3430 rajveer 13602
    private String ruleName; // required
3385 varun.gupt 13603
 
13604
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 13605
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 13606
      RULE_NAME((short)1, "ruleName");
13607
 
13608
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13609
 
13610
      static {
13611
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13612
          byName.put(field.getFieldName(), field);
13613
        }
13614
      }
13615
 
13616
      /**
13617
       * Find the _Fields constant that matches fieldId, or null if its not found.
13618
       */
13619
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 13620
        switch(fieldId) {
13621
          case 1: // RULE_NAME
13622
            return RULE_NAME;
13623
          default:
13624
            return null;
13625
        }
3385 varun.gupt 13626
      }
13627
 
13628
      /**
13629
       * Find the _Fields constant that matches fieldId, throwing an exception
13630
       * if it is not found.
13631
       */
13632
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13633
        _Fields fields = findByThriftId(fieldId);
13634
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13635
        return fields;
13636
      }
13637
 
13638
      /**
13639
       * Find the _Fields constant that matches name, or null if its not found.
13640
       */
13641
      public static _Fields findByName(String name) {
13642
        return byName.get(name);
13643
      }
13644
 
13645
      private final short _thriftId;
13646
      private final String _fieldName;
13647
 
13648
      _Fields(short thriftId, String fieldName) {
13649
        _thriftId = thriftId;
13650
        _fieldName = fieldName;
13651
      }
13652
 
13653
      public short getThriftFieldId() {
13654
        return _thriftId;
13655
      }
13656
 
13657
      public String getFieldName() {
13658
        return _fieldName;
13659
      }
13660
    }
13661
 
13662
    // isset id assignments
13663
 
3430 rajveer 13664
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 13665
    static {
3430 rajveer 13666
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13667
      tmpMap.put(_Fields.RULE_NAME, new org.apache.thrift.meta_data.FieldMetaData("ruleName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13668
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
13669
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13670
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_args.class, metaDataMap);
3385 varun.gupt 13671
    }
13672
 
13673
    public getRuleDocString_args() {
13674
    }
13675
 
13676
    public getRuleDocString_args(
13677
      String ruleName)
13678
    {
13679
      this();
13680
      this.ruleName = ruleName;
13681
    }
13682
 
13683
    /**
13684
     * Performs a deep copy on <i>other</i>.
13685
     */
13686
    public getRuleDocString_args(getRuleDocString_args other) {
13687
      if (other.isSetRuleName()) {
13688
        this.ruleName = other.ruleName;
13689
      }
13690
    }
13691
 
13692
    public getRuleDocString_args deepCopy() {
13693
      return new getRuleDocString_args(this);
13694
    }
13695
 
3430 rajveer 13696
    @Override
13697
    public void clear() {
13698
      this.ruleName = null;
3385 varun.gupt 13699
    }
13700
 
13701
    public String getRuleName() {
13702
      return this.ruleName;
13703
    }
13704
 
3430 rajveer 13705
    public void setRuleName(String ruleName) {
3385 varun.gupt 13706
      this.ruleName = ruleName;
13707
    }
13708
 
13709
    public void unsetRuleName() {
13710
      this.ruleName = null;
13711
    }
13712
 
3430 rajveer 13713
    /** Returns true if field ruleName is set (has been assigned a value) and false otherwise */
3385 varun.gupt 13714
    public boolean isSetRuleName() {
13715
      return this.ruleName != null;
13716
    }
13717
 
13718
    public void setRuleNameIsSet(boolean value) {
13719
      if (!value) {
13720
        this.ruleName = null;
13721
      }
13722
    }
13723
 
13724
    public void setFieldValue(_Fields field, Object value) {
13725
      switch (field) {
13726
      case RULE_NAME:
13727
        if (value == null) {
13728
          unsetRuleName();
13729
        } else {
13730
          setRuleName((String)value);
13731
        }
13732
        break;
13733
 
13734
      }
13735
    }
13736
 
13737
    public Object getFieldValue(_Fields field) {
13738
      switch (field) {
13739
      case RULE_NAME:
13740
        return getRuleName();
13741
 
13742
      }
13743
      throw new IllegalStateException();
13744
    }
13745
 
3430 rajveer 13746
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13747
    public boolean isSet(_Fields field) {
13748
      if (field == null) {
13749
        throw new IllegalArgumentException();
13750
      }
3385 varun.gupt 13751
 
13752
      switch (field) {
13753
      case RULE_NAME:
13754
        return isSetRuleName();
13755
      }
13756
      throw new IllegalStateException();
13757
    }
13758
 
13759
    @Override
13760
    public boolean equals(Object that) {
13761
      if (that == null)
13762
        return false;
13763
      if (that instanceof getRuleDocString_args)
13764
        return this.equals((getRuleDocString_args)that);
13765
      return false;
13766
    }
13767
 
13768
    public boolean equals(getRuleDocString_args that) {
13769
      if (that == null)
13770
        return false;
13771
 
13772
      boolean this_present_ruleName = true && this.isSetRuleName();
13773
      boolean that_present_ruleName = true && that.isSetRuleName();
13774
      if (this_present_ruleName || that_present_ruleName) {
13775
        if (!(this_present_ruleName && that_present_ruleName))
13776
          return false;
13777
        if (!this.ruleName.equals(that.ruleName))
13778
          return false;
13779
      }
13780
 
13781
      return true;
13782
    }
13783
 
13784
    @Override
13785
    public int hashCode() {
13786
      return 0;
13787
    }
13788
 
13789
    public int compareTo(getRuleDocString_args other) {
13790
      if (!getClass().equals(other.getClass())) {
13791
        return getClass().getName().compareTo(other.getClass().getName());
13792
      }
13793
 
13794
      int lastComparison = 0;
13795
      getRuleDocString_args typedOther = (getRuleDocString_args)other;
13796
 
3430 rajveer 13797
      lastComparison = Boolean.valueOf(isSetRuleName()).compareTo(typedOther.isSetRuleName());
3385 varun.gupt 13798
      if (lastComparison != 0) {
13799
        return lastComparison;
13800
      }
3430 rajveer 13801
      if (isSetRuleName()) {
13802
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleName, typedOther.ruleName);
13803
        if (lastComparison != 0) {
13804
          return lastComparison;
13805
        }
3385 varun.gupt 13806
      }
13807
      return 0;
13808
    }
13809
 
3430 rajveer 13810
    public _Fields fieldForId(int fieldId) {
13811
      return _Fields.findByThriftId(fieldId);
13812
    }
13813
 
13814
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13815
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 13816
      iprot.readStructBegin();
13817
      while (true)
13818
      {
13819
        field = iprot.readFieldBegin();
3430 rajveer 13820
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 13821
          break;
13822
        }
3430 rajveer 13823
        switch (field.id) {
13824
          case 1: // RULE_NAME
13825
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
13826
              this.ruleName = iprot.readString();
13827
            } else { 
13828
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13829
            }
13830
            break;
13831
          default:
13832
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 13833
        }
3430 rajveer 13834
        iprot.readFieldEnd();
3385 varun.gupt 13835
      }
13836
      iprot.readStructEnd();
13837
      validate();
13838
    }
13839
 
3430 rajveer 13840
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 13841
      validate();
13842
 
13843
      oprot.writeStructBegin(STRUCT_DESC);
13844
      if (this.ruleName != null) {
13845
        oprot.writeFieldBegin(RULE_NAME_FIELD_DESC);
13846
        oprot.writeString(this.ruleName);
13847
        oprot.writeFieldEnd();
13848
      }
13849
      oprot.writeFieldStop();
13850
      oprot.writeStructEnd();
13851
    }
13852
 
13853
    @Override
13854
    public String toString() {
13855
      StringBuilder sb = new StringBuilder("getRuleDocString_args(");
13856
      boolean first = true;
13857
 
13858
      sb.append("ruleName:");
13859
      if (this.ruleName == null) {
13860
        sb.append("null");
13861
      } else {
13862
        sb.append(this.ruleName);
13863
      }
13864
      first = false;
13865
      sb.append(")");
13866
      return sb.toString();
13867
    }
13868
 
3430 rajveer 13869
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 13870
      // check for required fields
13871
    }
13872
 
3430 rajveer 13873
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13874
      try {
13875
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13876
      } catch (org.apache.thrift.TException te) {
13877
        throw new java.io.IOException(te);
13878
      }
13879
    }
13880
 
13881
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13882
      try {
13883
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13884
      } catch (org.apache.thrift.TException te) {
13885
        throw new java.io.IOException(te);
13886
      }
13887
    }
13888
 
3385 varun.gupt 13889
  }
13890
 
3430 rajveer 13891
  public static class getRuleDocString_result implements org.apache.thrift.TBase<getRuleDocString_result, getRuleDocString_result._Fields>, java.io.Serializable, Cloneable   {
13892
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_result");
3385 varun.gupt 13893
 
3430 rajveer 13894
    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 13895
 
3430 rajveer 13896
    private String success; // required
3385 varun.gupt 13897
 
13898
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 13899
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 13900
      SUCCESS((short)0, "success");
13901
 
13902
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13903
 
13904
      static {
13905
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13906
          byName.put(field.getFieldName(), field);
13907
        }
13908
      }
13909
 
13910
      /**
13911
       * Find the _Fields constant that matches fieldId, or null if its not found.
13912
       */
13913
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 13914
        switch(fieldId) {
13915
          case 0: // SUCCESS
13916
            return SUCCESS;
13917
          default:
13918
            return null;
13919
        }
3385 varun.gupt 13920
      }
13921
 
13922
      /**
13923
       * Find the _Fields constant that matches fieldId, throwing an exception
13924
       * if it is not found.
13925
       */
13926
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13927
        _Fields fields = findByThriftId(fieldId);
13928
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13929
        return fields;
13930
      }
13931
 
13932
      /**
13933
       * Find the _Fields constant that matches name, or null if its not found.
13934
       */
13935
      public static _Fields findByName(String name) {
13936
        return byName.get(name);
13937
      }
13938
 
13939
      private final short _thriftId;
13940
      private final String _fieldName;
13941
 
13942
      _Fields(short thriftId, String fieldName) {
13943
        _thriftId = thriftId;
13944
        _fieldName = fieldName;
13945
      }
13946
 
13947
      public short getThriftFieldId() {
13948
        return _thriftId;
13949
      }
13950
 
13951
      public String getFieldName() {
13952
        return _fieldName;
13953
      }
13954
    }
13955
 
13956
    // isset id assignments
13957
 
3430 rajveer 13958
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 13959
    static {
3430 rajveer 13960
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13961
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13962
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
13963
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13964
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_result.class, metaDataMap);
3385 varun.gupt 13965
    }
13966
 
13967
    public getRuleDocString_result() {
13968
    }
13969
 
13970
    public getRuleDocString_result(
13971
      String success)
13972
    {
13973
      this();
13974
      this.success = success;
13975
    }
13976
 
13977
    /**
13978
     * Performs a deep copy on <i>other</i>.
13979
     */
13980
    public getRuleDocString_result(getRuleDocString_result other) {
13981
      if (other.isSetSuccess()) {
13982
        this.success = other.success;
13983
      }
13984
    }
13985
 
13986
    public getRuleDocString_result deepCopy() {
13987
      return new getRuleDocString_result(this);
13988
    }
13989
 
3430 rajveer 13990
    @Override
13991
    public void clear() {
13992
      this.success = null;
3385 varun.gupt 13993
    }
13994
 
13995
    public String getSuccess() {
13996
      return this.success;
13997
    }
13998
 
3430 rajveer 13999
    public void setSuccess(String success) {
3385 varun.gupt 14000
      this.success = success;
14001
    }
14002
 
14003
    public void unsetSuccess() {
14004
      this.success = null;
14005
    }
14006
 
3430 rajveer 14007
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 14008
    public boolean isSetSuccess() {
14009
      return this.success != null;
14010
    }
14011
 
14012
    public void setSuccessIsSet(boolean value) {
14013
      if (!value) {
14014
        this.success = null;
14015
      }
14016
    }
14017
 
14018
    public void setFieldValue(_Fields field, Object value) {
14019
      switch (field) {
14020
      case SUCCESS:
14021
        if (value == null) {
14022
          unsetSuccess();
14023
        } else {
14024
          setSuccess((String)value);
14025
        }
14026
        break;
14027
 
14028
      }
14029
    }
14030
 
14031
    public Object getFieldValue(_Fields field) {
14032
      switch (field) {
14033
      case SUCCESS:
14034
        return getSuccess();
14035
 
14036
      }
14037
      throw new IllegalStateException();
14038
    }
14039
 
3430 rajveer 14040
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14041
    public boolean isSet(_Fields field) {
14042
      if (field == null) {
14043
        throw new IllegalArgumentException();
14044
      }
3385 varun.gupt 14045
 
14046
      switch (field) {
14047
      case SUCCESS:
14048
        return isSetSuccess();
14049
      }
14050
      throw new IllegalStateException();
14051
    }
14052
 
14053
    @Override
14054
    public boolean equals(Object that) {
14055
      if (that == null)
14056
        return false;
14057
      if (that instanceof getRuleDocString_result)
14058
        return this.equals((getRuleDocString_result)that);
14059
      return false;
14060
    }
14061
 
14062
    public boolean equals(getRuleDocString_result that) {
14063
      if (that == null)
14064
        return false;
14065
 
14066
      boolean this_present_success = true && this.isSetSuccess();
14067
      boolean that_present_success = true && that.isSetSuccess();
14068
      if (this_present_success || that_present_success) {
14069
        if (!(this_present_success && that_present_success))
14070
          return false;
14071
        if (!this.success.equals(that.success))
14072
          return false;
14073
      }
14074
 
14075
      return true;
14076
    }
14077
 
14078
    @Override
14079
    public int hashCode() {
14080
      return 0;
14081
    }
14082
 
14083
    public int compareTo(getRuleDocString_result other) {
14084
      if (!getClass().equals(other.getClass())) {
14085
        return getClass().getName().compareTo(other.getClass().getName());
14086
      }
14087
 
14088
      int lastComparison = 0;
14089
      getRuleDocString_result typedOther = (getRuleDocString_result)other;
14090
 
3430 rajveer 14091
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 14092
      if (lastComparison != 0) {
14093
        return lastComparison;
14094
      }
3430 rajveer 14095
      if (isSetSuccess()) {
14096
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
14097
        if (lastComparison != 0) {
14098
          return lastComparison;
14099
        }
3385 varun.gupt 14100
      }
14101
      return 0;
14102
    }
14103
 
3430 rajveer 14104
    public _Fields fieldForId(int fieldId) {
14105
      return _Fields.findByThriftId(fieldId);
14106
    }
14107
 
14108
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14109
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 14110
      iprot.readStructBegin();
14111
      while (true)
14112
      {
14113
        field = iprot.readFieldBegin();
3430 rajveer 14114
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 14115
          break;
14116
        }
3430 rajveer 14117
        switch (field.id) {
14118
          case 0: // SUCCESS
14119
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
14120
              this.success = iprot.readString();
14121
            } else { 
14122
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14123
            }
14124
            break;
14125
          default:
14126
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 14127
        }
3430 rajveer 14128
        iprot.readFieldEnd();
3385 varun.gupt 14129
      }
14130
      iprot.readStructEnd();
14131
      validate();
14132
    }
14133
 
3430 rajveer 14134
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 14135
      oprot.writeStructBegin(STRUCT_DESC);
14136
 
14137
      if (this.isSetSuccess()) {
14138
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
14139
        oprot.writeString(this.success);
14140
        oprot.writeFieldEnd();
14141
      }
14142
      oprot.writeFieldStop();
14143
      oprot.writeStructEnd();
14144
    }
14145
 
14146
    @Override
14147
    public String toString() {
14148
      StringBuilder sb = new StringBuilder("getRuleDocString_result(");
14149
      boolean first = true;
14150
 
14151
      sb.append("success:");
14152
      if (this.success == null) {
14153
        sb.append("null");
14154
      } else {
14155
        sb.append(this.success);
14156
      }
14157
      first = false;
14158
      sb.append(")");
14159
      return sb.toString();
14160
    }
14161
 
3430 rajveer 14162
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 14163
      // check for required fields
14164
    }
14165
 
3430 rajveer 14166
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14167
      try {
14168
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14169
      } catch (org.apache.thrift.TException te) {
14170
        throw new java.io.IOException(te);
14171
      }
14172
    }
14173
 
14174
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14175
      try {
14176
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14177
      } catch (org.apache.thrift.TException te) {
14178
        throw new java.io.IOException(te);
14179
      }
14180
    }
14181
 
3385 varun.gupt 14182
  }
14183
 
4189 varun.gupt 14184
  public static class getItemDiscountMap_args implements org.apache.thrift.TBase<getItemDiscountMap_args, getItemDiscountMap_args._Fields>, java.io.Serializable, Cloneable   {
14185
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_args");
14186
 
14187
    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);
14188
 
14189
    private List<Long> itemIds; // required
14190
 
14191
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14192
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
14193
      ITEM_IDS((short)1, "itemIds");
14194
 
14195
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14196
 
14197
      static {
14198
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14199
          byName.put(field.getFieldName(), field);
14200
        }
14201
      }
14202
 
14203
      /**
14204
       * Find the _Fields constant that matches fieldId, or null if its not found.
14205
       */
14206
      public static _Fields findByThriftId(int fieldId) {
14207
        switch(fieldId) {
14208
          case 1: // ITEM_IDS
14209
            return ITEM_IDS;
14210
          default:
14211
            return null;
14212
        }
14213
      }
14214
 
14215
      /**
14216
       * Find the _Fields constant that matches fieldId, throwing an exception
14217
       * if it is not found.
14218
       */
14219
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14220
        _Fields fields = findByThriftId(fieldId);
14221
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14222
        return fields;
14223
      }
14224
 
14225
      /**
14226
       * Find the _Fields constant that matches name, or null if its not found.
14227
       */
14228
      public static _Fields findByName(String name) {
14229
        return byName.get(name);
14230
      }
14231
 
14232
      private final short _thriftId;
14233
      private final String _fieldName;
14234
 
14235
      _Fields(short thriftId, String fieldName) {
14236
        _thriftId = thriftId;
14237
        _fieldName = fieldName;
14238
      }
14239
 
14240
      public short getThriftFieldId() {
14241
        return _thriftId;
14242
      }
14243
 
14244
      public String getFieldName() {
14245
        return _fieldName;
14246
      }
14247
    }
14248
 
14249
    // isset id assignments
14250
 
14251
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
14252
    static {
14253
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
14254
      tmpMap.put(_Fields.ITEM_IDS, new org.apache.thrift.meta_data.FieldMetaData("itemIds", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14255
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
14256
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
14257
      metaDataMap = Collections.unmodifiableMap(tmpMap);
14258
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_args.class, metaDataMap);
14259
    }
14260
 
14261
    public getItemDiscountMap_args() {
14262
    }
14263
 
14264
    public getItemDiscountMap_args(
14265
      List<Long> itemIds)
14266
    {
14267
      this();
14268
      this.itemIds = itemIds;
14269
    }
14270
 
14271
    /**
14272
     * Performs a deep copy on <i>other</i>.
14273
     */
14274
    public getItemDiscountMap_args(getItemDiscountMap_args other) {
14275
      if (other.isSetItemIds()) {
14276
        List<Long> __this__itemIds = new ArrayList<Long>();
14277
        for (Long other_element : other.itemIds) {
14278
          __this__itemIds.add(other_element);
14279
        }
14280
        this.itemIds = __this__itemIds;
14281
      }
14282
    }
14283
 
14284
    public getItemDiscountMap_args deepCopy() {
14285
      return new getItemDiscountMap_args(this);
14286
    }
14287
 
14288
    @Override
14289
    public void clear() {
14290
      this.itemIds = null;
14291
    }
14292
 
14293
    public int getItemIdsSize() {
14294
      return (this.itemIds == null) ? 0 : this.itemIds.size();
14295
    }
14296
 
14297
    public java.util.Iterator<Long> getItemIdsIterator() {
14298
      return (this.itemIds == null) ? null : this.itemIds.iterator();
14299
    }
14300
 
14301
    public void addToItemIds(long elem) {
14302
      if (this.itemIds == null) {
14303
        this.itemIds = new ArrayList<Long>();
14304
      }
14305
      this.itemIds.add(elem);
14306
    }
14307
 
14308
    public List<Long> getItemIds() {
14309
      return this.itemIds;
14310
    }
14311
 
14312
    public void setItemIds(List<Long> itemIds) {
14313
      this.itemIds = itemIds;
14314
    }
14315
 
14316
    public void unsetItemIds() {
14317
      this.itemIds = null;
14318
    }
14319
 
14320
    /** Returns true if field itemIds is set (has been assigned a value) and false otherwise */
14321
    public boolean isSetItemIds() {
14322
      return this.itemIds != null;
14323
    }
14324
 
14325
    public void setItemIdsIsSet(boolean value) {
14326
      if (!value) {
14327
        this.itemIds = null;
14328
      }
14329
    }
14330
 
14331
    public void setFieldValue(_Fields field, Object value) {
14332
      switch (field) {
14333
      case ITEM_IDS:
14334
        if (value == null) {
14335
          unsetItemIds();
14336
        } else {
14337
          setItemIds((List<Long>)value);
14338
        }
14339
        break;
14340
 
14341
      }
14342
    }
14343
 
14344
    public Object getFieldValue(_Fields field) {
14345
      switch (field) {
14346
      case ITEM_IDS:
14347
        return getItemIds();
14348
 
14349
      }
14350
      throw new IllegalStateException();
14351
    }
14352
 
14353
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14354
    public boolean isSet(_Fields field) {
14355
      if (field == null) {
14356
        throw new IllegalArgumentException();
14357
      }
14358
 
14359
      switch (field) {
14360
      case ITEM_IDS:
14361
        return isSetItemIds();
14362
      }
14363
      throw new IllegalStateException();
14364
    }
14365
 
14366
    @Override
14367
    public boolean equals(Object that) {
14368
      if (that == null)
14369
        return false;
14370
      if (that instanceof getItemDiscountMap_args)
14371
        return this.equals((getItemDiscountMap_args)that);
14372
      return false;
14373
    }
14374
 
14375
    public boolean equals(getItemDiscountMap_args that) {
14376
      if (that == null)
14377
        return false;
14378
 
14379
      boolean this_present_itemIds = true && this.isSetItemIds();
14380
      boolean that_present_itemIds = true && that.isSetItemIds();
14381
      if (this_present_itemIds || that_present_itemIds) {
14382
        if (!(this_present_itemIds && that_present_itemIds))
14383
          return false;
14384
        if (!this.itemIds.equals(that.itemIds))
14385
          return false;
14386
      }
14387
 
14388
      return true;
14389
    }
14390
 
14391
    @Override
14392
    public int hashCode() {
14393
      return 0;
14394
    }
14395
 
14396
    public int compareTo(getItemDiscountMap_args other) {
14397
      if (!getClass().equals(other.getClass())) {
14398
        return getClass().getName().compareTo(other.getClass().getName());
14399
      }
14400
 
14401
      int lastComparison = 0;
14402
      getItemDiscountMap_args typedOther = (getItemDiscountMap_args)other;
14403
 
14404
      lastComparison = Boolean.valueOf(isSetItemIds()).compareTo(typedOther.isSetItemIds());
14405
      if (lastComparison != 0) {
14406
        return lastComparison;
14407
      }
14408
      if (isSetItemIds()) {
14409
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemIds, typedOther.itemIds);
14410
        if (lastComparison != 0) {
14411
          return lastComparison;
14412
        }
14413
      }
14414
      return 0;
14415
    }
14416
 
14417
    public _Fields fieldForId(int fieldId) {
14418
      return _Fields.findByThriftId(fieldId);
14419
    }
14420
 
14421
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14422
      org.apache.thrift.protocol.TField field;
14423
      iprot.readStructBegin();
14424
      while (true)
14425
      {
14426
        field = iprot.readFieldBegin();
14427
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
14428
          break;
14429
        }
14430
        switch (field.id) {
14431
          case 1: // ITEM_IDS
14432
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
14433
              {
6497 amit.gupta 14434
                org.apache.thrift.protocol.TList _list29 = iprot.readListBegin();
14435
                this.itemIds = new ArrayList<Long>(_list29.size);
14436
                for (int _i30 = 0; _i30 < _list29.size; ++_i30)
4189 varun.gupt 14437
                {
6497 amit.gupta 14438
                  long _elem31; // required
14439
                  _elem31 = iprot.readI64();
14440
                  this.itemIds.add(_elem31);
4189 varun.gupt 14441
                }
14442
                iprot.readListEnd();
14443
              }
14444
            } else { 
14445
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14446
            }
14447
            break;
14448
          default:
14449
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14450
        }
14451
        iprot.readFieldEnd();
14452
      }
14453
      iprot.readStructEnd();
14454
      validate();
14455
    }
14456
 
14457
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
14458
      validate();
14459
 
14460
      oprot.writeStructBegin(STRUCT_DESC);
14461
      if (this.itemIds != null) {
14462
        oprot.writeFieldBegin(ITEM_IDS_FIELD_DESC);
14463
        {
14464
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.itemIds.size()));
6497 amit.gupta 14465
          for (long _iter32 : this.itemIds)
4189 varun.gupt 14466
          {
6497 amit.gupta 14467
            oprot.writeI64(_iter32);
4189 varun.gupt 14468
          }
14469
          oprot.writeListEnd();
14470
        }
14471
        oprot.writeFieldEnd();
14472
      }
14473
      oprot.writeFieldStop();
14474
      oprot.writeStructEnd();
14475
    }
14476
 
14477
    @Override
14478
    public String toString() {
14479
      StringBuilder sb = new StringBuilder("getItemDiscountMap_args(");
14480
      boolean first = true;
14481
 
14482
      sb.append("itemIds:");
14483
      if (this.itemIds == null) {
14484
        sb.append("null");
14485
      } else {
14486
        sb.append(this.itemIds);
14487
      }
14488
      first = false;
14489
      sb.append(")");
14490
      return sb.toString();
14491
    }
14492
 
14493
    public void validate() throws org.apache.thrift.TException {
14494
      // check for required fields
14495
    }
14496
 
14497
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14498
      try {
14499
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14500
      } catch (org.apache.thrift.TException te) {
14501
        throw new java.io.IOException(te);
14502
      }
14503
    }
14504
 
14505
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14506
      try {
14507
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14508
      } catch (org.apache.thrift.TException te) {
14509
        throw new java.io.IOException(te);
14510
      }
14511
    }
14512
 
14513
  }
14514
 
14515
  public static class getItemDiscountMap_result implements org.apache.thrift.TBase<getItemDiscountMap_result, getItemDiscountMap_result._Fields>, java.io.Serializable, Cloneable   {
14516
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_result");
14517
 
14518
    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);
14519
    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);
14520
 
14521
    private List<ItemCouponDiscount> success; // required
14522
    private PromotionException pex; // required
14523
 
14524
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14525
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
14526
      SUCCESS((short)0, "success"),
14527
      PEX((short)1, "pex");
14528
 
14529
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14530
 
14531
      static {
14532
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14533
          byName.put(field.getFieldName(), field);
14534
        }
14535
      }
14536
 
14537
      /**
14538
       * Find the _Fields constant that matches fieldId, or null if its not found.
14539
       */
14540
      public static _Fields findByThriftId(int fieldId) {
14541
        switch(fieldId) {
14542
          case 0: // SUCCESS
14543
            return SUCCESS;
14544
          case 1: // PEX
14545
            return PEX;
14546
          default:
14547
            return null;
14548
        }
14549
      }
14550
 
14551
      /**
14552
       * Find the _Fields constant that matches fieldId, throwing an exception
14553
       * if it is not found.
14554
       */
14555
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14556
        _Fields fields = findByThriftId(fieldId);
14557
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14558
        return fields;
14559
      }
14560
 
14561
      /**
14562
       * Find the _Fields constant that matches name, or null if its not found.
14563
       */
14564
      public static _Fields findByName(String name) {
14565
        return byName.get(name);
14566
      }
14567
 
14568
      private final short _thriftId;
14569
      private final String _fieldName;
14570
 
14571
      _Fields(short thriftId, String fieldName) {
14572
        _thriftId = thriftId;
14573
        _fieldName = fieldName;
14574
      }
14575
 
14576
      public short getThriftFieldId() {
14577
        return _thriftId;
14578
      }
14579
 
14580
      public String getFieldName() {
14581
        return _fieldName;
14582
      }
14583
    }
14584
 
14585
    // isset id assignments
14586
 
14587
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
14588
    static {
14589
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
14590
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14591
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
14592
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ItemCouponDiscount.class))));
14593
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14594
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
14595
      metaDataMap = Collections.unmodifiableMap(tmpMap);
14596
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_result.class, metaDataMap);
14597
    }
14598
 
14599
    public getItemDiscountMap_result() {
14600
    }
14601
 
14602
    public getItemDiscountMap_result(
14603
      List<ItemCouponDiscount> success,
14604
      PromotionException pex)
14605
    {
14606
      this();
14607
      this.success = success;
14608
      this.pex = pex;
14609
    }
14610
 
14611
    /**
14612
     * Performs a deep copy on <i>other</i>.
14613
     */
14614
    public getItemDiscountMap_result(getItemDiscountMap_result other) {
14615
      if (other.isSetSuccess()) {
14616
        List<ItemCouponDiscount> __this__success = new ArrayList<ItemCouponDiscount>();
14617
        for (ItemCouponDiscount other_element : other.success) {
14618
          __this__success.add(new ItemCouponDiscount(other_element));
14619
        }
14620
        this.success = __this__success;
14621
      }
14622
      if (other.isSetPex()) {
14623
        this.pex = new PromotionException(other.pex);
14624
      }
14625
    }
14626
 
14627
    public getItemDiscountMap_result deepCopy() {
14628
      return new getItemDiscountMap_result(this);
14629
    }
14630
 
14631
    @Override
14632
    public void clear() {
14633
      this.success = null;
14634
      this.pex = null;
14635
    }
14636
 
14637
    public int getSuccessSize() {
14638
      return (this.success == null) ? 0 : this.success.size();
14639
    }
14640
 
14641
    public java.util.Iterator<ItemCouponDiscount> getSuccessIterator() {
14642
      return (this.success == null) ? null : this.success.iterator();
14643
    }
14644
 
14645
    public void addToSuccess(ItemCouponDiscount elem) {
14646
      if (this.success == null) {
14647
        this.success = new ArrayList<ItemCouponDiscount>();
14648
      }
14649
      this.success.add(elem);
14650
    }
14651
 
14652
    public List<ItemCouponDiscount> getSuccess() {
14653
      return this.success;
14654
    }
14655
 
14656
    public void setSuccess(List<ItemCouponDiscount> success) {
14657
      this.success = success;
14658
    }
14659
 
14660
    public void unsetSuccess() {
14661
      this.success = null;
14662
    }
14663
 
14664
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
14665
    public boolean isSetSuccess() {
14666
      return this.success != null;
14667
    }
14668
 
14669
    public void setSuccessIsSet(boolean value) {
14670
      if (!value) {
14671
        this.success = null;
14672
      }
14673
    }
14674
 
14675
    public PromotionException getPex() {
14676
      return this.pex;
14677
    }
14678
 
14679
    public void setPex(PromotionException pex) {
14680
      this.pex = pex;
14681
    }
14682
 
14683
    public void unsetPex() {
14684
      this.pex = null;
14685
    }
14686
 
14687
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
14688
    public boolean isSetPex() {
14689
      return this.pex != null;
14690
    }
14691
 
14692
    public void setPexIsSet(boolean value) {
14693
      if (!value) {
14694
        this.pex = null;
14695
      }
14696
    }
14697
 
14698
    public void setFieldValue(_Fields field, Object value) {
14699
      switch (field) {
14700
      case SUCCESS:
14701
        if (value == null) {
14702
          unsetSuccess();
14703
        } else {
14704
          setSuccess((List<ItemCouponDiscount>)value);
14705
        }
14706
        break;
14707
 
14708
      case PEX:
14709
        if (value == null) {
14710
          unsetPex();
14711
        } else {
14712
          setPex((PromotionException)value);
14713
        }
14714
        break;
14715
 
14716
      }
14717
    }
14718
 
14719
    public Object getFieldValue(_Fields field) {
14720
      switch (field) {
14721
      case SUCCESS:
14722
        return getSuccess();
14723
 
14724
      case PEX:
14725
        return getPex();
14726
 
14727
      }
14728
      throw new IllegalStateException();
14729
    }
14730
 
14731
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14732
    public boolean isSet(_Fields field) {
14733
      if (field == null) {
14734
        throw new IllegalArgumentException();
14735
      }
14736
 
14737
      switch (field) {
14738
      case SUCCESS:
14739
        return isSetSuccess();
14740
      case PEX:
14741
        return isSetPex();
14742
      }
14743
      throw new IllegalStateException();
14744
    }
14745
 
14746
    @Override
14747
    public boolean equals(Object that) {
14748
      if (that == null)
14749
        return false;
14750
      if (that instanceof getItemDiscountMap_result)
14751
        return this.equals((getItemDiscountMap_result)that);
14752
      return false;
14753
    }
14754
 
14755
    public boolean equals(getItemDiscountMap_result that) {
14756
      if (that == null)
14757
        return false;
14758
 
14759
      boolean this_present_success = true && this.isSetSuccess();
14760
      boolean that_present_success = true && that.isSetSuccess();
14761
      if (this_present_success || that_present_success) {
14762
        if (!(this_present_success && that_present_success))
14763
          return false;
14764
        if (!this.success.equals(that.success))
14765
          return false;
14766
      }
14767
 
14768
      boolean this_present_pex = true && this.isSetPex();
14769
      boolean that_present_pex = true && that.isSetPex();
14770
      if (this_present_pex || that_present_pex) {
14771
        if (!(this_present_pex && that_present_pex))
14772
          return false;
14773
        if (!this.pex.equals(that.pex))
14774
          return false;
14775
      }
14776
 
14777
      return true;
14778
    }
14779
 
14780
    @Override
14781
    public int hashCode() {
14782
      return 0;
14783
    }
14784
 
14785
    public int compareTo(getItemDiscountMap_result other) {
14786
      if (!getClass().equals(other.getClass())) {
14787
        return getClass().getName().compareTo(other.getClass().getName());
14788
      }
14789
 
14790
      int lastComparison = 0;
14791
      getItemDiscountMap_result typedOther = (getItemDiscountMap_result)other;
14792
 
14793
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
14794
      if (lastComparison != 0) {
14795
        return lastComparison;
14796
      }
14797
      if (isSetSuccess()) {
14798
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
14799
        if (lastComparison != 0) {
14800
          return lastComparison;
14801
        }
14802
      }
14803
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
14804
      if (lastComparison != 0) {
14805
        return lastComparison;
14806
      }
14807
      if (isSetPex()) {
14808
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
14809
        if (lastComparison != 0) {
14810
          return lastComparison;
14811
        }
14812
      }
14813
      return 0;
14814
    }
14815
 
14816
    public _Fields fieldForId(int fieldId) {
14817
      return _Fields.findByThriftId(fieldId);
14818
    }
14819
 
14820
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14821
      org.apache.thrift.protocol.TField field;
14822
      iprot.readStructBegin();
14823
      while (true)
14824
      {
14825
        field = iprot.readFieldBegin();
14826
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
14827
          break;
14828
        }
14829
        switch (field.id) {
14830
          case 0: // SUCCESS
14831
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
14832
              {
6497 amit.gupta 14833
                org.apache.thrift.protocol.TList _list33 = iprot.readListBegin();
14834
                this.success = new ArrayList<ItemCouponDiscount>(_list33.size);
14835
                for (int _i34 = 0; _i34 < _list33.size; ++_i34)
4189 varun.gupt 14836
                {
6497 amit.gupta 14837
                  ItemCouponDiscount _elem35; // required
14838
                  _elem35 = new ItemCouponDiscount();
14839
                  _elem35.read(iprot);
14840
                  this.success.add(_elem35);
4189 varun.gupt 14841
                }
14842
                iprot.readListEnd();
14843
              }
14844
            } else { 
14845
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14846
            }
14847
            break;
14848
          case 1: // PEX
14849
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
14850
              this.pex = new PromotionException();
14851
              this.pex.read(iprot);
14852
            } else { 
14853
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14854
            }
14855
            break;
14856
          default:
14857
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14858
        }
14859
        iprot.readFieldEnd();
14860
      }
14861
      iprot.readStructEnd();
14862
      validate();
14863
    }
14864
 
14865
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
14866
      oprot.writeStructBegin(STRUCT_DESC);
14867
 
14868
      if (this.isSetSuccess()) {
14869
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
14870
        {
14871
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
6497 amit.gupta 14872
          for (ItemCouponDiscount _iter36 : this.success)
4189 varun.gupt 14873
          {
6497 amit.gupta 14874
            _iter36.write(oprot);
4189 varun.gupt 14875
          }
14876
          oprot.writeListEnd();
14877
        }
14878
        oprot.writeFieldEnd();
14879
      } else if (this.isSetPex()) {
14880
        oprot.writeFieldBegin(PEX_FIELD_DESC);
14881
        this.pex.write(oprot);
14882
        oprot.writeFieldEnd();
14883
      }
14884
      oprot.writeFieldStop();
14885
      oprot.writeStructEnd();
14886
    }
14887
 
14888
    @Override
14889
    public String toString() {
14890
      StringBuilder sb = new StringBuilder("getItemDiscountMap_result(");
14891
      boolean first = true;
14892
 
14893
      sb.append("success:");
14894
      if (this.success == null) {
14895
        sb.append("null");
14896
      } else {
14897
        sb.append(this.success);
14898
      }
14899
      first = false;
14900
      if (!first) sb.append(", ");
14901
      sb.append("pex:");
14902
      if (this.pex == null) {
14903
        sb.append("null");
14904
      } else {
14905
        sb.append(this.pex);
14906
      }
14907
      first = false;
14908
      sb.append(")");
14909
      return sb.toString();
14910
    }
14911
 
14912
    public void validate() throws org.apache.thrift.TException {
14913
      // check for required fields
14914
    }
14915
 
14916
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14917
      try {
14918
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14919
      } catch (org.apache.thrift.TException te) {
14920
        throw new java.io.IOException(te);
14921
      }
14922
    }
14923
 
14924
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14925
      try {
14926
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14927
      } catch (org.apache.thrift.TException te) {
14928
        throw new java.io.IOException(te);
14929
      }
14930
    }
14931
 
14932
  }
14933
 
4494 varun.gupt 14934
  public static class getDiscountsForEntity_args implements org.apache.thrift.TBase<getDiscountsForEntity_args, getDiscountsForEntity_args._Fields>, java.io.Serializable, Cloneable   {
14935
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_args");
14936
 
14937
    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);
14938
 
14939
    private long entityId; // required
14940
 
14941
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14942
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
14943
      ENTITY_ID((short)1, "entityId");
14944
 
14945
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14946
 
14947
      static {
14948
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14949
          byName.put(field.getFieldName(), field);
14950
        }
14951
      }
14952
 
14953
      /**
14954
       * Find the _Fields constant that matches fieldId, or null if its not found.
14955
       */
14956
      public static _Fields findByThriftId(int fieldId) {
14957
        switch(fieldId) {
14958
          case 1: // ENTITY_ID
14959
            return ENTITY_ID;
14960
          default:
14961
            return null;
14962
        }
14963
      }
14964
 
14965
      /**
14966
       * Find the _Fields constant that matches fieldId, throwing an exception
14967
       * if it is not found.
14968
       */
14969
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14970
        _Fields fields = findByThriftId(fieldId);
14971
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14972
        return fields;
14973
      }
14974
 
14975
      /**
14976
       * Find the _Fields constant that matches name, or null if its not found.
14977
       */
14978
      public static _Fields findByName(String name) {
14979
        return byName.get(name);
14980
      }
14981
 
14982
      private final short _thriftId;
14983
      private final String _fieldName;
14984
 
14985
      _Fields(short thriftId, String fieldName) {
14986
        _thriftId = thriftId;
14987
        _fieldName = fieldName;
14988
      }
14989
 
14990
      public short getThriftFieldId() {
14991
        return _thriftId;
14992
      }
14993
 
14994
      public String getFieldName() {
14995
        return _fieldName;
14996
      }
14997
    }
14998
 
14999
    // isset id assignments
15000
    private static final int __ENTITYID_ISSET_ID = 0;
15001
    private BitSet __isset_bit_vector = new BitSet(1);
15002
 
15003
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
15004
    static {
15005
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15006
      tmpMap.put(_Fields.ENTITY_ID, new org.apache.thrift.meta_data.FieldMetaData("entityId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15007
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
15008
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15009
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_args.class, metaDataMap);
15010
    }
15011
 
15012
    public getDiscountsForEntity_args() {
15013
    }
15014
 
15015
    public getDiscountsForEntity_args(
15016
      long entityId)
15017
    {
15018
      this();
15019
      this.entityId = entityId;
15020
      setEntityIdIsSet(true);
15021
    }
15022
 
15023
    /**
15024
     * Performs a deep copy on <i>other</i>.
15025
     */
15026
    public getDiscountsForEntity_args(getDiscountsForEntity_args other) {
15027
      __isset_bit_vector.clear();
15028
      __isset_bit_vector.or(other.__isset_bit_vector);
15029
      this.entityId = other.entityId;
15030
    }
15031
 
15032
    public getDiscountsForEntity_args deepCopy() {
15033
      return new getDiscountsForEntity_args(this);
15034
    }
15035
 
15036
    @Override
15037
    public void clear() {
15038
      setEntityIdIsSet(false);
15039
      this.entityId = 0;
15040
    }
15041
 
15042
    public long getEntityId() {
15043
      return this.entityId;
15044
    }
15045
 
15046
    public void setEntityId(long entityId) {
15047
      this.entityId = entityId;
15048
      setEntityIdIsSet(true);
15049
    }
15050
 
15051
    public void unsetEntityId() {
15052
      __isset_bit_vector.clear(__ENTITYID_ISSET_ID);
15053
    }
15054
 
15055
    /** Returns true if field entityId is set (has been assigned a value) and false otherwise */
15056
    public boolean isSetEntityId() {
15057
      return __isset_bit_vector.get(__ENTITYID_ISSET_ID);
15058
    }
15059
 
15060
    public void setEntityIdIsSet(boolean value) {
15061
      __isset_bit_vector.set(__ENTITYID_ISSET_ID, value);
15062
    }
15063
 
15064
    public void setFieldValue(_Fields field, Object value) {
15065
      switch (field) {
15066
      case ENTITY_ID:
15067
        if (value == null) {
15068
          unsetEntityId();
15069
        } else {
15070
          setEntityId((Long)value);
15071
        }
15072
        break;
15073
 
15074
      }
15075
    }
15076
 
15077
    public Object getFieldValue(_Fields field) {
15078
      switch (field) {
15079
      case ENTITY_ID:
15080
        return Long.valueOf(getEntityId());
15081
 
15082
      }
15083
      throw new IllegalStateException();
15084
    }
15085
 
15086
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15087
    public boolean isSet(_Fields field) {
15088
      if (field == null) {
15089
        throw new IllegalArgumentException();
15090
      }
15091
 
15092
      switch (field) {
15093
      case ENTITY_ID:
15094
        return isSetEntityId();
15095
      }
15096
      throw new IllegalStateException();
15097
    }
15098
 
15099
    @Override
15100
    public boolean equals(Object that) {
15101
      if (that == null)
15102
        return false;
15103
      if (that instanceof getDiscountsForEntity_args)
15104
        return this.equals((getDiscountsForEntity_args)that);
15105
      return false;
15106
    }
15107
 
15108
    public boolean equals(getDiscountsForEntity_args that) {
15109
      if (that == null)
15110
        return false;
15111
 
15112
      boolean this_present_entityId = true;
15113
      boolean that_present_entityId = true;
15114
      if (this_present_entityId || that_present_entityId) {
15115
        if (!(this_present_entityId && that_present_entityId))
15116
          return false;
15117
        if (this.entityId != that.entityId)
15118
          return false;
15119
      }
15120
 
15121
      return true;
15122
    }
15123
 
15124
    @Override
15125
    public int hashCode() {
15126
      return 0;
15127
    }
15128
 
15129
    public int compareTo(getDiscountsForEntity_args other) {
15130
      if (!getClass().equals(other.getClass())) {
15131
        return getClass().getName().compareTo(other.getClass().getName());
15132
      }
15133
 
15134
      int lastComparison = 0;
15135
      getDiscountsForEntity_args typedOther = (getDiscountsForEntity_args)other;
15136
 
15137
      lastComparison = Boolean.valueOf(isSetEntityId()).compareTo(typedOther.isSetEntityId());
15138
      if (lastComparison != 0) {
15139
        return lastComparison;
15140
      }
15141
      if (isSetEntityId()) {
15142
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityId, typedOther.entityId);
15143
        if (lastComparison != 0) {
15144
          return lastComparison;
15145
        }
15146
      }
15147
      return 0;
15148
    }
15149
 
15150
    public _Fields fieldForId(int fieldId) {
15151
      return _Fields.findByThriftId(fieldId);
15152
    }
15153
 
15154
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15155
      org.apache.thrift.protocol.TField field;
15156
      iprot.readStructBegin();
15157
      while (true)
15158
      {
15159
        field = iprot.readFieldBegin();
15160
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
15161
          break;
15162
        }
15163
        switch (field.id) {
15164
          case 1: // ENTITY_ID
15165
            if (field.type == org.apache.thrift.protocol.TType.I64) {
15166
              this.entityId = iprot.readI64();
15167
              setEntityIdIsSet(true);
15168
            } else { 
15169
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15170
            }
15171
            break;
15172
          default:
15173
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15174
        }
15175
        iprot.readFieldEnd();
15176
      }
15177
      iprot.readStructEnd();
15178
      validate();
15179
    }
15180
 
15181
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
15182
      validate();
15183
 
15184
      oprot.writeStructBegin(STRUCT_DESC);
15185
      oprot.writeFieldBegin(ENTITY_ID_FIELD_DESC);
15186
      oprot.writeI64(this.entityId);
15187
      oprot.writeFieldEnd();
15188
      oprot.writeFieldStop();
15189
      oprot.writeStructEnd();
15190
    }
15191
 
15192
    @Override
15193
    public String toString() {
15194
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_args(");
15195
      boolean first = true;
15196
 
15197
      sb.append("entityId:");
15198
      sb.append(this.entityId);
15199
      first = false;
15200
      sb.append(")");
15201
      return sb.toString();
15202
    }
15203
 
15204
    public void validate() throws org.apache.thrift.TException {
15205
      // check for required fields
15206
    }
15207
 
15208
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15209
      try {
15210
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15211
      } catch (org.apache.thrift.TException te) {
15212
        throw new java.io.IOException(te);
15213
      }
15214
    }
15215
 
15216
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15217
      try {
15218
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
15219
        __isset_bit_vector = new BitSet(1);
15220
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15221
      } catch (org.apache.thrift.TException te) {
15222
        throw new java.io.IOException(te);
15223
      }
15224
    }
15225
 
15226
  }
15227
 
15228
  public static class getDiscountsForEntity_result implements org.apache.thrift.TBase<getDiscountsForEntity_result, getDiscountsForEntity_result._Fields>, java.io.Serializable, Cloneable   {
15229
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_result");
15230
 
15231
    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);
15232
 
15233
    private Map<String,Double> success; // required
15234
 
15235
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
15236
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
15237
      SUCCESS((short)0, "success");
15238
 
15239
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15240
 
15241
      static {
15242
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15243
          byName.put(field.getFieldName(), field);
15244
        }
15245
      }
15246
 
15247
      /**
15248
       * Find the _Fields constant that matches fieldId, or null if its not found.
15249
       */
15250
      public static _Fields findByThriftId(int fieldId) {
15251
        switch(fieldId) {
15252
          case 0: // SUCCESS
15253
            return SUCCESS;
15254
          default:
15255
            return null;
15256
        }
15257
      }
15258
 
15259
      /**
15260
       * Find the _Fields constant that matches fieldId, throwing an exception
15261
       * if it is not found.
15262
       */
15263
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15264
        _Fields fields = findByThriftId(fieldId);
15265
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15266
        return fields;
15267
      }
15268
 
15269
      /**
15270
       * Find the _Fields constant that matches name, or null if its not found.
15271
       */
15272
      public static _Fields findByName(String name) {
15273
        return byName.get(name);
15274
      }
15275
 
15276
      private final short _thriftId;
15277
      private final String _fieldName;
15278
 
15279
      _Fields(short thriftId, String fieldName) {
15280
        _thriftId = thriftId;
15281
        _fieldName = fieldName;
15282
      }
15283
 
15284
      public short getThriftFieldId() {
15285
        return _thriftId;
15286
      }
15287
 
15288
      public String getFieldName() {
15289
        return _fieldName;
15290
      }
15291
    }
15292
 
15293
    // isset id assignments
15294
 
15295
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
15296
    static {
15297
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15298
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15299
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
15300
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
15301
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
15302
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15303
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_result.class, metaDataMap);
15304
    }
15305
 
15306
    public getDiscountsForEntity_result() {
15307
    }
15308
 
15309
    public getDiscountsForEntity_result(
15310
      Map<String,Double> success)
15311
    {
15312
      this();
15313
      this.success = success;
15314
    }
15315
 
15316
    /**
15317
     * Performs a deep copy on <i>other</i>.
15318
     */
15319
    public getDiscountsForEntity_result(getDiscountsForEntity_result other) {
15320
      if (other.isSetSuccess()) {
15321
        Map<String,Double> __this__success = new HashMap<String,Double>();
15322
        for (Map.Entry<String, Double> other_element : other.success.entrySet()) {
15323
 
15324
          String other_element_key = other_element.getKey();
15325
          Double other_element_value = other_element.getValue();
15326
 
15327
          String __this__success_copy_key = other_element_key;
15328
 
15329
          Double __this__success_copy_value = other_element_value;
15330
 
15331
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
15332
        }
15333
        this.success = __this__success;
15334
      }
15335
    }
15336
 
15337
    public getDiscountsForEntity_result deepCopy() {
15338
      return new getDiscountsForEntity_result(this);
15339
    }
15340
 
15341
    @Override
15342
    public void clear() {
15343
      this.success = null;
15344
    }
15345
 
15346
    public int getSuccessSize() {
15347
      return (this.success == null) ? 0 : this.success.size();
15348
    }
15349
 
15350
    public void putToSuccess(String key, double val) {
15351
      if (this.success == null) {
15352
        this.success = new HashMap<String,Double>();
15353
      }
15354
      this.success.put(key, val);
15355
    }
15356
 
15357
    public Map<String,Double> getSuccess() {
15358
      return this.success;
15359
    }
15360
 
15361
    public void setSuccess(Map<String,Double> success) {
15362
      this.success = success;
15363
    }
15364
 
15365
    public void unsetSuccess() {
15366
      this.success = null;
15367
    }
15368
 
15369
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
15370
    public boolean isSetSuccess() {
15371
      return this.success != null;
15372
    }
15373
 
15374
    public void setSuccessIsSet(boolean value) {
15375
      if (!value) {
15376
        this.success = null;
15377
      }
15378
    }
15379
 
15380
    public void setFieldValue(_Fields field, Object value) {
15381
      switch (field) {
15382
      case SUCCESS:
15383
        if (value == null) {
15384
          unsetSuccess();
15385
        } else {
15386
          setSuccess((Map<String,Double>)value);
15387
        }
15388
        break;
15389
 
15390
      }
15391
    }
15392
 
15393
    public Object getFieldValue(_Fields field) {
15394
      switch (field) {
15395
      case SUCCESS:
15396
        return getSuccess();
15397
 
15398
      }
15399
      throw new IllegalStateException();
15400
    }
15401
 
15402
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15403
    public boolean isSet(_Fields field) {
15404
      if (field == null) {
15405
        throw new IllegalArgumentException();
15406
      }
15407
 
15408
      switch (field) {
15409
      case SUCCESS:
15410
        return isSetSuccess();
15411
      }
15412
      throw new IllegalStateException();
15413
    }
15414
 
15415
    @Override
15416
    public boolean equals(Object that) {
15417
      if (that == null)
15418
        return false;
15419
      if (that instanceof getDiscountsForEntity_result)
15420
        return this.equals((getDiscountsForEntity_result)that);
15421
      return false;
15422
    }
15423
 
15424
    public boolean equals(getDiscountsForEntity_result that) {
15425
      if (that == null)
15426
        return false;
15427
 
15428
      boolean this_present_success = true && this.isSetSuccess();
15429
      boolean that_present_success = true && that.isSetSuccess();
15430
      if (this_present_success || that_present_success) {
15431
        if (!(this_present_success && that_present_success))
15432
          return false;
15433
        if (!this.success.equals(that.success))
15434
          return false;
15435
      }
15436
 
15437
      return true;
15438
    }
15439
 
15440
    @Override
15441
    public int hashCode() {
15442
      return 0;
15443
    }
15444
 
15445
    public int compareTo(getDiscountsForEntity_result other) {
15446
      if (!getClass().equals(other.getClass())) {
15447
        return getClass().getName().compareTo(other.getClass().getName());
15448
      }
15449
 
15450
      int lastComparison = 0;
15451
      getDiscountsForEntity_result typedOther = (getDiscountsForEntity_result)other;
15452
 
15453
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
15454
      if (lastComparison != 0) {
15455
        return lastComparison;
15456
      }
15457
      if (isSetSuccess()) {
15458
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
15459
        if (lastComparison != 0) {
15460
          return lastComparison;
15461
        }
15462
      }
15463
      return 0;
15464
    }
15465
 
15466
    public _Fields fieldForId(int fieldId) {
15467
      return _Fields.findByThriftId(fieldId);
15468
    }
15469
 
15470
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15471
      org.apache.thrift.protocol.TField field;
15472
      iprot.readStructBegin();
15473
      while (true)
15474
      {
15475
        field = iprot.readFieldBegin();
15476
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
15477
          break;
15478
        }
15479
        switch (field.id) {
15480
          case 0: // SUCCESS
15481
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
15482
              {
6497 amit.gupta 15483
                org.apache.thrift.protocol.TMap _map37 = iprot.readMapBegin();
15484
                this.success = new HashMap<String,Double>(2*_map37.size);
15485
                for (int _i38 = 0; _i38 < _map37.size; ++_i38)
4494 varun.gupt 15486
                {
6497 amit.gupta 15487
                  String _key39; // required
15488
                  double _val40; // required
15489
                  _key39 = iprot.readString();
15490
                  _val40 = iprot.readDouble();
15491
                  this.success.put(_key39, _val40);
4494 varun.gupt 15492
                }
15493
                iprot.readMapEnd();
15494
              }
15495
            } else { 
15496
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15497
            }
15498
            break;
15499
          default:
15500
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15501
        }
15502
        iprot.readFieldEnd();
15503
      }
15504
      iprot.readStructEnd();
15505
      validate();
15506
    }
15507
 
15508
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
15509
      oprot.writeStructBegin(STRUCT_DESC);
15510
 
15511
      if (this.isSetSuccess()) {
15512
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
15513
        {
15514
          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 15515
          for (Map.Entry<String, Double> _iter41 : this.success.entrySet())
4494 varun.gupt 15516
          {
6497 amit.gupta 15517
            oprot.writeString(_iter41.getKey());
15518
            oprot.writeDouble(_iter41.getValue());
4494 varun.gupt 15519
          }
15520
          oprot.writeMapEnd();
15521
        }
15522
        oprot.writeFieldEnd();
15523
      }
15524
      oprot.writeFieldStop();
15525
      oprot.writeStructEnd();
15526
    }
15527
 
15528
    @Override
15529
    public String toString() {
15530
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_result(");
15531
      boolean first = true;
15532
 
15533
      sb.append("success:");
15534
      if (this.success == null) {
15535
        sb.append("null");
15536
      } else {
15537
        sb.append(this.success);
15538
      }
15539
      first = false;
15540
      sb.append(")");
15541
      return sb.toString();
15542
    }
15543
 
15544
    public void validate() throws org.apache.thrift.TException {
15545
      // check for required fields
15546
    }
15547
 
15548
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15549
      try {
15550
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15551
      } catch (org.apache.thrift.TException te) {
15552
        throw new java.io.IOException(te);
15553
      }
15554
    }
15555
 
15556
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15557
      try {
15558
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15559
      } catch (org.apache.thrift.TException te) {
15560
        throw new java.io.IOException(te);
15561
      }
15562
    }
15563
 
15564
  }
15565
 
5469 rajveer 15566
  public static class addVoucher_args implements org.apache.thrift.TBase<addVoucher_args, addVoucher_args._Fields>, java.io.Serializable, Cloneable   {
15567
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_args");
15568
 
15569
    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);
15570
 
15571
    private Voucher voucher; // required
15572
 
15573
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
15574
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
15575
      VOUCHER((short)1, "voucher");
15576
 
15577
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15578
 
15579
      static {
15580
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15581
          byName.put(field.getFieldName(), field);
15582
        }
15583
      }
15584
 
15585
      /**
15586
       * Find the _Fields constant that matches fieldId, or null if its not found.
15587
       */
15588
      public static _Fields findByThriftId(int fieldId) {
15589
        switch(fieldId) {
15590
          case 1: // VOUCHER
15591
            return VOUCHER;
15592
          default:
15593
            return null;
15594
        }
15595
      }
15596
 
15597
      /**
15598
       * Find the _Fields constant that matches fieldId, throwing an exception
15599
       * if it is not found.
15600
       */
15601
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15602
        _Fields fields = findByThriftId(fieldId);
15603
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15604
        return fields;
15605
      }
15606
 
15607
      /**
15608
       * Find the _Fields constant that matches name, or null if its not found.
15609
       */
15610
      public static _Fields findByName(String name) {
15611
        return byName.get(name);
15612
      }
15613
 
15614
      private final short _thriftId;
15615
      private final String _fieldName;
15616
 
15617
      _Fields(short thriftId, String fieldName) {
15618
        _thriftId = thriftId;
15619
        _fieldName = fieldName;
15620
      }
15621
 
15622
      public short getThriftFieldId() {
15623
        return _thriftId;
15624
      }
15625
 
15626
      public String getFieldName() {
15627
        return _fieldName;
15628
      }
15629
    }
15630
 
15631
    // isset id assignments
15632
 
15633
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
15634
    static {
15635
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15636
      tmpMap.put(_Fields.VOUCHER, new org.apache.thrift.meta_data.FieldMetaData("voucher", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15637
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
15638
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15639
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_args.class, metaDataMap);
15640
    }
15641
 
15642
    public addVoucher_args() {
15643
    }
15644
 
15645
    public addVoucher_args(
15646
      Voucher voucher)
15647
    {
15648
      this();
15649
      this.voucher = voucher;
15650
    }
15651
 
15652
    /**
15653
     * Performs a deep copy on <i>other</i>.
15654
     */
15655
    public addVoucher_args(addVoucher_args other) {
15656
      if (other.isSetVoucher()) {
15657
        this.voucher = new Voucher(other.voucher);
15658
      }
15659
    }
15660
 
15661
    public addVoucher_args deepCopy() {
15662
      return new addVoucher_args(this);
15663
    }
15664
 
15665
    @Override
15666
    public void clear() {
15667
      this.voucher = null;
15668
    }
15669
 
15670
    public Voucher getVoucher() {
15671
      return this.voucher;
15672
    }
15673
 
15674
    public void setVoucher(Voucher voucher) {
15675
      this.voucher = voucher;
15676
    }
15677
 
15678
    public void unsetVoucher() {
15679
      this.voucher = null;
15680
    }
15681
 
15682
    /** Returns true if field voucher is set (has been assigned a value) and false otherwise */
15683
    public boolean isSetVoucher() {
15684
      return this.voucher != null;
15685
    }
15686
 
15687
    public void setVoucherIsSet(boolean value) {
15688
      if (!value) {
15689
        this.voucher = null;
15690
      }
15691
    }
15692
 
15693
    public void setFieldValue(_Fields field, Object value) {
15694
      switch (field) {
15695
      case VOUCHER:
15696
        if (value == null) {
15697
          unsetVoucher();
15698
        } else {
15699
          setVoucher((Voucher)value);
15700
        }
15701
        break;
15702
 
15703
      }
15704
    }
15705
 
15706
    public Object getFieldValue(_Fields field) {
15707
      switch (field) {
15708
      case VOUCHER:
15709
        return getVoucher();
15710
 
15711
      }
15712
      throw new IllegalStateException();
15713
    }
15714
 
15715
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15716
    public boolean isSet(_Fields field) {
15717
      if (field == null) {
15718
        throw new IllegalArgumentException();
15719
      }
15720
 
15721
      switch (field) {
15722
      case VOUCHER:
15723
        return isSetVoucher();
15724
      }
15725
      throw new IllegalStateException();
15726
    }
15727
 
15728
    @Override
15729
    public boolean equals(Object that) {
15730
      if (that == null)
15731
        return false;
15732
      if (that instanceof addVoucher_args)
15733
        return this.equals((addVoucher_args)that);
15734
      return false;
15735
    }
15736
 
15737
    public boolean equals(addVoucher_args that) {
15738
      if (that == null)
15739
        return false;
15740
 
15741
      boolean this_present_voucher = true && this.isSetVoucher();
15742
      boolean that_present_voucher = true && that.isSetVoucher();
15743
      if (this_present_voucher || that_present_voucher) {
15744
        if (!(this_present_voucher && that_present_voucher))
15745
          return false;
15746
        if (!this.voucher.equals(that.voucher))
15747
          return false;
15748
      }
15749
 
15750
      return true;
15751
    }
15752
 
15753
    @Override
15754
    public int hashCode() {
15755
      return 0;
15756
    }
15757
 
15758
    public int compareTo(addVoucher_args other) {
15759
      if (!getClass().equals(other.getClass())) {
15760
        return getClass().getName().compareTo(other.getClass().getName());
15761
      }
15762
 
15763
      int lastComparison = 0;
15764
      addVoucher_args typedOther = (addVoucher_args)other;
15765
 
15766
      lastComparison = Boolean.valueOf(isSetVoucher()).compareTo(typedOther.isSetVoucher());
15767
      if (lastComparison != 0) {
15768
        return lastComparison;
15769
      }
15770
      if (isSetVoucher()) {
15771
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucher, typedOther.voucher);
15772
        if (lastComparison != 0) {
15773
          return lastComparison;
15774
        }
15775
      }
15776
      return 0;
15777
    }
15778
 
15779
    public _Fields fieldForId(int fieldId) {
15780
      return _Fields.findByThriftId(fieldId);
15781
    }
15782
 
15783
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15784
      org.apache.thrift.protocol.TField field;
15785
      iprot.readStructBegin();
15786
      while (true)
15787
      {
15788
        field = iprot.readFieldBegin();
15789
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
15790
          break;
15791
        }
15792
        switch (field.id) {
15793
          case 1: // VOUCHER
15794
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
15795
              this.voucher = new Voucher();
15796
              this.voucher.read(iprot);
15797
            } else { 
15798
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15799
            }
15800
            break;
15801
          default:
15802
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15803
        }
15804
        iprot.readFieldEnd();
15805
      }
15806
      iprot.readStructEnd();
15807
      validate();
15808
    }
15809
 
15810
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
15811
      validate();
15812
 
15813
      oprot.writeStructBegin(STRUCT_DESC);
15814
      if (this.voucher != null) {
15815
        oprot.writeFieldBegin(VOUCHER_FIELD_DESC);
15816
        this.voucher.write(oprot);
15817
        oprot.writeFieldEnd();
15818
      }
15819
      oprot.writeFieldStop();
15820
      oprot.writeStructEnd();
15821
    }
15822
 
15823
    @Override
15824
    public String toString() {
15825
      StringBuilder sb = new StringBuilder("addVoucher_args(");
15826
      boolean first = true;
15827
 
15828
      sb.append("voucher:");
15829
      if (this.voucher == null) {
15830
        sb.append("null");
15831
      } else {
15832
        sb.append(this.voucher);
15833
      }
15834
      first = false;
15835
      sb.append(")");
15836
      return sb.toString();
15837
    }
15838
 
15839
    public void validate() throws org.apache.thrift.TException {
15840
      // check for required fields
15841
    }
15842
 
15843
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15844
      try {
15845
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15846
      } catch (org.apache.thrift.TException te) {
15847
        throw new java.io.IOException(te);
15848
      }
15849
    }
15850
 
15851
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15852
      try {
15853
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15854
      } catch (org.apache.thrift.TException te) {
15855
        throw new java.io.IOException(te);
15856
      }
15857
    }
15858
 
15859
  }
15860
 
15861
  public static class addVoucher_result implements org.apache.thrift.TBase<addVoucher_result, addVoucher_result._Fields>, java.io.Serializable, Cloneable   {
15862
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_result");
15863
 
15864
 
15865
 
15866
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
15867
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
15868
;
15869
 
15870
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15871
 
15872
      static {
15873
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15874
          byName.put(field.getFieldName(), field);
15875
        }
15876
      }
15877
 
15878
      /**
15879
       * Find the _Fields constant that matches fieldId, or null if its not found.
15880
       */
15881
      public static _Fields findByThriftId(int fieldId) {
15882
        switch(fieldId) {
15883
          default:
15884
            return null;
15885
        }
15886
      }
15887
 
15888
      /**
15889
       * Find the _Fields constant that matches fieldId, throwing an exception
15890
       * if it is not found.
15891
       */
15892
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15893
        _Fields fields = findByThriftId(fieldId);
15894
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15895
        return fields;
15896
      }
15897
 
15898
      /**
15899
       * Find the _Fields constant that matches name, or null if its not found.
15900
       */
15901
      public static _Fields findByName(String name) {
15902
        return byName.get(name);
15903
      }
15904
 
15905
      private final short _thriftId;
15906
      private final String _fieldName;
15907
 
15908
      _Fields(short thriftId, String fieldName) {
15909
        _thriftId = thriftId;
15910
        _fieldName = fieldName;
15911
      }
15912
 
15913
      public short getThriftFieldId() {
15914
        return _thriftId;
15915
      }
15916
 
15917
      public String getFieldName() {
15918
        return _fieldName;
15919
      }
15920
    }
15921
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
15922
    static {
15923
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15924
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15925
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_result.class, metaDataMap);
15926
    }
15927
 
15928
    public addVoucher_result() {
15929
    }
15930
 
15931
    /**
15932
     * Performs a deep copy on <i>other</i>.
15933
     */
15934
    public addVoucher_result(addVoucher_result other) {
15935
    }
15936
 
15937
    public addVoucher_result deepCopy() {
15938
      return new addVoucher_result(this);
15939
    }
15940
 
15941
    @Override
15942
    public void clear() {
15943
    }
15944
 
15945
    public void setFieldValue(_Fields field, Object value) {
15946
      switch (field) {
15947
      }
15948
    }
15949
 
15950
    public Object getFieldValue(_Fields field) {
15951
      switch (field) {
15952
      }
15953
      throw new IllegalStateException();
15954
    }
15955
 
15956
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15957
    public boolean isSet(_Fields field) {
15958
      if (field == null) {
15959
        throw new IllegalArgumentException();
15960
      }
15961
 
15962
      switch (field) {
15963
      }
15964
      throw new IllegalStateException();
15965
    }
15966
 
15967
    @Override
15968
    public boolean equals(Object that) {
15969
      if (that == null)
15970
        return false;
15971
      if (that instanceof addVoucher_result)
15972
        return this.equals((addVoucher_result)that);
15973
      return false;
15974
    }
15975
 
15976
    public boolean equals(addVoucher_result that) {
15977
      if (that == null)
15978
        return false;
15979
 
15980
      return true;
15981
    }
15982
 
15983
    @Override
15984
    public int hashCode() {
15985
      return 0;
15986
    }
15987
 
15988
    public int compareTo(addVoucher_result other) {
15989
      if (!getClass().equals(other.getClass())) {
15990
        return getClass().getName().compareTo(other.getClass().getName());
15991
      }
15992
 
15993
      int lastComparison = 0;
15994
      addVoucher_result typedOther = (addVoucher_result)other;
15995
 
15996
      return 0;
15997
    }
15998
 
15999
    public _Fields fieldForId(int fieldId) {
16000
      return _Fields.findByThriftId(fieldId);
16001
    }
16002
 
16003
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16004
      org.apache.thrift.protocol.TField field;
16005
      iprot.readStructBegin();
16006
      while (true)
16007
      {
16008
        field = iprot.readFieldBegin();
16009
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
16010
          break;
16011
        }
16012
        switch (field.id) {
16013
          default:
16014
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16015
        }
16016
        iprot.readFieldEnd();
16017
      }
16018
      iprot.readStructEnd();
16019
      validate();
16020
    }
16021
 
16022
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
16023
      oprot.writeStructBegin(STRUCT_DESC);
16024
 
16025
      oprot.writeFieldStop();
16026
      oprot.writeStructEnd();
16027
    }
16028
 
16029
    @Override
16030
    public String toString() {
16031
      StringBuilder sb = new StringBuilder("addVoucher_result(");
16032
      boolean first = true;
16033
 
16034
      sb.append(")");
16035
      return sb.toString();
16036
    }
16037
 
16038
    public void validate() throws org.apache.thrift.TException {
16039
      // check for required fields
16040
    }
16041
 
16042
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16043
      try {
16044
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16045
      } catch (org.apache.thrift.TException te) {
16046
        throw new java.io.IOException(te);
16047
      }
16048
    }
16049
 
16050
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16051
      try {
16052
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16053
      } catch (org.apache.thrift.TException te) {
16054
        throw new java.io.IOException(te);
16055
      }
16056
    }
16057
 
16058
  }
16059
 
16060
  public static class assignVoucher_args implements org.apache.thrift.TBase<assignVoucher_args, assignVoucher_args._Fields>, java.io.Serializable, Cloneable   {
16061
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_args");
16062
 
16063
    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);
16064
    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);
16065
    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);
16066
    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);
16067
 
16068
    private long userId; // required
16069
    private String userEmail; // required
16070
    private VoucherType voucherType; // required
16071
    private long amount; // required
16072
 
16073
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
16074
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
16075
      USER_ID((short)1, "userId"),
16076
      USER_EMAIL((short)2, "userEmail"),
16077
      /**
16078
       * 
16079
       * @see VoucherType
16080
       */
16081
      VOUCHER_TYPE((short)3, "voucherType"),
16082
      AMOUNT((short)4, "amount");
16083
 
16084
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16085
 
16086
      static {
16087
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16088
          byName.put(field.getFieldName(), field);
16089
        }
16090
      }
16091
 
16092
      /**
16093
       * Find the _Fields constant that matches fieldId, or null if its not found.
16094
       */
16095
      public static _Fields findByThriftId(int fieldId) {
16096
        switch(fieldId) {
16097
          case 1: // USER_ID
16098
            return USER_ID;
16099
          case 2: // USER_EMAIL
16100
            return USER_EMAIL;
16101
          case 3: // VOUCHER_TYPE
16102
            return VOUCHER_TYPE;
16103
          case 4: // AMOUNT
16104
            return AMOUNT;
16105
          default:
16106
            return null;
16107
        }
16108
      }
16109
 
16110
      /**
16111
       * Find the _Fields constant that matches fieldId, throwing an exception
16112
       * if it is not found.
16113
       */
16114
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16115
        _Fields fields = findByThriftId(fieldId);
16116
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16117
        return fields;
16118
      }
16119
 
16120
      /**
16121
       * Find the _Fields constant that matches name, or null if its not found.
16122
       */
16123
      public static _Fields findByName(String name) {
16124
        return byName.get(name);
16125
      }
16126
 
16127
      private final short _thriftId;
16128
      private final String _fieldName;
16129
 
16130
      _Fields(short thriftId, String fieldName) {
16131
        _thriftId = thriftId;
16132
        _fieldName = fieldName;
16133
      }
16134
 
16135
      public short getThriftFieldId() {
16136
        return _thriftId;
16137
      }
16138
 
16139
      public String getFieldName() {
16140
        return _fieldName;
16141
      }
16142
    }
16143
 
16144
    // isset id assignments
16145
    private static final int __USERID_ISSET_ID = 0;
16146
    private static final int __AMOUNT_ISSET_ID = 1;
16147
    private BitSet __isset_bit_vector = new BitSet(2);
16148
 
16149
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
16150
    static {
16151
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16152
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16153
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
16154
      tmpMap.put(_Fields.USER_EMAIL, new org.apache.thrift.meta_data.FieldMetaData("userEmail", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16155
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
16156
      tmpMap.put(_Fields.VOUCHER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("voucherType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16157
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, VoucherType.class)));
16158
      tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16159
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
16160
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16161
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_args.class, metaDataMap);
16162
    }
16163
 
16164
    public assignVoucher_args() {
16165
    }
16166
 
16167
    public assignVoucher_args(
16168
      long userId,
16169
      String userEmail,
16170
      VoucherType voucherType,
16171
      long amount)
16172
    {
16173
      this();
16174
      this.userId = userId;
16175
      setUserIdIsSet(true);
16176
      this.userEmail = userEmail;
16177
      this.voucherType = voucherType;
16178
      this.amount = amount;
16179
      setAmountIsSet(true);
16180
    }
16181
 
16182
    /**
16183
     * Performs a deep copy on <i>other</i>.
16184
     */
16185
    public assignVoucher_args(assignVoucher_args other) {
16186
      __isset_bit_vector.clear();
16187
      __isset_bit_vector.or(other.__isset_bit_vector);
16188
      this.userId = other.userId;
16189
      if (other.isSetUserEmail()) {
16190
        this.userEmail = other.userEmail;
16191
      }
16192
      if (other.isSetVoucherType()) {
16193
        this.voucherType = other.voucherType;
16194
      }
16195
      this.amount = other.amount;
16196
    }
16197
 
16198
    public assignVoucher_args deepCopy() {
16199
      return new assignVoucher_args(this);
16200
    }
16201
 
16202
    @Override
16203
    public void clear() {
16204
      setUserIdIsSet(false);
16205
      this.userId = 0;
16206
      this.userEmail = null;
16207
      this.voucherType = null;
16208
      setAmountIsSet(false);
16209
      this.amount = 0;
16210
    }
16211
 
16212
    public long getUserId() {
16213
      return this.userId;
16214
    }
16215
 
16216
    public void setUserId(long userId) {
16217
      this.userId = userId;
16218
      setUserIdIsSet(true);
16219
    }
16220
 
16221
    public void unsetUserId() {
16222
      __isset_bit_vector.clear(__USERID_ISSET_ID);
16223
    }
16224
 
16225
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
16226
    public boolean isSetUserId() {
16227
      return __isset_bit_vector.get(__USERID_ISSET_ID);
16228
    }
16229
 
16230
    public void setUserIdIsSet(boolean value) {
16231
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
16232
    }
16233
 
16234
    public String getUserEmail() {
16235
      return this.userEmail;
16236
    }
16237
 
16238
    public void setUserEmail(String userEmail) {
16239
      this.userEmail = userEmail;
16240
    }
16241
 
16242
    public void unsetUserEmail() {
16243
      this.userEmail = null;
16244
    }
16245
 
16246
    /** Returns true if field userEmail is set (has been assigned a value) and false otherwise */
16247
    public boolean isSetUserEmail() {
16248
      return this.userEmail != null;
16249
    }
16250
 
16251
    public void setUserEmailIsSet(boolean value) {
16252
      if (!value) {
16253
        this.userEmail = null;
16254
      }
16255
    }
16256
 
16257
    /**
16258
     * 
16259
     * @see VoucherType
16260
     */
16261
    public VoucherType getVoucherType() {
16262
      return this.voucherType;
16263
    }
16264
 
16265
    /**
16266
     * 
16267
     * @see VoucherType
16268
     */
16269
    public void setVoucherType(VoucherType voucherType) {
16270
      this.voucherType = voucherType;
16271
    }
16272
 
16273
    public void unsetVoucherType() {
16274
      this.voucherType = null;
16275
    }
16276
 
16277
    /** Returns true if field voucherType is set (has been assigned a value) and false otherwise */
16278
    public boolean isSetVoucherType() {
16279
      return this.voucherType != null;
16280
    }
16281
 
16282
    public void setVoucherTypeIsSet(boolean value) {
16283
      if (!value) {
16284
        this.voucherType = null;
16285
      }
16286
    }
16287
 
16288
    public long getAmount() {
16289
      return this.amount;
16290
    }
16291
 
16292
    public void setAmount(long amount) {
16293
      this.amount = amount;
16294
      setAmountIsSet(true);
16295
    }
16296
 
16297
    public void unsetAmount() {
16298
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
16299
    }
16300
 
16301
    /** Returns true if field amount is set (has been assigned a value) and false otherwise */
16302
    public boolean isSetAmount() {
16303
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
16304
    }
16305
 
16306
    public void setAmountIsSet(boolean value) {
16307
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
16308
    }
16309
 
16310
    public void setFieldValue(_Fields field, Object value) {
16311
      switch (field) {
16312
      case USER_ID:
16313
        if (value == null) {
16314
          unsetUserId();
16315
        } else {
16316
          setUserId((Long)value);
16317
        }
16318
        break;
16319
 
16320
      case USER_EMAIL:
16321
        if (value == null) {
16322
          unsetUserEmail();
16323
        } else {
16324
          setUserEmail((String)value);
16325
        }
16326
        break;
16327
 
16328
      case VOUCHER_TYPE:
16329
        if (value == null) {
16330
          unsetVoucherType();
16331
        } else {
16332
          setVoucherType((VoucherType)value);
16333
        }
16334
        break;
16335
 
16336
      case AMOUNT:
16337
        if (value == null) {
16338
          unsetAmount();
16339
        } else {
16340
          setAmount((Long)value);
16341
        }
16342
        break;
16343
 
16344
      }
16345
    }
16346
 
16347
    public Object getFieldValue(_Fields field) {
16348
      switch (field) {
16349
      case USER_ID:
16350
        return Long.valueOf(getUserId());
16351
 
16352
      case USER_EMAIL:
16353
        return getUserEmail();
16354
 
16355
      case VOUCHER_TYPE:
16356
        return getVoucherType();
16357
 
16358
      case AMOUNT:
16359
        return Long.valueOf(getAmount());
16360
 
16361
      }
16362
      throw new IllegalStateException();
16363
    }
16364
 
16365
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16366
    public boolean isSet(_Fields field) {
16367
      if (field == null) {
16368
        throw new IllegalArgumentException();
16369
      }
16370
 
16371
      switch (field) {
16372
      case USER_ID:
16373
        return isSetUserId();
16374
      case USER_EMAIL:
16375
        return isSetUserEmail();
16376
      case VOUCHER_TYPE:
16377
        return isSetVoucherType();
16378
      case AMOUNT:
16379
        return isSetAmount();
16380
      }
16381
      throw new IllegalStateException();
16382
    }
16383
 
16384
    @Override
16385
    public boolean equals(Object that) {
16386
      if (that == null)
16387
        return false;
16388
      if (that instanceof assignVoucher_args)
16389
        return this.equals((assignVoucher_args)that);
16390
      return false;
16391
    }
16392
 
16393
    public boolean equals(assignVoucher_args that) {
16394
      if (that == null)
16395
        return false;
16396
 
16397
      boolean this_present_userId = true;
16398
      boolean that_present_userId = true;
16399
      if (this_present_userId || that_present_userId) {
16400
        if (!(this_present_userId && that_present_userId))
16401
          return false;
16402
        if (this.userId != that.userId)
16403
          return false;
16404
      }
16405
 
16406
      boolean this_present_userEmail = true && this.isSetUserEmail();
16407
      boolean that_present_userEmail = true && that.isSetUserEmail();
16408
      if (this_present_userEmail || that_present_userEmail) {
16409
        if (!(this_present_userEmail && that_present_userEmail))
16410
          return false;
16411
        if (!this.userEmail.equals(that.userEmail))
16412
          return false;
16413
      }
16414
 
16415
      boolean this_present_voucherType = true && this.isSetVoucherType();
16416
      boolean that_present_voucherType = true && that.isSetVoucherType();
16417
      if (this_present_voucherType || that_present_voucherType) {
16418
        if (!(this_present_voucherType && that_present_voucherType))
16419
          return false;
16420
        if (!this.voucherType.equals(that.voucherType))
16421
          return false;
16422
      }
16423
 
16424
      boolean this_present_amount = true;
16425
      boolean that_present_amount = true;
16426
      if (this_present_amount || that_present_amount) {
16427
        if (!(this_present_amount && that_present_amount))
16428
          return false;
16429
        if (this.amount != that.amount)
16430
          return false;
16431
      }
16432
 
16433
      return true;
16434
    }
16435
 
16436
    @Override
16437
    public int hashCode() {
16438
      return 0;
16439
    }
16440
 
16441
    public int compareTo(assignVoucher_args other) {
16442
      if (!getClass().equals(other.getClass())) {
16443
        return getClass().getName().compareTo(other.getClass().getName());
16444
      }
16445
 
16446
      int lastComparison = 0;
16447
      assignVoucher_args typedOther = (assignVoucher_args)other;
16448
 
16449
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
16450
      if (lastComparison != 0) {
16451
        return lastComparison;
16452
      }
16453
      if (isSetUserId()) {
16454
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
16455
        if (lastComparison != 0) {
16456
          return lastComparison;
16457
        }
16458
      }
16459
      lastComparison = Boolean.valueOf(isSetUserEmail()).compareTo(typedOther.isSetUserEmail());
16460
      if (lastComparison != 0) {
16461
        return lastComparison;
16462
      }
16463
      if (isSetUserEmail()) {
16464
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userEmail, typedOther.userEmail);
16465
        if (lastComparison != 0) {
16466
          return lastComparison;
16467
        }
16468
      }
16469
      lastComparison = Boolean.valueOf(isSetVoucherType()).compareTo(typedOther.isSetVoucherType());
16470
      if (lastComparison != 0) {
16471
        return lastComparison;
16472
      }
16473
      if (isSetVoucherType()) {
16474
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherType, typedOther.voucherType);
16475
        if (lastComparison != 0) {
16476
          return lastComparison;
16477
        }
16478
      }
16479
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
16480
      if (lastComparison != 0) {
16481
        return lastComparison;
16482
      }
16483
      if (isSetAmount()) {
16484
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
16485
        if (lastComparison != 0) {
16486
          return lastComparison;
16487
        }
16488
      }
16489
      return 0;
16490
    }
16491
 
16492
    public _Fields fieldForId(int fieldId) {
16493
      return _Fields.findByThriftId(fieldId);
16494
    }
16495
 
16496
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16497
      org.apache.thrift.protocol.TField field;
16498
      iprot.readStructBegin();
16499
      while (true)
16500
      {
16501
        field = iprot.readFieldBegin();
16502
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
16503
          break;
16504
        }
16505
        switch (field.id) {
16506
          case 1: // USER_ID
16507
            if (field.type == org.apache.thrift.protocol.TType.I64) {
16508
              this.userId = iprot.readI64();
16509
              setUserIdIsSet(true);
16510
            } else { 
16511
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16512
            }
16513
            break;
16514
          case 2: // USER_EMAIL
16515
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
16516
              this.userEmail = iprot.readString();
16517
            } else { 
16518
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16519
            }
16520
            break;
16521
          case 3: // VOUCHER_TYPE
16522
            if (field.type == org.apache.thrift.protocol.TType.I32) {
16523
              this.voucherType = VoucherType.findByValue(iprot.readI32());
16524
            } else { 
16525
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16526
            }
16527
            break;
16528
          case 4: // AMOUNT
16529
            if (field.type == org.apache.thrift.protocol.TType.I64) {
16530
              this.amount = iprot.readI64();
16531
              setAmountIsSet(true);
16532
            } else { 
16533
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16534
            }
16535
            break;
16536
          default:
16537
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16538
        }
16539
        iprot.readFieldEnd();
16540
      }
16541
      iprot.readStructEnd();
16542
      validate();
16543
    }
16544
 
16545
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
16546
      validate();
16547
 
16548
      oprot.writeStructBegin(STRUCT_DESC);
16549
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
16550
      oprot.writeI64(this.userId);
16551
      oprot.writeFieldEnd();
16552
      if (this.userEmail != null) {
16553
        oprot.writeFieldBegin(USER_EMAIL_FIELD_DESC);
16554
        oprot.writeString(this.userEmail);
16555
        oprot.writeFieldEnd();
16556
      }
16557
      if (this.voucherType != null) {
16558
        oprot.writeFieldBegin(VOUCHER_TYPE_FIELD_DESC);
16559
        oprot.writeI32(this.voucherType.getValue());
16560
        oprot.writeFieldEnd();
16561
      }
16562
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
16563
      oprot.writeI64(this.amount);
16564
      oprot.writeFieldEnd();
16565
      oprot.writeFieldStop();
16566
      oprot.writeStructEnd();
16567
    }
16568
 
16569
    @Override
16570
    public String toString() {
16571
      StringBuilder sb = new StringBuilder("assignVoucher_args(");
16572
      boolean first = true;
16573
 
16574
      sb.append("userId:");
16575
      sb.append(this.userId);
16576
      first = false;
16577
      if (!first) sb.append(", ");
16578
      sb.append("userEmail:");
16579
      if (this.userEmail == null) {
16580
        sb.append("null");
16581
      } else {
16582
        sb.append(this.userEmail);
16583
      }
16584
      first = false;
16585
      if (!first) sb.append(", ");
16586
      sb.append("voucherType:");
16587
      if (this.voucherType == null) {
16588
        sb.append("null");
16589
      } else {
16590
        sb.append(this.voucherType);
16591
      }
16592
      first = false;
16593
      if (!first) sb.append(", ");
16594
      sb.append("amount:");
16595
      sb.append(this.amount);
16596
      first = false;
16597
      sb.append(")");
16598
      return sb.toString();
16599
    }
16600
 
16601
    public void validate() throws org.apache.thrift.TException {
16602
      // check for required fields
16603
    }
16604
 
16605
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16606
      try {
16607
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16608
      } catch (org.apache.thrift.TException te) {
16609
        throw new java.io.IOException(te);
16610
      }
16611
    }
16612
 
16613
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16614
      try {
16615
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
16616
        __isset_bit_vector = new BitSet(1);
16617
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16618
      } catch (org.apache.thrift.TException te) {
16619
        throw new java.io.IOException(te);
16620
      }
16621
    }
16622
 
16623
  }
16624
 
16625
  public static class assignVoucher_result implements org.apache.thrift.TBase<assignVoucher_result, assignVoucher_result._Fields>, java.io.Serializable, Cloneable   {
16626
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_result");
16627
 
16628
    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);
16629
 
16630
    private Voucher success; // required
16631
 
16632
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
16633
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
16634
      SUCCESS((short)0, "success");
16635
 
16636
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16637
 
16638
      static {
16639
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16640
          byName.put(field.getFieldName(), field);
16641
        }
16642
      }
16643
 
16644
      /**
16645
       * Find the _Fields constant that matches fieldId, or null if its not found.
16646
       */
16647
      public static _Fields findByThriftId(int fieldId) {
16648
        switch(fieldId) {
16649
          case 0: // SUCCESS
16650
            return SUCCESS;
16651
          default:
16652
            return null;
16653
        }
16654
      }
16655
 
16656
      /**
16657
       * Find the _Fields constant that matches fieldId, throwing an exception
16658
       * if it is not found.
16659
       */
16660
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16661
        _Fields fields = findByThriftId(fieldId);
16662
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16663
        return fields;
16664
      }
16665
 
16666
      /**
16667
       * Find the _Fields constant that matches name, or null if its not found.
16668
       */
16669
      public static _Fields findByName(String name) {
16670
        return byName.get(name);
16671
      }
16672
 
16673
      private final short _thriftId;
16674
      private final String _fieldName;
16675
 
16676
      _Fields(short thriftId, String fieldName) {
16677
        _thriftId = thriftId;
16678
        _fieldName = fieldName;
16679
      }
16680
 
16681
      public short getThriftFieldId() {
16682
        return _thriftId;
16683
      }
16684
 
16685
      public String getFieldName() {
16686
        return _fieldName;
16687
      }
16688
    }
16689
 
16690
    // isset id assignments
16691
 
16692
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
16693
    static {
16694
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16695
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16696
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
16697
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16698
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_result.class, metaDataMap);
16699
    }
16700
 
16701
    public assignVoucher_result() {
16702
    }
16703
 
16704
    public assignVoucher_result(
16705
      Voucher success)
16706
    {
16707
      this();
16708
      this.success = success;
16709
    }
16710
 
16711
    /**
16712
     * Performs a deep copy on <i>other</i>.
16713
     */
16714
    public assignVoucher_result(assignVoucher_result other) {
16715
      if (other.isSetSuccess()) {
16716
        this.success = new Voucher(other.success);
16717
      }
16718
    }
16719
 
16720
    public assignVoucher_result deepCopy() {
16721
      return new assignVoucher_result(this);
16722
    }
16723
 
16724
    @Override
16725
    public void clear() {
16726
      this.success = null;
16727
    }
16728
 
16729
    public Voucher getSuccess() {
16730
      return this.success;
16731
    }
16732
 
16733
    public void setSuccess(Voucher success) {
16734
      this.success = success;
16735
    }
16736
 
16737
    public void unsetSuccess() {
16738
      this.success = null;
16739
    }
16740
 
16741
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
16742
    public boolean isSetSuccess() {
16743
      return this.success != null;
16744
    }
16745
 
16746
    public void setSuccessIsSet(boolean value) {
16747
      if (!value) {
16748
        this.success = null;
16749
      }
16750
    }
16751
 
16752
    public void setFieldValue(_Fields field, Object value) {
16753
      switch (field) {
16754
      case SUCCESS:
16755
        if (value == null) {
16756
          unsetSuccess();
16757
        } else {
16758
          setSuccess((Voucher)value);
16759
        }
16760
        break;
16761
 
16762
      }
16763
    }
16764
 
16765
    public Object getFieldValue(_Fields field) {
16766
      switch (field) {
16767
      case SUCCESS:
16768
        return getSuccess();
16769
 
16770
      }
16771
      throw new IllegalStateException();
16772
    }
16773
 
16774
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16775
    public boolean isSet(_Fields field) {
16776
      if (field == null) {
16777
        throw new IllegalArgumentException();
16778
      }
16779
 
16780
      switch (field) {
16781
      case SUCCESS:
16782
        return isSetSuccess();
16783
      }
16784
      throw new IllegalStateException();
16785
    }
16786
 
16787
    @Override
16788
    public boolean equals(Object that) {
16789
      if (that == null)
16790
        return false;
16791
      if (that instanceof assignVoucher_result)
16792
        return this.equals((assignVoucher_result)that);
16793
      return false;
16794
    }
16795
 
16796
    public boolean equals(assignVoucher_result that) {
16797
      if (that == null)
16798
        return false;
16799
 
16800
      boolean this_present_success = true && this.isSetSuccess();
16801
      boolean that_present_success = true && that.isSetSuccess();
16802
      if (this_present_success || that_present_success) {
16803
        if (!(this_present_success && that_present_success))
16804
          return false;
16805
        if (!this.success.equals(that.success))
16806
          return false;
16807
      }
16808
 
16809
      return true;
16810
    }
16811
 
16812
    @Override
16813
    public int hashCode() {
16814
      return 0;
16815
    }
16816
 
16817
    public int compareTo(assignVoucher_result other) {
16818
      if (!getClass().equals(other.getClass())) {
16819
        return getClass().getName().compareTo(other.getClass().getName());
16820
      }
16821
 
16822
      int lastComparison = 0;
16823
      assignVoucher_result typedOther = (assignVoucher_result)other;
16824
 
16825
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
16826
      if (lastComparison != 0) {
16827
        return lastComparison;
16828
      }
16829
      if (isSetSuccess()) {
16830
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
16831
        if (lastComparison != 0) {
16832
          return lastComparison;
16833
        }
16834
      }
16835
      return 0;
16836
    }
16837
 
16838
    public _Fields fieldForId(int fieldId) {
16839
      return _Fields.findByThriftId(fieldId);
16840
    }
16841
 
16842
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16843
      org.apache.thrift.protocol.TField field;
16844
      iprot.readStructBegin();
16845
      while (true)
16846
      {
16847
        field = iprot.readFieldBegin();
16848
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
16849
          break;
16850
        }
16851
        switch (field.id) {
16852
          case 0: // SUCCESS
16853
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
16854
              this.success = new Voucher();
16855
              this.success.read(iprot);
16856
            } else { 
16857
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16858
            }
16859
            break;
16860
          default:
16861
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16862
        }
16863
        iprot.readFieldEnd();
16864
      }
16865
      iprot.readStructEnd();
16866
      validate();
16867
    }
16868
 
16869
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
16870
      oprot.writeStructBegin(STRUCT_DESC);
16871
 
16872
      if (this.isSetSuccess()) {
16873
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
16874
        this.success.write(oprot);
16875
        oprot.writeFieldEnd();
16876
      }
16877
      oprot.writeFieldStop();
16878
      oprot.writeStructEnd();
16879
    }
16880
 
16881
    @Override
16882
    public String toString() {
16883
      StringBuilder sb = new StringBuilder("assignVoucher_result(");
16884
      boolean first = true;
16885
 
16886
      sb.append("success:");
16887
      if (this.success == null) {
16888
        sb.append("null");
16889
      } else {
16890
        sb.append(this.success);
16891
      }
16892
      first = false;
16893
      sb.append(")");
16894
      return sb.toString();
16895
    }
16896
 
16897
    public void validate() throws org.apache.thrift.TException {
16898
      // check for required fields
16899
    }
16900
 
16901
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16902
      try {
16903
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16904
      } catch (org.apache.thrift.TException te) {
16905
        throw new java.io.IOException(te);
16906
      }
16907
    }
16908
 
16909
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16910
      try {
16911
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16912
      } catch (org.apache.thrift.TException te) {
16913
        throw new java.io.IOException(te);
16914
      }
16915
    }
16916
 
16917
  }
16918
 
16919
  public static class markVoucherAsRedeemed_args implements org.apache.thrift.TBase<markVoucherAsRedeemed_args, markVoucherAsRedeemed_args._Fields>, java.io.Serializable, Cloneable   {
16920
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_args");
16921
 
16922
    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);
16923
    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);
16924
 
16925
    private String voucherCode; // required
16926
    private long redeemedOn; // required
16927
 
16928
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
16929
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
16930
      VOUCHER_CODE((short)1, "voucherCode"),
16931
      REDEEMED_ON((short)2, "redeemedOn");
16932
 
16933
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16934
 
16935
      static {
16936
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16937
          byName.put(field.getFieldName(), field);
16938
        }
16939
      }
16940
 
16941
      /**
16942
       * Find the _Fields constant that matches fieldId, or null if its not found.
16943
       */
16944
      public static _Fields findByThriftId(int fieldId) {
16945
        switch(fieldId) {
16946
          case 1: // VOUCHER_CODE
16947
            return VOUCHER_CODE;
16948
          case 2: // REDEEMED_ON
16949
            return REDEEMED_ON;
16950
          default:
16951
            return null;
16952
        }
16953
      }
16954
 
16955
      /**
16956
       * Find the _Fields constant that matches fieldId, throwing an exception
16957
       * if it is not found.
16958
       */
16959
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16960
        _Fields fields = findByThriftId(fieldId);
16961
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16962
        return fields;
16963
      }
16964
 
16965
      /**
16966
       * Find the _Fields constant that matches name, or null if its not found.
16967
       */
16968
      public static _Fields findByName(String name) {
16969
        return byName.get(name);
16970
      }
16971
 
16972
      private final short _thriftId;
16973
      private final String _fieldName;
16974
 
16975
      _Fields(short thriftId, String fieldName) {
16976
        _thriftId = thriftId;
16977
        _fieldName = fieldName;
16978
      }
16979
 
16980
      public short getThriftFieldId() {
16981
        return _thriftId;
16982
      }
16983
 
16984
      public String getFieldName() {
16985
        return _fieldName;
16986
      }
16987
    }
16988
 
16989
    // isset id assignments
16990
    private static final int __REDEEMEDON_ISSET_ID = 0;
16991
    private BitSet __isset_bit_vector = new BitSet(1);
16992
 
16993
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
16994
    static {
16995
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16996
      tmpMap.put(_Fields.VOUCHER_CODE, new org.apache.thrift.meta_data.FieldMetaData("voucherCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16997
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
16998
      tmpMap.put(_Fields.REDEEMED_ON, new org.apache.thrift.meta_data.FieldMetaData("redeemedOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16999
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
17000
      metaDataMap = Collections.unmodifiableMap(tmpMap);
17001
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_args.class, metaDataMap);
17002
    }
17003
 
17004
    public markVoucherAsRedeemed_args() {
17005
    }
17006
 
17007
    public markVoucherAsRedeemed_args(
17008
      String voucherCode,
17009
      long redeemedOn)
17010
    {
17011
      this();
17012
      this.voucherCode = voucherCode;
17013
      this.redeemedOn = redeemedOn;
17014
      setRedeemedOnIsSet(true);
17015
    }
17016
 
17017
    /**
17018
     * Performs a deep copy on <i>other</i>.
17019
     */
17020
    public markVoucherAsRedeemed_args(markVoucherAsRedeemed_args other) {
17021
      __isset_bit_vector.clear();
17022
      __isset_bit_vector.or(other.__isset_bit_vector);
17023
      if (other.isSetVoucherCode()) {
17024
        this.voucherCode = other.voucherCode;
17025
      }
17026
      this.redeemedOn = other.redeemedOn;
17027
    }
17028
 
17029
    public markVoucherAsRedeemed_args deepCopy() {
17030
      return new markVoucherAsRedeemed_args(this);
17031
    }
17032
 
17033
    @Override
17034
    public void clear() {
17035
      this.voucherCode = null;
17036
      setRedeemedOnIsSet(false);
17037
      this.redeemedOn = 0;
17038
    }
17039
 
17040
    public String getVoucherCode() {
17041
      return this.voucherCode;
17042
    }
17043
 
17044
    public void setVoucherCode(String voucherCode) {
17045
      this.voucherCode = voucherCode;
17046
    }
17047
 
17048
    public void unsetVoucherCode() {
17049
      this.voucherCode = null;
17050
    }
17051
 
17052
    /** Returns true if field voucherCode is set (has been assigned a value) and false otherwise */
17053
    public boolean isSetVoucherCode() {
17054
      return this.voucherCode != null;
17055
    }
17056
 
17057
    public void setVoucherCodeIsSet(boolean value) {
17058
      if (!value) {
17059
        this.voucherCode = null;
17060
      }
17061
    }
17062
 
17063
    public long getRedeemedOn() {
17064
      return this.redeemedOn;
17065
    }
17066
 
17067
    public void setRedeemedOn(long redeemedOn) {
17068
      this.redeemedOn = redeemedOn;
17069
      setRedeemedOnIsSet(true);
17070
    }
17071
 
17072
    public void unsetRedeemedOn() {
17073
      __isset_bit_vector.clear(__REDEEMEDON_ISSET_ID);
17074
    }
17075
 
17076
    /** Returns true if field redeemedOn is set (has been assigned a value) and false otherwise */
17077
    public boolean isSetRedeemedOn() {
17078
      return __isset_bit_vector.get(__REDEEMEDON_ISSET_ID);
17079
    }
17080
 
17081
    public void setRedeemedOnIsSet(boolean value) {
17082
      __isset_bit_vector.set(__REDEEMEDON_ISSET_ID, value);
17083
    }
17084
 
17085
    public void setFieldValue(_Fields field, Object value) {
17086
      switch (field) {
17087
      case VOUCHER_CODE:
17088
        if (value == null) {
17089
          unsetVoucherCode();
17090
        } else {
17091
          setVoucherCode((String)value);
17092
        }
17093
        break;
17094
 
17095
      case REDEEMED_ON:
17096
        if (value == null) {
17097
          unsetRedeemedOn();
17098
        } else {
17099
          setRedeemedOn((Long)value);
17100
        }
17101
        break;
17102
 
17103
      }
17104
    }
17105
 
17106
    public Object getFieldValue(_Fields field) {
17107
      switch (field) {
17108
      case VOUCHER_CODE:
17109
        return getVoucherCode();
17110
 
17111
      case REDEEMED_ON:
17112
        return Long.valueOf(getRedeemedOn());
17113
 
17114
      }
17115
      throw new IllegalStateException();
17116
    }
17117
 
17118
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
17119
    public boolean isSet(_Fields field) {
17120
      if (field == null) {
17121
        throw new IllegalArgumentException();
17122
      }
17123
 
17124
      switch (field) {
17125
      case VOUCHER_CODE:
17126
        return isSetVoucherCode();
17127
      case REDEEMED_ON:
17128
        return isSetRedeemedOn();
17129
      }
17130
      throw new IllegalStateException();
17131
    }
17132
 
17133
    @Override
17134
    public boolean equals(Object that) {
17135
      if (that == null)
17136
        return false;
17137
      if (that instanceof markVoucherAsRedeemed_args)
17138
        return this.equals((markVoucherAsRedeemed_args)that);
17139
      return false;
17140
    }
17141
 
17142
    public boolean equals(markVoucherAsRedeemed_args that) {
17143
      if (that == null)
17144
        return false;
17145
 
17146
      boolean this_present_voucherCode = true && this.isSetVoucherCode();
17147
      boolean that_present_voucherCode = true && that.isSetVoucherCode();
17148
      if (this_present_voucherCode || that_present_voucherCode) {
17149
        if (!(this_present_voucherCode && that_present_voucherCode))
17150
          return false;
17151
        if (!this.voucherCode.equals(that.voucherCode))
17152
          return false;
17153
      }
17154
 
17155
      boolean this_present_redeemedOn = true;
17156
      boolean that_present_redeemedOn = true;
17157
      if (this_present_redeemedOn || that_present_redeemedOn) {
17158
        if (!(this_present_redeemedOn && that_present_redeemedOn))
17159
          return false;
17160
        if (this.redeemedOn != that.redeemedOn)
17161
          return false;
17162
      }
17163
 
17164
      return true;
17165
    }
17166
 
17167
    @Override
17168
    public int hashCode() {
17169
      return 0;
17170
    }
17171
 
17172
    public int compareTo(markVoucherAsRedeemed_args other) {
17173
      if (!getClass().equals(other.getClass())) {
17174
        return getClass().getName().compareTo(other.getClass().getName());
17175
      }
17176
 
17177
      int lastComparison = 0;
17178
      markVoucherAsRedeemed_args typedOther = (markVoucherAsRedeemed_args)other;
17179
 
17180
      lastComparison = Boolean.valueOf(isSetVoucherCode()).compareTo(typedOther.isSetVoucherCode());
17181
      if (lastComparison != 0) {
17182
        return lastComparison;
17183
      }
17184
      if (isSetVoucherCode()) {
17185
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherCode, typedOther.voucherCode);
17186
        if (lastComparison != 0) {
17187
          return lastComparison;
17188
        }
17189
      }
17190
      lastComparison = Boolean.valueOf(isSetRedeemedOn()).compareTo(typedOther.isSetRedeemedOn());
17191
      if (lastComparison != 0) {
17192
        return lastComparison;
17193
      }
17194
      if (isSetRedeemedOn()) {
17195
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.redeemedOn, typedOther.redeemedOn);
17196
        if (lastComparison != 0) {
17197
          return lastComparison;
17198
        }
17199
      }
17200
      return 0;
17201
    }
17202
 
17203
    public _Fields fieldForId(int fieldId) {
17204
      return _Fields.findByThriftId(fieldId);
17205
    }
17206
 
17207
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17208
      org.apache.thrift.protocol.TField field;
17209
      iprot.readStructBegin();
17210
      while (true)
17211
      {
17212
        field = iprot.readFieldBegin();
17213
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17214
          break;
17215
        }
17216
        switch (field.id) {
17217
          case 1: // VOUCHER_CODE
17218
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
17219
              this.voucherCode = iprot.readString();
17220
            } else { 
17221
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17222
            }
17223
            break;
17224
          case 2: // REDEEMED_ON
17225
            if (field.type == org.apache.thrift.protocol.TType.I64) {
17226
              this.redeemedOn = iprot.readI64();
17227
              setRedeemedOnIsSet(true);
17228
            } else { 
17229
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17230
            }
17231
            break;
17232
          default:
17233
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17234
        }
17235
        iprot.readFieldEnd();
17236
      }
17237
      iprot.readStructEnd();
17238
      validate();
17239
    }
17240
 
17241
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17242
      validate();
17243
 
17244
      oprot.writeStructBegin(STRUCT_DESC);
17245
      if (this.voucherCode != null) {
17246
        oprot.writeFieldBegin(VOUCHER_CODE_FIELD_DESC);
17247
        oprot.writeString(this.voucherCode);
17248
        oprot.writeFieldEnd();
17249
      }
17250
      oprot.writeFieldBegin(REDEEMED_ON_FIELD_DESC);
17251
      oprot.writeI64(this.redeemedOn);
17252
      oprot.writeFieldEnd();
17253
      oprot.writeFieldStop();
17254
      oprot.writeStructEnd();
17255
    }
17256
 
17257
    @Override
17258
    public String toString() {
17259
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_args(");
17260
      boolean first = true;
17261
 
17262
      sb.append("voucherCode:");
17263
      if (this.voucherCode == null) {
17264
        sb.append("null");
17265
      } else {
17266
        sb.append(this.voucherCode);
17267
      }
17268
      first = false;
17269
      if (!first) sb.append(", ");
17270
      sb.append("redeemedOn:");
17271
      sb.append(this.redeemedOn);
17272
      first = false;
17273
      sb.append(")");
17274
      return sb.toString();
17275
    }
17276
 
17277
    public void validate() throws org.apache.thrift.TException {
17278
      // check for required fields
17279
    }
17280
 
17281
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17282
      try {
17283
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17284
      } catch (org.apache.thrift.TException te) {
17285
        throw new java.io.IOException(te);
17286
      }
17287
    }
17288
 
17289
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
17290
      try {
17291
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
17292
        __isset_bit_vector = new BitSet(1);
17293
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
17294
      } catch (org.apache.thrift.TException te) {
17295
        throw new java.io.IOException(te);
17296
      }
17297
    }
17298
 
17299
  }
17300
 
17301
  public static class markVoucherAsRedeemed_result implements org.apache.thrift.TBase<markVoucherAsRedeemed_result, markVoucherAsRedeemed_result._Fields>, java.io.Serializable, Cloneable   {
17302
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_result");
17303
 
17304
    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);
17305
 
17306
    private boolean success; // required
17307
 
17308
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
17309
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
17310
      SUCCESS((short)0, "success");
17311
 
17312
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
17313
 
17314
      static {
17315
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
17316
          byName.put(field.getFieldName(), field);
17317
        }
17318
      }
17319
 
17320
      /**
17321
       * Find the _Fields constant that matches fieldId, or null if its not found.
17322
       */
17323
      public static _Fields findByThriftId(int fieldId) {
17324
        switch(fieldId) {
17325
          case 0: // SUCCESS
17326
            return SUCCESS;
17327
          default:
17328
            return null;
17329
        }
17330
      }
17331
 
17332
      /**
17333
       * Find the _Fields constant that matches fieldId, throwing an exception
17334
       * if it is not found.
17335
       */
17336
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17337
        _Fields fields = findByThriftId(fieldId);
17338
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17339
        return fields;
17340
      }
17341
 
17342
      /**
17343
       * Find the _Fields constant that matches name, or null if its not found.
17344
       */
17345
      public static _Fields findByName(String name) {
17346
        return byName.get(name);
17347
      }
17348
 
17349
      private final short _thriftId;
17350
      private final String _fieldName;
17351
 
17352
      _Fields(short thriftId, String fieldName) {
17353
        _thriftId = thriftId;
17354
        _fieldName = fieldName;
17355
      }
17356
 
17357
      public short getThriftFieldId() {
17358
        return _thriftId;
17359
      }
17360
 
17361
      public String getFieldName() {
17362
        return _fieldName;
17363
      }
17364
    }
17365
 
17366
    // isset id assignments
17367
    private static final int __SUCCESS_ISSET_ID = 0;
17368
    private BitSet __isset_bit_vector = new BitSet(1);
17369
 
17370
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
17371
    static {
17372
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
17373
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17374
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
17375
      metaDataMap = Collections.unmodifiableMap(tmpMap);
17376
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_result.class, metaDataMap);
17377
    }
17378
 
17379
    public markVoucherAsRedeemed_result() {
17380
    }
17381
 
17382
    public markVoucherAsRedeemed_result(
17383
      boolean success)
17384
    {
17385
      this();
17386
      this.success = success;
17387
      setSuccessIsSet(true);
17388
    }
17389
 
17390
    /**
17391
     * Performs a deep copy on <i>other</i>.
17392
     */
17393
    public markVoucherAsRedeemed_result(markVoucherAsRedeemed_result other) {
17394
      __isset_bit_vector.clear();
17395
      __isset_bit_vector.or(other.__isset_bit_vector);
17396
      this.success = other.success;
17397
    }
17398
 
17399
    public markVoucherAsRedeemed_result deepCopy() {
17400
      return new markVoucherAsRedeemed_result(this);
17401
    }
17402
 
17403
    @Override
17404
    public void clear() {
17405
      setSuccessIsSet(false);
17406
      this.success = false;
17407
    }
17408
 
17409
    public boolean isSuccess() {
17410
      return this.success;
17411
    }
17412
 
17413
    public void setSuccess(boolean success) {
17414
      this.success = success;
17415
      setSuccessIsSet(true);
17416
    }
17417
 
17418
    public void unsetSuccess() {
17419
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
17420
    }
17421
 
17422
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
17423
    public boolean isSetSuccess() {
17424
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
17425
    }
17426
 
17427
    public void setSuccessIsSet(boolean value) {
17428
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
17429
    }
17430
 
17431
    public void setFieldValue(_Fields field, Object value) {
17432
      switch (field) {
17433
      case SUCCESS:
17434
        if (value == null) {
17435
          unsetSuccess();
17436
        } else {
17437
          setSuccess((Boolean)value);
17438
        }
17439
        break;
17440
 
17441
      }
17442
    }
17443
 
17444
    public Object getFieldValue(_Fields field) {
17445
      switch (field) {
17446
      case SUCCESS:
17447
        return Boolean.valueOf(isSuccess());
17448
 
17449
      }
17450
      throw new IllegalStateException();
17451
    }
17452
 
17453
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
17454
    public boolean isSet(_Fields field) {
17455
      if (field == null) {
17456
        throw new IllegalArgumentException();
17457
      }
17458
 
17459
      switch (field) {
17460
      case SUCCESS:
17461
        return isSetSuccess();
17462
      }
17463
      throw new IllegalStateException();
17464
    }
17465
 
17466
    @Override
17467
    public boolean equals(Object that) {
17468
      if (that == null)
17469
        return false;
17470
      if (that instanceof markVoucherAsRedeemed_result)
17471
        return this.equals((markVoucherAsRedeemed_result)that);
17472
      return false;
17473
    }
17474
 
17475
    public boolean equals(markVoucherAsRedeemed_result that) {
17476
      if (that == null)
17477
        return false;
17478
 
17479
      boolean this_present_success = true;
17480
      boolean that_present_success = true;
17481
      if (this_present_success || that_present_success) {
17482
        if (!(this_present_success && that_present_success))
17483
          return false;
17484
        if (this.success != that.success)
17485
          return false;
17486
      }
17487
 
17488
      return true;
17489
    }
17490
 
17491
    @Override
17492
    public int hashCode() {
17493
      return 0;
17494
    }
17495
 
17496
    public int compareTo(markVoucherAsRedeemed_result other) {
17497
      if (!getClass().equals(other.getClass())) {
17498
        return getClass().getName().compareTo(other.getClass().getName());
17499
      }
17500
 
17501
      int lastComparison = 0;
17502
      markVoucherAsRedeemed_result typedOther = (markVoucherAsRedeemed_result)other;
17503
 
17504
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
17505
      if (lastComparison != 0) {
17506
        return lastComparison;
17507
      }
17508
      if (isSetSuccess()) {
17509
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
17510
        if (lastComparison != 0) {
17511
          return lastComparison;
17512
        }
17513
      }
17514
      return 0;
17515
    }
17516
 
17517
    public _Fields fieldForId(int fieldId) {
17518
      return _Fields.findByThriftId(fieldId);
17519
    }
17520
 
17521
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17522
      org.apache.thrift.protocol.TField field;
17523
      iprot.readStructBegin();
17524
      while (true)
17525
      {
17526
        field = iprot.readFieldBegin();
17527
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17528
          break;
17529
        }
17530
        switch (field.id) {
17531
          case 0: // SUCCESS
17532
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
17533
              this.success = iprot.readBool();
17534
              setSuccessIsSet(true);
17535
            } else { 
17536
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17537
            }
17538
            break;
17539
          default:
17540
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17541
        }
17542
        iprot.readFieldEnd();
17543
      }
17544
      iprot.readStructEnd();
17545
      validate();
17546
    }
17547
 
17548
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17549
      oprot.writeStructBegin(STRUCT_DESC);
17550
 
17551
      if (this.isSetSuccess()) {
17552
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
17553
        oprot.writeBool(this.success);
17554
        oprot.writeFieldEnd();
17555
      }
17556
      oprot.writeFieldStop();
17557
      oprot.writeStructEnd();
17558
    }
17559
 
17560
    @Override
17561
    public String toString() {
17562
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_result(");
17563
      boolean first = true;
17564
 
17565
      sb.append("success:");
17566
      sb.append(this.success);
17567
      first = false;
17568
      sb.append(")");
17569
      return sb.toString();
17570
    }
17571
 
17572
    public void validate() throws org.apache.thrift.TException {
17573
      // check for required fields
17574
    }
17575
 
17576
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17577
      try {
17578
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17579
      } catch (org.apache.thrift.TException te) {
17580
        throw new java.io.IOException(te);
17581
      }
17582
    }
17583
 
17584
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
17585
      try {
17586
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
17587
      } catch (org.apache.thrift.TException te) {
17588
        throw new java.io.IOException(te);
17589
      }
17590
    }
17591
 
17592
  }
17593
 
1982 varun.gupt 17594
}