Subversion Repositories SmartDukaan

Rev

Rev 6433 | Rev 6561 | 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
    /**
6250 amit.gupta 62
     * Creates a coupon and returns couponcode if successfully created
63
     * 
64
     * @param promotionId
65
     * @param endOn
66
     * @param email
67
     * @param amount
6356 amit.gupta 68
     * @param isCod
6250 amit.gupta 69
     * @param usage
70
     */
6356 amit.gupta 71
    public String createCoupon(long promotionId, long endOn, String email, long amount, boolean isCod, long usage) throws PromotionException, org.apache.thrift.TException;
6250 amit.gupta 72
 
73
    /**
3385 varun.gupt 74
     * Returns the count of successful payments done using a given coupon
75
     * 
76
     * @param couponCode
77
     */
3430 rajveer 78
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
3385 varun.gupt 79
 
80
    /**
81
     * Returns the doc string of the rule module
82
     * 
83
     * @param ruleName
84
     */
3430 rajveer 85
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException;
3385 varun.gupt 86
 
4189 varun.gupt 87
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException;
88
 
4494 varun.gupt 89
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException;
90
 
5469 rajveer 91
    public void addVoucher(Voucher voucher) throws org.apache.thrift.TException;
92
 
93
    public Voucher assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException;
94
 
95
    public boolean markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException;
96
 
1982 varun.gupt 97
  }
98
 
3430 rajveer 99
  public interface AsyncIface extends in.shop2020.generic.GenericService .AsyncIface {
1982 varun.gupt 100
 
3430 rajveer 101
    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 102
 
6301 amit.gupta 103
    public void getCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCoupon_call> resultHandler) throws org.apache.thrift.TException;
104
 
105
    public void isGiftVoucher(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.isGiftVoucher_call> resultHandler) throws org.apache.thrift.TException;
106
 
6356 amit.gupta 107
    public void isCodApplicable(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.isCodApplicable_call> resultHandler) throws org.apache.thrift.TException;
108
 
3430 rajveer 109
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllPromotions_call> resultHandler) throws org.apache.thrift.TException;
110
 
111
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPromotionById_call> resultHandler) throws org.apache.thrift.TException;
112
 
113
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException;
114
 
115
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyCoupon_call> resultHandler) throws org.apache.thrift.TException;
116
 
6433 anupam.sin 117
    public void applyRechargeCoupon(String couponCode, long totalAmount, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyRechargeCoupon_call> resultHandler) throws org.apache.thrift.TException;
118
 
3430 rajveer 119
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException;
120
 
121
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException;
122
 
6497 amit.gupta 123
    public void getActiveCodes(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getActiveCodes_call> resultHandler) throws org.apache.thrift.TException;
124
 
125
    public void deleteCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.deleteCoupon_call> resultHandler) throws org.apache.thrift.TException;
126
 
3430 rajveer 127
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException;
128
 
6356 amit.gupta 129
    public void createCoupon(long promotionId, long endOn, String email, long amount, boolean isCod, long usage, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.createCoupon_call> resultHandler) throws org.apache.thrift.TException;
6250 amit.gupta 130
 
3430 rajveer 131
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException;
132
 
133
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getRuleDocString_call> resultHandler) throws org.apache.thrift.TException;
134
 
4189 varun.gupt 135
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException;
136
 
4494 varun.gupt 137
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException;
138
 
5469 rajveer 139
    public void addVoucher(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.addVoucher_call> resultHandler) throws org.apache.thrift.TException;
140
 
141
    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;
142
 
143
    public void markVoucherAsRedeemed(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.markVoucherAsRedeemed_call> resultHandler) throws org.apache.thrift.TException;
144
 
3430 rajveer 145
  }
146
 
147
  public static class Client extends in.shop2020.generic.GenericService.Client implements Iface {
148
    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
149
      public Factory() {}
150
      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
151
        return new Client(prot);
152
      }
153
      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
154
        return new Client(iprot, oprot);
155
      }
1982 varun.gupt 156
    }
157
 
3430 rajveer 158
    public Client(org.apache.thrift.protocol.TProtocol prot)
1982 varun.gupt 159
    {
3430 rajveer 160
      super(prot, prot);
1982 varun.gupt 161
    }
162
 
3430 rajveer 163
    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
164
      super(iprot, oprot);
1982 varun.gupt 165
    }
166
 
3430 rajveer 167
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 168
    {
169
      send_createPromotion(name, ruleExecutionSrc, startOn, endOn);
170
      recv_createPromotion();
171
    }
172
 
3430 rajveer 173
    public void send_createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws org.apache.thrift.TException
1982 varun.gupt 174
    {
175
      createPromotion_args args = new createPromotion_args();
3430 rajveer 176
      args.setName(name);
177
      args.setRuleExecutionSrc(ruleExecutionSrc);
178
      args.setStartOn(startOn);
179
      args.setEndOn(endOn);
180
      sendBase("createPromotion", args);
1982 varun.gupt 181
    }
182
 
3430 rajveer 183
    public void recv_createPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 184
    {
185
      createPromotion_result result = new createPromotion_result();
3430 rajveer 186
      receiveBase(result, "createPromotion");
1982 varun.gupt 187
      if (result.pex != null) {
188
        throw result.pex;
189
      }
190
      return;
191
    }
192
 
6301 amit.gupta 193
    public Coupon getCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
194
    {
195
      send_getCoupon(couponCode);
196
      return recv_getCoupon();
197
    }
198
 
199
    public void send_getCoupon(String couponCode) throws org.apache.thrift.TException
200
    {
201
      getCoupon_args args = new getCoupon_args();
202
      args.setCouponCode(couponCode);
203
      sendBase("getCoupon", args);
204
    }
205
 
206
    public Coupon recv_getCoupon() throws PromotionException, org.apache.thrift.TException
207
    {
208
      getCoupon_result result = new getCoupon_result();
209
      receiveBase(result, "getCoupon");
210
      if (result.isSetSuccess()) {
211
        return result.success;
212
      }
213
      if (result.pex != null) {
214
        throw result.pex;
215
      }
216
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCoupon failed: unknown result");
217
    }
218
 
219
    public boolean isGiftVoucher(String couponCode) throws PromotionException, org.apache.thrift.TException
220
    {
221
      send_isGiftVoucher(couponCode);
222
      return recv_isGiftVoucher();
223
    }
224
 
225
    public void send_isGiftVoucher(String couponCode) throws org.apache.thrift.TException
226
    {
227
      isGiftVoucher_args args = new isGiftVoucher_args();
228
      args.setCouponCode(couponCode);
229
      sendBase("isGiftVoucher", args);
230
    }
231
 
232
    public boolean recv_isGiftVoucher() throws PromotionException, org.apache.thrift.TException
233
    {
234
      isGiftVoucher_result result = new isGiftVoucher_result();
235
      receiveBase(result, "isGiftVoucher");
236
      if (result.isSetSuccess()) {
237
        return result.success;
238
      }
239
      if (result.pex != null) {
240
        throw result.pex;
241
      }
242
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isGiftVoucher failed: unknown result");
243
    }
244
 
6356 amit.gupta 245
    public boolean isCodApplicable(String couponCode) throws PromotionException, org.apache.thrift.TException
246
    {
247
      send_isCodApplicable(couponCode);
248
      return recv_isCodApplicable();
249
    }
250
 
251
    public void send_isCodApplicable(String couponCode) throws org.apache.thrift.TException
252
    {
253
      isCodApplicable_args args = new isCodApplicable_args();
254
      args.setCouponCode(couponCode);
255
      sendBase("isCodApplicable", args);
256
    }
257
 
258
    public boolean recv_isCodApplicable() throws PromotionException, org.apache.thrift.TException
259
    {
260
      isCodApplicable_result result = new isCodApplicable_result();
261
      receiveBase(result, "isCodApplicable");
262
      if (result.isSetSuccess()) {
263
        return result.success;
264
      }
265
      if (result.pex != null) {
266
        throw result.pex;
267
      }
268
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isCodApplicable failed: unknown result");
269
    }
270
 
3430 rajveer 271
    public List<Promotion> getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 272
    {
273
      send_getAllPromotions();
274
      return recv_getAllPromotions();
275
    }
276
 
3430 rajveer 277
    public void send_getAllPromotions() throws org.apache.thrift.TException
1982 varun.gupt 278
    {
279
      getAllPromotions_args args = new getAllPromotions_args();
3430 rajveer 280
      sendBase("getAllPromotions", args);
1982 varun.gupt 281
    }
282
 
3430 rajveer 283
    public List<Promotion> recv_getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 284
    {
285
      getAllPromotions_result result = new getAllPromotions_result();
3430 rajveer 286
      receiveBase(result, "getAllPromotions");
1982 varun.gupt 287
      if (result.isSetSuccess()) {
288
        return result.success;
289
      }
290
      if (result.pex != null) {
291
        throw result.pex;
292
      }
3430 rajveer 293
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllPromotions failed: unknown result");
1982 varun.gupt 294
    }
295
 
3430 rajveer 296
    public Promotion getPromotionById(long promotionId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 297
    {
298
      send_getPromotionById(promotionId);
299
      return recv_getPromotionById();
300
    }
301
 
3430 rajveer 302
    public void send_getPromotionById(long promotionId) throws org.apache.thrift.TException
1982 varun.gupt 303
    {
304
      getPromotionById_args args = new getPromotionById_args();
3430 rajveer 305
      args.setPromotionId(promotionId);
306
      sendBase("getPromotionById", args);
1982 varun.gupt 307
    }
308
 
3430 rajveer 309
    public Promotion recv_getPromotionById() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 310
    {
311
      getPromotionById_result result = new getPromotionById_result();
3430 rajveer 312
      receiveBase(result, "getPromotionById");
1982 varun.gupt 313
      if (result.isSetSuccess()) {
314
        return result.success;
315
      }
316
      if (result.pex != null) {
317
        throw result.pex;
318
      }
3430 rajveer 319
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPromotionById failed: unknown result");
1982 varun.gupt 320
    }
321
 
3430 rajveer 322
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 323
    {
324
      send_generateCouponsForPromotion(promotionId, couponCode);
325
      recv_generateCouponsForPromotion();
326
    }
327
 
3430 rajveer 328
    public void send_generateCouponsForPromotion(long promotionId, String couponCode) throws org.apache.thrift.TException
1982 varun.gupt 329
    {
330
      generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
3430 rajveer 331
      args.setPromotionId(promotionId);
332
      args.setCouponCode(couponCode);
333
      sendBase("generateCouponsForPromotion", args);
1982 varun.gupt 334
    }
335
 
3430 rajveer 336
    public void recv_generateCouponsForPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 337
    {
338
      generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
3430 rajveer 339
      receiveBase(result, "generateCouponsForPromotion");
1982 varun.gupt 340
      if (result.pex != null) {
341
        throw result.pex;
342
      }
343
      return;
344
    }
345
 
3430 rajveer 346
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 347
    {
348
      send_applyCoupon(couponCode, cartId);
349
      return recv_applyCoupon();
350
    }
351
 
3430 rajveer 352
    public void send_applyCoupon(String couponCode, long cartId) throws org.apache.thrift.TException
1982 varun.gupt 353
    {
354
      applyCoupon_args args = new applyCoupon_args();
3430 rajveer 355
      args.setCouponCode(couponCode);
356
      args.setCartId(cartId);
357
      sendBase("applyCoupon", args);
1982 varun.gupt 358
    }
359
 
3430 rajveer 360
    public Cart recv_applyCoupon() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 361
    {
362
      applyCoupon_result result = new applyCoupon_result();
3430 rajveer 363
      receiveBase(result, "applyCoupon");
1982 varun.gupt 364
      if (result.isSetSuccess()) {
365
        return result.success;
366
      }
367
      if (result.pex != null) {
368
        throw result.pex;
369
      }
3430 rajveer 370
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "applyCoupon failed: unknown result");
1982 varun.gupt 371
    }
372
 
6433 anupam.sin 373
    public Map<Long,String> applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws PromotionException, org.apache.thrift.TException
374
    {
375
      send_applyRechargeCoupon(couponCode, totalAmount, userId);
376
      return recv_applyRechargeCoupon();
377
    }
378
 
379
    public void send_applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws org.apache.thrift.TException
380
    {
381
      applyRechargeCoupon_args args = new applyRechargeCoupon_args();
382
      args.setCouponCode(couponCode);
383
      args.setTotalAmount(totalAmount);
384
      args.setUserId(userId);
385
      sendBase("applyRechargeCoupon", args);
386
    }
387
 
388
    public Map<Long,String> recv_applyRechargeCoupon() throws PromotionException, org.apache.thrift.TException
389
    {
390
      applyRechargeCoupon_result result = new applyRechargeCoupon_result();
391
      receiveBase(result, "applyRechargeCoupon");
392
      if (result.isSetSuccess()) {
393
        return result.success;
394
      }
395
      if (result.pex != null) {
396
        throw result.pex;
397
      }
398
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "applyRechargeCoupon failed: unknown result");
399
    }
400
 
3430 rajveer 401
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 402
    {
403
      send_trackCouponUsage(couponCode, transactionId, userId);
404
      recv_trackCouponUsage();
405
    }
406
 
3430 rajveer 407
    public void send_trackCouponUsage(String couponCode, long transactionId, long userId) throws org.apache.thrift.TException
1982 varun.gupt 408
    {
409
      trackCouponUsage_args args = new trackCouponUsage_args();
3430 rajveer 410
      args.setCouponCode(couponCode);
411
      args.setTransactionId(transactionId);
412
      args.setUserId(userId);
413
      sendBase("trackCouponUsage", args);
1982 varun.gupt 414
    }
415
 
3430 rajveer 416
    public void recv_trackCouponUsage() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 417
    {
418
      trackCouponUsage_result result = new trackCouponUsage_result();
3430 rajveer 419
      receiveBase(result, "trackCouponUsage");
1982 varun.gupt 420
      if (result.pex != null) {
421
        throw result.pex;
422
      }
423
      return;
424
    }
425
 
3430 rajveer 426
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 427
    {
428
      send_getCouponUsageCountByUser(couponCode, userId);
429
      return recv_getCouponUsageCountByUser();
430
    }
431
 
3430 rajveer 432
    public void send_getCouponUsageCountByUser(String couponCode, long userId) throws org.apache.thrift.TException
1982 varun.gupt 433
    {
434
      getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
3430 rajveer 435
      args.setCouponCode(couponCode);
436
      args.setUserId(userId);
437
      sendBase("getCouponUsageCountByUser", args);
1982 varun.gupt 438
    }
439
 
3430 rajveer 440
    public long recv_getCouponUsageCountByUser() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 441
    {
442
      getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
3430 rajveer 443
      receiveBase(result, "getCouponUsageCountByUser");
1982 varun.gupt 444
      if (result.isSetSuccess()) {
445
        return result.success;
446
      }
447
      if (result.pex != null) {
448
        throw result.pex;
449
      }
3430 rajveer 450
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCouponUsageCountByUser failed: unknown result");
1982 varun.gupt 451
    }
452
 
6497 amit.gupta 453
    public List<Coupon> getActiveCodes(long promotionId) throws PromotionException, org.apache.thrift.TException
454
    {
455
      send_getActiveCodes(promotionId);
456
      return recv_getActiveCodes();
457
    }
458
 
459
    public void send_getActiveCodes(long promotionId) throws org.apache.thrift.TException
460
    {
461
      getActiveCodes_args args = new getActiveCodes_args();
462
      args.setPromotionId(promotionId);
463
      sendBase("getActiveCodes", args);
464
    }
465
 
466
    public List<Coupon> recv_getActiveCodes() throws PromotionException, org.apache.thrift.TException
467
    {
468
      getActiveCodes_result result = new getActiveCodes_result();
469
      receiveBase(result, "getActiveCodes");
470
      if (result.isSetSuccess()) {
471
        return result.success;
472
      }
473
      if (result.pex != null) {
474
        throw result.pex;
475
      }
476
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getActiveCodes failed: unknown result");
477
    }
478
 
479
    public void deleteCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
480
    {
481
      send_deleteCoupon(couponCode);
482
      recv_deleteCoupon();
483
    }
484
 
485
    public void send_deleteCoupon(String couponCode) throws org.apache.thrift.TException
486
    {
487
      deleteCoupon_args args = new deleteCoupon_args();
488
      args.setCouponCode(couponCode);
489
      sendBase("deleteCoupon", args);
490
    }
491
 
492
    public void recv_deleteCoupon() throws PromotionException, org.apache.thrift.TException
493
    {
494
      deleteCoupon_result result = new deleteCoupon_result();
495
      receiveBase(result, "deleteCoupon");
496
      if (result.pex != null) {
497
        throw result.pex;
498
      }
499
      return;
500
    }
501
 
3430 rajveer 502
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 503
    {
504
      send_getActiveCoupons();
505
      return recv_getActiveCoupons();
506
    }
507
 
3430 rajveer 508
    public void send_getActiveCoupons() throws org.apache.thrift.TException
3385 varun.gupt 509
    {
510
      getActiveCoupons_args args = new getActiveCoupons_args();
3430 rajveer 511
      sendBase("getActiveCoupons", args);
3385 varun.gupt 512
    }
513
 
3430 rajveer 514
    public List<Coupon> recv_getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 515
    {
516
      getActiveCoupons_result result = new getActiveCoupons_result();
3430 rajveer 517
      receiveBase(result, "getActiveCoupons");
3385 varun.gupt 518
      if (result.isSetSuccess()) {
519
        return result.success;
520
      }
521
      if (result.pex != null) {
522
        throw result.pex;
523
      }
3430 rajveer 524
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getActiveCoupons failed: unknown result");
3385 varun.gupt 525
    }
526
 
6356 amit.gupta 527
    public String createCoupon(long promotionId, long endOn, String email, long amount, boolean isCod, long usage) throws PromotionException, org.apache.thrift.TException
6250 amit.gupta 528
    {
6356 amit.gupta 529
      send_createCoupon(promotionId, endOn, email, amount, isCod, usage);
6250 amit.gupta 530
      return recv_createCoupon();
531
    }
532
 
6356 amit.gupta 533
    public void send_createCoupon(long promotionId, long endOn, String email, long amount, boolean isCod, long usage) throws org.apache.thrift.TException
6250 amit.gupta 534
    {
535
      createCoupon_args args = new createCoupon_args();
536
      args.setPromotionId(promotionId);
537
      args.setEndOn(endOn);
538
      args.setEmail(email);
539
      args.setAmount(amount);
6356 amit.gupta 540
      args.setIsCod(isCod);
6250 amit.gupta 541
      args.setUsage(usage);
542
      sendBase("createCoupon", args);
543
    }
544
 
545
    public String recv_createCoupon() throws PromotionException, org.apache.thrift.TException
546
    {
547
      createCoupon_result result = new createCoupon_result();
548
      receiveBase(result, "createCoupon");
549
      if (result.isSetSuccess()) {
550
        return result.success;
551
      }
552
      if (result.pex != null) {
553
        throw result.pex;
554
      }
555
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createCoupon failed: unknown result");
556
    }
557
 
3430 rajveer 558
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 559
    {
560
      send_getSuccessfulPaymentCountForCoupon(couponCode);
561
      return recv_getSuccessfulPaymentCountForCoupon();
562
    }
563
 
3430 rajveer 564
    public void send_getSuccessfulPaymentCountForCoupon(String couponCode) throws org.apache.thrift.TException
3385 varun.gupt 565
    {
566
      getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
3430 rajveer 567
      args.setCouponCode(couponCode);
568
      sendBase("getSuccessfulPaymentCountForCoupon", args);
3385 varun.gupt 569
    }
570
 
3430 rajveer 571
    public long recv_getSuccessfulPaymentCountForCoupon() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 572
    {
573
      getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
3430 rajveer 574
      receiveBase(result, "getSuccessfulPaymentCountForCoupon");
3385 varun.gupt 575
      if (result.isSetSuccess()) {
576
        return result.success;
577
      }
578
      if (result.pex != null) {
579
        throw result.pex;
580
      }
3430 rajveer 581
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSuccessfulPaymentCountForCoupon failed: unknown result");
3385 varun.gupt 582
    }
583
 
3430 rajveer 584
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 585
    {
586
      send_getRuleDocString(ruleName);
587
      return recv_getRuleDocString();
588
    }
589
 
3430 rajveer 590
    public void send_getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 591
    {
592
      getRuleDocString_args args = new getRuleDocString_args();
3430 rajveer 593
      args.setRuleName(ruleName);
594
      sendBase("getRuleDocString", args);
3385 varun.gupt 595
    }
596
 
3430 rajveer 597
    public String recv_getRuleDocString() throws org.apache.thrift.TException
3385 varun.gupt 598
    {
599
      getRuleDocString_result result = new getRuleDocString_result();
3430 rajveer 600
      receiveBase(result, "getRuleDocString");
3385 varun.gupt 601
      if (result.isSetSuccess()) {
602
        return result.success;
603
      }
3430 rajveer 604
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRuleDocString failed: unknown result");
3385 varun.gupt 605
    }
606
 
4189 varun.gupt 607
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException
608
    {
609
      send_getItemDiscountMap(itemIds);
610
      return recv_getItemDiscountMap();
611
    }
612
 
613
    public void send_getItemDiscountMap(List<Long> itemIds) throws org.apache.thrift.TException
614
    {
615
      getItemDiscountMap_args args = new getItemDiscountMap_args();
616
      args.setItemIds(itemIds);
617
      sendBase("getItemDiscountMap", args);
618
    }
619
 
620
    public List<ItemCouponDiscount> recv_getItemDiscountMap() throws PromotionException, org.apache.thrift.TException
621
    {
622
      getItemDiscountMap_result result = new getItemDiscountMap_result();
623
      receiveBase(result, "getItemDiscountMap");
624
      if (result.isSetSuccess()) {
625
        return result.success;
626
      }
627
      if (result.pex != null) {
628
        throw result.pex;
629
      }
630
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemDiscountMap failed: unknown result");
631
    }
632
 
4494 varun.gupt 633
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
634
    {
635
      send_getDiscountsForEntity(entityId);
636
      return recv_getDiscountsForEntity();
637
    }
638
 
639
    public void send_getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
640
    {
641
      getDiscountsForEntity_args args = new getDiscountsForEntity_args();
642
      args.setEntityId(entityId);
643
      sendBase("getDiscountsForEntity", args);
644
    }
645
 
646
    public Map<String,Double> recv_getDiscountsForEntity() throws org.apache.thrift.TException
647
    {
648
      getDiscountsForEntity_result result = new getDiscountsForEntity_result();
649
      receiveBase(result, "getDiscountsForEntity");
650
      if (result.isSetSuccess()) {
651
        return result.success;
652
      }
653
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getDiscountsForEntity failed: unknown result");
654
    }
655
 
5469 rajveer 656
    public void addVoucher(Voucher voucher) throws org.apache.thrift.TException
657
    {
658
      send_addVoucher(voucher);
659
      recv_addVoucher();
660
    }
661
 
662
    public void send_addVoucher(Voucher voucher) throws org.apache.thrift.TException
663
    {
664
      addVoucher_args args = new addVoucher_args();
665
      args.setVoucher(voucher);
666
      sendBase("addVoucher", args);
667
    }
668
 
669
    public void recv_addVoucher() throws org.apache.thrift.TException
670
    {
671
      addVoucher_result result = new addVoucher_result();
672
      receiveBase(result, "addVoucher");
673
      return;
674
    }
675
 
676
    public Voucher assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException
677
    {
678
      send_assignVoucher(userId, userEmail, voucherType, amount);
679
      return recv_assignVoucher();
680
    }
681
 
682
    public void send_assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException
683
    {
684
      assignVoucher_args args = new assignVoucher_args();
685
      args.setUserId(userId);
686
      args.setUserEmail(userEmail);
687
      args.setVoucherType(voucherType);
688
      args.setAmount(amount);
689
      sendBase("assignVoucher", args);
690
    }
691
 
692
    public Voucher recv_assignVoucher() throws org.apache.thrift.TException
693
    {
694
      assignVoucher_result result = new assignVoucher_result();
695
      receiveBase(result, "assignVoucher");
696
      if (result.isSetSuccess()) {
697
        return result.success;
698
      }
699
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "assignVoucher failed: unknown result");
700
    }
701
 
702
    public boolean markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException
703
    {
704
      send_markVoucherAsRedeemed(voucherCode, redeemedOn);
705
      return recv_markVoucherAsRedeemed();
706
    }
707
 
708
    public void send_markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException
709
    {
710
      markVoucherAsRedeemed_args args = new markVoucherAsRedeemed_args();
711
      args.setVoucherCode(voucherCode);
712
      args.setRedeemedOn(redeemedOn);
713
      sendBase("markVoucherAsRedeemed", args);
714
    }
715
 
716
    public boolean recv_markVoucherAsRedeemed() throws org.apache.thrift.TException
717
    {
718
      markVoucherAsRedeemed_result result = new markVoucherAsRedeemed_result();
719
      receiveBase(result, "markVoucherAsRedeemed");
720
      if (result.isSetSuccess()) {
721
        return result.success;
722
      }
723
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "markVoucherAsRedeemed failed: unknown result");
724
    }
725
 
1982 varun.gupt 726
  }
3430 rajveer 727
  public static class AsyncClient extends in.shop2020.generic.GenericService.AsyncClient implements AsyncIface {
728
    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
729
      private org.apache.thrift.async.TAsyncClientManager clientManager;
730
      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
731
      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
732
        this.clientManager = clientManager;
733
        this.protocolFactory = protocolFactory;
734
      }
735
      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
736
        return new AsyncClient(protocolFactory, clientManager, transport);
737
      }
1982 varun.gupt 738
    }
739
 
3430 rajveer 740
    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
741
      super(protocolFactory, clientManager, transport);
742
    }
1982 varun.gupt 743
 
3430 rajveer 744
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn, org.apache.thrift.async.AsyncMethodCallback<createPromotion_call> resultHandler) throws org.apache.thrift.TException {
745
      checkReady();
746
      createPromotion_call method_call = new createPromotion_call(name, ruleExecutionSrc, startOn, endOn, resultHandler, this, ___protocolFactory, ___transport);
747
      this.___currentMethod = method_call;
748
      ___manager.call(method_call);
1982 varun.gupt 749
    }
750
 
3430 rajveer 751
    public static class createPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
752
      private String name;
753
      private String ruleExecutionSrc;
754
      private long startOn;
755
      private long endOn;
756
      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 {
757
        super(client, protocolFactory, transport, resultHandler, false);
758
        this.name = name;
759
        this.ruleExecutionSrc = ruleExecutionSrc;
760
        this.startOn = startOn;
761
        this.endOn = endOn;
1982 varun.gupt 762
      }
763
 
3430 rajveer 764
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
765
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
1982 varun.gupt 766
        createPromotion_args args = new createPromotion_args();
3430 rajveer 767
        args.setName(name);
768
        args.setRuleExecutionSrc(ruleExecutionSrc);
769
        args.setStartOn(startOn);
770
        args.setEndOn(endOn);
771
        args.write(prot);
772
        prot.writeMessageEnd();
1982 varun.gupt 773
      }
774
 
3430 rajveer 775
      public void getResult() throws PromotionException, org.apache.thrift.TException {
776
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
777
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 778
        }
3430 rajveer 779
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
780
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
781
        (new Client(prot)).recv_createPromotion();
1982 varun.gupt 782
      }
3430 rajveer 783
    }
1982 varun.gupt 784
 
6301 amit.gupta 785
    public void getCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getCoupon_call> resultHandler) throws org.apache.thrift.TException {
786
      checkReady();
787
      getCoupon_call method_call = new getCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
788
      this.___currentMethod = method_call;
789
      ___manager.call(method_call);
790
    }
791
 
792
    public static class getCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
793
      private String couponCode;
794
      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 {
795
        super(client, protocolFactory, transport, resultHandler, false);
796
        this.couponCode = couponCode;
797
      }
798
 
799
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
800
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
801
        getCoupon_args args = new getCoupon_args();
802
        args.setCouponCode(couponCode);
803
        args.write(prot);
804
        prot.writeMessageEnd();
805
      }
806
 
807
      public Coupon getResult() throws PromotionException, org.apache.thrift.TException {
808
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
809
          throw new IllegalStateException("Method call not finished!");
810
        }
811
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
812
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
813
        return (new Client(prot)).recv_getCoupon();
814
      }
815
    }
816
 
817
    public void isGiftVoucher(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isGiftVoucher_call> resultHandler) throws org.apache.thrift.TException {
818
      checkReady();
819
      isGiftVoucher_call method_call = new isGiftVoucher_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
820
      this.___currentMethod = method_call;
821
      ___manager.call(method_call);
822
    }
823
 
824
    public static class isGiftVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
825
      private String couponCode;
826
      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 {
827
        super(client, protocolFactory, transport, resultHandler, false);
828
        this.couponCode = couponCode;
829
      }
830
 
831
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
832
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isGiftVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
833
        isGiftVoucher_args args = new isGiftVoucher_args();
834
        args.setCouponCode(couponCode);
835
        args.write(prot);
836
        prot.writeMessageEnd();
837
      }
838
 
839
      public boolean getResult() throws PromotionException, org.apache.thrift.TException {
840
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
841
          throw new IllegalStateException("Method call not finished!");
842
        }
843
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
844
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
845
        return (new Client(prot)).recv_isGiftVoucher();
846
      }
847
    }
848
 
6356 amit.gupta 849
    public void isCodApplicable(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isCodApplicable_call> resultHandler) throws org.apache.thrift.TException {
850
      checkReady();
851
      isCodApplicable_call method_call = new isCodApplicable_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
852
      this.___currentMethod = method_call;
853
      ___manager.call(method_call);
854
    }
855
 
856
    public static class isCodApplicable_call extends org.apache.thrift.async.TAsyncMethodCall {
857
      private String couponCode;
858
      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 {
859
        super(client, protocolFactory, transport, resultHandler, false);
860
        this.couponCode = couponCode;
861
      }
862
 
863
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
864
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isCodApplicable", org.apache.thrift.protocol.TMessageType.CALL, 0));
865
        isCodApplicable_args args = new isCodApplicable_args();
866
        args.setCouponCode(couponCode);
867
        args.write(prot);
868
        prot.writeMessageEnd();
869
      }
870
 
871
      public boolean getResult() throws PromotionException, org.apache.thrift.TException {
872
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
873
          throw new IllegalStateException("Method call not finished!");
874
        }
875
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
876
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
877
        return (new Client(prot)).recv_isCodApplicable();
878
      }
879
    }
880
 
3430 rajveer 881
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<getAllPromotions_call> resultHandler) throws org.apache.thrift.TException {
882
      checkReady();
883
      getAllPromotions_call method_call = new getAllPromotions_call(resultHandler, this, ___protocolFactory, ___transport);
884
      this.___currentMethod = method_call;
885
      ___manager.call(method_call);
1982 varun.gupt 886
    }
887
 
3430 rajveer 888
    public static class getAllPromotions_call extends org.apache.thrift.async.TAsyncMethodCall {
889
      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 {
890
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 891
      }
892
 
3430 rajveer 893
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
894
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllPromotions", org.apache.thrift.protocol.TMessageType.CALL, 0));
895
        getAllPromotions_args args = new getAllPromotions_args();
896
        args.write(prot);
897
        prot.writeMessageEnd();
898
      }
1982 varun.gupt 899
 
3430 rajveer 900
      public List<Promotion> getResult() throws PromotionException, org.apache.thrift.TException {
901
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
902
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 903
        }
3430 rajveer 904
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
905
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
906
        return (new Client(prot)).recv_getAllPromotions();
1982 varun.gupt 907
      }
3430 rajveer 908
    }
1982 varun.gupt 909
 
3430 rajveer 910
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getPromotionById_call> resultHandler) throws org.apache.thrift.TException {
911
      checkReady();
912
      getPromotionById_call method_call = new getPromotionById_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
913
      this.___currentMethod = method_call;
914
      ___manager.call(method_call);
1982 varun.gupt 915
    }
916
 
3430 rajveer 917
    public static class getPromotionById_call extends org.apache.thrift.async.TAsyncMethodCall {
918
      private long promotionId;
919
      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 {
920
        super(client, protocolFactory, transport, resultHandler, false);
921
        this.promotionId = promotionId;
1982 varun.gupt 922
      }
923
 
3430 rajveer 924
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
925
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPromotionById", org.apache.thrift.protocol.TMessageType.CALL, 0));
926
        getPromotionById_args args = new getPromotionById_args();
927
        args.setPromotionId(promotionId);
928
        args.write(prot);
929
        prot.writeMessageEnd();
930
      }
1982 varun.gupt 931
 
3430 rajveer 932
      public Promotion getResult() throws PromotionException, org.apache.thrift.TException {
933
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
934
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 935
        }
3430 rajveer 936
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
937
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
938
        return (new Client(prot)).recv_getPromotionById();
1982 varun.gupt 939
      }
3430 rajveer 940
    }
1982 varun.gupt 941
 
3430 rajveer 942
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException {
943
      checkReady();
944
      generateCouponsForPromotion_call method_call = new generateCouponsForPromotion_call(promotionId, couponCode, resultHandler, this, ___protocolFactory, ___transport);
945
      this.___currentMethod = method_call;
946
      ___manager.call(method_call);
1982 varun.gupt 947
    }
948
 
3430 rajveer 949
    public static class generateCouponsForPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
950
      private long promotionId;
951
      private String couponCode;
952
      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 {
953
        super(client, protocolFactory, transport, resultHandler, false);
954
        this.promotionId = promotionId;
955
        this.couponCode = couponCode;
1982 varun.gupt 956
      }
957
 
3430 rajveer 958
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
959
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("generateCouponsForPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
960
        generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
961
        args.setPromotionId(promotionId);
962
        args.setCouponCode(couponCode);
963
        args.write(prot);
964
        prot.writeMessageEnd();
3385 varun.gupt 965
      }
966
 
3430 rajveer 967
      public void getResult() throws PromotionException, org.apache.thrift.TException {
968
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
969
          throw new IllegalStateException("Method call not finished!");
3385 varun.gupt 970
        }
3430 rajveer 971
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
972
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
973
        (new Client(prot)).recv_generateCouponsForPromotion();
3385 varun.gupt 974
      }
975
    }
976
 
3430 rajveer 977
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<applyCoupon_call> resultHandler) throws org.apache.thrift.TException {
978
      checkReady();
979
      applyCoupon_call method_call = new applyCoupon_call(couponCode, cartId, resultHandler, this, ___protocolFactory, ___transport);
980
      this.___currentMethod = method_call;
981
      ___manager.call(method_call);
3385 varun.gupt 982
    }
983
 
3430 rajveer 984
    public static class applyCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
985
      private String couponCode;
986
      private long cartId;
987
      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 {
988
        super(client, protocolFactory, transport, resultHandler, false);
989
        this.couponCode = couponCode;
990
        this.cartId = cartId;
1982 varun.gupt 991
      }
992
 
3430 rajveer 993
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
994
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("applyCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
995
        applyCoupon_args args = new applyCoupon_args();
996
        args.setCouponCode(couponCode);
997
        args.setCartId(cartId);
998
        args.write(prot);
999
        prot.writeMessageEnd();
1982 varun.gupt 1000
      }
1001
 
3430 rajveer 1002
      public Cart getResult() throws PromotionException, org.apache.thrift.TException {
1003
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1004
          throw new IllegalStateException("Method call not finished!");
1005
        }
1006
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1007
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1008
        return (new Client(prot)).recv_applyCoupon();
1982 varun.gupt 1009
      }
3430 rajveer 1010
    }
1982 varun.gupt 1011
 
6433 anupam.sin 1012
    public void applyRechargeCoupon(String couponCode, long totalAmount, long userId, org.apache.thrift.async.AsyncMethodCallback<applyRechargeCoupon_call> resultHandler) throws org.apache.thrift.TException {
1013
      checkReady();
1014
      applyRechargeCoupon_call method_call = new applyRechargeCoupon_call(couponCode, totalAmount, userId, resultHandler, this, ___protocolFactory, ___transport);
1015
      this.___currentMethod = method_call;
1016
      ___manager.call(method_call);
1017
    }
1018
 
1019
    public static class applyRechargeCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1020
      private String couponCode;
1021
      private long totalAmount;
1022
      private long userId;
1023
      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 {
1024
        super(client, protocolFactory, transport, resultHandler, false);
1025
        this.couponCode = couponCode;
1026
        this.totalAmount = totalAmount;
1027
        this.userId = userId;
1028
      }
1029
 
1030
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1031
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("applyRechargeCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1032
        applyRechargeCoupon_args args = new applyRechargeCoupon_args();
1033
        args.setCouponCode(couponCode);
1034
        args.setTotalAmount(totalAmount);
1035
        args.setUserId(userId);
1036
        args.write(prot);
1037
        prot.writeMessageEnd();
1038
      }
1039
 
1040
      public Map<Long,String> getResult() throws PromotionException, org.apache.thrift.TException {
1041
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1042
          throw new IllegalStateException("Method call not finished!");
1043
        }
1044
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1045
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1046
        return (new Client(prot)).recv_applyRechargeCoupon();
1047
      }
1048
    }
1049
 
3430 rajveer 1050
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException {
1051
      checkReady();
1052
      trackCouponUsage_call method_call = new trackCouponUsage_call(couponCode, transactionId, userId, resultHandler, this, ___protocolFactory, ___transport);
1053
      this.___currentMethod = method_call;
1054
      ___manager.call(method_call);
1055
    }
1982 varun.gupt 1056
 
3430 rajveer 1057
    public static class trackCouponUsage_call extends org.apache.thrift.async.TAsyncMethodCall {
1058
      private String couponCode;
1059
      private long transactionId;
1060
      private long userId;
1061
      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 {
1062
        super(client, protocolFactory, transport, resultHandler, false);
1063
        this.couponCode = couponCode;
1064
        this.transactionId = transactionId;
1065
        this.userId = userId;
1982 varun.gupt 1066
      }
1067
 
3430 rajveer 1068
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1069
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("trackCouponUsage", org.apache.thrift.protocol.TMessageType.CALL, 0));
1070
        trackCouponUsage_args args = new trackCouponUsage_args();
1071
        args.setCouponCode(couponCode);
1072
        args.setTransactionId(transactionId);
1073
        args.setUserId(userId);
1074
        args.write(prot);
1075
        prot.writeMessageEnd();
1982 varun.gupt 1076
      }
1077
 
3430 rajveer 1078
      public void getResult() throws PromotionException, org.apache.thrift.TException {
1079
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1080
          throw new IllegalStateException("Method call not finished!");
1081
        }
1082
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1083
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1084
        (new Client(prot)).recv_trackCouponUsage();
1982 varun.gupt 1085
      }
1086
    }
1087
 
3430 rajveer 1088
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException {
1089
      checkReady();
1090
      getCouponUsageCountByUser_call method_call = new getCouponUsageCountByUser_call(couponCode, userId, resultHandler, this, ___protocolFactory, ___transport);
1091
      this.___currentMethod = method_call;
1092
      ___manager.call(method_call);
1982 varun.gupt 1093
    }
1094
 
3430 rajveer 1095
    public static class getCouponUsageCountByUser_call extends org.apache.thrift.async.TAsyncMethodCall {
1096
      private String couponCode;
1097
      private long userId;
1098
      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 {
1099
        super(client, protocolFactory, transport, resultHandler, false);
1100
        this.couponCode = couponCode;
1101
        this.userId = userId;
1102
      }
1982 varun.gupt 1103
 
3430 rajveer 1104
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1105
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCouponUsageCountByUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
1106
        getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
1107
        args.setCouponCode(couponCode);
1108
        args.setUserId(userId);
1109
        args.write(prot);
1110
        prot.writeMessageEnd();
1111
      }
1982 varun.gupt 1112
 
3430 rajveer 1113
      public long getResult() throws PromotionException, org.apache.thrift.TException {
1114
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1115
          throw new IllegalStateException("Method call not finished!");
1116
        }
1117
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1118
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1119
        return (new Client(prot)).recv_getCouponUsageCountByUser();
1120
      }
1982 varun.gupt 1121
    }
1122
 
6497 amit.gupta 1123
    public void getActiveCodes(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getActiveCodes_call> resultHandler) throws org.apache.thrift.TException {
1124
      checkReady();
1125
      getActiveCodes_call method_call = new getActiveCodes_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
1126
      this.___currentMethod = method_call;
1127
      ___manager.call(method_call);
1128
    }
1129
 
1130
    public static class getActiveCodes_call extends org.apache.thrift.async.TAsyncMethodCall {
1131
      private long promotionId;
1132
      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 {
1133
        super(client, protocolFactory, transport, resultHandler, false);
1134
        this.promotionId = promotionId;
1135
      }
1136
 
1137
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1138
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getActiveCodes", org.apache.thrift.protocol.TMessageType.CALL, 0));
1139
        getActiveCodes_args args = new getActiveCodes_args();
1140
        args.setPromotionId(promotionId);
1141
        args.write(prot);
1142
        prot.writeMessageEnd();
1143
      }
1144
 
1145
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
1146
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1147
          throw new IllegalStateException("Method call not finished!");
1148
        }
1149
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1150
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1151
        return (new Client(prot)).recv_getActiveCodes();
1152
      }
1153
    }
1154
 
1155
    public void deleteCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<deleteCoupon_call> resultHandler) throws org.apache.thrift.TException {
1156
      checkReady();
1157
      deleteCoupon_call method_call = new deleteCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
1158
      this.___currentMethod = method_call;
1159
      ___manager.call(method_call);
1160
    }
1161
 
1162
    public static class deleteCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1163
      private String couponCode;
1164
      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 {
1165
        super(client, protocolFactory, transport, resultHandler, false);
1166
        this.couponCode = couponCode;
1167
      }
1168
 
1169
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1170
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1171
        deleteCoupon_args args = new deleteCoupon_args();
1172
        args.setCouponCode(couponCode);
1173
        args.write(prot);
1174
        prot.writeMessageEnd();
1175
      }
1176
 
1177
      public void getResult() throws PromotionException, org.apache.thrift.TException {
1178
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1179
          throw new IllegalStateException("Method call not finished!");
1180
        }
1181
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1182
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1183
        (new Client(prot)).recv_deleteCoupon();
1184
      }
1185
    }
1186
 
3430 rajveer 1187
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException {
1188
      checkReady();
1189
      getActiveCoupons_call method_call = new getActiveCoupons_call(resultHandler, this, ___protocolFactory, ___transport);
1190
      this.___currentMethod = method_call;
1191
      ___manager.call(method_call);
1982 varun.gupt 1192
    }
1193
 
3430 rajveer 1194
    public static class getActiveCoupons_call extends org.apache.thrift.async.TAsyncMethodCall {
1195
      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 {
1196
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 1197
      }
1198
 
3430 rajveer 1199
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1200
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getActiveCoupons", org.apache.thrift.protocol.TMessageType.CALL, 0));
1201
        getActiveCoupons_args args = new getActiveCoupons_args();
1202
        args.write(prot);
1203
        prot.writeMessageEnd();
1204
      }
1982 varun.gupt 1205
 
3430 rajveer 1206
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
1207
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1208
          throw new IllegalStateException("Method call not finished!");
1209
        }
1210
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1211
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1212
        return (new Client(prot)).recv_getActiveCoupons();
1982 varun.gupt 1213
      }
1214
    }
1215
 
6356 amit.gupta 1216
    public void createCoupon(long promotionId, long endOn, String email, long amount, boolean isCod, long usage, org.apache.thrift.async.AsyncMethodCallback<createCoupon_call> resultHandler) throws org.apache.thrift.TException {
6250 amit.gupta 1217
      checkReady();
6356 amit.gupta 1218
      createCoupon_call method_call = new createCoupon_call(promotionId, endOn, email, amount, isCod, usage, resultHandler, this, ___protocolFactory, ___transport);
6250 amit.gupta 1219
      this.___currentMethod = method_call;
1220
      ___manager.call(method_call);
1221
    }
1222
 
1223
    public static class createCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1224
      private long promotionId;
1225
      private long endOn;
1226
      private String email;
1227
      private long amount;
6356 amit.gupta 1228
      private boolean isCod;
6250 amit.gupta 1229
      private long usage;
6356 amit.gupta 1230
      public createCoupon_call(long promotionId, long endOn, String email, long amount, boolean isCod, long usage, 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 1231
        super(client, protocolFactory, transport, resultHandler, false);
1232
        this.promotionId = promotionId;
1233
        this.endOn = endOn;
1234
        this.email = email;
1235
        this.amount = amount;
6356 amit.gupta 1236
        this.isCod = isCod;
6250 amit.gupta 1237
        this.usage = usage;
1238
      }
1239
 
1240
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1241
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1242
        createCoupon_args args = new createCoupon_args();
1243
        args.setPromotionId(promotionId);
1244
        args.setEndOn(endOn);
1245
        args.setEmail(email);
1246
        args.setAmount(amount);
6356 amit.gupta 1247
        args.setIsCod(isCod);
6250 amit.gupta 1248
        args.setUsage(usage);
1249
        args.write(prot);
1250
        prot.writeMessageEnd();
1251
      }
1252
 
1253
      public String getResult() throws PromotionException, org.apache.thrift.TException {
1254
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1255
          throw new IllegalStateException("Method call not finished!");
1256
        }
1257
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1258
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1259
        return (new Client(prot)).recv_createCoupon();
1260
      }
1261
    }
1262
 
3430 rajveer 1263
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException {
1264
      checkReady();
1265
      getSuccessfulPaymentCountForCoupon_call method_call = new getSuccessfulPaymentCountForCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
1266
      this.___currentMethod = method_call;
1267
      ___manager.call(method_call);
1982 varun.gupt 1268
    }
1269
 
3430 rajveer 1270
    public static class getSuccessfulPaymentCountForCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1271
      private String couponCode;
1272
      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 {
1273
        super(client, protocolFactory, transport, resultHandler, false);
1274
        this.couponCode = couponCode;
1982 varun.gupt 1275
      }
1276
 
3430 rajveer 1277
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1278
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSuccessfulPaymentCountForCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1279
        getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
1280
        args.setCouponCode(couponCode);
1281
        args.write(prot);
1282
        prot.writeMessageEnd();
1283
      }
1982 varun.gupt 1284
 
3430 rajveer 1285
      public long getResult() throws PromotionException, org.apache.thrift.TException {
1286
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1287
          throw new IllegalStateException("Method call not finished!");
1288
        }
1289
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1290
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1291
        return (new Client(prot)).recv_getSuccessfulPaymentCountForCoupon();
1292
      }
1982 varun.gupt 1293
    }
1294
 
3430 rajveer 1295
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<getRuleDocString_call> resultHandler) throws org.apache.thrift.TException {
1296
      checkReady();
1297
      getRuleDocString_call method_call = new getRuleDocString_call(ruleName, resultHandler, this, ___protocolFactory, ___transport);
1298
      this.___currentMethod = method_call;
1299
      ___manager.call(method_call);
1982 varun.gupt 1300
    }
1301
 
3430 rajveer 1302
    public static class getRuleDocString_call extends org.apache.thrift.async.TAsyncMethodCall {
1303
      private String ruleName;
1304
      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 {
1305
        super(client, protocolFactory, transport, resultHandler, false);
1306
        this.ruleName = ruleName;
1307
      }
1982 varun.gupt 1308
 
3430 rajveer 1309
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1310
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRuleDocString", org.apache.thrift.protocol.TMessageType.CALL, 0));
1311
        getRuleDocString_args args = new getRuleDocString_args();
1312
        args.setRuleName(ruleName);
1313
        args.write(prot);
1314
        prot.writeMessageEnd();
1982 varun.gupt 1315
      }
1316
 
3430 rajveer 1317
      public String getResult() throws org.apache.thrift.TException {
1318
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1319
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 1320
        }
3430 rajveer 1321
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1322
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1323
        return (new Client(prot)).recv_getRuleDocString();
1982 varun.gupt 1324
      }
1325
    }
1326
 
4189 varun.gupt 1327
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException {
1328
      checkReady();
1329
      getItemDiscountMap_call method_call = new getItemDiscountMap_call(itemIds, resultHandler, this, ___protocolFactory, ___transport);
1330
      this.___currentMethod = method_call;
1331
      ___manager.call(method_call);
1332
    }
1333
 
1334
    public static class getItemDiscountMap_call extends org.apache.thrift.async.TAsyncMethodCall {
1335
      private List<Long> itemIds;
1336
      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 {
1337
        super(client, protocolFactory, transport, resultHandler, false);
1338
        this.itemIds = itemIds;
1339
      }
1340
 
1341
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1342
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getItemDiscountMap", org.apache.thrift.protocol.TMessageType.CALL, 0));
1343
        getItemDiscountMap_args args = new getItemDiscountMap_args();
1344
        args.setItemIds(itemIds);
1345
        args.write(prot);
1346
        prot.writeMessageEnd();
1347
      }
1348
 
1349
      public List<ItemCouponDiscount> getResult() throws PromotionException, org.apache.thrift.TException {
1350
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1351
          throw new IllegalStateException("Method call not finished!");
1352
        }
1353
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1354
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1355
        return (new Client(prot)).recv_getItemDiscountMap();
1356
      }
1357
    }
1358
 
4494 varun.gupt 1359
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException {
1360
      checkReady();
1361
      getDiscountsForEntity_call method_call = new getDiscountsForEntity_call(entityId, resultHandler, this, ___protocolFactory, ___transport);
1362
      this.___currentMethod = method_call;
1363
      ___manager.call(method_call);
1364
    }
1365
 
1366
    public static class getDiscountsForEntity_call extends org.apache.thrift.async.TAsyncMethodCall {
1367
      private long entityId;
1368
      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 {
1369
        super(client, protocolFactory, transport, resultHandler, false);
1370
        this.entityId = entityId;
1371
      }
1372
 
1373
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1374
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getDiscountsForEntity", org.apache.thrift.protocol.TMessageType.CALL, 0));
1375
        getDiscountsForEntity_args args = new getDiscountsForEntity_args();
1376
        args.setEntityId(entityId);
1377
        args.write(prot);
1378
        prot.writeMessageEnd();
1379
      }
1380
 
1381
      public Map<String,Double> getResult() throws org.apache.thrift.TException {
1382
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1383
          throw new IllegalStateException("Method call not finished!");
1384
        }
1385
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1386
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1387
        return (new Client(prot)).recv_getDiscountsForEntity();
1388
      }
1389
    }
1390
 
5469 rajveer 1391
    public void addVoucher(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<addVoucher_call> resultHandler) throws org.apache.thrift.TException {
1392
      checkReady();
1393
      addVoucher_call method_call = new addVoucher_call(voucher, resultHandler, this, ___protocolFactory, ___transport);
1394
      this.___currentMethod = method_call;
1395
      ___manager.call(method_call);
1396
    }
1397
 
1398
    public static class addVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
1399
      private Voucher voucher;
1400
      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 {
1401
        super(client, protocolFactory, transport, resultHandler, false);
1402
        this.voucher = voucher;
1403
      }
1404
 
1405
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1406
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
1407
        addVoucher_args args = new addVoucher_args();
1408
        args.setVoucher(voucher);
1409
        args.write(prot);
1410
        prot.writeMessageEnd();
1411
      }
1412
 
1413
      public void getResult() throws org.apache.thrift.TException {
1414
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1415
          throw new IllegalStateException("Method call not finished!");
1416
        }
1417
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1418
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1419
        (new Client(prot)).recv_addVoucher();
1420
      }
1421
    }
1422
 
1423
    public void assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount, org.apache.thrift.async.AsyncMethodCallback<assignVoucher_call> resultHandler) throws org.apache.thrift.TException {
1424
      checkReady();
1425
      assignVoucher_call method_call = new assignVoucher_call(userId, userEmail, voucherType, amount, resultHandler, this, ___protocolFactory, ___transport);
1426
      this.___currentMethod = method_call;
1427
      ___manager.call(method_call);
1428
    }
1429
 
1430
    public static class assignVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
1431
      private long userId;
1432
      private String userEmail;
1433
      private VoucherType voucherType;
1434
      private long amount;
1435
      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 {
1436
        super(client, protocolFactory, transport, resultHandler, false);
1437
        this.userId = userId;
1438
        this.userEmail = userEmail;
1439
        this.voucherType = voucherType;
1440
        this.amount = amount;
1441
      }
1442
 
1443
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1444
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("assignVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
1445
        assignVoucher_args args = new assignVoucher_args();
1446
        args.setUserId(userId);
1447
        args.setUserEmail(userEmail);
1448
        args.setVoucherType(voucherType);
1449
        args.setAmount(amount);
1450
        args.write(prot);
1451
        prot.writeMessageEnd();
1452
      }
1453
 
1454
      public Voucher getResult() throws org.apache.thrift.TException {
1455
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1456
          throw new IllegalStateException("Method call not finished!");
1457
        }
1458
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1459
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1460
        return (new Client(prot)).recv_assignVoucher();
1461
      }
1462
    }
1463
 
1464
    public void markVoucherAsRedeemed(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<markVoucherAsRedeemed_call> resultHandler) throws org.apache.thrift.TException {
1465
      checkReady();
1466
      markVoucherAsRedeemed_call method_call = new markVoucherAsRedeemed_call(voucherCode, redeemedOn, resultHandler, this, ___protocolFactory, ___transport);
1467
      this.___currentMethod = method_call;
1468
      ___manager.call(method_call);
1469
    }
1470
 
1471
    public static class markVoucherAsRedeemed_call extends org.apache.thrift.async.TAsyncMethodCall {
1472
      private String voucherCode;
1473
      private long redeemedOn;
1474
      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 {
1475
        super(client, protocolFactory, transport, resultHandler, false);
1476
        this.voucherCode = voucherCode;
1477
        this.redeemedOn = redeemedOn;
1478
      }
1479
 
1480
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1481
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("markVoucherAsRedeemed", org.apache.thrift.protocol.TMessageType.CALL, 0));
1482
        markVoucherAsRedeemed_args args = new markVoucherAsRedeemed_args();
1483
        args.setVoucherCode(voucherCode);
1484
        args.setRedeemedOn(redeemedOn);
1485
        args.write(prot);
1486
        prot.writeMessageEnd();
1487
      }
1488
 
1489
      public boolean getResult() throws org.apache.thrift.TException {
1490
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1491
          throw new IllegalStateException("Method call not finished!");
1492
        }
1493
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1494
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1495
        return (new Client(prot)).recv_markVoucherAsRedeemed();
1496
      }
1497
    }
1498
 
3430 rajveer 1499
  }
1982 varun.gupt 1500
 
3430 rajveer 1501
  public static class Processor<I extends Iface> extends in.shop2020.generic.GenericService.Processor implements org.apache.thrift.TProcessor {
1502
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
1503
    public Processor(I iface) {
1504
      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
1982 varun.gupt 1505
    }
1506
 
3430 rajveer 1507
    protected Processor(I iface, Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
1508
      super(iface, getProcessMap(processMap));
1982 varun.gupt 1509
    }
1510
 
3430 rajveer 1511
    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) {
1512
      processMap.put("createPromotion", new createPromotion());
6301 amit.gupta 1513
      processMap.put("getCoupon", new getCoupon());
1514
      processMap.put("isGiftVoucher", new isGiftVoucher());
6356 amit.gupta 1515
      processMap.put("isCodApplicable", new isCodApplicable());
3430 rajveer 1516
      processMap.put("getAllPromotions", new getAllPromotions());
1517
      processMap.put("getPromotionById", new getPromotionById());
1518
      processMap.put("generateCouponsForPromotion", new generateCouponsForPromotion());
1519
      processMap.put("applyCoupon", new applyCoupon());
6433 anupam.sin 1520
      processMap.put("applyRechargeCoupon", new applyRechargeCoupon());
3430 rajveer 1521
      processMap.put("trackCouponUsage", new trackCouponUsage());
1522
      processMap.put("getCouponUsageCountByUser", new getCouponUsageCountByUser());
6497 amit.gupta 1523
      processMap.put("getActiveCodes", new getActiveCodes());
1524
      processMap.put("deleteCoupon", new deleteCoupon());
3430 rajveer 1525
      processMap.put("getActiveCoupons", new getActiveCoupons());
6250 amit.gupta 1526
      processMap.put("createCoupon", new createCoupon());
3430 rajveer 1527
      processMap.put("getSuccessfulPaymentCountForCoupon", new getSuccessfulPaymentCountForCoupon());
1528
      processMap.put("getRuleDocString", new getRuleDocString());
4189 varun.gupt 1529
      processMap.put("getItemDiscountMap", new getItemDiscountMap());
4494 varun.gupt 1530
      processMap.put("getDiscountsForEntity", new getDiscountsForEntity());
5469 rajveer 1531
      processMap.put("addVoucher", new addVoucher());
1532
      processMap.put("assignVoucher", new assignVoucher());
1533
      processMap.put("markVoucherAsRedeemed", new markVoucherAsRedeemed());
3430 rajveer 1534
      return processMap;
1982 varun.gupt 1535
    }
1536
 
3430 rajveer 1537
    private static class createPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createPromotion_args> {
1538
      public createPromotion() {
1539
        super("createPromotion");
1540
      }
1982 varun.gupt 1541
 
3430 rajveer 1542
      protected createPromotion_args getEmptyArgsInstance() {
1543
        return new createPromotion_args();
1544
      }
1982 varun.gupt 1545
 
3430 rajveer 1546
      protected createPromotion_result getResult(I iface, createPromotion_args args) throws org.apache.thrift.TException {
1547
        createPromotion_result result = new createPromotion_result();
1548
        try {
1549
          iface.createPromotion(args.name, args.ruleExecutionSrc, args.startOn, args.endOn);
1550
        } catch (PromotionException pex) {
1551
          result.pex = pex;
1982 varun.gupt 1552
        }
3430 rajveer 1553
        return result;
1982 varun.gupt 1554
      }
3430 rajveer 1555
    }
1982 varun.gupt 1556
 
6301 amit.gupta 1557
    private static class getCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCoupon_args> {
1558
      public getCoupon() {
1559
        super("getCoupon");
1560
      }
1561
 
1562
      protected getCoupon_args getEmptyArgsInstance() {
1563
        return new getCoupon_args();
1564
      }
1565
 
1566
      protected getCoupon_result getResult(I iface, getCoupon_args args) throws org.apache.thrift.TException {
1567
        getCoupon_result result = new getCoupon_result();
1568
        try {
1569
          result.success = iface.getCoupon(args.couponCode);
1570
        } catch (PromotionException pex) {
1571
          result.pex = pex;
1572
        }
1573
        return result;
1574
      }
1575
    }
1576
 
1577
    private static class isGiftVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isGiftVoucher_args> {
1578
      public isGiftVoucher() {
1579
        super("isGiftVoucher");
1580
      }
1581
 
1582
      protected isGiftVoucher_args getEmptyArgsInstance() {
1583
        return new isGiftVoucher_args();
1584
      }
1585
 
1586
      protected isGiftVoucher_result getResult(I iface, isGiftVoucher_args args) throws org.apache.thrift.TException {
1587
        isGiftVoucher_result result = new isGiftVoucher_result();
1588
        try {
1589
          result.success = iface.isGiftVoucher(args.couponCode);
1590
          result.setSuccessIsSet(true);
1591
        } catch (PromotionException pex) {
1592
          result.pex = pex;
1593
        }
1594
        return result;
1595
      }
1596
    }
1597
 
6356 amit.gupta 1598
    private static class isCodApplicable<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isCodApplicable_args> {
1599
      public isCodApplicable() {
1600
        super("isCodApplicable");
1601
      }
1602
 
1603
      protected isCodApplicable_args getEmptyArgsInstance() {
1604
        return new isCodApplicable_args();
1605
      }
1606
 
1607
      protected isCodApplicable_result getResult(I iface, isCodApplicable_args args) throws org.apache.thrift.TException {
1608
        isCodApplicable_result result = new isCodApplicable_result();
1609
        try {
1610
          result.success = iface.isCodApplicable(args.couponCode);
1611
          result.setSuccessIsSet(true);
1612
        } catch (PromotionException pex) {
1613
          result.pex = pex;
1614
        }
1615
        return result;
1616
      }
1617
    }
1618
 
3430 rajveer 1619
    private static class getAllPromotions<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllPromotions_args> {
1620
      public getAllPromotions() {
1621
        super("getAllPromotions");
1982 varun.gupt 1622
      }
1623
 
3430 rajveer 1624
      protected getAllPromotions_args getEmptyArgsInstance() {
1625
        return new getAllPromotions_args();
1982 varun.gupt 1626
      }
1627
 
3430 rajveer 1628
      protected getAllPromotions_result getResult(I iface, getAllPromotions_args args) throws org.apache.thrift.TException {
1629
        getAllPromotions_result result = new getAllPromotions_result();
1630
        try {
1631
          result.success = iface.getAllPromotions();
1632
        } catch (PromotionException pex) {
1633
          result.pex = pex;
1634
        }
1635
        return result;
1982 varun.gupt 1636
      }
3430 rajveer 1637
    }
1982 varun.gupt 1638
 
3430 rajveer 1639
    private static class getPromotionById<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPromotionById_args> {
1640
      public getPromotionById() {
1641
        super("getPromotionById");
1982 varun.gupt 1642
      }
1643
 
3430 rajveer 1644
      protected getPromotionById_args getEmptyArgsInstance() {
1645
        return new getPromotionById_args();
1982 varun.gupt 1646
      }
1647
 
3430 rajveer 1648
      protected getPromotionById_result getResult(I iface, getPromotionById_args args) throws org.apache.thrift.TException {
1649
        getPromotionById_result result = new getPromotionById_result();
1650
        try {
1651
          result.success = iface.getPromotionById(args.promotionId);
1652
        } catch (PromotionException pex) {
1653
          result.pex = pex;
1654
        }
1655
        return result;
1982 varun.gupt 1656
      }
1657
    }
1658
 
3430 rajveer 1659
    private static class generateCouponsForPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, generateCouponsForPromotion_args> {
1660
      public generateCouponsForPromotion() {
1661
        super("generateCouponsForPromotion");
1662
      }
1982 varun.gupt 1663
 
3430 rajveer 1664
      protected generateCouponsForPromotion_args getEmptyArgsInstance() {
1665
        return new generateCouponsForPromotion_args();
1666
      }
1982 varun.gupt 1667
 
3430 rajveer 1668
      protected generateCouponsForPromotion_result getResult(I iface, generateCouponsForPromotion_args args) throws org.apache.thrift.TException {
1669
        generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
1670
        try {
1671
          iface.generateCouponsForPromotion(args.promotionId, args.couponCode);
1672
        } catch (PromotionException pex) {
1673
          result.pex = pex;
1674
        }
1675
        return result;
1676
      }
1982 varun.gupt 1677
    }
1678
 
3430 rajveer 1679
    private static class applyCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, applyCoupon_args> {
1680
      public applyCoupon() {
1681
        super("applyCoupon");
1682
      }
1982 varun.gupt 1683
 
3430 rajveer 1684
      protected applyCoupon_args getEmptyArgsInstance() {
1685
        return new applyCoupon_args();
1686
      }
1982 varun.gupt 1687
 
3430 rajveer 1688
      protected applyCoupon_result getResult(I iface, applyCoupon_args args) throws org.apache.thrift.TException {
1689
        applyCoupon_result result = new applyCoupon_result();
1690
        try {
1691
          result.success = iface.applyCoupon(args.couponCode, args.cartId);
1692
        } catch (PromotionException pex) {
1693
          result.pex = pex;
1694
        }
1695
        return result;
1982 varun.gupt 1696
      }
1697
    }
1698
 
6433 anupam.sin 1699
    private static class applyRechargeCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, applyRechargeCoupon_args> {
1700
      public applyRechargeCoupon() {
1701
        super("applyRechargeCoupon");
1702
      }
1703
 
1704
      protected applyRechargeCoupon_args getEmptyArgsInstance() {
1705
        return new applyRechargeCoupon_args();
1706
      }
1707
 
1708
      protected applyRechargeCoupon_result getResult(I iface, applyRechargeCoupon_args args) throws org.apache.thrift.TException {
1709
        applyRechargeCoupon_result result = new applyRechargeCoupon_result();
1710
        try {
1711
          result.success = iface.applyRechargeCoupon(args.couponCode, args.totalAmount, args.userId);
1712
        } catch (PromotionException pex) {
1713
          result.pex = pex;
1714
        }
1715
        return result;
1716
      }
1717
    }
1718
 
3430 rajveer 1719
    private static class trackCouponUsage<I extends Iface> extends org.apache.thrift.ProcessFunction<I, trackCouponUsage_args> {
1720
      public trackCouponUsage() {
1721
        super("trackCouponUsage");
1722
      }
1982 varun.gupt 1723
 
3430 rajveer 1724
      protected trackCouponUsage_args getEmptyArgsInstance() {
1725
        return new trackCouponUsage_args();
1982 varun.gupt 1726
      }
1727
 
3430 rajveer 1728
      protected trackCouponUsage_result getResult(I iface, trackCouponUsage_args args) throws org.apache.thrift.TException {
1729
        trackCouponUsage_result result = new trackCouponUsage_result();
1730
        try {
1731
          iface.trackCouponUsage(args.couponCode, args.transactionId, args.userId);
1732
        } catch (PromotionException pex) {
1733
          result.pex = pex;
1734
        }
1735
        return result;
1736
      }
1982 varun.gupt 1737
    }
1738
 
3430 rajveer 1739
    private static class getCouponUsageCountByUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCouponUsageCountByUser_args> {
1740
      public getCouponUsageCountByUser() {
1741
        super("getCouponUsageCountByUser");
1982 varun.gupt 1742
      }
1743
 
3430 rajveer 1744
      protected getCouponUsageCountByUser_args getEmptyArgsInstance() {
1745
        return new getCouponUsageCountByUser_args();
1746
      }
1982 varun.gupt 1747
 
3430 rajveer 1748
      protected getCouponUsageCountByUser_result getResult(I iface, getCouponUsageCountByUser_args args) throws org.apache.thrift.TException {
1749
        getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
1750
        try {
1751
          result.success = iface.getCouponUsageCountByUser(args.couponCode, args.userId);
1752
          result.setSuccessIsSet(true);
1753
        } catch (PromotionException pex) {
1754
          result.pex = pex;
1755
        }
1756
        return result;
1757
      }
1982 varun.gupt 1758
    }
1759
 
6497 amit.gupta 1760
    private static class getActiveCodes<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getActiveCodes_args> {
1761
      public getActiveCodes() {
1762
        super("getActiveCodes");
1763
      }
1764
 
1765
      protected getActiveCodes_args getEmptyArgsInstance() {
1766
        return new getActiveCodes_args();
1767
      }
1768
 
1769
      protected getActiveCodes_result getResult(I iface, getActiveCodes_args args) throws org.apache.thrift.TException {
1770
        getActiveCodes_result result = new getActiveCodes_result();
1771
        try {
1772
          result.success = iface.getActiveCodes(args.promotionId);
1773
        } catch (PromotionException pex) {
1774
          result.pex = pex;
1775
        }
1776
        return result;
1777
      }
1778
    }
1779
 
1780
    private static class deleteCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, deleteCoupon_args> {
1781
      public deleteCoupon() {
1782
        super("deleteCoupon");
1783
      }
1784
 
1785
      protected deleteCoupon_args getEmptyArgsInstance() {
1786
        return new deleteCoupon_args();
1787
      }
1788
 
1789
      protected deleteCoupon_result getResult(I iface, deleteCoupon_args args) throws org.apache.thrift.TException {
1790
        deleteCoupon_result result = new deleteCoupon_result();
1791
        try {
1792
          iface.deleteCoupon(args.couponCode);
1793
        } catch (PromotionException pex) {
1794
          result.pex = pex;
1795
        }
1796
        return result;
1797
      }
1798
    }
1799
 
3430 rajveer 1800
    private static class getActiveCoupons<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getActiveCoupons_args> {
1801
      public getActiveCoupons() {
1802
        super("getActiveCoupons");
1803
      }
1982 varun.gupt 1804
 
3430 rajveer 1805
      protected getActiveCoupons_args getEmptyArgsInstance() {
1806
        return new getActiveCoupons_args();
1807
      }
1982 varun.gupt 1808
 
3430 rajveer 1809
      protected getActiveCoupons_result getResult(I iface, getActiveCoupons_args args) throws org.apache.thrift.TException {
1810
        getActiveCoupons_result result = new getActiveCoupons_result();
1811
        try {
1812
          result.success = iface.getActiveCoupons();
1813
        } catch (PromotionException pex) {
1814
          result.pex = pex;
1815
        }
1816
        return result;
1817
      }
1982 varun.gupt 1818
    }
1819
 
6250 amit.gupta 1820
    private static class createCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createCoupon_args> {
1821
      public createCoupon() {
1822
        super("createCoupon");
1823
      }
1824
 
1825
      protected createCoupon_args getEmptyArgsInstance() {
1826
        return new createCoupon_args();
1827
      }
1828
 
1829
      protected createCoupon_result getResult(I iface, createCoupon_args args) throws org.apache.thrift.TException {
1830
        createCoupon_result result = new createCoupon_result();
1831
        try {
6356 amit.gupta 1832
          result.success = iface.createCoupon(args.promotionId, args.endOn, args.email, args.amount, args.isCod, args.usage);
6250 amit.gupta 1833
        } catch (PromotionException pex) {
1834
          result.pex = pex;
1835
        }
1836
        return result;
1837
      }
1838
    }
1839
 
3430 rajveer 1840
    private static class getSuccessfulPaymentCountForCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSuccessfulPaymentCountForCoupon_args> {
1841
      public getSuccessfulPaymentCountForCoupon() {
1842
        super("getSuccessfulPaymentCountForCoupon");
1982 varun.gupt 1843
      }
1844
 
3430 rajveer 1845
      protected getSuccessfulPaymentCountForCoupon_args getEmptyArgsInstance() {
1846
        return new getSuccessfulPaymentCountForCoupon_args();
1847
      }
1982 varun.gupt 1848
 
3430 rajveer 1849
      protected getSuccessfulPaymentCountForCoupon_result getResult(I iface, getSuccessfulPaymentCountForCoupon_args args) throws org.apache.thrift.TException {
1850
        getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
1851
        try {
1852
          result.success = iface.getSuccessfulPaymentCountForCoupon(args.couponCode);
1853
          result.setSuccessIsSet(true);
1854
        } catch (PromotionException pex) {
1855
          result.pex = pex;
1982 varun.gupt 1856
        }
3430 rajveer 1857
        return result;
1982 varun.gupt 1858
      }
1859
    }
1860
 
3430 rajveer 1861
    private static class getRuleDocString<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getRuleDocString_args> {
1862
      public getRuleDocString() {
1863
        super("getRuleDocString");
1864
      }
1982 varun.gupt 1865
 
3430 rajveer 1866
      protected getRuleDocString_args getEmptyArgsInstance() {
1867
        return new getRuleDocString_args();
1868
      }
1982 varun.gupt 1869
 
3430 rajveer 1870
      protected getRuleDocString_result getResult(I iface, getRuleDocString_args args) throws org.apache.thrift.TException {
1871
        getRuleDocString_result result = new getRuleDocString_result();
1872
        result.success = iface.getRuleDocString(args.ruleName);
1873
        return result;
1874
      }
1982 varun.gupt 1875
    }
1876
 
4189 varun.gupt 1877
    private static class getItemDiscountMap<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getItemDiscountMap_args> {
1878
      public getItemDiscountMap() {
1879
        super("getItemDiscountMap");
1880
      }
1881
 
1882
      protected getItemDiscountMap_args getEmptyArgsInstance() {
1883
        return new getItemDiscountMap_args();
1884
      }
1885
 
1886
      protected getItemDiscountMap_result getResult(I iface, getItemDiscountMap_args args) throws org.apache.thrift.TException {
1887
        getItemDiscountMap_result result = new getItemDiscountMap_result();
1888
        try {
1889
          result.success = iface.getItemDiscountMap(args.itemIds);
1890
        } catch (PromotionException pex) {
1891
          result.pex = pex;
1892
        }
1893
        return result;
1894
      }
1895
    }
1896
 
4494 varun.gupt 1897
    private static class getDiscountsForEntity<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getDiscountsForEntity_args> {
1898
      public getDiscountsForEntity() {
1899
        super("getDiscountsForEntity");
1900
      }
1901
 
1902
      protected getDiscountsForEntity_args getEmptyArgsInstance() {
1903
        return new getDiscountsForEntity_args();
1904
      }
1905
 
1906
      protected getDiscountsForEntity_result getResult(I iface, getDiscountsForEntity_args args) throws org.apache.thrift.TException {
1907
        getDiscountsForEntity_result result = new getDiscountsForEntity_result();
1908
        result.success = iface.getDiscountsForEntity(args.entityId);
1909
        return result;
1910
      }
1911
    }
1912
 
5469 rajveer 1913
    private static class addVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addVoucher_args> {
1914
      public addVoucher() {
1915
        super("addVoucher");
1916
      }
1917
 
1918
      protected addVoucher_args getEmptyArgsInstance() {
1919
        return new addVoucher_args();
1920
      }
1921
 
1922
      protected addVoucher_result getResult(I iface, addVoucher_args args) throws org.apache.thrift.TException {
1923
        addVoucher_result result = new addVoucher_result();
1924
        iface.addVoucher(args.voucher);
1925
        return result;
1926
      }
1927
    }
1928
 
1929
    private static class assignVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, assignVoucher_args> {
1930
      public assignVoucher() {
1931
        super("assignVoucher");
1932
      }
1933
 
1934
      protected assignVoucher_args getEmptyArgsInstance() {
1935
        return new assignVoucher_args();
1936
      }
1937
 
1938
      protected assignVoucher_result getResult(I iface, assignVoucher_args args) throws org.apache.thrift.TException {
1939
        assignVoucher_result result = new assignVoucher_result();
1940
        result.success = iface.assignVoucher(args.userId, args.userEmail, args.voucherType, args.amount);
1941
        return result;
1942
      }
1943
    }
1944
 
1945
    private static class markVoucherAsRedeemed<I extends Iface> extends org.apache.thrift.ProcessFunction<I, markVoucherAsRedeemed_args> {
1946
      public markVoucherAsRedeemed() {
1947
        super("markVoucherAsRedeemed");
1948
      }
1949
 
1950
      protected markVoucherAsRedeemed_args getEmptyArgsInstance() {
1951
        return new markVoucherAsRedeemed_args();
1952
      }
1953
 
1954
      protected markVoucherAsRedeemed_result getResult(I iface, markVoucherAsRedeemed_args args) throws org.apache.thrift.TException {
1955
        markVoucherAsRedeemed_result result = new markVoucherAsRedeemed_result();
1956
        result.success = iface.markVoucherAsRedeemed(args.voucherCode, args.redeemedOn);
1957
        result.setSuccessIsSet(true);
1958
        return result;
1959
      }
1960
    }
1961
 
1982 varun.gupt 1962
  }
1963
 
3430 rajveer 1964
  public static class createPromotion_args implements org.apache.thrift.TBase<createPromotion_args, createPromotion_args._Fields>, java.io.Serializable, Cloneable   {
1965
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_args");
1982 varun.gupt 1966
 
3430 rajveer 1967
    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);
1968
    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);
1969
    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);
1970
    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 1971
 
3430 rajveer 1972
    private String name; // required
1973
    private String ruleExecutionSrc; // required
1974
    private long startOn; // required
1975
    private long endOn; // required
1982 varun.gupt 1976
 
1977
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 1978
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 1979
      NAME((short)1, "name"),
1980
      RULE_EXECUTION_SRC((short)2, "ruleExecutionSrc"),
1981
      START_ON((short)3, "startOn"),
1982
      END_ON((short)4, "endOn");
1983
 
1984
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
1985
 
1986
      static {
1987
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
1988
          byName.put(field.getFieldName(), field);
1989
        }
1990
      }
1991
 
1992
      /**
1993
       * Find the _Fields constant that matches fieldId, or null if its not found.
1994
       */
1995
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 1996
        switch(fieldId) {
1997
          case 1: // NAME
1998
            return NAME;
1999
          case 2: // RULE_EXECUTION_SRC
2000
            return RULE_EXECUTION_SRC;
2001
          case 3: // START_ON
2002
            return START_ON;
2003
          case 4: // END_ON
2004
            return END_ON;
2005
          default:
2006
            return null;
2007
        }
1982 varun.gupt 2008
      }
2009
 
2010
      /**
2011
       * Find the _Fields constant that matches fieldId, throwing an exception
2012
       * if it is not found.
2013
       */
2014
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2015
        _Fields fields = findByThriftId(fieldId);
2016
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2017
        return fields;
2018
      }
2019
 
2020
      /**
2021
       * Find the _Fields constant that matches name, or null if its not found.
2022
       */
2023
      public static _Fields findByName(String name) {
2024
        return byName.get(name);
2025
      }
2026
 
2027
      private final short _thriftId;
2028
      private final String _fieldName;
2029
 
2030
      _Fields(short thriftId, String fieldName) {
2031
        _thriftId = thriftId;
2032
        _fieldName = fieldName;
2033
      }
2034
 
2035
      public short getThriftFieldId() {
2036
        return _thriftId;
2037
      }
2038
 
2039
      public String getFieldName() {
2040
        return _fieldName;
2041
      }
2042
    }
2043
 
2044
    // isset id assignments
2045
    private static final int __STARTON_ISSET_ID = 0;
2046
    private static final int __ENDON_ISSET_ID = 1;
2047
    private BitSet __isset_bit_vector = new BitSet(2);
2048
 
3430 rajveer 2049
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2050
    static {
3430 rajveer 2051
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2052
      tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2053
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
2054
      tmpMap.put(_Fields.RULE_EXECUTION_SRC, new org.apache.thrift.meta_data.FieldMetaData("ruleExecutionSrc", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2055
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
2056
      tmpMap.put(_Fields.START_ON, new org.apache.thrift.meta_data.FieldMetaData("startOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2057
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
2058
      tmpMap.put(_Fields.END_ON, new org.apache.thrift.meta_data.FieldMetaData("endOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2059
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
2060
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2061
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_args.class, metaDataMap);
1982 varun.gupt 2062
    }
2063
 
2064
    public createPromotion_args() {
2065
    }
2066
 
2067
    public createPromotion_args(
2068
      String name,
2069
      String ruleExecutionSrc,
2070
      long startOn,
2071
      long endOn)
2072
    {
2073
      this();
2074
      this.name = name;
2075
      this.ruleExecutionSrc = ruleExecutionSrc;
2076
      this.startOn = startOn;
2077
      setStartOnIsSet(true);
2078
      this.endOn = endOn;
2079
      setEndOnIsSet(true);
2080
    }
2081
 
2082
    /**
2083
     * Performs a deep copy on <i>other</i>.
2084
     */
2085
    public createPromotion_args(createPromotion_args other) {
2086
      __isset_bit_vector.clear();
2087
      __isset_bit_vector.or(other.__isset_bit_vector);
2088
      if (other.isSetName()) {
2089
        this.name = other.name;
2090
      }
2091
      if (other.isSetRuleExecutionSrc()) {
2092
        this.ruleExecutionSrc = other.ruleExecutionSrc;
2093
      }
2094
      this.startOn = other.startOn;
2095
      this.endOn = other.endOn;
2096
    }
2097
 
2098
    public createPromotion_args deepCopy() {
2099
      return new createPromotion_args(this);
2100
    }
2101
 
3430 rajveer 2102
    @Override
2103
    public void clear() {
2104
      this.name = null;
2105
      this.ruleExecutionSrc = null;
2106
      setStartOnIsSet(false);
2107
      this.startOn = 0;
2108
      setEndOnIsSet(false);
2109
      this.endOn = 0;
1982 varun.gupt 2110
    }
2111
 
2112
    public String getName() {
2113
      return this.name;
2114
    }
2115
 
3430 rajveer 2116
    public void setName(String name) {
1982 varun.gupt 2117
      this.name = name;
2118
    }
2119
 
2120
    public void unsetName() {
2121
      this.name = null;
2122
    }
2123
 
3430 rajveer 2124
    /** Returns true if field name is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2125
    public boolean isSetName() {
2126
      return this.name != null;
2127
    }
2128
 
2129
    public void setNameIsSet(boolean value) {
2130
      if (!value) {
2131
        this.name = null;
2132
      }
2133
    }
2134
 
2135
    public String getRuleExecutionSrc() {
2136
      return this.ruleExecutionSrc;
2137
    }
2138
 
3430 rajveer 2139
    public void setRuleExecutionSrc(String ruleExecutionSrc) {
1982 varun.gupt 2140
      this.ruleExecutionSrc = ruleExecutionSrc;
2141
    }
2142
 
2143
    public void unsetRuleExecutionSrc() {
2144
      this.ruleExecutionSrc = null;
2145
    }
2146
 
3430 rajveer 2147
    /** Returns true if field ruleExecutionSrc is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2148
    public boolean isSetRuleExecutionSrc() {
2149
      return this.ruleExecutionSrc != null;
2150
    }
2151
 
2152
    public void setRuleExecutionSrcIsSet(boolean value) {
2153
      if (!value) {
2154
        this.ruleExecutionSrc = null;
2155
      }
2156
    }
2157
 
2158
    public long getStartOn() {
2159
      return this.startOn;
2160
    }
2161
 
3430 rajveer 2162
    public void setStartOn(long startOn) {
1982 varun.gupt 2163
      this.startOn = startOn;
2164
      setStartOnIsSet(true);
2165
    }
2166
 
2167
    public void unsetStartOn() {
2168
      __isset_bit_vector.clear(__STARTON_ISSET_ID);
2169
    }
2170
 
3430 rajveer 2171
    /** Returns true if field startOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2172
    public boolean isSetStartOn() {
2173
      return __isset_bit_vector.get(__STARTON_ISSET_ID);
2174
    }
2175
 
2176
    public void setStartOnIsSet(boolean value) {
2177
      __isset_bit_vector.set(__STARTON_ISSET_ID, value);
2178
    }
2179
 
2180
    public long getEndOn() {
2181
      return this.endOn;
2182
    }
2183
 
3430 rajveer 2184
    public void setEndOn(long endOn) {
1982 varun.gupt 2185
      this.endOn = endOn;
2186
      setEndOnIsSet(true);
2187
    }
2188
 
2189
    public void unsetEndOn() {
2190
      __isset_bit_vector.clear(__ENDON_ISSET_ID);
2191
    }
2192
 
3430 rajveer 2193
    /** Returns true if field endOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2194
    public boolean isSetEndOn() {
2195
      return __isset_bit_vector.get(__ENDON_ISSET_ID);
2196
    }
2197
 
2198
    public void setEndOnIsSet(boolean value) {
2199
      __isset_bit_vector.set(__ENDON_ISSET_ID, value);
2200
    }
2201
 
2202
    public void setFieldValue(_Fields field, Object value) {
2203
      switch (field) {
2204
      case NAME:
2205
        if (value == null) {
2206
          unsetName();
2207
        } else {
2208
          setName((String)value);
2209
        }
2210
        break;
2211
 
2212
      case RULE_EXECUTION_SRC:
2213
        if (value == null) {
2214
          unsetRuleExecutionSrc();
2215
        } else {
2216
          setRuleExecutionSrc((String)value);
2217
        }
2218
        break;
2219
 
2220
      case START_ON:
2221
        if (value == null) {
2222
          unsetStartOn();
2223
        } else {
2224
          setStartOn((Long)value);
2225
        }
2226
        break;
2227
 
2228
      case END_ON:
2229
        if (value == null) {
2230
          unsetEndOn();
2231
        } else {
2232
          setEndOn((Long)value);
2233
        }
2234
        break;
2235
 
2236
      }
2237
    }
2238
 
2239
    public Object getFieldValue(_Fields field) {
2240
      switch (field) {
2241
      case NAME:
2242
        return getName();
2243
 
2244
      case RULE_EXECUTION_SRC:
2245
        return getRuleExecutionSrc();
2246
 
2247
      case START_ON:
3430 rajveer 2248
        return Long.valueOf(getStartOn());
1982 varun.gupt 2249
 
2250
      case END_ON:
3430 rajveer 2251
        return Long.valueOf(getEndOn());
1982 varun.gupt 2252
 
2253
      }
2254
      throw new IllegalStateException();
2255
    }
2256
 
3430 rajveer 2257
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2258
    public boolean isSet(_Fields field) {
2259
      if (field == null) {
2260
        throw new IllegalArgumentException();
2261
      }
1982 varun.gupt 2262
 
2263
      switch (field) {
2264
      case NAME:
2265
        return isSetName();
2266
      case RULE_EXECUTION_SRC:
2267
        return isSetRuleExecutionSrc();
2268
      case START_ON:
2269
        return isSetStartOn();
2270
      case END_ON:
2271
        return isSetEndOn();
2272
      }
2273
      throw new IllegalStateException();
2274
    }
2275
 
2276
    @Override
2277
    public boolean equals(Object that) {
2278
      if (that == null)
2279
        return false;
2280
      if (that instanceof createPromotion_args)
2281
        return this.equals((createPromotion_args)that);
2282
      return false;
2283
    }
2284
 
2285
    public boolean equals(createPromotion_args that) {
2286
      if (that == null)
2287
        return false;
2288
 
2289
      boolean this_present_name = true && this.isSetName();
2290
      boolean that_present_name = true && that.isSetName();
2291
      if (this_present_name || that_present_name) {
2292
        if (!(this_present_name && that_present_name))
2293
          return false;
2294
        if (!this.name.equals(that.name))
2295
          return false;
2296
      }
2297
 
2298
      boolean this_present_ruleExecutionSrc = true && this.isSetRuleExecutionSrc();
2299
      boolean that_present_ruleExecutionSrc = true && that.isSetRuleExecutionSrc();
2300
      if (this_present_ruleExecutionSrc || that_present_ruleExecutionSrc) {
2301
        if (!(this_present_ruleExecutionSrc && that_present_ruleExecutionSrc))
2302
          return false;
2303
        if (!this.ruleExecutionSrc.equals(that.ruleExecutionSrc))
2304
          return false;
2305
      }
2306
 
2307
      boolean this_present_startOn = true;
2308
      boolean that_present_startOn = true;
2309
      if (this_present_startOn || that_present_startOn) {
2310
        if (!(this_present_startOn && that_present_startOn))
2311
          return false;
2312
        if (this.startOn != that.startOn)
2313
          return false;
2314
      }
2315
 
2316
      boolean this_present_endOn = true;
2317
      boolean that_present_endOn = true;
2318
      if (this_present_endOn || that_present_endOn) {
2319
        if (!(this_present_endOn && that_present_endOn))
2320
          return false;
2321
        if (this.endOn != that.endOn)
2322
          return false;
2323
      }
2324
 
2325
      return true;
2326
    }
2327
 
2328
    @Override
2329
    public int hashCode() {
2330
      return 0;
2331
    }
2332
 
2333
    public int compareTo(createPromotion_args other) {
2334
      if (!getClass().equals(other.getClass())) {
2335
        return getClass().getName().compareTo(other.getClass().getName());
2336
      }
2337
 
2338
      int lastComparison = 0;
2339
      createPromotion_args typedOther = (createPromotion_args)other;
2340
 
3430 rajveer 2341
      lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
1982 varun.gupt 2342
      if (lastComparison != 0) {
2343
        return lastComparison;
2344
      }
3430 rajveer 2345
      if (isSetName()) {
2346
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
2347
        if (lastComparison != 0) {
2348
          return lastComparison;
2349
        }
1982 varun.gupt 2350
      }
3430 rajveer 2351
      lastComparison = Boolean.valueOf(isSetRuleExecutionSrc()).compareTo(typedOther.isSetRuleExecutionSrc());
1982 varun.gupt 2352
      if (lastComparison != 0) {
2353
        return lastComparison;
2354
      }
3430 rajveer 2355
      if (isSetRuleExecutionSrc()) {
2356
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleExecutionSrc, typedOther.ruleExecutionSrc);
2357
        if (lastComparison != 0) {
2358
          return lastComparison;
2359
        }
1982 varun.gupt 2360
      }
3430 rajveer 2361
      lastComparison = Boolean.valueOf(isSetStartOn()).compareTo(typedOther.isSetStartOn());
1982 varun.gupt 2362
      if (lastComparison != 0) {
2363
        return lastComparison;
2364
      }
3430 rajveer 2365
      if (isSetStartOn()) {
2366
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startOn, typedOther.startOn);
2367
        if (lastComparison != 0) {
2368
          return lastComparison;
2369
        }
1982 varun.gupt 2370
      }
3430 rajveer 2371
      lastComparison = Boolean.valueOf(isSetEndOn()).compareTo(typedOther.isSetEndOn());
1982 varun.gupt 2372
      if (lastComparison != 0) {
2373
        return lastComparison;
2374
      }
3430 rajveer 2375
      if (isSetEndOn()) {
2376
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endOn, typedOther.endOn);
2377
        if (lastComparison != 0) {
2378
          return lastComparison;
2379
        }
1982 varun.gupt 2380
      }
2381
      return 0;
2382
    }
2383
 
3430 rajveer 2384
    public _Fields fieldForId(int fieldId) {
2385
      return _Fields.findByThriftId(fieldId);
2386
    }
2387
 
2388
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2389
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2390
      iprot.readStructBegin();
2391
      while (true)
2392
      {
2393
        field = iprot.readFieldBegin();
3430 rajveer 2394
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2395
          break;
2396
        }
3430 rajveer 2397
        switch (field.id) {
2398
          case 1: // NAME
2399
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
2400
              this.name = iprot.readString();
2401
            } else { 
2402
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2403
            }
2404
            break;
2405
          case 2: // RULE_EXECUTION_SRC
2406
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
2407
              this.ruleExecutionSrc = iprot.readString();
2408
            } else { 
2409
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2410
            }
2411
            break;
2412
          case 3: // START_ON
2413
            if (field.type == org.apache.thrift.protocol.TType.I64) {
2414
              this.startOn = iprot.readI64();
2415
              setStartOnIsSet(true);
2416
            } else { 
2417
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2418
            }
2419
            break;
2420
          case 4: // END_ON
2421
            if (field.type == org.apache.thrift.protocol.TType.I64) {
2422
              this.endOn = iprot.readI64();
2423
              setEndOnIsSet(true);
2424
            } else { 
2425
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2426
            }
2427
            break;
2428
          default:
2429
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2430
        }
3430 rajveer 2431
        iprot.readFieldEnd();
1982 varun.gupt 2432
      }
2433
      iprot.readStructEnd();
2434
      validate();
2435
    }
2436
 
3430 rajveer 2437
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2438
      validate();
2439
 
2440
      oprot.writeStructBegin(STRUCT_DESC);
2441
      if (this.name != null) {
2442
        oprot.writeFieldBegin(NAME_FIELD_DESC);
2443
        oprot.writeString(this.name);
2444
        oprot.writeFieldEnd();
2445
      }
2446
      if (this.ruleExecutionSrc != null) {
2447
        oprot.writeFieldBegin(RULE_EXECUTION_SRC_FIELD_DESC);
2448
        oprot.writeString(this.ruleExecutionSrc);
2449
        oprot.writeFieldEnd();
2450
      }
2451
      oprot.writeFieldBegin(START_ON_FIELD_DESC);
2452
      oprot.writeI64(this.startOn);
2453
      oprot.writeFieldEnd();
2454
      oprot.writeFieldBegin(END_ON_FIELD_DESC);
2455
      oprot.writeI64(this.endOn);
2456
      oprot.writeFieldEnd();
2457
      oprot.writeFieldStop();
2458
      oprot.writeStructEnd();
2459
    }
2460
 
2461
    @Override
2462
    public String toString() {
2463
      StringBuilder sb = new StringBuilder("createPromotion_args(");
2464
      boolean first = true;
2465
 
2466
      sb.append("name:");
2467
      if (this.name == null) {
2468
        sb.append("null");
2469
      } else {
2470
        sb.append(this.name);
2471
      }
2472
      first = false;
2473
      if (!first) sb.append(", ");
2474
      sb.append("ruleExecutionSrc:");
2475
      if (this.ruleExecutionSrc == null) {
2476
        sb.append("null");
2477
      } else {
2478
        sb.append(this.ruleExecutionSrc);
2479
      }
2480
      first = false;
2481
      if (!first) sb.append(", ");
2482
      sb.append("startOn:");
2483
      sb.append(this.startOn);
2484
      first = false;
2485
      if (!first) sb.append(", ");
2486
      sb.append("endOn:");
2487
      sb.append(this.endOn);
2488
      first = false;
2489
      sb.append(")");
2490
      return sb.toString();
2491
    }
2492
 
3430 rajveer 2493
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2494
      // check for required fields
2495
    }
2496
 
3430 rajveer 2497
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2498
      try {
2499
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2500
      } catch (org.apache.thrift.TException te) {
2501
        throw new java.io.IOException(te);
2502
      }
2503
    }
2504
 
2505
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2506
      try {
2507
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
2508
        __isset_bit_vector = new BitSet(1);
2509
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2510
      } catch (org.apache.thrift.TException te) {
2511
        throw new java.io.IOException(te);
2512
      }
2513
    }
2514
 
1982 varun.gupt 2515
  }
2516
 
3430 rajveer 2517
  public static class createPromotion_result implements org.apache.thrift.TBase<createPromotion_result, createPromotion_result._Fields>, java.io.Serializable, Cloneable   {
2518
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_result");
1982 varun.gupt 2519
 
3430 rajveer 2520
    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 2521
 
3430 rajveer 2522
    private PromotionException pex; // required
1982 varun.gupt 2523
 
2524
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2525
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2526
      PEX((short)1, "pex");
2527
 
2528
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2529
 
2530
      static {
2531
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2532
          byName.put(field.getFieldName(), field);
2533
        }
2534
      }
2535
 
2536
      /**
2537
       * Find the _Fields constant that matches fieldId, or null if its not found.
2538
       */
2539
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2540
        switch(fieldId) {
2541
          case 1: // PEX
2542
            return PEX;
2543
          default:
2544
            return null;
2545
        }
1982 varun.gupt 2546
      }
2547
 
2548
      /**
2549
       * Find the _Fields constant that matches fieldId, throwing an exception
2550
       * if it is not found.
2551
       */
2552
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2553
        _Fields fields = findByThriftId(fieldId);
2554
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2555
        return fields;
2556
      }
2557
 
2558
      /**
2559
       * Find the _Fields constant that matches name, or null if its not found.
2560
       */
2561
      public static _Fields findByName(String name) {
2562
        return byName.get(name);
2563
      }
2564
 
2565
      private final short _thriftId;
2566
      private final String _fieldName;
2567
 
2568
      _Fields(short thriftId, String fieldName) {
2569
        _thriftId = thriftId;
2570
        _fieldName = fieldName;
2571
      }
2572
 
2573
      public short getThriftFieldId() {
2574
        return _thriftId;
2575
      }
2576
 
2577
      public String getFieldName() {
2578
        return _fieldName;
2579
      }
2580
    }
2581
 
2582
    // isset id assignments
2583
 
3430 rajveer 2584
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2585
    static {
3430 rajveer 2586
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2587
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2588
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
2589
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2590
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_result.class, metaDataMap);
1982 varun.gupt 2591
    }
2592
 
2593
    public createPromotion_result() {
2594
    }
2595
 
2596
    public createPromotion_result(
2597
      PromotionException pex)
2598
    {
2599
      this();
2600
      this.pex = pex;
2601
    }
2602
 
2603
    /**
2604
     * Performs a deep copy on <i>other</i>.
2605
     */
2606
    public createPromotion_result(createPromotion_result other) {
2607
      if (other.isSetPex()) {
2608
        this.pex = new PromotionException(other.pex);
2609
      }
2610
    }
2611
 
2612
    public createPromotion_result deepCopy() {
2613
      return new createPromotion_result(this);
2614
    }
2615
 
3430 rajveer 2616
    @Override
2617
    public void clear() {
2618
      this.pex = null;
1982 varun.gupt 2619
    }
2620
 
2621
    public PromotionException getPex() {
2622
      return this.pex;
2623
    }
2624
 
3430 rajveer 2625
    public void setPex(PromotionException pex) {
1982 varun.gupt 2626
      this.pex = pex;
2627
    }
2628
 
2629
    public void unsetPex() {
2630
      this.pex = null;
2631
    }
2632
 
3430 rajveer 2633
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2634
    public boolean isSetPex() {
2635
      return this.pex != null;
2636
    }
2637
 
2638
    public void setPexIsSet(boolean value) {
2639
      if (!value) {
2640
        this.pex = null;
2641
      }
2642
    }
2643
 
2644
    public void setFieldValue(_Fields field, Object value) {
2645
      switch (field) {
2646
      case PEX:
2647
        if (value == null) {
2648
          unsetPex();
2649
        } else {
2650
          setPex((PromotionException)value);
2651
        }
2652
        break;
2653
 
2654
      }
2655
    }
2656
 
2657
    public Object getFieldValue(_Fields field) {
2658
      switch (field) {
2659
      case PEX:
2660
        return getPex();
2661
 
2662
      }
2663
      throw new IllegalStateException();
2664
    }
2665
 
3430 rajveer 2666
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2667
    public boolean isSet(_Fields field) {
2668
      if (field == null) {
2669
        throw new IllegalArgumentException();
2670
      }
1982 varun.gupt 2671
 
2672
      switch (field) {
2673
      case PEX:
2674
        return isSetPex();
2675
      }
2676
      throw new IllegalStateException();
2677
    }
2678
 
2679
    @Override
2680
    public boolean equals(Object that) {
2681
      if (that == null)
2682
        return false;
2683
      if (that instanceof createPromotion_result)
2684
        return this.equals((createPromotion_result)that);
2685
      return false;
2686
    }
2687
 
2688
    public boolean equals(createPromotion_result that) {
2689
      if (that == null)
2690
        return false;
2691
 
2692
      boolean this_present_pex = true && this.isSetPex();
2693
      boolean that_present_pex = true && that.isSetPex();
2694
      if (this_present_pex || that_present_pex) {
2695
        if (!(this_present_pex && that_present_pex))
2696
          return false;
2697
        if (!this.pex.equals(that.pex))
2698
          return false;
2699
      }
2700
 
2701
      return true;
2702
    }
2703
 
2704
    @Override
2705
    public int hashCode() {
2706
      return 0;
2707
    }
2708
 
2709
    public int compareTo(createPromotion_result other) {
2710
      if (!getClass().equals(other.getClass())) {
2711
        return getClass().getName().compareTo(other.getClass().getName());
2712
      }
2713
 
2714
      int lastComparison = 0;
2715
      createPromotion_result typedOther = (createPromotion_result)other;
2716
 
3430 rajveer 2717
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 2718
      if (lastComparison != 0) {
2719
        return lastComparison;
2720
      }
3430 rajveer 2721
      if (isSetPex()) {
2722
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
2723
        if (lastComparison != 0) {
2724
          return lastComparison;
2725
        }
1982 varun.gupt 2726
      }
2727
      return 0;
2728
    }
2729
 
3430 rajveer 2730
    public _Fields fieldForId(int fieldId) {
2731
      return _Fields.findByThriftId(fieldId);
2732
    }
2733
 
2734
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2735
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2736
      iprot.readStructBegin();
2737
      while (true)
2738
      {
2739
        field = iprot.readFieldBegin();
3430 rajveer 2740
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2741
          break;
2742
        }
3430 rajveer 2743
        switch (field.id) {
2744
          case 1: // PEX
2745
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
2746
              this.pex = new PromotionException();
2747
              this.pex.read(iprot);
2748
            } else { 
2749
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2750
            }
2751
            break;
2752
          default:
2753
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2754
        }
3430 rajveer 2755
        iprot.readFieldEnd();
1982 varun.gupt 2756
      }
2757
      iprot.readStructEnd();
2758
      validate();
2759
    }
2760
 
3430 rajveer 2761
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2762
      oprot.writeStructBegin(STRUCT_DESC);
2763
 
2764
      if (this.isSetPex()) {
2765
        oprot.writeFieldBegin(PEX_FIELD_DESC);
2766
        this.pex.write(oprot);
2767
        oprot.writeFieldEnd();
2768
      }
2769
      oprot.writeFieldStop();
2770
      oprot.writeStructEnd();
2771
    }
2772
 
2773
    @Override
2774
    public String toString() {
2775
      StringBuilder sb = new StringBuilder("createPromotion_result(");
2776
      boolean first = true;
2777
 
2778
      sb.append("pex:");
2779
      if (this.pex == null) {
2780
        sb.append("null");
2781
      } else {
2782
        sb.append(this.pex);
2783
      }
2784
      first = false;
2785
      sb.append(")");
2786
      return sb.toString();
2787
    }
2788
 
3430 rajveer 2789
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2790
      // check for required fields
2791
    }
2792
 
3430 rajveer 2793
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2794
      try {
2795
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2796
      } catch (org.apache.thrift.TException te) {
2797
        throw new java.io.IOException(te);
2798
      }
2799
    }
2800
 
2801
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2802
      try {
2803
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2804
      } catch (org.apache.thrift.TException te) {
2805
        throw new java.io.IOException(te);
2806
      }
2807
    }
2808
 
1982 varun.gupt 2809
  }
2810
 
6301 amit.gupta 2811
  public static class getCoupon_args implements org.apache.thrift.TBase<getCoupon_args, getCoupon_args._Fields>, java.io.Serializable, Cloneable   {
2812
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCoupon_args");
2813
 
2814
    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);
2815
 
2816
    private String couponCode; // required
2817
 
2818
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2819
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
2820
      COUPON_CODE((short)1, "couponCode");
2821
 
2822
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2823
 
2824
      static {
2825
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2826
          byName.put(field.getFieldName(), field);
2827
        }
2828
      }
2829
 
2830
      /**
2831
       * Find the _Fields constant that matches fieldId, or null if its not found.
2832
       */
2833
      public static _Fields findByThriftId(int fieldId) {
2834
        switch(fieldId) {
2835
          case 1: // COUPON_CODE
2836
            return COUPON_CODE;
2837
          default:
2838
            return null;
2839
        }
2840
      }
2841
 
2842
      /**
2843
       * Find the _Fields constant that matches fieldId, throwing an exception
2844
       * if it is not found.
2845
       */
2846
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2847
        _Fields fields = findByThriftId(fieldId);
2848
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2849
        return fields;
2850
      }
2851
 
2852
      /**
2853
       * Find the _Fields constant that matches name, or null if its not found.
2854
       */
2855
      public static _Fields findByName(String name) {
2856
        return byName.get(name);
2857
      }
2858
 
2859
      private final short _thriftId;
2860
      private final String _fieldName;
2861
 
2862
      _Fields(short thriftId, String fieldName) {
2863
        _thriftId = thriftId;
2864
        _fieldName = fieldName;
2865
      }
2866
 
2867
      public short getThriftFieldId() {
2868
        return _thriftId;
2869
      }
2870
 
2871
      public String getFieldName() {
2872
        return _fieldName;
2873
      }
2874
    }
2875
 
2876
    // isset id assignments
2877
 
2878
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
2879
    static {
2880
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2881
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2882
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
2883
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2884
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCoupon_args.class, metaDataMap);
2885
    }
2886
 
2887
    public getCoupon_args() {
2888
    }
2889
 
2890
    public getCoupon_args(
2891
      String couponCode)
2892
    {
2893
      this();
2894
      this.couponCode = couponCode;
2895
    }
2896
 
2897
    /**
2898
     * Performs a deep copy on <i>other</i>.
2899
     */
2900
    public getCoupon_args(getCoupon_args other) {
2901
      if (other.isSetCouponCode()) {
2902
        this.couponCode = other.couponCode;
2903
      }
2904
    }
2905
 
2906
    public getCoupon_args deepCopy() {
2907
      return new getCoupon_args(this);
2908
    }
2909
 
2910
    @Override
2911
    public void clear() {
2912
      this.couponCode = null;
2913
    }
2914
 
2915
    public String getCouponCode() {
2916
      return this.couponCode;
2917
    }
2918
 
2919
    public void setCouponCode(String couponCode) {
2920
      this.couponCode = couponCode;
2921
    }
2922
 
2923
    public void unsetCouponCode() {
2924
      this.couponCode = null;
2925
    }
2926
 
2927
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
2928
    public boolean isSetCouponCode() {
2929
      return this.couponCode != null;
2930
    }
2931
 
2932
    public void setCouponCodeIsSet(boolean value) {
2933
      if (!value) {
2934
        this.couponCode = null;
2935
      }
2936
    }
2937
 
2938
    public void setFieldValue(_Fields field, Object value) {
2939
      switch (field) {
2940
      case COUPON_CODE:
2941
        if (value == null) {
2942
          unsetCouponCode();
2943
        } else {
2944
          setCouponCode((String)value);
2945
        }
2946
        break;
2947
 
2948
      }
2949
    }
2950
 
2951
    public Object getFieldValue(_Fields field) {
2952
      switch (field) {
2953
      case COUPON_CODE:
2954
        return getCouponCode();
2955
 
2956
      }
2957
      throw new IllegalStateException();
2958
    }
2959
 
2960
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2961
    public boolean isSet(_Fields field) {
2962
      if (field == null) {
2963
        throw new IllegalArgumentException();
2964
      }
2965
 
2966
      switch (field) {
2967
      case COUPON_CODE:
2968
        return isSetCouponCode();
2969
      }
2970
      throw new IllegalStateException();
2971
    }
2972
 
2973
    @Override
2974
    public boolean equals(Object that) {
2975
      if (that == null)
2976
        return false;
2977
      if (that instanceof getCoupon_args)
2978
        return this.equals((getCoupon_args)that);
2979
      return false;
2980
    }
2981
 
2982
    public boolean equals(getCoupon_args that) {
2983
      if (that == null)
2984
        return false;
2985
 
2986
      boolean this_present_couponCode = true && this.isSetCouponCode();
2987
      boolean that_present_couponCode = true && that.isSetCouponCode();
2988
      if (this_present_couponCode || that_present_couponCode) {
2989
        if (!(this_present_couponCode && that_present_couponCode))
2990
          return false;
2991
        if (!this.couponCode.equals(that.couponCode))
2992
          return false;
2993
      }
2994
 
2995
      return true;
2996
    }
2997
 
2998
    @Override
2999
    public int hashCode() {
3000
      return 0;
3001
    }
3002
 
3003
    public int compareTo(getCoupon_args other) {
3004
      if (!getClass().equals(other.getClass())) {
3005
        return getClass().getName().compareTo(other.getClass().getName());
3006
      }
3007
 
3008
      int lastComparison = 0;
3009
      getCoupon_args typedOther = (getCoupon_args)other;
3010
 
3011
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3012
      if (lastComparison != 0) {
3013
        return lastComparison;
3014
      }
3015
      if (isSetCouponCode()) {
3016
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
3017
        if (lastComparison != 0) {
3018
          return lastComparison;
3019
        }
3020
      }
3021
      return 0;
3022
    }
3023
 
3024
    public _Fields fieldForId(int fieldId) {
3025
      return _Fields.findByThriftId(fieldId);
3026
    }
3027
 
3028
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3029
      org.apache.thrift.protocol.TField field;
3030
      iprot.readStructBegin();
3031
      while (true)
3032
      {
3033
        field = iprot.readFieldBegin();
3034
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3035
          break;
3036
        }
3037
        switch (field.id) {
3038
          case 1: // COUPON_CODE
3039
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
3040
              this.couponCode = iprot.readString();
3041
            } else { 
3042
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3043
            }
3044
            break;
3045
          default:
3046
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3047
        }
3048
        iprot.readFieldEnd();
3049
      }
3050
      iprot.readStructEnd();
3051
      validate();
3052
    }
3053
 
3054
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3055
      validate();
3056
 
3057
      oprot.writeStructBegin(STRUCT_DESC);
3058
      if (this.couponCode != null) {
3059
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
3060
        oprot.writeString(this.couponCode);
3061
        oprot.writeFieldEnd();
3062
      }
3063
      oprot.writeFieldStop();
3064
      oprot.writeStructEnd();
3065
    }
3066
 
3067
    @Override
3068
    public String toString() {
3069
      StringBuilder sb = new StringBuilder("getCoupon_args(");
3070
      boolean first = true;
3071
 
3072
      sb.append("couponCode:");
3073
      if (this.couponCode == null) {
3074
        sb.append("null");
3075
      } else {
3076
        sb.append(this.couponCode);
3077
      }
3078
      first = false;
3079
      sb.append(")");
3080
      return sb.toString();
3081
    }
3082
 
3083
    public void validate() throws org.apache.thrift.TException {
3084
      // check for required fields
3085
    }
3086
 
3087
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3088
      try {
3089
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3090
      } catch (org.apache.thrift.TException te) {
3091
        throw new java.io.IOException(te);
3092
      }
3093
    }
3094
 
3095
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3096
      try {
3097
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3098
      } catch (org.apache.thrift.TException te) {
3099
        throw new java.io.IOException(te);
3100
      }
3101
    }
3102
 
3103
  }
3104
 
3105
  public static class getCoupon_result implements org.apache.thrift.TBase<getCoupon_result, getCoupon_result._Fields>, java.io.Serializable, Cloneable   {
3106
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCoupon_result");
3107
 
3108
    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);
3109
    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);
3110
 
3111
    private Coupon success; // required
3112
    private PromotionException pex; // required
3113
 
3114
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3115
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3116
      SUCCESS((short)0, "success"),
3117
      PEX((short)1, "pex");
3118
 
3119
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3120
 
3121
      static {
3122
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3123
          byName.put(field.getFieldName(), field);
3124
        }
3125
      }
3126
 
3127
      /**
3128
       * Find the _Fields constant that matches fieldId, or null if its not found.
3129
       */
3130
      public static _Fields findByThriftId(int fieldId) {
3131
        switch(fieldId) {
3132
          case 0: // SUCCESS
3133
            return SUCCESS;
3134
          case 1: // PEX
3135
            return PEX;
3136
          default:
3137
            return null;
3138
        }
3139
      }
3140
 
3141
      /**
3142
       * Find the _Fields constant that matches fieldId, throwing an exception
3143
       * if it is not found.
3144
       */
3145
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3146
        _Fields fields = findByThriftId(fieldId);
3147
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3148
        return fields;
3149
      }
3150
 
3151
      /**
3152
       * Find the _Fields constant that matches name, or null if its not found.
3153
       */
3154
      public static _Fields findByName(String name) {
3155
        return byName.get(name);
3156
      }
3157
 
3158
      private final short _thriftId;
3159
      private final String _fieldName;
3160
 
3161
      _Fields(short thriftId, String fieldName) {
3162
        _thriftId = thriftId;
3163
        _fieldName = fieldName;
3164
      }
3165
 
3166
      public short getThriftFieldId() {
3167
        return _thriftId;
3168
      }
3169
 
3170
      public String getFieldName() {
3171
        return _fieldName;
3172
      }
3173
    }
3174
 
3175
    // isset id assignments
3176
 
3177
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3178
    static {
3179
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3180
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3181
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class)));
3182
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3183
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
3184
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3185
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCoupon_result.class, metaDataMap);
3186
    }
3187
 
3188
    public getCoupon_result() {
3189
    }
3190
 
3191
    public getCoupon_result(
3192
      Coupon success,
3193
      PromotionException pex)
3194
    {
3195
      this();
3196
      this.success = success;
3197
      this.pex = pex;
3198
    }
3199
 
3200
    /**
3201
     * Performs a deep copy on <i>other</i>.
3202
     */
3203
    public getCoupon_result(getCoupon_result other) {
3204
      if (other.isSetSuccess()) {
3205
        this.success = new Coupon(other.success);
3206
      }
3207
      if (other.isSetPex()) {
3208
        this.pex = new PromotionException(other.pex);
3209
      }
3210
    }
3211
 
3212
    public getCoupon_result deepCopy() {
3213
      return new getCoupon_result(this);
3214
    }
3215
 
3216
    @Override
3217
    public void clear() {
3218
      this.success = null;
3219
      this.pex = null;
3220
    }
3221
 
3222
    public Coupon getSuccess() {
3223
      return this.success;
3224
    }
3225
 
3226
    public void setSuccess(Coupon success) {
3227
      this.success = success;
3228
    }
3229
 
3230
    public void unsetSuccess() {
3231
      this.success = null;
3232
    }
3233
 
3234
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3235
    public boolean isSetSuccess() {
3236
      return this.success != null;
3237
    }
3238
 
3239
    public void setSuccessIsSet(boolean value) {
3240
      if (!value) {
3241
        this.success = null;
3242
      }
3243
    }
3244
 
3245
    public PromotionException getPex() {
3246
      return this.pex;
3247
    }
3248
 
3249
    public void setPex(PromotionException pex) {
3250
      this.pex = pex;
3251
    }
3252
 
3253
    public void unsetPex() {
3254
      this.pex = null;
3255
    }
3256
 
3257
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3258
    public boolean isSetPex() {
3259
      return this.pex != null;
3260
    }
3261
 
3262
    public void setPexIsSet(boolean value) {
3263
      if (!value) {
3264
        this.pex = null;
3265
      }
3266
    }
3267
 
3268
    public void setFieldValue(_Fields field, Object value) {
3269
      switch (field) {
3270
      case SUCCESS:
3271
        if (value == null) {
3272
          unsetSuccess();
3273
        } else {
3274
          setSuccess((Coupon)value);
3275
        }
3276
        break;
3277
 
3278
      case PEX:
3279
        if (value == null) {
3280
          unsetPex();
3281
        } else {
3282
          setPex((PromotionException)value);
3283
        }
3284
        break;
3285
 
3286
      }
3287
    }
3288
 
3289
    public Object getFieldValue(_Fields field) {
3290
      switch (field) {
3291
      case SUCCESS:
3292
        return getSuccess();
3293
 
3294
      case PEX:
3295
        return getPex();
3296
 
3297
      }
3298
      throw new IllegalStateException();
3299
    }
3300
 
3301
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3302
    public boolean isSet(_Fields field) {
3303
      if (field == null) {
3304
        throw new IllegalArgumentException();
3305
      }
3306
 
3307
      switch (field) {
3308
      case SUCCESS:
3309
        return isSetSuccess();
3310
      case PEX:
3311
        return isSetPex();
3312
      }
3313
      throw new IllegalStateException();
3314
    }
3315
 
3316
    @Override
3317
    public boolean equals(Object that) {
3318
      if (that == null)
3319
        return false;
3320
      if (that instanceof getCoupon_result)
3321
        return this.equals((getCoupon_result)that);
3322
      return false;
3323
    }
3324
 
3325
    public boolean equals(getCoupon_result that) {
3326
      if (that == null)
3327
        return false;
3328
 
3329
      boolean this_present_success = true && this.isSetSuccess();
3330
      boolean that_present_success = true && that.isSetSuccess();
3331
      if (this_present_success || that_present_success) {
3332
        if (!(this_present_success && that_present_success))
3333
          return false;
3334
        if (!this.success.equals(that.success))
3335
          return false;
3336
      }
3337
 
3338
      boolean this_present_pex = true && this.isSetPex();
3339
      boolean that_present_pex = true && that.isSetPex();
3340
      if (this_present_pex || that_present_pex) {
3341
        if (!(this_present_pex && that_present_pex))
3342
          return false;
3343
        if (!this.pex.equals(that.pex))
3344
          return false;
3345
      }
3346
 
3347
      return true;
3348
    }
3349
 
3350
    @Override
3351
    public int hashCode() {
3352
      return 0;
3353
    }
3354
 
3355
    public int compareTo(getCoupon_result other) {
3356
      if (!getClass().equals(other.getClass())) {
3357
        return getClass().getName().compareTo(other.getClass().getName());
3358
      }
3359
 
3360
      int lastComparison = 0;
3361
      getCoupon_result typedOther = (getCoupon_result)other;
3362
 
3363
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3364
      if (lastComparison != 0) {
3365
        return lastComparison;
3366
      }
3367
      if (isSetSuccess()) {
3368
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
3369
        if (lastComparison != 0) {
3370
          return lastComparison;
3371
        }
3372
      }
3373
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3374
      if (lastComparison != 0) {
3375
        return lastComparison;
3376
      }
3377
      if (isSetPex()) {
3378
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
3379
        if (lastComparison != 0) {
3380
          return lastComparison;
3381
        }
3382
      }
3383
      return 0;
3384
    }
3385
 
3386
    public _Fields fieldForId(int fieldId) {
3387
      return _Fields.findByThriftId(fieldId);
3388
    }
3389
 
3390
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3391
      org.apache.thrift.protocol.TField field;
3392
      iprot.readStructBegin();
3393
      while (true)
3394
      {
3395
        field = iprot.readFieldBegin();
3396
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3397
          break;
3398
        }
3399
        switch (field.id) {
3400
          case 0: // SUCCESS
3401
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3402
              this.success = new Coupon();
3403
              this.success.read(iprot);
3404
            } else { 
3405
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3406
            }
3407
            break;
3408
          case 1: // PEX
3409
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3410
              this.pex = new PromotionException();
3411
              this.pex.read(iprot);
3412
            } else { 
3413
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3414
            }
3415
            break;
3416
          default:
3417
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3418
        }
3419
        iprot.readFieldEnd();
3420
      }
3421
      iprot.readStructEnd();
3422
      validate();
3423
    }
3424
 
3425
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3426
      oprot.writeStructBegin(STRUCT_DESC);
3427
 
3428
      if (this.isSetSuccess()) {
3429
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
3430
        this.success.write(oprot);
3431
        oprot.writeFieldEnd();
3432
      } else if (this.isSetPex()) {
3433
        oprot.writeFieldBegin(PEX_FIELD_DESC);
3434
        this.pex.write(oprot);
3435
        oprot.writeFieldEnd();
3436
      }
3437
      oprot.writeFieldStop();
3438
      oprot.writeStructEnd();
3439
    }
3440
 
3441
    @Override
3442
    public String toString() {
3443
      StringBuilder sb = new StringBuilder("getCoupon_result(");
3444
      boolean first = true;
3445
 
3446
      sb.append("success:");
3447
      if (this.success == null) {
3448
        sb.append("null");
3449
      } else {
3450
        sb.append(this.success);
3451
      }
3452
      first = false;
3453
      if (!first) sb.append(", ");
3454
      sb.append("pex:");
3455
      if (this.pex == null) {
3456
        sb.append("null");
3457
      } else {
3458
        sb.append(this.pex);
3459
      }
3460
      first = false;
3461
      sb.append(")");
3462
      return sb.toString();
3463
    }
3464
 
3465
    public void validate() throws org.apache.thrift.TException {
3466
      // check for required fields
3467
    }
3468
 
3469
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3470
      try {
3471
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3472
      } catch (org.apache.thrift.TException te) {
3473
        throw new java.io.IOException(te);
3474
      }
3475
    }
3476
 
3477
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3478
      try {
3479
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3480
      } catch (org.apache.thrift.TException te) {
3481
        throw new java.io.IOException(te);
3482
      }
3483
    }
3484
 
3485
  }
3486
 
3487
  public static class isGiftVoucher_args implements org.apache.thrift.TBase<isGiftVoucher_args, isGiftVoucher_args._Fields>, java.io.Serializable, Cloneable   {
3488
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isGiftVoucher_args");
3489
 
3490
    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);
3491
 
3492
    private String couponCode; // required
3493
 
3494
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3495
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3496
      COUPON_CODE((short)1, "couponCode");
3497
 
3498
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3499
 
3500
      static {
3501
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3502
          byName.put(field.getFieldName(), field);
3503
        }
3504
      }
3505
 
3506
      /**
3507
       * Find the _Fields constant that matches fieldId, or null if its not found.
3508
       */
3509
      public static _Fields findByThriftId(int fieldId) {
3510
        switch(fieldId) {
3511
          case 1: // COUPON_CODE
3512
            return COUPON_CODE;
3513
          default:
3514
            return null;
3515
        }
3516
      }
3517
 
3518
      /**
3519
       * Find the _Fields constant that matches fieldId, throwing an exception
3520
       * if it is not found.
3521
       */
3522
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3523
        _Fields fields = findByThriftId(fieldId);
3524
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3525
        return fields;
3526
      }
3527
 
3528
      /**
3529
       * Find the _Fields constant that matches name, or null if its not found.
3530
       */
3531
      public static _Fields findByName(String name) {
3532
        return byName.get(name);
3533
      }
3534
 
3535
      private final short _thriftId;
3536
      private final String _fieldName;
3537
 
3538
      _Fields(short thriftId, String fieldName) {
3539
        _thriftId = thriftId;
3540
        _fieldName = fieldName;
3541
      }
3542
 
3543
      public short getThriftFieldId() {
3544
        return _thriftId;
3545
      }
3546
 
3547
      public String getFieldName() {
3548
        return _fieldName;
3549
      }
3550
    }
3551
 
3552
    // isset id assignments
3553
 
3554
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3555
    static {
3556
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3557
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3558
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
3559
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3560
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isGiftVoucher_args.class, metaDataMap);
3561
    }
3562
 
3563
    public isGiftVoucher_args() {
3564
    }
3565
 
3566
    public isGiftVoucher_args(
3567
      String couponCode)
3568
    {
3569
      this();
3570
      this.couponCode = couponCode;
3571
    }
3572
 
3573
    /**
3574
     * Performs a deep copy on <i>other</i>.
3575
     */
3576
    public isGiftVoucher_args(isGiftVoucher_args other) {
3577
      if (other.isSetCouponCode()) {
3578
        this.couponCode = other.couponCode;
3579
      }
3580
    }
3581
 
3582
    public isGiftVoucher_args deepCopy() {
3583
      return new isGiftVoucher_args(this);
3584
    }
3585
 
3586
    @Override
3587
    public void clear() {
3588
      this.couponCode = null;
3589
    }
3590
 
3591
    public String getCouponCode() {
3592
      return this.couponCode;
3593
    }
3594
 
3595
    public void setCouponCode(String couponCode) {
3596
      this.couponCode = couponCode;
3597
    }
3598
 
3599
    public void unsetCouponCode() {
3600
      this.couponCode = null;
3601
    }
3602
 
3603
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3604
    public boolean isSetCouponCode() {
3605
      return this.couponCode != null;
3606
    }
3607
 
3608
    public void setCouponCodeIsSet(boolean value) {
3609
      if (!value) {
3610
        this.couponCode = null;
3611
      }
3612
    }
3613
 
3614
    public void setFieldValue(_Fields field, Object value) {
3615
      switch (field) {
3616
      case COUPON_CODE:
3617
        if (value == null) {
3618
          unsetCouponCode();
3619
        } else {
3620
          setCouponCode((String)value);
3621
        }
3622
        break;
3623
 
3624
      }
3625
    }
3626
 
3627
    public Object getFieldValue(_Fields field) {
3628
      switch (field) {
3629
      case COUPON_CODE:
3630
        return getCouponCode();
3631
 
3632
      }
3633
      throw new IllegalStateException();
3634
    }
3635
 
3636
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3637
    public boolean isSet(_Fields field) {
3638
      if (field == null) {
3639
        throw new IllegalArgumentException();
3640
      }
3641
 
3642
      switch (field) {
3643
      case COUPON_CODE:
3644
        return isSetCouponCode();
3645
      }
3646
      throw new IllegalStateException();
3647
    }
3648
 
3649
    @Override
3650
    public boolean equals(Object that) {
3651
      if (that == null)
3652
        return false;
3653
      if (that instanceof isGiftVoucher_args)
3654
        return this.equals((isGiftVoucher_args)that);
3655
      return false;
3656
    }
3657
 
3658
    public boolean equals(isGiftVoucher_args that) {
3659
      if (that == null)
3660
        return false;
3661
 
3662
      boolean this_present_couponCode = true && this.isSetCouponCode();
3663
      boolean that_present_couponCode = true && that.isSetCouponCode();
3664
      if (this_present_couponCode || that_present_couponCode) {
3665
        if (!(this_present_couponCode && that_present_couponCode))
3666
          return false;
3667
        if (!this.couponCode.equals(that.couponCode))
3668
          return false;
3669
      }
3670
 
3671
      return true;
3672
    }
3673
 
3674
    @Override
3675
    public int hashCode() {
3676
      return 0;
3677
    }
3678
 
3679
    public int compareTo(isGiftVoucher_args other) {
3680
      if (!getClass().equals(other.getClass())) {
3681
        return getClass().getName().compareTo(other.getClass().getName());
3682
      }
3683
 
3684
      int lastComparison = 0;
3685
      isGiftVoucher_args typedOther = (isGiftVoucher_args)other;
3686
 
3687
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3688
      if (lastComparison != 0) {
3689
        return lastComparison;
3690
      }
3691
      if (isSetCouponCode()) {
3692
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
3693
        if (lastComparison != 0) {
3694
          return lastComparison;
3695
        }
3696
      }
3697
      return 0;
3698
    }
3699
 
3700
    public _Fields fieldForId(int fieldId) {
3701
      return _Fields.findByThriftId(fieldId);
3702
    }
3703
 
3704
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3705
      org.apache.thrift.protocol.TField field;
3706
      iprot.readStructBegin();
3707
      while (true)
3708
      {
3709
        field = iprot.readFieldBegin();
3710
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3711
          break;
3712
        }
3713
        switch (field.id) {
3714
          case 1: // COUPON_CODE
3715
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
3716
              this.couponCode = iprot.readString();
3717
            } else { 
3718
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3719
            }
3720
            break;
3721
          default:
3722
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3723
        }
3724
        iprot.readFieldEnd();
3725
      }
3726
      iprot.readStructEnd();
3727
      validate();
3728
    }
3729
 
3730
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3731
      validate();
3732
 
3733
      oprot.writeStructBegin(STRUCT_DESC);
3734
      if (this.couponCode != null) {
3735
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
3736
        oprot.writeString(this.couponCode);
3737
        oprot.writeFieldEnd();
3738
      }
3739
      oprot.writeFieldStop();
3740
      oprot.writeStructEnd();
3741
    }
3742
 
3743
    @Override
3744
    public String toString() {
3745
      StringBuilder sb = new StringBuilder("isGiftVoucher_args(");
3746
      boolean first = true;
3747
 
3748
      sb.append("couponCode:");
3749
      if (this.couponCode == null) {
3750
        sb.append("null");
3751
      } else {
3752
        sb.append(this.couponCode);
3753
      }
3754
      first = false;
3755
      sb.append(")");
3756
      return sb.toString();
3757
    }
3758
 
3759
    public void validate() throws org.apache.thrift.TException {
3760
      // check for required fields
3761
    }
3762
 
3763
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3764
      try {
3765
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3766
      } catch (org.apache.thrift.TException te) {
3767
        throw new java.io.IOException(te);
3768
      }
3769
    }
3770
 
3771
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3772
      try {
3773
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3774
      } catch (org.apache.thrift.TException te) {
3775
        throw new java.io.IOException(te);
3776
      }
3777
    }
3778
 
3779
  }
3780
 
3781
  public static class isGiftVoucher_result implements org.apache.thrift.TBase<isGiftVoucher_result, isGiftVoucher_result._Fields>, java.io.Serializable, Cloneable   {
3782
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isGiftVoucher_result");
3783
 
3784
    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);
3785
    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);
3786
 
3787
    private boolean success; // required
3788
    private PromotionException pex; // required
3789
 
3790
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3791
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3792
      SUCCESS((short)0, "success"),
3793
      PEX((short)1, "pex");
3794
 
3795
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3796
 
3797
      static {
3798
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3799
          byName.put(field.getFieldName(), field);
3800
        }
3801
      }
3802
 
3803
      /**
3804
       * Find the _Fields constant that matches fieldId, or null if its not found.
3805
       */
3806
      public static _Fields findByThriftId(int fieldId) {
3807
        switch(fieldId) {
3808
          case 0: // SUCCESS
3809
            return SUCCESS;
3810
          case 1: // PEX
3811
            return PEX;
3812
          default:
3813
            return null;
3814
        }
3815
      }
3816
 
3817
      /**
3818
       * Find the _Fields constant that matches fieldId, throwing an exception
3819
       * if it is not found.
3820
       */
3821
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3822
        _Fields fields = findByThriftId(fieldId);
3823
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3824
        return fields;
3825
      }
3826
 
3827
      /**
3828
       * Find the _Fields constant that matches name, or null if its not found.
3829
       */
3830
      public static _Fields findByName(String name) {
3831
        return byName.get(name);
3832
      }
3833
 
3834
      private final short _thriftId;
3835
      private final String _fieldName;
3836
 
3837
      _Fields(short thriftId, String fieldName) {
3838
        _thriftId = thriftId;
3839
        _fieldName = fieldName;
3840
      }
3841
 
3842
      public short getThriftFieldId() {
3843
        return _thriftId;
3844
      }
3845
 
3846
      public String getFieldName() {
3847
        return _fieldName;
3848
      }
3849
    }
3850
 
3851
    // isset id assignments
3852
    private static final int __SUCCESS_ISSET_ID = 0;
3853
    private BitSet __isset_bit_vector = new BitSet(1);
3854
 
3855
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3856
    static {
3857
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3858
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3859
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
3860
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3861
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
3862
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3863
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isGiftVoucher_result.class, metaDataMap);
3864
    }
3865
 
3866
    public isGiftVoucher_result() {
3867
    }
3868
 
3869
    public isGiftVoucher_result(
3870
      boolean success,
3871
      PromotionException pex)
3872
    {
3873
      this();
3874
      this.success = success;
3875
      setSuccessIsSet(true);
3876
      this.pex = pex;
3877
    }
3878
 
3879
    /**
3880
     * Performs a deep copy on <i>other</i>.
3881
     */
3882
    public isGiftVoucher_result(isGiftVoucher_result other) {
3883
      __isset_bit_vector.clear();
3884
      __isset_bit_vector.or(other.__isset_bit_vector);
3885
      this.success = other.success;
3886
      if (other.isSetPex()) {
3887
        this.pex = new PromotionException(other.pex);
3888
      }
3889
    }
3890
 
3891
    public isGiftVoucher_result deepCopy() {
3892
      return new isGiftVoucher_result(this);
3893
    }
3894
 
3895
    @Override
3896
    public void clear() {
3897
      setSuccessIsSet(false);
3898
      this.success = false;
3899
      this.pex = null;
3900
    }
3901
 
3902
    public boolean isSuccess() {
3903
      return this.success;
3904
    }
3905
 
3906
    public void setSuccess(boolean success) {
3907
      this.success = success;
3908
      setSuccessIsSet(true);
3909
    }
3910
 
3911
    public void unsetSuccess() {
3912
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
3913
    }
3914
 
3915
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3916
    public boolean isSetSuccess() {
3917
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
3918
    }
3919
 
3920
    public void setSuccessIsSet(boolean value) {
3921
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
3922
    }
3923
 
3924
    public PromotionException getPex() {
3925
      return this.pex;
3926
    }
3927
 
3928
    public void setPex(PromotionException pex) {
3929
      this.pex = pex;
3930
    }
3931
 
3932
    public void unsetPex() {
3933
      this.pex = null;
3934
    }
3935
 
3936
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3937
    public boolean isSetPex() {
3938
      return this.pex != null;
3939
    }
3940
 
3941
    public void setPexIsSet(boolean value) {
3942
      if (!value) {
3943
        this.pex = null;
3944
      }
3945
    }
3946
 
3947
    public void setFieldValue(_Fields field, Object value) {
3948
      switch (field) {
3949
      case SUCCESS:
3950
        if (value == null) {
3951
          unsetSuccess();
3952
        } else {
3953
          setSuccess((Boolean)value);
3954
        }
3955
        break;
3956
 
3957
      case PEX:
3958
        if (value == null) {
3959
          unsetPex();
3960
        } else {
3961
          setPex((PromotionException)value);
3962
        }
3963
        break;
3964
 
3965
      }
3966
    }
3967
 
3968
    public Object getFieldValue(_Fields field) {
3969
      switch (field) {
3970
      case SUCCESS:
3971
        return Boolean.valueOf(isSuccess());
3972
 
3973
      case PEX:
3974
        return getPex();
3975
 
3976
      }
3977
      throw new IllegalStateException();
3978
    }
3979
 
3980
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3981
    public boolean isSet(_Fields field) {
3982
      if (field == null) {
3983
        throw new IllegalArgumentException();
3984
      }
3985
 
3986
      switch (field) {
3987
      case SUCCESS:
3988
        return isSetSuccess();
3989
      case PEX:
3990
        return isSetPex();
3991
      }
3992
      throw new IllegalStateException();
3993
    }
3994
 
3995
    @Override
3996
    public boolean equals(Object that) {
3997
      if (that == null)
3998
        return false;
3999
      if (that instanceof isGiftVoucher_result)
4000
        return this.equals((isGiftVoucher_result)that);
4001
      return false;
4002
    }
4003
 
4004
    public boolean equals(isGiftVoucher_result that) {
4005
      if (that == null)
4006
        return false;
4007
 
4008
      boolean this_present_success = true;
4009
      boolean that_present_success = true;
4010
      if (this_present_success || that_present_success) {
4011
        if (!(this_present_success && that_present_success))
4012
          return false;
4013
        if (this.success != that.success)
4014
          return false;
4015
      }
4016
 
4017
      boolean this_present_pex = true && this.isSetPex();
4018
      boolean that_present_pex = true && that.isSetPex();
4019
      if (this_present_pex || that_present_pex) {
4020
        if (!(this_present_pex && that_present_pex))
4021
          return false;
4022
        if (!this.pex.equals(that.pex))
4023
          return false;
4024
      }
4025
 
4026
      return true;
4027
    }
4028
 
4029
    @Override
4030
    public int hashCode() {
4031
      return 0;
4032
    }
4033
 
4034
    public int compareTo(isGiftVoucher_result other) {
4035
      if (!getClass().equals(other.getClass())) {
4036
        return getClass().getName().compareTo(other.getClass().getName());
4037
      }
4038
 
4039
      int lastComparison = 0;
4040
      isGiftVoucher_result typedOther = (isGiftVoucher_result)other;
4041
 
4042
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
4043
      if (lastComparison != 0) {
4044
        return lastComparison;
4045
      }
4046
      if (isSetSuccess()) {
4047
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4048
        if (lastComparison != 0) {
4049
          return lastComparison;
4050
        }
4051
      }
4052
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
4053
      if (lastComparison != 0) {
4054
        return lastComparison;
4055
      }
4056
      if (isSetPex()) {
4057
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
4058
        if (lastComparison != 0) {
4059
          return lastComparison;
4060
        }
4061
      }
4062
      return 0;
4063
    }
4064
 
4065
    public _Fields fieldForId(int fieldId) {
4066
      return _Fields.findByThriftId(fieldId);
4067
    }
4068
 
4069
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4070
      org.apache.thrift.protocol.TField field;
4071
      iprot.readStructBegin();
4072
      while (true)
4073
      {
4074
        field = iprot.readFieldBegin();
4075
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4076
          break;
4077
        }
4078
        switch (field.id) {
4079
          case 0: // SUCCESS
4080
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
4081
              this.success = iprot.readBool();
4082
              setSuccessIsSet(true);
4083
            } else { 
4084
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4085
            }
4086
            break;
4087
          case 1: // PEX
4088
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4089
              this.pex = new PromotionException();
4090
              this.pex.read(iprot);
4091
            } else { 
4092
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4093
            }
4094
            break;
4095
          default:
4096
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4097
        }
4098
        iprot.readFieldEnd();
4099
      }
4100
      iprot.readStructEnd();
4101
      validate();
4102
    }
4103
 
4104
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4105
      oprot.writeStructBegin(STRUCT_DESC);
4106
 
4107
      if (this.isSetSuccess()) {
4108
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4109
        oprot.writeBool(this.success);
4110
        oprot.writeFieldEnd();
4111
      } else if (this.isSetPex()) {
4112
        oprot.writeFieldBegin(PEX_FIELD_DESC);
4113
        this.pex.write(oprot);
4114
        oprot.writeFieldEnd();
4115
      }
4116
      oprot.writeFieldStop();
4117
      oprot.writeStructEnd();
4118
    }
4119
 
4120
    @Override
4121
    public String toString() {
4122
      StringBuilder sb = new StringBuilder("isGiftVoucher_result(");
4123
      boolean first = true;
4124
 
4125
      sb.append("success:");
4126
      sb.append(this.success);
4127
      first = false;
4128
      if (!first) sb.append(", ");
4129
      sb.append("pex:");
4130
      if (this.pex == null) {
4131
        sb.append("null");
4132
      } else {
4133
        sb.append(this.pex);
4134
      }
4135
      first = false;
4136
      sb.append(")");
4137
      return sb.toString();
4138
    }
4139
 
4140
    public void validate() throws org.apache.thrift.TException {
4141
      // check for required fields
4142
    }
4143
 
4144
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4145
      try {
4146
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4147
      } catch (org.apache.thrift.TException te) {
4148
        throw new java.io.IOException(te);
4149
      }
4150
    }
4151
 
4152
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4153
      try {
4154
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4155
      } catch (org.apache.thrift.TException te) {
4156
        throw new java.io.IOException(te);
4157
      }
4158
    }
4159
 
4160
  }
4161
 
6356 amit.gupta 4162
  public static class isCodApplicable_args implements org.apache.thrift.TBase<isCodApplicable_args, isCodApplicable_args._Fields>, java.io.Serializable, Cloneable   {
4163
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isCodApplicable_args");
4164
 
4165
    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);
4166
 
4167
    private String couponCode; // required
4168
 
4169
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4170
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4171
      COUPON_CODE((short)1, "couponCode");
4172
 
4173
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4174
 
4175
      static {
4176
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4177
          byName.put(field.getFieldName(), field);
4178
        }
4179
      }
4180
 
4181
      /**
4182
       * Find the _Fields constant that matches fieldId, or null if its not found.
4183
       */
4184
      public static _Fields findByThriftId(int fieldId) {
4185
        switch(fieldId) {
4186
          case 1: // COUPON_CODE
4187
            return COUPON_CODE;
4188
          default:
4189
            return null;
4190
        }
4191
      }
4192
 
4193
      /**
4194
       * Find the _Fields constant that matches fieldId, throwing an exception
4195
       * if it is not found.
4196
       */
4197
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4198
        _Fields fields = findByThriftId(fieldId);
4199
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4200
        return fields;
4201
      }
4202
 
4203
      /**
4204
       * Find the _Fields constant that matches name, or null if its not found.
4205
       */
4206
      public static _Fields findByName(String name) {
4207
        return byName.get(name);
4208
      }
4209
 
4210
      private final short _thriftId;
4211
      private final String _fieldName;
4212
 
4213
      _Fields(short thriftId, String fieldName) {
4214
        _thriftId = thriftId;
4215
        _fieldName = fieldName;
4216
      }
4217
 
4218
      public short getThriftFieldId() {
4219
        return _thriftId;
4220
      }
4221
 
4222
      public String getFieldName() {
4223
        return _fieldName;
4224
      }
4225
    }
4226
 
4227
    // isset id assignments
4228
 
4229
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4230
    static {
4231
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4232
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4233
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
4234
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4235
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isCodApplicable_args.class, metaDataMap);
4236
    }
4237
 
4238
    public isCodApplicable_args() {
4239
    }
4240
 
4241
    public isCodApplicable_args(
4242
      String couponCode)
4243
    {
4244
      this();
4245
      this.couponCode = couponCode;
4246
    }
4247
 
4248
    /**
4249
     * Performs a deep copy on <i>other</i>.
4250
     */
4251
    public isCodApplicable_args(isCodApplicable_args other) {
4252
      if (other.isSetCouponCode()) {
4253
        this.couponCode = other.couponCode;
4254
      }
4255
    }
4256
 
4257
    public isCodApplicable_args deepCopy() {
4258
      return new isCodApplicable_args(this);
4259
    }
4260
 
4261
    @Override
4262
    public void clear() {
4263
      this.couponCode = null;
4264
    }
4265
 
4266
    public String getCouponCode() {
4267
      return this.couponCode;
4268
    }
4269
 
4270
    public void setCouponCode(String couponCode) {
4271
      this.couponCode = couponCode;
4272
    }
4273
 
4274
    public void unsetCouponCode() {
4275
      this.couponCode = null;
4276
    }
4277
 
4278
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
4279
    public boolean isSetCouponCode() {
4280
      return this.couponCode != null;
4281
    }
4282
 
4283
    public void setCouponCodeIsSet(boolean value) {
4284
      if (!value) {
4285
        this.couponCode = null;
4286
      }
4287
    }
4288
 
4289
    public void setFieldValue(_Fields field, Object value) {
4290
      switch (field) {
4291
      case COUPON_CODE:
4292
        if (value == null) {
4293
          unsetCouponCode();
4294
        } else {
4295
          setCouponCode((String)value);
4296
        }
4297
        break;
4298
 
4299
      }
4300
    }
4301
 
4302
    public Object getFieldValue(_Fields field) {
4303
      switch (field) {
4304
      case COUPON_CODE:
4305
        return getCouponCode();
4306
 
4307
      }
4308
      throw new IllegalStateException();
4309
    }
4310
 
4311
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4312
    public boolean isSet(_Fields field) {
4313
      if (field == null) {
4314
        throw new IllegalArgumentException();
4315
      }
4316
 
4317
      switch (field) {
4318
      case COUPON_CODE:
4319
        return isSetCouponCode();
4320
      }
4321
      throw new IllegalStateException();
4322
    }
4323
 
4324
    @Override
4325
    public boolean equals(Object that) {
4326
      if (that == null)
4327
        return false;
4328
      if (that instanceof isCodApplicable_args)
4329
        return this.equals((isCodApplicable_args)that);
4330
      return false;
4331
    }
4332
 
4333
    public boolean equals(isCodApplicable_args that) {
4334
      if (that == null)
4335
        return false;
4336
 
4337
      boolean this_present_couponCode = true && this.isSetCouponCode();
4338
      boolean that_present_couponCode = true && that.isSetCouponCode();
4339
      if (this_present_couponCode || that_present_couponCode) {
4340
        if (!(this_present_couponCode && that_present_couponCode))
4341
          return false;
4342
        if (!this.couponCode.equals(that.couponCode))
4343
          return false;
4344
      }
4345
 
4346
      return true;
4347
    }
4348
 
4349
    @Override
4350
    public int hashCode() {
4351
      return 0;
4352
    }
4353
 
4354
    public int compareTo(isCodApplicable_args other) {
4355
      if (!getClass().equals(other.getClass())) {
4356
        return getClass().getName().compareTo(other.getClass().getName());
4357
      }
4358
 
4359
      int lastComparison = 0;
4360
      isCodApplicable_args typedOther = (isCodApplicable_args)other;
4361
 
4362
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
4363
      if (lastComparison != 0) {
4364
        return lastComparison;
4365
      }
4366
      if (isSetCouponCode()) {
4367
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
4368
        if (lastComparison != 0) {
4369
          return lastComparison;
4370
        }
4371
      }
4372
      return 0;
4373
    }
4374
 
4375
    public _Fields fieldForId(int fieldId) {
4376
      return _Fields.findByThriftId(fieldId);
4377
    }
4378
 
4379
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4380
      org.apache.thrift.protocol.TField field;
4381
      iprot.readStructBegin();
4382
      while (true)
4383
      {
4384
        field = iprot.readFieldBegin();
4385
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4386
          break;
4387
        }
4388
        switch (field.id) {
4389
          case 1: // COUPON_CODE
4390
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
4391
              this.couponCode = iprot.readString();
4392
            } else { 
4393
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4394
            }
4395
            break;
4396
          default:
4397
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4398
        }
4399
        iprot.readFieldEnd();
4400
      }
4401
      iprot.readStructEnd();
4402
      validate();
4403
    }
4404
 
4405
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4406
      validate();
4407
 
4408
      oprot.writeStructBegin(STRUCT_DESC);
4409
      if (this.couponCode != null) {
4410
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
4411
        oprot.writeString(this.couponCode);
4412
        oprot.writeFieldEnd();
4413
      }
4414
      oprot.writeFieldStop();
4415
      oprot.writeStructEnd();
4416
    }
4417
 
4418
    @Override
4419
    public String toString() {
4420
      StringBuilder sb = new StringBuilder("isCodApplicable_args(");
4421
      boolean first = true;
4422
 
4423
      sb.append("couponCode:");
4424
      if (this.couponCode == null) {
4425
        sb.append("null");
4426
      } else {
4427
        sb.append(this.couponCode);
4428
      }
4429
      first = false;
4430
      sb.append(")");
4431
      return sb.toString();
4432
    }
4433
 
4434
    public void validate() throws org.apache.thrift.TException {
4435
      // check for required fields
4436
    }
4437
 
4438
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4439
      try {
4440
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4441
      } catch (org.apache.thrift.TException te) {
4442
        throw new java.io.IOException(te);
4443
      }
4444
    }
4445
 
4446
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4447
      try {
4448
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4449
      } catch (org.apache.thrift.TException te) {
4450
        throw new java.io.IOException(te);
4451
      }
4452
    }
4453
 
4454
  }
4455
 
4456
  public static class isCodApplicable_result implements org.apache.thrift.TBase<isCodApplicable_result, isCodApplicable_result._Fields>, java.io.Serializable, Cloneable   {
4457
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isCodApplicable_result");
4458
 
4459
    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);
4460
    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);
4461
 
4462
    private boolean success; // required
4463
    private PromotionException pex; // required
4464
 
4465
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4466
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4467
      SUCCESS((short)0, "success"),
4468
      PEX((short)1, "pex");
4469
 
4470
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4471
 
4472
      static {
4473
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4474
          byName.put(field.getFieldName(), field);
4475
        }
4476
      }
4477
 
4478
      /**
4479
       * Find the _Fields constant that matches fieldId, or null if its not found.
4480
       */
4481
      public static _Fields findByThriftId(int fieldId) {
4482
        switch(fieldId) {
4483
          case 0: // SUCCESS
4484
            return SUCCESS;
4485
          case 1: // PEX
4486
            return PEX;
4487
          default:
4488
            return null;
4489
        }
4490
      }
4491
 
4492
      /**
4493
       * Find the _Fields constant that matches fieldId, throwing an exception
4494
       * if it is not found.
4495
       */
4496
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4497
        _Fields fields = findByThriftId(fieldId);
4498
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4499
        return fields;
4500
      }
4501
 
4502
      /**
4503
       * Find the _Fields constant that matches name, or null if its not found.
4504
       */
4505
      public static _Fields findByName(String name) {
4506
        return byName.get(name);
4507
      }
4508
 
4509
      private final short _thriftId;
4510
      private final String _fieldName;
4511
 
4512
      _Fields(short thriftId, String fieldName) {
4513
        _thriftId = thriftId;
4514
        _fieldName = fieldName;
4515
      }
4516
 
4517
      public short getThriftFieldId() {
4518
        return _thriftId;
4519
      }
4520
 
4521
      public String getFieldName() {
4522
        return _fieldName;
4523
      }
4524
    }
4525
 
4526
    // isset id assignments
4527
    private static final int __SUCCESS_ISSET_ID = 0;
4528
    private BitSet __isset_bit_vector = new BitSet(1);
4529
 
4530
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4531
    static {
4532
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4533
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4534
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
4535
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4536
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4537
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4538
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isCodApplicable_result.class, metaDataMap);
4539
    }
4540
 
4541
    public isCodApplicable_result() {
4542
    }
4543
 
4544
    public isCodApplicable_result(
4545
      boolean success,
4546
      PromotionException pex)
4547
    {
4548
      this();
4549
      this.success = success;
4550
      setSuccessIsSet(true);
4551
      this.pex = pex;
4552
    }
4553
 
4554
    /**
4555
     * Performs a deep copy on <i>other</i>.
4556
     */
4557
    public isCodApplicable_result(isCodApplicable_result other) {
4558
      __isset_bit_vector.clear();
4559
      __isset_bit_vector.or(other.__isset_bit_vector);
4560
      this.success = other.success;
4561
      if (other.isSetPex()) {
4562
        this.pex = new PromotionException(other.pex);
4563
      }
4564
    }
4565
 
4566
    public isCodApplicable_result deepCopy() {
4567
      return new isCodApplicable_result(this);
4568
    }
4569
 
4570
    @Override
4571
    public void clear() {
4572
      setSuccessIsSet(false);
4573
      this.success = false;
4574
      this.pex = null;
4575
    }
4576
 
4577
    public boolean isSuccess() {
4578
      return this.success;
4579
    }
4580
 
4581
    public void setSuccess(boolean success) {
4582
      this.success = success;
4583
      setSuccessIsSet(true);
4584
    }
4585
 
4586
    public void unsetSuccess() {
4587
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
4588
    }
4589
 
4590
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
4591
    public boolean isSetSuccess() {
4592
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
4593
    }
4594
 
4595
    public void setSuccessIsSet(boolean value) {
4596
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
4597
    }
4598
 
4599
    public PromotionException getPex() {
4600
      return this.pex;
4601
    }
4602
 
4603
    public void setPex(PromotionException pex) {
4604
      this.pex = pex;
4605
    }
4606
 
4607
    public void unsetPex() {
4608
      this.pex = null;
4609
    }
4610
 
4611
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
4612
    public boolean isSetPex() {
4613
      return this.pex != null;
4614
    }
4615
 
4616
    public void setPexIsSet(boolean value) {
4617
      if (!value) {
4618
        this.pex = null;
4619
      }
4620
    }
4621
 
4622
    public void setFieldValue(_Fields field, Object value) {
4623
      switch (field) {
4624
      case SUCCESS:
4625
        if (value == null) {
4626
          unsetSuccess();
4627
        } else {
4628
          setSuccess((Boolean)value);
4629
        }
4630
        break;
4631
 
4632
      case PEX:
4633
        if (value == null) {
4634
          unsetPex();
4635
        } else {
4636
          setPex((PromotionException)value);
4637
        }
4638
        break;
4639
 
4640
      }
4641
    }
4642
 
4643
    public Object getFieldValue(_Fields field) {
4644
      switch (field) {
4645
      case SUCCESS:
4646
        return Boolean.valueOf(isSuccess());
4647
 
4648
      case PEX:
4649
        return getPex();
4650
 
4651
      }
4652
      throw new IllegalStateException();
4653
    }
4654
 
4655
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4656
    public boolean isSet(_Fields field) {
4657
      if (field == null) {
4658
        throw new IllegalArgumentException();
4659
      }
4660
 
4661
      switch (field) {
4662
      case SUCCESS:
4663
        return isSetSuccess();
4664
      case PEX:
4665
        return isSetPex();
4666
      }
4667
      throw new IllegalStateException();
4668
    }
4669
 
4670
    @Override
4671
    public boolean equals(Object that) {
4672
      if (that == null)
4673
        return false;
4674
      if (that instanceof isCodApplicable_result)
4675
        return this.equals((isCodApplicable_result)that);
4676
      return false;
4677
    }
4678
 
4679
    public boolean equals(isCodApplicable_result that) {
4680
      if (that == null)
4681
        return false;
4682
 
4683
      boolean this_present_success = true;
4684
      boolean that_present_success = true;
4685
      if (this_present_success || that_present_success) {
4686
        if (!(this_present_success && that_present_success))
4687
          return false;
4688
        if (this.success != that.success)
4689
          return false;
4690
      }
4691
 
4692
      boolean this_present_pex = true && this.isSetPex();
4693
      boolean that_present_pex = true && that.isSetPex();
4694
      if (this_present_pex || that_present_pex) {
4695
        if (!(this_present_pex && that_present_pex))
4696
          return false;
4697
        if (!this.pex.equals(that.pex))
4698
          return false;
4699
      }
4700
 
4701
      return true;
4702
    }
4703
 
4704
    @Override
4705
    public int hashCode() {
4706
      return 0;
4707
    }
4708
 
4709
    public int compareTo(isCodApplicable_result other) {
4710
      if (!getClass().equals(other.getClass())) {
4711
        return getClass().getName().compareTo(other.getClass().getName());
4712
      }
4713
 
4714
      int lastComparison = 0;
4715
      isCodApplicable_result typedOther = (isCodApplicable_result)other;
4716
 
4717
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
4718
      if (lastComparison != 0) {
4719
        return lastComparison;
4720
      }
4721
      if (isSetSuccess()) {
4722
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4723
        if (lastComparison != 0) {
4724
          return lastComparison;
4725
        }
4726
      }
4727
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
4728
      if (lastComparison != 0) {
4729
        return lastComparison;
4730
      }
4731
      if (isSetPex()) {
4732
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
4733
        if (lastComparison != 0) {
4734
          return lastComparison;
4735
        }
4736
      }
4737
      return 0;
4738
    }
4739
 
4740
    public _Fields fieldForId(int fieldId) {
4741
      return _Fields.findByThriftId(fieldId);
4742
    }
4743
 
4744
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4745
      org.apache.thrift.protocol.TField field;
4746
      iprot.readStructBegin();
4747
      while (true)
4748
      {
4749
        field = iprot.readFieldBegin();
4750
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4751
          break;
4752
        }
4753
        switch (field.id) {
4754
          case 0: // SUCCESS
4755
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
4756
              this.success = iprot.readBool();
4757
              setSuccessIsSet(true);
4758
            } else { 
4759
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4760
            }
4761
            break;
4762
          case 1: // PEX
4763
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4764
              this.pex = new PromotionException();
4765
              this.pex.read(iprot);
4766
            } else { 
4767
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4768
            }
4769
            break;
4770
          default:
4771
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4772
        }
4773
        iprot.readFieldEnd();
4774
      }
4775
      iprot.readStructEnd();
4776
      validate();
4777
    }
4778
 
4779
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4780
      oprot.writeStructBegin(STRUCT_DESC);
4781
 
4782
      if (this.isSetSuccess()) {
4783
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4784
        oprot.writeBool(this.success);
4785
        oprot.writeFieldEnd();
4786
      } else if (this.isSetPex()) {
4787
        oprot.writeFieldBegin(PEX_FIELD_DESC);
4788
        this.pex.write(oprot);
4789
        oprot.writeFieldEnd();
4790
      }
4791
      oprot.writeFieldStop();
4792
      oprot.writeStructEnd();
4793
    }
4794
 
4795
    @Override
4796
    public String toString() {
4797
      StringBuilder sb = new StringBuilder("isCodApplicable_result(");
4798
      boolean first = true;
4799
 
4800
      sb.append("success:");
4801
      sb.append(this.success);
4802
      first = false;
4803
      if (!first) sb.append(", ");
4804
      sb.append("pex:");
4805
      if (this.pex == null) {
4806
        sb.append("null");
4807
      } else {
4808
        sb.append(this.pex);
4809
      }
4810
      first = false;
4811
      sb.append(")");
4812
      return sb.toString();
4813
    }
4814
 
4815
    public void validate() throws org.apache.thrift.TException {
4816
      // check for required fields
4817
    }
4818
 
4819
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4820
      try {
4821
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4822
      } catch (org.apache.thrift.TException te) {
4823
        throw new java.io.IOException(te);
4824
      }
4825
    }
4826
 
4827
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4828
      try {
4829
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4830
      } catch (org.apache.thrift.TException te) {
4831
        throw new java.io.IOException(te);
4832
      }
4833
    }
4834
 
4835
  }
4836
 
3430 rajveer 4837
  public static class getAllPromotions_args implements org.apache.thrift.TBase<getAllPromotions_args, getAllPromotions_args._Fields>, java.io.Serializable, Cloneable   {
4838
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_args");
1982 varun.gupt 4839
 
4840
 
4841
 
4842
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 4843
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 4844
;
4845
 
4846
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4847
 
4848
      static {
4849
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4850
          byName.put(field.getFieldName(), field);
4851
        }
4852
      }
4853
 
4854
      /**
4855
       * Find the _Fields constant that matches fieldId, or null if its not found.
4856
       */
4857
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 4858
        switch(fieldId) {
4859
          default:
4860
            return null;
4861
        }
1982 varun.gupt 4862
      }
4863
 
4864
      /**
4865
       * Find the _Fields constant that matches fieldId, throwing an exception
4866
       * if it is not found.
4867
       */
4868
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4869
        _Fields fields = findByThriftId(fieldId);
4870
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4871
        return fields;
4872
      }
4873
 
4874
      /**
4875
       * Find the _Fields constant that matches name, or null if its not found.
4876
       */
4877
      public static _Fields findByName(String name) {
4878
        return byName.get(name);
4879
      }
4880
 
4881
      private final short _thriftId;
4882
      private final String _fieldName;
4883
 
4884
      _Fields(short thriftId, String fieldName) {
4885
        _thriftId = thriftId;
4886
        _fieldName = fieldName;
4887
      }
4888
 
4889
      public short getThriftFieldId() {
4890
        return _thriftId;
4891
      }
4892
 
4893
      public String getFieldName() {
4894
        return _fieldName;
4895
      }
4896
    }
3430 rajveer 4897
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 4898
    static {
3430 rajveer 4899
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4900
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4901
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_args.class, metaDataMap);
1982 varun.gupt 4902
    }
4903
 
4904
    public getAllPromotions_args() {
4905
    }
4906
 
4907
    /**
4908
     * Performs a deep copy on <i>other</i>.
4909
     */
4910
    public getAllPromotions_args(getAllPromotions_args other) {
4911
    }
4912
 
4913
    public getAllPromotions_args deepCopy() {
4914
      return new getAllPromotions_args(this);
4915
    }
4916
 
3430 rajveer 4917
    @Override
4918
    public void clear() {
1982 varun.gupt 4919
    }
4920
 
4921
    public void setFieldValue(_Fields field, Object value) {
4922
      switch (field) {
4923
      }
4924
    }
4925
 
4926
    public Object getFieldValue(_Fields field) {
4927
      switch (field) {
4928
      }
4929
      throw new IllegalStateException();
4930
    }
4931
 
3430 rajveer 4932
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4933
    public boolean isSet(_Fields field) {
4934
      if (field == null) {
4935
        throw new IllegalArgumentException();
4936
      }
1982 varun.gupt 4937
 
4938
      switch (field) {
4939
      }
4940
      throw new IllegalStateException();
4941
    }
4942
 
4943
    @Override
4944
    public boolean equals(Object that) {
4945
      if (that == null)
4946
        return false;
4947
      if (that instanceof getAllPromotions_args)
4948
        return this.equals((getAllPromotions_args)that);
4949
      return false;
4950
    }
4951
 
4952
    public boolean equals(getAllPromotions_args that) {
4953
      if (that == null)
4954
        return false;
4955
 
4956
      return true;
4957
    }
4958
 
4959
    @Override
4960
    public int hashCode() {
4961
      return 0;
4962
    }
4963
 
4964
    public int compareTo(getAllPromotions_args other) {
4965
      if (!getClass().equals(other.getClass())) {
4966
        return getClass().getName().compareTo(other.getClass().getName());
4967
      }
4968
 
4969
      int lastComparison = 0;
4970
      getAllPromotions_args typedOther = (getAllPromotions_args)other;
4971
 
4972
      return 0;
4973
    }
4974
 
3430 rajveer 4975
    public _Fields fieldForId(int fieldId) {
4976
      return _Fields.findByThriftId(fieldId);
4977
    }
4978
 
4979
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4980
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 4981
      iprot.readStructBegin();
4982
      while (true)
4983
      {
4984
        field = iprot.readFieldBegin();
3430 rajveer 4985
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 4986
          break;
4987
        }
3430 rajveer 4988
        switch (field.id) {
4989
          default:
4990
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 4991
        }
3430 rajveer 4992
        iprot.readFieldEnd();
1982 varun.gupt 4993
      }
4994
      iprot.readStructEnd();
4995
      validate();
4996
    }
4997
 
3430 rajveer 4998
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 4999
      validate();
5000
 
5001
      oprot.writeStructBegin(STRUCT_DESC);
5002
      oprot.writeFieldStop();
5003
      oprot.writeStructEnd();
5004
    }
5005
 
5006
    @Override
5007
    public String toString() {
5008
      StringBuilder sb = new StringBuilder("getAllPromotions_args(");
5009
      boolean first = true;
5010
 
5011
      sb.append(")");
5012
      return sb.toString();
5013
    }
5014
 
3430 rajveer 5015
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5016
      // check for required fields
5017
    }
5018
 
3430 rajveer 5019
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5020
      try {
5021
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5022
      } catch (org.apache.thrift.TException te) {
5023
        throw new java.io.IOException(te);
5024
      }
5025
    }
5026
 
5027
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5028
      try {
5029
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5030
      } catch (org.apache.thrift.TException te) {
5031
        throw new java.io.IOException(te);
5032
      }
5033
    }
5034
 
1982 varun.gupt 5035
  }
5036
 
3430 rajveer 5037
  public static class getAllPromotions_result implements org.apache.thrift.TBase<getAllPromotions_result, getAllPromotions_result._Fields>, java.io.Serializable, Cloneable   {
5038
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_result");
1982 varun.gupt 5039
 
3430 rajveer 5040
    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);
5041
    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 5042
 
3430 rajveer 5043
    private List<Promotion> success; // required
5044
    private PromotionException pex; // required
1982 varun.gupt 5045
 
5046
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5047
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5048
      SUCCESS((short)0, "success"),
5049
      PEX((short)1, "pex");
5050
 
5051
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5052
 
5053
      static {
5054
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5055
          byName.put(field.getFieldName(), field);
5056
        }
5057
      }
5058
 
5059
      /**
5060
       * Find the _Fields constant that matches fieldId, or null if its not found.
5061
       */
5062
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5063
        switch(fieldId) {
5064
          case 0: // SUCCESS
5065
            return SUCCESS;
5066
          case 1: // PEX
5067
            return PEX;
5068
          default:
5069
            return null;
5070
        }
1982 varun.gupt 5071
      }
5072
 
5073
      /**
5074
       * Find the _Fields constant that matches fieldId, throwing an exception
5075
       * if it is not found.
5076
       */
5077
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5078
        _Fields fields = findByThriftId(fieldId);
5079
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5080
        return fields;
5081
      }
5082
 
5083
      /**
5084
       * Find the _Fields constant that matches name, or null if its not found.
5085
       */
5086
      public static _Fields findByName(String name) {
5087
        return byName.get(name);
5088
      }
5089
 
5090
      private final short _thriftId;
5091
      private final String _fieldName;
5092
 
5093
      _Fields(short thriftId, String fieldName) {
5094
        _thriftId = thriftId;
5095
        _fieldName = fieldName;
5096
      }
5097
 
5098
      public short getThriftFieldId() {
5099
        return _thriftId;
5100
      }
5101
 
5102
      public String getFieldName() {
5103
        return _fieldName;
5104
      }
5105
    }
5106
 
5107
    // isset id assignments
5108
 
3430 rajveer 5109
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5110
    static {
3430 rajveer 5111
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5112
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5113
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
5114
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class))));
5115
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5116
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
5117
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5118
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_result.class, metaDataMap);
1982 varun.gupt 5119
    }
5120
 
5121
    public getAllPromotions_result() {
5122
    }
5123
 
5124
    public getAllPromotions_result(
5125
      List<Promotion> success,
5126
      PromotionException pex)
5127
    {
5128
      this();
5129
      this.success = success;
5130
      this.pex = pex;
5131
    }
5132
 
5133
    /**
5134
     * Performs a deep copy on <i>other</i>.
5135
     */
5136
    public getAllPromotions_result(getAllPromotions_result other) {
5137
      if (other.isSetSuccess()) {
5138
        List<Promotion> __this__success = new ArrayList<Promotion>();
5139
        for (Promotion other_element : other.success) {
5140
          __this__success.add(new Promotion(other_element));
5141
        }
5142
        this.success = __this__success;
5143
      }
5144
      if (other.isSetPex()) {
5145
        this.pex = new PromotionException(other.pex);
5146
      }
5147
    }
5148
 
5149
    public getAllPromotions_result deepCopy() {
5150
      return new getAllPromotions_result(this);
5151
    }
5152
 
3430 rajveer 5153
    @Override
5154
    public void clear() {
5155
      this.success = null;
5156
      this.pex = null;
1982 varun.gupt 5157
    }
5158
 
5159
    public int getSuccessSize() {
5160
      return (this.success == null) ? 0 : this.success.size();
5161
    }
5162
 
5163
    public java.util.Iterator<Promotion> getSuccessIterator() {
5164
      return (this.success == null) ? null : this.success.iterator();
5165
    }
5166
 
5167
    public void addToSuccess(Promotion elem) {
5168
      if (this.success == null) {
5169
        this.success = new ArrayList<Promotion>();
5170
      }
5171
      this.success.add(elem);
5172
    }
5173
 
5174
    public List<Promotion> getSuccess() {
5175
      return this.success;
5176
    }
5177
 
3430 rajveer 5178
    public void setSuccess(List<Promotion> success) {
1982 varun.gupt 5179
      this.success = success;
5180
    }
5181
 
5182
    public void unsetSuccess() {
5183
      this.success = null;
5184
    }
5185
 
3430 rajveer 5186
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5187
    public boolean isSetSuccess() {
5188
      return this.success != null;
5189
    }
5190
 
5191
    public void setSuccessIsSet(boolean value) {
5192
      if (!value) {
5193
        this.success = null;
5194
      }
5195
    }
5196
 
5197
    public PromotionException getPex() {
5198
      return this.pex;
5199
    }
5200
 
3430 rajveer 5201
    public void setPex(PromotionException pex) {
1982 varun.gupt 5202
      this.pex = pex;
5203
    }
5204
 
5205
    public void unsetPex() {
5206
      this.pex = null;
5207
    }
5208
 
3430 rajveer 5209
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5210
    public boolean isSetPex() {
5211
      return this.pex != null;
5212
    }
5213
 
5214
    public void setPexIsSet(boolean value) {
5215
      if (!value) {
5216
        this.pex = null;
5217
      }
5218
    }
5219
 
5220
    public void setFieldValue(_Fields field, Object value) {
5221
      switch (field) {
5222
      case SUCCESS:
5223
        if (value == null) {
5224
          unsetSuccess();
5225
        } else {
5226
          setSuccess((List<Promotion>)value);
5227
        }
5228
        break;
5229
 
5230
      case PEX:
5231
        if (value == null) {
5232
          unsetPex();
5233
        } else {
5234
          setPex((PromotionException)value);
5235
        }
5236
        break;
5237
 
5238
      }
5239
    }
5240
 
5241
    public Object getFieldValue(_Fields field) {
5242
      switch (field) {
5243
      case SUCCESS:
5244
        return getSuccess();
5245
 
5246
      case PEX:
5247
        return getPex();
5248
 
5249
      }
5250
      throw new IllegalStateException();
5251
    }
5252
 
3430 rajveer 5253
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5254
    public boolean isSet(_Fields field) {
5255
      if (field == null) {
5256
        throw new IllegalArgumentException();
5257
      }
1982 varun.gupt 5258
 
5259
      switch (field) {
5260
      case SUCCESS:
5261
        return isSetSuccess();
5262
      case PEX:
5263
        return isSetPex();
5264
      }
5265
      throw new IllegalStateException();
5266
    }
5267
 
5268
    @Override
5269
    public boolean equals(Object that) {
5270
      if (that == null)
5271
        return false;
5272
      if (that instanceof getAllPromotions_result)
5273
        return this.equals((getAllPromotions_result)that);
5274
      return false;
5275
    }
5276
 
5277
    public boolean equals(getAllPromotions_result that) {
5278
      if (that == null)
5279
        return false;
5280
 
5281
      boolean this_present_success = true && this.isSetSuccess();
5282
      boolean that_present_success = true && that.isSetSuccess();
5283
      if (this_present_success || that_present_success) {
5284
        if (!(this_present_success && that_present_success))
5285
          return false;
5286
        if (!this.success.equals(that.success))
5287
          return false;
5288
      }
5289
 
5290
      boolean this_present_pex = true && this.isSetPex();
5291
      boolean that_present_pex = true && that.isSetPex();
5292
      if (this_present_pex || that_present_pex) {
5293
        if (!(this_present_pex && that_present_pex))
5294
          return false;
5295
        if (!this.pex.equals(that.pex))
5296
          return false;
5297
      }
5298
 
5299
      return true;
5300
    }
5301
 
5302
    @Override
5303
    public int hashCode() {
5304
      return 0;
5305
    }
5306
 
5307
    public int compareTo(getAllPromotions_result other) {
5308
      if (!getClass().equals(other.getClass())) {
5309
        return getClass().getName().compareTo(other.getClass().getName());
5310
      }
5311
 
5312
      int lastComparison = 0;
5313
      getAllPromotions_result typedOther = (getAllPromotions_result)other;
5314
 
3430 rajveer 5315
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 5316
      if (lastComparison != 0) {
5317
        return lastComparison;
5318
      }
3430 rajveer 5319
      if (isSetSuccess()) {
5320
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
5321
        if (lastComparison != 0) {
5322
          return lastComparison;
5323
        }
1982 varun.gupt 5324
      }
3430 rajveer 5325
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 5326
      if (lastComparison != 0) {
5327
        return lastComparison;
5328
      }
3430 rajveer 5329
      if (isSetPex()) {
5330
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
5331
        if (lastComparison != 0) {
5332
          return lastComparison;
5333
        }
1982 varun.gupt 5334
      }
5335
      return 0;
5336
    }
5337
 
3430 rajveer 5338
    public _Fields fieldForId(int fieldId) {
5339
      return _Fields.findByThriftId(fieldId);
5340
    }
5341
 
5342
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5343
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5344
      iprot.readStructBegin();
5345
      while (true)
5346
      {
5347
        field = iprot.readFieldBegin();
3430 rajveer 5348
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5349
          break;
5350
        }
3430 rajveer 5351
        switch (field.id) {
5352
          case 0: // SUCCESS
5353
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
5354
              {
5327 rajveer 5355
                org.apache.thrift.protocol.TList _list12 = iprot.readListBegin();
5356
                this.success = new ArrayList<Promotion>(_list12.size);
5357
                for (int _i13 = 0; _i13 < _list12.size; ++_i13)
1982 varun.gupt 5358
                {
5327 rajveer 5359
                  Promotion _elem14; // required
5360
                  _elem14 = new Promotion();
5361
                  _elem14.read(iprot);
5362
                  this.success.add(_elem14);
1982 varun.gupt 5363
                }
3430 rajveer 5364
                iprot.readListEnd();
1982 varun.gupt 5365
              }
3430 rajveer 5366
            } else { 
5367
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5368
            }
5369
            break;
5370
          case 1: // PEX
5371
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5372
              this.pex = new PromotionException();
5373
              this.pex.read(iprot);
5374
            } else { 
5375
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5376
            }
5377
            break;
5378
          default:
5379
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5380
        }
3430 rajveer 5381
        iprot.readFieldEnd();
1982 varun.gupt 5382
      }
5383
      iprot.readStructEnd();
5384
      validate();
5385
    }
5386
 
3430 rajveer 5387
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5388
      oprot.writeStructBegin(STRUCT_DESC);
5389
 
5390
      if (this.isSetSuccess()) {
5391
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
5392
        {
3430 rajveer 5393
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
5327 rajveer 5394
          for (Promotion _iter15 : this.success)
1982 varun.gupt 5395
          {
5327 rajveer 5396
            _iter15.write(oprot);
1982 varun.gupt 5397
          }
5398
          oprot.writeListEnd();
5399
        }
5400
        oprot.writeFieldEnd();
5401
      } else if (this.isSetPex()) {
5402
        oprot.writeFieldBegin(PEX_FIELD_DESC);
5403
        this.pex.write(oprot);
5404
        oprot.writeFieldEnd();
5405
      }
5406
      oprot.writeFieldStop();
5407
      oprot.writeStructEnd();
5408
    }
5409
 
5410
    @Override
5411
    public String toString() {
5412
      StringBuilder sb = new StringBuilder("getAllPromotions_result(");
5413
      boolean first = true;
5414
 
5415
      sb.append("success:");
5416
      if (this.success == null) {
5417
        sb.append("null");
5418
      } else {
5419
        sb.append(this.success);
5420
      }
5421
      first = false;
5422
      if (!first) sb.append(", ");
5423
      sb.append("pex:");
5424
      if (this.pex == null) {
5425
        sb.append("null");
5426
      } else {
5427
        sb.append(this.pex);
5428
      }
5429
      first = false;
5430
      sb.append(")");
5431
      return sb.toString();
5432
    }
5433
 
3430 rajveer 5434
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5435
      // check for required fields
5436
    }
5437
 
3430 rajveer 5438
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5439
      try {
5440
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5441
      } catch (org.apache.thrift.TException te) {
5442
        throw new java.io.IOException(te);
5443
      }
5444
    }
5445
 
5446
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5447
      try {
5448
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5449
      } catch (org.apache.thrift.TException te) {
5450
        throw new java.io.IOException(te);
5451
      }
5452
    }
5453
 
1982 varun.gupt 5454
  }
5455
 
3430 rajveer 5456
  public static class getPromotionById_args implements org.apache.thrift.TBase<getPromotionById_args, getPromotionById_args._Fields>, java.io.Serializable, Cloneable   {
5457
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_args");
1982 varun.gupt 5458
 
3430 rajveer 5459
    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 5460
 
3430 rajveer 5461
    private long promotionId; // required
1982 varun.gupt 5462
 
5463
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5464
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5465
      PROMOTION_ID((short)1, "promotionId");
5466
 
5467
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5468
 
5469
      static {
5470
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5471
          byName.put(field.getFieldName(), field);
5472
        }
5473
      }
5474
 
5475
      /**
5476
       * Find the _Fields constant that matches fieldId, or null if its not found.
5477
       */
5478
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5479
        switch(fieldId) {
5480
          case 1: // PROMOTION_ID
5481
            return PROMOTION_ID;
5482
          default:
5483
            return null;
5484
        }
1982 varun.gupt 5485
      }
5486
 
5487
      /**
5488
       * Find the _Fields constant that matches fieldId, throwing an exception
5489
       * if it is not found.
5490
       */
5491
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5492
        _Fields fields = findByThriftId(fieldId);
5493
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5494
        return fields;
5495
      }
5496
 
5497
      /**
5498
       * Find the _Fields constant that matches name, or null if its not found.
5499
       */
5500
      public static _Fields findByName(String name) {
5501
        return byName.get(name);
5502
      }
5503
 
5504
      private final short _thriftId;
5505
      private final String _fieldName;
5506
 
5507
      _Fields(short thriftId, String fieldName) {
5508
        _thriftId = thriftId;
5509
        _fieldName = fieldName;
5510
      }
5511
 
5512
      public short getThriftFieldId() {
5513
        return _thriftId;
5514
      }
5515
 
5516
      public String getFieldName() {
5517
        return _fieldName;
5518
      }
5519
    }
5520
 
5521
    // isset id assignments
5522
    private static final int __PROMOTIONID_ISSET_ID = 0;
5523
    private BitSet __isset_bit_vector = new BitSet(1);
5524
 
3430 rajveer 5525
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5526
    static {
3430 rajveer 5527
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5528
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5529
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
5530
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5531
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_args.class, metaDataMap);
1982 varun.gupt 5532
    }
5533
 
5534
    public getPromotionById_args() {
5535
    }
5536
 
5537
    public getPromotionById_args(
5538
      long promotionId)
5539
    {
5540
      this();
5541
      this.promotionId = promotionId;
5542
      setPromotionIdIsSet(true);
5543
    }
5544
 
5545
    /**
5546
     * Performs a deep copy on <i>other</i>.
5547
     */
5548
    public getPromotionById_args(getPromotionById_args other) {
5549
      __isset_bit_vector.clear();
5550
      __isset_bit_vector.or(other.__isset_bit_vector);
5551
      this.promotionId = other.promotionId;
5552
    }
5553
 
5554
    public getPromotionById_args deepCopy() {
5555
      return new getPromotionById_args(this);
5556
    }
5557
 
3430 rajveer 5558
    @Override
5559
    public void clear() {
5560
      setPromotionIdIsSet(false);
5561
      this.promotionId = 0;
1982 varun.gupt 5562
    }
5563
 
5564
    public long getPromotionId() {
5565
      return this.promotionId;
5566
    }
5567
 
3430 rajveer 5568
    public void setPromotionId(long promotionId) {
1982 varun.gupt 5569
      this.promotionId = promotionId;
5570
      setPromotionIdIsSet(true);
5571
    }
5572
 
5573
    public void unsetPromotionId() {
5574
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
5575
    }
5576
 
3430 rajveer 5577
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5578
    public boolean isSetPromotionId() {
5579
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
5580
    }
5581
 
5582
    public void setPromotionIdIsSet(boolean value) {
5583
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
5584
    }
5585
 
5586
    public void setFieldValue(_Fields field, Object value) {
5587
      switch (field) {
5588
      case PROMOTION_ID:
5589
        if (value == null) {
5590
          unsetPromotionId();
5591
        } else {
5592
          setPromotionId((Long)value);
5593
        }
5594
        break;
5595
 
5596
      }
5597
    }
5598
 
5599
    public Object getFieldValue(_Fields field) {
5600
      switch (field) {
5601
      case PROMOTION_ID:
3430 rajveer 5602
        return Long.valueOf(getPromotionId());
1982 varun.gupt 5603
 
5604
      }
5605
      throw new IllegalStateException();
5606
    }
5607
 
3430 rajveer 5608
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5609
    public boolean isSet(_Fields field) {
5610
      if (field == null) {
5611
        throw new IllegalArgumentException();
5612
      }
1982 varun.gupt 5613
 
5614
      switch (field) {
5615
      case PROMOTION_ID:
5616
        return isSetPromotionId();
5617
      }
5618
      throw new IllegalStateException();
5619
    }
5620
 
5621
    @Override
5622
    public boolean equals(Object that) {
5623
      if (that == null)
5624
        return false;
5625
      if (that instanceof getPromotionById_args)
5626
        return this.equals((getPromotionById_args)that);
5627
      return false;
5628
    }
5629
 
5630
    public boolean equals(getPromotionById_args that) {
5631
      if (that == null)
5632
        return false;
5633
 
5634
      boolean this_present_promotionId = true;
5635
      boolean that_present_promotionId = true;
5636
      if (this_present_promotionId || that_present_promotionId) {
5637
        if (!(this_present_promotionId && that_present_promotionId))
5638
          return false;
5639
        if (this.promotionId != that.promotionId)
5640
          return false;
5641
      }
5642
 
5643
      return true;
5644
    }
5645
 
5646
    @Override
5647
    public int hashCode() {
5648
      return 0;
5649
    }
5650
 
5651
    public int compareTo(getPromotionById_args other) {
5652
      if (!getClass().equals(other.getClass())) {
5653
        return getClass().getName().compareTo(other.getClass().getName());
5654
      }
5655
 
5656
      int lastComparison = 0;
5657
      getPromotionById_args typedOther = (getPromotionById_args)other;
5658
 
3430 rajveer 5659
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 5660
      if (lastComparison != 0) {
5661
        return lastComparison;
5662
      }
3430 rajveer 5663
      if (isSetPromotionId()) {
5664
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
5665
        if (lastComparison != 0) {
5666
          return lastComparison;
5667
        }
1982 varun.gupt 5668
      }
5669
      return 0;
5670
    }
5671
 
3430 rajveer 5672
    public _Fields fieldForId(int fieldId) {
5673
      return _Fields.findByThriftId(fieldId);
5674
    }
5675
 
5676
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5677
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5678
      iprot.readStructBegin();
5679
      while (true)
5680
      {
5681
        field = iprot.readFieldBegin();
3430 rajveer 5682
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5683
          break;
5684
        }
3430 rajveer 5685
        switch (field.id) {
5686
          case 1: // PROMOTION_ID
5687
            if (field.type == org.apache.thrift.protocol.TType.I64) {
5688
              this.promotionId = iprot.readI64();
5689
              setPromotionIdIsSet(true);
5690
            } else { 
5691
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5692
            }
5693
            break;
5694
          default:
5695
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5696
        }
3430 rajveer 5697
        iprot.readFieldEnd();
1982 varun.gupt 5698
      }
5699
      iprot.readStructEnd();
5700
      validate();
5701
    }
5702
 
3430 rajveer 5703
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5704
      validate();
5705
 
5706
      oprot.writeStructBegin(STRUCT_DESC);
5707
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
5708
      oprot.writeI64(this.promotionId);
5709
      oprot.writeFieldEnd();
5710
      oprot.writeFieldStop();
5711
      oprot.writeStructEnd();
5712
    }
5713
 
5714
    @Override
5715
    public String toString() {
5716
      StringBuilder sb = new StringBuilder("getPromotionById_args(");
5717
      boolean first = true;
5718
 
5719
      sb.append("promotionId:");
5720
      sb.append(this.promotionId);
5721
      first = false;
5722
      sb.append(")");
5723
      return sb.toString();
5724
    }
5725
 
3430 rajveer 5726
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5727
      // check for required fields
5728
    }
5729
 
3430 rajveer 5730
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5731
      try {
5732
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5733
      } catch (org.apache.thrift.TException te) {
5734
        throw new java.io.IOException(te);
5735
      }
5736
    }
5737
 
5738
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5739
      try {
5740
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
5741
        __isset_bit_vector = new BitSet(1);
5742
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5743
      } catch (org.apache.thrift.TException te) {
5744
        throw new java.io.IOException(te);
5745
      }
5746
    }
5747
 
1982 varun.gupt 5748
  }
5749
 
3430 rajveer 5750
  public static class getPromotionById_result implements org.apache.thrift.TBase<getPromotionById_result, getPromotionById_result._Fields>, java.io.Serializable, Cloneable   {
5751
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_result");
1982 varun.gupt 5752
 
3430 rajveer 5753
    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);
5754
    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 5755
 
3430 rajveer 5756
    private Promotion success; // required
5757
    private PromotionException pex; // required
1982 varun.gupt 5758
 
5759
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5760
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5761
      SUCCESS((short)0, "success"),
5762
      PEX((short)1, "pex");
5763
 
5764
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5765
 
5766
      static {
5767
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5768
          byName.put(field.getFieldName(), field);
5769
        }
5770
      }
5771
 
5772
      /**
5773
       * Find the _Fields constant that matches fieldId, or null if its not found.
5774
       */
5775
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5776
        switch(fieldId) {
5777
          case 0: // SUCCESS
5778
            return SUCCESS;
5779
          case 1: // PEX
5780
            return PEX;
5781
          default:
5782
            return null;
5783
        }
1982 varun.gupt 5784
      }
5785
 
5786
      /**
5787
       * Find the _Fields constant that matches fieldId, throwing an exception
5788
       * if it is not found.
5789
       */
5790
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5791
        _Fields fields = findByThriftId(fieldId);
5792
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5793
        return fields;
5794
      }
5795
 
5796
      /**
5797
       * Find the _Fields constant that matches name, or null if its not found.
5798
       */
5799
      public static _Fields findByName(String name) {
5800
        return byName.get(name);
5801
      }
5802
 
5803
      private final short _thriftId;
5804
      private final String _fieldName;
5805
 
5806
      _Fields(short thriftId, String fieldName) {
5807
        _thriftId = thriftId;
5808
        _fieldName = fieldName;
5809
      }
5810
 
5811
      public short getThriftFieldId() {
5812
        return _thriftId;
5813
      }
5814
 
5815
      public String getFieldName() {
5816
        return _fieldName;
5817
      }
5818
    }
5819
 
5820
    // isset id assignments
5821
 
3430 rajveer 5822
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5823
    static {
3430 rajveer 5824
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5825
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5826
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class)));
5827
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5828
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
5829
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5830
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_result.class, metaDataMap);
1982 varun.gupt 5831
    }
5832
 
5833
    public getPromotionById_result() {
5834
    }
5835
 
5836
    public getPromotionById_result(
5837
      Promotion success,
5838
      PromotionException pex)
5839
    {
5840
      this();
5841
      this.success = success;
5842
      this.pex = pex;
5843
    }
5844
 
5845
    /**
5846
     * Performs a deep copy on <i>other</i>.
5847
     */
5848
    public getPromotionById_result(getPromotionById_result other) {
5849
      if (other.isSetSuccess()) {
5850
        this.success = new Promotion(other.success);
5851
      }
5852
      if (other.isSetPex()) {
5853
        this.pex = new PromotionException(other.pex);
5854
      }
5855
    }
5856
 
5857
    public getPromotionById_result deepCopy() {
5858
      return new getPromotionById_result(this);
5859
    }
5860
 
3430 rajveer 5861
    @Override
5862
    public void clear() {
5863
      this.success = null;
5864
      this.pex = null;
1982 varun.gupt 5865
    }
5866
 
5867
    public Promotion getSuccess() {
5868
      return this.success;
5869
    }
5870
 
3430 rajveer 5871
    public void setSuccess(Promotion success) {
1982 varun.gupt 5872
      this.success = success;
5873
    }
5874
 
5875
    public void unsetSuccess() {
5876
      this.success = null;
5877
    }
5878
 
3430 rajveer 5879
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5880
    public boolean isSetSuccess() {
5881
      return this.success != null;
5882
    }
5883
 
5884
    public void setSuccessIsSet(boolean value) {
5885
      if (!value) {
5886
        this.success = null;
5887
      }
5888
    }
5889
 
5890
    public PromotionException getPex() {
5891
      return this.pex;
5892
    }
5893
 
3430 rajveer 5894
    public void setPex(PromotionException pex) {
1982 varun.gupt 5895
      this.pex = pex;
5896
    }
5897
 
5898
    public void unsetPex() {
5899
      this.pex = null;
5900
    }
5901
 
3430 rajveer 5902
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5903
    public boolean isSetPex() {
5904
      return this.pex != null;
5905
    }
5906
 
5907
    public void setPexIsSet(boolean value) {
5908
      if (!value) {
5909
        this.pex = null;
5910
      }
5911
    }
5912
 
5913
    public void setFieldValue(_Fields field, Object value) {
5914
      switch (field) {
5915
      case SUCCESS:
5916
        if (value == null) {
5917
          unsetSuccess();
5918
        } else {
5919
          setSuccess((Promotion)value);
5920
        }
5921
        break;
5922
 
5923
      case PEX:
5924
        if (value == null) {
5925
          unsetPex();
5926
        } else {
5927
          setPex((PromotionException)value);
5928
        }
5929
        break;
5930
 
5931
      }
5932
    }
5933
 
5934
    public Object getFieldValue(_Fields field) {
5935
      switch (field) {
5936
      case SUCCESS:
5937
        return getSuccess();
5938
 
5939
      case PEX:
5940
        return getPex();
5941
 
5942
      }
5943
      throw new IllegalStateException();
5944
    }
5945
 
3430 rajveer 5946
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5947
    public boolean isSet(_Fields field) {
5948
      if (field == null) {
5949
        throw new IllegalArgumentException();
5950
      }
1982 varun.gupt 5951
 
5952
      switch (field) {
5953
      case SUCCESS:
5954
        return isSetSuccess();
5955
      case PEX:
5956
        return isSetPex();
5957
      }
5958
      throw new IllegalStateException();
5959
    }
5960
 
5961
    @Override
5962
    public boolean equals(Object that) {
5963
      if (that == null)
5964
        return false;
5965
      if (that instanceof getPromotionById_result)
5966
        return this.equals((getPromotionById_result)that);
5967
      return false;
5968
    }
5969
 
5970
    public boolean equals(getPromotionById_result that) {
5971
      if (that == null)
5972
        return false;
5973
 
5974
      boolean this_present_success = true && this.isSetSuccess();
5975
      boolean that_present_success = true && that.isSetSuccess();
5976
      if (this_present_success || that_present_success) {
5977
        if (!(this_present_success && that_present_success))
5978
          return false;
5979
        if (!this.success.equals(that.success))
5980
          return false;
5981
      }
5982
 
5983
      boolean this_present_pex = true && this.isSetPex();
5984
      boolean that_present_pex = true && that.isSetPex();
5985
      if (this_present_pex || that_present_pex) {
5986
        if (!(this_present_pex && that_present_pex))
5987
          return false;
5988
        if (!this.pex.equals(that.pex))
5989
          return false;
5990
      }
5991
 
5992
      return true;
5993
    }
5994
 
5995
    @Override
5996
    public int hashCode() {
5997
      return 0;
5998
    }
5999
 
6000
    public int compareTo(getPromotionById_result other) {
6001
      if (!getClass().equals(other.getClass())) {
6002
        return getClass().getName().compareTo(other.getClass().getName());
6003
      }
6004
 
6005
      int lastComparison = 0;
6006
      getPromotionById_result typedOther = (getPromotionById_result)other;
6007
 
3430 rajveer 6008
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 6009
      if (lastComparison != 0) {
6010
        return lastComparison;
6011
      }
3430 rajveer 6012
      if (isSetSuccess()) {
6013
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
6014
        if (lastComparison != 0) {
6015
          return lastComparison;
6016
        }
1982 varun.gupt 6017
      }
3430 rajveer 6018
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 6019
      if (lastComparison != 0) {
6020
        return lastComparison;
6021
      }
3430 rajveer 6022
      if (isSetPex()) {
6023
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
6024
        if (lastComparison != 0) {
6025
          return lastComparison;
6026
        }
1982 varun.gupt 6027
      }
6028
      return 0;
6029
    }
6030
 
3430 rajveer 6031
    public _Fields fieldForId(int fieldId) {
6032
      return _Fields.findByThriftId(fieldId);
6033
    }
6034
 
6035
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6036
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6037
      iprot.readStructBegin();
6038
      while (true)
6039
      {
6040
        field = iprot.readFieldBegin();
3430 rajveer 6041
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6042
          break;
6043
        }
3430 rajveer 6044
        switch (field.id) {
6045
          case 0: // SUCCESS
6046
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6047
              this.success = new Promotion();
6048
              this.success.read(iprot);
6049
            } else { 
6050
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6051
            }
6052
            break;
6053
          case 1: // PEX
6054
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6055
              this.pex = new PromotionException();
6056
              this.pex.read(iprot);
6057
            } else { 
6058
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6059
            }
6060
            break;
6061
          default:
6062
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6063
        }
3430 rajveer 6064
        iprot.readFieldEnd();
1982 varun.gupt 6065
      }
6066
      iprot.readStructEnd();
6067
      validate();
6068
    }
6069
 
3430 rajveer 6070
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6071
      oprot.writeStructBegin(STRUCT_DESC);
6072
 
6073
      if (this.isSetSuccess()) {
6074
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
6075
        this.success.write(oprot);
6076
        oprot.writeFieldEnd();
6077
      } else if (this.isSetPex()) {
6078
        oprot.writeFieldBegin(PEX_FIELD_DESC);
6079
        this.pex.write(oprot);
6080
        oprot.writeFieldEnd();
6081
      }
6082
      oprot.writeFieldStop();
6083
      oprot.writeStructEnd();
6084
    }
6085
 
6086
    @Override
6087
    public String toString() {
6088
      StringBuilder sb = new StringBuilder("getPromotionById_result(");
6089
      boolean first = true;
6090
 
6091
      sb.append("success:");
6092
      if (this.success == null) {
6093
        sb.append("null");
6094
      } else {
6095
        sb.append(this.success);
6096
      }
6097
      first = false;
6098
      if (!first) sb.append(", ");
6099
      sb.append("pex:");
6100
      if (this.pex == null) {
6101
        sb.append("null");
6102
      } else {
6103
        sb.append(this.pex);
6104
      }
6105
      first = false;
6106
      sb.append(")");
6107
      return sb.toString();
6108
    }
6109
 
3430 rajveer 6110
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6111
      // check for required fields
6112
    }
6113
 
3430 rajveer 6114
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6115
      try {
6116
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6117
      } catch (org.apache.thrift.TException te) {
6118
        throw new java.io.IOException(te);
6119
      }
6120
    }
6121
 
6122
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6123
      try {
6124
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6125
      } catch (org.apache.thrift.TException te) {
6126
        throw new java.io.IOException(te);
6127
      }
6128
    }
6129
 
1982 varun.gupt 6130
  }
6131
 
3430 rajveer 6132
  public static class generateCouponsForPromotion_args implements org.apache.thrift.TBase<generateCouponsForPromotion_args, generateCouponsForPromotion_args._Fields>, java.io.Serializable, Cloneable   {
6133
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_args");
1982 varun.gupt 6134
 
3430 rajveer 6135
    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);
6136
    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 6137
 
3430 rajveer 6138
    private long promotionId; // required
6139
    private String couponCode; // required
1982 varun.gupt 6140
 
6141
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6142
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6143
      PROMOTION_ID((short)1, "promotionId"),
6144
      COUPON_CODE((short)2, "couponCode");
6145
 
6146
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6147
 
6148
      static {
6149
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6150
          byName.put(field.getFieldName(), field);
6151
        }
6152
      }
6153
 
6154
      /**
6155
       * Find the _Fields constant that matches fieldId, or null if its not found.
6156
       */
6157
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6158
        switch(fieldId) {
6159
          case 1: // PROMOTION_ID
6160
            return PROMOTION_ID;
6161
          case 2: // COUPON_CODE
6162
            return COUPON_CODE;
6163
          default:
6164
            return null;
6165
        }
1982 varun.gupt 6166
      }
6167
 
6168
      /**
6169
       * Find the _Fields constant that matches fieldId, throwing an exception
6170
       * if it is not found.
6171
       */
6172
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6173
        _Fields fields = findByThriftId(fieldId);
6174
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6175
        return fields;
6176
      }
6177
 
6178
      /**
6179
       * Find the _Fields constant that matches name, or null if its not found.
6180
       */
6181
      public static _Fields findByName(String name) {
6182
        return byName.get(name);
6183
      }
6184
 
6185
      private final short _thriftId;
6186
      private final String _fieldName;
6187
 
6188
      _Fields(short thriftId, String fieldName) {
6189
        _thriftId = thriftId;
6190
        _fieldName = fieldName;
6191
      }
6192
 
6193
      public short getThriftFieldId() {
6194
        return _thriftId;
6195
      }
6196
 
6197
      public String getFieldName() {
6198
        return _fieldName;
6199
      }
6200
    }
6201
 
6202
    // isset id assignments
6203
    private static final int __PROMOTIONID_ISSET_ID = 0;
6204
    private BitSet __isset_bit_vector = new BitSet(1);
6205
 
3430 rajveer 6206
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6207
    static {
3430 rajveer 6208
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6209
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6210
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6211
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6212
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6213
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6214
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_args.class, metaDataMap);
1982 varun.gupt 6215
    }
6216
 
6217
    public generateCouponsForPromotion_args() {
6218
    }
6219
 
6220
    public generateCouponsForPromotion_args(
6221
      long promotionId,
6222
      String couponCode)
6223
    {
6224
      this();
6225
      this.promotionId = promotionId;
6226
      setPromotionIdIsSet(true);
6227
      this.couponCode = couponCode;
6228
    }
6229
 
6230
    /**
6231
     * Performs a deep copy on <i>other</i>.
6232
     */
6233
    public generateCouponsForPromotion_args(generateCouponsForPromotion_args other) {
6234
      __isset_bit_vector.clear();
6235
      __isset_bit_vector.or(other.__isset_bit_vector);
6236
      this.promotionId = other.promotionId;
6237
      if (other.isSetCouponCode()) {
6238
        this.couponCode = other.couponCode;
6239
      }
6240
    }
6241
 
6242
    public generateCouponsForPromotion_args deepCopy() {
6243
      return new generateCouponsForPromotion_args(this);
6244
    }
6245
 
3430 rajveer 6246
    @Override
6247
    public void clear() {
6248
      setPromotionIdIsSet(false);
6249
      this.promotionId = 0;
6250
      this.couponCode = null;
1982 varun.gupt 6251
    }
6252
 
6253
    public long getPromotionId() {
6254
      return this.promotionId;
6255
    }
6256
 
3430 rajveer 6257
    public void setPromotionId(long promotionId) {
1982 varun.gupt 6258
      this.promotionId = promotionId;
6259
      setPromotionIdIsSet(true);
6260
    }
6261
 
6262
    public void unsetPromotionId() {
6263
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
6264
    }
6265
 
3430 rajveer 6266
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6267
    public boolean isSetPromotionId() {
6268
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
6269
    }
6270
 
6271
    public void setPromotionIdIsSet(boolean value) {
6272
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
6273
    }
6274
 
6275
    public String getCouponCode() {
6276
      return this.couponCode;
6277
    }
6278
 
3430 rajveer 6279
    public void setCouponCode(String couponCode) {
1982 varun.gupt 6280
      this.couponCode = couponCode;
6281
    }
6282
 
6283
    public void unsetCouponCode() {
6284
      this.couponCode = null;
6285
    }
6286
 
3430 rajveer 6287
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6288
    public boolean isSetCouponCode() {
6289
      return this.couponCode != null;
6290
    }
6291
 
6292
    public void setCouponCodeIsSet(boolean value) {
6293
      if (!value) {
6294
        this.couponCode = null;
6295
      }
6296
    }
6297
 
6298
    public void setFieldValue(_Fields field, Object value) {
6299
      switch (field) {
6300
      case PROMOTION_ID:
6301
        if (value == null) {
6302
          unsetPromotionId();
6303
        } else {
6304
          setPromotionId((Long)value);
6305
        }
6306
        break;
6307
 
6308
      case COUPON_CODE:
6309
        if (value == null) {
6310
          unsetCouponCode();
6311
        } else {
6312
          setCouponCode((String)value);
6313
        }
6314
        break;
6315
 
6316
      }
6317
    }
6318
 
6319
    public Object getFieldValue(_Fields field) {
6320
      switch (field) {
6321
      case PROMOTION_ID:
3430 rajveer 6322
        return Long.valueOf(getPromotionId());
1982 varun.gupt 6323
 
6324
      case COUPON_CODE:
6325
        return getCouponCode();
6326
 
6327
      }
6328
      throw new IllegalStateException();
6329
    }
6330
 
3430 rajveer 6331
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6332
    public boolean isSet(_Fields field) {
6333
      if (field == null) {
6334
        throw new IllegalArgumentException();
6335
      }
1982 varun.gupt 6336
 
6337
      switch (field) {
6338
      case PROMOTION_ID:
6339
        return isSetPromotionId();
6340
      case COUPON_CODE:
6341
        return isSetCouponCode();
6342
      }
6343
      throw new IllegalStateException();
6344
    }
6345
 
6346
    @Override
6347
    public boolean equals(Object that) {
6348
      if (that == null)
6349
        return false;
6350
      if (that instanceof generateCouponsForPromotion_args)
6351
        return this.equals((generateCouponsForPromotion_args)that);
6352
      return false;
6353
    }
6354
 
6355
    public boolean equals(generateCouponsForPromotion_args that) {
6356
      if (that == null)
6357
        return false;
6358
 
6359
      boolean this_present_promotionId = true;
6360
      boolean that_present_promotionId = true;
6361
      if (this_present_promotionId || that_present_promotionId) {
6362
        if (!(this_present_promotionId && that_present_promotionId))
6363
          return false;
6364
        if (this.promotionId != that.promotionId)
6365
          return false;
6366
      }
6367
 
6368
      boolean this_present_couponCode = true && this.isSetCouponCode();
6369
      boolean that_present_couponCode = true && that.isSetCouponCode();
6370
      if (this_present_couponCode || that_present_couponCode) {
6371
        if (!(this_present_couponCode && that_present_couponCode))
6372
          return false;
6373
        if (!this.couponCode.equals(that.couponCode))
6374
          return false;
6375
      }
6376
 
6377
      return true;
6378
    }
6379
 
6380
    @Override
6381
    public int hashCode() {
6382
      return 0;
6383
    }
6384
 
6385
    public int compareTo(generateCouponsForPromotion_args other) {
6386
      if (!getClass().equals(other.getClass())) {
6387
        return getClass().getName().compareTo(other.getClass().getName());
6388
      }
6389
 
6390
      int lastComparison = 0;
6391
      generateCouponsForPromotion_args typedOther = (generateCouponsForPromotion_args)other;
6392
 
3430 rajveer 6393
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 6394
      if (lastComparison != 0) {
6395
        return lastComparison;
6396
      }
3430 rajveer 6397
      if (isSetPromotionId()) {
6398
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
6399
        if (lastComparison != 0) {
6400
          return lastComparison;
6401
        }
1982 varun.gupt 6402
      }
3430 rajveer 6403
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 6404
      if (lastComparison != 0) {
6405
        return lastComparison;
6406
      }
3430 rajveer 6407
      if (isSetCouponCode()) {
6408
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
6409
        if (lastComparison != 0) {
6410
          return lastComparison;
6411
        }
1982 varun.gupt 6412
      }
6413
      return 0;
6414
    }
6415
 
3430 rajveer 6416
    public _Fields fieldForId(int fieldId) {
6417
      return _Fields.findByThriftId(fieldId);
6418
    }
6419
 
6420
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6421
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6422
      iprot.readStructBegin();
6423
      while (true)
6424
      {
6425
        field = iprot.readFieldBegin();
3430 rajveer 6426
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6427
          break;
6428
        }
3430 rajveer 6429
        switch (field.id) {
6430
          case 1: // PROMOTION_ID
6431
            if (field.type == org.apache.thrift.protocol.TType.I64) {
6432
              this.promotionId = iprot.readI64();
6433
              setPromotionIdIsSet(true);
6434
            } else { 
6435
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6436
            }
6437
            break;
6438
          case 2: // COUPON_CODE
6439
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
6440
              this.couponCode = iprot.readString();
6441
            } else { 
6442
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6443
            }
6444
            break;
6445
          default:
6446
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6447
        }
3430 rajveer 6448
        iprot.readFieldEnd();
1982 varun.gupt 6449
      }
6450
      iprot.readStructEnd();
6451
      validate();
6452
    }
6453
 
3430 rajveer 6454
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6455
      validate();
6456
 
6457
      oprot.writeStructBegin(STRUCT_DESC);
6458
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
6459
      oprot.writeI64(this.promotionId);
6460
      oprot.writeFieldEnd();
6461
      if (this.couponCode != null) {
6462
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
6463
        oprot.writeString(this.couponCode);
6464
        oprot.writeFieldEnd();
6465
      }
6466
      oprot.writeFieldStop();
6467
      oprot.writeStructEnd();
6468
    }
6469
 
6470
    @Override
6471
    public String toString() {
6472
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_args(");
6473
      boolean first = true;
6474
 
6475
      sb.append("promotionId:");
6476
      sb.append(this.promotionId);
6477
      first = false;
6478
      if (!first) sb.append(", ");
6479
      sb.append("couponCode:");
6480
      if (this.couponCode == null) {
6481
        sb.append("null");
6482
      } else {
6483
        sb.append(this.couponCode);
6484
      }
6485
      first = false;
6486
      sb.append(")");
6487
      return sb.toString();
6488
    }
6489
 
3430 rajveer 6490
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6491
      // check for required fields
6492
    }
6493
 
3430 rajveer 6494
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6495
      try {
6496
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6497
      } catch (org.apache.thrift.TException te) {
6498
        throw new java.io.IOException(te);
6499
      }
6500
    }
6501
 
6502
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6503
      try {
6504
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
6505
        __isset_bit_vector = new BitSet(1);
6506
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6507
      } catch (org.apache.thrift.TException te) {
6508
        throw new java.io.IOException(te);
6509
      }
6510
    }
6511
 
1982 varun.gupt 6512
  }
6513
 
3430 rajveer 6514
  public static class generateCouponsForPromotion_result implements org.apache.thrift.TBase<generateCouponsForPromotion_result, generateCouponsForPromotion_result._Fields>, java.io.Serializable, Cloneable   {
6515
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_result");
1982 varun.gupt 6516
 
3430 rajveer 6517
    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 6518
 
3430 rajveer 6519
    private PromotionException pex; // required
1982 varun.gupt 6520
 
6521
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6522
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6523
      PEX((short)1, "pex");
6524
 
6525
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6526
 
6527
      static {
6528
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6529
          byName.put(field.getFieldName(), field);
6530
        }
6531
      }
6532
 
6533
      /**
6534
       * Find the _Fields constant that matches fieldId, or null if its not found.
6535
       */
6536
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6537
        switch(fieldId) {
6538
          case 1: // PEX
6539
            return PEX;
6540
          default:
6541
            return null;
6542
        }
1982 varun.gupt 6543
      }
6544
 
6545
      /**
6546
       * Find the _Fields constant that matches fieldId, throwing an exception
6547
       * if it is not found.
6548
       */
6549
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6550
        _Fields fields = findByThriftId(fieldId);
6551
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6552
        return fields;
6553
      }
6554
 
6555
      /**
6556
       * Find the _Fields constant that matches name, or null if its not found.
6557
       */
6558
      public static _Fields findByName(String name) {
6559
        return byName.get(name);
6560
      }
6561
 
6562
      private final short _thriftId;
6563
      private final String _fieldName;
6564
 
6565
      _Fields(short thriftId, String fieldName) {
6566
        _thriftId = thriftId;
6567
        _fieldName = fieldName;
6568
      }
6569
 
6570
      public short getThriftFieldId() {
6571
        return _thriftId;
6572
      }
6573
 
6574
      public String getFieldName() {
6575
        return _fieldName;
6576
      }
6577
    }
6578
 
6579
    // isset id assignments
6580
 
3430 rajveer 6581
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6582
    static {
3430 rajveer 6583
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6584
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6585
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
6586
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6587
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_result.class, metaDataMap);
1982 varun.gupt 6588
    }
6589
 
6590
    public generateCouponsForPromotion_result() {
6591
    }
6592
 
6593
    public generateCouponsForPromotion_result(
6594
      PromotionException pex)
6595
    {
6596
      this();
6597
      this.pex = pex;
6598
    }
6599
 
6600
    /**
6601
     * Performs a deep copy on <i>other</i>.
6602
     */
6603
    public generateCouponsForPromotion_result(generateCouponsForPromotion_result other) {
6604
      if (other.isSetPex()) {
6605
        this.pex = new PromotionException(other.pex);
6606
      }
6607
    }
6608
 
6609
    public generateCouponsForPromotion_result deepCopy() {
6610
      return new generateCouponsForPromotion_result(this);
6611
    }
6612
 
3430 rajveer 6613
    @Override
6614
    public void clear() {
6615
      this.pex = null;
1982 varun.gupt 6616
    }
6617
 
6618
    public PromotionException getPex() {
6619
      return this.pex;
6620
    }
6621
 
3430 rajveer 6622
    public void setPex(PromotionException pex) {
1982 varun.gupt 6623
      this.pex = pex;
6624
    }
6625
 
6626
    public void unsetPex() {
6627
      this.pex = null;
6628
    }
6629
 
3430 rajveer 6630
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6631
    public boolean isSetPex() {
6632
      return this.pex != null;
6633
    }
6634
 
6635
    public void setPexIsSet(boolean value) {
6636
      if (!value) {
6637
        this.pex = null;
6638
      }
6639
    }
6640
 
6641
    public void setFieldValue(_Fields field, Object value) {
6642
      switch (field) {
6643
      case PEX:
6644
        if (value == null) {
6645
          unsetPex();
6646
        } else {
6647
          setPex((PromotionException)value);
6648
        }
6649
        break;
6650
 
6651
      }
6652
    }
6653
 
6654
    public Object getFieldValue(_Fields field) {
6655
      switch (field) {
6656
      case PEX:
6657
        return getPex();
6658
 
6659
      }
6660
      throw new IllegalStateException();
6661
    }
6662
 
3430 rajveer 6663
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6664
    public boolean isSet(_Fields field) {
6665
      if (field == null) {
6666
        throw new IllegalArgumentException();
6667
      }
1982 varun.gupt 6668
 
6669
      switch (field) {
6670
      case PEX:
6671
        return isSetPex();
6672
      }
6673
      throw new IllegalStateException();
6674
    }
6675
 
6676
    @Override
6677
    public boolean equals(Object that) {
6678
      if (that == null)
6679
        return false;
6680
      if (that instanceof generateCouponsForPromotion_result)
6681
        return this.equals((generateCouponsForPromotion_result)that);
6682
      return false;
6683
    }
6684
 
6685
    public boolean equals(generateCouponsForPromotion_result that) {
6686
      if (that == null)
6687
        return false;
6688
 
6689
      boolean this_present_pex = true && this.isSetPex();
6690
      boolean that_present_pex = true && that.isSetPex();
6691
      if (this_present_pex || that_present_pex) {
6692
        if (!(this_present_pex && that_present_pex))
6693
          return false;
6694
        if (!this.pex.equals(that.pex))
6695
          return false;
6696
      }
6697
 
6698
      return true;
6699
    }
6700
 
6701
    @Override
6702
    public int hashCode() {
6703
      return 0;
6704
    }
6705
 
6706
    public int compareTo(generateCouponsForPromotion_result other) {
6707
      if (!getClass().equals(other.getClass())) {
6708
        return getClass().getName().compareTo(other.getClass().getName());
6709
      }
6710
 
6711
      int lastComparison = 0;
6712
      generateCouponsForPromotion_result typedOther = (generateCouponsForPromotion_result)other;
6713
 
3430 rajveer 6714
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 6715
      if (lastComparison != 0) {
6716
        return lastComparison;
6717
      }
3430 rajveer 6718
      if (isSetPex()) {
6719
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
6720
        if (lastComparison != 0) {
6721
          return lastComparison;
6722
        }
1982 varun.gupt 6723
      }
6724
      return 0;
6725
    }
6726
 
3430 rajveer 6727
    public _Fields fieldForId(int fieldId) {
6728
      return _Fields.findByThriftId(fieldId);
6729
    }
6730
 
6731
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6732
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6733
      iprot.readStructBegin();
6734
      while (true)
6735
      {
6736
        field = iprot.readFieldBegin();
3430 rajveer 6737
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6738
          break;
6739
        }
3430 rajveer 6740
        switch (field.id) {
6741
          case 1: // PEX
6742
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6743
              this.pex = new PromotionException();
6744
              this.pex.read(iprot);
6745
            } else { 
6746
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6747
            }
6748
            break;
6749
          default:
6750
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6751
        }
3430 rajveer 6752
        iprot.readFieldEnd();
1982 varun.gupt 6753
      }
6754
      iprot.readStructEnd();
6755
      validate();
6756
    }
6757
 
3430 rajveer 6758
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6759
      oprot.writeStructBegin(STRUCT_DESC);
6760
 
6761
      if (this.isSetPex()) {
6762
        oprot.writeFieldBegin(PEX_FIELD_DESC);
6763
        this.pex.write(oprot);
6764
        oprot.writeFieldEnd();
6765
      }
6766
      oprot.writeFieldStop();
6767
      oprot.writeStructEnd();
6768
    }
6769
 
6770
    @Override
6771
    public String toString() {
6772
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_result(");
6773
      boolean first = true;
6774
 
6775
      sb.append("pex:");
6776
      if (this.pex == null) {
6777
        sb.append("null");
6778
      } else {
6779
        sb.append(this.pex);
6780
      }
6781
      first = false;
6782
      sb.append(")");
6783
      return sb.toString();
6784
    }
6785
 
3430 rajveer 6786
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6787
      // check for required fields
6788
    }
6789
 
3430 rajveer 6790
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6791
      try {
6792
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6793
      } catch (org.apache.thrift.TException te) {
6794
        throw new java.io.IOException(te);
6795
      }
6796
    }
6797
 
6798
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6799
      try {
6800
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6801
      } catch (org.apache.thrift.TException te) {
6802
        throw new java.io.IOException(te);
6803
      }
6804
    }
6805
 
1982 varun.gupt 6806
  }
6807
 
3430 rajveer 6808
  public static class applyCoupon_args implements org.apache.thrift.TBase<applyCoupon_args, applyCoupon_args._Fields>, java.io.Serializable, Cloneable   {
6809
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_args");
1982 varun.gupt 6810
 
3430 rajveer 6811
    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);
6812
    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 6813
 
3430 rajveer 6814
    private String couponCode; // required
6815
    private long cartId; // required
1982 varun.gupt 6816
 
6817
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6818
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6819
      COUPON_CODE((short)1, "couponCode"),
6820
      CART_ID((short)2, "cartId");
6821
 
6822
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6823
 
6824
      static {
6825
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6826
          byName.put(field.getFieldName(), field);
6827
        }
6828
      }
6829
 
6830
      /**
6831
       * Find the _Fields constant that matches fieldId, or null if its not found.
6832
       */
6833
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6834
        switch(fieldId) {
6835
          case 1: // COUPON_CODE
6836
            return COUPON_CODE;
6837
          case 2: // CART_ID
6838
            return CART_ID;
6839
          default:
6840
            return null;
6841
        }
1982 varun.gupt 6842
      }
6843
 
6844
      /**
6845
       * Find the _Fields constant that matches fieldId, throwing an exception
6846
       * if it is not found.
6847
       */
6848
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6849
        _Fields fields = findByThriftId(fieldId);
6850
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6851
        return fields;
6852
      }
6853
 
6854
      /**
6855
       * Find the _Fields constant that matches name, or null if its not found.
6856
       */
6857
      public static _Fields findByName(String name) {
6858
        return byName.get(name);
6859
      }
6860
 
6861
      private final short _thriftId;
6862
      private final String _fieldName;
6863
 
6864
      _Fields(short thriftId, String fieldName) {
6865
        _thriftId = thriftId;
6866
        _fieldName = fieldName;
6867
      }
6868
 
6869
      public short getThriftFieldId() {
6870
        return _thriftId;
6871
      }
6872
 
6873
      public String getFieldName() {
6874
        return _fieldName;
6875
      }
6876
    }
6877
 
6878
    // isset id assignments
6879
    private static final int __CARTID_ISSET_ID = 0;
6880
    private BitSet __isset_bit_vector = new BitSet(1);
6881
 
3430 rajveer 6882
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6883
    static {
3430 rajveer 6884
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6885
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6886
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6887
      tmpMap.put(_Fields.CART_ID, new org.apache.thrift.meta_data.FieldMetaData("cartId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6888
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6889
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6890
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_args.class, metaDataMap);
1982 varun.gupt 6891
    }
6892
 
6893
    public applyCoupon_args() {
6894
    }
6895
 
6896
    public applyCoupon_args(
6897
      String couponCode,
6898
      long cartId)
6899
    {
6900
      this();
6901
      this.couponCode = couponCode;
6902
      this.cartId = cartId;
6903
      setCartIdIsSet(true);
6904
    }
6905
 
6906
    /**
6907
     * Performs a deep copy on <i>other</i>.
6908
     */
6909
    public applyCoupon_args(applyCoupon_args other) {
6910
      __isset_bit_vector.clear();
6911
      __isset_bit_vector.or(other.__isset_bit_vector);
6912
      if (other.isSetCouponCode()) {
6913
        this.couponCode = other.couponCode;
6914
      }
6915
      this.cartId = other.cartId;
6916
    }
6917
 
6918
    public applyCoupon_args deepCopy() {
6919
      return new applyCoupon_args(this);
6920
    }
6921
 
3430 rajveer 6922
    @Override
6923
    public void clear() {
6924
      this.couponCode = null;
6925
      setCartIdIsSet(false);
6926
      this.cartId = 0;
1982 varun.gupt 6927
    }
6928
 
6929
    public String getCouponCode() {
6930
      return this.couponCode;
6931
    }
6932
 
3430 rajveer 6933
    public void setCouponCode(String couponCode) {
1982 varun.gupt 6934
      this.couponCode = couponCode;
6935
    }
6936
 
6937
    public void unsetCouponCode() {
6938
      this.couponCode = null;
6939
    }
6940
 
3430 rajveer 6941
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6942
    public boolean isSetCouponCode() {
6943
      return this.couponCode != null;
6944
    }
6945
 
6946
    public void setCouponCodeIsSet(boolean value) {
6947
      if (!value) {
6948
        this.couponCode = null;
6949
      }
6950
    }
6951
 
6952
    public long getCartId() {
6953
      return this.cartId;
6954
    }
6955
 
3430 rajveer 6956
    public void setCartId(long cartId) {
1982 varun.gupt 6957
      this.cartId = cartId;
6958
      setCartIdIsSet(true);
6959
    }
6960
 
6961
    public void unsetCartId() {
6962
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
6963
    }
6964
 
3430 rajveer 6965
    /** Returns true if field cartId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6966
    public boolean isSetCartId() {
6967
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
6968
    }
6969
 
6970
    public void setCartIdIsSet(boolean value) {
6971
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
6972
    }
6973
 
6974
    public void setFieldValue(_Fields field, Object value) {
6975
      switch (field) {
6976
      case COUPON_CODE:
6977
        if (value == null) {
6978
          unsetCouponCode();
6979
        } else {
6980
          setCouponCode((String)value);
6981
        }
6982
        break;
6983
 
6984
      case CART_ID:
6985
        if (value == null) {
6986
          unsetCartId();
6987
        } else {
6988
          setCartId((Long)value);
6989
        }
6990
        break;
6991
 
6992
      }
6993
    }
6994
 
6995
    public Object getFieldValue(_Fields field) {
6996
      switch (field) {
6997
      case COUPON_CODE:
6998
        return getCouponCode();
6999
 
7000
      case CART_ID:
3430 rajveer 7001
        return Long.valueOf(getCartId());
1982 varun.gupt 7002
 
7003
      }
7004
      throw new IllegalStateException();
7005
    }
7006
 
3430 rajveer 7007
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7008
    public boolean isSet(_Fields field) {
7009
      if (field == null) {
7010
        throw new IllegalArgumentException();
7011
      }
1982 varun.gupt 7012
 
7013
      switch (field) {
7014
      case COUPON_CODE:
7015
        return isSetCouponCode();
7016
      case CART_ID:
7017
        return isSetCartId();
7018
      }
7019
      throw new IllegalStateException();
7020
    }
7021
 
7022
    @Override
7023
    public boolean equals(Object that) {
7024
      if (that == null)
7025
        return false;
7026
      if (that instanceof applyCoupon_args)
7027
        return this.equals((applyCoupon_args)that);
7028
      return false;
7029
    }
7030
 
7031
    public boolean equals(applyCoupon_args that) {
7032
      if (that == null)
7033
        return false;
7034
 
7035
      boolean this_present_couponCode = true && this.isSetCouponCode();
7036
      boolean that_present_couponCode = true && that.isSetCouponCode();
7037
      if (this_present_couponCode || that_present_couponCode) {
7038
        if (!(this_present_couponCode && that_present_couponCode))
7039
          return false;
7040
        if (!this.couponCode.equals(that.couponCode))
7041
          return false;
7042
      }
7043
 
7044
      boolean this_present_cartId = true;
7045
      boolean that_present_cartId = true;
7046
      if (this_present_cartId || that_present_cartId) {
7047
        if (!(this_present_cartId && that_present_cartId))
7048
          return false;
7049
        if (this.cartId != that.cartId)
7050
          return false;
7051
      }
7052
 
7053
      return true;
7054
    }
7055
 
7056
    @Override
7057
    public int hashCode() {
7058
      return 0;
7059
    }
7060
 
7061
    public int compareTo(applyCoupon_args other) {
7062
      if (!getClass().equals(other.getClass())) {
7063
        return getClass().getName().compareTo(other.getClass().getName());
7064
      }
7065
 
7066
      int lastComparison = 0;
7067
      applyCoupon_args typedOther = (applyCoupon_args)other;
7068
 
3430 rajveer 7069
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 7070
      if (lastComparison != 0) {
7071
        return lastComparison;
7072
      }
3430 rajveer 7073
      if (isSetCouponCode()) {
7074
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
7075
        if (lastComparison != 0) {
7076
          return lastComparison;
7077
        }
1982 varun.gupt 7078
      }
3430 rajveer 7079
      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(typedOther.isSetCartId());
1982 varun.gupt 7080
      if (lastComparison != 0) {
7081
        return lastComparison;
7082
      }
3430 rajveer 7083
      if (isSetCartId()) {
7084
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cartId, typedOther.cartId);
7085
        if (lastComparison != 0) {
7086
          return lastComparison;
7087
        }
1982 varun.gupt 7088
      }
7089
      return 0;
7090
    }
7091
 
3430 rajveer 7092
    public _Fields fieldForId(int fieldId) {
7093
      return _Fields.findByThriftId(fieldId);
7094
    }
7095
 
7096
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7097
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 7098
      iprot.readStructBegin();
7099
      while (true)
7100
      {
7101
        field = iprot.readFieldBegin();
3430 rajveer 7102
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 7103
          break;
7104
        }
3430 rajveer 7105
        switch (field.id) {
7106
          case 1: // COUPON_CODE
7107
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
7108
              this.couponCode = iprot.readString();
7109
            } else { 
7110
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7111
            }
7112
            break;
7113
          case 2: // CART_ID
7114
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7115
              this.cartId = iprot.readI64();
7116
              setCartIdIsSet(true);
7117
            } else { 
7118
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7119
            }
7120
            break;
7121
          default:
7122
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 7123
        }
3430 rajveer 7124
        iprot.readFieldEnd();
1982 varun.gupt 7125
      }
7126
      iprot.readStructEnd();
7127
      validate();
7128
    }
7129
 
3430 rajveer 7130
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 7131
      validate();
7132
 
7133
      oprot.writeStructBegin(STRUCT_DESC);
7134
      if (this.couponCode != null) {
7135
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
7136
        oprot.writeString(this.couponCode);
7137
        oprot.writeFieldEnd();
7138
      }
7139
      oprot.writeFieldBegin(CART_ID_FIELD_DESC);
7140
      oprot.writeI64(this.cartId);
7141
      oprot.writeFieldEnd();
7142
      oprot.writeFieldStop();
7143
      oprot.writeStructEnd();
7144
    }
7145
 
7146
    @Override
7147
    public String toString() {
7148
      StringBuilder sb = new StringBuilder("applyCoupon_args(");
7149
      boolean first = true;
7150
 
7151
      sb.append("couponCode:");
7152
      if (this.couponCode == null) {
7153
        sb.append("null");
7154
      } else {
7155
        sb.append(this.couponCode);
7156
      }
7157
      first = false;
7158
      if (!first) sb.append(", ");
7159
      sb.append("cartId:");
7160
      sb.append(this.cartId);
7161
      first = false;
7162
      sb.append(")");
7163
      return sb.toString();
7164
    }
7165
 
3430 rajveer 7166
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7167
      // check for required fields
7168
    }
7169
 
3430 rajveer 7170
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7171
      try {
7172
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7173
      } catch (org.apache.thrift.TException te) {
7174
        throw new java.io.IOException(te);
7175
      }
7176
    }
7177
 
7178
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7179
      try {
7180
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
7181
        __isset_bit_vector = new BitSet(1);
7182
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7183
      } catch (org.apache.thrift.TException te) {
7184
        throw new java.io.IOException(te);
7185
      }
7186
    }
7187
 
1982 varun.gupt 7188
  }
7189
 
3430 rajveer 7190
  public static class applyCoupon_result implements org.apache.thrift.TBase<applyCoupon_result, applyCoupon_result._Fields>, java.io.Serializable, Cloneable   {
7191
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_result");
1982 varun.gupt 7192
 
3430 rajveer 7193
    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);
7194
    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 7195
 
3430 rajveer 7196
    private Cart success; // required
7197
    private PromotionException pex; // required
1982 varun.gupt 7198
 
7199
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7200
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 7201
      SUCCESS((short)0, "success"),
7202
      PEX((short)1, "pex");
7203
 
7204
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7205
 
7206
      static {
7207
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7208
          byName.put(field.getFieldName(), field);
7209
        }
7210
      }
7211
 
7212
      /**
7213
       * Find the _Fields constant that matches fieldId, or null if its not found.
7214
       */
7215
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7216
        switch(fieldId) {
7217
          case 0: // SUCCESS
7218
            return SUCCESS;
7219
          case 1: // PEX
7220
            return PEX;
7221
          default:
7222
            return null;
7223
        }
1982 varun.gupt 7224
      }
7225
 
7226
      /**
7227
       * Find the _Fields constant that matches fieldId, throwing an exception
7228
       * if it is not found.
7229
       */
7230
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7231
        _Fields fields = findByThriftId(fieldId);
7232
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7233
        return fields;
7234
      }
7235
 
7236
      /**
7237
       * Find the _Fields constant that matches name, or null if its not found.
7238
       */
7239
      public static _Fields findByName(String name) {
7240
        return byName.get(name);
7241
      }
7242
 
7243
      private final short _thriftId;
7244
      private final String _fieldName;
7245
 
7246
      _Fields(short thriftId, String fieldName) {
7247
        _thriftId = thriftId;
7248
        _fieldName = fieldName;
7249
      }
7250
 
7251
      public short getThriftFieldId() {
7252
        return _thriftId;
7253
      }
7254
 
7255
      public String getFieldName() {
7256
        return _fieldName;
7257
      }
7258
    }
7259
 
7260
    // isset id assignments
7261
 
3430 rajveer 7262
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 7263
    static {
3430 rajveer 7264
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7265
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7266
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Cart.class)));
7267
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7268
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
7269
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7270
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_result.class, metaDataMap);
1982 varun.gupt 7271
    }
7272
 
7273
    public applyCoupon_result() {
7274
    }
7275
 
7276
    public applyCoupon_result(
7277
      Cart success,
7278
      PromotionException pex)
7279
    {
7280
      this();
7281
      this.success = success;
7282
      this.pex = pex;
7283
    }
7284
 
7285
    /**
7286
     * Performs a deep copy on <i>other</i>.
7287
     */
7288
    public applyCoupon_result(applyCoupon_result other) {
7289
      if (other.isSetSuccess()) {
7290
        this.success = new Cart(other.success);
7291
      }
7292
      if (other.isSetPex()) {
7293
        this.pex = new PromotionException(other.pex);
7294
      }
7295
    }
7296
 
7297
    public applyCoupon_result deepCopy() {
7298
      return new applyCoupon_result(this);
7299
    }
7300
 
3430 rajveer 7301
    @Override
7302
    public void clear() {
7303
      this.success = null;
7304
      this.pex = null;
1982 varun.gupt 7305
    }
7306
 
7307
    public Cart getSuccess() {
7308
      return this.success;
7309
    }
7310
 
3430 rajveer 7311
    public void setSuccess(Cart success) {
1982 varun.gupt 7312
      this.success = success;
7313
    }
7314
 
7315
    public void unsetSuccess() {
7316
      this.success = null;
7317
    }
7318
 
3430 rajveer 7319
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7320
    public boolean isSetSuccess() {
7321
      return this.success != null;
7322
    }
7323
 
7324
    public void setSuccessIsSet(boolean value) {
7325
      if (!value) {
7326
        this.success = null;
7327
      }
7328
    }
7329
 
7330
    public PromotionException getPex() {
7331
      return this.pex;
7332
    }
7333
 
3430 rajveer 7334
    public void setPex(PromotionException pex) {
1982 varun.gupt 7335
      this.pex = pex;
7336
    }
7337
 
7338
    public void unsetPex() {
7339
      this.pex = null;
7340
    }
7341
 
3430 rajveer 7342
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7343
    public boolean isSetPex() {
7344
      return this.pex != null;
7345
    }
7346
 
7347
    public void setPexIsSet(boolean value) {
7348
      if (!value) {
7349
        this.pex = null;
7350
      }
7351
    }
7352
 
7353
    public void setFieldValue(_Fields field, Object value) {
7354
      switch (field) {
7355
      case SUCCESS:
7356
        if (value == null) {
7357
          unsetSuccess();
7358
        } else {
7359
          setSuccess((Cart)value);
7360
        }
7361
        break;
7362
 
7363
      case PEX:
7364
        if (value == null) {
7365
          unsetPex();
7366
        } else {
7367
          setPex((PromotionException)value);
7368
        }
7369
        break;
7370
 
7371
      }
7372
    }
7373
 
7374
    public Object getFieldValue(_Fields field) {
7375
      switch (field) {
7376
      case SUCCESS:
7377
        return getSuccess();
7378
 
7379
      case PEX:
7380
        return getPex();
7381
 
7382
      }
7383
      throw new IllegalStateException();
7384
    }
7385
 
3430 rajveer 7386
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7387
    public boolean isSet(_Fields field) {
7388
      if (field == null) {
7389
        throw new IllegalArgumentException();
7390
      }
1982 varun.gupt 7391
 
7392
      switch (field) {
7393
      case SUCCESS:
7394
        return isSetSuccess();
7395
      case PEX:
7396
        return isSetPex();
7397
      }
7398
      throw new IllegalStateException();
7399
    }
7400
 
7401
    @Override
7402
    public boolean equals(Object that) {
7403
      if (that == null)
7404
        return false;
7405
      if (that instanceof applyCoupon_result)
7406
        return this.equals((applyCoupon_result)that);
7407
      return false;
7408
    }
7409
 
7410
    public boolean equals(applyCoupon_result that) {
7411
      if (that == null)
7412
        return false;
7413
 
7414
      boolean this_present_success = true && this.isSetSuccess();
7415
      boolean that_present_success = true && that.isSetSuccess();
7416
      if (this_present_success || that_present_success) {
7417
        if (!(this_present_success && that_present_success))
7418
          return false;
7419
        if (!this.success.equals(that.success))
7420
          return false;
7421
      }
7422
 
7423
      boolean this_present_pex = true && this.isSetPex();
7424
      boolean that_present_pex = true && that.isSetPex();
7425
      if (this_present_pex || that_present_pex) {
7426
        if (!(this_present_pex && that_present_pex))
7427
          return false;
7428
        if (!this.pex.equals(that.pex))
7429
          return false;
7430
      }
7431
 
7432
      return true;
7433
    }
7434
 
7435
    @Override
7436
    public int hashCode() {
7437
      return 0;
7438
    }
7439
 
7440
    public int compareTo(applyCoupon_result other) {
7441
      if (!getClass().equals(other.getClass())) {
7442
        return getClass().getName().compareTo(other.getClass().getName());
7443
      }
7444
 
7445
      int lastComparison = 0;
7446
      applyCoupon_result typedOther = (applyCoupon_result)other;
7447
 
3430 rajveer 7448
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 7449
      if (lastComparison != 0) {
7450
        return lastComparison;
7451
      }
3430 rajveer 7452
      if (isSetSuccess()) {
7453
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
7454
        if (lastComparison != 0) {
7455
          return lastComparison;
7456
        }
1982 varun.gupt 7457
      }
3430 rajveer 7458
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 7459
      if (lastComparison != 0) {
7460
        return lastComparison;
7461
      }
3430 rajveer 7462
      if (isSetPex()) {
7463
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
7464
        if (lastComparison != 0) {
7465
          return lastComparison;
7466
        }
1982 varun.gupt 7467
      }
7468
      return 0;
7469
    }
7470
 
3430 rajveer 7471
    public _Fields fieldForId(int fieldId) {
7472
      return _Fields.findByThriftId(fieldId);
7473
    }
7474
 
7475
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7476
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 7477
      iprot.readStructBegin();
7478
      while (true)
7479
      {
7480
        field = iprot.readFieldBegin();
3430 rajveer 7481
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 7482
          break;
7483
        }
3430 rajveer 7484
        switch (field.id) {
7485
          case 0: // SUCCESS
7486
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
7487
              this.success = new Cart();
7488
              this.success.read(iprot);
7489
            } else { 
7490
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7491
            }
7492
            break;
7493
          case 1: // PEX
7494
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
7495
              this.pex = new PromotionException();
7496
              this.pex.read(iprot);
7497
            } else { 
7498
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7499
            }
7500
            break;
7501
          default:
7502
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 7503
        }
3430 rajveer 7504
        iprot.readFieldEnd();
1982 varun.gupt 7505
      }
7506
      iprot.readStructEnd();
7507
      validate();
7508
    }
7509
 
3430 rajveer 7510
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 7511
      oprot.writeStructBegin(STRUCT_DESC);
7512
 
7513
      if (this.isSetSuccess()) {
7514
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
7515
        this.success.write(oprot);
7516
        oprot.writeFieldEnd();
7517
      } else if (this.isSetPex()) {
7518
        oprot.writeFieldBegin(PEX_FIELD_DESC);
7519
        this.pex.write(oprot);
7520
        oprot.writeFieldEnd();
7521
      }
7522
      oprot.writeFieldStop();
7523
      oprot.writeStructEnd();
7524
    }
7525
 
7526
    @Override
7527
    public String toString() {
7528
      StringBuilder sb = new StringBuilder("applyCoupon_result(");
7529
      boolean first = true;
7530
 
7531
      sb.append("success:");
7532
      if (this.success == null) {
7533
        sb.append("null");
7534
      } else {
7535
        sb.append(this.success);
7536
      }
7537
      first = false;
7538
      if (!first) sb.append(", ");
7539
      sb.append("pex:");
7540
      if (this.pex == null) {
7541
        sb.append("null");
7542
      } else {
7543
        sb.append(this.pex);
7544
      }
7545
      first = false;
7546
      sb.append(")");
7547
      return sb.toString();
7548
    }
7549
 
3430 rajveer 7550
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7551
      // check for required fields
7552
    }
7553
 
3430 rajveer 7554
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7555
      try {
7556
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7557
      } catch (org.apache.thrift.TException te) {
7558
        throw new java.io.IOException(te);
7559
      }
7560
    }
7561
 
7562
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7563
      try {
7564
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7565
      } catch (org.apache.thrift.TException te) {
7566
        throw new java.io.IOException(te);
7567
      }
7568
    }
7569
 
1982 varun.gupt 7570
  }
7571
 
6433 anupam.sin 7572
  public static class applyRechargeCoupon_args implements org.apache.thrift.TBase<applyRechargeCoupon_args, applyRechargeCoupon_args._Fields>, java.io.Serializable, Cloneable   {
7573
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyRechargeCoupon_args");
7574
 
7575
    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);
7576
    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);
7577
    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);
7578
 
7579
    private String couponCode; // required
7580
    private long totalAmount; // required
7581
    private long userId; // required
7582
 
7583
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
7584
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
7585
      COUPON_CODE((short)1, "couponCode"),
7586
      TOTAL_AMOUNT((short)2, "totalAmount"),
7587
      USER_ID((short)3, "userId");
7588
 
7589
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7590
 
7591
      static {
7592
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7593
          byName.put(field.getFieldName(), field);
7594
        }
7595
      }
7596
 
7597
      /**
7598
       * Find the _Fields constant that matches fieldId, or null if its not found.
7599
       */
7600
      public static _Fields findByThriftId(int fieldId) {
7601
        switch(fieldId) {
7602
          case 1: // COUPON_CODE
7603
            return COUPON_CODE;
7604
          case 2: // TOTAL_AMOUNT
7605
            return TOTAL_AMOUNT;
7606
          case 3: // USER_ID
7607
            return USER_ID;
7608
          default:
7609
            return null;
7610
        }
7611
      }
7612
 
7613
      /**
7614
       * Find the _Fields constant that matches fieldId, throwing an exception
7615
       * if it is not found.
7616
       */
7617
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7618
        _Fields fields = findByThriftId(fieldId);
7619
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7620
        return fields;
7621
      }
7622
 
7623
      /**
7624
       * Find the _Fields constant that matches name, or null if its not found.
7625
       */
7626
      public static _Fields findByName(String name) {
7627
        return byName.get(name);
7628
      }
7629
 
7630
      private final short _thriftId;
7631
      private final String _fieldName;
7632
 
7633
      _Fields(short thriftId, String fieldName) {
7634
        _thriftId = thriftId;
7635
        _fieldName = fieldName;
7636
      }
7637
 
7638
      public short getThriftFieldId() {
7639
        return _thriftId;
7640
      }
7641
 
7642
      public String getFieldName() {
7643
        return _fieldName;
7644
      }
7645
    }
7646
 
7647
    // isset id assignments
7648
    private static final int __TOTALAMOUNT_ISSET_ID = 0;
7649
    private static final int __USERID_ISSET_ID = 1;
7650
    private BitSet __isset_bit_vector = new BitSet(2);
7651
 
7652
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
7653
    static {
7654
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7655
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7656
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
7657
      tmpMap.put(_Fields.TOTAL_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("totalAmount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7658
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7659
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7660
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7661
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7662
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyRechargeCoupon_args.class, metaDataMap);
7663
    }
7664
 
7665
    public applyRechargeCoupon_args() {
7666
    }
7667
 
7668
    public applyRechargeCoupon_args(
7669
      String couponCode,
7670
      long totalAmount,
7671
      long userId)
7672
    {
7673
      this();
7674
      this.couponCode = couponCode;
7675
      this.totalAmount = totalAmount;
7676
      setTotalAmountIsSet(true);
7677
      this.userId = userId;
7678
      setUserIdIsSet(true);
7679
    }
7680
 
7681
    /**
7682
     * Performs a deep copy on <i>other</i>.
7683
     */
7684
    public applyRechargeCoupon_args(applyRechargeCoupon_args other) {
7685
      __isset_bit_vector.clear();
7686
      __isset_bit_vector.or(other.__isset_bit_vector);
7687
      if (other.isSetCouponCode()) {
7688
        this.couponCode = other.couponCode;
7689
      }
7690
      this.totalAmount = other.totalAmount;
7691
      this.userId = other.userId;
7692
    }
7693
 
7694
    public applyRechargeCoupon_args deepCopy() {
7695
      return new applyRechargeCoupon_args(this);
7696
    }
7697
 
7698
    @Override
7699
    public void clear() {
7700
      this.couponCode = null;
7701
      setTotalAmountIsSet(false);
7702
      this.totalAmount = 0;
7703
      setUserIdIsSet(false);
7704
      this.userId = 0;
7705
    }
7706
 
7707
    public String getCouponCode() {
7708
      return this.couponCode;
7709
    }
7710
 
7711
    public void setCouponCode(String couponCode) {
7712
      this.couponCode = couponCode;
7713
    }
7714
 
7715
    public void unsetCouponCode() {
7716
      this.couponCode = null;
7717
    }
7718
 
7719
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
7720
    public boolean isSetCouponCode() {
7721
      return this.couponCode != null;
7722
    }
7723
 
7724
    public void setCouponCodeIsSet(boolean value) {
7725
      if (!value) {
7726
        this.couponCode = null;
7727
      }
7728
    }
7729
 
7730
    public long getTotalAmount() {
7731
      return this.totalAmount;
7732
    }
7733
 
7734
    public void setTotalAmount(long totalAmount) {
7735
      this.totalAmount = totalAmount;
7736
      setTotalAmountIsSet(true);
7737
    }
7738
 
7739
    public void unsetTotalAmount() {
7740
      __isset_bit_vector.clear(__TOTALAMOUNT_ISSET_ID);
7741
    }
7742
 
7743
    /** Returns true if field totalAmount is set (has been assigned a value) and false otherwise */
7744
    public boolean isSetTotalAmount() {
7745
      return __isset_bit_vector.get(__TOTALAMOUNT_ISSET_ID);
7746
    }
7747
 
7748
    public void setTotalAmountIsSet(boolean value) {
7749
      __isset_bit_vector.set(__TOTALAMOUNT_ISSET_ID, value);
7750
    }
7751
 
7752
    public long getUserId() {
7753
      return this.userId;
7754
    }
7755
 
7756
    public void setUserId(long userId) {
7757
      this.userId = userId;
7758
      setUserIdIsSet(true);
7759
    }
7760
 
7761
    public void unsetUserId() {
7762
      __isset_bit_vector.clear(__USERID_ISSET_ID);
7763
    }
7764
 
7765
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
7766
    public boolean isSetUserId() {
7767
      return __isset_bit_vector.get(__USERID_ISSET_ID);
7768
    }
7769
 
7770
    public void setUserIdIsSet(boolean value) {
7771
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
7772
    }
7773
 
7774
    public void setFieldValue(_Fields field, Object value) {
7775
      switch (field) {
7776
      case COUPON_CODE:
7777
        if (value == null) {
7778
          unsetCouponCode();
7779
        } else {
7780
          setCouponCode((String)value);
7781
        }
7782
        break;
7783
 
7784
      case TOTAL_AMOUNT:
7785
        if (value == null) {
7786
          unsetTotalAmount();
7787
        } else {
7788
          setTotalAmount((Long)value);
7789
        }
7790
        break;
7791
 
7792
      case USER_ID:
7793
        if (value == null) {
7794
          unsetUserId();
7795
        } else {
7796
          setUserId((Long)value);
7797
        }
7798
        break;
7799
 
7800
      }
7801
    }
7802
 
7803
    public Object getFieldValue(_Fields field) {
7804
      switch (field) {
7805
      case COUPON_CODE:
7806
        return getCouponCode();
7807
 
7808
      case TOTAL_AMOUNT:
7809
        return Long.valueOf(getTotalAmount());
7810
 
7811
      case USER_ID:
7812
        return Long.valueOf(getUserId());
7813
 
7814
      }
7815
      throw new IllegalStateException();
7816
    }
7817
 
7818
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7819
    public boolean isSet(_Fields field) {
7820
      if (field == null) {
7821
        throw new IllegalArgumentException();
7822
      }
7823
 
7824
      switch (field) {
7825
      case COUPON_CODE:
7826
        return isSetCouponCode();
7827
      case TOTAL_AMOUNT:
7828
        return isSetTotalAmount();
7829
      case USER_ID:
7830
        return isSetUserId();
7831
      }
7832
      throw new IllegalStateException();
7833
    }
7834
 
7835
    @Override
7836
    public boolean equals(Object that) {
7837
      if (that == null)
7838
        return false;
7839
      if (that instanceof applyRechargeCoupon_args)
7840
        return this.equals((applyRechargeCoupon_args)that);
7841
      return false;
7842
    }
7843
 
7844
    public boolean equals(applyRechargeCoupon_args that) {
7845
      if (that == null)
7846
        return false;
7847
 
7848
      boolean this_present_couponCode = true && this.isSetCouponCode();
7849
      boolean that_present_couponCode = true && that.isSetCouponCode();
7850
      if (this_present_couponCode || that_present_couponCode) {
7851
        if (!(this_present_couponCode && that_present_couponCode))
7852
          return false;
7853
        if (!this.couponCode.equals(that.couponCode))
7854
          return false;
7855
      }
7856
 
7857
      boolean this_present_totalAmount = true;
7858
      boolean that_present_totalAmount = true;
7859
      if (this_present_totalAmount || that_present_totalAmount) {
7860
        if (!(this_present_totalAmount && that_present_totalAmount))
7861
          return false;
7862
        if (this.totalAmount != that.totalAmount)
7863
          return false;
7864
      }
7865
 
7866
      boolean this_present_userId = true;
7867
      boolean that_present_userId = true;
7868
      if (this_present_userId || that_present_userId) {
7869
        if (!(this_present_userId && that_present_userId))
7870
          return false;
7871
        if (this.userId != that.userId)
7872
          return false;
7873
      }
7874
 
7875
      return true;
7876
    }
7877
 
7878
    @Override
7879
    public int hashCode() {
7880
      return 0;
7881
    }
7882
 
7883
    public int compareTo(applyRechargeCoupon_args other) {
7884
      if (!getClass().equals(other.getClass())) {
7885
        return getClass().getName().compareTo(other.getClass().getName());
7886
      }
7887
 
7888
      int lastComparison = 0;
7889
      applyRechargeCoupon_args typedOther = (applyRechargeCoupon_args)other;
7890
 
7891
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
7892
      if (lastComparison != 0) {
7893
        return lastComparison;
7894
      }
7895
      if (isSetCouponCode()) {
7896
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
7897
        if (lastComparison != 0) {
7898
          return lastComparison;
7899
        }
7900
      }
7901
      lastComparison = Boolean.valueOf(isSetTotalAmount()).compareTo(typedOther.isSetTotalAmount());
7902
      if (lastComparison != 0) {
7903
        return lastComparison;
7904
      }
7905
      if (isSetTotalAmount()) {
7906
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.totalAmount, typedOther.totalAmount);
7907
        if (lastComparison != 0) {
7908
          return lastComparison;
7909
        }
7910
      }
7911
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
7912
      if (lastComparison != 0) {
7913
        return lastComparison;
7914
      }
7915
      if (isSetUserId()) {
7916
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
7917
        if (lastComparison != 0) {
7918
          return lastComparison;
7919
        }
7920
      }
7921
      return 0;
7922
    }
7923
 
7924
    public _Fields fieldForId(int fieldId) {
7925
      return _Fields.findByThriftId(fieldId);
7926
    }
7927
 
7928
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7929
      org.apache.thrift.protocol.TField field;
7930
      iprot.readStructBegin();
7931
      while (true)
7932
      {
7933
        field = iprot.readFieldBegin();
7934
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
7935
          break;
7936
        }
7937
        switch (field.id) {
7938
          case 1: // COUPON_CODE
7939
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
7940
              this.couponCode = iprot.readString();
7941
            } else { 
7942
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7943
            }
7944
            break;
7945
          case 2: // TOTAL_AMOUNT
7946
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7947
              this.totalAmount = iprot.readI64();
7948
              setTotalAmountIsSet(true);
7949
            } else { 
7950
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7951
            }
7952
            break;
7953
          case 3: // USER_ID
7954
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7955
              this.userId = iprot.readI64();
7956
              setUserIdIsSet(true);
7957
            } else { 
7958
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7959
            }
7960
            break;
7961
          default:
7962
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7963
        }
7964
        iprot.readFieldEnd();
7965
      }
7966
      iprot.readStructEnd();
7967
      validate();
7968
    }
7969
 
7970
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
7971
      validate();
7972
 
7973
      oprot.writeStructBegin(STRUCT_DESC);
7974
      if (this.couponCode != null) {
7975
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
7976
        oprot.writeString(this.couponCode);
7977
        oprot.writeFieldEnd();
7978
      }
7979
      oprot.writeFieldBegin(TOTAL_AMOUNT_FIELD_DESC);
7980
      oprot.writeI64(this.totalAmount);
7981
      oprot.writeFieldEnd();
7982
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
7983
      oprot.writeI64(this.userId);
7984
      oprot.writeFieldEnd();
7985
      oprot.writeFieldStop();
7986
      oprot.writeStructEnd();
7987
    }
7988
 
7989
    @Override
7990
    public String toString() {
7991
      StringBuilder sb = new StringBuilder("applyRechargeCoupon_args(");
7992
      boolean first = true;
7993
 
7994
      sb.append("couponCode:");
7995
      if (this.couponCode == null) {
7996
        sb.append("null");
7997
      } else {
7998
        sb.append(this.couponCode);
7999
      }
8000
      first = false;
8001
      if (!first) sb.append(", ");
8002
      sb.append("totalAmount:");
8003
      sb.append(this.totalAmount);
8004
      first = false;
8005
      if (!first) sb.append(", ");
8006
      sb.append("userId:");
8007
      sb.append(this.userId);
8008
      first = false;
8009
      sb.append(")");
8010
      return sb.toString();
8011
    }
8012
 
8013
    public void validate() throws org.apache.thrift.TException {
8014
      // check for required fields
8015
    }
8016
 
8017
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8018
      try {
8019
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8020
      } catch (org.apache.thrift.TException te) {
8021
        throw new java.io.IOException(te);
8022
      }
8023
    }
8024
 
8025
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8026
      try {
8027
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
8028
        __isset_bit_vector = new BitSet(1);
8029
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8030
      } catch (org.apache.thrift.TException te) {
8031
        throw new java.io.IOException(te);
8032
      }
8033
    }
8034
 
8035
  }
8036
 
8037
  public static class applyRechargeCoupon_result implements org.apache.thrift.TBase<applyRechargeCoupon_result, applyRechargeCoupon_result._Fields>, java.io.Serializable, Cloneable   {
8038
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyRechargeCoupon_result");
8039
 
8040
    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);
8041
    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);
8042
 
8043
    private Map<Long,String> success; // required
8044
    private PromotionException pex; // required
8045
 
8046
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8047
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
8048
      SUCCESS((short)0, "success"),
8049
      PEX((short)1, "pex");
8050
 
8051
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8052
 
8053
      static {
8054
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8055
          byName.put(field.getFieldName(), field);
8056
        }
8057
      }
8058
 
8059
      /**
8060
       * Find the _Fields constant that matches fieldId, or null if its not found.
8061
       */
8062
      public static _Fields findByThriftId(int fieldId) {
8063
        switch(fieldId) {
8064
          case 0: // SUCCESS
8065
            return SUCCESS;
8066
          case 1: // PEX
8067
            return PEX;
8068
          default:
8069
            return null;
8070
        }
8071
      }
8072
 
8073
      /**
8074
       * Find the _Fields constant that matches fieldId, throwing an exception
8075
       * if it is not found.
8076
       */
8077
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8078
        _Fields fields = findByThriftId(fieldId);
8079
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8080
        return fields;
8081
      }
8082
 
8083
      /**
8084
       * Find the _Fields constant that matches name, or null if its not found.
8085
       */
8086
      public static _Fields findByName(String name) {
8087
        return byName.get(name);
8088
      }
8089
 
8090
      private final short _thriftId;
8091
      private final String _fieldName;
8092
 
8093
      _Fields(short thriftId, String fieldName) {
8094
        _thriftId = thriftId;
8095
        _fieldName = fieldName;
8096
      }
8097
 
8098
      public short getThriftFieldId() {
8099
        return _thriftId;
8100
      }
8101
 
8102
      public String getFieldName() {
8103
        return _fieldName;
8104
      }
8105
    }
8106
 
8107
    // isset id assignments
8108
 
8109
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
8110
    static {
8111
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8112
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8113
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
8114
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), 
8115
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
8116
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8117
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
8118
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8119
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyRechargeCoupon_result.class, metaDataMap);
8120
    }
8121
 
8122
    public applyRechargeCoupon_result() {
8123
    }
8124
 
8125
    public applyRechargeCoupon_result(
8126
      Map<Long,String> success,
8127
      PromotionException pex)
8128
    {
8129
      this();
8130
      this.success = success;
8131
      this.pex = pex;
8132
    }
8133
 
8134
    /**
8135
     * Performs a deep copy on <i>other</i>.
8136
     */
8137
    public applyRechargeCoupon_result(applyRechargeCoupon_result other) {
8138
      if (other.isSetSuccess()) {
8139
        Map<Long,String> __this__success = new HashMap<Long,String>();
8140
        for (Map.Entry<Long, String> other_element : other.success.entrySet()) {
8141
 
8142
          Long other_element_key = other_element.getKey();
8143
          String other_element_value = other_element.getValue();
8144
 
8145
          Long __this__success_copy_key = other_element_key;
8146
 
8147
          String __this__success_copy_value = other_element_value;
8148
 
8149
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
8150
        }
8151
        this.success = __this__success;
8152
      }
8153
      if (other.isSetPex()) {
8154
        this.pex = new PromotionException(other.pex);
8155
      }
8156
    }
8157
 
8158
    public applyRechargeCoupon_result deepCopy() {
8159
      return new applyRechargeCoupon_result(this);
8160
    }
8161
 
8162
    @Override
8163
    public void clear() {
8164
      this.success = null;
8165
      this.pex = null;
8166
    }
8167
 
8168
    public int getSuccessSize() {
8169
      return (this.success == null) ? 0 : this.success.size();
8170
    }
8171
 
8172
    public void putToSuccess(long key, String val) {
8173
      if (this.success == null) {
8174
        this.success = new HashMap<Long,String>();
8175
      }
8176
      this.success.put(key, val);
8177
    }
8178
 
8179
    public Map<Long,String> getSuccess() {
8180
      return this.success;
8181
    }
8182
 
8183
    public void setSuccess(Map<Long,String> success) {
8184
      this.success = success;
8185
    }
8186
 
8187
    public void unsetSuccess() {
8188
      this.success = null;
8189
    }
8190
 
8191
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
8192
    public boolean isSetSuccess() {
8193
      return this.success != null;
8194
    }
8195
 
8196
    public void setSuccessIsSet(boolean value) {
8197
      if (!value) {
8198
        this.success = null;
8199
      }
8200
    }
8201
 
8202
    public PromotionException getPex() {
8203
      return this.pex;
8204
    }
8205
 
8206
    public void setPex(PromotionException pex) {
8207
      this.pex = pex;
8208
    }
8209
 
8210
    public void unsetPex() {
8211
      this.pex = null;
8212
    }
8213
 
8214
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
8215
    public boolean isSetPex() {
8216
      return this.pex != null;
8217
    }
8218
 
8219
    public void setPexIsSet(boolean value) {
8220
      if (!value) {
8221
        this.pex = null;
8222
      }
8223
    }
8224
 
8225
    public void setFieldValue(_Fields field, Object value) {
8226
      switch (field) {
8227
      case SUCCESS:
8228
        if (value == null) {
8229
          unsetSuccess();
8230
        } else {
8231
          setSuccess((Map<Long,String>)value);
8232
        }
8233
        break;
8234
 
8235
      case PEX:
8236
        if (value == null) {
8237
          unsetPex();
8238
        } else {
8239
          setPex((PromotionException)value);
8240
        }
8241
        break;
8242
 
8243
      }
8244
    }
8245
 
8246
    public Object getFieldValue(_Fields field) {
8247
      switch (field) {
8248
      case SUCCESS:
8249
        return getSuccess();
8250
 
8251
      case PEX:
8252
        return getPex();
8253
 
8254
      }
8255
      throw new IllegalStateException();
8256
    }
8257
 
8258
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8259
    public boolean isSet(_Fields field) {
8260
      if (field == null) {
8261
        throw new IllegalArgumentException();
8262
      }
8263
 
8264
      switch (field) {
8265
      case SUCCESS:
8266
        return isSetSuccess();
8267
      case PEX:
8268
        return isSetPex();
8269
      }
8270
      throw new IllegalStateException();
8271
    }
8272
 
8273
    @Override
8274
    public boolean equals(Object that) {
8275
      if (that == null)
8276
        return false;
8277
      if (that instanceof applyRechargeCoupon_result)
8278
        return this.equals((applyRechargeCoupon_result)that);
8279
      return false;
8280
    }
8281
 
8282
    public boolean equals(applyRechargeCoupon_result that) {
8283
      if (that == null)
8284
        return false;
8285
 
8286
      boolean this_present_success = true && this.isSetSuccess();
8287
      boolean that_present_success = true && that.isSetSuccess();
8288
      if (this_present_success || that_present_success) {
8289
        if (!(this_present_success && that_present_success))
8290
          return false;
8291
        if (!this.success.equals(that.success))
8292
          return false;
8293
      }
8294
 
8295
      boolean this_present_pex = true && this.isSetPex();
8296
      boolean that_present_pex = true && that.isSetPex();
8297
      if (this_present_pex || that_present_pex) {
8298
        if (!(this_present_pex && that_present_pex))
8299
          return false;
8300
        if (!this.pex.equals(that.pex))
8301
          return false;
8302
      }
8303
 
8304
      return true;
8305
    }
8306
 
8307
    @Override
8308
    public int hashCode() {
8309
      return 0;
8310
    }
8311
 
8312
    public int compareTo(applyRechargeCoupon_result other) {
8313
      if (!getClass().equals(other.getClass())) {
8314
        return getClass().getName().compareTo(other.getClass().getName());
8315
      }
8316
 
8317
      int lastComparison = 0;
8318
      applyRechargeCoupon_result typedOther = (applyRechargeCoupon_result)other;
8319
 
8320
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
8321
      if (lastComparison != 0) {
8322
        return lastComparison;
8323
      }
8324
      if (isSetSuccess()) {
8325
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
8326
        if (lastComparison != 0) {
8327
          return lastComparison;
8328
        }
8329
      }
8330
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
8331
      if (lastComparison != 0) {
8332
        return lastComparison;
8333
      }
8334
      if (isSetPex()) {
8335
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
8336
        if (lastComparison != 0) {
8337
          return lastComparison;
8338
        }
8339
      }
8340
      return 0;
8341
    }
8342
 
8343
    public _Fields fieldForId(int fieldId) {
8344
      return _Fields.findByThriftId(fieldId);
8345
    }
8346
 
8347
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8348
      org.apache.thrift.protocol.TField field;
8349
      iprot.readStructBegin();
8350
      while (true)
8351
      {
8352
        field = iprot.readFieldBegin();
8353
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
8354
          break;
8355
        }
8356
        switch (field.id) {
8357
          case 0: // SUCCESS
8358
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
8359
              {
8360
                org.apache.thrift.protocol.TMap _map16 = iprot.readMapBegin();
8361
                this.success = new HashMap<Long,String>(2*_map16.size);
8362
                for (int _i17 = 0; _i17 < _map16.size; ++_i17)
8363
                {
8364
                  long _key18; // required
8365
                  String _val19; // required
8366
                  _key18 = iprot.readI64();
8367
                  _val19 = iprot.readString();
8368
                  this.success.put(_key18, _val19);
8369
                }
8370
                iprot.readMapEnd();
8371
              }
8372
            } else { 
8373
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8374
            }
8375
            break;
8376
          case 1: // PEX
8377
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
8378
              this.pex = new PromotionException();
8379
              this.pex.read(iprot);
8380
            } else { 
8381
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8382
            }
8383
            break;
8384
          default:
8385
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8386
        }
8387
        iprot.readFieldEnd();
8388
      }
8389
      iprot.readStructEnd();
8390
      validate();
8391
    }
8392
 
8393
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
8394
      oprot.writeStructBegin(STRUCT_DESC);
8395
 
8396
      if (this.isSetSuccess()) {
8397
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
8398
        {
8399
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.STRING, this.success.size()));
8400
          for (Map.Entry<Long, String> _iter20 : this.success.entrySet())
8401
          {
8402
            oprot.writeI64(_iter20.getKey());
8403
            oprot.writeString(_iter20.getValue());
8404
          }
8405
          oprot.writeMapEnd();
8406
        }
8407
        oprot.writeFieldEnd();
8408
      } else if (this.isSetPex()) {
8409
        oprot.writeFieldBegin(PEX_FIELD_DESC);
8410
        this.pex.write(oprot);
8411
        oprot.writeFieldEnd();
8412
      }
8413
      oprot.writeFieldStop();
8414
      oprot.writeStructEnd();
8415
    }
8416
 
8417
    @Override
8418
    public String toString() {
8419
      StringBuilder sb = new StringBuilder("applyRechargeCoupon_result(");
8420
      boolean first = true;
8421
 
8422
      sb.append("success:");
8423
      if (this.success == null) {
8424
        sb.append("null");
8425
      } else {
8426
        sb.append(this.success);
8427
      }
8428
      first = false;
8429
      if (!first) sb.append(", ");
8430
      sb.append("pex:");
8431
      if (this.pex == null) {
8432
        sb.append("null");
8433
      } else {
8434
        sb.append(this.pex);
8435
      }
8436
      first = false;
8437
      sb.append(")");
8438
      return sb.toString();
8439
    }
8440
 
8441
    public void validate() throws org.apache.thrift.TException {
8442
      // check for required fields
8443
    }
8444
 
8445
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8446
      try {
8447
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8448
      } catch (org.apache.thrift.TException te) {
8449
        throw new java.io.IOException(te);
8450
      }
8451
    }
8452
 
8453
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8454
      try {
8455
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8456
      } catch (org.apache.thrift.TException te) {
8457
        throw new java.io.IOException(te);
8458
      }
8459
    }
8460
 
8461
  }
8462
 
3430 rajveer 8463
  public static class trackCouponUsage_args implements org.apache.thrift.TBase<trackCouponUsage_args, trackCouponUsage_args._Fields>, java.io.Serializable, Cloneable   {
8464
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_args");
1982 varun.gupt 8465
 
3430 rajveer 8466
    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);
8467
    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);
8468
    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 8469
 
3430 rajveer 8470
    private String couponCode; // required
8471
    private long transactionId; // required
8472
    private long userId; // required
1982 varun.gupt 8473
 
8474
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 8475
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 8476
      COUPON_CODE((short)1, "couponCode"),
8477
      TRANSACTION_ID((short)2, "transactionId"),
8478
      USER_ID((short)3, "userId");
8479
 
8480
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8481
 
8482
      static {
8483
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8484
          byName.put(field.getFieldName(), field);
8485
        }
8486
      }
8487
 
8488
      /**
8489
       * Find the _Fields constant that matches fieldId, or null if its not found.
8490
       */
8491
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 8492
        switch(fieldId) {
8493
          case 1: // COUPON_CODE
8494
            return COUPON_CODE;
8495
          case 2: // TRANSACTION_ID
8496
            return TRANSACTION_ID;
8497
          case 3: // USER_ID
8498
            return USER_ID;
8499
          default:
8500
            return null;
8501
        }
1982 varun.gupt 8502
      }
8503
 
8504
      /**
8505
       * Find the _Fields constant that matches fieldId, throwing an exception
8506
       * if it is not found.
8507
       */
8508
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8509
        _Fields fields = findByThriftId(fieldId);
8510
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8511
        return fields;
8512
      }
8513
 
8514
      /**
8515
       * Find the _Fields constant that matches name, or null if its not found.
8516
       */
8517
      public static _Fields findByName(String name) {
8518
        return byName.get(name);
8519
      }
8520
 
8521
      private final short _thriftId;
8522
      private final String _fieldName;
8523
 
8524
      _Fields(short thriftId, String fieldName) {
8525
        _thriftId = thriftId;
8526
        _fieldName = fieldName;
8527
      }
8528
 
8529
      public short getThriftFieldId() {
8530
        return _thriftId;
8531
      }
8532
 
8533
      public String getFieldName() {
8534
        return _fieldName;
8535
      }
8536
    }
8537
 
8538
    // isset id assignments
8539
    private static final int __TRANSACTIONID_ISSET_ID = 0;
8540
    private static final int __USERID_ISSET_ID = 1;
8541
    private BitSet __isset_bit_vector = new BitSet(2);
8542
 
3430 rajveer 8543
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 8544
    static {
3430 rajveer 8545
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8546
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8547
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
8548
      tmpMap.put(_Fields.TRANSACTION_ID, new org.apache.thrift.meta_data.FieldMetaData("transactionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8549
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8550
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8551
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8552
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8553
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_args.class, metaDataMap);
1982 varun.gupt 8554
    }
8555
 
8556
    public trackCouponUsage_args() {
8557
    }
8558
 
8559
    public trackCouponUsage_args(
8560
      String couponCode,
8561
      long transactionId,
8562
      long userId)
8563
    {
8564
      this();
8565
      this.couponCode = couponCode;
8566
      this.transactionId = transactionId;
8567
      setTransactionIdIsSet(true);
8568
      this.userId = userId;
8569
      setUserIdIsSet(true);
8570
    }
8571
 
8572
    /**
8573
     * Performs a deep copy on <i>other</i>.
8574
     */
8575
    public trackCouponUsage_args(trackCouponUsage_args other) {
8576
      __isset_bit_vector.clear();
8577
      __isset_bit_vector.or(other.__isset_bit_vector);
8578
      if (other.isSetCouponCode()) {
8579
        this.couponCode = other.couponCode;
8580
      }
8581
      this.transactionId = other.transactionId;
8582
      this.userId = other.userId;
8583
    }
8584
 
8585
    public trackCouponUsage_args deepCopy() {
8586
      return new trackCouponUsage_args(this);
8587
    }
8588
 
3430 rajveer 8589
    @Override
8590
    public void clear() {
8591
      this.couponCode = null;
8592
      setTransactionIdIsSet(false);
8593
      this.transactionId = 0;
8594
      setUserIdIsSet(false);
8595
      this.userId = 0;
1982 varun.gupt 8596
    }
8597
 
8598
    public String getCouponCode() {
8599
      return this.couponCode;
8600
    }
8601
 
3430 rajveer 8602
    public void setCouponCode(String couponCode) {
1982 varun.gupt 8603
      this.couponCode = couponCode;
8604
    }
8605
 
8606
    public void unsetCouponCode() {
8607
      this.couponCode = null;
8608
    }
8609
 
3430 rajveer 8610
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 8611
    public boolean isSetCouponCode() {
8612
      return this.couponCode != null;
8613
    }
8614
 
8615
    public void setCouponCodeIsSet(boolean value) {
8616
      if (!value) {
8617
        this.couponCode = null;
8618
      }
8619
    }
8620
 
8621
    public long getTransactionId() {
8622
      return this.transactionId;
8623
    }
8624
 
3430 rajveer 8625
    public void setTransactionId(long transactionId) {
1982 varun.gupt 8626
      this.transactionId = transactionId;
8627
      setTransactionIdIsSet(true);
8628
    }
8629
 
8630
    public void unsetTransactionId() {
8631
      __isset_bit_vector.clear(__TRANSACTIONID_ISSET_ID);
8632
    }
8633
 
3430 rajveer 8634
    /** Returns true if field transactionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 8635
    public boolean isSetTransactionId() {
8636
      return __isset_bit_vector.get(__TRANSACTIONID_ISSET_ID);
8637
    }
8638
 
8639
    public void setTransactionIdIsSet(boolean value) {
8640
      __isset_bit_vector.set(__TRANSACTIONID_ISSET_ID, value);
8641
    }
8642
 
8643
    public long getUserId() {
8644
      return this.userId;
8645
    }
8646
 
3430 rajveer 8647
    public void setUserId(long userId) {
1982 varun.gupt 8648
      this.userId = userId;
8649
      setUserIdIsSet(true);
8650
    }
8651
 
8652
    public void unsetUserId() {
8653
      __isset_bit_vector.clear(__USERID_ISSET_ID);
8654
    }
8655
 
3430 rajveer 8656
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 8657
    public boolean isSetUserId() {
8658
      return __isset_bit_vector.get(__USERID_ISSET_ID);
8659
    }
8660
 
8661
    public void setUserIdIsSet(boolean value) {
8662
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
8663
    }
8664
 
8665
    public void setFieldValue(_Fields field, Object value) {
8666
      switch (field) {
8667
      case COUPON_CODE:
8668
        if (value == null) {
8669
          unsetCouponCode();
8670
        } else {
8671
          setCouponCode((String)value);
8672
        }
8673
        break;
8674
 
8675
      case TRANSACTION_ID:
8676
        if (value == null) {
8677
          unsetTransactionId();
8678
        } else {
8679
          setTransactionId((Long)value);
8680
        }
8681
        break;
8682
 
8683
      case USER_ID:
8684
        if (value == null) {
8685
          unsetUserId();
8686
        } else {
8687
          setUserId((Long)value);
8688
        }
8689
        break;
8690
 
8691
      }
8692
    }
8693
 
8694
    public Object getFieldValue(_Fields field) {
8695
      switch (field) {
8696
      case COUPON_CODE:
8697
        return getCouponCode();
8698
 
8699
      case TRANSACTION_ID:
3430 rajveer 8700
        return Long.valueOf(getTransactionId());
1982 varun.gupt 8701
 
8702
      case USER_ID:
3430 rajveer 8703
        return Long.valueOf(getUserId());
1982 varun.gupt 8704
 
8705
      }
8706
      throw new IllegalStateException();
8707
    }
8708
 
3430 rajveer 8709
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8710
    public boolean isSet(_Fields field) {
8711
      if (field == null) {
8712
        throw new IllegalArgumentException();
8713
      }
1982 varun.gupt 8714
 
8715
      switch (field) {
8716
      case COUPON_CODE:
8717
        return isSetCouponCode();
8718
      case TRANSACTION_ID:
8719
        return isSetTransactionId();
8720
      case USER_ID:
8721
        return isSetUserId();
8722
      }
8723
      throw new IllegalStateException();
8724
    }
8725
 
8726
    @Override
8727
    public boolean equals(Object that) {
8728
      if (that == null)
8729
        return false;
8730
      if (that instanceof trackCouponUsage_args)
8731
        return this.equals((trackCouponUsage_args)that);
8732
      return false;
8733
    }
8734
 
8735
    public boolean equals(trackCouponUsage_args that) {
8736
      if (that == null)
8737
        return false;
8738
 
8739
      boolean this_present_couponCode = true && this.isSetCouponCode();
8740
      boolean that_present_couponCode = true && that.isSetCouponCode();
8741
      if (this_present_couponCode || that_present_couponCode) {
8742
        if (!(this_present_couponCode && that_present_couponCode))
8743
          return false;
8744
        if (!this.couponCode.equals(that.couponCode))
8745
          return false;
8746
      }
8747
 
8748
      boolean this_present_transactionId = true;
8749
      boolean that_present_transactionId = true;
8750
      if (this_present_transactionId || that_present_transactionId) {
8751
        if (!(this_present_transactionId && that_present_transactionId))
8752
          return false;
8753
        if (this.transactionId != that.transactionId)
8754
          return false;
8755
      }
8756
 
8757
      boolean this_present_userId = true;
8758
      boolean that_present_userId = true;
8759
      if (this_present_userId || that_present_userId) {
8760
        if (!(this_present_userId && that_present_userId))
8761
          return false;
8762
        if (this.userId != that.userId)
8763
          return false;
8764
      }
8765
 
8766
      return true;
8767
    }
8768
 
8769
    @Override
8770
    public int hashCode() {
8771
      return 0;
8772
    }
8773
 
8774
    public int compareTo(trackCouponUsage_args other) {
8775
      if (!getClass().equals(other.getClass())) {
8776
        return getClass().getName().compareTo(other.getClass().getName());
8777
      }
8778
 
8779
      int lastComparison = 0;
8780
      trackCouponUsage_args typedOther = (trackCouponUsage_args)other;
8781
 
3430 rajveer 8782
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 8783
      if (lastComparison != 0) {
8784
        return lastComparison;
8785
      }
3430 rajveer 8786
      if (isSetCouponCode()) {
8787
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
8788
        if (lastComparison != 0) {
8789
          return lastComparison;
8790
        }
1982 varun.gupt 8791
      }
3430 rajveer 8792
      lastComparison = Boolean.valueOf(isSetTransactionId()).compareTo(typedOther.isSetTransactionId());
1982 varun.gupt 8793
      if (lastComparison != 0) {
8794
        return lastComparison;
8795
      }
3430 rajveer 8796
      if (isSetTransactionId()) {
8797
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transactionId, typedOther.transactionId);
8798
        if (lastComparison != 0) {
8799
          return lastComparison;
8800
        }
1982 varun.gupt 8801
      }
3430 rajveer 8802
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 8803
      if (lastComparison != 0) {
8804
        return lastComparison;
8805
      }
3430 rajveer 8806
      if (isSetUserId()) {
8807
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
8808
        if (lastComparison != 0) {
8809
          return lastComparison;
8810
        }
1982 varun.gupt 8811
      }
8812
      return 0;
8813
    }
8814
 
3430 rajveer 8815
    public _Fields fieldForId(int fieldId) {
8816
      return _Fields.findByThriftId(fieldId);
8817
    }
8818
 
8819
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8820
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 8821
      iprot.readStructBegin();
8822
      while (true)
8823
      {
8824
        field = iprot.readFieldBegin();
3430 rajveer 8825
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 8826
          break;
8827
        }
3430 rajveer 8828
        switch (field.id) {
8829
          case 1: // COUPON_CODE
8830
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
8831
              this.couponCode = iprot.readString();
8832
            } else { 
8833
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8834
            }
8835
            break;
8836
          case 2: // TRANSACTION_ID
8837
            if (field.type == org.apache.thrift.protocol.TType.I64) {
8838
              this.transactionId = iprot.readI64();
8839
              setTransactionIdIsSet(true);
8840
            } else { 
8841
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8842
            }
8843
            break;
8844
          case 3: // USER_ID
8845
            if (field.type == org.apache.thrift.protocol.TType.I64) {
8846
              this.userId = iprot.readI64();
8847
              setUserIdIsSet(true);
8848
            } else { 
8849
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8850
            }
8851
            break;
8852
          default:
8853
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 8854
        }
3430 rajveer 8855
        iprot.readFieldEnd();
1982 varun.gupt 8856
      }
8857
      iprot.readStructEnd();
8858
      validate();
8859
    }
8860
 
3430 rajveer 8861
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 8862
      validate();
8863
 
8864
      oprot.writeStructBegin(STRUCT_DESC);
8865
      if (this.couponCode != null) {
8866
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
8867
        oprot.writeString(this.couponCode);
8868
        oprot.writeFieldEnd();
8869
      }
8870
      oprot.writeFieldBegin(TRANSACTION_ID_FIELD_DESC);
8871
      oprot.writeI64(this.transactionId);
8872
      oprot.writeFieldEnd();
8873
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
8874
      oprot.writeI64(this.userId);
8875
      oprot.writeFieldEnd();
8876
      oprot.writeFieldStop();
8877
      oprot.writeStructEnd();
8878
    }
8879
 
8880
    @Override
8881
    public String toString() {
8882
      StringBuilder sb = new StringBuilder("trackCouponUsage_args(");
8883
      boolean first = true;
8884
 
8885
      sb.append("couponCode:");
8886
      if (this.couponCode == null) {
8887
        sb.append("null");
8888
      } else {
8889
        sb.append(this.couponCode);
8890
      }
8891
      first = false;
8892
      if (!first) sb.append(", ");
8893
      sb.append("transactionId:");
8894
      sb.append(this.transactionId);
8895
      first = false;
8896
      if (!first) sb.append(", ");
8897
      sb.append("userId:");
8898
      sb.append(this.userId);
8899
      first = false;
8900
      sb.append(")");
8901
      return sb.toString();
8902
    }
8903
 
3430 rajveer 8904
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 8905
      // check for required fields
8906
    }
8907
 
3430 rajveer 8908
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8909
      try {
8910
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8911
      } catch (org.apache.thrift.TException te) {
8912
        throw new java.io.IOException(te);
8913
      }
8914
    }
8915
 
8916
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8917
      try {
8918
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
8919
        __isset_bit_vector = new BitSet(1);
8920
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8921
      } catch (org.apache.thrift.TException te) {
8922
        throw new java.io.IOException(te);
8923
      }
8924
    }
8925
 
1982 varun.gupt 8926
  }
8927
 
3430 rajveer 8928
  public static class trackCouponUsage_result implements org.apache.thrift.TBase<trackCouponUsage_result, trackCouponUsage_result._Fields>, java.io.Serializable, Cloneable   {
8929
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_result");
1982 varun.gupt 8930
 
3430 rajveer 8931
    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 8932
 
3430 rajveer 8933
    private PromotionException pex; // required
1982 varun.gupt 8934
 
8935
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 8936
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 8937
      PEX((short)1, "pex");
8938
 
8939
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8940
 
8941
      static {
8942
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8943
          byName.put(field.getFieldName(), field);
8944
        }
8945
      }
8946
 
8947
      /**
8948
       * Find the _Fields constant that matches fieldId, or null if its not found.
8949
       */
8950
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 8951
        switch(fieldId) {
8952
          case 1: // PEX
8953
            return PEX;
8954
          default:
8955
            return null;
8956
        }
1982 varun.gupt 8957
      }
8958
 
8959
      /**
8960
       * Find the _Fields constant that matches fieldId, throwing an exception
8961
       * if it is not found.
8962
       */
8963
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8964
        _Fields fields = findByThriftId(fieldId);
8965
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8966
        return fields;
8967
      }
8968
 
8969
      /**
8970
       * Find the _Fields constant that matches name, or null if its not found.
8971
       */
8972
      public static _Fields findByName(String name) {
8973
        return byName.get(name);
8974
      }
8975
 
8976
      private final short _thriftId;
8977
      private final String _fieldName;
8978
 
8979
      _Fields(short thriftId, String fieldName) {
8980
        _thriftId = thriftId;
8981
        _fieldName = fieldName;
8982
      }
8983
 
8984
      public short getThriftFieldId() {
8985
        return _thriftId;
8986
      }
8987
 
8988
      public String getFieldName() {
8989
        return _fieldName;
8990
      }
8991
    }
8992
 
8993
    // isset id assignments
8994
 
3430 rajveer 8995
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 8996
    static {
3430 rajveer 8997
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8998
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8999
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
9000
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9001
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_result.class, metaDataMap);
1982 varun.gupt 9002
    }
9003
 
9004
    public trackCouponUsage_result() {
9005
    }
9006
 
9007
    public trackCouponUsage_result(
9008
      PromotionException pex)
9009
    {
9010
      this();
9011
      this.pex = pex;
9012
    }
9013
 
9014
    /**
9015
     * Performs a deep copy on <i>other</i>.
9016
     */
9017
    public trackCouponUsage_result(trackCouponUsage_result other) {
9018
      if (other.isSetPex()) {
9019
        this.pex = new PromotionException(other.pex);
9020
      }
9021
    }
9022
 
9023
    public trackCouponUsage_result deepCopy() {
9024
      return new trackCouponUsage_result(this);
9025
    }
9026
 
3430 rajveer 9027
    @Override
9028
    public void clear() {
9029
      this.pex = null;
1982 varun.gupt 9030
    }
9031
 
9032
    public PromotionException getPex() {
9033
      return this.pex;
9034
    }
9035
 
3430 rajveer 9036
    public void setPex(PromotionException pex) {
1982 varun.gupt 9037
      this.pex = pex;
9038
    }
9039
 
9040
    public void unsetPex() {
9041
      this.pex = null;
9042
    }
9043
 
3430 rajveer 9044
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 9045
    public boolean isSetPex() {
9046
      return this.pex != null;
9047
    }
9048
 
9049
    public void setPexIsSet(boolean value) {
9050
      if (!value) {
9051
        this.pex = null;
9052
      }
9053
    }
9054
 
9055
    public void setFieldValue(_Fields field, Object value) {
9056
      switch (field) {
9057
      case PEX:
9058
        if (value == null) {
9059
          unsetPex();
9060
        } else {
9061
          setPex((PromotionException)value);
9062
        }
9063
        break;
9064
 
9065
      }
9066
    }
9067
 
9068
    public Object getFieldValue(_Fields field) {
9069
      switch (field) {
9070
      case PEX:
9071
        return getPex();
9072
 
9073
      }
9074
      throw new IllegalStateException();
9075
    }
9076
 
3430 rajveer 9077
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9078
    public boolean isSet(_Fields field) {
9079
      if (field == null) {
9080
        throw new IllegalArgumentException();
9081
      }
1982 varun.gupt 9082
 
9083
      switch (field) {
9084
      case PEX:
9085
        return isSetPex();
9086
      }
9087
      throw new IllegalStateException();
9088
    }
9089
 
9090
    @Override
9091
    public boolean equals(Object that) {
9092
      if (that == null)
9093
        return false;
9094
      if (that instanceof trackCouponUsage_result)
9095
        return this.equals((trackCouponUsage_result)that);
9096
      return false;
9097
    }
9098
 
9099
    public boolean equals(trackCouponUsage_result that) {
9100
      if (that == null)
9101
        return false;
9102
 
9103
      boolean this_present_pex = true && this.isSetPex();
9104
      boolean that_present_pex = true && that.isSetPex();
9105
      if (this_present_pex || that_present_pex) {
9106
        if (!(this_present_pex && that_present_pex))
9107
          return false;
9108
        if (!this.pex.equals(that.pex))
9109
          return false;
9110
      }
9111
 
9112
      return true;
9113
    }
9114
 
9115
    @Override
9116
    public int hashCode() {
9117
      return 0;
9118
    }
9119
 
9120
    public int compareTo(trackCouponUsage_result other) {
9121
      if (!getClass().equals(other.getClass())) {
9122
        return getClass().getName().compareTo(other.getClass().getName());
9123
      }
9124
 
9125
      int lastComparison = 0;
9126
      trackCouponUsage_result typedOther = (trackCouponUsage_result)other;
9127
 
3430 rajveer 9128
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 9129
      if (lastComparison != 0) {
9130
        return lastComparison;
9131
      }
3430 rajveer 9132
      if (isSetPex()) {
9133
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
9134
        if (lastComparison != 0) {
9135
          return lastComparison;
9136
        }
1982 varun.gupt 9137
      }
9138
      return 0;
9139
    }
9140
 
3430 rajveer 9141
    public _Fields fieldForId(int fieldId) {
9142
      return _Fields.findByThriftId(fieldId);
9143
    }
9144
 
9145
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9146
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 9147
      iprot.readStructBegin();
9148
      while (true)
9149
      {
9150
        field = iprot.readFieldBegin();
3430 rajveer 9151
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 9152
          break;
9153
        }
3430 rajveer 9154
        switch (field.id) {
9155
          case 1: // PEX
9156
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
9157
              this.pex = new PromotionException();
9158
              this.pex.read(iprot);
9159
            } else { 
9160
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9161
            }
9162
            break;
9163
          default:
9164
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 9165
        }
3430 rajveer 9166
        iprot.readFieldEnd();
1982 varun.gupt 9167
      }
9168
      iprot.readStructEnd();
9169
      validate();
9170
    }
9171
 
3430 rajveer 9172
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 9173
      oprot.writeStructBegin(STRUCT_DESC);
9174
 
9175
      if (this.isSetPex()) {
9176
        oprot.writeFieldBegin(PEX_FIELD_DESC);
9177
        this.pex.write(oprot);
9178
        oprot.writeFieldEnd();
9179
      }
9180
      oprot.writeFieldStop();
9181
      oprot.writeStructEnd();
9182
    }
9183
 
9184
    @Override
9185
    public String toString() {
9186
      StringBuilder sb = new StringBuilder("trackCouponUsage_result(");
9187
      boolean first = true;
9188
 
9189
      sb.append("pex:");
9190
      if (this.pex == null) {
9191
        sb.append("null");
9192
      } else {
9193
        sb.append(this.pex);
9194
      }
9195
      first = false;
9196
      sb.append(")");
9197
      return sb.toString();
9198
    }
9199
 
3430 rajveer 9200
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 9201
      // check for required fields
9202
    }
9203
 
3430 rajveer 9204
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9205
      try {
9206
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9207
      } catch (org.apache.thrift.TException te) {
9208
        throw new java.io.IOException(te);
9209
      }
9210
    }
9211
 
9212
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9213
      try {
9214
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9215
      } catch (org.apache.thrift.TException te) {
9216
        throw new java.io.IOException(te);
9217
      }
9218
    }
9219
 
1982 varun.gupt 9220
  }
9221
 
3430 rajveer 9222
  public static class getCouponUsageCountByUser_args implements org.apache.thrift.TBase<getCouponUsageCountByUser_args, getCouponUsageCountByUser_args._Fields>, java.io.Serializable, Cloneable   {
9223
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_args");
1982 varun.gupt 9224
 
3430 rajveer 9225
    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);
9226
    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 9227
 
3430 rajveer 9228
    private String couponCode; // required
9229
    private long userId; // required
1982 varun.gupt 9230
 
9231
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 9232
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 9233
      COUPON_CODE((short)1, "couponCode"),
9234
      USER_ID((short)2, "userId");
9235
 
9236
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9237
 
9238
      static {
9239
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9240
          byName.put(field.getFieldName(), field);
9241
        }
9242
      }
9243
 
9244
      /**
9245
       * Find the _Fields constant that matches fieldId, or null if its not found.
9246
       */
9247
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 9248
        switch(fieldId) {
9249
          case 1: // COUPON_CODE
9250
            return COUPON_CODE;
9251
          case 2: // USER_ID
9252
            return USER_ID;
9253
          default:
9254
            return null;
9255
        }
1982 varun.gupt 9256
      }
9257
 
9258
      /**
9259
       * Find the _Fields constant that matches fieldId, throwing an exception
9260
       * if it is not found.
9261
       */
9262
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9263
        _Fields fields = findByThriftId(fieldId);
9264
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9265
        return fields;
9266
      }
9267
 
9268
      /**
9269
       * Find the _Fields constant that matches name, or null if its not found.
9270
       */
9271
      public static _Fields findByName(String name) {
9272
        return byName.get(name);
9273
      }
9274
 
9275
      private final short _thriftId;
9276
      private final String _fieldName;
9277
 
9278
      _Fields(short thriftId, String fieldName) {
9279
        _thriftId = thriftId;
9280
        _fieldName = fieldName;
9281
      }
9282
 
9283
      public short getThriftFieldId() {
9284
        return _thriftId;
9285
      }
9286
 
9287
      public String getFieldName() {
9288
        return _fieldName;
9289
      }
9290
    }
9291
 
9292
    // isset id assignments
9293
    private static final int __USERID_ISSET_ID = 0;
9294
    private BitSet __isset_bit_vector = new BitSet(1);
9295
 
3430 rajveer 9296
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 9297
    static {
3430 rajveer 9298
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9299
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9300
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
9301
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9302
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9303
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9304
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_args.class, metaDataMap);
1982 varun.gupt 9305
    }
9306
 
9307
    public getCouponUsageCountByUser_args() {
9308
    }
9309
 
9310
    public getCouponUsageCountByUser_args(
9311
      String couponCode,
9312
      long userId)
9313
    {
9314
      this();
9315
      this.couponCode = couponCode;
9316
      this.userId = userId;
9317
      setUserIdIsSet(true);
9318
    }
9319
 
9320
    /**
9321
     * Performs a deep copy on <i>other</i>.
9322
     */
9323
    public getCouponUsageCountByUser_args(getCouponUsageCountByUser_args other) {
9324
      __isset_bit_vector.clear();
9325
      __isset_bit_vector.or(other.__isset_bit_vector);
9326
      if (other.isSetCouponCode()) {
9327
        this.couponCode = other.couponCode;
9328
      }
9329
      this.userId = other.userId;
9330
    }
9331
 
9332
    public getCouponUsageCountByUser_args deepCopy() {
9333
      return new getCouponUsageCountByUser_args(this);
9334
    }
9335
 
3430 rajveer 9336
    @Override
9337
    public void clear() {
9338
      this.couponCode = null;
9339
      setUserIdIsSet(false);
9340
      this.userId = 0;
1982 varun.gupt 9341
    }
9342
 
9343
    public String getCouponCode() {
9344
      return this.couponCode;
9345
    }
9346
 
3430 rajveer 9347
    public void setCouponCode(String couponCode) {
1982 varun.gupt 9348
      this.couponCode = couponCode;
9349
    }
9350
 
9351
    public void unsetCouponCode() {
9352
      this.couponCode = null;
9353
    }
9354
 
3430 rajveer 9355
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 9356
    public boolean isSetCouponCode() {
9357
      return this.couponCode != null;
9358
    }
9359
 
9360
    public void setCouponCodeIsSet(boolean value) {
9361
      if (!value) {
9362
        this.couponCode = null;
9363
      }
9364
    }
9365
 
9366
    public long getUserId() {
9367
      return this.userId;
9368
    }
9369
 
3430 rajveer 9370
    public void setUserId(long userId) {
1982 varun.gupt 9371
      this.userId = userId;
9372
      setUserIdIsSet(true);
9373
    }
9374
 
9375
    public void unsetUserId() {
9376
      __isset_bit_vector.clear(__USERID_ISSET_ID);
9377
    }
9378
 
3430 rajveer 9379
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 9380
    public boolean isSetUserId() {
9381
      return __isset_bit_vector.get(__USERID_ISSET_ID);
9382
    }
9383
 
9384
    public void setUserIdIsSet(boolean value) {
9385
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
9386
    }
9387
 
9388
    public void setFieldValue(_Fields field, Object value) {
9389
      switch (field) {
9390
      case COUPON_CODE:
9391
        if (value == null) {
9392
          unsetCouponCode();
9393
        } else {
9394
          setCouponCode((String)value);
9395
        }
9396
        break;
9397
 
9398
      case USER_ID:
9399
        if (value == null) {
9400
          unsetUserId();
9401
        } else {
9402
          setUserId((Long)value);
9403
        }
9404
        break;
9405
 
9406
      }
9407
    }
9408
 
9409
    public Object getFieldValue(_Fields field) {
9410
      switch (field) {
9411
      case COUPON_CODE:
9412
        return getCouponCode();
9413
 
9414
      case USER_ID:
3430 rajveer 9415
        return Long.valueOf(getUserId());
1982 varun.gupt 9416
 
9417
      }
9418
      throw new IllegalStateException();
9419
    }
9420
 
3430 rajveer 9421
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9422
    public boolean isSet(_Fields field) {
9423
      if (field == null) {
9424
        throw new IllegalArgumentException();
9425
      }
1982 varun.gupt 9426
 
9427
      switch (field) {
9428
      case COUPON_CODE:
9429
        return isSetCouponCode();
9430
      case USER_ID:
9431
        return isSetUserId();
9432
      }
9433
      throw new IllegalStateException();
9434
    }
9435
 
9436
    @Override
9437
    public boolean equals(Object that) {
9438
      if (that == null)
9439
        return false;
9440
      if (that instanceof getCouponUsageCountByUser_args)
9441
        return this.equals((getCouponUsageCountByUser_args)that);
9442
      return false;
9443
    }
9444
 
9445
    public boolean equals(getCouponUsageCountByUser_args that) {
9446
      if (that == null)
9447
        return false;
9448
 
9449
      boolean this_present_couponCode = true && this.isSetCouponCode();
9450
      boolean that_present_couponCode = true && that.isSetCouponCode();
9451
      if (this_present_couponCode || that_present_couponCode) {
9452
        if (!(this_present_couponCode && that_present_couponCode))
9453
          return false;
9454
        if (!this.couponCode.equals(that.couponCode))
9455
          return false;
9456
      }
9457
 
9458
      boolean this_present_userId = true;
9459
      boolean that_present_userId = true;
9460
      if (this_present_userId || that_present_userId) {
9461
        if (!(this_present_userId && that_present_userId))
9462
          return false;
9463
        if (this.userId != that.userId)
9464
          return false;
9465
      }
9466
 
9467
      return true;
9468
    }
9469
 
9470
    @Override
9471
    public int hashCode() {
9472
      return 0;
9473
    }
9474
 
9475
    public int compareTo(getCouponUsageCountByUser_args other) {
9476
      if (!getClass().equals(other.getClass())) {
9477
        return getClass().getName().compareTo(other.getClass().getName());
9478
      }
9479
 
9480
      int lastComparison = 0;
9481
      getCouponUsageCountByUser_args typedOther = (getCouponUsageCountByUser_args)other;
9482
 
3430 rajveer 9483
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 9484
      if (lastComparison != 0) {
9485
        return lastComparison;
9486
      }
3430 rajveer 9487
      if (isSetCouponCode()) {
9488
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
9489
        if (lastComparison != 0) {
9490
          return lastComparison;
9491
        }
1982 varun.gupt 9492
      }
3430 rajveer 9493
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 9494
      if (lastComparison != 0) {
9495
        return lastComparison;
9496
      }
3430 rajveer 9497
      if (isSetUserId()) {
9498
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
9499
        if (lastComparison != 0) {
9500
          return lastComparison;
9501
        }
1982 varun.gupt 9502
      }
9503
      return 0;
9504
    }
9505
 
3430 rajveer 9506
    public _Fields fieldForId(int fieldId) {
9507
      return _Fields.findByThriftId(fieldId);
9508
    }
9509
 
9510
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9511
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 9512
      iprot.readStructBegin();
9513
      while (true)
9514
      {
9515
        field = iprot.readFieldBegin();
3430 rajveer 9516
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 9517
          break;
9518
        }
3430 rajveer 9519
        switch (field.id) {
9520
          case 1: // COUPON_CODE
9521
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
9522
              this.couponCode = iprot.readString();
9523
            } else { 
9524
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9525
            }
9526
            break;
9527
          case 2: // USER_ID
9528
            if (field.type == org.apache.thrift.protocol.TType.I64) {
9529
              this.userId = iprot.readI64();
9530
              setUserIdIsSet(true);
9531
            } else { 
9532
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9533
            }
9534
            break;
9535
          default:
9536
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 9537
        }
3430 rajveer 9538
        iprot.readFieldEnd();
1982 varun.gupt 9539
      }
9540
      iprot.readStructEnd();
9541
      validate();
9542
    }
9543
 
3430 rajveer 9544
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 9545
      validate();
9546
 
9547
      oprot.writeStructBegin(STRUCT_DESC);
9548
      if (this.couponCode != null) {
9549
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
9550
        oprot.writeString(this.couponCode);
9551
        oprot.writeFieldEnd();
9552
      }
9553
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
9554
      oprot.writeI64(this.userId);
9555
      oprot.writeFieldEnd();
9556
      oprot.writeFieldStop();
9557
      oprot.writeStructEnd();
9558
    }
9559
 
9560
    @Override
9561
    public String toString() {
9562
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_args(");
9563
      boolean first = true;
9564
 
9565
      sb.append("couponCode:");
9566
      if (this.couponCode == null) {
9567
        sb.append("null");
9568
      } else {
9569
        sb.append(this.couponCode);
9570
      }
9571
      first = false;
9572
      if (!first) sb.append(", ");
9573
      sb.append("userId:");
9574
      sb.append(this.userId);
9575
      first = false;
9576
      sb.append(")");
9577
      return sb.toString();
9578
    }
9579
 
3430 rajveer 9580
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 9581
      // check for required fields
9582
    }
9583
 
3430 rajveer 9584
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9585
      try {
9586
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9587
      } catch (org.apache.thrift.TException te) {
9588
        throw new java.io.IOException(te);
9589
      }
9590
    }
9591
 
9592
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9593
      try {
9594
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
9595
        __isset_bit_vector = new BitSet(1);
9596
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9597
      } catch (org.apache.thrift.TException te) {
9598
        throw new java.io.IOException(te);
9599
      }
9600
    }
9601
 
1982 varun.gupt 9602
  }
9603
 
3430 rajveer 9604
  public static class getCouponUsageCountByUser_result implements org.apache.thrift.TBase<getCouponUsageCountByUser_result, getCouponUsageCountByUser_result._Fields>, java.io.Serializable, Cloneable   {
9605
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_result");
1982 varun.gupt 9606
 
3430 rajveer 9607
    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);
9608
    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 9609
 
3430 rajveer 9610
    private long success; // required
9611
    private PromotionException pex; // required
1982 varun.gupt 9612
 
9613
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 9614
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 9615
      SUCCESS((short)0, "success"),
9616
      PEX((short)1, "pex");
9617
 
9618
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9619
 
9620
      static {
9621
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9622
          byName.put(field.getFieldName(), field);
9623
        }
9624
      }
9625
 
9626
      /**
9627
       * Find the _Fields constant that matches fieldId, or null if its not found.
9628
       */
9629
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 9630
        switch(fieldId) {
9631
          case 0: // SUCCESS
9632
            return SUCCESS;
9633
          case 1: // PEX
9634
            return PEX;
9635
          default:
9636
            return null;
9637
        }
1982 varun.gupt 9638
      }
9639
 
9640
      /**
9641
       * Find the _Fields constant that matches fieldId, throwing an exception
9642
       * if it is not found.
9643
       */
9644
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9645
        _Fields fields = findByThriftId(fieldId);
9646
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9647
        return fields;
9648
      }
9649
 
9650
      /**
9651
       * Find the _Fields constant that matches name, or null if its not found.
9652
       */
9653
      public static _Fields findByName(String name) {
9654
        return byName.get(name);
9655
      }
9656
 
9657
      private final short _thriftId;
9658
      private final String _fieldName;
9659
 
9660
      _Fields(short thriftId, String fieldName) {
9661
        _thriftId = thriftId;
9662
        _fieldName = fieldName;
9663
      }
9664
 
9665
      public short getThriftFieldId() {
9666
        return _thriftId;
9667
      }
9668
 
9669
      public String getFieldName() {
9670
        return _fieldName;
9671
      }
9672
    }
9673
 
9674
    // isset id assignments
9675
    private static final int __SUCCESS_ISSET_ID = 0;
9676
    private BitSet __isset_bit_vector = new BitSet(1);
9677
 
3430 rajveer 9678
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 9679
    static {
3430 rajveer 9680
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9681
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9682
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9683
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9684
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
9685
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9686
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_result.class, metaDataMap);
1982 varun.gupt 9687
    }
9688
 
9689
    public getCouponUsageCountByUser_result() {
9690
    }
9691
 
9692
    public getCouponUsageCountByUser_result(
9693
      long success,
9694
      PromotionException pex)
9695
    {
9696
      this();
9697
      this.success = success;
9698
      setSuccessIsSet(true);
9699
      this.pex = pex;
9700
    }
9701
 
9702
    /**
9703
     * Performs a deep copy on <i>other</i>.
9704
     */
9705
    public getCouponUsageCountByUser_result(getCouponUsageCountByUser_result other) {
9706
      __isset_bit_vector.clear();
9707
      __isset_bit_vector.or(other.__isset_bit_vector);
9708
      this.success = other.success;
9709
      if (other.isSetPex()) {
9710
        this.pex = new PromotionException(other.pex);
9711
      }
9712
    }
9713
 
9714
    public getCouponUsageCountByUser_result deepCopy() {
9715
      return new getCouponUsageCountByUser_result(this);
9716
    }
9717
 
3430 rajveer 9718
    @Override
9719
    public void clear() {
9720
      setSuccessIsSet(false);
9721
      this.success = 0;
9722
      this.pex = null;
1982 varun.gupt 9723
    }
9724
 
9725
    public long getSuccess() {
9726
      return this.success;
9727
    }
9728
 
3430 rajveer 9729
    public void setSuccess(long success) {
1982 varun.gupt 9730
      this.success = success;
9731
      setSuccessIsSet(true);
9732
    }
9733
 
9734
    public void unsetSuccess() {
9735
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
9736
    }
9737
 
3430 rajveer 9738
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 9739
    public boolean isSetSuccess() {
9740
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
9741
    }
9742
 
9743
    public void setSuccessIsSet(boolean value) {
9744
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
9745
    }
9746
 
9747
    public PromotionException getPex() {
9748
      return this.pex;
9749
    }
9750
 
3430 rajveer 9751
    public void setPex(PromotionException pex) {
1982 varun.gupt 9752
      this.pex = pex;
9753
    }
9754
 
9755
    public void unsetPex() {
9756
      this.pex = null;
9757
    }
9758
 
3430 rajveer 9759
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 9760
    public boolean isSetPex() {
9761
      return this.pex != null;
9762
    }
9763
 
9764
    public void setPexIsSet(boolean value) {
9765
      if (!value) {
9766
        this.pex = null;
9767
      }
9768
    }
9769
 
9770
    public void setFieldValue(_Fields field, Object value) {
9771
      switch (field) {
9772
      case SUCCESS:
9773
        if (value == null) {
9774
          unsetSuccess();
9775
        } else {
9776
          setSuccess((Long)value);
9777
        }
9778
        break;
9779
 
9780
      case PEX:
9781
        if (value == null) {
9782
          unsetPex();
9783
        } else {
9784
          setPex((PromotionException)value);
9785
        }
9786
        break;
9787
 
9788
      }
9789
    }
9790
 
9791
    public Object getFieldValue(_Fields field) {
9792
      switch (field) {
9793
      case SUCCESS:
3430 rajveer 9794
        return Long.valueOf(getSuccess());
1982 varun.gupt 9795
 
9796
      case PEX:
9797
        return getPex();
9798
 
9799
      }
9800
      throw new IllegalStateException();
9801
    }
9802
 
3430 rajveer 9803
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9804
    public boolean isSet(_Fields field) {
9805
      if (field == null) {
9806
        throw new IllegalArgumentException();
9807
      }
1982 varun.gupt 9808
 
9809
      switch (field) {
9810
      case SUCCESS:
9811
        return isSetSuccess();
9812
      case PEX:
9813
        return isSetPex();
9814
      }
9815
      throw new IllegalStateException();
9816
    }
9817
 
9818
    @Override
9819
    public boolean equals(Object that) {
9820
      if (that == null)
9821
        return false;
9822
      if (that instanceof getCouponUsageCountByUser_result)
9823
        return this.equals((getCouponUsageCountByUser_result)that);
9824
      return false;
9825
    }
9826
 
9827
    public boolean equals(getCouponUsageCountByUser_result that) {
9828
      if (that == null)
9829
        return false;
9830
 
9831
      boolean this_present_success = true;
9832
      boolean that_present_success = true;
9833
      if (this_present_success || that_present_success) {
9834
        if (!(this_present_success && that_present_success))
9835
          return false;
9836
        if (this.success != that.success)
9837
          return false;
9838
      }
9839
 
9840
      boolean this_present_pex = true && this.isSetPex();
9841
      boolean that_present_pex = true && that.isSetPex();
9842
      if (this_present_pex || that_present_pex) {
9843
        if (!(this_present_pex && that_present_pex))
9844
          return false;
9845
        if (!this.pex.equals(that.pex))
9846
          return false;
9847
      }
9848
 
9849
      return true;
9850
    }
9851
 
9852
    @Override
9853
    public int hashCode() {
9854
      return 0;
9855
    }
9856
 
9857
    public int compareTo(getCouponUsageCountByUser_result other) {
9858
      if (!getClass().equals(other.getClass())) {
9859
        return getClass().getName().compareTo(other.getClass().getName());
9860
      }
9861
 
9862
      int lastComparison = 0;
9863
      getCouponUsageCountByUser_result typedOther = (getCouponUsageCountByUser_result)other;
9864
 
3430 rajveer 9865
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 9866
      if (lastComparison != 0) {
9867
        return lastComparison;
9868
      }
3430 rajveer 9869
      if (isSetSuccess()) {
9870
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
9871
        if (lastComparison != 0) {
9872
          return lastComparison;
9873
        }
1982 varun.gupt 9874
      }
3430 rajveer 9875
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 9876
      if (lastComparison != 0) {
9877
        return lastComparison;
9878
      }
3430 rajveer 9879
      if (isSetPex()) {
9880
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
9881
        if (lastComparison != 0) {
9882
          return lastComparison;
9883
        }
1982 varun.gupt 9884
      }
9885
      return 0;
9886
    }
9887
 
3430 rajveer 9888
    public _Fields fieldForId(int fieldId) {
9889
      return _Fields.findByThriftId(fieldId);
9890
    }
9891
 
9892
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9893
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 9894
      iprot.readStructBegin();
9895
      while (true)
9896
      {
9897
        field = iprot.readFieldBegin();
3430 rajveer 9898
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 9899
          break;
9900
        }
3430 rajveer 9901
        switch (field.id) {
9902
          case 0: // SUCCESS
9903
            if (field.type == org.apache.thrift.protocol.TType.I64) {
9904
              this.success = iprot.readI64();
9905
              setSuccessIsSet(true);
9906
            } else { 
9907
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9908
            }
9909
            break;
9910
          case 1: // PEX
9911
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
9912
              this.pex = new PromotionException();
9913
              this.pex.read(iprot);
9914
            } else { 
9915
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9916
            }
9917
            break;
9918
          default:
9919
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 9920
        }
3430 rajveer 9921
        iprot.readFieldEnd();
1982 varun.gupt 9922
      }
9923
      iprot.readStructEnd();
9924
      validate();
9925
    }
9926
 
3430 rajveer 9927
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 9928
      oprot.writeStructBegin(STRUCT_DESC);
9929
 
9930
      if (this.isSetSuccess()) {
9931
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
9932
        oprot.writeI64(this.success);
9933
        oprot.writeFieldEnd();
9934
      } else if (this.isSetPex()) {
9935
        oprot.writeFieldBegin(PEX_FIELD_DESC);
9936
        this.pex.write(oprot);
9937
        oprot.writeFieldEnd();
9938
      }
9939
      oprot.writeFieldStop();
9940
      oprot.writeStructEnd();
9941
    }
9942
 
9943
    @Override
9944
    public String toString() {
9945
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_result(");
9946
      boolean first = true;
9947
 
9948
      sb.append("success:");
9949
      sb.append(this.success);
9950
      first = false;
9951
      if (!first) sb.append(", ");
9952
      sb.append("pex:");
9953
      if (this.pex == null) {
9954
        sb.append("null");
9955
      } else {
9956
        sb.append(this.pex);
9957
      }
9958
      first = false;
9959
      sb.append(")");
9960
      return sb.toString();
9961
    }
9962
 
3430 rajveer 9963
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 9964
      // check for required fields
9965
    }
9966
 
3430 rajveer 9967
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9968
      try {
9969
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9970
      } catch (org.apache.thrift.TException te) {
9971
        throw new java.io.IOException(te);
9972
      }
9973
    }
9974
 
9975
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9976
      try {
9977
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9978
      } catch (org.apache.thrift.TException te) {
9979
        throw new java.io.IOException(te);
9980
      }
9981
    }
9982
 
1982 varun.gupt 9983
  }
9984
 
6497 amit.gupta 9985
  public static class getActiveCodes_args implements org.apache.thrift.TBase<getActiveCodes_args, getActiveCodes_args._Fields>, java.io.Serializable, Cloneable   {
9986
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCodes_args");
9987
 
9988
    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);
9989
 
9990
    private long promotionId; // required
9991
 
9992
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9993
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
9994
      PROMOTION_ID((short)1, "promotionId");
9995
 
9996
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9997
 
9998
      static {
9999
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10000
          byName.put(field.getFieldName(), field);
10001
        }
10002
      }
10003
 
10004
      /**
10005
       * Find the _Fields constant that matches fieldId, or null if its not found.
10006
       */
10007
      public static _Fields findByThriftId(int fieldId) {
10008
        switch(fieldId) {
10009
          case 1: // PROMOTION_ID
10010
            return PROMOTION_ID;
10011
          default:
10012
            return null;
10013
        }
10014
      }
10015
 
10016
      /**
10017
       * Find the _Fields constant that matches fieldId, throwing an exception
10018
       * if it is not found.
10019
       */
10020
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10021
        _Fields fields = findByThriftId(fieldId);
10022
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10023
        return fields;
10024
      }
10025
 
10026
      /**
10027
       * Find the _Fields constant that matches name, or null if its not found.
10028
       */
10029
      public static _Fields findByName(String name) {
10030
        return byName.get(name);
10031
      }
10032
 
10033
      private final short _thriftId;
10034
      private final String _fieldName;
10035
 
10036
      _Fields(short thriftId, String fieldName) {
10037
        _thriftId = thriftId;
10038
        _fieldName = fieldName;
10039
      }
10040
 
10041
      public short getThriftFieldId() {
10042
        return _thriftId;
10043
      }
10044
 
10045
      public String getFieldName() {
10046
        return _fieldName;
10047
      }
10048
    }
10049
 
10050
    // isset id assignments
10051
    private static final int __PROMOTIONID_ISSET_ID = 0;
10052
    private BitSet __isset_bit_vector = new BitSet(1);
10053
 
10054
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
10055
    static {
10056
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10057
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10058
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
10059
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10060
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCodes_args.class, metaDataMap);
10061
    }
10062
 
10063
    public getActiveCodes_args() {
10064
    }
10065
 
10066
    public getActiveCodes_args(
10067
      long promotionId)
10068
    {
10069
      this();
10070
      this.promotionId = promotionId;
10071
      setPromotionIdIsSet(true);
10072
    }
10073
 
10074
    /**
10075
     * Performs a deep copy on <i>other</i>.
10076
     */
10077
    public getActiveCodes_args(getActiveCodes_args other) {
10078
      __isset_bit_vector.clear();
10079
      __isset_bit_vector.or(other.__isset_bit_vector);
10080
      this.promotionId = other.promotionId;
10081
    }
10082
 
10083
    public getActiveCodes_args deepCopy() {
10084
      return new getActiveCodes_args(this);
10085
    }
10086
 
10087
    @Override
10088
    public void clear() {
10089
      setPromotionIdIsSet(false);
10090
      this.promotionId = 0;
10091
    }
10092
 
10093
    public long getPromotionId() {
10094
      return this.promotionId;
10095
    }
10096
 
10097
    public void setPromotionId(long promotionId) {
10098
      this.promotionId = promotionId;
10099
      setPromotionIdIsSet(true);
10100
    }
10101
 
10102
    public void unsetPromotionId() {
10103
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
10104
    }
10105
 
10106
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
10107
    public boolean isSetPromotionId() {
10108
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
10109
    }
10110
 
10111
    public void setPromotionIdIsSet(boolean value) {
10112
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
10113
    }
10114
 
10115
    public void setFieldValue(_Fields field, Object value) {
10116
      switch (field) {
10117
      case PROMOTION_ID:
10118
        if (value == null) {
10119
          unsetPromotionId();
10120
        } else {
10121
          setPromotionId((Long)value);
10122
        }
10123
        break;
10124
 
10125
      }
10126
    }
10127
 
10128
    public Object getFieldValue(_Fields field) {
10129
      switch (field) {
10130
      case PROMOTION_ID:
10131
        return Long.valueOf(getPromotionId());
10132
 
10133
      }
10134
      throw new IllegalStateException();
10135
    }
10136
 
10137
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10138
    public boolean isSet(_Fields field) {
10139
      if (field == null) {
10140
        throw new IllegalArgumentException();
10141
      }
10142
 
10143
      switch (field) {
10144
      case PROMOTION_ID:
10145
        return isSetPromotionId();
10146
      }
10147
      throw new IllegalStateException();
10148
    }
10149
 
10150
    @Override
10151
    public boolean equals(Object that) {
10152
      if (that == null)
10153
        return false;
10154
      if (that instanceof getActiveCodes_args)
10155
        return this.equals((getActiveCodes_args)that);
10156
      return false;
10157
    }
10158
 
10159
    public boolean equals(getActiveCodes_args that) {
10160
      if (that == null)
10161
        return false;
10162
 
10163
      boolean this_present_promotionId = true;
10164
      boolean that_present_promotionId = true;
10165
      if (this_present_promotionId || that_present_promotionId) {
10166
        if (!(this_present_promotionId && that_present_promotionId))
10167
          return false;
10168
        if (this.promotionId != that.promotionId)
10169
          return false;
10170
      }
10171
 
10172
      return true;
10173
    }
10174
 
10175
    @Override
10176
    public int hashCode() {
10177
      return 0;
10178
    }
10179
 
10180
    public int compareTo(getActiveCodes_args other) {
10181
      if (!getClass().equals(other.getClass())) {
10182
        return getClass().getName().compareTo(other.getClass().getName());
10183
      }
10184
 
10185
      int lastComparison = 0;
10186
      getActiveCodes_args typedOther = (getActiveCodes_args)other;
10187
 
10188
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
10189
      if (lastComparison != 0) {
10190
        return lastComparison;
10191
      }
10192
      if (isSetPromotionId()) {
10193
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
10194
        if (lastComparison != 0) {
10195
          return lastComparison;
10196
        }
10197
      }
10198
      return 0;
10199
    }
10200
 
10201
    public _Fields fieldForId(int fieldId) {
10202
      return _Fields.findByThriftId(fieldId);
10203
    }
10204
 
10205
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10206
      org.apache.thrift.protocol.TField field;
10207
      iprot.readStructBegin();
10208
      while (true)
10209
      {
10210
        field = iprot.readFieldBegin();
10211
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
10212
          break;
10213
        }
10214
        switch (field.id) {
10215
          case 1: // PROMOTION_ID
10216
            if (field.type == org.apache.thrift.protocol.TType.I64) {
10217
              this.promotionId = iprot.readI64();
10218
              setPromotionIdIsSet(true);
10219
            } else { 
10220
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10221
            }
10222
            break;
10223
          default:
10224
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10225
        }
10226
        iprot.readFieldEnd();
10227
      }
10228
      iprot.readStructEnd();
10229
      validate();
10230
    }
10231
 
10232
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
10233
      validate();
10234
 
10235
      oprot.writeStructBegin(STRUCT_DESC);
10236
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
10237
      oprot.writeI64(this.promotionId);
10238
      oprot.writeFieldEnd();
10239
      oprot.writeFieldStop();
10240
      oprot.writeStructEnd();
10241
    }
10242
 
10243
    @Override
10244
    public String toString() {
10245
      StringBuilder sb = new StringBuilder("getActiveCodes_args(");
10246
      boolean first = true;
10247
 
10248
      sb.append("promotionId:");
10249
      sb.append(this.promotionId);
10250
      first = false;
10251
      sb.append(")");
10252
      return sb.toString();
10253
    }
10254
 
10255
    public void validate() throws org.apache.thrift.TException {
10256
      // check for required fields
10257
    }
10258
 
10259
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10260
      try {
10261
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10262
      } catch (org.apache.thrift.TException te) {
10263
        throw new java.io.IOException(te);
10264
      }
10265
    }
10266
 
10267
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10268
      try {
10269
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
10270
        __isset_bit_vector = new BitSet(1);
10271
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10272
      } catch (org.apache.thrift.TException te) {
10273
        throw new java.io.IOException(te);
10274
      }
10275
    }
10276
 
10277
  }
10278
 
10279
  public static class getActiveCodes_result implements org.apache.thrift.TBase<getActiveCodes_result, getActiveCodes_result._Fields>, java.io.Serializable, Cloneable   {
10280
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCodes_result");
10281
 
10282
    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);
10283
    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);
10284
 
10285
    private List<Coupon> success; // required
10286
    private PromotionException pex; // required
10287
 
10288
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
10289
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
10290
      SUCCESS((short)0, "success"),
10291
      PEX((short)1, "pex");
10292
 
10293
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10294
 
10295
      static {
10296
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10297
          byName.put(field.getFieldName(), field);
10298
        }
10299
      }
10300
 
10301
      /**
10302
       * Find the _Fields constant that matches fieldId, or null if its not found.
10303
       */
10304
      public static _Fields findByThriftId(int fieldId) {
10305
        switch(fieldId) {
10306
          case 0: // SUCCESS
10307
            return SUCCESS;
10308
          case 1: // PEX
10309
            return PEX;
10310
          default:
10311
            return null;
10312
        }
10313
      }
10314
 
10315
      /**
10316
       * Find the _Fields constant that matches fieldId, throwing an exception
10317
       * if it is not found.
10318
       */
10319
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10320
        _Fields fields = findByThriftId(fieldId);
10321
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10322
        return fields;
10323
      }
10324
 
10325
      /**
10326
       * Find the _Fields constant that matches name, or null if its not found.
10327
       */
10328
      public static _Fields findByName(String name) {
10329
        return byName.get(name);
10330
      }
10331
 
10332
      private final short _thriftId;
10333
      private final String _fieldName;
10334
 
10335
      _Fields(short thriftId, String fieldName) {
10336
        _thriftId = thriftId;
10337
        _fieldName = fieldName;
10338
      }
10339
 
10340
      public short getThriftFieldId() {
10341
        return _thriftId;
10342
      }
10343
 
10344
      public String getFieldName() {
10345
        return _fieldName;
10346
      }
10347
    }
10348
 
10349
    // isset id assignments
10350
 
10351
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
10352
    static {
10353
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10354
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10355
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
10356
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
10357
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10358
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
10359
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10360
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCodes_result.class, metaDataMap);
10361
    }
10362
 
10363
    public getActiveCodes_result() {
10364
    }
10365
 
10366
    public getActiveCodes_result(
10367
      List<Coupon> success,
10368
      PromotionException pex)
10369
    {
10370
      this();
10371
      this.success = success;
10372
      this.pex = pex;
10373
    }
10374
 
10375
    /**
10376
     * Performs a deep copy on <i>other</i>.
10377
     */
10378
    public getActiveCodes_result(getActiveCodes_result other) {
10379
      if (other.isSetSuccess()) {
10380
        List<Coupon> __this__success = new ArrayList<Coupon>();
10381
        for (Coupon other_element : other.success) {
10382
          __this__success.add(new Coupon(other_element));
10383
        }
10384
        this.success = __this__success;
10385
      }
10386
      if (other.isSetPex()) {
10387
        this.pex = new PromotionException(other.pex);
10388
      }
10389
    }
10390
 
10391
    public getActiveCodes_result deepCopy() {
10392
      return new getActiveCodes_result(this);
10393
    }
10394
 
10395
    @Override
10396
    public void clear() {
10397
      this.success = null;
10398
      this.pex = null;
10399
    }
10400
 
10401
    public int getSuccessSize() {
10402
      return (this.success == null) ? 0 : this.success.size();
10403
    }
10404
 
10405
    public java.util.Iterator<Coupon> getSuccessIterator() {
10406
      return (this.success == null) ? null : this.success.iterator();
10407
    }
10408
 
10409
    public void addToSuccess(Coupon elem) {
10410
      if (this.success == null) {
10411
        this.success = new ArrayList<Coupon>();
10412
      }
10413
      this.success.add(elem);
10414
    }
10415
 
10416
    public List<Coupon> getSuccess() {
10417
      return this.success;
10418
    }
10419
 
10420
    public void setSuccess(List<Coupon> success) {
10421
      this.success = success;
10422
    }
10423
 
10424
    public void unsetSuccess() {
10425
      this.success = null;
10426
    }
10427
 
10428
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
10429
    public boolean isSetSuccess() {
10430
      return this.success != null;
10431
    }
10432
 
10433
    public void setSuccessIsSet(boolean value) {
10434
      if (!value) {
10435
        this.success = null;
10436
      }
10437
    }
10438
 
10439
    public PromotionException getPex() {
10440
      return this.pex;
10441
    }
10442
 
10443
    public void setPex(PromotionException pex) {
10444
      this.pex = pex;
10445
    }
10446
 
10447
    public void unsetPex() {
10448
      this.pex = null;
10449
    }
10450
 
10451
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
10452
    public boolean isSetPex() {
10453
      return this.pex != null;
10454
    }
10455
 
10456
    public void setPexIsSet(boolean value) {
10457
      if (!value) {
10458
        this.pex = null;
10459
      }
10460
    }
10461
 
10462
    public void setFieldValue(_Fields field, Object value) {
10463
      switch (field) {
10464
      case SUCCESS:
10465
        if (value == null) {
10466
          unsetSuccess();
10467
        } else {
10468
          setSuccess((List<Coupon>)value);
10469
        }
10470
        break;
10471
 
10472
      case PEX:
10473
        if (value == null) {
10474
          unsetPex();
10475
        } else {
10476
          setPex((PromotionException)value);
10477
        }
10478
        break;
10479
 
10480
      }
10481
    }
10482
 
10483
    public Object getFieldValue(_Fields field) {
10484
      switch (field) {
10485
      case SUCCESS:
10486
        return getSuccess();
10487
 
10488
      case PEX:
10489
        return getPex();
10490
 
10491
      }
10492
      throw new IllegalStateException();
10493
    }
10494
 
10495
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10496
    public boolean isSet(_Fields field) {
10497
      if (field == null) {
10498
        throw new IllegalArgumentException();
10499
      }
10500
 
10501
      switch (field) {
10502
      case SUCCESS:
10503
        return isSetSuccess();
10504
      case PEX:
10505
        return isSetPex();
10506
      }
10507
      throw new IllegalStateException();
10508
    }
10509
 
10510
    @Override
10511
    public boolean equals(Object that) {
10512
      if (that == null)
10513
        return false;
10514
      if (that instanceof getActiveCodes_result)
10515
        return this.equals((getActiveCodes_result)that);
10516
      return false;
10517
    }
10518
 
10519
    public boolean equals(getActiveCodes_result that) {
10520
      if (that == null)
10521
        return false;
10522
 
10523
      boolean this_present_success = true && this.isSetSuccess();
10524
      boolean that_present_success = true && that.isSetSuccess();
10525
      if (this_present_success || that_present_success) {
10526
        if (!(this_present_success && that_present_success))
10527
          return false;
10528
        if (!this.success.equals(that.success))
10529
          return false;
10530
      }
10531
 
10532
      boolean this_present_pex = true && this.isSetPex();
10533
      boolean that_present_pex = true && that.isSetPex();
10534
      if (this_present_pex || that_present_pex) {
10535
        if (!(this_present_pex && that_present_pex))
10536
          return false;
10537
        if (!this.pex.equals(that.pex))
10538
          return false;
10539
      }
10540
 
10541
      return true;
10542
    }
10543
 
10544
    @Override
10545
    public int hashCode() {
10546
      return 0;
10547
    }
10548
 
10549
    public int compareTo(getActiveCodes_result other) {
10550
      if (!getClass().equals(other.getClass())) {
10551
        return getClass().getName().compareTo(other.getClass().getName());
10552
      }
10553
 
10554
      int lastComparison = 0;
10555
      getActiveCodes_result typedOther = (getActiveCodes_result)other;
10556
 
10557
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
10558
      if (lastComparison != 0) {
10559
        return lastComparison;
10560
      }
10561
      if (isSetSuccess()) {
10562
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
10563
        if (lastComparison != 0) {
10564
          return lastComparison;
10565
        }
10566
      }
10567
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
10568
      if (lastComparison != 0) {
10569
        return lastComparison;
10570
      }
10571
      if (isSetPex()) {
10572
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
10573
        if (lastComparison != 0) {
10574
          return lastComparison;
10575
        }
10576
      }
10577
      return 0;
10578
    }
10579
 
10580
    public _Fields fieldForId(int fieldId) {
10581
      return _Fields.findByThriftId(fieldId);
10582
    }
10583
 
10584
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10585
      org.apache.thrift.protocol.TField field;
10586
      iprot.readStructBegin();
10587
      while (true)
10588
      {
10589
        field = iprot.readFieldBegin();
10590
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
10591
          break;
10592
        }
10593
        switch (field.id) {
10594
          case 0: // SUCCESS
10595
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
10596
              {
10597
                org.apache.thrift.protocol.TList _list21 = iprot.readListBegin();
10598
                this.success = new ArrayList<Coupon>(_list21.size);
10599
                for (int _i22 = 0; _i22 < _list21.size; ++_i22)
10600
                {
10601
                  Coupon _elem23; // required
10602
                  _elem23 = new Coupon();
10603
                  _elem23.read(iprot);
10604
                  this.success.add(_elem23);
10605
                }
10606
                iprot.readListEnd();
10607
              }
10608
            } else { 
10609
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10610
            }
10611
            break;
10612
          case 1: // PEX
10613
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
10614
              this.pex = new PromotionException();
10615
              this.pex.read(iprot);
10616
            } else { 
10617
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10618
            }
10619
            break;
10620
          default:
10621
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10622
        }
10623
        iprot.readFieldEnd();
10624
      }
10625
      iprot.readStructEnd();
10626
      validate();
10627
    }
10628
 
10629
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
10630
      oprot.writeStructBegin(STRUCT_DESC);
10631
 
10632
      if (this.isSetSuccess()) {
10633
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
10634
        {
10635
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
10636
          for (Coupon _iter24 : this.success)
10637
          {
10638
            _iter24.write(oprot);
10639
          }
10640
          oprot.writeListEnd();
10641
        }
10642
        oprot.writeFieldEnd();
10643
      } else if (this.isSetPex()) {
10644
        oprot.writeFieldBegin(PEX_FIELD_DESC);
10645
        this.pex.write(oprot);
10646
        oprot.writeFieldEnd();
10647
      }
10648
      oprot.writeFieldStop();
10649
      oprot.writeStructEnd();
10650
    }
10651
 
10652
    @Override
10653
    public String toString() {
10654
      StringBuilder sb = new StringBuilder("getActiveCodes_result(");
10655
      boolean first = true;
10656
 
10657
      sb.append("success:");
10658
      if (this.success == null) {
10659
        sb.append("null");
10660
      } else {
10661
        sb.append(this.success);
10662
      }
10663
      first = false;
10664
      if (!first) sb.append(", ");
10665
      sb.append("pex:");
10666
      if (this.pex == null) {
10667
        sb.append("null");
10668
      } else {
10669
        sb.append(this.pex);
10670
      }
10671
      first = false;
10672
      sb.append(")");
10673
      return sb.toString();
10674
    }
10675
 
10676
    public void validate() throws org.apache.thrift.TException {
10677
      // check for required fields
10678
    }
10679
 
10680
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10681
      try {
10682
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10683
      } catch (org.apache.thrift.TException te) {
10684
        throw new java.io.IOException(te);
10685
      }
10686
    }
10687
 
10688
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10689
      try {
10690
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10691
      } catch (org.apache.thrift.TException te) {
10692
        throw new java.io.IOException(te);
10693
      }
10694
    }
10695
 
10696
  }
10697
 
10698
  public static class deleteCoupon_args implements org.apache.thrift.TBase<deleteCoupon_args, deleteCoupon_args._Fields>, java.io.Serializable, Cloneable   {
10699
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteCoupon_args");
10700
 
10701
    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);
10702
 
10703
    private String couponCode; // required
10704
 
10705
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
10706
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
10707
      COUPON_CODE((short)1, "couponCode");
10708
 
10709
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10710
 
10711
      static {
10712
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10713
          byName.put(field.getFieldName(), field);
10714
        }
10715
      }
10716
 
10717
      /**
10718
       * Find the _Fields constant that matches fieldId, or null if its not found.
10719
       */
10720
      public static _Fields findByThriftId(int fieldId) {
10721
        switch(fieldId) {
10722
          case 1: // COUPON_CODE
10723
            return COUPON_CODE;
10724
          default:
10725
            return null;
10726
        }
10727
      }
10728
 
10729
      /**
10730
       * Find the _Fields constant that matches fieldId, throwing an exception
10731
       * if it is not found.
10732
       */
10733
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10734
        _Fields fields = findByThriftId(fieldId);
10735
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10736
        return fields;
10737
      }
10738
 
10739
      /**
10740
       * Find the _Fields constant that matches name, or null if its not found.
10741
       */
10742
      public static _Fields findByName(String name) {
10743
        return byName.get(name);
10744
      }
10745
 
10746
      private final short _thriftId;
10747
      private final String _fieldName;
10748
 
10749
      _Fields(short thriftId, String fieldName) {
10750
        _thriftId = thriftId;
10751
        _fieldName = fieldName;
10752
      }
10753
 
10754
      public short getThriftFieldId() {
10755
        return _thriftId;
10756
      }
10757
 
10758
      public String getFieldName() {
10759
        return _fieldName;
10760
      }
10761
    }
10762
 
10763
    // isset id assignments
10764
 
10765
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
10766
    static {
10767
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10768
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10769
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
10770
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10771
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteCoupon_args.class, metaDataMap);
10772
    }
10773
 
10774
    public deleteCoupon_args() {
10775
    }
10776
 
10777
    public deleteCoupon_args(
10778
      String couponCode)
10779
    {
10780
      this();
10781
      this.couponCode = couponCode;
10782
    }
10783
 
10784
    /**
10785
     * Performs a deep copy on <i>other</i>.
10786
     */
10787
    public deleteCoupon_args(deleteCoupon_args other) {
10788
      if (other.isSetCouponCode()) {
10789
        this.couponCode = other.couponCode;
10790
      }
10791
    }
10792
 
10793
    public deleteCoupon_args deepCopy() {
10794
      return new deleteCoupon_args(this);
10795
    }
10796
 
10797
    @Override
10798
    public void clear() {
10799
      this.couponCode = null;
10800
    }
10801
 
10802
    public String getCouponCode() {
10803
      return this.couponCode;
10804
    }
10805
 
10806
    public void setCouponCode(String couponCode) {
10807
      this.couponCode = couponCode;
10808
    }
10809
 
10810
    public void unsetCouponCode() {
10811
      this.couponCode = null;
10812
    }
10813
 
10814
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
10815
    public boolean isSetCouponCode() {
10816
      return this.couponCode != null;
10817
    }
10818
 
10819
    public void setCouponCodeIsSet(boolean value) {
10820
      if (!value) {
10821
        this.couponCode = null;
10822
      }
10823
    }
10824
 
10825
    public void setFieldValue(_Fields field, Object value) {
10826
      switch (field) {
10827
      case COUPON_CODE:
10828
        if (value == null) {
10829
          unsetCouponCode();
10830
        } else {
10831
          setCouponCode((String)value);
10832
        }
10833
        break;
10834
 
10835
      }
10836
    }
10837
 
10838
    public Object getFieldValue(_Fields field) {
10839
      switch (field) {
10840
      case COUPON_CODE:
10841
        return getCouponCode();
10842
 
10843
      }
10844
      throw new IllegalStateException();
10845
    }
10846
 
10847
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10848
    public boolean isSet(_Fields field) {
10849
      if (field == null) {
10850
        throw new IllegalArgumentException();
10851
      }
10852
 
10853
      switch (field) {
10854
      case COUPON_CODE:
10855
        return isSetCouponCode();
10856
      }
10857
      throw new IllegalStateException();
10858
    }
10859
 
10860
    @Override
10861
    public boolean equals(Object that) {
10862
      if (that == null)
10863
        return false;
10864
      if (that instanceof deleteCoupon_args)
10865
        return this.equals((deleteCoupon_args)that);
10866
      return false;
10867
    }
10868
 
10869
    public boolean equals(deleteCoupon_args that) {
10870
      if (that == null)
10871
        return false;
10872
 
10873
      boolean this_present_couponCode = true && this.isSetCouponCode();
10874
      boolean that_present_couponCode = true && that.isSetCouponCode();
10875
      if (this_present_couponCode || that_present_couponCode) {
10876
        if (!(this_present_couponCode && that_present_couponCode))
10877
          return false;
10878
        if (!this.couponCode.equals(that.couponCode))
10879
          return false;
10880
      }
10881
 
10882
      return true;
10883
    }
10884
 
10885
    @Override
10886
    public int hashCode() {
10887
      return 0;
10888
    }
10889
 
10890
    public int compareTo(deleteCoupon_args other) {
10891
      if (!getClass().equals(other.getClass())) {
10892
        return getClass().getName().compareTo(other.getClass().getName());
10893
      }
10894
 
10895
      int lastComparison = 0;
10896
      deleteCoupon_args typedOther = (deleteCoupon_args)other;
10897
 
10898
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
10899
      if (lastComparison != 0) {
10900
        return lastComparison;
10901
      }
10902
      if (isSetCouponCode()) {
10903
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
10904
        if (lastComparison != 0) {
10905
          return lastComparison;
10906
        }
10907
      }
10908
      return 0;
10909
    }
10910
 
10911
    public _Fields fieldForId(int fieldId) {
10912
      return _Fields.findByThriftId(fieldId);
10913
    }
10914
 
10915
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10916
      org.apache.thrift.protocol.TField field;
10917
      iprot.readStructBegin();
10918
      while (true)
10919
      {
10920
        field = iprot.readFieldBegin();
10921
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
10922
          break;
10923
        }
10924
        switch (field.id) {
10925
          case 1: // COUPON_CODE
10926
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
10927
              this.couponCode = iprot.readString();
10928
            } else { 
10929
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10930
            }
10931
            break;
10932
          default:
10933
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10934
        }
10935
        iprot.readFieldEnd();
10936
      }
10937
      iprot.readStructEnd();
10938
      validate();
10939
    }
10940
 
10941
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
10942
      validate();
10943
 
10944
      oprot.writeStructBegin(STRUCT_DESC);
10945
      if (this.couponCode != null) {
10946
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
10947
        oprot.writeString(this.couponCode);
10948
        oprot.writeFieldEnd();
10949
      }
10950
      oprot.writeFieldStop();
10951
      oprot.writeStructEnd();
10952
    }
10953
 
10954
    @Override
10955
    public String toString() {
10956
      StringBuilder sb = new StringBuilder("deleteCoupon_args(");
10957
      boolean first = true;
10958
 
10959
      sb.append("couponCode:");
10960
      if (this.couponCode == null) {
10961
        sb.append("null");
10962
      } else {
10963
        sb.append(this.couponCode);
10964
      }
10965
      first = false;
10966
      sb.append(")");
10967
      return sb.toString();
10968
    }
10969
 
10970
    public void validate() throws org.apache.thrift.TException {
10971
      // check for required fields
10972
    }
10973
 
10974
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10975
      try {
10976
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10977
      } catch (org.apache.thrift.TException te) {
10978
        throw new java.io.IOException(te);
10979
      }
10980
    }
10981
 
10982
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10983
      try {
10984
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10985
      } catch (org.apache.thrift.TException te) {
10986
        throw new java.io.IOException(te);
10987
      }
10988
    }
10989
 
10990
  }
10991
 
10992
  public static class deleteCoupon_result implements org.apache.thrift.TBase<deleteCoupon_result, deleteCoupon_result._Fields>, java.io.Serializable, Cloneable   {
10993
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteCoupon_result");
10994
 
10995
    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);
10996
 
10997
    private PromotionException pex; // required
10998
 
10999
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11000
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11001
      PEX((short)1, "pex");
11002
 
11003
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11004
 
11005
      static {
11006
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11007
          byName.put(field.getFieldName(), field);
11008
        }
11009
      }
11010
 
11011
      /**
11012
       * Find the _Fields constant that matches fieldId, or null if its not found.
11013
       */
11014
      public static _Fields findByThriftId(int fieldId) {
11015
        switch(fieldId) {
11016
          case 1: // PEX
11017
            return PEX;
11018
          default:
11019
            return null;
11020
        }
11021
      }
11022
 
11023
      /**
11024
       * Find the _Fields constant that matches fieldId, throwing an exception
11025
       * if it is not found.
11026
       */
11027
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11028
        _Fields fields = findByThriftId(fieldId);
11029
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11030
        return fields;
11031
      }
11032
 
11033
      /**
11034
       * Find the _Fields constant that matches name, or null if its not found.
11035
       */
11036
      public static _Fields findByName(String name) {
11037
        return byName.get(name);
11038
      }
11039
 
11040
      private final short _thriftId;
11041
      private final String _fieldName;
11042
 
11043
      _Fields(short thriftId, String fieldName) {
11044
        _thriftId = thriftId;
11045
        _fieldName = fieldName;
11046
      }
11047
 
11048
      public short getThriftFieldId() {
11049
        return _thriftId;
11050
      }
11051
 
11052
      public String getFieldName() {
11053
        return _fieldName;
11054
      }
11055
    }
11056
 
11057
    // isset id assignments
11058
 
11059
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
11060
    static {
11061
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11062
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11063
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
11064
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11065
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteCoupon_result.class, metaDataMap);
11066
    }
11067
 
11068
    public deleteCoupon_result() {
11069
    }
11070
 
11071
    public deleteCoupon_result(
11072
      PromotionException pex)
11073
    {
11074
      this();
11075
      this.pex = pex;
11076
    }
11077
 
11078
    /**
11079
     * Performs a deep copy on <i>other</i>.
11080
     */
11081
    public deleteCoupon_result(deleteCoupon_result other) {
11082
      if (other.isSetPex()) {
11083
        this.pex = new PromotionException(other.pex);
11084
      }
11085
    }
11086
 
11087
    public deleteCoupon_result deepCopy() {
11088
      return new deleteCoupon_result(this);
11089
    }
11090
 
11091
    @Override
11092
    public void clear() {
11093
      this.pex = null;
11094
    }
11095
 
11096
    public PromotionException getPex() {
11097
      return this.pex;
11098
    }
11099
 
11100
    public void setPex(PromotionException pex) {
11101
      this.pex = pex;
11102
    }
11103
 
11104
    public void unsetPex() {
11105
      this.pex = null;
11106
    }
11107
 
11108
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
11109
    public boolean isSetPex() {
11110
      return this.pex != null;
11111
    }
11112
 
11113
    public void setPexIsSet(boolean value) {
11114
      if (!value) {
11115
        this.pex = null;
11116
      }
11117
    }
11118
 
11119
    public void setFieldValue(_Fields field, Object value) {
11120
      switch (field) {
11121
      case PEX:
11122
        if (value == null) {
11123
          unsetPex();
11124
        } else {
11125
          setPex((PromotionException)value);
11126
        }
11127
        break;
11128
 
11129
      }
11130
    }
11131
 
11132
    public Object getFieldValue(_Fields field) {
11133
      switch (field) {
11134
      case PEX:
11135
        return getPex();
11136
 
11137
      }
11138
      throw new IllegalStateException();
11139
    }
11140
 
11141
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11142
    public boolean isSet(_Fields field) {
11143
      if (field == null) {
11144
        throw new IllegalArgumentException();
11145
      }
11146
 
11147
      switch (field) {
11148
      case PEX:
11149
        return isSetPex();
11150
      }
11151
      throw new IllegalStateException();
11152
    }
11153
 
11154
    @Override
11155
    public boolean equals(Object that) {
11156
      if (that == null)
11157
        return false;
11158
      if (that instanceof deleteCoupon_result)
11159
        return this.equals((deleteCoupon_result)that);
11160
      return false;
11161
    }
11162
 
11163
    public boolean equals(deleteCoupon_result that) {
11164
      if (that == null)
11165
        return false;
11166
 
11167
      boolean this_present_pex = true && this.isSetPex();
11168
      boolean that_present_pex = true && that.isSetPex();
11169
      if (this_present_pex || that_present_pex) {
11170
        if (!(this_present_pex && that_present_pex))
11171
          return false;
11172
        if (!this.pex.equals(that.pex))
11173
          return false;
11174
      }
11175
 
11176
      return true;
11177
    }
11178
 
11179
    @Override
11180
    public int hashCode() {
11181
      return 0;
11182
    }
11183
 
11184
    public int compareTo(deleteCoupon_result other) {
11185
      if (!getClass().equals(other.getClass())) {
11186
        return getClass().getName().compareTo(other.getClass().getName());
11187
      }
11188
 
11189
      int lastComparison = 0;
11190
      deleteCoupon_result typedOther = (deleteCoupon_result)other;
11191
 
11192
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
11193
      if (lastComparison != 0) {
11194
        return lastComparison;
11195
      }
11196
      if (isSetPex()) {
11197
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
11198
        if (lastComparison != 0) {
11199
          return lastComparison;
11200
        }
11201
      }
11202
      return 0;
11203
    }
11204
 
11205
    public _Fields fieldForId(int fieldId) {
11206
      return _Fields.findByThriftId(fieldId);
11207
    }
11208
 
11209
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11210
      org.apache.thrift.protocol.TField field;
11211
      iprot.readStructBegin();
11212
      while (true)
11213
      {
11214
        field = iprot.readFieldBegin();
11215
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
11216
          break;
11217
        }
11218
        switch (field.id) {
11219
          case 1: // PEX
11220
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
11221
              this.pex = new PromotionException();
11222
              this.pex.read(iprot);
11223
            } else { 
11224
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11225
            }
11226
            break;
11227
          default:
11228
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11229
        }
11230
        iprot.readFieldEnd();
11231
      }
11232
      iprot.readStructEnd();
11233
      validate();
11234
    }
11235
 
11236
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
11237
      oprot.writeStructBegin(STRUCT_DESC);
11238
 
11239
      if (this.isSetPex()) {
11240
        oprot.writeFieldBegin(PEX_FIELD_DESC);
11241
        this.pex.write(oprot);
11242
        oprot.writeFieldEnd();
11243
      }
11244
      oprot.writeFieldStop();
11245
      oprot.writeStructEnd();
11246
    }
11247
 
11248
    @Override
11249
    public String toString() {
11250
      StringBuilder sb = new StringBuilder("deleteCoupon_result(");
11251
      boolean first = true;
11252
 
11253
      sb.append("pex:");
11254
      if (this.pex == null) {
11255
        sb.append("null");
11256
      } else {
11257
        sb.append(this.pex);
11258
      }
11259
      first = false;
11260
      sb.append(")");
11261
      return sb.toString();
11262
    }
11263
 
11264
    public void validate() throws org.apache.thrift.TException {
11265
      // check for required fields
11266
    }
11267
 
11268
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11269
      try {
11270
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11271
      } catch (org.apache.thrift.TException te) {
11272
        throw new java.io.IOException(te);
11273
      }
11274
    }
11275
 
11276
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11277
      try {
11278
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11279
      } catch (org.apache.thrift.TException te) {
11280
        throw new java.io.IOException(te);
11281
      }
11282
    }
11283
 
11284
  }
11285
 
3430 rajveer 11286
  public static class getActiveCoupons_args implements org.apache.thrift.TBase<getActiveCoupons_args, getActiveCoupons_args._Fields>, java.io.Serializable, Cloneable   {
11287
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_args");
3385 varun.gupt 11288
 
11289
 
11290
 
11291
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 11292
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 11293
;
11294
 
11295
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11296
 
11297
      static {
11298
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11299
          byName.put(field.getFieldName(), field);
11300
        }
11301
      }
11302
 
11303
      /**
11304
       * Find the _Fields constant that matches fieldId, or null if its not found.
11305
       */
11306
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 11307
        switch(fieldId) {
11308
          default:
11309
            return null;
11310
        }
3385 varun.gupt 11311
      }
11312
 
11313
      /**
11314
       * Find the _Fields constant that matches fieldId, throwing an exception
11315
       * if it is not found.
11316
       */
11317
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11318
        _Fields fields = findByThriftId(fieldId);
11319
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11320
        return fields;
11321
      }
11322
 
11323
      /**
11324
       * Find the _Fields constant that matches name, or null if its not found.
11325
       */
11326
      public static _Fields findByName(String name) {
11327
        return byName.get(name);
11328
      }
11329
 
11330
      private final short _thriftId;
11331
      private final String _fieldName;
11332
 
11333
      _Fields(short thriftId, String fieldName) {
11334
        _thriftId = thriftId;
11335
        _fieldName = fieldName;
11336
      }
11337
 
11338
      public short getThriftFieldId() {
11339
        return _thriftId;
11340
      }
11341
 
11342
      public String getFieldName() {
11343
        return _fieldName;
11344
      }
11345
    }
3430 rajveer 11346
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 11347
    static {
3430 rajveer 11348
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11349
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11350
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_args.class, metaDataMap);
3385 varun.gupt 11351
    }
11352
 
11353
    public getActiveCoupons_args() {
11354
    }
11355
 
11356
    /**
11357
     * Performs a deep copy on <i>other</i>.
11358
     */
11359
    public getActiveCoupons_args(getActiveCoupons_args other) {
11360
    }
11361
 
11362
    public getActiveCoupons_args deepCopy() {
11363
      return new getActiveCoupons_args(this);
11364
    }
11365
 
3430 rajveer 11366
    @Override
11367
    public void clear() {
3385 varun.gupt 11368
    }
11369
 
11370
    public void setFieldValue(_Fields field, Object value) {
11371
      switch (field) {
11372
      }
11373
    }
11374
 
11375
    public Object getFieldValue(_Fields field) {
11376
      switch (field) {
11377
      }
11378
      throw new IllegalStateException();
11379
    }
11380
 
3430 rajveer 11381
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11382
    public boolean isSet(_Fields field) {
11383
      if (field == null) {
11384
        throw new IllegalArgumentException();
11385
      }
3385 varun.gupt 11386
 
11387
      switch (field) {
11388
      }
11389
      throw new IllegalStateException();
11390
    }
11391
 
11392
    @Override
11393
    public boolean equals(Object that) {
11394
      if (that == null)
11395
        return false;
11396
      if (that instanceof getActiveCoupons_args)
11397
        return this.equals((getActiveCoupons_args)that);
11398
      return false;
11399
    }
11400
 
11401
    public boolean equals(getActiveCoupons_args that) {
11402
      if (that == null)
11403
        return false;
11404
 
11405
      return true;
11406
    }
11407
 
11408
    @Override
11409
    public int hashCode() {
11410
      return 0;
11411
    }
11412
 
11413
    public int compareTo(getActiveCoupons_args other) {
11414
      if (!getClass().equals(other.getClass())) {
11415
        return getClass().getName().compareTo(other.getClass().getName());
11416
      }
11417
 
11418
      int lastComparison = 0;
11419
      getActiveCoupons_args typedOther = (getActiveCoupons_args)other;
11420
 
11421
      return 0;
11422
    }
11423
 
3430 rajveer 11424
    public _Fields fieldForId(int fieldId) {
11425
      return _Fields.findByThriftId(fieldId);
11426
    }
11427
 
11428
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11429
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 11430
      iprot.readStructBegin();
11431
      while (true)
11432
      {
11433
        field = iprot.readFieldBegin();
3430 rajveer 11434
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 11435
          break;
11436
        }
3430 rajveer 11437
        switch (field.id) {
11438
          default:
11439
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 11440
        }
3430 rajveer 11441
        iprot.readFieldEnd();
3385 varun.gupt 11442
      }
11443
      iprot.readStructEnd();
11444
      validate();
11445
    }
11446
 
3430 rajveer 11447
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 11448
      validate();
11449
 
11450
      oprot.writeStructBegin(STRUCT_DESC);
11451
      oprot.writeFieldStop();
11452
      oprot.writeStructEnd();
11453
    }
11454
 
11455
    @Override
11456
    public String toString() {
11457
      StringBuilder sb = new StringBuilder("getActiveCoupons_args(");
11458
      boolean first = true;
11459
 
11460
      sb.append(")");
11461
      return sb.toString();
11462
    }
11463
 
3430 rajveer 11464
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 11465
      // check for required fields
11466
    }
11467
 
3430 rajveer 11468
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11469
      try {
11470
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11471
      } catch (org.apache.thrift.TException te) {
11472
        throw new java.io.IOException(te);
11473
      }
11474
    }
11475
 
11476
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11477
      try {
11478
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11479
      } catch (org.apache.thrift.TException te) {
11480
        throw new java.io.IOException(te);
11481
      }
11482
    }
11483
 
3385 varun.gupt 11484
  }
11485
 
3430 rajveer 11486
  public static class getActiveCoupons_result implements org.apache.thrift.TBase<getActiveCoupons_result, getActiveCoupons_result._Fields>, java.io.Serializable, Cloneable   {
11487
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_result");
3385 varun.gupt 11488
 
3430 rajveer 11489
    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);
11490
    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 11491
 
3430 rajveer 11492
    private List<Coupon> success; // required
11493
    private PromotionException pex; // required
3385 varun.gupt 11494
 
11495
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 11496
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 11497
      SUCCESS((short)0, "success"),
11498
      PEX((short)1, "pex");
11499
 
11500
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11501
 
11502
      static {
11503
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11504
          byName.put(field.getFieldName(), field);
11505
        }
11506
      }
11507
 
11508
      /**
11509
       * Find the _Fields constant that matches fieldId, or null if its not found.
11510
       */
11511
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 11512
        switch(fieldId) {
11513
          case 0: // SUCCESS
11514
            return SUCCESS;
11515
          case 1: // PEX
11516
            return PEX;
11517
          default:
11518
            return null;
11519
        }
3385 varun.gupt 11520
      }
11521
 
11522
      /**
11523
       * Find the _Fields constant that matches fieldId, throwing an exception
11524
       * if it is not found.
11525
       */
11526
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11527
        _Fields fields = findByThriftId(fieldId);
11528
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11529
        return fields;
11530
      }
11531
 
11532
      /**
11533
       * Find the _Fields constant that matches name, or null if its not found.
11534
       */
11535
      public static _Fields findByName(String name) {
11536
        return byName.get(name);
11537
      }
11538
 
11539
      private final short _thriftId;
11540
      private final String _fieldName;
11541
 
11542
      _Fields(short thriftId, String fieldName) {
11543
        _thriftId = thriftId;
11544
        _fieldName = fieldName;
11545
      }
11546
 
11547
      public short getThriftFieldId() {
11548
        return _thriftId;
11549
      }
11550
 
11551
      public String getFieldName() {
11552
        return _fieldName;
11553
      }
11554
    }
11555
 
11556
    // isset id assignments
11557
 
3430 rajveer 11558
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 11559
    static {
3430 rajveer 11560
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11561
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11562
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
11563
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
11564
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11565
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
11566
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11567
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_result.class, metaDataMap);
3385 varun.gupt 11568
    }
11569
 
11570
    public getActiveCoupons_result() {
11571
    }
11572
 
11573
    public getActiveCoupons_result(
11574
      List<Coupon> success,
11575
      PromotionException pex)
11576
    {
11577
      this();
11578
      this.success = success;
11579
      this.pex = pex;
11580
    }
11581
 
11582
    /**
11583
     * Performs a deep copy on <i>other</i>.
11584
     */
11585
    public getActiveCoupons_result(getActiveCoupons_result other) {
11586
      if (other.isSetSuccess()) {
11587
        List<Coupon> __this__success = new ArrayList<Coupon>();
11588
        for (Coupon other_element : other.success) {
11589
          __this__success.add(new Coupon(other_element));
11590
        }
11591
        this.success = __this__success;
11592
      }
11593
      if (other.isSetPex()) {
11594
        this.pex = new PromotionException(other.pex);
11595
      }
11596
    }
11597
 
11598
    public getActiveCoupons_result deepCopy() {
11599
      return new getActiveCoupons_result(this);
11600
    }
11601
 
3430 rajveer 11602
    @Override
11603
    public void clear() {
11604
      this.success = null;
11605
      this.pex = null;
3385 varun.gupt 11606
    }
11607
 
11608
    public int getSuccessSize() {
11609
      return (this.success == null) ? 0 : this.success.size();
11610
    }
11611
 
11612
    public java.util.Iterator<Coupon> getSuccessIterator() {
11613
      return (this.success == null) ? null : this.success.iterator();
11614
    }
11615
 
11616
    public void addToSuccess(Coupon elem) {
11617
      if (this.success == null) {
11618
        this.success = new ArrayList<Coupon>();
11619
      }
11620
      this.success.add(elem);
11621
    }
11622
 
11623
    public List<Coupon> getSuccess() {
11624
      return this.success;
11625
    }
11626
 
3430 rajveer 11627
    public void setSuccess(List<Coupon> success) {
3385 varun.gupt 11628
      this.success = success;
11629
    }
11630
 
11631
    public void unsetSuccess() {
11632
      this.success = null;
11633
    }
11634
 
3430 rajveer 11635
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 11636
    public boolean isSetSuccess() {
11637
      return this.success != null;
11638
    }
11639
 
11640
    public void setSuccessIsSet(boolean value) {
11641
      if (!value) {
11642
        this.success = null;
11643
      }
11644
    }
11645
 
11646
    public PromotionException getPex() {
11647
      return this.pex;
11648
    }
11649
 
3430 rajveer 11650
    public void setPex(PromotionException pex) {
3385 varun.gupt 11651
      this.pex = pex;
11652
    }
11653
 
11654
    public void unsetPex() {
11655
      this.pex = null;
11656
    }
11657
 
3430 rajveer 11658
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 11659
    public boolean isSetPex() {
11660
      return this.pex != null;
11661
    }
11662
 
11663
    public void setPexIsSet(boolean value) {
11664
      if (!value) {
11665
        this.pex = null;
11666
      }
11667
    }
11668
 
11669
    public void setFieldValue(_Fields field, Object value) {
11670
      switch (field) {
11671
      case SUCCESS:
11672
        if (value == null) {
11673
          unsetSuccess();
11674
        } else {
11675
          setSuccess((List<Coupon>)value);
11676
        }
11677
        break;
11678
 
11679
      case PEX:
11680
        if (value == null) {
11681
          unsetPex();
11682
        } else {
11683
          setPex((PromotionException)value);
11684
        }
11685
        break;
11686
 
11687
      }
11688
    }
11689
 
11690
    public Object getFieldValue(_Fields field) {
11691
      switch (field) {
11692
      case SUCCESS:
11693
        return getSuccess();
11694
 
11695
      case PEX:
11696
        return getPex();
11697
 
11698
      }
11699
      throw new IllegalStateException();
11700
    }
11701
 
3430 rajveer 11702
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11703
    public boolean isSet(_Fields field) {
11704
      if (field == null) {
11705
        throw new IllegalArgumentException();
11706
      }
3385 varun.gupt 11707
 
11708
      switch (field) {
11709
      case SUCCESS:
11710
        return isSetSuccess();
11711
      case PEX:
11712
        return isSetPex();
11713
      }
11714
      throw new IllegalStateException();
11715
    }
11716
 
11717
    @Override
11718
    public boolean equals(Object that) {
11719
      if (that == null)
11720
        return false;
11721
      if (that instanceof getActiveCoupons_result)
11722
        return this.equals((getActiveCoupons_result)that);
11723
      return false;
11724
    }
11725
 
11726
    public boolean equals(getActiveCoupons_result that) {
11727
      if (that == null)
11728
        return false;
11729
 
11730
      boolean this_present_success = true && this.isSetSuccess();
11731
      boolean that_present_success = true && that.isSetSuccess();
11732
      if (this_present_success || that_present_success) {
11733
        if (!(this_present_success && that_present_success))
11734
          return false;
11735
        if (!this.success.equals(that.success))
11736
          return false;
11737
      }
11738
 
11739
      boolean this_present_pex = true && this.isSetPex();
11740
      boolean that_present_pex = true && that.isSetPex();
11741
      if (this_present_pex || that_present_pex) {
11742
        if (!(this_present_pex && that_present_pex))
11743
          return false;
11744
        if (!this.pex.equals(that.pex))
11745
          return false;
11746
      }
11747
 
11748
      return true;
11749
    }
11750
 
11751
    @Override
11752
    public int hashCode() {
11753
      return 0;
11754
    }
11755
 
11756
    public int compareTo(getActiveCoupons_result other) {
11757
      if (!getClass().equals(other.getClass())) {
11758
        return getClass().getName().compareTo(other.getClass().getName());
11759
      }
11760
 
11761
      int lastComparison = 0;
11762
      getActiveCoupons_result typedOther = (getActiveCoupons_result)other;
11763
 
3430 rajveer 11764
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 11765
      if (lastComparison != 0) {
11766
        return lastComparison;
11767
      }
3430 rajveer 11768
      if (isSetSuccess()) {
11769
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
11770
        if (lastComparison != 0) {
11771
          return lastComparison;
11772
        }
3385 varun.gupt 11773
      }
3430 rajveer 11774
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 11775
      if (lastComparison != 0) {
11776
        return lastComparison;
11777
      }
3430 rajveer 11778
      if (isSetPex()) {
11779
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
11780
        if (lastComparison != 0) {
11781
          return lastComparison;
11782
        }
3385 varun.gupt 11783
      }
11784
      return 0;
11785
    }
11786
 
3430 rajveer 11787
    public _Fields fieldForId(int fieldId) {
11788
      return _Fields.findByThriftId(fieldId);
11789
    }
11790
 
11791
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11792
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 11793
      iprot.readStructBegin();
11794
      while (true)
11795
      {
11796
        field = iprot.readFieldBegin();
3430 rajveer 11797
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 11798
          break;
11799
        }
3430 rajveer 11800
        switch (field.id) {
11801
          case 0: // SUCCESS
11802
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
11803
              {
6497 amit.gupta 11804
                org.apache.thrift.protocol.TList _list25 = iprot.readListBegin();
11805
                this.success = new ArrayList<Coupon>(_list25.size);
11806
                for (int _i26 = 0; _i26 < _list25.size; ++_i26)
3385 varun.gupt 11807
                {
6497 amit.gupta 11808
                  Coupon _elem27; // required
11809
                  _elem27 = new Coupon();
11810
                  _elem27.read(iprot);
11811
                  this.success.add(_elem27);
3385 varun.gupt 11812
                }
3430 rajveer 11813
                iprot.readListEnd();
3385 varun.gupt 11814
              }
3430 rajveer 11815
            } else { 
11816
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11817
            }
11818
            break;
11819
          case 1: // PEX
11820
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
11821
              this.pex = new PromotionException();
11822
              this.pex.read(iprot);
11823
            } else { 
11824
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11825
            }
11826
            break;
11827
          default:
11828
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 11829
        }
3430 rajveer 11830
        iprot.readFieldEnd();
3385 varun.gupt 11831
      }
11832
      iprot.readStructEnd();
11833
      validate();
11834
    }
11835
 
3430 rajveer 11836
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 11837
      oprot.writeStructBegin(STRUCT_DESC);
11838
 
11839
      if (this.isSetSuccess()) {
11840
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
11841
        {
3430 rajveer 11842
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
6497 amit.gupta 11843
          for (Coupon _iter28 : this.success)
3385 varun.gupt 11844
          {
6497 amit.gupta 11845
            _iter28.write(oprot);
3385 varun.gupt 11846
          }
11847
          oprot.writeListEnd();
11848
        }
11849
        oprot.writeFieldEnd();
11850
      } else if (this.isSetPex()) {
11851
        oprot.writeFieldBegin(PEX_FIELD_DESC);
11852
        this.pex.write(oprot);
11853
        oprot.writeFieldEnd();
11854
      }
11855
      oprot.writeFieldStop();
11856
      oprot.writeStructEnd();
11857
    }
11858
 
11859
    @Override
11860
    public String toString() {
11861
      StringBuilder sb = new StringBuilder("getActiveCoupons_result(");
11862
      boolean first = true;
11863
 
11864
      sb.append("success:");
11865
      if (this.success == null) {
11866
        sb.append("null");
11867
      } else {
11868
        sb.append(this.success);
11869
      }
11870
      first = false;
11871
      if (!first) sb.append(", ");
11872
      sb.append("pex:");
11873
      if (this.pex == null) {
11874
        sb.append("null");
11875
      } else {
11876
        sb.append(this.pex);
11877
      }
11878
      first = false;
11879
      sb.append(")");
11880
      return sb.toString();
11881
    }
11882
 
3430 rajveer 11883
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 11884
      // check for required fields
11885
    }
11886
 
3430 rajveer 11887
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11888
      try {
11889
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11890
      } catch (org.apache.thrift.TException te) {
11891
        throw new java.io.IOException(te);
11892
      }
11893
    }
11894
 
11895
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11896
      try {
11897
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11898
      } catch (org.apache.thrift.TException te) {
11899
        throw new java.io.IOException(te);
11900
      }
11901
    }
11902
 
3385 varun.gupt 11903
  }
11904
 
6250 amit.gupta 11905
  public static class createCoupon_args implements org.apache.thrift.TBase<createCoupon_args, createCoupon_args._Fields>, java.io.Serializable, Cloneable   {
11906
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_args");
11907
 
11908
    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);
11909
    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)2);
11910
    private static final org.apache.thrift.protocol.TField EMAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("email", org.apache.thrift.protocol.TType.STRING, (short)3);
11911
    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);
6356 amit.gupta 11912
    private static final org.apache.thrift.protocol.TField IS_COD_FIELD_DESC = new org.apache.thrift.protocol.TField("isCod", org.apache.thrift.protocol.TType.BOOL, (short)5);
11913
    private static final org.apache.thrift.protocol.TField USAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("usage", org.apache.thrift.protocol.TType.I64, (short)6);
6250 amit.gupta 11914
 
11915
    private long promotionId; // required
11916
    private long endOn; // required
11917
    private String email; // required
11918
    private long amount; // required
6356 amit.gupta 11919
    private boolean isCod; // required
6250 amit.gupta 11920
    private long usage; // required
11921
 
11922
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11923
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11924
      PROMOTION_ID((short)1, "promotionId"),
11925
      END_ON((short)2, "endOn"),
11926
      EMAIL((short)3, "email"),
11927
      AMOUNT((short)4, "amount"),
6356 amit.gupta 11928
      IS_COD((short)5, "isCod"),
11929
      USAGE((short)6, "usage");
6250 amit.gupta 11930
 
11931
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11932
 
11933
      static {
11934
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11935
          byName.put(field.getFieldName(), field);
11936
        }
11937
      }
11938
 
11939
      /**
11940
       * Find the _Fields constant that matches fieldId, or null if its not found.
11941
       */
11942
      public static _Fields findByThriftId(int fieldId) {
11943
        switch(fieldId) {
11944
          case 1: // PROMOTION_ID
11945
            return PROMOTION_ID;
11946
          case 2: // END_ON
11947
            return END_ON;
11948
          case 3: // EMAIL
11949
            return EMAIL;
11950
          case 4: // AMOUNT
11951
            return AMOUNT;
6356 amit.gupta 11952
          case 5: // IS_COD
11953
            return IS_COD;
11954
          case 6: // USAGE
6250 amit.gupta 11955
            return USAGE;
11956
          default:
11957
            return null;
11958
        }
11959
      }
11960
 
11961
      /**
11962
       * Find the _Fields constant that matches fieldId, throwing an exception
11963
       * if it is not found.
11964
       */
11965
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11966
        _Fields fields = findByThriftId(fieldId);
11967
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11968
        return fields;
11969
      }
11970
 
11971
      /**
11972
       * Find the _Fields constant that matches name, or null if its not found.
11973
       */
11974
      public static _Fields findByName(String name) {
11975
        return byName.get(name);
11976
      }
11977
 
11978
      private final short _thriftId;
11979
      private final String _fieldName;
11980
 
11981
      _Fields(short thriftId, String fieldName) {
11982
        _thriftId = thriftId;
11983
        _fieldName = fieldName;
11984
      }
11985
 
11986
      public short getThriftFieldId() {
11987
        return _thriftId;
11988
      }
11989
 
11990
      public String getFieldName() {
11991
        return _fieldName;
11992
      }
11993
    }
11994
 
11995
    // isset id assignments
11996
    private static final int __PROMOTIONID_ISSET_ID = 0;
11997
    private static final int __ENDON_ISSET_ID = 1;
11998
    private static final int __AMOUNT_ISSET_ID = 2;
6356 amit.gupta 11999
    private static final int __ISCOD_ISSET_ID = 3;
12000
    private static final int __USAGE_ISSET_ID = 4;
12001
    private BitSet __isset_bit_vector = new BitSet(5);
6250 amit.gupta 12002
 
12003
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12004
    static {
12005
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12006
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12007
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
12008
      tmpMap.put(_Fields.END_ON, new org.apache.thrift.meta_data.FieldMetaData("endOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12009
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
12010
      tmpMap.put(_Fields.EMAIL, new org.apache.thrift.meta_data.FieldMetaData("email", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12011
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
12012
      tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12013
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6356 amit.gupta 12014
      tmpMap.put(_Fields.IS_COD, new org.apache.thrift.meta_data.FieldMetaData("isCod", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12015
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
6250 amit.gupta 12016
      tmpMap.put(_Fields.USAGE, new org.apache.thrift.meta_data.FieldMetaData("usage", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12017
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
12018
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12019
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_args.class, metaDataMap);
12020
    }
12021
 
12022
    public createCoupon_args() {
12023
    }
12024
 
12025
    public createCoupon_args(
12026
      long promotionId,
12027
      long endOn,
12028
      String email,
12029
      long amount,
6356 amit.gupta 12030
      boolean isCod,
6250 amit.gupta 12031
      long usage)
12032
    {
12033
      this();
12034
      this.promotionId = promotionId;
12035
      setPromotionIdIsSet(true);
12036
      this.endOn = endOn;
12037
      setEndOnIsSet(true);
12038
      this.email = email;
12039
      this.amount = amount;
12040
      setAmountIsSet(true);
6356 amit.gupta 12041
      this.isCod = isCod;
12042
      setIsCodIsSet(true);
6250 amit.gupta 12043
      this.usage = usage;
12044
      setUsageIsSet(true);
12045
    }
12046
 
12047
    /**
12048
     * Performs a deep copy on <i>other</i>.
12049
     */
12050
    public createCoupon_args(createCoupon_args other) {
12051
      __isset_bit_vector.clear();
12052
      __isset_bit_vector.or(other.__isset_bit_vector);
12053
      this.promotionId = other.promotionId;
12054
      this.endOn = other.endOn;
12055
      if (other.isSetEmail()) {
12056
        this.email = other.email;
12057
      }
12058
      this.amount = other.amount;
6356 amit.gupta 12059
      this.isCod = other.isCod;
6250 amit.gupta 12060
      this.usage = other.usage;
12061
    }
12062
 
12063
    public createCoupon_args deepCopy() {
12064
      return new createCoupon_args(this);
12065
    }
12066
 
12067
    @Override
12068
    public void clear() {
12069
      setPromotionIdIsSet(false);
12070
      this.promotionId = 0;
12071
      setEndOnIsSet(false);
12072
      this.endOn = 0;
12073
      this.email = null;
12074
      setAmountIsSet(false);
12075
      this.amount = 0;
6356 amit.gupta 12076
      setIsCodIsSet(false);
12077
      this.isCod = false;
6250 amit.gupta 12078
      setUsageIsSet(false);
12079
      this.usage = 0;
12080
    }
12081
 
12082
    public long getPromotionId() {
12083
      return this.promotionId;
12084
    }
12085
 
12086
    public void setPromotionId(long promotionId) {
12087
      this.promotionId = promotionId;
12088
      setPromotionIdIsSet(true);
12089
    }
12090
 
12091
    public void unsetPromotionId() {
12092
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
12093
    }
12094
 
12095
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
12096
    public boolean isSetPromotionId() {
12097
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
12098
    }
12099
 
12100
    public void setPromotionIdIsSet(boolean value) {
12101
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
12102
    }
12103
 
12104
    public long getEndOn() {
12105
      return this.endOn;
12106
    }
12107
 
12108
    public void setEndOn(long endOn) {
12109
      this.endOn = endOn;
12110
      setEndOnIsSet(true);
12111
    }
12112
 
12113
    public void unsetEndOn() {
12114
      __isset_bit_vector.clear(__ENDON_ISSET_ID);
12115
    }
12116
 
12117
    /** Returns true if field endOn is set (has been assigned a value) and false otherwise */
12118
    public boolean isSetEndOn() {
12119
      return __isset_bit_vector.get(__ENDON_ISSET_ID);
12120
    }
12121
 
12122
    public void setEndOnIsSet(boolean value) {
12123
      __isset_bit_vector.set(__ENDON_ISSET_ID, value);
12124
    }
12125
 
12126
    public String getEmail() {
12127
      return this.email;
12128
    }
12129
 
12130
    public void setEmail(String email) {
12131
      this.email = email;
12132
    }
12133
 
12134
    public void unsetEmail() {
12135
      this.email = null;
12136
    }
12137
 
12138
    /** Returns true if field email is set (has been assigned a value) and false otherwise */
12139
    public boolean isSetEmail() {
12140
      return this.email != null;
12141
    }
12142
 
12143
    public void setEmailIsSet(boolean value) {
12144
      if (!value) {
12145
        this.email = null;
12146
      }
12147
    }
12148
 
12149
    public long getAmount() {
12150
      return this.amount;
12151
    }
12152
 
12153
    public void setAmount(long amount) {
12154
      this.amount = amount;
12155
      setAmountIsSet(true);
12156
    }
12157
 
12158
    public void unsetAmount() {
12159
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
12160
    }
12161
 
12162
    /** Returns true if field amount is set (has been assigned a value) and false otherwise */
12163
    public boolean isSetAmount() {
12164
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
12165
    }
12166
 
12167
    public void setAmountIsSet(boolean value) {
12168
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
12169
    }
12170
 
6356 amit.gupta 12171
    public boolean isIsCod() {
12172
      return this.isCod;
12173
    }
12174
 
12175
    public void setIsCod(boolean isCod) {
12176
      this.isCod = isCod;
12177
      setIsCodIsSet(true);
12178
    }
12179
 
12180
    public void unsetIsCod() {
12181
      __isset_bit_vector.clear(__ISCOD_ISSET_ID);
12182
    }
12183
 
12184
    /** Returns true if field isCod is set (has been assigned a value) and false otherwise */
12185
    public boolean isSetIsCod() {
12186
      return __isset_bit_vector.get(__ISCOD_ISSET_ID);
12187
    }
12188
 
12189
    public void setIsCodIsSet(boolean value) {
12190
      __isset_bit_vector.set(__ISCOD_ISSET_ID, value);
12191
    }
12192
 
6250 amit.gupta 12193
    public long getUsage() {
12194
      return this.usage;
12195
    }
12196
 
12197
    public void setUsage(long usage) {
12198
      this.usage = usage;
12199
      setUsageIsSet(true);
12200
    }
12201
 
12202
    public void unsetUsage() {
12203
      __isset_bit_vector.clear(__USAGE_ISSET_ID);
12204
    }
12205
 
12206
    /** Returns true if field usage is set (has been assigned a value) and false otherwise */
12207
    public boolean isSetUsage() {
12208
      return __isset_bit_vector.get(__USAGE_ISSET_ID);
12209
    }
12210
 
12211
    public void setUsageIsSet(boolean value) {
12212
      __isset_bit_vector.set(__USAGE_ISSET_ID, value);
12213
    }
12214
 
12215
    public void setFieldValue(_Fields field, Object value) {
12216
      switch (field) {
12217
      case PROMOTION_ID:
12218
        if (value == null) {
12219
          unsetPromotionId();
12220
        } else {
12221
          setPromotionId((Long)value);
12222
        }
12223
        break;
12224
 
12225
      case END_ON:
12226
        if (value == null) {
12227
          unsetEndOn();
12228
        } else {
12229
          setEndOn((Long)value);
12230
        }
12231
        break;
12232
 
12233
      case EMAIL:
12234
        if (value == null) {
12235
          unsetEmail();
12236
        } else {
12237
          setEmail((String)value);
12238
        }
12239
        break;
12240
 
12241
      case AMOUNT:
12242
        if (value == null) {
12243
          unsetAmount();
12244
        } else {
12245
          setAmount((Long)value);
12246
        }
12247
        break;
12248
 
6356 amit.gupta 12249
      case IS_COD:
12250
        if (value == null) {
12251
          unsetIsCod();
12252
        } else {
12253
          setIsCod((Boolean)value);
12254
        }
12255
        break;
12256
 
6250 amit.gupta 12257
      case USAGE:
12258
        if (value == null) {
12259
          unsetUsage();
12260
        } else {
12261
          setUsage((Long)value);
12262
        }
12263
        break;
12264
 
12265
      }
12266
    }
12267
 
12268
    public Object getFieldValue(_Fields field) {
12269
      switch (field) {
12270
      case PROMOTION_ID:
12271
        return Long.valueOf(getPromotionId());
12272
 
12273
      case END_ON:
12274
        return Long.valueOf(getEndOn());
12275
 
12276
      case EMAIL:
12277
        return getEmail();
12278
 
12279
      case AMOUNT:
12280
        return Long.valueOf(getAmount());
12281
 
6356 amit.gupta 12282
      case IS_COD:
12283
        return Boolean.valueOf(isIsCod());
12284
 
6250 amit.gupta 12285
      case USAGE:
12286
        return Long.valueOf(getUsage());
12287
 
12288
      }
12289
      throw new IllegalStateException();
12290
    }
12291
 
12292
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12293
    public boolean isSet(_Fields field) {
12294
      if (field == null) {
12295
        throw new IllegalArgumentException();
12296
      }
12297
 
12298
      switch (field) {
12299
      case PROMOTION_ID:
12300
        return isSetPromotionId();
12301
      case END_ON:
12302
        return isSetEndOn();
12303
      case EMAIL:
12304
        return isSetEmail();
12305
      case AMOUNT:
12306
        return isSetAmount();
6356 amit.gupta 12307
      case IS_COD:
12308
        return isSetIsCod();
6250 amit.gupta 12309
      case USAGE:
12310
        return isSetUsage();
12311
      }
12312
      throw new IllegalStateException();
12313
    }
12314
 
12315
    @Override
12316
    public boolean equals(Object that) {
12317
      if (that == null)
12318
        return false;
12319
      if (that instanceof createCoupon_args)
12320
        return this.equals((createCoupon_args)that);
12321
      return false;
12322
    }
12323
 
12324
    public boolean equals(createCoupon_args that) {
12325
      if (that == null)
12326
        return false;
12327
 
12328
      boolean this_present_promotionId = true;
12329
      boolean that_present_promotionId = true;
12330
      if (this_present_promotionId || that_present_promotionId) {
12331
        if (!(this_present_promotionId && that_present_promotionId))
12332
          return false;
12333
        if (this.promotionId != that.promotionId)
12334
          return false;
12335
      }
12336
 
12337
      boolean this_present_endOn = true;
12338
      boolean that_present_endOn = true;
12339
      if (this_present_endOn || that_present_endOn) {
12340
        if (!(this_present_endOn && that_present_endOn))
12341
          return false;
12342
        if (this.endOn != that.endOn)
12343
          return false;
12344
      }
12345
 
12346
      boolean this_present_email = true && this.isSetEmail();
12347
      boolean that_present_email = true && that.isSetEmail();
12348
      if (this_present_email || that_present_email) {
12349
        if (!(this_present_email && that_present_email))
12350
          return false;
12351
        if (!this.email.equals(that.email))
12352
          return false;
12353
      }
12354
 
12355
      boolean this_present_amount = true;
12356
      boolean that_present_amount = true;
12357
      if (this_present_amount || that_present_amount) {
12358
        if (!(this_present_amount && that_present_amount))
12359
          return false;
12360
        if (this.amount != that.amount)
12361
          return false;
12362
      }
12363
 
6356 amit.gupta 12364
      boolean this_present_isCod = true;
12365
      boolean that_present_isCod = true;
12366
      if (this_present_isCod || that_present_isCod) {
12367
        if (!(this_present_isCod && that_present_isCod))
12368
          return false;
12369
        if (this.isCod != that.isCod)
12370
          return false;
12371
      }
12372
 
6250 amit.gupta 12373
      boolean this_present_usage = true;
12374
      boolean that_present_usage = true;
12375
      if (this_present_usage || that_present_usage) {
12376
        if (!(this_present_usage && that_present_usage))
12377
          return false;
12378
        if (this.usage != that.usage)
12379
          return false;
12380
      }
12381
 
12382
      return true;
12383
    }
12384
 
12385
    @Override
12386
    public int hashCode() {
12387
      return 0;
12388
    }
12389
 
12390
    public int compareTo(createCoupon_args other) {
12391
      if (!getClass().equals(other.getClass())) {
12392
        return getClass().getName().compareTo(other.getClass().getName());
12393
      }
12394
 
12395
      int lastComparison = 0;
12396
      createCoupon_args typedOther = (createCoupon_args)other;
12397
 
12398
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
12399
      if (lastComparison != 0) {
12400
        return lastComparison;
12401
      }
12402
      if (isSetPromotionId()) {
12403
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
12404
        if (lastComparison != 0) {
12405
          return lastComparison;
12406
        }
12407
      }
12408
      lastComparison = Boolean.valueOf(isSetEndOn()).compareTo(typedOther.isSetEndOn());
12409
      if (lastComparison != 0) {
12410
        return lastComparison;
12411
      }
12412
      if (isSetEndOn()) {
12413
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endOn, typedOther.endOn);
12414
        if (lastComparison != 0) {
12415
          return lastComparison;
12416
        }
12417
      }
12418
      lastComparison = Boolean.valueOf(isSetEmail()).compareTo(typedOther.isSetEmail());
12419
      if (lastComparison != 0) {
12420
        return lastComparison;
12421
      }
12422
      if (isSetEmail()) {
12423
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.email, typedOther.email);
12424
        if (lastComparison != 0) {
12425
          return lastComparison;
12426
        }
12427
      }
12428
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
12429
      if (lastComparison != 0) {
12430
        return lastComparison;
12431
      }
12432
      if (isSetAmount()) {
12433
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
12434
        if (lastComparison != 0) {
12435
          return lastComparison;
12436
        }
12437
      }
6356 amit.gupta 12438
      lastComparison = Boolean.valueOf(isSetIsCod()).compareTo(typedOther.isSetIsCod());
12439
      if (lastComparison != 0) {
12440
        return lastComparison;
12441
      }
12442
      if (isSetIsCod()) {
12443
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isCod, typedOther.isCod);
12444
        if (lastComparison != 0) {
12445
          return lastComparison;
12446
        }
12447
      }
6250 amit.gupta 12448
      lastComparison = Boolean.valueOf(isSetUsage()).compareTo(typedOther.isSetUsage());
12449
      if (lastComparison != 0) {
12450
        return lastComparison;
12451
      }
12452
      if (isSetUsage()) {
12453
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.usage, typedOther.usage);
12454
        if (lastComparison != 0) {
12455
          return lastComparison;
12456
        }
12457
      }
12458
      return 0;
12459
    }
12460
 
12461
    public _Fields fieldForId(int fieldId) {
12462
      return _Fields.findByThriftId(fieldId);
12463
    }
12464
 
12465
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12466
      org.apache.thrift.protocol.TField field;
12467
      iprot.readStructBegin();
12468
      while (true)
12469
      {
12470
        field = iprot.readFieldBegin();
12471
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12472
          break;
12473
        }
12474
        switch (field.id) {
12475
          case 1: // PROMOTION_ID
12476
            if (field.type == org.apache.thrift.protocol.TType.I64) {
12477
              this.promotionId = iprot.readI64();
12478
              setPromotionIdIsSet(true);
12479
            } else { 
12480
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12481
            }
12482
            break;
12483
          case 2: // END_ON
12484
            if (field.type == org.apache.thrift.protocol.TType.I64) {
12485
              this.endOn = iprot.readI64();
12486
              setEndOnIsSet(true);
12487
            } else { 
12488
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12489
            }
12490
            break;
12491
          case 3: // EMAIL
12492
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
12493
              this.email = iprot.readString();
12494
            } else { 
12495
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12496
            }
12497
            break;
12498
          case 4: // AMOUNT
12499
            if (field.type == org.apache.thrift.protocol.TType.I64) {
12500
              this.amount = iprot.readI64();
12501
              setAmountIsSet(true);
12502
            } else { 
12503
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12504
            }
12505
            break;
6356 amit.gupta 12506
          case 5: // IS_COD
12507
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
12508
              this.isCod = iprot.readBool();
12509
              setIsCodIsSet(true);
12510
            } else { 
12511
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12512
            }
12513
            break;
12514
          case 6: // USAGE
6250 amit.gupta 12515
            if (field.type == org.apache.thrift.protocol.TType.I64) {
12516
              this.usage = iprot.readI64();
12517
              setUsageIsSet(true);
12518
            } else { 
12519
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12520
            }
12521
            break;
12522
          default:
12523
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12524
        }
12525
        iprot.readFieldEnd();
12526
      }
12527
      iprot.readStructEnd();
12528
      validate();
12529
    }
12530
 
12531
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12532
      validate();
12533
 
12534
      oprot.writeStructBegin(STRUCT_DESC);
12535
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
12536
      oprot.writeI64(this.promotionId);
12537
      oprot.writeFieldEnd();
12538
      oprot.writeFieldBegin(END_ON_FIELD_DESC);
12539
      oprot.writeI64(this.endOn);
12540
      oprot.writeFieldEnd();
12541
      if (this.email != null) {
12542
        oprot.writeFieldBegin(EMAIL_FIELD_DESC);
12543
        oprot.writeString(this.email);
12544
        oprot.writeFieldEnd();
12545
      }
12546
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
12547
      oprot.writeI64(this.amount);
12548
      oprot.writeFieldEnd();
6356 amit.gupta 12549
      oprot.writeFieldBegin(IS_COD_FIELD_DESC);
12550
      oprot.writeBool(this.isCod);
12551
      oprot.writeFieldEnd();
6250 amit.gupta 12552
      oprot.writeFieldBegin(USAGE_FIELD_DESC);
12553
      oprot.writeI64(this.usage);
12554
      oprot.writeFieldEnd();
12555
      oprot.writeFieldStop();
12556
      oprot.writeStructEnd();
12557
    }
12558
 
12559
    @Override
12560
    public String toString() {
12561
      StringBuilder sb = new StringBuilder("createCoupon_args(");
12562
      boolean first = true;
12563
 
12564
      sb.append("promotionId:");
12565
      sb.append(this.promotionId);
12566
      first = false;
12567
      if (!first) sb.append(", ");
12568
      sb.append("endOn:");
12569
      sb.append(this.endOn);
12570
      first = false;
12571
      if (!first) sb.append(", ");
12572
      sb.append("email:");
12573
      if (this.email == null) {
12574
        sb.append("null");
12575
      } else {
12576
        sb.append(this.email);
12577
      }
12578
      first = false;
12579
      if (!first) sb.append(", ");
12580
      sb.append("amount:");
12581
      sb.append(this.amount);
12582
      first = false;
12583
      if (!first) sb.append(", ");
6356 amit.gupta 12584
      sb.append("isCod:");
12585
      sb.append(this.isCod);
12586
      first = false;
12587
      if (!first) sb.append(", ");
6250 amit.gupta 12588
      sb.append("usage:");
12589
      sb.append(this.usage);
12590
      first = false;
12591
      sb.append(")");
12592
      return sb.toString();
12593
    }
12594
 
12595
    public void validate() throws org.apache.thrift.TException {
12596
      // check for required fields
12597
    }
12598
 
12599
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12600
      try {
12601
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12602
      } catch (org.apache.thrift.TException te) {
12603
        throw new java.io.IOException(te);
12604
      }
12605
    }
12606
 
12607
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12608
      try {
12609
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12610
      } catch (org.apache.thrift.TException te) {
12611
        throw new java.io.IOException(te);
12612
      }
12613
    }
12614
 
12615
  }
12616
 
12617
  public static class createCoupon_result implements org.apache.thrift.TBase<createCoupon_result, createCoupon_result._Fields>, java.io.Serializable, Cloneable   {
12618
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_result");
12619
 
12620
    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);
12621
    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);
12622
 
12623
    private String success; // required
12624
    private PromotionException pex; // required
12625
 
12626
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12627
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12628
      SUCCESS((short)0, "success"),
12629
      PEX((short)1, "pex");
12630
 
12631
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12632
 
12633
      static {
12634
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12635
          byName.put(field.getFieldName(), field);
12636
        }
12637
      }
12638
 
12639
      /**
12640
       * Find the _Fields constant that matches fieldId, or null if its not found.
12641
       */
12642
      public static _Fields findByThriftId(int fieldId) {
12643
        switch(fieldId) {
12644
          case 0: // SUCCESS
12645
            return SUCCESS;
12646
          case 1: // PEX
12647
            return PEX;
12648
          default:
12649
            return null;
12650
        }
12651
      }
12652
 
12653
      /**
12654
       * Find the _Fields constant that matches fieldId, throwing an exception
12655
       * if it is not found.
12656
       */
12657
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12658
        _Fields fields = findByThriftId(fieldId);
12659
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12660
        return fields;
12661
      }
12662
 
12663
      /**
12664
       * Find the _Fields constant that matches name, or null if its not found.
12665
       */
12666
      public static _Fields findByName(String name) {
12667
        return byName.get(name);
12668
      }
12669
 
12670
      private final short _thriftId;
12671
      private final String _fieldName;
12672
 
12673
      _Fields(short thriftId, String fieldName) {
12674
        _thriftId = thriftId;
12675
        _fieldName = fieldName;
12676
      }
12677
 
12678
      public short getThriftFieldId() {
12679
        return _thriftId;
12680
      }
12681
 
12682
      public String getFieldName() {
12683
        return _fieldName;
12684
      }
12685
    }
12686
 
12687
    // isset id assignments
12688
 
12689
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12690
    static {
12691
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12692
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12693
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
12694
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12695
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
12696
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12697
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_result.class, metaDataMap);
12698
    }
12699
 
12700
    public createCoupon_result() {
12701
    }
12702
 
12703
    public createCoupon_result(
12704
      String success,
12705
      PromotionException pex)
12706
    {
12707
      this();
12708
      this.success = success;
12709
      this.pex = pex;
12710
    }
12711
 
12712
    /**
12713
     * Performs a deep copy on <i>other</i>.
12714
     */
12715
    public createCoupon_result(createCoupon_result other) {
12716
      if (other.isSetSuccess()) {
12717
        this.success = other.success;
12718
      }
12719
      if (other.isSetPex()) {
12720
        this.pex = new PromotionException(other.pex);
12721
      }
12722
    }
12723
 
12724
    public createCoupon_result deepCopy() {
12725
      return new createCoupon_result(this);
12726
    }
12727
 
12728
    @Override
12729
    public void clear() {
12730
      this.success = null;
12731
      this.pex = null;
12732
    }
12733
 
12734
    public String getSuccess() {
12735
      return this.success;
12736
    }
12737
 
12738
    public void setSuccess(String success) {
12739
      this.success = success;
12740
    }
12741
 
12742
    public void unsetSuccess() {
12743
      this.success = null;
12744
    }
12745
 
12746
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
12747
    public boolean isSetSuccess() {
12748
      return this.success != null;
12749
    }
12750
 
12751
    public void setSuccessIsSet(boolean value) {
12752
      if (!value) {
12753
        this.success = null;
12754
      }
12755
    }
12756
 
12757
    public PromotionException getPex() {
12758
      return this.pex;
12759
    }
12760
 
12761
    public void setPex(PromotionException pex) {
12762
      this.pex = pex;
12763
    }
12764
 
12765
    public void unsetPex() {
12766
      this.pex = null;
12767
    }
12768
 
12769
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
12770
    public boolean isSetPex() {
12771
      return this.pex != null;
12772
    }
12773
 
12774
    public void setPexIsSet(boolean value) {
12775
      if (!value) {
12776
        this.pex = null;
12777
      }
12778
    }
12779
 
12780
    public void setFieldValue(_Fields field, Object value) {
12781
      switch (field) {
12782
      case SUCCESS:
12783
        if (value == null) {
12784
          unsetSuccess();
12785
        } else {
12786
          setSuccess((String)value);
12787
        }
12788
        break;
12789
 
12790
      case PEX:
12791
        if (value == null) {
12792
          unsetPex();
12793
        } else {
12794
          setPex((PromotionException)value);
12795
        }
12796
        break;
12797
 
12798
      }
12799
    }
12800
 
12801
    public Object getFieldValue(_Fields field) {
12802
      switch (field) {
12803
      case SUCCESS:
12804
        return getSuccess();
12805
 
12806
      case PEX:
12807
        return getPex();
12808
 
12809
      }
12810
      throw new IllegalStateException();
12811
    }
12812
 
12813
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12814
    public boolean isSet(_Fields field) {
12815
      if (field == null) {
12816
        throw new IllegalArgumentException();
12817
      }
12818
 
12819
      switch (field) {
12820
      case SUCCESS:
12821
        return isSetSuccess();
12822
      case PEX:
12823
        return isSetPex();
12824
      }
12825
      throw new IllegalStateException();
12826
    }
12827
 
12828
    @Override
12829
    public boolean equals(Object that) {
12830
      if (that == null)
12831
        return false;
12832
      if (that instanceof createCoupon_result)
12833
        return this.equals((createCoupon_result)that);
12834
      return false;
12835
    }
12836
 
12837
    public boolean equals(createCoupon_result that) {
12838
      if (that == null)
12839
        return false;
12840
 
12841
      boolean this_present_success = true && this.isSetSuccess();
12842
      boolean that_present_success = true && that.isSetSuccess();
12843
      if (this_present_success || that_present_success) {
12844
        if (!(this_present_success && that_present_success))
12845
          return false;
12846
        if (!this.success.equals(that.success))
12847
          return false;
12848
      }
12849
 
12850
      boolean this_present_pex = true && this.isSetPex();
12851
      boolean that_present_pex = true && that.isSetPex();
12852
      if (this_present_pex || that_present_pex) {
12853
        if (!(this_present_pex && that_present_pex))
12854
          return false;
12855
        if (!this.pex.equals(that.pex))
12856
          return false;
12857
      }
12858
 
12859
      return true;
12860
    }
12861
 
12862
    @Override
12863
    public int hashCode() {
12864
      return 0;
12865
    }
12866
 
12867
    public int compareTo(createCoupon_result other) {
12868
      if (!getClass().equals(other.getClass())) {
12869
        return getClass().getName().compareTo(other.getClass().getName());
12870
      }
12871
 
12872
      int lastComparison = 0;
12873
      createCoupon_result typedOther = (createCoupon_result)other;
12874
 
12875
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
12876
      if (lastComparison != 0) {
12877
        return lastComparison;
12878
      }
12879
      if (isSetSuccess()) {
12880
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
12881
        if (lastComparison != 0) {
12882
          return lastComparison;
12883
        }
12884
      }
12885
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
12886
      if (lastComparison != 0) {
12887
        return lastComparison;
12888
      }
12889
      if (isSetPex()) {
12890
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
12891
        if (lastComparison != 0) {
12892
          return lastComparison;
12893
        }
12894
      }
12895
      return 0;
12896
    }
12897
 
12898
    public _Fields fieldForId(int fieldId) {
12899
      return _Fields.findByThriftId(fieldId);
12900
    }
12901
 
12902
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12903
      org.apache.thrift.protocol.TField field;
12904
      iprot.readStructBegin();
12905
      while (true)
12906
      {
12907
        field = iprot.readFieldBegin();
12908
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12909
          break;
12910
        }
12911
        switch (field.id) {
12912
          case 0: // SUCCESS
12913
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
12914
              this.success = iprot.readString();
12915
            } else { 
12916
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12917
            }
12918
            break;
12919
          case 1: // PEX
12920
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
12921
              this.pex = new PromotionException();
12922
              this.pex.read(iprot);
12923
            } else { 
12924
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12925
            }
12926
            break;
12927
          default:
12928
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12929
        }
12930
        iprot.readFieldEnd();
12931
      }
12932
      iprot.readStructEnd();
12933
      validate();
12934
    }
12935
 
12936
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12937
      oprot.writeStructBegin(STRUCT_DESC);
12938
 
12939
      if (this.isSetSuccess()) {
12940
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
12941
        oprot.writeString(this.success);
12942
        oprot.writeFieldEnd();
12943
      } else if (this.isSetPex()) {
12944
        oprot.writeFieldBegin(PEX_FIELD_DESC);
12945
        this.pex.write(oprot);
12946
        oprot.writeFieldEnd();
12947
      }
12948
      oprot.writeFieldStop();
12949
      oprot.writeStructEnd();
12950
    }
12951
 
12952
    @Override
12953
    public String toString() {
12954
      StringBuilder sb = new StringBuilder("createCoupon_result(");
12955
      boolean first = true;
12956
 
12957
      sb.append("success:");
12958
      if (this.success == null) {
12959
        sb.append("null");
12960
      } else {
12961
        sb.append(this.success);
12962
      }
12963
      first = false;
12964
      if (!first) sb.append(", ");
12965
      sb.append("pex:");
12966
      if (this.pex == null) {
12967
        sb.append("null");
12968
      } else {
12969
        sb.append(this.pex);
12970
      }
12971
      first = false;
12972
      sb.append(")");
12973
      return sb.toString();
12974
    }
12975
 
12976
    public void validate() throws org.apache.thrift.TException {
12977
      // check for required fields
12978
    }
12979
 
12980
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12981
      try {
12982
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12983
      } catch (org.apache.thrift.TException te) {
12984
        throw new java.io.IOException(te);
12985
      }
12986
    }
12987
 
12988
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12989
      try {
12990
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12991
      } catch (org.apache.thrift.TException te) {
12992
        throw new java.io.IOException(te);
12993
      }
12994
    }
12995
 
12996
  }
12997
 
3430 rajveer 12998
  public static class getSuccessfulPaymentCountForCoupon_args implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_args, getSuccessfulPaymentCountForCoupon_args._Fields>, java.io.Serializable, Cloneable   {
12999
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_args");
3385 varun.gupt 13000
 
3430 rajveer 13001
    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 13002
 
3430 rajveer 13003
    private String couponCode; // required
3385 varun.gupt 13004
 
13005
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 13006
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 13007
      COUPON_CODE((short)1, "couponCode");
13008
 
13009
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13010
 
13011
      static {
13012
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13013
          byName.put(field.getFieldName(), field);
13014
        }
13015
      }
13016
 
13017
      /**
13018
       * Find the _Fields constant that matches fieldId, or null if its not found.
13019
       */
13020
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 13021
        switch(fieldId) {
13022
          case 1: // COUPON_CODE
13023
            return COUPON_CODE;
13024
          default:
13025
            return null;
13026
        }
3385 varun.gupt 13027
      }
13028
 
13029
      /**
13030
       * Find the _Fields constant that matches fieldId, throwing an exception
13031
       * if it is not found.
13032
       */
13033
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13034
        _Fields fields = findByThriftId(fieldId);
13035
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13036
        return fields;
13037
      }
13038
 
13039
      /**
13040
       * Find the _Fields constant that matches name, or null if its not found.
13041
       */
13042
      public static _Fields findByName(String name) {
13043
        return byName.get(name);
13044
      }
13045
 
13046
      private final short _thriftId;
13047
      private final String _fieldName;
13048
 
13049
      _Fields(short thriftId, String fieldName) {
13050
        _thriftId = thriftId;
13051
        _fieldName = fieldName;
13052
      }
13053
 
13054
      public short getThriftFieldId() {
13055
        return _thriftId;
13056
      }
13057
 
13058
      public String getFieldName() {
13059
        return _fieldName;
13060
      }
13061
    }
13062
 
13063
    // isset id assignments
13064
 
3430 rajveer 13065
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 13066
    static {
3430 rajveer 13067
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13068
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13069
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
13070
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13071
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_args.class, metaDataMap);
3385 varun.gupt 13072
    }
13073
 
13074
    public getSuccessfulPaymentCountForCoupon_args() {
13075
    }
13076
 
13077
    public getSuccessfulPaymentCountForCoupon_args(
13078
      String couponCode)
13079
    {
13080
      this();
13081
      this.couponCode = couponCode;
13082
    }
13083
 
13084
    /**
13085
     * Performs a deep copy on <i>other</i>.
13086
     */
13087
    public getSuccessfulPaymentCountForCoupon_args(getSuccessfulPaymentCountForCoupon_args other) {
13088
      if (other.isSetCouponCode()) {
13089
        this.couponCode = other.couponCode;
13090
      }
13091
    }
13092
 
13093
    public getSuccessfulPaymentCountForCoupon_args deepCopy() {
13094
      return new getSuccessfulPaymentCountForCoupon_args(this);
13095
    }
13096
 
3430 rajveer 13097
    @Override
13098
    public void clear() {
13099
      this.couponCode = null;
3385 varun.gupt 13100
    }
13101
 
13102
    public String getCouponCode() {
13103
      return this.couponCode;
13104
    }
13105
 
3430 rajveer 13106
    public void setCouponCode(String couponCode) {
3385 varun.gupt 13107
      this.couponCode = couponCode;
13108
    }
13109
 
13110
    public void unsetCouponCode() {
13111
      this.couponCode = null;
13112
    }
13113
 
3430 rajveer 13114
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3385 varun.gupt 13115
    public boolean isSetCouponCode() {
13116
      return this.couponCode != null;
13117
    }
13118
 
13119
    public void setCouponCodeIsSet(boolean value) {
13120
      if (!value) {
13121
        this.couponCode = null;
13122
      }
13123
    }
13124
 
13125
    public void setFieldValue(_Fields field, Object value) {
13126
      switch (field) {
13127
      case COUPON_CODE:
13128
        if (value == null) {
13129
          unsetCouponCode();
13130
        } else {
13131
          setCouponCode((String)value);
13132
        }
13133
        break;
13134
 
13135
      }
13136
    }
13137
 
13138
    public Object getFieldValue(_Fields field) {
13139
      switch (field) {
13140
      case COUPON_CODE:
13141
        return getCouponCode();
13142
 
13143
      }
13144
      throw new IllegalStateException();
13145
    }
13146
 
3430 rajveer 13147
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13148
    public boolean isSet(_Fields field) {
13149
      if (field == null) {
13150
        throw new IllegalArgumentException();
13151
      }
3385 varun.gupt 13152
 
13153
      switch (field) {
13154
      case COUPON_CODE:
13155
        return isSetCouponCode();
13156
      }
13157
      throw new IllegalStateException();
13158
    }
13159
 
13160
    @Override
13161
    public boolean equals(Object that) {
13162
      if (that == null)
13163
        return false;
13164
      if (that instanceof getSuccessfulPaymentCountForCoupon_args)
13165
        return this.equals((getSuccessfulPaymentCountForCoupon_args)that);
13166
      return false;
13167
    }
13168
 
13169
    public boolean equals(getSuccessfulPaymentCountForCoupon_args that) {
13170
      if (that == null)
13171
        return false;
13172
 
13173
      boolean this_present_couponCode = true && this.isSetCouponCode();
13174
      boolean that_present_couponCode = true && that.isSetCouponCode();
13175
      if (this_present_couponCode || that_present_couponCode) {
13176
        if (!(this_present_couponCode && that_present_couponCode))
13177
          return false;
13178
        if (!this.couponCode.equals(that.couponCode))
13179
          return false;
13180
      }
13181
 
13182
      return true;
13183
    }
13184
 
13185
    @Override
13186
    public int hashCode() {
13187
      return 0;
13188
    }
13189
 
13190
    public int compareTo(getSuccessfulPaymentCountForCoupon_args other) {
13191
      if (!getClass().equals(other.getClass())) {
13192
        return getClass().getName().compareTo(other.getClass().getName());
13193
      }
13194
 
13195
      int lastComparison = 0;
13196
      getSuccessfulPaymentCountForCoupon_args typedOther = (getSuccessfulPaymentCountForCoupon_args)other;
13197
 
3430 rajveer 13198
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3385 varun.gupt 13199
      if (lastComparison != 0) {
13200
        return lastComparison;
13201
      }
3430 rajveer 13202
      if (isSetCouponCode()) {
13203
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
13204
        if (lastComparison != 0) {
13205
          return lastComparison;
13206
        }
3385 varun.gupt 13207
      }
13208
      return 0;
13209
    }
13210
 
3430 rajveer 13211
    public _Fields fieldForId(int fieldId) {
13212
      return _Fields.findByThriftId(fieldId);
13213
    }
13214
 
13215
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13216
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 13217
      iprot.readStructBegin();
13218
      while (true)
13219
      {
13220
        field = iprot.readFieldBegin();
3430 rajveer 13221
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 13222
          break;
13223
        }
3430 rajveer 13224
        switch (field.id) {
13225
          case 1: // COUPON_CODE
13226
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
13227
              this.couponCode = iprot.readString();
13228
            } else { 
13229
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13230
            }
13231
            break;
13232
          default:
13233
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 13234
        }
3430 rajveer 13235
        iprot.readFieldEnd();
3385 varun.gupt 13236
      }
13237
      iprot.readStructEnd();
13238
      validate();
13239
    }
13240
 
3430 rajveer 13241
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 13242
      validate();
13243
 
13244
      oprot.writeStructBegin(STRUCT_DESC);
13245
      if (this.couponCode != null) {
13246
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
13247
        oprot.writeString(this.couponCode);
13248
        oprot.writeFieldEnd();
13249
      }
13250
      oprot.writeFieldStop();
13251
      oprot.writeStructEnd();
13252
    }
13253
 
13254
    @Override
13255
    public String toString() {
13256
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_args(");
13257
      boolean first = true;
13258
 
13259
      sb.append("couponCode:");
13260
      if (this.couponCode == null) {
13261
        sb.append("null");
13262
      } else {
13263
        sb.append(this.couponCode);
13264
      }
13265
      first = false;
13266
      sb.append(")");
13267
      return sb.toString();
13268
    }
13269
 
3430 rajveer 13270
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 13271
      // check for required fields
13272
    }
13273
 
3430 rajveer 13274
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13275
      try {
13276
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13277
      } catch (org.apache.thrift.TException te) {
13278
        throw new java.io.IOException(te);
13279
      }
13280
    }
13281
 
13282
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13283
      try {
13284
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13285
      } catch (org.apache.thrift.TException te) {
13286
        throw new java.io.IOException(te);
13287
      }
13288
    }
13289
 
3385 varun.gupt 13290
  }
13291
 
3430 rajveer 13292
  public static class getSuccessfulPaymentCountForCoupon_result implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_result, getSuccessfulPaymentCountForCoupon_result._Fields>, java.io.Serializable, Cloneable   {
13293
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_result");
3385 varun.gupt 13294
 
3430 rajveer 13295
    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);
13296
    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 13297
 
3430 rajveer 13298
    private long success; // required
13299
    private PromotionException pex; // required
3385 varun.gupt 13300
 
13301
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 13302
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 13303
      SUCCESS((short)0, "success"),
13304
      PEX((short)1, "pex");
13305
 
13306
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13307
 
13308
      static {
13309
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13310
          byName.put(field.getFieldName(), field);
13311
        }
13312
      }
13313
 
13314
      /**
13315
       * Find the _Fields constant that matches fieldId, or null if its not found.
13316
       */
13317
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 13318
        switch(fieldId) {
13319
          case 0: // SUCCESS
13320
            return SUCCESS;
13321
          case 1: // PEX
13322
            return PEX;
13323
          default:
13324
            return null;
13325
        }
3385 varun.gupt 13326
      }
13327
 
13328
      /**
13329
       * Find the _Fields constant that matches fieldId, throwing an exception
13330
       * if it is not found.
13331
       */
13332
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13333
        _Fields fields = findByThriftId(fieldId);
13334
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13335
        return fields;
13336
      }
13337
 
13338
      /**
13339
       * Find the _Fields constant that matches name, or null if its not found.
13340
       */
13341
      public static _Fields findByName(String name) {
13342
        return byName.get(name);
13343
      }
13344
 
13345
      private final short _thriftId;
13346
      private final String _fieldName;
13347
 
13348
      _Fields(short thriftId, String fieldName) {
13349
        _thriftId = thriftId;
13350
        _fieldName = fieldName;
13351
      }
13352
 
13353
      public short getThriftFieldId() {
13354
        return _thriftId;
13355
      }
13356
 
13357
      public String getFieldName() {
13358
        return _fieldName;
13359
      }
13360
    }
13361
 
13362
    // isset id assignments
13363
    private static final int __SUCCESS_ISSET_ID = 0;
13364
    private BitSet __isset_bit_vector = new BitSet(1);
13365
 
3430 rajveer 13366
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 13367
    static {
3430 rajveer 13368
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13369
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13370
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
13371
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13372
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
13373
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13374
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_result.class, metaDataMap);
3385 varun.gupt 13375
    }
13376
 
13377
    public getSuccessfulPaymentCountForCoupon_result() {
13378
    }
13379
 
13380
    public getSuccessfulPaymentCountForCoupon_result(
13381
      long success,
13382
      PromotionException pex)
13383
    {
13384
      this();
13385
      this.success = success;
13386
      setSuccessIsSet(true);
13387
      this.pex = pex;
13388
    }
13389
 
13390
    /**
13391
     * Performs a deep copy on <i>other</i>.
13392
     */
13393
    public getSuccessfulPaymentCountForCoupon_result(getSuccessfulPaymentCountForCoupon_result other) {
13394
      __isset_bit_vector.clear();
13395
      __isset_bit_vector.or(other.__isset_bit_vector);
13396
      this.success = other.success;
13397
      if (other.isSetPex()) {
13398
        this.pex = new PromotionException(other.pex);
13399
      }
13400
    }
13401
 
13402
    public getSuccessfulPaymentCountForCoupon_result deepCopy() {
13403
      return new getSuccessfulPaymentCountForCoupon_result(this);
13404
    }
13405
 
3430 rajveer 13406
    @Override
13407
    public void clear() {
13408
      setSuccessIsSet(false);
13409
      this.success = 0;
13410
      this.pex = null;
3385 varun.gupt 13411
    }
13412
 
13413
    public long getSuccess() {
13414
      return this.success;
13415
    }
13416
 
3430 rajveer 13417
    public void setSuccess(long success) {
3385 varun.gupt 13418
      this.success = success;
13419
      setSuccessIsSet(true);
13420
    }
13421
 
13422
    public void unsetSuccess() {
13423
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
13424
    }
13425
 
3430 rajveer 13426
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 13427
    public boolean isSetSuccess() {
13428
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
13429
    }
13430
 
13431
    public void setSuccessIsSet(boolean value) {
13432
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
13433
    }
13434
 
13435
    public PromotionException getPex() {
13436
      return this.pex;
13437
    }
13438
 
3430 rajveer 13439
    public void setPex(PromotionException pex) {
3385 varun.gupt 13440
      this.pex = pex;
13441
    }
13442
 
13443
    public void unsetPex() {
13444
      this.pex = null;
13445
    }
13446
 
3430 rajveer 13447
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 13448
    public boolean isSetPex() {
13449
      return this.pex != null;
13450
    }
13451
 
13452
    public void setPexIsSet(boolean value) {
13453
      if (!value) {
13454
        this.pex = null;
13455
      }
13456
    }
13457
 
13458
    public void setFieldValue(_Fields field, Object value) {
13459
      switch (field) {
13460
      case SUCCESS:
13461
        if (value == null) {
13462
          unsetSuccess();
13463
        } else {
13464
          setSuccess((Long)value);
13465
        }
13466
        break;
13467
 
13468
      case PEX:
13469
        if (value == null) {
13470
          unsetPex();
13471
        } else {
13472
          setPex((PromotionException)value);
13473
        }
13474
        break;
13475
 
13476
      }
13477
    }
13478
 
13479
    public Object getFieldValue(_Fields field) {
13480
      switch (field) {
13481
      case SUCCESS:
3430 rajveer 13482
        return Long.valueOf(getSuccess());
3385 varun.gupt 13483
 
13484
      case PEX:
13485
        return getPex();
13486
 
13487
      }
13488
      throw new IllegalStateException();
13489
    }
13490
 
3430 rajveer 13491
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13492
    public boolean isSet(_Fields field) {
13493
      if (field == null) {
13494
        throw new IllegalArgumentException();
13495
      }
3385 varun.gupt 13496
 
13497
      switch (field) {
13498
      case SUCCESS:
13499
        return isSetSuccess();
13500
      case PEX:
13501
        return isSetPex();
13502
      }
13503
      throw new IllegalStateException();
13504
    }
13505
 
13506
    @Override
13507
    public boolean equals(Object that) {
13508
      if (that == null)
13509
        return false;
13510
      if (that instanceof getSuccessfulPaymentCountForCoupon_result)
13511
        return this.equals((getSuccessfulPaymentCountForCoupon_result)that);
13512
      return false;
13513
    }
13514
 
13515
    public boolean equals(getSuccessfulPaymentCountForCoupon_result that) {
13516
      if (that == null)
13517
        return false;
13518
 
13519
      boolean this_present_success = true;
13520
      boolean that_present_success = true;
13521
      if (this_present_success || that_present_success) {
13522
        if (!(this_present_success && that_present_success))
13523
          return false;
13524
        if (this.success != that.success)
13525
          return false;
13526
      }
13527
 
13528
      boolean this_present_pex = true && this.isSetPex();
13529
      boolean that_present_pex = true && that.isSetPex();
13530
      if (this_present_pex || that_present_pex) {
13531
        if (!(this_present_pex && that_present_pex))
13532
          return false;
13533
        if (!this.pex.equals(that.pex))
13534
          return false;
13535
      }
13536
 
13537
      return true;
13538
    }
13539
 
13540
    @Override
13541
    public int hashCode() {
13542
      return 0;
13543
    }
13544
 
13545
    public int compareTo(getSuccessfulPaymentCountForCoupon_result other) {
13546
      if (!getClass().equals(other.getClass())) {
13547
        return getClass().getName().compareTo(other.getClass().getName());
13548
      }
13549
 
13550
      int lastComparison = 0;
13551
      getSuccessfulPaymentCountForCoupon_result typedOther = (getSuccessfulPaymentCountForCoupon_result)other;
13552
 
3430 rajveer 13553
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 13554
      if (lastComparison != 0) {
13555
        return lastComparison;
13556
      }
3430 rajveer 13557
      if (isSetSuccess()) {
13558
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
13559
        if (lastComparison != 0) {
13560
          return lastComparison;
13561
        }
3385 varun.gupt 13562
      }
3430 rajveer 13563
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 13564
      if (lastComparison != 0) {
13565
        return lastComparison;
13566
      }
3430 rajveer 13567
      if (isSetPex()) {
13568
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
13569
        if (lastComparison != 0) {
13570
          return lastComparison;
13571
        }
3385 varun.gupt 13572
      }
13573
      return 0;
13574
    }
13575
 
3430 rajveer 13576
    public _Fields fieldForId(int fieldId) {
13577
      return _Fields.findByThriftId(fieldId);
13578
    }
13579
 
13580
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13581
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 13582
      iprot.readStructBegin();
13583
      while (true)
13584
      {
13585
        field = iprot.readFieldBegin();
3430 rajveer 13586
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 13587
          break;
13588
        }
3430 rajveer 13589
        switch (field.id) {
13590
          case 0: // SUCCESS
13591
            if (field.type == org.apache.thrift.protocol.TType.I64) {
13592
              this.success = iprot.readI64();
13593
              setSuccessIsSet(true);
13594
            } else { 
13595
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13596
            }
13597
            break;
13598
          case 1: // PEX
13599
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
13600
              this.pex = new PromotionException();
13601
              this.pex.read(iprot);
13602
            } else { 
13603
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13604
            }
13605
            break;
13606
          default:
13607
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 13608
        }
3430 rajveer 13609
        iprot.readFieldEnd();
3385 varun.gupt 13610
      }
13611
      iprot.readStructEnd();
13612
      validate();
13613
    }
13614
 
3430 rajveer 13615
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 13616
      oprot.writeStructBegin(STRUCT_DESC);
13617
 
13618
      if (this.isSetSuccess()) {
13619
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
13620
        oprot.writeI64(this.success);
13621
        oprot.writeFieldEnd();
13622
      } else if (this.isSetPex()) {
13623
        oprot.writeFieldBegin(PEX_FIELD_DESC);
13624
        this.pex.write(oprot);
13625
        oprot.writeFieldEnd();
13626
      }
13627
      oprot.writeFieldStop();
13628
      oprot.writeStructEnd();
13629
    }
13630
 
13631
    @Override
13632
    public String toString() {
13633
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_result(");
13634
      boolean first = true;
13635
 
13636
      sb.append("success:");
13637
      sb.append(this.success);
13638
      first = false;
13639
      if (!first) sb.append(", ");
13640
      sb.append("pex:");
13641
      if (this.pex == null) {
13642
        sb.append("null");
13643
      } else {
13644
        sb.append(this.pex);
13645
      }
13646
      first = false;
13647
      sb.append(")");
13648
      return sb.toString();
13649
    }
13650
 
3430 rajveer 13651
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 13652
      // check for required fields
13653
    }
13654
 
3430 rajveer 13655
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13656
      try {
13657
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13658
      } catch (org.apache.thrift.TException te) {
13659
        throw new java.io.IOException(te);
13660
      }
13661
    }
13662
 
13663
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13664
      try {
13665
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13666
      } catch (org.apache.thrift.TException te) {
13667
        throw new java.io.IOException(te);
13668
      }
13669
    }
13670
 
3385 varun.gupt 13671
  }
13672
 
3430 rajveer 13673
  public static class getRuleDocString_args implements org.apache.thrift.TBase<getRuleDocString_args, getRuleDocString_args._Fields>, java.io.Serializable, Cloneable   {
13674
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_args");
3385 varun.gupt 13675
 
3430 rajveer 13676
    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 13677
 
3430 rajveer 13678
    private String ruleName; // required
3385 varun.gupt 13679
 
13680
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 13681
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 13682
      RULE_NAME((short)1, "ruleName");
13683
 
13684
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13685
 
13686
      static {
13687
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13688
          byName.put(field.getFieldName(), field);
13689
        }
13690
      }
13691
 
13692
      /**
13693
       * Find the _Fields constant that matches fieldId, or null if its not found.
13694
       */
13695
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 13696
        switch(fieldId) {
13697
          case 1: // RULE_NAME
13698
            return RULE_NAME;
13699
          default:
13700
            return null;
13701
        }
3385 varun.gupt 13702
      }
13703
 
13704
      /**
13705
       * Find the _Fields constant that matches fieldId, throwing an exception
13706
       * if it is not found.
13707
       */
13708
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13709
        _Fields fields = findByThriftId(fieldId);
13710
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13711
        return fields;
13712
      }
13713
 
13714
      /**
13715
       * Find the _Fields constant that matches name, or null if its not found.
13716
       */
13717
      public static _Fields findByName(String name) {
13718
        return byName.get(name);
13719
      }
13720
 
13721
      private final short _thriftId;
13722
      private final String _fieldName;
13723
 
13724
      _Fields(short thriftId, String fieldName) {
13725
        _thriftId = thriftId;
13726
        _fieldName = fieldName;
13727
      }
13728
 
13729
      public short getThriftFieldId() {
13730
        return _thriftId;
13731
      }
13732
 
13733
      public String getFieldName() {
13734
        return _fieldName;
13735
      }
13736
    }
13737
 
13738
    // isset id assignments
13739
 
3430 rajveer 13740
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 13741
    static {
3430 rajveer 13742
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13743
      tmpMap.put(_Fields.RULE_NAME, new org.apache.thrift.meta_data.FieldMetaData("ruleName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13744
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
13745
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13746
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_args.class, metaDataMap);
3385 varun.gupt 13747
    }
13748
 
13749
    public getRuleDocString_args() {
13750
    }
13751
 
13752
    public getRuleDocString_args(
13753
      String ruleName)
13754
    {
13755
      this();
13756
      this.ruleName = ruleName;
13757
    }
13758
 
13759
    /**
13760
     * Performs a deep copy on <i>other</i>.
13761
     */
13762
    public getRuleDocString_args(getRuleDocString_args other) {
13763
      if (other.isSetRuleName()) {
13764
        this.ruleName = other.ruleName;
13765
      }
13766
    }
13767
 
13768
    public getRuleDocString_args deepCopy() {
13769
      return new getRuleDocString_args(this);
13770
    }
13771
 
3430 rajveer 13772
    @Override
13773
    public void clear() {
13774
      this.ruleName = null;
3385 varun.gupt 13775
    }
13776
 
13777
    public String getRuleName() {
13778
      return this.ruleName;
13779
    }
13780
 
3430 rajveer 13781
    public void setRuleName(String ruleName) {
3385 varun.gupt 13782
      this.ruleName = ruleName;
13783
    }
13784
 
13785
    public void unsetRuleName() {
13786
      this.ruleName = null;
13787
    }
13788
 
3430 rajveer 13789
    /** Returns true if field ruleName is set (has been assigned a value) and false otherwise */
3385 varun.gupt 13790
    public boolean isSetRuleName() {
13791
      return this.ruleName != null;
13792
    }
13793
 
13794
    public void setRuleNameIsSet(boolean value) {
13795
      if (!value) {
13796
        this.ruleName = null;
13797
      }
13798
    }
13799
 
13800
    public void setFieldValue(_Fields field, Object value) {
13801
      switch (field) {
13802
      case RULE_NAME:
13803
        if (value == null) {
13804
          unsetRuleName();
13805
        } else {
13806
          setRuleName((String)value);
13807
        }
13808
        break;
13809
 
13810
      }
13811
    }
13812
 
13813
    public Object getFieldValue(_Fields field) {
13814
      switch (field) {
13815
      case RULE_NAME:
13816
        return getRuleName();
13817
 
13818
      }
13819
      throw new IllegalStateException();
13820
    }
13821
 
3430 rajveer 13822
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13823
    public boolean isSet(_Fields field) {
13824
      if (field == null) {
13825
        throw new IllegalArgumentException();
13826
      }
3385 varun.gupt 13827
 
13828
      switch (field) {
13829
      case RULE_NAME:
13830
        return isSetRuleName();
13831
      }
13832
      throw new IllegalStateException();
13833
    }
13834
 
13835
    @Override
13836
    public boolean equals(Object that) {
13837
      if (that == null)
13838
        return false;
13839
      if (that instanceof getRuleDocString_args)
13840
        return this.equals((getRuleDocString_args)that);
13841
      return false;
13842
    }
13843
 
13844
    public boolean equals(getRuleDocString_args that) {
13845
      if (that == null)
13846
        return false;
13847
 
13848
      boolean this_present_ruleName = true && this.isSetRuleName();
13849
      boolean that_present_ruleName = true && that.isSetRuleName();
13850
      if (this_present_ruleName || that_present_ruleName) {
13851
        if (!(this_present_ruleName && that_present_ruleName))
13852
          return false;
13853
        if (!this.ruleName.equals(that.ruleName))
13854
          return false;
13855
      }
13856
 
13857
      return true;
13858
    }
13859
 
13860
    @Override
13861
    public int hashCode() {
13862
      return 0;
13863
    }
13864
 
13865
    public int compareTo(getRuleDocString_args other) {
13866
      if (!getClass().equals(other.getClass())) {
13867
        return getClass().getName().compareTo(other.getClass().getName());
13868
      }
13869
 
13870
      int lastComparison = 0;
13871
      getRuleDocString_args typedOther = (getRuleDocString_args)other;
13872
 
3430 rajveer 13873
      lastComparison = Boolean.valueOf(isSetRuleName()).compareTo(typedOther.isSetRuleName());
3385 varun.gupt 13874
      if (lastComparison != 0) {
13875
        return lastComparison;
13876
      }
3430 rajveer 13877
      if (isSetRuleName()) {
13878
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleName, typedOther.ruleName);
13879
        if (lastComparison != 0) {
13880
          return lastComparison;
13881
        }
3385 varun.gupt 13882
      }
13883
      return 0;
13884
    }
13885
 
3430 rajveer 13886
    public _Fields fieldForId(int fieldId) {
13887
      return _Fields.findByThriftId(fieldId);
13888
    }
13889
 
13890
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13891
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 13892
      iprot.readStructBegin();
13893
      while (true)
13894
      {
13895
        field = iprot.readFieldBegin();
3430 rajveer 13896
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 13897
          break;
13898
        }
3430 rajveer 13899
        switch (field.id) {
13900
          case 1: // RULE_NAME
13901
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
13902
              this.ruleName = iprot.readString();
13903
            } else { 
13904
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13905
            }
13906
            break;
13907
          default:
13908
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 13909
        }
3430 rajveer 13910
        iprot.readFieldEnd();
3385 varun.gupt 13911
      }
13912
      iprot.readStructEnd();
13913
      validate();
13914
    }
13915
 
3430 rajveer 13916
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 13917
      validate();
13918
 
13919
      oprot.writeStructBegin(STRUCT_DESC);
13920
      if (this.ruleName != null) {
13921
        oprot.writeFieldBegin(RULE_NAME_FIELD_DESC);
13922
        oprot.writeString(this.ruleName);
13923
        oprot.writeFieldEnd();
13924
      }
13925
      oprot.writeFieldStop();
13926
      oprot.writeStructEnd();
13927
    }
13928
 
13929
    @Override
13930
    public String toString() {
13931
      StringBuilder sb = new StringBuilder("getRuleDocString_args(");
13932
      boolean first = true;
13933
 
13934
      sb.append("ruleName:");
13935
      if (this.ruleName == null) {
13936
        sb.append("null");
13937
      } else {
13938
        sb.append(this.ruleName);
13939
      }
13940
      first = false;
13941
      sb.append(")");
13942
      return sb.toString();
13943
    }
13944
 
3430 rajveer 13945
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 13946
      // check for required fields
13947
    }
13948
 
3430 rajveer 13949
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13950
      try {
13951
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13952
      } catch (org.apache.thrift.TException te) {
13953
        throw new java.io.IOException(te);
13954
      }
13955
    }
13956
 
13957
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13958
      try {
13959
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13960
      } catch (org.apache.thrift.TException te) {
13961
        throw new java.io.IOException(te);
13962
      }
13963
    }
13964
 
3385 varun.gupt 13965
  }
13966
 
3430 rajveer 13967
  public static class getRuleDocString_result implements org.apache.thrift.TBase<getRuleDocString_result, getRuleDocString_result._Fields>, java.io.Serializable, Cloneable   {
13968
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_result");
3385 varun.gupt 13969
 
3430 rajveer 13970
    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 13971
 
3430 rajveer 13972
    private String success; // required
3385 varun.gupt 13973
 
13974
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 13975
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 13976
      SUCCESS((short)0, "success");
13977
 
13978
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13979
 
13980
      static {
13981
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13982
          byName.put(field.getFieldName(), field);
13983
        }
13984
      }
13985
 
13986
      /**
13987
       * Find the _Fields constant that matches fieldId, or null if its not found.
13988
       */
13989
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 13990
        switch(fieldId) {
13991
          case 0: // SUCCESS
13992
            return SUCCESS;
13993
          default:
13994
            return null;
13995
        }
3385 varun.gupt 13996
      }
13997
 
13998
      /**
13999
       * Find the _Fields constant that matches fieldId, throwing an exception
14000
       * if it is not found.
14001
       */
14002
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14003
        _Fields fields = findByThriftId(fieldId);
14004
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14005
        return fields;
14006
      }
14007
 
14008
      /**
14009
       * Find the _Fields constant that matches name, or null if its not found.
14010
       */
14011
      public static _Fields findByName(String name) {
14012
        return byName.get(name);
14013
      }
14014
 
14015
      private final short _thriftId;
14016
      private final String _fieldName;
14017
 
14018
      _Fields(short thriftId, String fieldName) {
14019
        _thriftId = thriftId;
14020
        _fieldName = fieldName;
14021
      }
14022
 
14023
      public short getThriftFieldId() {
14024
        return _thriftId;
14025
      }
14026
 
14027
      public String getFieldName() {
14028
        return _fieldName;
14029
      }
14030
    }
14031
 
14032
    // isset id assignments
14033
 
3430 rajveer 14034
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 14035
    static {
3430 rajveer 14036
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
14037
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14038
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
14039
      metaDataMap = Collections.unmodifiableMap(tmpMap);
14040
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_result.class, metaDataMap);
3385 varun.gupt 14041
    }
14042
 
14043
    public getRuleDocString_result() {
14044
    }
14045
 
14046
    public getRuleDocString_result(
14047
      String success)
14048
    {
14049
      this();
14050
      this.success = success;
14051
    }
14052
 
14053
    /**
14054
     * Performs a deep copy on <i>other</i>.
14055
     */
14056
    public getRuleDocString_result(getRuleDocString_result other) {
14057
      if (other.isSetSuccess()) {
14058
        this.success = other.success;
14059
      }
14060
    }
14061
 
14062
    public getRuleDocString_result deepCopy() {
14063
      return new getRuleDocString_result(this);
14064
    }
14065
 
3430 rajveer 14066
    @Override
14067
    public void clear() {
14068
      this.success = null;
3385 varun.gupt 14069
    }
14070
 
14071
    public String getSuccess() {
14072
      return this.success;
14073
    }
14074
 
3430 rajveer 14075
    public void setSuccess(String success) {
3385 varun.gupt 14076
      this.success = success;
14077
    }
14078
 
14079
    public void unsetSuccess() {
14080
      this.success = null;
14081
    }
14082
 
3430 rajveer 14083
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 14084
    public boolean isSetSuccess() {
14085
      return this.success != null;
14086
    }
14087
 
14088
    public void setSuccessIsSet(boolean value) {
14089
      if (!value) {
14090
        this.success = null;
14091
      }
14092
    }
14093
 
14094
    public void setFieldValue(_Fields field, Object value) {
14095
      switch (field) {
14096
      case SUCCESS:
14097
        if (value == null) {
14098
          unsetSuccess();
14099
        } else {
14100
          setSuccess((String)value);
14101
        }
14102
        break;
14103
 
14104
      }
14105
    }
14106
 
14107
    public Object getFieldValue(_Fields field) {
14108
      switch (field) {
14109
      case SUCCESS:
14110
        return getSuccess();
14111
 
14112
      }
14113
      throw new IllegalStateException();
14114
    }
14115
 
3430 rajveer 14116
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14117
    public boolean isSet(_Fields field) {
14118
      if (field == null) {
14119
        throw new IllegalArgumentException();
14120
      }
3385 varun.gupt 14121
 
14122
      switch (field) {
14123
      case SUCCESS:
14124
        return isSetSuccess();
14125
      }
14126
      throw new IllegalStateException();
14127
    }
14128
 
14129
    @Override
14130
    public boolean equals(Object that) {
14131
      if (that == null)
14132
        return false;
14133
      if (that instanceof getRuleDocString_result)
14134
        return this.equals((getRuleDocString_result)that);
14135
      return false;
14136
    }
14137
 
14138
    public boolean equals(getRuleDocString_result that) {
14139
      if (that == null)
14140
        return false;
14141
 
14142
      boolean this_present_success = true && this.isSetSuccess();
14143
      boolean that_present_success = true && that.isSetSuccess();
14144
      if (this_present_success || that_present_success) {
14145
        if (!(this_present_success && that_present_success))
14146
          return false;
14147
        if (!this.success.equals(that.success))
14148
          return false;
14149
      }
14150
 
14151
      return true;
14152
    }
14153
 
14154
    @Override
14155
    public int hashCode() {
14156
      return 0;
14157
    }
14158
 
14159
    public int compareTo(getRuleDocString_result other) {
14160
      if (!getClass().equals(other.getClass())) {
14161
        return getClass().getName().compareTo(other.getClass().getName());
14162
      }
14163
 
14164
      int lastComparison = 0;
14165
      getRuleDocString_result typedOther = (getRuleDocString_result)other;
14166
 
3430 rajveer 14167
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 14168
      if (lastComparison != 0) {
14169
        return lastComparison;
14170
      }
3430 rajveer 14171
      if (isSetSuccess()) {
14172
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
14173
        if (lastComparison != 0) {
14174
          return lastComparison;
14175
        }
3385 varun.gupt 14176
      }
14177
      return 0;
14178
    }
14179
 
3430 rajveer 14180
    public _Fields fieldForId(int fieldId) {
14181
      return _Fields.findByThriftId(fieldId);
14182
    }
14183
 
14184
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14185
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 14186
      iprot.readStructBegin();
14187
      while (true)
14188
      {
14189
        field = iprot.readFieldBegin();
3430 rajveer 14190
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 14191
          break;
14192
        }
3430 rajveer 14193
        switch (field.id) {
14194
          case 0: // SUCCESS
14195
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
14196
              this.success = iprot.readString();
14197
            } else { 
14198
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14199
            }
14200
            break;
14201
          default:
14202
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 14203
        }
3430 rajveer 14204
        iprot.readFieldEnd();
3385 varun.gupt 14205
      }
14206
      iprot.readStructEnd();
14207
      validate();
14208
    }
14209
 
3430 rajveer 14210
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 14211
      oprot.writeStructBegin(STRUCT_DESC);
14212
 
14213
      if (this.isSetSuccess()) {
14214
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
14215
        oprot.writeString(this.success);
14216
        oprot.writeFieldEnd();
14217
      }
14218
      oprot.writeFieldStop();
14219
      oprot.writeStructEnd();
14220
    }
14221
 
14222
    @Override
14223
    public String toString() {
14224
      StringBuilder sb = new StringBuilder("getRuleDocString_result(");
14225
      boolean first = true;
14226
 
14227
      sb.append("success:");
14228
      if (this.success == null) {
14229
        sb.append("null");
14230
      } else {
14231
        sb.append(this.success);
14232
      }
14233
      first = false;
14234
      sb.append(")");
14235
      return sb.toString();
14236
    }
14237
 
3430 rajveer 14238
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 14239
      // check for required fields
14240
    }
14241
 
3430 rajveer 14242
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14243
      try {
14244
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14245
      } catch (org.apache.thrift.TException te) {
14246
        throw new java.io.IOException(te);
14247
      }
14248
    }
14249
 
14250
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14251
      try {
14252
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14253
      } catch (org.apache.thrift.TException te) {
14254
        throw new java.io.IOException(te);
14255
      }
14256
    }
14257
 
3385 varun.gupt 14258
  }
14259
 
4189 varun.gupt 14260
  public static class getItemDiscountMap_args implements org.apache.thrift.TBase<getItemDiscountMap_args, getItemDiscountMap_args._Fields>, java.io.Serializable, Cloneable   {
14261
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_args");
14262
 
14263
    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);
14264
 
14265
    private List<Long> itemIds; // required
14266
 
14267
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14268
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
14269
      ITEM_IDS((short)1, "itemIds");
14270
 
14271
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14272
 
14273
      static {
14274
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14275
          byName.put(field.getFieldName(), field);
14276
        }
14277
      }
14278
 
14279
      /**
14280
       * Find the _Fields constant that matches fieldId, or null if its not found.
14281
       */
14282
      public static _Fields findByThriftId(int fieldId) {
14283
        switch(fieldId) {
14284
          case 1: // ITEM_IDS
14285
            return ITEM_IDS;
14286
          default:
14287
            return null;
14288
        }
14289
      }
14290
 
14291
      /**
14292
       * Find the _Fields constant that matches fieldId, throwing an exception
14293
       * if it is not found.
14294
       */
14295
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14296
        _Fields fields = findByThriftId(fieldId);
14297
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14298
        return fields;
14299
      }
14300
 
14301
      /**
14302
       * Find the _Fields constant that matches name, or null if its not found.
14303
       */
14304
      public static _Fields findByName(String name) {
14305
        return byName.get(name);
14306
      }
14307
 
14308
      private final short _thriftId;
14309
      private final String _fieldName;
14310
 
14311
      _Fields(short thriftId, String fieldName) {
14312
        _thriftId = thriftId;
14313
        _fieldName = fieldName;
14314
      }
14315
 
14316
      public short getThriftFieldId() {
14317
        return _thriftId;
14318
      }
14319
 
14320
      public String getFieldName() {
14321
        return _fieldName;
14322
      }
14323
    }
14324
 
14325
    // isset id assignments
14326
 
14327
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
14328
    static {
14329
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
14330
      tmpMap.put(_Fields.ITEM_IDS, new org.apache.thrift.meta_data.FieldMetaData("itemIds", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14331
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
14332
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
14333
      metaDataMap = Collections.unmodifiableMap(tmpMap);
14334
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_args.class, metaDataMap);
14335
    }
14336
 
14337
    public getItemDiscountMap_args() {
14338
    }
14339
 
14340
    public getItemDiscountMap_args(
14341
      List<Long> itemIds)
14342
    {
14343
      this();
14344
      this.itemIds = itemIds;
14345
    }
14346
 
14347
    /**
14348
     * Performs a deep copy on <i>other</i>.
14349
     */
14350
    public getItemDiscountMap_args(getItemDiscountMap_args other) {
14351
      if (other.isSetItemIds()) {
14352
        List<Long> __this__itemIds = new ArrayList<Long>();
14353
        for (Long other_element : other.itemIds) {
14354
          __this__itemIds.add(other_element);
14355
        }
14356
        this.itemIds = __this__itemIds;
14357
      }
14358
    }
14359
 
14360
    public getItemDiscountMap_args deepCopy() {
14361
      return new getItemDiscountMap_args(this);
14362
    }
14363
 
14364
    @Override
14365
    public void clear() {
14366
      this.itemIds = null;
14367
    }
14368
 
14369
    public int getItemIdsSize() {
14370
      return (this.itemIds == null) ? 0 : this.itemIds.size();
14371
    }
14372
 
14373
    public java.util.Iterator<Long> getItemIdsIterator() {
14374
      return (this.itemIds == null) ? null : this.itemIds.iterator();
14375
    }
14376
 
14377
    public void addToItemIds(long elem) {
14378
      if (this.itemIds == null) {
14379
        this.itemIds = new ArrayList<Long>();
14380
      }
14381
      this.itemIds.add(elem);
14382
    }
14383
 
14384
    public List<Long> getItemIds() {
14385
      return this.itemIds;
14386
    }
14387
 
14388
    public void setItemIds(List<Long> itemIds) {
14389
      this.itemIds = itemIds;
14390
    }
14391
 
14392
    public void unsetItemIds() {
14393
      this.itemIds = null;
14394
    }
14395
 
14396
    /** Returns true if field itemIds is set (has been assigned a value) and false otherwise */
14397
    public boolean isSetItemIds() {
14398
      return this.itemIds != null;
14399
    }
14400
 
14401
    public void setItemIdsIsSet(boolean value) {
14402
      if (!value) {
14403
        this.itemIds = null;
14404
      }
14405
    }
14406
 
14407
    public void setFieldValue(_Fields field, Object value) {
14408
      switch (field) {
14409
      case ITEM_IDS:
14410
        if (value == null) {
14411
          unsetItemIds();
14412
        } else {
14413
          setItemIds((List<Long>)value);
14414
        }
14415
        break;
14416
 
14417
      }
14418
    }
14419
 
14420
    public Object getFieldValue(_Fields field) {
14421
      switch (field) {
14422
      case ITEM_IDS:
14423
        return getItemIds();
14424
 
14425
      }
14426
      throw new IllegalStateException();
14427
    }
14428
 
14429
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14430
    public boolean isSet(_Fields field) {
14431
      if (field == null) {
14432
        throw new IllegalArgumentException();
14433
      }
14434
 
14435
      switch (field) {
14436
      case ITEM_IDS:
14437
        return isSetItemIds();
14438
      }
14439
      throw new IllegalStateException();
14440
    }
14441
 
14442
    @Override
14443
    public boolean equals(Object that) {
14444
      if (that == null)
14445
        return false;
14446
      if (that instanceof getItemDiscountMap_args)
14447
        return this.equals((getItemDiscountMap_args)that);
14448
      return false;
14449
    }
14450
 
14451
    public boolean equals(getItemDiscountMap_args that) {
14452
      if (that == null)
14453
        return false;
14454
 
14455
      boolean this_present_itemIds = true && this.isSetItemIds();
14456
      boolean that_present_itemIds = true && that.isSetItemIds();
14457
      if (this_present_itemIds || that_present_itemIds) {
14458
        if (!(this_present_itemIds && that_present_itemIds))
14459
          return false;
14460
        if (!this.itemIds.equals(that.itemIds))
14461
          return false;
14462
      }
14463
 
14464
      return true;
14465
    }
14466
 
14467
    @Override
14468
    public int hashCode() {
14469
      return 0;
14470
    }
14471
 
14472
    public int compareTo(getItemDiscountMap_args other) {
14473
      if (!getClass().equals(other.getClass())) {
14474
        return getClass().getName().compareTo(other.getClass().getName());
14475
      }
14476
 
14477
      int lastComparison = 0;
14478
      getItemDiscountMap_args typedOther = (getItemDiscountMap_args)other;
14479
 
14480
      lastComparison = Boolean.valueOf(isSetItemIds()).compareTo(typedOther.isSetItemIds());
14481
      if (lastComparison != 0) {
14482
        return lastComparison;
14483
      }
14484
      if (isSetItemIds()) {
14485
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemIds, typedOther.itemIds);
14486
        if (lastComparison != 0) {
14487
          return lastComparison;
14488
        }
14489
      }
14490
      return 0;
14491
    }
14492
 
14493
    public _Fields fieldForId(int fieldId) {
14494
      return _Fields.findByThriftId(fieldId);
14495
    }
14496
 
14497
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14498
      org.apache.thrift.protocol.TField field;
14499
      iprot.readStructBegin();
14500
      while (true)
14501
      {
14502
        field = iprot.readFieldBegin();
14503
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
14504
          break;
14505
        }
14506
        switch (field.id) {
14507
          case 1: // ITEM_IDS
14508
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
14509
              {
6497 amit.gupta 14510
                org.apache.thrift.protocol.TList _list29 = iprot.readListBegin();
14511
                this.itemIds = new ArrayList<Long>(_list29.size);
14512
                for (int _i30 = 0; _i30 < _list29.size; ++_i30)
4189 varun.gupt 14513
                {
6497 amit.gupta 14514
                  long _elem31; // required
14515
                  _elem31 = iprot.readI64();
14516
                  this.itemIds.add(_elem31);
4189 varun.gupt 14517
                }
14518
                iprot.readListEnd();
14519
              }
14520
            } else { 
14521
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14522
            }
14523
            break;
14524
          default:
14525
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14526
        }
14527
        iprot.readFieldEnd();
14528
      }
14529
      iprot.readStructEnd();
14530
      validate();
14531
    }
14532
 
14533
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
14534
      validate();
14535
 
14536
      oprot.writeStructBegin(STRUCT_DESC);
14537
      if (this.itemIds != null) {
14538
        oprot.writeFieldBegin(ITEM_IDS_FIELD_DESC);
14539
        {
14540
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.itemIds.size()));
6497 amit.gupta 14541
          for (long _iter32 : this.itemIds)
4189 varun.gupt 14542
          {
6497 amit.gupta 14543
            oprot.writeI64(_iter32);
4189 varun.gupt 14544
          }
14545
          oprot.writeListEnd();
14546
        }
14547
        oprot.writeFieldEnd();
14548
      }
14549
      oprot.writeFieldStop();
14550
      oprot.writeStructEnd();
14551
    }
14552
 
14553
    @Override
14554
    public String toString() {
14555
      StringBuilder sb = new StringBuilder("getItemDiscountMap_args(");
14556
      boolean first = true;
14557
 
14558
      sb.append("itemIds:");
14559
      if (this.itemIds == null) {
14560
        sb.append("null");
14561
      } else {
14562
        sb.append(this.itemIds);
14563
      }
14564
      first = false;
14565
      sb.append(")");
14566
      return sb.toString();
14567
    }
14568
 
14569
    public void validate() throws org.apache.thrift.TException {
14570
      // check for required fields
14571
    }
14572
 
14573
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14574
      try {
14575
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14576
      } catch (org.apache.thrift.TException te) {
14577
        throw new java.io.IOException(te);
14578
      }
14579
    }
14580
 
14581
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14582
      try {
14583
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14584
      } catch (org.apache.thrift.TException te) {
14585
        throw new java.io.IOException(te);
14586
      }
14587
    }
14588
 
14589
  }
14590
 
14591
  public static class getItemDiscountMap_result implements org.apache.thrift.TBase<getItemDiscountMap_result, getItemDiscountMap_result._Fields>, java.io.Serializable, Cloneable   {
14592
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_result");
14593
 
14594
    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);
14595
    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);
14596
 
14597
    private List<ItemCouponDiscount> success; // required
14598
    private PromotionException pex; // required
14599
 
14600
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14601
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
14602
      SUCCESS((short)0, "success"),
14603
      PEX((short)1, "pex");
14604
 
14605
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14606
 
14607
      static {
14608
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14609
          byName.put(field.getFieldName(), field);
14610
        }
14611
      }
14612
 
14613
      /**
14614
       * Find the _Fields constant that matches fieldId, or null if its not found.
14615
       */
14616
      public static _Fields findByThriftId(int fieldId) {
14617
        switch(fieldId) {
14618
          case 0: // SUCCESS
14619
            return SUCCESS;
14620
          case 1: // PEX
14621
            return PEX;
14622
          default:
14623
            return null;
14624
        }
14625
      }
14626
 
14627
      /**
14628
       * Find the _Fields constant that matches fieldId, throwing an exception
14629
       * if it is not found.
14630
       */
14631
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14632
        _Fields fields = findByThriftId(fieldId);
14633
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14634
        return fields;
14635
      }
14636
 
14637
      /**
14638
       * Find the _Fields constant that matches name, or null if its not found.
14639
       */
14640
      public static _Fields findByName(String name) {
14641
        return byName.get(name);
14642
      }
14643
 
14644
      private final short _thriftId;
14645
      private final String _fieldName;
14646
 
14647
      _Fields(short thriftId, String fieldName) {
14648
        _thriftId = thriftId;
14649
        _fieldName = fieldName;
14650
      }
14651
 
14652
      public short getThriftFieldId() {
14653
        return _thriftId;
14654
      }
14655
 
14656
      public String getFieldName() {
14657
        return _fieldName;
14658
      }
14659
    }
14660
 
14661
    // isset id assignments
14662
 
14663
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
14664
    static {
14665
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
14666
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14667
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
14668
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ItemCouponDiscount.class))));
14669
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14670
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
14671
      metaDataMap = Collections.unmodifiableMap(tmpMap);
14672
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_result.class, metaDataMap);
14673
    }
14674
 
14675
    public getItemDiscountMap_result() {
14676
    }
14677
 
14678
    public getItemDiscountMap_result(
14679
      List<ItemCouponDiscount> success,
14680
      PromotionException pex)
14681
    {
14682
      this();
14683
      this.success = success;
14684
      this.pex = pex;
14685
    }
14686
 
14687
    /**
14688
     * Performs a deep copy on <i>other</i>.
14689
     */
14690
    public getItemDiscountMap_result(getItemDiscountMap_result other) {
14691
      if (other.isSetSuccess()) {
14692
        List<ItemCouponDiscount> __this__success = new ArrayList<ItemCouponDiscount>();
14693
        for (ItemCouponDiscount other_element : other.success) {
14694
          __this__success.add(new ItemCouponDiscount(other_element));
14695
        }
14696
        this.success = __this__success;
14697
      }
14698
      if (other.isSetPex()) {
14699
        this.pex = new PromotionException(other.pex);
14700
      }
14701
    }
14702
 
14703
    public getItemDiscountMap_result deepCopy() {
14704
      return new getItemDiscountMap_result(this);
14705
    }
14706
 
14707
    @Override
14708
    public void clear() {
14709
      this.success = null;
14710
      this.pex = null;
14711
    }
14712
 
14713
    public int getSuccessSize() {
14714
      return (this.success == null) ? 0 : this.success.size();
14715
    }
14716
 
14717
    public java.util.Iterator<ItemCouponDiscount> getSuccessIterator() {
14718
      return (this.success == null) ? null : this.success.iterator();
14719
    }
14720
 
14721
    public void addToSuccess(ItemCouponDiscount elem) {
14722
      if (this.success == null) {
14723
        this.success = new ArrayList<ItemCouponDiscount>();
14724
      }
14725
      this.success.add(elem);
14726
    }
14727
 
14728
    public List<ItemCouponDiscount> getSuccess() {
14729
      return this.success;
14730
    }
14731
 
14732
    public void setSuccess(List<ItemCouponDiscount> success) {
14733
      this.success = success;
14734
    }
14735
 
14736
    public void unsetSuccess() {
14737
      this.success = null;
14738
    }
14739
 
14740
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
14741
    public boolean isSetSuccess() {
14742
      return this.success != null;
14743
    }
14744
 
14745
    public void setSuccessIsSet(boolean value) {
14746
      if (!value) {
14747
        this.success = null;
14748
      }
14749
    }
14750
 
14751
    public PromotionException getPex() {
14752
      return this.pex;
14753
    }
14754
 
14755
    public void setPex(PromotionException pex) {
14756
      this.pex = pex;
14757
    }
14758
 
14759
    public void unsetPex() {
14760
      this.pex = null;
14761
    }
14762
 
14763
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
14764
    public boolean isSetPex() {
14765
      return this.pex != null;
14766
    }
14767
 
14768
    public void setPexIsSet(boolean value) {
14769
      if (!value) {
14770
        this.pex = null;
14771
      }
14772
    }
14773
 
14774
    public void setFieldValue(_Fields field, Object value) {
14775
      switch (field) {
14776
      case SUCCESS:
14777
        if (value == null) {
14778
          unsetSuccess();
14779
        } else {
14780
          setSuccess((List<ItemCouponDiscount>)value);
14781
        }
14782
        break;
14783
 
14784
      case PEX:
14785
        if (value == null) {
14786
          unsetPex();
14787
        } else {
14788
          setPex((PromotionException)value);
14789
        }
14790
        break;
14791
 
14792
      }
14793
    }
14794
 
14795
    public Object getFieldValue(_Fields field) {
14796
      switch (field) {
14797
      case SUCCESS:
14798
        return getSuccess();
14799
 
14800
      case PEX:
14801
        return getPex();
14802
 
14803
      }
14804
      throw new IllegalStateException();
14805
    }
14806
 
14807
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14808
    public boolean isSet(_Fields field) {
14809
      if (field == null) {
14810
        throw new IllegalArgumentException();
14811
      }
14812
 
14813
      switch (field) {
14814
      case SUCCESS:
14815
        return isSetSuccess();
14816
      case PEX:
14817
        return isSetPex();
14818
      }
14819
      throw new IllegalStateException();
14820
    }
14821
 
14822
    @Override
14823
    public boolean equals(Object that) {
14824
      if (that == null)
14825
        return false;
14826
      if (that instanceof getItemDiscountMap_result)
14827
        return this.equals((getItemDiscountMap_result)that);
14828
      return false;
14829
    }
14830
 
14831
    public boolean equals(getItemDiscountMap_result that) {
14832
      if (that == null)
14833
        return false;
14834
 
14835
      boolean this_present_success = true && this.isSetSuccess();
14836
      boolean that_present_success = true && that.isSetSuccess();
14837
      if (this_present_success || that_present_success) {
14838
        if (!(this_present_success && that_present_success))
14839
          return false;
14840
        if (!this.success.equals(that.success))
14841
          return false;
14842
      }
14843
 
14844
      boolean this_present_pex = true && this.isSetPex();
14845
      boolean that_present_pex = true && that.isSetPex();
14846
      if (this_present_pex || that_present_pex) {
14847
        if (!(this_present_pex && that_present_pex))
14848
          return false;
14849
        if (!this.pex.equals(that.pex))
14850
          return false;
14851
      }
14852
 
14853
      return true;
14854
    }
14855
 
14856
    @Override
14857
    public int hashCode() {
14858
      return 0;
14859
    }
14860
 
14861
    public int compareTo(getItemDiscountMap_result other) {
14862
      if (!getClass().equals(other.getClass())) {
14863
        return getClass().getName().compareTo(other.getClass().getName());
14864
      }
14865
 
14866
      int lastComparison = 0;
14867
      getItemDiscountMap_result typedOther = (getItemDiscountMap_result)other;
14868
 
14869
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
14870
      if (lastComparison != 0) {
14871
        return lastComparison;
14872
      }
14873
      if (isSetSuccess()) {
14874
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
14875
        if (lastComparison != 0) {
14876
          return lastComparison;
14877
        }
14878
      }
14879
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
14880
      if (lastComparison != 0) {
14881
        return lastComparison;
14882
      }
14883
      if (isSetPex()) {
14884
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
14885
        if (lastComparison != 0) {
14886
          return lastComparison;
14887
        }
14888
      }
14889
      return 0;
14890
    }
14891
 
14892
    public _Fields fieldForId(int fieldId) {
14893
      return _Fields.findByThriftId(fieldId);
14894
    }
14895
 
14896
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14897
      org.apache.thrift.protocol.TField field;
14898
      iprot.readStructBegin();
14899
      while (true)
14900
      {
14901
        field = iprot.readFieldBegin();
14902
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
14903
          break;
14904
        }
14905
        switch (field.id) {
14906
          case 0: // SUCCESS
14907
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
14908
              {
6497 amit.gupta 14909
                org.apache.thrift.protocol.TList _list33 = iprot.readListBegin();
14910
                this.success = new ArrayList<ItemCouponDiscount>(_list33.size);
14911
                for (int _i34 = 0; _i34 < _list33.size; ++_i34)
4189 varun.gupt 14912
                {
6497 amit.gupta 14913
                  ItemCouponDiscount _elem35; // required
14914
                  _elem35 = new ItemCouponDiscount();
14915
                  _elem35.read(iprot);
14916
                  this.success.add(_elem35);
4189 varun.gupt 14917
                }
14918
                iprot.readListEnd();
14919
              }
14920
            } else { 
14921
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14922
            }
14923
            break;
14924
          case 1: // PEX
14925
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
14926
              this.pex = new PromotionException();
14927
              this.pex.read(iprot);
14928
            } else { 
14929
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14930
            }
14931
            break;
14932
          default:
14933
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14934
        }
14935
        iprot.readFieldEnd();
14936
      }
14937
      iprot.readStructEnd();
14938
      validate();
14939
    }
14940
 
14941
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
14942
      oprot.writeStructBegin(STRUCT_DESC);
14943
 
14944
      if (this.isSetSuccess()) {
14945
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
14946
        {
14947
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
6497 amit.gupta 14948
          for (ItemCouponDiscount _iter36 : this.success)
4189 varun.gupt 14949
          {
6497 amit.gupta 14950
            _iter36.write(oprot);
4189 varun.gupt 14951
          }
14952
          oprot.writeListEnd();
14953
        }
14954
        oprot.writeFieldEnd();
14955
      } else if (this.isSetPex()) {
14956
        oprot.writeFieldBegin(PEX_FIELD_DESC);
14957
        this.pex.write(oprot);
14958
        oprot.writeFieldEnd();
14959
      }
14960
      oprot.writeFieldStop();
14961
      oprot.writeStructEnd();
14962
    }
14963
 
14964
    @Override
14965
    public String toString() {
14966
      StringBuilder sb = new StringBuilder("getItemDiscountMap_result(");
14967
      boolean first = true;
14968
 
14969
      sb.append("success:");
14970
      if (this.success == null) {
14971
        sb.append("null");
14972
      } else {
14973
        sb.append(this.success);
14974
      }
14975
      first = false;
14976
      if (!first) sb.append(", ");
14977
      sb.append("pex:");
14978
      if (this.pex == null) {
14979
        sb.append("null");
14980
      } else {
14981
        sb.append(this.pex);
14982
      }
14983
      first = false;
14984
      sb.append(")");
14985
      return sb.toString();
14986
    }
14987
 
14988
    public void validate() throws org.apache.thrift.TException {
14989
      // check for required fields
14990
    }
14991
 
14992
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14993
      try {
14994
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14995
      } catch (org.apache.thrift.TException te) {
14996
        throw new java.io.IOException(te);
14997
      }
14998
    }
14999
 
15000
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15001
      try {
15002
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15003
      } catch (org.apache.thrift.TException te) {
15004
        throw new java.io.IOException(te);
15005
      }
15006
    }
15007
 
15008
  }
15009
 
4494 varun.gupt 15010
  public static class getDiscountsForEntity_args implements org.apache.thrift.TBase<getDiscountsForEntity_args, getDiscountsForEntity_args._Fields>, java.io.Serializable, Cloneable   {
15011
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_args");
15012
 
15013
    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);
15014
 
15015
    private long entityId; // required
15016
 
15017
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
15018
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
15019
      ENTITY_ID((short)1, "entityId");
15020
 
15021
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15022
 
15023
      static {
15024
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15025
          byName.put(field.getFieldName(), field);
15026
        }
15027
      }
15028
 
15029
      /**
15030
       * Find the _Fields constant that matches fieldId, or null if its not found.
15031
       */
15032
      public static _Fields findByThriftId(int fieldId) {
15033
        switch(fieldId) {
15034
          case 1: // ENTITY_ID
15035
            return ENTITY_ID;
15036
          default:
15037
            return null;
15038
        }
15039
      }
15040
 
15041
      /**
15042
       * Find the _Fields constant that matches fieldId, throwing an exception
15043
       * if it is not found.
15044
       */
15045
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15046
        _Fields fields = findByThriftId(fieldId);
15047
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15048
        return fields;
15049
      }
15050
 
15051
      /**
15052
       * Find the _Fields constant that matches name, or null if its not found.
15053
       */
15054
      public static _Fields findByName(String name) {
15055
        return byName.get(name);
15056
      }
15057
 
15058
      private final short _thriftId;
15059
      private final String _fieldName;
15060
 
15061
      _Fields(short thriftId, String fieldName) {
15062
        _thriftId = thriftId;
15063
        _fieldName = fieldName;
15064
      }
15065
 
15066
      public short getThriftFieldId() {
15067
        return _thriftId;
15068
      }
15069
 
15070
      public String getFieldName() {
15071
        return _fieldName;
15072
      }
15073
    }
15074
 
15075
    // isset id assignments
15076
    private static final int __ENTITYID_ISSET_ID = 0;
15077
    private BitSet __isset_bit_vector = new BitSet(1);
15078
 
15079
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
15080
    static {
15081
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15082
      tmpMap.put(_Fields.ENTITY_ID, new org.apache.thrift.meta_data.FieldMetaData("entityId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15083
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
15084
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15085
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_args.class, metaDataMap);
15086
    }
15087
 
15088
    public getDiscountsForEntity_args() {
15089
    }
15090
 
15091
    public getDiscountsForEntity_args(
15092
      long entityId)
15093
    {
15094
      this();
15095
      this.entityId = entityId;
15096
      setEntityIdIsSet(true);
15097
    }
15098
 
15099
    /**
15100
     * Performs a deep copy on <i>other</i>.
15101
     */
15102
    public getDiscountsForEntity_args(getDiscountsForEntity_args other) {
15103
      __isset_bit_vector.clear();
15104
      __isset_bit_vector.or(other.__isset_bit_vector);
15105
      this.entityId = other.entityId;
15106
    }
15107
 
15108
    public getDiscountsForEntity_args deepCopy() {
15109
      return new getDiscountsForEntity_args(this);
15110
    }
15111
 
15112
    @Override
15113
    public void clear() {
15114
      setEntityIdIsSet(false);
15115
      this.entityId = 0;
15116
    }
15117
 
15118
    public long getEntityId() {
15119
      return this.entityId;
15120
    }
15121
 
15122
    public void setEntityId(long entityId) {
15123
      this.entityId = entityId;
15124
      setEntityIdIsSet(true);
15125
    }
15126
 
15127
    public void unsetEntityId() {
15128
      __isset_bit_vector.clear(__ENTITYID_ISSET_ID);
15129
    }
15130
 
15131
    /** Returns true if field entityId is set (has been assigned a value) and false otherwise */
15132
    public boolean isSetEntityId() {
15133
      return __isset_bit_vector.get(__ENTITYID_ISSET_ID);
15134
    }
15135
 
15136
    public void setEntityIdIsSet(boolean value) {
15137
      __isset_bit_vector.set(__ENTITYID_ISSET_ID, value);
15138
    }
15139
 
15140
    public void setFieldValue(_Fields field, Object value) {
15141
      switch (field) {
15142
      case ENTITY_ID:
15143
        if (value == null) {
15144
          unsetEntityId();
15145
        } else {
15146
          setEntityId((Long)value);
15147
        }
15148
        break;
15149
 
15150
      }
15151
    }
15152
 
15153
    public Object getFieldValue(_Fields field) {
15154
      switch (field) {
15155
      case ENTITY_ID:
15156
        return Long.valueOf(getEntityId());
15157
 
15158
      }
15159
      throw new IllegalStateException();
15160
    }
15161
 
15162
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15163
    public boolean isSet(_Fields field) {
15164
      if (field == null) {
15165
        throw new IllegalArgumentException();
15166
      }
15167
 
15168
      switch (field) {
15169
      case ENTITY_ID:
15170
        return isSetEntityId();
15171
      }
15172
      throw new IllegalStateException();
15173
    }
15174
 
15175
    @Override
15176
    public boolean equals(Object that) {
15177
      if (that == null)
15178
        return false;
15179
      if (that instanceof getDiscountsForEntity_args)
15180
        return this.equals((getDiscountsForEntity_args)that);
15181
      return false;
15182
    }
15183
 
15184
    public boolean equals(getDiscountsForEntity_args that) {
15185
      if (that == null)
15186
        return false;
15187
 
15188
      boolean this_present_entityId = true;
15189
      boolean that_present_entityId = true;
15190
      if (this_present_entityId || that_present_entityId) {
15191
        if (!(this_present_entityId && that_present_entityId))
15192
          return false;
15193
        if (this.entityId != that.entityId)
15194
          return false;
15195
      }
15196
 
15197
      return true;
15198
    }
15199
 
15200
    @Override
15201
    public int hashCode() {
15202
      return 0;
15203
    }
15204
 
15205
    public int compareTo(getDiscountsForEntity_args other) {
15206
      if (!getClass().equals(other.getClass())) {
15207
        return getClass().getName().compareTo(other.getClass().getName());
15208
      }
15209
 
15210
      int lastComparison = 0;
15211
      getDiscountsForEntity_args typedOther = (getDiscountsForEntity_args)other;
15212
 
15213
      lastComparison = Boolean.valueOf(isSetEntityId()).compareTo(typedOther.isSetEntityId());
15214
      if (lastComparison != 0) {
15215
        return lastComparison;
15216
      }
15217
      if (isSetEntityId()) {
15218
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityId, typedOther.entityId);
15219
        if (lastComparison != 0) {
15220
          return lastComparison;
15221
        }
15222
      }
15223
      return 0;
15224
    }
15225
 
15226
    public _Fields fieldForId(int fieldId) {
15227
      return _Fields.findByThriftId(fieldId);
15228
    }
15229
 
15230
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15231
      org.apache.thrift.protocol.TField field;
15232
      iprot.readStructBegin();
15233
      while (true)
15234
      {
15235
        field = iprot.readFieldBegin();
15236
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
15237
          break;
15238
        }
15239
        switch (field.id) {
15240
          case 1: // ENTITY_ID
15241
            if (field.type == org.apache.thrift.protocol.TType.I64) {
15242
              this.entityId = iprot.readI64();
15243
              setEntityIdIsSet(true);
15244
            } else { 
15245
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15246
            }
15247
            break;
15248
          default:
15249
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15250
        }
15251
        iprot.readFieldEnd();
15252
      }
15253
      iprot.readStructEnd();
15254
      validate();
15255
    }
15256
 
15257
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
15258
      validate();
15259
 
15260
      oprot.writeStructBegin(STRUCT_DESC);
15261
      oprot.writeFieldBegin(ENTITY_ID_FIELD_DESC);
15262
      oprot.writeI64(this.entityId);
15263
      oprot.writeFieldEnd();
15264
      oprot.writeFieldStop();
15265
      oprot.writeStructEnd();
15266
    }
15267
 
15268
    @Override
15269
    public String toString() {
15270
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_args(");
15271
      boolean first = true;
15272
 
15273
      sb.append("entityId:");
15274
      sb.append(this.entityId);
15275
      first = false;
15276
      sb.append(")");
15277
      return sb.toString();
15278
    }
15279
 
15280
    public void validate() throws org.apache.thrift.TException {
15281
      // check for required fields
15282
    }
15283
 
15284
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15285
      try {
15286
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15287
      } catch (org.apache.thrift.TException te) {
15288
        throw new java.io.IOException(te);
15289
      }
15290
    }
15291
 
15292
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15293
      try {
15294
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
15295
        __isset_bit_vector = new BitSet(1);
15296
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15297
      } catch (org.apache.thrift.TException te) {
15298
        throw new java.io.IOException(te);
15299
      }
15300
    }
15301
 
15302
  }
15303
 
15304
  public static class getDiscountsForEntity_result implements org.apache.thrift.TBase<getDiscountsForEntity_result, getDiscountsForEntity_result._Fields>, java.io.Serializable, Cloneable   {
15305
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_result");
15306
 
15307
    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);
15308
 
15309
    private Map<String,Double> success; // required
15310
 
15311
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
15312
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
15313
      SUCCESS((short)0, "success");
15314
 
15315
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15316
 
15317
      static {
15318
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15319
          byName.put(field.getFieldName(), field);
15320
        }
15321
      }
15322
 
15323
      /**
15324
       * Find the _Fields constant that matches fieldId, or null if its not found.
15325
       */
15326
      public static _Fields findByThriftId(int fieldId) {
15327
        switch(fieldId) {
15328
          case 0: // SUCCESS
15329
            return SUCCESS;
15330
          default:
15331
            return null;
15332
        }
15333
      }
15334
 
15335
      /**
15336
       * Find the _Fields constant that matches fieldId, throwing an exception
15337
       * if it is not found.
15338
       */
15339
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15340
        _Fields fields = findByThriftId(fieldId);
15341
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15342
        return fields;
15343
      }
15344
 
15345
      /**
15346
       * Find the _Fields constant that matches name, or null if its not found.
15347
       */
15348
      public static _Fields findByName(String name) {
15349
        return byName.get(name);
15350
      }
15351
 
15352
      private final short _thriftId;
15353
      private final String _fieldName;
15354
 
15355
      _Fields(short thriftId, String fieldName) {
15356
        _thriftId = thriftId;
15357
        _fieldName = fieldName;
15358
      }
15359
 
15360
      public short getThriftFieldId() {
15361
        return _thriftId;
15362
      }
15363
 
15364
      public String getFieldName() {
15365
        return _fieldName;
15366
      }
15367
    }
15368
 
15369
    // isset id assignments
15370
 
15371
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
15372
    static {
15373
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15374
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15375
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
15376
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
15377
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
15378
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15379
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_result.class, metaDataMap);
15380
    }
15381
 
15382
    public getDiscountsForEntity_result() {
15383
    }
15384
 
15385
    public getDiscountsForEntity_result(
15386
      Map<String,Double> success)
15387
    {
15388
      this();
15389
      this.success = success;
15390
    }
15391
 
15392
    /**
15393
     * Performs a deep copy on <i>other</i>.
15394
     */
15395
    public getDiscountsForEntity_result(getDiscountsForEntity_result other) {
15396
      if (other.isSetSuccess()) {
15397
        Map<String,Double> __this__success = new HashMap<String,Double>();
15398
        for (Map.Entry<String, Double> other_element : other.success.entrySet()) {
15399
 
15400
          String other_element_key = other_element.getKey();
15401
          Double other_element_value = other_element.getValue();
15402
 
15403
          String __this__success_copy_key = other_element_key;
15404
 
15405
          Double __this__success_copy_value = other_element_value;
15406
 
15407
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
15408
        }
15409
        this.success = __this__success;
15410
      }
15411
    }
15412
 
15413
    public getDiscountsForEntity_result deepCopy() {
15414
      return new getDiscountsForEntity_result(this);
15415
    }
15416
 
15417
    @Override
15418
    public void clear() {
15419
      this.success = null;
15420
    }
15421
 
15422
    public int getSuccessSize() {
15423
      return (this.success == null) ? 0 : this.success.size();
15424
    }
15425
 
15426
    public void putToSuccess(String key, double val) {
15427
      if (this.success == null) {
15428
        this.success = new HashMap<String,Double>();
15429
      }
15430
      this.success.put(key, val);
15431
    }
15432
 
15433
    public Map<String,Double> getSuccess() {
15434
      return this.success;
15435
    }
15436
 
15437
    public void setSuccess(Map<String,Double> success) {
15438
      this.success = success;
15439
    }
15440
 
15441
    public void unsetSuccess() {
15442
      this.success = null;
15443
    }
15444
 
15445
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
15446
    public boolean isSetSuccess() {
15447
      return this.success != null;
15448
    }
15449
 
15450
    public void setSuccessIsSet(boolean value) {
15451
      if (!value) {
15452
        this.success = null;
15453
      }
15454
    }
15455
 
15456
    public void setFieldValue(_Fields field, Object value) {
15457
      switch (field) {
15458
      case SUCCESS:
15459
        if (value == null) {
15460
          unsetSuccess();
15461
        } else {
15462
          setSuccess((Map<String,Double>)value);
15463
        }
15464
        break;
15465
 
15466
      }
15467
    }
15468
 
15469
    public Object getFieldValue(_Fields field) {
15470
      switch (field) {
15471
      case SUCCESS:
15472
        return getSuccess();
15473
 
15474
      }
15475
      throw new IllegalStateException();
15476
    }
15477
 
15478
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15479
    public boolean isSet(_Fields field) {
15480
      if (field == null) {
15481
        throw new IllegalArgumentException();
15482
      }
15483
 
15484
      switch (field) {
15485
      case SUCCESS:
15486
        return isSetSuccess();
15487
      }
15488
      throw new IllegalStateException();
15489
    }
15490
 
15491
    @Override
15492
    public boolean equals(Object that) {
15493
      if (that == null)
15494
        return false;
15495
      if (that instanceof getDiscountsForEntity_result)
15496
        return this.equals((getDiscountsForEntity_result)that);
15497
      return false;
15498
    }
15499
 
15500
    public boolean equals(getDiscountsForEntity_result that) {
15501
      if (that == null)
15502
        return false;
15503
 
15504
      boolean this_present_success = true && this.isSetSuccess();
15505
      boolean that_present_success = true && that.isSetSuccess();
15506
      if (this_present_success || that_present_success) {
15507
        if (!(this_present_success && that_present_success))
15508
          return false;
15509
        if (!this.success.equals(that.success))
15510
          return false;
15511
      }
15512
 
15513
      return true;
15514
    }
15515
 
15516
    @Override
15517
    public int hashCode() {
15518
      return 0;
15519
    }
15520
 
15521
    public int compareTo(getDiscountsForEntity_result other) {
15522
      if (!getClass().equals(other.getClass())) {
15523
        return getClass().getName().compareTo(other.getClass().getName());
15524
      }
15525
 
15526
      int lastComparison = 0;
15527
      getDiscountsForEntity_result typedOther = (getDiscountsForEntity_result)other;
15528
 
15529
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
15530
      if (lastComparison != 0) {
15531
        return lastComparison;
15532
      }
15533
      if (isSetSuccess()) {
15534
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
15535
        if (lastComparison != 0) {
15536
          return lastComparison;
15537
        }
15538
      }
15539
      return 0;
15540
    }
15541
 
15542
    public _Fields fieldForId(int fieldId) {
15543
      return _Fields.findByThriftId(fieldId);
15544
    }
15545
 
15546
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15547
      org.apache.thrift.protocol.TField field;
15548
      iprot.readStructBegin();
15549
      while (true)
15550
      {
15551
        field = iprot.readFieldBegin();
15552
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
15553
          break;
15554
        }
15555
        switch (field.id) {
15556
          case 0: // SUCCESS
15557
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
15558
              {
6497 amit.gupta 15559
                org.apache.thrift.protocol.TMap _map37 = iprot.readMapBegin();
15560
                this.success = new HashMap<String,Double>(2*_map37.size);
15561
                for (int _i38 = 0; _i38 < _map37.size; ++_i38)
4494 varun.gupt 15562
                {
6497 amit.gupta 15563
                  String _key39; // required
15564
                  double _val40; // required
15565
                  _key39 = iprot.readString();
15566
                  _val40 = iprot.readDouble();
15567
                  this.success.put(_key39, _val40);
4494 varun.gupt 15568
                }
15569
                iprot.readMapEnd();
15570
              }
15571
            } else { 
15572
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15573
            }
15574
            break;
15575
          default:
15576
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15577
        }
15578
        iprot.readFieldEnd();
15579
      }
15580
      iprot.readStructEnd();
15581
      validate();
15582
    }
15583
 
15584
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
15585
      oprot.writeStructBegin(STRUCT_DESC);
15586
 
15587
      if (this.isSetSuccess()) {
15588
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
15589
        {
15590
          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 15591
          for (Map.Entry<String, Double> _iter41 : this.success.entrySet())
4494 varun.gupt 15592
          {
6497 amit.gupta 15593
            oprot.writeString(_iter41.getKey());
15594
            oprot.writeDouble(_iter41.getValue());
4494 varun.gupt 15595
          }
15596
          oprot.writeMapEnd();
15597
        }
15598
        oprot.writeFieldEnd();
15599
      }
15600
      oprot.writeFieldStop();
15601
      oprot.writeStructEnd();
15602
    }
15603
 
15604
    @Override
15605
    public String toString() {
15606
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_result(");
15607
      boolean first = true;
15608
 
15609
      sb.append("success:");
15610
      if (this.success == null) {
15611
        sb.append("null");
15612
      } else {
15613
        sb.append(this.success);
15614
      }
15615
      first = false;
15616
      sb.append(")");
15617
      return sb.toString();
15618
    }
15619
 
15620
    public void validate() throws org.apache.thrift.TException {
15621
      // check for required fields
15622
    }
15623
 
15624
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15625
      try {
15626
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15627
      } catch (org.apache.thrift.TException te) {
15628
        throw new java.io.IOException(te);
15629
      }
15630
    }
15631
 
15632
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15633
      try {
15634
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15635
      } catch (org.apache.thrift.TException te) {
15636
        throw new java.io.IOException(te);
15637
      }
15638
    }
15639
 
15640
  }
15641
 
5469 rajveer 15642
  public static class addVoucher_args implements org.apache.thrift.TBase<addVoucher_args, addVoucher_args._Fields>, java.io.Serializable, Cloneable   {
15643
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_args");
15644
 
15645
    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);
15646
 
15647
    private Voucher voucher; // required
15648
 
15649
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
15650
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
15651
      VOUCHER((short)1, "voucher");
15652
 
15653
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15654
 
15655
      static {
15656
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15657
          byName.put(field.getFieldName(), field);
15658
        }
15659
      }
15660
 
15661
      /**
15662
       * Find the _Fields constant that matches fieldId, or null if its not found.
15663
       */
15664
      public static _Fields findByThriftId(int fieldId) {
15665
        switch(fieldId) {
15666
          case 1: // VOUCHER
15667
            return VOUCHER;
15668
          default:
15669
            return null;
15670
        }
15671
      }
15672
 
15673
      /**
15674
       * Find the _Fields constant that matches fieldId, throwing an exception
15675
       * if it is not found.
15676
       */
15677
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15678
        _Fields fields = findByThriftId(fieldId);
15679
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15680
        return fields;
15681
      }
15682
 
15683
      /**
15684
       * Find the _Fields constant that matches name, or null if its not found.
15685
       */
15686
      public static _Fields findByName(String name) {
15687
        return byName.get(name);
15688
      }
15689
 
15690
      private final short _thriftId;
15691
      private final String _fieldName;
15692
 
15693
      _Fields(short thriftId, String fieldName) {
15694
        _thriftId = thriftId;
15695
        _fieldName = fieldName;
15696
      }
15697
 
15698
      public short getThriftFieldId() {
15699
        return _thriftId;
15700
      }
15701
 
15702
      public String getFieldName() {
15703
        return _fieldName;
15704
      }
15705
    }
15706
 
15707
    // isset id assignments
15708
 
15709
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
15710
    static {
15711
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15712
      tmpMap.put(_Fields.VOUCHER, new org.apache.thrift.meta_data.FieldMetaData("voucher", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15713
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
15714
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15715
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_args.class, metaDataMap);
15716
    }
15717
 
15718
    public addVoucher_args() {
15719
    }
15720
 
15721
    public addVoucher_args(
15722
      Voucher voucher)
15723
    {
15724
      this();
15725
      this.voucher = voucher;
15726
    }
15727
 
15728
    /**
15729
     * Performs a deep copy on <i>other</i>.
15730
     */
15731
    public addVoucher_args(addVoucher_args other) {
15732
      if (other.isSetVoucher()) {
15733
        this.voucher = new Voucher(other.voucher);
15734
      }
15735
    }
15736
 
15737
    public addVoucher_args deepCopy() {
15738
      return new addVoucher_args(this);
15739
    }
15740
 
15741
    @Override
15742
    public void clear() {
15743
      this.voucher = null;
15744
    }
15745
 
15746
    public Voucher getVoucher() {
15747
      return this.voucher;
15748
    }
15749
 
15750
    public void setVoucher(Voucher voucher) {
15751
      this.voucher = voucher;
15752
    }
15753
 
15754
    public void unsetVoucher() {
15755
      this.voucher = null;
15756
    }
15757
 
15758
    /** Returns true if field voucher is set (has been assigned a value) and false otherwise */
15759
    public boolean isSetVoucher() {
15760
      return this.voucher != null;
15761
    }
15762
 
15763
    public void setVoucherIsSet(boolean value) {
15764
      if (!value) {
15765
        this.voucher = null;
15766
      }
15767
    }
15768
 
15769
    public void setFieldValue(_Fields field, Object value) {
15770
      switch (field) {
15771
      case VOUCHER:
15772
        if (value == null) {
15773
          unsetVoucher();
15774
        } else {
15775
          setVoucher((Voucher)value);
15776
        }
15777
        break;
15778
 
15779
      }
15780
    }
15781
 
15782
    public Object getFieldValue(_Fields field) {
15783
      switch (field) {
15784
      case VOUCHER:
15785
        return getVoucher();
15786
 
15787
      }
15788
      throw new IllegalStateException();
15789
    }
15790
 
15791
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15792
    public boolean isSet(_Fields field) {
15793
      if (field == null) {
15794
        throw new IllegalArgumentException();
15795
      }
15796
 
15797
      switch (field) {
15798
      case VOUCHER:
15799
        return isSetVoucher();
15800
      }
15801
      throw new IllegalStateException();
15802
    }
15803
 
15804
    @Override
15805
    public boolean equals(Object that) {
15806
      if (that == null)
15807
        return false;
15808
      if (that instanceof addVoucher_args)
15809
        return this.equals((addVoucher_args)that);
15810
      return false;
15811
    }
15812
 
15813
    public boolean equals(addVoucher_args that) {
15814
      if (that == null)
15815
        return false;
15816
 
15817
      boolean this_present_voucher = true && this.isSetVoucher();
15818
      boolean that_present_voucher = true && that.isSetVoucher();
15819
      if (this_present_voucher || that_present_voucher) {
15820
        if (!(this_present_voucher && that_present_voucher))
15821
          return false;
15822
        if (!this.voucher.equals(that.voucher))
15823
          return false;
15824
      }
15825
 
15826
      return true;
15827
    }
15828
 
15829
    @Override
15830
    public int hashCode() {
15831
      return 0;
15832
    }
15833
 
15834
    public int compareTo(addVoucher_args other) {
15835
      if (!getClass().equals(other.getClass())) {
15836
        return getClass().getName().compareTo(other.getClass().getName());
15837
      }
15838
 
15839
      int lastComparison = 0;
15840
      addVoucher_args typedOther = (addVoucher_args)other;
15841
 
15842
      lastComparison = Boolean.valueOf(isSetVoucher()).compareTo(typedOther.isSetVoucher());
15843
      if (lastComparison != 0) {
15844
        return lastComparison;
15845
      }
15846
      if (isSetVoucher()) {
15847
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucher, typedOther.voucher);
15848
        if (lastComparison != 0) {
15849
          return lastComparison;
15850
        }
15851
      }
15852
      return 0;
15853
    }
15854
 
15855
    public _Fields fieldForId(int fieldId) {
15856
      return _Fields.findByThriftId(fieldId);
15857
    }
15858
 
15859
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15860
      org.apache.thrift.protocol.TField field;
15861
      iprot.readStructBegin();
15862
      while (true)
15863
      {
15864
        field = iprot.readFieldBegin();
15865
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
15866
          break;
15867
        }
15868
        switch (field.id) {
15869
          case 1: // VOUCHER
15870
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
15871
              this.voucher = new Voucher();
15872
              this.voucher.read(iprot);
15873
            } else { 
15874
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15875
            }
15876
            break;
15877
          default:
15878
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15879
        }
15880
        iprot.readFieldEnd();
15881
      }
15882
      iprot.readStructEnd();
15883
      validate();
15884
    }
15885
 
15886
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
15887
      validate();
15888
 
15889
      oprot.writeStructBegin(STRUCT_DESC);
15890
      if (this.voucher != null) {
15891
        oprot.writeFieldBegin(VOUCHER_FIELD_DESC);
15892
        this.voucher.write(oprot);
15893
        oprot.writeFieldEnd();
15894
      }
15895
      oprot.writeFieldStop();
15896
      oprot.writeStructEnd();
15897
    }
15898
 
15899
    @Override
15900
    public String toString() {
15901
      StringBuilder sb = new StringBuilder("addVoucher_args(");
15902
      boolean first = true;
15903
 
15904
      sb.append("voucher:");
15905
      if (this.voucher == null) {
15906
        sb.append("null");
15907
      } else {
15908
        sb.append(this.voucher);
15909
      }
15910
      first = false;
15911
      sb.append(")");
15912
      return sb.toString();
15913
    }
15914
 
15915
    public void validate() throws org.apache.thrift.TException {
15916
      // check for required fields
15917
    }
15918
 
15919
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15920
      try {
15921
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15922
      } catch (org.apache.thrift.TException te) {
15923
        throw new java.io.IOException(te);
15924
      }
15925
    }
15926
 
15927
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15928
      try {
15929
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15930
      } catch (org.apache.thrift.TException te) {
15931
        throw new java.io.IOException(te);
15932
      }
15933
    }
15934
 
15935
  }
15936
 
15937
  public static class addVoucher_result implements org.apache.thrift.TBase<addVoucher_result, addVoucher_result._Fields>, java.io.Serializable, Cloneable   {
15938
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_result");
15939
 
15940
 
15941
 
15942
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
15943
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
15944
;
15945
 
15946
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15947
 
15948
      static {
15949
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15950
          byName.put(field.getFieldName(), field);
15951
        }
15952
      }
15953
 
15954
      /**
15955
       * Find the _Fields constant that matches fieldId, or null if its not found.
15956
       */
15957
      public static _Fields findByThriftId(int fieldId) {
15958
        switch(fieldId) {
15959
          default:
15960
            return null;
15961
        }
15962
      }
15963
 
15964
      /**
15965
       * Find the _Fields constant that matches fieldId, throwing an exception
15966
       * if it is not found.
15967
       */
15968
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15969
        _Fields fields = findByThriftId(fieldId);
15970
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15971
        return fields;
15972
      }
15973
 
15974
      /**
15975
       * Find the _Fields constant that matches name, or null if its not found.
15976
       */
15977
      public static _Fields findByName(String name) {
15978
        return byName.get(name);
15979
      }
15980
 
15981
      private final short _thriftId;
15982
      private final String _fieldName;
15983
 
15984
      _Fields(short thriftId, String fieldName) {
15985
        _thriftId = thriftId;
15986
        _fieldName = fieldName;
15987
      }
15988
 
15989
      public short getThriftFieldId() {
15990
        return _thriftId;
15991
      }
15992
 
15993
      public String getFieldName() {
15994
        return _fieldName;
15995
      }
15996
    }
15997
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
15998
    static {
15999
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16000
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16001
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_result.class, metaDataMap);
16002
    }
16003
 
16004
    public addVoucher_result() {
16005
    }
16006
 
16007
    /**
16008
     * Performs a deep copy on <i>other</i>.
16009
     */
16010
    public addVoucher_result(addVoucher_result other) {
16011
    }
16012
 
16013
    public addVoucher_result deepCopy() {
16014
      return new addVoucher_result(this);
16015
    }
16016
 
16017
    @Override
16018
    public void clear() {
16019
    }
16020
 
16021
    public void setFieldValue(_Fields field, Object value) {
16022
      switch (field) {
16023
      }
16024
    }
16025
 
16026
    public Object getFieldValue(_Fields field) {
16027
      switch (field) {
16028
      }
16029
      throw new IllegalStateException();
16030
    }
16031
 
16032
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16033
    public boolean isSet(_Fields field) {
16034
      if (field == null) {
16035
        throw new IllegalArgumentException();
16036
      }
16037
 
16038
      switch (field) {
16039
      }
16040
      throw new IllegalStateException();
16041
    }
16042
 
16043
    @Override
16044
    public boolean equals(Object that) {
16045
      if (that == null)
16046
        return false;
16047
      if (that instanceof addVoucher_result)
16048
        return this.equals((addVoucher_result)that);
16049
      return false;
16050
    }
16051
 
16052
    public boolean equals(addVoucher_result that) {
16053
      if (that == null)
16054
        return false;
16055
 
16056
      return true;
16057
    }
16058
 
16059
    @Override
16060
    public int hashCode() {
16061
      return 0;
16062
    }
16063
 
16064
    public int compareTo(addVoucher_result other) {
16065
      if (!getClass().equals(other.getClass())) {
16066
        return getClass().getName().compareTo(other.getClass().getName());
16067
      }
16068
 
16069
      int lastComparison = 0;
16070
      addVoucher_result typedOther = (addVoucher_result)other;
16071
 
16072
      return 0;
16073
    }
16074
 
16075
    public _Fields fieldForId(int fieldId) {
16076
      return _Fields.findByThriftId(fieldId);
16077
    }
16078
 
16079
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16080
      org.apache.thrift.protocol.TField field;
16081
      iprot.readStructBegin();
16082
      while (true)
16083
      {
16084
        field = iprot.readFieldBegin();
16085
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
16086
          break;
16087
        }
16088
        switch (field.id) {
16089
          default:
16090
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16091
        }
16092
        iprot.readFieldEnd();
16093
      }
16094
      iprot.readStructEnd();
16095
      validate();
16096
    }
16097
 
16098
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
16099
      oprot.writeStructBegin(STRUCT_DESC);
16100
 
16101
      oprot.writeFieldStop();
16102
      oprot.writeStructEnd();
16103
    }
16104
 
16105
    @Override
16106
    public String toString() {
16107
      StringBuilder sb = new StringBuilder("addVoucher_result(");
16108
      boolean first = true;
16109
 
16110
      sb.append(")");
16111
      return sb.toString();
16112
    }
16113
 
16114
    public void validate() throws org.apache.thrift.TException {
16115
      // check for required fields
16116
    }
16117
 
16118
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16119
      try {
16120
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16121
      } catch (org.apache.thrift.TException te) {
16122
        throw new java.io.IOException(te);
16123
      }
16124
    }
16125
 
16126
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16127
      try {
16128
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16129
      } catch (org.apache.thrift.TException te) {
16130
        throw new java.io.IOException(te);
16131
      }
16132
    }
16133
 
16134
  }
16135
 
16136
  public static class assignVoucher_args implements org.apache.thrift.TBase<assignVoucher_args, assignVoucher_args._Fields>, java.io.Serializable, Cloneable   {
16137
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_args");
16138
 
16139
    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);
16140
    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);
16141
    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);
16142
    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);
16143
 
16144
    private long userId; // required
16145
    private String userEmail; // required
16146
    private VoucherType voucherType; // required
16147
    private long amount; // required
16148
 
16149
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
16150
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
16151
      USER_ID((short)1, "userId"),
16152
      USER_EMAIL((short)2, "userEmail"),
16153
      /**
16154
       * 
16155
       * @see VoucherType
16156
       */
16157
      VOUCHER_TYPE((short)3, "voucherType"),
16158
      AMOUNT((short)4, "amount");
16159
 
16160
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16161
 
16162
      static {
16163
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16164
          byName.put(field.getFieldName(), field);
16165
        }
16166
      }
16167
 
16168
      /**
16169
       * Find the _Fields constant that matches fieldId, or null if its not found.
16170
       */
16171
      public static _Fields findByThriftId(int fieldId) {
16172
        switch(fieldId) {
16173
          case 1: // USER_ID
16174
            return USER_ID;
16175
          case 2: // USER_EMAIL
16176
            return USER_EMAIL;
16177
          case 3: // VOUCHER_TYPE
16178
            return VOUCHER_TYPE;
16179
          case 4: // AMOUNT
16180
            return AMOUNT;
16181
          default:
16182
            return null;
16183
        }
16184
      }
16185
 
16186
      /**
16187
       * Find the _Fields constant that matches fieldId, throwing an exception
16188
       * if it is not found.
16189
       */
16190
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16191
        _Fields fields = findByThriftId(fieldId);
16192
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16193
        return fields;
16194
      }
16195
 
16196
      /**
16197
       * Find the _Fields constant that matches name, or null if its not found.
16198
       */
16199
      public static _Fields findByName(String name) {
16200
        return byName.get(name);
16201
      }
16202
 
16203
      private final short _thriftId;
16204
      private final String _fieldName;
16205
 
16206
      _Fields(short thriftId, String fieldName) {
16207
        _thriftId = thriftId;
16208
        _fieldName = fieldName;
16209
      }
16210
 
16211
      public short getThriftFieldId() {
16212
        return _thriftId;
16213
      }
16214
 
16215
      public String getFieldName() {
16216
        return _fieldName;
16217
      }
16218
    }
16219
 
16220
    // isset id assignments
16221
    private static final int __USERID_ISSET_ID = 0;
16222
    private static final int __AMOUNT_ISSET_ID = 1;
16223
    private BitSet __isset_bit_vector = new BitSet(2);
16224
 
16225
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
16226
    static {
16227
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16228
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16229
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
16230
      tmpMap.put(_Fields.USER_EMAIL, new org.apache.thrift.meta_data.FieldMetaData("userEmail", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16231
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
16232
      tmpMap.put(_Fields.VOUCHER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("voucherType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16233
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, VoucherType.class)));
16234
      tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16235
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
16236
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16237
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_args.class, metaDataMap);
16238
    }
16239
 
16240
    public assignVoucher_args() {
16241
    }
16242
 
16243
    public assignVoucher_args(
16244
      long userId,
16245
      String userEmail,
16246
      VoucherType voucherType,
16247
      long amount)
16248
    {
16249
      this();
16250
      this.userId = userId;
16251
      setUserIdIsSet(true);
16252
      this.userEmail = userEmail;
16253
      this.voucherType = voucherType;
16254
      this.amount = amount;
16255
      setAmountIsSet(true);
16256
    }
16257
 
16258
    /**
16259
     * Performs a deep copy on <i>other</i>.
16260
     */
16261
    public assignVoucher_args(assignVoucher_args other) {
16262
      __isset_bit_vector.clear();
16263
      __isset_bit_vector.or(other.__isset_bit_vector);
16264
      this.userId = other.userId;
16265
      if (other.isSetUserEmail()) {
16266
        this.userEmail = other.userEmail;
16267
      }
16268
      if (other.isSetVoucherType()) {
16269
        this.voucherType = other.voucherType;
16270
      }
16271
      this.amount = other.amount;
16272
    }
16273
 
16274
    public assignVoucher_args deepCopy() {
16275
      return new assignVoucher_args(this);
16276
    }
16277
 
16278
    @Override
16279
    public void clear() {
16280
      setUserIdIsSet(false);
16281
      this.userId = 0;
16282
      this.userEmail = null;
16283
      this.voucherType = null;
16284
      setAmountIsSet(false);
16285
      this.amount = 0;
16286
    }
16287
 
16288
    public long getUserId() {
16289
      return this.userId;
16290
    }
16291
 
16292
    public void setUserId(long userId) {
16293
      this.userId = userId;
16294
      setUserIdIsSet(true);
16295
    }
16296
 
16297
    public void unsetUserId() {
16298
      __isset_bit_vector.clear(__USERID_ISSET_ID);
16299
    }
16300
 
16301
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
16302
    public boolean isSetUserId() {
16303
      return __isset_bit_vector.get(__USERID_ISSET_ID);
16304
    }
16305
 
16306
    public void setUserIdIsSet(boolean value) {
16307
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
16308
    }
16309
 
16310
    public String getUserEmail() {
16311
      return this.userEmail;
16312
    }
16313
 
16314
    public void setUserEmail(String userEmail) {
16315
      this.userEmail = userEmail;
16316
    }
16317
 
16318
    public void unsetUserEmail() {
16319
      this.userEmail = null;
16320
    }
16321
 
16322
    /** Returns true if field userEmail is set (has been assigned a value) and false otherwise */
16323
    public boolean isSetUserEmail() {
16324
      return this.userEmail != null;
16325
    }
16326
 
16327
    public void setUserEmailIsSet(boolean value) {
16328
      if (!value) {
16329
        this.userEmail = null;
16330
      }
16331
    }
16332
 
16333
    /**
16334
     * 
16335
     * @see VoucherType
16336
     */
16337
    public VoucherType getVoucherType() {
16338
      return this.voucherType;
16339
    }
16340
 
16341
    /**
16342
     * 
16343
     * @see VoucherType
16344
     */
16345
    public void setVoucherType(VoucherType voucherType) {
16346
      this.voucherType = voucherType;
16347
    }
16348
 
16349
    public void unsetVoucherType() {
16350
      this.voucherType = null;
16351
    }
16352
 
16353
    /** Returns true if field voucherType is set (has been assigned a value) and false otherwise */
16354
    public boolean isSetVoucherType() {
16355
      return this.voucherType != null;
16356
    }
16357
 
16358
    public void setVoucherTypeIsSet(boolean value) {
16359
      if (!value) {
16360
        this.voucherType = null;
16361
      }
16362
    }
16363
 
16364
    public long getAmount() {
16365
      return this.amount;
16366
    }
16367
 
16368
    public void setAmount(long amount) {
16369
      this.amount = amount;
16370
      setAmountIsSet(true);
16371
    }
16372
 
16373
    public void unsetAmount() {
16374
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
16375
    }
16376
 
16377
    /** Returns true if field amount is set (has been assigned a value) and false otherwise */
16378
    public boolean isSetAmount() {
16379
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
16380
    }
16381
 
16382
    public void setAmountIsSet(boolean value) {
16383
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
16384
    }
16385
 
16386
    public void setFieldValue(_Fields field, Object value) {
16387
      switch (field) {
16388
      case USER_ID:
16389
        if (value == null) {
16390
          unsetUserId();
16391
        } else {
16392
          setUserId((Long)value);
16393
        }
16394
        break;
16395
 
16396
      case USER_EMAIL:
16397
        if (value == null) {
16398
          unsetUserEmail();
16399
        } else {
16400
          setUserEmail((String)value);
16401
        }
16402
        break;
16403
 
16404
      case VOUCHER_TYPE:
16405
        if (value == null) {
16406
          unsetVoucherType();
16407
        } else {
16408
          setVoucherType((VoucherType)value);
16409
        }
16410
        break;
16411
 
16412
      case AMOUNT:
16413
        if (value == null) {
16414
          unsetAmount();
16415
        } else {
16416
          setAmount((Long)value);
16417
        }
16418
        break;
16419
 
16420
      }
16421
    }
16422
 
16423
    public Object getFieldValue(_Fields field) {
16424
      switch (field) {
16425
      case USER_ID:
16426
        return Long.valueOf(getUserId());
16427
 
16428
      case USER_EMAIL:
16429
        return getUserEmail();
16430
 
16431
      case VOUCHER_TYPE:
16432
        return getVoucherType();
16433
 
16434
      case AMOUNT:
16435
        return Long.valueOf(getAmount());
16436
 
16437
      }
16438
      throw new IllegalStateException();
16439
    }
16440
 
16441
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16442
    public boolean isSet(_Fields field) {
16443
      if (field == null) {
16444
        throw new IllegalArgumentException();
16445
      }
16446
 
16447
      switch (field) {
16448
      case USER_ID:
16449
        return isSetUserId();
16450
      case USER_EMAIL:
16451
        return isSetUserEmail();
16452
      case VOUCHER_TYPE:
16453
        return isSetVoucherType();
16454
      case AMOUNT:
16455
        return isSetAmount();
16456
      }
16457
      throw new IllegalStateException();
16458
    }
16459
 
16460
    @Override
16461
    public boolean equals(Object that) {
16462
      if (that == null)
16463
        return false;
16464
      if (that instanceof assignVoucher_args)
16465
        return this.equals((assignVoucher_args)that);
16466
      return false;
16467
    }
16468
 
16469
    public boolean equals(assignVoucher_args that) {
16470
      if (that == null)
16471
        return false;
16472
 
16473
      boolean this_present_userId = true;
16474
      boolean that_present_userId = true;
16475
      if (this_present_userId || that_present_userId) {
16476
        if (!(this_present_userId && that_present_userId))
16477
          return false;
16478
        if (this.userId != that.userId)
16479
          return false;
16480
      }
16481
 
16482
      boolean this_present_userEmail = true && this.isSetUserEmail();
16483
      boolean that_present_userEmail = true && that.isSetUserEmail();
16484
      if (this_present_userEmail || that_present_userEmail) {
16485
        if (!(this_present_userEmail && that_present_userEmail))
16486
          return false;
16487
        if (!this.userEmail.equals(that.userEmail))
16488
          return false;
16489
      }
16490
 
16491
      boolean this_present_voucherType = true && this.isSetVoucherType();
16492
      boolean that_present_voucherType = true && that.isSetVoucherType();
16493
      if (this_present_voucherType || that_present_voucherType) {
16494
        if (!(this_present_voucherType && that_present_voucherType))
16495
          return false;
16496
        if (!this.voucherType.equals(that.voucherType))
16497
          return false;
16498
      }
16499
 
16500
      boolean this_present_amount = true;
16501
      boolean that_present_amount = true;
16502
      if (this_present_amount || that_present_amount) {
16503
        if (!(this_present_amount && that_present_amount))
16504
          return false;
16505
        if (this.amount != that.amount)
16506
          return false;
16507
      }
16508
 
16509
      return true;
16510
    }
16511
 
16512
    @Override
16513
    public int hashCode() {
16514
      return 0;
16515
    }
16516
 
16517
    public int compareTo(assignVoucher_args other) {
16518
      if (!getClass().equals(other.getClass())) {
16519
        return getClass().getName().compareTo(other.getClass().getName());
16520
      }
16521
 
16522
      int lastComparison = 0;
16523
      assignVoucher_args typedOther = (assignVoucher_args)other;
16524
 
16525
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
16526
      if (lastComparison != 0) {
16527
        return lastComparison;
16528
      }
16529
      if (isSetUserId()) {
16530
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
16531
        if (lastComparison != 0) {
16532
          return lastComparison;
16533
        }
16534
      }
16535
      lastComparison = Boolean.valueOf(isSetUserEmail()).compareTo(typedOther.isSetUserEmail());
16536
      if (lastComparison != 0) {
16537
        return lastComparison;
16538
      }
16539
      if (isSetUserEmail()) {
16540
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userEmail, typedOther.userEmail);
16541
        if (lastComparison != 0) {
16542
          return lastComparison;
16543
        }
16544
      }
16545
      lastComparison = Boolean.valueOf(isSetVoucherType()).compareTo(typedOther.isSetVoucherType());
16546
      if (lastComparison != 0) {
16547
        return lastComparison;
16548
      }
16549
      if (isSetVoucherType()) {
16550
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherType, typedOther.voucherType);
16551
        if (lastComparison != 0) {
16552
          return lastComparison;
16553
        }
16554
      }
16555
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
16556
      if (lastComparison != 0) {
16557
        return lastComparison;
16558
      }
16559
      if (isSetAmount()) {
16560
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
16561
        if (lastComparison != 0) {
16562
          return lastComparison;
16563
        }
16564
      }
16565
      return 0;
16566
    }
16567
 
16568
    public _Fields fieldForId(int fieldId) {
16569
      return _Fields.findByThriftId(fieldId);
16570
    }
16571
 
16572
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16573
      org.apache.thrift.protocol.TField field;
16574
      iprot.readStructBegin();
16575
      while (true)
16576
      {
16577
        field = iprot.readFieldBegin();
16578
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
16579
          break;
16580
        }
16581
        switch (field.id) {
16582
          case 1: // USER_ID
16583
            if (field.type == org.apache.thrift.protocol.TType.I64) {
16584
              this.userId = iprot.readI64();
16585
              setUserIdIsSet(true);
16586
            } else { 
16587
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16588
            }
16589
            break;
16590
          case 2: // USER_EMAIL
16591
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
16592
              this.userEmail = iprot.readString();
16593
            } else { 
16594
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16595
            }
16596
            break;
16597
          case 3: // VOUCHER_TYPE
16598
            if (field.type == org.apache.thrift.protocol.TType.I32) {
16599
              this.voucherType = VoucherType.findByValue(iprot.readI32());
16600
            } else { 
16601
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16602
            }
16603
            break;
16604
          case 4: // AMOUNT
16605
            if (field.type == org.apache.thrift.protocol.TType.I64) {
16606
              this.amount = iprot.readI64();
16607
              setAmountIsSet(true);
16608
            } else { 
16609
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16610
            }
16611
            break;
16612
          default:
16613
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16614
        }
16615
        iprot.readFieldEnd();
16616
      }
16617
      iprot.readStructEnd();
16618
      validate();
16619
    }
16620
 
16621
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
16622
      validate();
16623
 
16624
      oprot.writeStructBegin(STRUCT_DESC);
16625
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
16626
      oprot.writeI64(this.userId);
16627
      oprot.writeFieldEnd();
16628
      if (this.userEmail != null) {
16629
        oprot.writeFieldBegin(USER_EMAIL_FIELD_DESC);
16630
        oprot.writeString(this.userEmail);
16631
        oprot.writeFieldEnd();
16632
      }
16633
      if (this.voucherType != null) {
16634
        oprot.writeFieldBegin(VOUCHER_TYPE_FIELD_DESC);
16635
        oprot.writeI32(this.voucherType.getValue());
16636
        oprot.writeFieldEnd();
16637
      }
16638
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
16639
      oprot.writeI64(this.amount);
16640
      oprot.writeFieldEnd();
16641
      oprot.writeFieldStop();
16642
      oprot.writeStructEnd();
16643
    }
16644
 
16645
    @Override
16646
    public String toString() {
16647
      StringBuilder sb = new StringBuilder("assignVoucher_args(");
16648
      boolean first = true;
16649
 
16650
      sb.append("userId:");
16651
      sb.append(this.userId);
16652
      first = false;
16653
      if (!first) sb.append(", ");
16654
      sb.append("userEmail:");
16655
      if (this.userEmail == null) {
16656
        sb.append("null");
16657
      } else {
16658
        sb.append(this.userEmail);
16659
      }
16660
      first = false;
16661
      if (!first) sb.append(", ");
16662
      sb.append("voucherType:");
16663
      if (this.voucherType == null) {
16664
        sb.append("null");
16665
      } else {
16666
        sb.append(this.voucherType);
16667
      }
16668
      first = false;
16669
      if (!first) sb.append(", ");
16670
      sb.append("amount:");
16671
      sb.append(this.amount);
16672
      first = false;
16673
      sb.append(")");
16674
      return sb.toString();
16675
    }
16676
 
16677
    public void validate() throws org.apache.thrift.TException {
16678
      // check for required fields
16679
    }
16680
 
16681
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16682
      try {
16683
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16684
      } catch (org.apache.thrift.TException te) {
16685
        throw new java.io.IOException(te);
16686
      }
16687
    }
16688
 
16689
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16690
      try {
16691
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
16692
        __isset_bit_vector = new BitSet(1);
16693
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16694
      } catch (org.apache.thrift.TException te) {
16695
        throw new java.io.IOException(te);
16696
      }
16697
    }
16698
 
16699
  }
16700
 
16701
  public static class assignVoucher_result implements org.apache.thrift.TBase<assignVoucher_result, assignVoucher_result._Fields>, java.io.Serializable, Cloneable   {
16702
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_result");
16703
 
16704
    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);
16705
 
16706
    private Voucher success; // required
16707
 
16708
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
16709
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
16710
      SUCCESS((short)0, "success");
16711
 
16712
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16713
 
16714
      static {
16715
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16716
          byName.put(field.getFieldName(), field);
16717
        }
16718
      }
16719
 
16720
      /**
16721
       * Find the _Fields constant that matches fieldId, or null if its not found.
16722
       */
16723
      public static _Fields findByThriftId(int fieldId) {
16724
        switch(fieldId) {
16725
          case 0: // SUCCESS
16726
            return SUCCESS;
16727
          default:
16728
            return null;
16729
        }
16730
      }
16731
 
16732
      /**
16733
       * Find the _Fields constant that matches fieldId, throwing an exception
16734
       * if it is not found.
16735
       */
16736
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16737
        _Fields fields = findByThriftId(fieldId);
16738
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16739
        return fields;
16740
      }
16741
 
16742
      /**
16743
       * Find the _Fields constant that matches name, or null if its not found.
16744
       */
16745
      public static _Fields findByName(String name) {
16746
        return byName.get(name);
16747
      }
16748
 
16749
      private final short _thriftId;
16750
      private final String _fieldName;
16751
 
16752
      _Fields(short thriftId, String fieldName) {
16753
        _thriftId = thriftId;
16754
        _fieldName = fieldName;
16755
      }
16756
 
16757
      public short getThriftFieldId() {
16758
        return _thriftId;
16759
      }
16760
 
16761
      public String getFieldName() {
16762
        return _fieldName;
16763
      }
16764
    }
16765
 
16766
    // isset id assignments
16767
 
16768
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
16769
    static {
16770
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16771
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16772
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
16773
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16774
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_result.class, metaDataMap);
16775
    }
16776
 
16777
    public assignVoucher_result() {
16778
    }
16779
 
16780
    public assignVoucher_result(
16781
      Voucher success)
16782
    {
16783
      this();
16784
      this.success = success;
16785
    }
16786
 
16787
    /**
16788
     * Performs a deep copy on <i>other</i>.
16789
     */
16790
    public assignVoucher_result(assignVoucher_result other) {
16791
      if (other.isSetSuccess()) {
16792
        this.success = new Voucher(other.success);
16793
      }
16794
    }
16795
 
16796
    public assignVoucher_result deepCopy() {
16797
      return new assignVoucher_result(this);
16798
    }
16799
 
16800
    @Override
16801
    public void clear() {
16802
      this.success = null;
16803
    }
16804
 
16805
    public Voucher getSuccess() {
16806
      return this.success;
16807
    }
16808
 
16809
    public void setSuccess(Voucher success) {
16810
      this.success = success;
16811
    }
16812
 
16813
    public void unsetSuccess() {
16814
      this.success = null;
16815
    }
16816
 
16817
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
16818
    public boolean isSetSuccess() {
16819
      return this.success != null;
16820
    }
16821
 
16822
    public void setSuccessIsSet(boolean value) {
16823
      if (!value) {
16824
        this.success = null;
16825
      }
16826
    }
16827
 
16828
    public void setFieldValue(_Fields field, Object value) {
16829
      switch (field) {
16830
      case SUCCESS:
16831
        if (value == null) {
16832
          unsetSuccess();
16833
        } else {
16834
          setSuccess((Voucher)value);
16835
        }
16836
        break;
16837
 
16838
      }
16839
    }
16840
 
16841
    public Object getFieldValue(_Fields field) {
16842
      switch (field) {
16843
      case SUCCESS:
16844
        return getSuccess();
16845
 
16846
      }
16847
      throw new IllegalStateException();
16848
    }
16849
 
16850
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16851
    public boolean isSet(_Fields field) {
16852
      if (field == null) {
16853
        throw new IllegalArgumentException();
16854
      }
16855
 
16856
      switch (field) {
16857
      case SUCCESS:
16858
        return isSetSuccess();
16859
      }
16860
      throw new IllegalStateException();
16861
    }
16862
 
16863
    @Override
16864
    public boolean equals(Object that) {
16865
      if (that == null)
16866
        return false;
16867
      if (that instanceof assignVoucher_result)
16868
        return this.equals((assignVoucher_result)that);
16869
      return false;
16870
    }
16871
 
16872
    public boolean equals(assignVoucher_result that) {
16873
      if (that == null)
16874
        return false;
16875
 
16876
      boolean this_present_success = true && this.isSetSuccess();
16877
      boolean that_present_success = true && that.isSetSuccess();
16878
      if (this_present_success || that_present_success) {
16879
        if (!(this_present_success && that_present_success))
16880
          return false;
16881
        if (!this.success.equals(that.success))
16882
          return false;
16883
      }
16884
 
16885
      return true;
16886
    }
16887
 
16888
    @Override
16889
    public int hashCode() {
16890
      return 0;
16891
    }
16892
 
16893
    public int compareTo(assignVoucher_result other) {
16894
      if (!getClass().equals(other.getClass())) {
16895
        return getClass().getName().compareTo(other.getClass().getName());
16896
      }
16897
 
16898
      int lastComparison = 0;
16899
      assignVoucher_result typedOther = (assignVoucher_result)other;
16900
 
16901
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
16902
      if (lastComparison != 0) {
16903
        return lastComparison;
16904
      }
16905
      if (isSetSuccess()) {
16906
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
16907
        if (lastComparison != 0) {
16908
          return lastComparison;
16909
        }
16910
      }
16911
      return 0;
16912
    }
16913
 
16914
    public _Fields fieldForId(int fieldId) {
16915
      return _Fields.findByThriftId(fieldId);
16916
    }
16917
 
16918
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16919
      org.apache.thrift.protocol.TField field;
16920
      iprot.readStructBegin();
16921
      while (true)
16922
      {
16923
        field = iprot.readFieldBegin();
16924
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
16925
          break;
16926
        }
16927
        switch (field.id) {
16928
          case 0: // SUCCESS
16929
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
16930
              this.success = new Voucher();
16931
              this.success.read(iprot);
16932
            } else { 
16933
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16934
            }
16935
            break;
16936
          default:
16937
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16938
        }
16939
        iprot.readFieldEnd();
16940
      }
16941
      iprot.readStructEnd();
16942
      validate();
16943
    }
16944
 
16945
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
16946
      oprot.writeStructBegin(STRUCT_DESC);
16947
 
16948
      if (this.isSetSuccess()) {
16949
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
16950
        this.success.write(oprot);
16951
        oprot.writeFieldEnd();
16952
      }
16953
      oprot.writeFieldStop();
16954
      oprot.writeStructEnd();
16955
    }
16956
 
16957
    @Override
16958
    public String toString() {
16959
      StringBuilder sb = new StringBuilder("assignVoucher_result(");
16960
      boolean first = true;
16961
 
16962
      sb.append("success:");
16963
      if (this.success == null) {
16964
        sb.append("null");
16965
      } else {
16966
        sb.append(this.success);
16967
      }
16968
      first = false;
16969
      sb.append(")");
16970
      return sb.toString();
16971
    }
16972
 
16973
    public void validate() throws org.apache.thrift.TException {
16974
      // check for required fields
16975
    }
16976
 
16977
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16978
      try {
16979
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16980
      } catch (org.apache.thrift.TException te) {
16981
        throw new java.io.IOException(te);
16982
      }
16983
    }
16984
 
16985
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16986
      try {
16987
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16988
      } catch (org.apache.thrift.TException te) {
16989
        throw new java.io.IOException(te);
16990
      }
16991
    }
16992
 
16993
  }
16994
 
16995
  public static class markVoucherAsRedeemed_args implements org.apache.thrift.TBase<markVoucherAsRedeemed_args, markVoucherAsRedeemed_args._Fields>, java.io.Serializable, Cloneable   {
16996
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_args");
16997
 
16998
    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);
16999
    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);
17000
 
17001
    private String voucherCode; // required
17002
    private long redeemedOn; // required
17003
 
17004
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
17005
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
17006
      VOUCHER_CODE((short)1, "voucherCode"),
17007
      REDEEMED_ON((short)2, "redeemedOn");
17008
 
17009
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
17010
 
17011
      static {
17012
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
17013
          byName.put(field.getFieldName(), field);
17014
        }
17015
      }
17016
 
17017
      /**
17018
       * Find the _Fields constant that matches fieldId, or null if its not found.
17019
       */
17020
      public static _Fields findByThriftId(int fieldId) {
17021
        switch(fieldId) {
17022
          case 1: // VOUCHER_CODE
17023
            return VOUCHER_CODE;
17024
          case 2: // REDEEMED_ON
17025
            return REDEEMED_ON;
17026
          default:
17027
            return null;
17028
        }
17029
      }
17030
 
17031
      /**
17032
       * Find the _Fields constant that matches fieldId, throwing an exception
17033
       * if it is not found.
17034
       */
17035
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17036
        _Fields fields = findByThriftId(fieldId);
17037
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17038
        return fields;
17039
      }
17040
 
17041
      /**
17042
       * Find the _Fields constant that matches name, or null if its not found.
17043
       */
17044
      public static _Fields findByName(String name) {
17045
        return byName.get(name);
17046
      }
17047
 
17048
      private final short _thriftId;
17049
      private final String _fieldName;
17050
 
17051
      _Fields(short thriftId, String fieldName) {
17052
        _thriftId = thriftId;
17053
        _fieldName = fieldName;
17054
      }
17055
 
17056
      public short getThriftFieldId() {
17057
        return _thriftId;
17058
      }
17059
 
17060
      public String getFieldName() {
17061
        return _fieldName;
17062
      }
17063
    }
17064
 
17065
    // isset id assignments
17066
    private static final int __REDEEMEDON_ISSET_ID = 0;
17067
    private BitSet __isset_bit_vector = new BitSet(1);
17068
 
17069
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
17070
    static {
17071
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
17072
      tmpMap.put(_Fields.VOUCHER_CODE, new org.apache.thrift.meta_data.FieldMetaData("voucherCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17073
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
17074
      tmpMap.put(_Fields.REDEEMED_ON, new org.apache.thrift.meta_data.FieldMetaData("redeemedOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17075
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
17076
      metaDataMap = Collections.unmodifiableMap(tmpMap);
17077
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_args.class, metaDataMap);
17078
    }
17079
 
17080
    public markVoucherAsRedeemed_args() {
17081
    }
17082
 
17083
    public markVoucherAsRedeemed_args(
17084
      String voucherCode,
17085
      long redeemedOn)
17086
    {
17087
      this();
17088
      this.voucherCode = voucherCode;
17089
      this.redeemedOn = redeemedOn;
17090
      setRedeemedOnIsSet(true);
17091
    }
17092
 
17093
    /**
17094
     * Performs a deep copy on <i>other</i>.
17095
     */
17096
    public markVoucherAsRedeemed_args(markVoucherAsRedeemed_args other) {
17097
      __isset_bit_vector.clear();
17098
      __isset_bit_vector.or(other.__isset_bit_vector);
17099
      if (other.isSetVoucherCode()) {
17100
        this.voucherCode = other.voucherCode;
17101
      }
17102
      this.redeemedOn = other.redeemedOn;
17103
    }
17104
 
17105
    public markVoucherAsRedeemed_args deepCopy() {
17106
      return new markVoucherAsRedeemed_args(this);
17107
    }
17108
 
17109
    @Override
17110
    public void clear() {
17111
      this.voucherCode = null;
17112
      setRedeemedOnIsSet(false);
17113
      this.redeemedOn = 0;
17114
    }
17115
 
17116
    public String getVoucherCode() {
17117
      return this.voucherCode;
17118
    }
17119
 
17120
    public void setVoucherCode(String voucherCode) {
17121
      this.voucherCode = voucherCode;
17122
    }
17123
 
17124
    public void unsetVoucherCode() {
17125
      this.voucherCode = null;
17126
    }
17127
 
17128
    /** Returns true if field voucherCode is set (has been assigned a value) and false otherwise */
17129
    public boolean isSetVoucherCode() {
17130
      return this.voucherCode != null;
17131
    }
17132
 
17133
    public void setVoucherCodeIsSet(boolean value) {
17134
      if (!value) {
17135
        this.voucherCode = null;
17136
      }
17137
    }
17138
 
17139
    public long getRedeemedOn() {
17140
      return this.redeemedOn;
17141
    }
17142
 
17143
    public void setRedeemedOn(long redeemedOn) {
17144
      this.redeemedOn = redeemedOn;
17145
      setRedeemedOnIsSet(true);
17146
    }
17147
 
17148
    public void unsetRedeemedOn() {
17149
      __isset_bit_vector.clear(__REDEEMEDON_ISSET_ID);
17150
    }
17151
 
17152
    /** Returns true if field redeemedOn is set (has been assigned a value) and false otherwise */
17153
    public boolean isSetRedeemedOn() {
17154
      return __isset_bit_vector.get(__REDEEMEDON_ISSET_ID);
17155
    }
17156
 
17157
    public void setRedeemedOnIsSet(boolean value) {
17158
      __isset_bit_vector.set(__REDEEMEDON_ISSET_ID, value);
17159
    }
17160
 
17161
    public void setFieldValue(_Fields field, Object value) {
17162
      switch (field) {
17163
      case VOUCHER_CODE:
17164
        if (value == null) {
17165
          unsetVoucherCode();
17166
        } else {
17167
          setVoucherCode((String)value);
17168
        }
17169
        break;
17170
 
17171
      case REDEEMED_ON:
17172
        if (value == null) {
17173
          unsetRedeemedOn();
17174
        } else {
17175
          setRedeemedOn((Long)value);
17176
        }
17177
        break;
17178
 
17179
      }
17180
    }
17181
 
17182
    public Object getFieldValue(_Fields field) {
17183
      switch (field) {
17184
      case VOUCHER_CODE:
17185
        return getVoucherCode();
17186
 
17187
      case REDEEMED_ON:
17188
        return Long.valueOf(getRedeemedOn());
17189
 
17190
      }
17191
      throw new IllegalStateException();
17192
    }
17193
 
17194
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
17195
    public boolean isSet(_Fields field) {
17196
      if (field == null) {
17197
        throw new IllegalArgumentException();
17198
      }
17199
 
17200
      switch (field) {
17201
      case VOUCHER_CODE:
17202
        return isSetVoucherCode();
17203
      case REDEEMED_ON:
17204
        return isSetRedeemedOn();
17205
      }
17206
      throw new IllegalStateException();
17207
    }
17208
 
17209
    @Override
17210
    public boolean equals(Object that) {
17211
      if (that == null)
17212
        return false;
17213
      if (that instanceof markVoucherAsRedeemed_args)
17214
        return this.equals((markVoucherAsRedeemed_args)that);
17215
      return false;
17216
    }
17217
 
17218
    public boolean equals(markVoucherAsRedeemed_args that) {
17219
      if (that == null)
17220
        return false;
17221
 
17222
      boolean this_present_voucherCode = true && this.isSetVoucherCode();
17223
      boolean that_present_voucherCode = true && that.isSetVoucherCode();
17224
      if (this_present_voucherCode || that_present_voucherCode) {
17225
        if (!(this_present_voucherCode && that_present_voucherCode))
17226
          return false;
17227
        if (!this.voucherCode.equals(that.voucherCode))
17228
          return false;
17229
      }
17230
 
17231
      boolean this_present_redeemedOn = true;
17232
      boolean that_present_redeemedOn = true;
17233
      if (this_present_redeemedOn || that_present_redeemedOn) {
17234
        if (!(this_present_redeemedOn && that_present_redeemedOn))
17235
          return false;
17236
        if (this.redeemedOn != that.redeemedOn)
17237
          return false;
17238
      }
17239
 
17240
      return true;
17241
    }
17242
 
17243
    @Override
17244
    public int hashCode() {
17245
      return 0;
17246
    }
17247
 
17248
    public int compareTo(markVoucherAsRedeemed_args other) {
17249
      if (!getClass().equals(other.getClass())) {
17250
        return getClass().getName().compareTo(other.getClass().getName());
17251
      }
17252
 
17253
      int lastComparison = 0;
17254
      markVoucherAsRedeemed_args typedOther = (markVoucherAsRedeemed_args)other;
17255
 
17256
      lastComparison = Boolean.valueOf(isSetVoucherCode()).compareTo(typedOther.isSetVoucherCode());
17257
      if (lastComparison != 0) {
17258
        return lastComparison;
17259
      }
17260
      if (isSetVoucherCode()) {
17261
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherCode, typedOther.voucherCode);
17262
        if (lastComparison != 0) {
17263
          return lastComparison;
17264
        }
17265
      }
17266
      lastComparison = Boolean.valueOf(isSetRedeemedOn()).compareTo(typedOther.isSetRedeemedOn());
17267
      if (lastComparison != 0) {
17268
        return lastComparison;
17269
      }
17270
      if (isSetRedeemedOn()) {
17271
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.redeemedOn, typedOther.redeemedOn);
17272
        if (lastComparison != 0) {
17273
          return lastComparison;
17274
        }
17275
      }
17276
      return 0;
17277
    }
17278
 
17279
    public _Fields fieldForId(int fieldId) {
17280
      return _Fields.findByThriftId(fieldId);
17281
    }
17282
 
17283
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17284
      org.apache.thrift.protocol.TField field;
17285
      iprot.readStructBegin();
17286
      while (true)
17287
      {
17288
        field = iprot.readFieldBegin();
17289
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17290
          break;
17291
        }
17292
        switch (field.id) {
17293
          case 1: // VOUCHER_CODE
17294
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
17295
              this.voucherCode = iprot.readString();
17296
            } else { 
17297
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17298
            }
17299
            break;
17300
          case 2: // REDEEMED_ON
17301
            if (field.type == org.apache.thrift.protocol.TType.I64) {
17302
              this.redeemedOn = iprot.readI64();
17303
              setRedeemedOnIsSet(true);
17304
            } else { 
17305
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17306
            }
17307
            break;
17308
          default:
17309
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17310
        }
17311
        iprot.readFieldEnd();
17312
      }
17313
      iprot.readStructEnd();
17314
      validate();
17315
    }
17316
 
17317
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17318
      validate();
17319
 
17320
      oprot.writeStructBegin(STRUCT_DESC);
17321
      if (this.voucherCode != null) {
17322
        oprot.writeFieldBegin(VOUCHER_CODE_FIELD_DESC);
17323
        oprot.writeString(this.voucherCode);
17324
        oprot.writeFieldEnd();
17325
      }
17326
      oprot.writeFieldBegin(REDEEMED_ON_FIELD_DESC);
17327
      oprot.writeI64(this.redeemedOn);
17328
      oprot.writeFieldEnd();
17329
      oprot.writeFieldStop();
17330
      oprot.writeStructEnd();
17331
    }
17332
 
17333
    @Override
17334
    public String toString() {
17335
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_args(");
17336
      boolean first = true;
17337
 
17338
      sb.append("voucherCode:");
17339
      if (this.voucherCode == null) {
17340
        sb.append("null");
17341
      } else {
17342
        sb.append(this.voucherCode);
17343
      }
17344
      first = false;
17345
      if (!first) sb.append(", ");
17346
      sb.append("redeemedOn:");
17347
      sb.append(this.redeemedOn);
17348
      first = false;
17349
      sb.append(")");
17350
      return sb.toString();
17351
    }
17352
 
17353
    public void validate() throws org.apache.thrift.TException {
17354
      // check for required fields
17355
    }
17356
 
17357
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17358
      try {
17359
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17360
      } catch (org.apache.thrift.TException te) {
17361
        throw new java.io.IOException(te);
17362
      }
17363
    }
17364
 
17365
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
17366
      try {
17367
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
17368
        __isset_bit_vector = new BitSet(1);
17369
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
17370
      } catch (org.apache.thrift.TException te) {
17371
        throw new java.io.IOException(te);
17372
      }
17373
    }
17374
 
17375
  }
17376
 
17377
  public static class markVoucherAsRedeemed_result implements org.apache.thrift.TBase<markVoucherAsRedeemed_result, markVoucherAsRedeemed_result._Fields>, java.io.Serializable, Cloneable   {
17378
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_result");
17379
 
17380
    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);
17381
 
17382
    private boolean success; // required
17383
 
17384
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
17385
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
17386
      SUCCESS((short)0, "success");
17387
 
17388
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
17389
 
17390
      static {
17391
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
17392
          byName.put(field.getFieldName(), field);
17393
        }
17394
      }
17395
 
17396
      /**
17397
       * Find the _Fields constant that matches fieldId, or null if its not found.
17398
       */
17399
      public static _Fields findByThriftId(int fieldId) {
17400
        switch(fieldId) {
17401
          case 0: // SUCCESS
17402
            return SUCCESS;
17403
          default:
17404
            return null;
17405
        }
17406
      }
17407
 
17408
      /**
17409
       * Find the _Fields constant that matches fieldId, throwing an exception
17410
       * if it is not found.
17411
       */
17412
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17413
        _Fields fields = findByThriftId(fieldId);
17414
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17415
        return fields;
17416
      }
17417
 
17418
      /**
17419
       * Find the _Fields constant that matches name, or null if its not found.
17420
       */
17421
      public static _Fields findByName(String name) {
17422
        return byName.get(name);
17423
      }
17424
 
17425
      private final short _thriftId;
17426
      private final String _fieldName;
17427
 
17428
      _Fields(short thriftId, String fieldName) {
17429
        _thriftId = thriftId;
17430
        _fieldName = fieldName;
17431
      }
17432
 
17433
      public short getThriftFieldId() {
17434
        return _thriftId;
17435
      }
17436
 
17437
      public String getFieldName() {
17438
        return _fieldName;
17439
      }
17440
    }
17441
 
17442
    // isset id assignments
17443
    private static final int __SUCCESS_ISSET_ID = 0;
17444
    private BitSet __isset_bit_vector = new BitSet(1);
17445
 
17446
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
17447
    static {
17448
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
17449
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17450
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
17451
      metaDataMap = Collections.unmodifiableMap(tmpMap);
17452
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_result.class, metaDataMap);
17453
    }
17454
 
17455
    public markVoucherAsRedeemed_result() {
17456
    }
17457
 
17458
    public markVoucherAsRedeemed_result(
17459
      boolean success)
17460
    {
17461
      this();
17462
      this.success = success;
17463
      setSuccessIsSet(true);
17464
    }
17465
 
17466
    /**
17467
     * Performs a deep copy on <i>other</i>.
17468
     */
17469
    public markVoucherAsRedeemed_result(markVoucherAsRedeemed_result other) {
17470
      __isset_bit_vector.clear();
17471
      __isset_bit_vector.or(other.__isset_bit_vector);
17472
      this.success = other.success;
17473
    }
17474
 
17475
    public markVoucherAsRedeemed_result deepCopy() {
17476
      return new markVoucherAsRedeemed_result(this);
17477
    }
17478
 
17479
    @Override
17480
    public void clear() {
17481
      setSuccessIsSet(false);
17482
      this.success = false;
17483
    }
17484
 
17485
    public boolean isSuccess() {
17486
      return this.success;
17487
    }
17488
 
17489
    public void setSuccess(boolean success) {
17490
      this.success = success;
17491
      setSuccessIsSet(true);
17492
    }
17493
 
17494
    public void unsetSuccess() {
17495
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
17496
    }
17497
 
17498
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
17499
    public boolean isSetSuccess() {
17500
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
17501
    }
17502
 
17503
    public void setSuccessIsSet(boolean value) {
17504
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
17505
    }
17506
 
17507
    public void setFieldValue(_Fields field, Object value) {
17508
      switch (field) {
17509
      case SUCCESS:
17510
        if (value == null) {
17511
          unsetSuccess();
17512
        } else {
17513
          setSuccess((Boolean)value);
17514
        }
17515
        break;
17516
 
17517
      }
17518
    }
17519
 
17520
    public Object getFieldValue(_Fields field) {
17521
      switch (field) {
17522
      case SUCCESS:
17523
        return Boolean.valueOf(isSuccess());
17524
 
17525
      }
17526
      throw new IllegalStateException();
17527
    }
17528
 
17529
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
17530
    public boolean isSet(_Fields field) {
17531
      if (field == null) {
17532
        throw new IllegalArgumentException();
17533
      }
17534
 
17535
      switch (field) {
17536
      case SUCCESS:
17537
        return isSetSuccess();
17538
      }
17539
      throw new IllegalStateException();
17540
    }
17541
 
17542
    @Override
17543
    public boolean equals(Object that) {
17544
      if (that == null)
17545
        return false;
17546
      if (that instanceof markVoucherAsRedeemed_result)
17547
        return this.equals((markVoucherAsRedeemed_result)that);
17548
      return false;
17549
    }
17550
 
17551
    public boolean equals(markVoucherAsRedeemed_result that) {
17552
      if (that == null)
17553
        return false;
17554
 
17555
      boolean this_present_success = true;
17556
      boolean that_present_success = true;
17557
      if (this_present_success || that_present_success) {
17558
        if (!(this_present_success && that_present_success))
17559
          return false;
17560
        if (this.success != that.success)
17561
          return false;
17562
      }
17563
 
17564
      return true;
17565
    }
17566
 
17567
    @Override
17568
    public int hashCode() {
17569
      return 0;
17570
    }
17571
 
17572
    public int compareTo(markVoucherAsRedeemed_result other) {
17573
      if (!getClass().equals(other.getClass())) {
17574
        return getClass().getName().compareTo(other.getClass().getName());
17575
      }
17576
 
17577
      int lastComparison = 0;
17578
      markVoucherAsRedeemed_result typedOther = (markVoucherAsRedeemed_result)other;
17579
 
17580
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
17581
      if (lastComparison != 0) {
17582
        return lastComparison;
17583
      }
17584
      if (isSetSuccess()) {
17585
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
17586
        if (lastComparison != 0) {
17587
          return lastComparison;
17588
        }
17589
      }
17590
      return 0;
17591
    }
17592
 
17593
    public _Fields fieldForId(int fieldId) {
17594
      return _Fields.findByThriftId(fieldId);
17595
    }
17596
 
17597
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17598
      org.apache.thrift.protocol.TField field;
17599
      iprot.readStructBegin();
17600
      while (true)
17601
      {
17602
        field = iprot.readFieldBegin();
17603
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17604
          break;
17605
        }
17606
        switch (field.id) {
17607
          case 0: // SUCCESS
17608
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
17609
              this.success = iprot.readBool();
17610
              setSuccessIsSet(true);
17611
            } else { 
17612
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17613
            }
17614
            break;
17615
          default:
17616
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17617
        }
17618
        iprot.readFieldEnd();
17619
      }
17620
      iprot.readStructEnd();
17621
      validate();
17622
    }
17623
 
17624
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17625
      oprot.writeStructBegin(STRUCT_DESC);
17626
 
17627
      if (this.isSetSuccess()) {
17628
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
17629
        oprot.writeBool(this.success);
17630
        oprot.writeFieldEnd();
17631
      }
17632
      oprot.writeFieldStop();
17633
      oprot.writeStructEnd();
17634
    }
17635
 
17636
    @Override
17637
    public String toString() {
17638
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_result(");
17639
      boolean first = true;
17640
 
17641
      sb.append("success:");
17642
      sb.append(this.success);
17643
      first = false;
17644
      sb.append(")");
17645
      return sb.toString();
17646
    }
17647
 
17648
    public void validate() throws org.apache.thrift.TException {
17649
      // check for required fields
17650
    }
17651
 
17652
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17653
      try {
17654
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17655
      } catch (org.apache.thrift.TException te) {
17656
        throw new java.io.IOException(te);
17657
      }
17658
    }
17659
 
17660
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
17661
      try {
17662
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
17663
      } catch (org.apache.thrift.TException te) {
17664
        throw new java.io.IOException(te);
17665
      }
17666
    }
17667
 
17668
  }
17669
 
1982 varun.gupt 17670
}