Subversion Repositories SmartDukaan

Rev

Rev 6736 | Rev 7746 | 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
 
6736 amit.gupta 46
    public Map<Long,Double> getEmiDiscount(long cartId) throws PromotionException, org.apache.thrift.TException;
47
 
6433 anupam.sin 48
    public Map<Long,String> applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws PromotionException, org.apache.thrift.TException;
49
 
3430 rajveer 50
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 51
 
3430 rajveer 52
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 53
 
6497 amit.gupta 54
    public List<Coupon> getActiveCodes(long promotionId) throws PromotionException, org.apache.thrift.TException;
55
 
56
    public void deleteCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
57
 
7092 amit.gupta 58
    public List<Coupon> getAllCouponsByPromotionId(long promotionId) throws PromotionException, org.apache.thrift.TException;
59
 
3385 varun.gupt 60
    /**
61
     * Returns a list of active coupons
62
     */
3430 rajveer 63
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException;
3385 varun.gupt 64
 
65
    /**
6561 amit.gupta 66
     * Creates a coupon with prefix (optional, pass null)and returns couponcode if successfully created.
6250 amit.gupta 67
     * 
68
     * @param promotionId
6730 anupam.sin 69
     * @param couponCode
6679 anupam.sin 70
     * @param arguments
6356 amit.gupta 71
     * @param isCod
6561 amit.gupta 72
     * @param prefix
6250 amit.gupta 73
     */
6730 anupam.sin 74
    public String createCoupon(long promotionId, String couponCode, String arguments, boolean isCod, String prefix) throws PromotionException, org.apache.thrift.TException;
6250 amit.gupta 75
 
76
    /**
3385 varun.gupt 77
     * Returns the count of successful payments done using a given coupon
78
     * 
79
     * @param couponCode
80
     */
3430 rajveer 81
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
3385 varun.gupt 82
 
83
    /**
84
     * Returns the doc string of the rule module
85
     * 
86
     * @param ruleName
87
     */
3430 rajveer 88
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException;
3385 varun.gupt 89
 
4189 varun.gupt 90
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException;
91
 
4494 varun.gupt 92
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException;
93
 
5469 rajveer 94
    public void addVoucher(Voucher voucher) throws org.apache.thrift.TException;
95
 
96
    public Voucher assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException;
97
 
98
    public boolean markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException;
99
 
1982 varun.gupt 100
  }
101
 
3430 rajveer 102
  public interface AsyncIface extends in.shop2020.generic.GenericService .AsyncIface {
1982 varun.gupt 103
 
3430 rajveer 104
    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 105
 
6301 amit.gupta 106
    public void getCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCoupon_call> resultHandler) throws org.apache.thrift.TException;
107
 
108
    public void isGiftVoucher(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.isGiftVoucher_call> resultHandler) throws org.apache.thrift.TException;
109
 
6356 amit.gupta 110
    public void isCodApplicable(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.isCodApplicable_call> resultHandler) throws org.apache.thrift.TException;
111
 
3430 rajveer 112
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllPromotions_call> resultHandler) throws org.apache.thrift.TException;
113
 
114
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPromotionById_call> resultHandler) throws org.apache.thrift.TException;
115
 
116
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException;
117
 
118
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyCoupon_call> resultHandler) throws org.apache.thrift.TException;
119
 
6736 amit.gupta 120
    public void getEmiDiscount(long cartId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getEmiDiscount_call> resultHandler) throws org.apache.thrift.TException;
121
 
6433 anupam.sin 122
    public void applyRechargeCoupon(String couponCode, long totalAmount, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyRechargeCoupon_call> resultHandler) throws org.apache.thrift.TException;
123
 
3430 rajveer 124
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException;
125
 
126
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException;
127
 
6497 amit.gupta 128
    public void getActiveCodes(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getActiveCodes_call> resultHandler) throws org.apache.thrift.TException;
129
 
130
    public void deleteCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.deleteCoupon_call> resultHandler) throws org.apache.thrift.TException;
131
 
7092 amit.gupta 132
    public void getAllCouponsByPromotionId(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllCouponsByPromotionId_call> resultHandler) throws org.apache.thrift.TException;
133
 
3430 rajveer 134
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException;
135
 
6730 anupam.sin 136
    public void createCoupon(long promotionId, String couponCode, String arguments, boolean isCod, String prefix, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.createCoupon_call> resultHandler) throws org.apache.thrift.TException;
6250 amit.gupta 137
 
3430 rajveer 138
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException;
139
 
140
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getRuleDocString_call> resultHandler) throws org.apache.thrift.TException;
141
 
4189 varun.gupt 142
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException;
143
 
4494 varun.gupt 144
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException;
145
 
5469 rajveer 146
    public void addVoucher(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.addVoucher_call> resultHandler) throws org.apache.thrift.TException;
147
 
148
    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;
149
 
150
    public void markVoucherAsRedeemed(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.markVoucherAsRedeemed_call> resultHandler) throws org.apache.thrift.TException;
151
 
3430 rajveer 152
  }
153
 
154
  public static class Client extends in.shop2020.generic.GenericService.Client implements Iface {
155
    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
156
      public Factory() {}
157
      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
158
        return new Client(prot);
159
      }
160
      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
161
        return new Client(iprot, oprot);
162
      }
1982 varun.gupt 163
    }
164
 
3430 rajveer 165
    public Client(org.apache.thrift.protocol.TProtocol prot)
1982 varun.gupt 166
    {
3430 rajveer 167
      super(prot, prot);
1982 varun.gupt 168
    }
169
 
3430 rajveer 170
    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
171
      super(iprot, oprot);
1982 varun.gupt 172
    }
173
 
3430 rajveer 174
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 175
    {
176
      send_createPromotion(name, ruleExecutionSrc, startOn, endOn);
177
      recv_createPromotion();
178
    }
179
 
3430 rajveer 180
    public void send_createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws org.apache.thrift.TException
1982 varun.gupt 181
    {
182
      createPromotion_args args = new createPromotion_args();
3430 rajveer 183
      args.setName(name);
184
      args.setRuleExecutionSrc(ruleExecutionSrc);
185
      args.setStartOn(startOn);
186
      args.setEndOn(endOn);
187
      sendBase("createPromotion", args);
1982 varun.gupt 188
    }
189
 
3430 rajveer 190
    public void recv_createPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 191
    {
192
      createPromotion_result result = new createPromotion_result();
3430 rajveer 193
      receiveBase(result, "createPromotion");
1982 varun.gupt 194
      if (result.pex != null) {
195
        throw result.pex;
196
      }
197
      return;
198
    }
199
 
6301 amit.gupta 200
    public Coupon getCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
201
    {
202
      send_getCoupon(couponCode);
203
      return recv_getCoupon();
204
    }
205
 
206
    public void send_getCoupon(String couponCode) throws org.apache.thrift.TException
207
    {
208
      getCoupon_args args = new getCoupon_args();
209
      args.setCouponCode(couponCode);
210
      sendBase("getCoupon", args);
211
    }
212
 
213
    public Coupon recv_getCoupon() throws PromotionException, org.apache.thrift.TException
214
    {
215
      getCoupon_result result = new getCoupon_result();
216
      receiveBase(result, "getCoupon");
217
      if (result.isSetSuccess()) {
218
        return result.success;
219
      }
220
      if (result.pex != null) {
221
        throw result.pex;
222
      }
223
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCoupon failed: unknown result");
224
    }
225
 
226
    public boolean isGiftVoucher(String couponCode) throws PromotionException, org.apache.thrift.TException
227
    {
228
      send_isGiftVoucher(couponCode);
229
      return recv_isGiftVoucher();
230
    }
231
 
232
    public void send_isGiftVoucher(String couponCode) throws org.apache.thrift.TException
233
    {
234
      isGiftVoucher_args args = new isGiftVoucher_args();
235
      args.setCouponCode(couponCode);
236
      sendBase("isGiftVoucher", args);
237
    }
238
 
239
    public boolean recv_isGiftVoucher() throws PromotionException, org.apache.thrift.TException
240
    {
241
      isGiftVoucher_result result = new isGiftVoucher_result();
242
      receiveBase(result, "isGiftVoucher");
243
      if (result.isSetSuccess()) {
244
        return result.success;
245
      }
246
      if (result.pex != null) {
247
        throw result.pex;
248
      }
249
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isGiftVoucher failed: unknown result");
250
    }
251
 
6356 amit.gupta 252
    public boolean isCodApplicable(String couponCode) throws PromotionException, org.apache.thrift.TException
253
    {
254
      send_isCodApplicable(couponCode);
255
      return recv_isCodApplicable();
256
    }
257
 
258
    public void send_isCodApplicable(String couponCode) throws org.apache.thrift.TException
259
    {
260
      isCodApplicable_args args = new isCodApplicable_args();
261
      args.setCouponCode(couponCode);
262
      sendBase("isCodApplicable", args);
263
    }
264
 
265
    public boolean recv_isCodApplicable() throws PromotionException, org.apache.thrift.TException
266
    {
267
      isCodApplicable_result result = new isCodApplicable_result();
268
      receiveBase(result, "isCodApplicable");
269
      if (result.isSetSuccess()) {
270
        return result.success;
271
      }
272
      if (result.pex != null) {
273
        throw result.pex;
274
      }
275
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isCodApplicable failed: unknown result");
276
    }
277
 
3430 rajveer 278
    public List<Promotion> getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 279
    {
280
      send_getAllPromotions();
281
      return recv_getAllPromotions();
282
    }
283
 
3430 rajveer 284
    public void send_getAllPromotions() throws org.apache.thrift.TException
1982 varun.gupt 285
    {
286
      getAllPromotions_args args = new getAllPromotions_args();
3430 rajveer 287
      sendBase("getAllPromotions", args);
1982 varun.gupt 288
    }
289
 
3430 rajveer 290
    public List<Promotion> recv_getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 291
    {
292
      getAllPromotions_result result = new getAllPromotions_result();
3430 rajveer 293
      receiveBase(result, "getAllPromotions");
1982 varun.gupt 294
      if (result.isSetSuccess()) {
295
        return result.success;
296
      }
297
      if (result.pex != null) {
298
        throw result.pex;
299
      }
3430 rajveer 300
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllPromotions failed: unknown result");
1982 varun.gupt 301
    }
302
 
3430 rajveer 303
    public Promotion getPromotionById(long promotionId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 304
    {
305
      send_getPromotionById(promotionId);
306
      return recv_getPromotionById();
307
    }
308
 
3430 rajveer 309
    public void send_getPromotionById(long promotionId) throws org.apache.thrift.TException
1982 varun.gupt 310
    {
311
      getPromotionById_args args = new getPromotionById_args();
3430 rajveer 312
      args.setPromotionId(promotionId);
313
      sendBase("getPromotionById", args);
1982 varun.gupt 314
    }
315
 
3430 rajveer 316
    public Promotion recv_getPromotionById() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 317
    {
318
      getPromotionById_result result = new getPromotionById_result();
3430 rajveer 319
      receiveBase(result, "getPromotionById");
1982 varun.gupt 320
      if (result.isSetSuccess()) {
321
        return result.success;
322
      }
323
      if (result.pex != null) {
324
        throw result.pex;
325
      }
3430 rajveer 326
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPromotionById failed: unknown result");
1982 varun.gupt 327
    }
328
 
3430 rajveer 329
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 330
    {
331
      send_generateCouponsForPromotion(promotionId, couponCode);
332
      recv_generateCouponsForPromotion();
333
    }
334
 
3430 rajveer 335
    public void send_generateCouponsForPromotion(long promotionId, String couponCode) throws org.apache.thrift.TException
1982 varun.gupt 336
    {
337
      generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
3430 rajveer 338
      args.setPromotionId(promotionId);
339
      args.setCouponCode(couponCode);
340
      sendBase("generateCouponsForPromotion", args);
1982 varun.gupt 341
    }
342
 
3430 rajveer 343
    public void recv_generateCouponsForPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 344
    {
345
      generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
3430 rajveer 346
      receiveBase(result, "generateCouponsForPromotion");
1982 varun.gupt 347
      if (result.pex != null) {
348
        throw result.pex;
349
      }
350
      return;
351
    }
352
 
3430 rajveer 353
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 354
    {
355
      send_applyCoupon(couponCode, cartId);
356
      return recv_applyCoupon();
357
    }
358
 
3430 rajveer 359
    public void send_applyCoupon(String couponCode, long cartId) throws org.apache.thrift.TException
1982 varun.gupt 360
    {
361
      applyCoupon_args args = new applyCoupon_args();
3430 rajveer 362
      args.setCouponCode(couponCode);
363
      args.setCartId(cartId);
364
      sendBase("applyCoupon", args);
1982 varun.gupt 365
    }
366
 
3430 rajveer 367
    public Cart recv_applyCoupon() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 368
    {
369
      applyCoupon_result result = new applyCoupon_result();
3430 rajveer 370
      receiveBase(result, "applyCoupon");
1982 varun.gupt 371
      if (result.isSetSuccess()) {
372
        return result.success;
373
      }
374
      if (result.pex != null) {
375
        throw result.pex;
376
      }
3430 rajveer 377
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "applyCoupon failed: unknown result");
1982 varun.gupt 378
    }
379
 
6736 amit.gupta 380
    public Map<Long,Double> getEmiDiscount(long cartId) throws PromotionException, org.apache.thrift.TException
381
    {
382
      send_getEmiDiscount(cartId);
383
      return recv_getEmiDiscount();
384
    }
385
 
386
    public void send_getEmiDiscount(long cartId) throws org.apache.thrift.TException
387
    {
388
      getEmiDiscount_args args = new getEmiDiscount_args();
389
      args.setCartId(cartId);
390
      sendBase("getEmiDiscount", args);
391
    }
392
 
393
    public Map<Long,Double> recv_getEmiDiscount() throws PromotionException, org.apache.thrift.TException
394
    {
395
      getEmiDiscount_result result = new getEmiDiscount_result();
396
      receiveBase(result, "getEmiDiscount");
397
      if (result.isSetSuccess()) {
398
        return result.success;
399
      }
400
      if (result.pex != null) {
401
        throw result.pex;
402
      }
403
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getEmiDiscount failed: unknown result");
404
    }
405
 
6433 anupam.sin 406
    public Map<Long,String> applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws PromotionException, org.apache.thrift.TException
407
    {
408
      send_applyRechargeCoupon(couponCode, totalAmount, userId);
409
      return recv_applyRechargeCoupon();
410
    }
411
 
412
    public void send_applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws org.apache.thrift.TException
413
    {
414
      applyRechargeCoupon_args args = new applyRechargeCoupon_args();
415
      args.setCouponCode(couponCode);
416
      args.setTotalAmount(totalAmount);
417
      args.setUserId(userId);
418
      sendBase("applyRechargeCoupon", args);
419
    }
420
 
421
    public Map<Long,String> recv_applyRechargeCoupon() throws PromotionException, org.apache.thrift.TException
422
    {
423
      applyRechargeCoupon_result result = new applyRechargeCoupon_result();
424
      receiveBase(result, "applyRechargeCoupon");
425
      if (result.isSetSuccess()) {
426
        return result.success;
427
      }
428
      if (result.pex != null) {
429
        throw result.pex;
430
      }
431
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "applyRechargeCoupon failed: unknown result");
432
    }
433
 
3430 rajveer 434
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 435
    {
436
      send_trackCouponUsage(couponCode, transactionId, userId);
437
      recv_trackCouponUsage();
438
    }
439
 
3430 rajveer 440
    public void send_trackCouponUsage(String couponCode, long transactionId, long userId) throws org.apache.thrift.TException
1982 varun.gupt 441
    {
442
      trackCouponUsage_args args = new trackCouponUsage_args();
3430 rajveer 443
      args.setCouponCode(couponCode);
444
      args.setTransactionId(transactionId);
445
      args.setUserId(userId);
446
      sendBase("trackCouponUsage", args);
1982 varun.gupt 447
    }
448
 
3430 rajveer 449
    public void recv_trackCouponUsage() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 450
    {
451
      trackCouponUsage_result result = new trackCouponUsage_result();
3430 rajveer 452
      receiveBase(result, "trackCouponUsage");
1982 varun.gupt 453
      if (result.pex != null) {
454
        throw result.pex;
455
      }
456
      return;
457
    }
458
 
3430 rajveer 459
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 460
    {
461
      send_getCouponUsageCountByUser(couponCode, userId);
462
      return recv_getCouponUsageCountByUser();
463
    }
464
 
3430 rajveer 465
    public void send_getCouponUsageCountByUser(String couponCode, long userId) throws org.apache.thrift.TException
1982 varun.gupt 466
    {
467
      getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
3430 rajveer 468
      args.setCouponCode(couponCode);
469
      args.setUserId(userId);
470
      sendBase("getCouponUsageCountByUser", args);
1982 varun.gupt 471
    }
472
 
3430 rajveer 473
    public long recv_getCouponUsageCountByUser() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 474
    {
475
      getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
3430 rajveer 476
      receiveBase(result, "getCouponUsageCountByUser");
1982 varun.gupt 477
      if (result.isSetSuccess()) {
478
        return result.success;
479
      }
480
      if (result.pex != null) {
481
        throw result.pex;
482
      }
3430 rajveer 483
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCouponUsageCountByUser failed: unknown result");
1982 varun.gupt 484
    }
485
 
6497 amit.gupta 486
    public List<Coupon> getActiveCodes(long promotionId) throws PromotionException, org.apache.thrift.TException
487
    {
488
      send_getActiveCodes(promotionId);
489
      return recv_getActiveCodes();
490
    }
491
 
492
    public void send_getActiveCodes(long promotionId) throws org.apache.thrift.TException
493
    {
494
      getActiveCodes_args args = new getActiveCodes_args();
495
      args.setPromotionId(promotionId);
496
      sendBase("getActiveCodes", args);
497
    }
498
 
499
    public List<Coupon> recv_getActiveCodes() throws PromotionException, org.apache.thrift.TException
500
    {
501
      getActiveCodes_result result = new getActiveCodes_result();
502
      receiveBase(result, "getActiveCodes");
503
      if (result.isSetSuccess()) {
504
        return result.success;
505
      }
506
      if (result.pex != null) {
507
        throw result.pex;
508
      }
509
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getActiveCodes failed: unknown result");
510
    }
511
 
512
    public void deleteCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
513
    {
514
      send_deleteCoupon(couponCode);
515
      recv_deleteCoupon();
516
    }
517
 
518
    public void send_deleteCoupon(String couponCode) throws org.apache.thrift.TException
519
    {
520
      deleteCoupon_args args = new deleteCoupon_args();
521
      args.setCouponCode(couponCode);
522
      sendBase("deleteCoupon", args);
523
    }
524
 
525
    public void recv_deleteCoupon() throws PromotionException, org.apache.thrift.TException
526
    {
527
      deleteCoupon_result result = new deleteCoupon_result();
528
      receiveBase(result, "deleteCoupon");
529
      if (result.pex != null) {
530
        throw result.pex;
531
      }
532
      return;
533
    }
534
 
7092 amit.gupta 535
    public List<Coupon> getAllCouponsByPromotionId(long promotionId) throws PromotionException, org.apache.thrift.TException
536
    {
537
      send_getAllCouponsByPromotionId(promotionId);
538
      return recv_getAllCouponsByPromotionId();
539
    }
540
 
541
    public void send_getAllCouponsByPromotionId(long promotionId) throws org.apache.thrift.TException
542
    {
543
      getAllCouponsByPromotionId_args args = new getAllCouponsByPromotionId_args();
544
      args.setPromotionId(promotionId);
545
      sendBase("getAllCouponsByPromotionId", args);
546
    }
547
 
548
    public List<Coupon> recv_getAllCouponsByPromotionId() throws PromotionException, org.apache.thrift.TException
549
    {
550
      getAllCouponsByPromotionId_result result = new getAllCouponsByPromotionId_result();
551
      receiveBase(result, "getAllCouponsByPromotionId");
552
      if (result.isSetSuccess()) {
553
        return result.success;
554
      }
555
      if (result.pex != null) {
556
        throw result.pex;
557
      }
558
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllCouponsByPromotionId failed: unknown result");
559
    }
560
 
3430 rajveer 561
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 562
    {
563
      send_getActiveCoupons();
564
      return recv_getActiveCoupons();
565
    }
566
 
3430 rajveer 567
    public void send_getActiveCoupons() throws org.apache.thrift.TException
3385 varun.gupt 568
    {
569
      getActiveCoupons_args args = new getActiveCoupons_args();
3430 rajveer 570
      sendBase("getActiveCoupons", args);
3385 varun.gupt 571
    }
572
 
3430 rajveer 573
    public List<Coupon> recv_getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 574
    {
575
      getActiveCoupons_result result = new getActiveCoupons_result();
3430 rajveer 576
      receiveBase(result, "getActiveCoupons");
3385 varun.gupt 577
      if (result.isSetSuccess()) {
578
        return result.success;
579
      }
580
      if (result.pex != null) {
581
        throw result.pex;
582
      }
3430 rajveer 583
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getActiveCoupons failed: unknown result");
3385 varun.gupt 584
    }
585
 
6730 anupam.sin 586
    public String createCoupon(long promotionId, String couponCode, String arguments, boolean isCod, String prefix) throws PromotionException, org.apache.thrift.TException
6250 amit.gupta 587
    {
6730 anupam.sin 588
      send_createCoupon(promotionId, couponCode, arguments, isCod, prefix);
6250 amit.gupta 589
      return recv_createCoupon();
590
    }
591
 
6730 anupam.sin 592
    public void send_createCoupon(long promotionId, String couponCode, String arguments, boolean isCod, String prefix) throws org.apache.thrift.TException
6250 amit.gupta 593
    {
594
      createCoupon_args args = new createCoupon_args();
595
      args.setPromotionId(promotionId);
6730 anupam.sin 596
      args.setCouponCode(couponCode);
6679 anupam.sin 597
      args.setArguments(arguments);
6356 amit.gupta 598
      args.setIsCod(isCod);
6561 amit.gupta 599
      args.setPrefix(prefix);
6250 amit.gupta 600
      sendBase("createCoupon", args);
601
    }
602
 
603
    public String recv_createCoupon() throws PromotionException, org.apache.thrift.TException
604
    {
605
      createCoupon_result result = new createCoupon_result();
606
      receiveBase(result, "createCoupon");
607
      if (result.isSetSuccess()) {
608
        return result.success;
609
      }
610
      if (result.pex != null) {
611
        throw result.pex;
612
      }
613
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createCoupon failed: unknown result");
614
    }
615
 
3430 rajveer 616
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 617
    {
618
      send_getSuccessfulPaymentCountForCoupon(couponCode);
619
      return recv_getSuccessfulPaymentCountForCoupon();
620
    }
621
 
3430 rajveer 622
    public void send_getSuccessfulPaymentCountForCoupon(String couponCode) throws org.apache.thrift.TException
3385 varun.gupt 623
    {
624
      getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
3430 rajveer 625
      args.setCouponCode(couponCode);
626
      sendBase("getSuccessfulPaymentCountForCoupon", args);
3385 varun.gupt 627
    }
628
 
3430 rajveer 629
    public long recv_getSuccessfulPaymentCountForCoupon() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 630
    {
631
      getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
3430 rajveer 632
      receiveBase(result, "getSuccessfulPaymentCountForCoupon");
3385 varun.gupt 633
      if (result.isSetSuccess()) {
634
        return result.success;
635
      }
636
      if (result.pex != null) {
637
        throw result.pex;
638
      }
3430 rajveer 639
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSuccessfulPaymentCountForCoupon failed: unknown result");
3385 varun.gupt 640
    }
641
 
3430 rajveer 642
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 643
    {
644
      send_getRuleDocString(ruleName);
645
      return recv_getRuleDocString();
646
    }
647
 
3430 rajveer 648
    public void send_getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 649
    {
650
      getRuleDocString_args args = new getRuleDocString_args();
3430 rajveer 651
      args.setRuleName(ruleName);
652
      sendBase("getRuleDocString", args);
3385 varun.gupt 653
    }
654
 
3430 rajveer 655
    public String recv_getRuleDocString() throws org.apache.thrift.TException
3385 varun.gupt 656
    {
657
      getRuleDocString_result result = new getRuleDocString_result();
3430 rajveer 658
      receiveBase(result, "getRuleDocString");
3385 varun.gupt 659
      if (result.isSetSuccess()) {
660
        return result.success;
661
      }
3430 rajveer 662
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRuleDocString failed: unknown result");
3385 varun.gupt 663
    }
664
 
4189 varun.gupt 665
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException
666
    {
667
      send_getItemDiscountMap(itemIds);
668
      return recv_getItemDiscountMap();
669
    }
670
 
671
    public void send_getItemDiscountMap(List<Long> itemIds) throws org.apache.thrift.TException
672
    {
673
      getItemDiscountMap_args args = new getItemDiscountMap_args();
674
      args.setItemIds(itemIds);
675
      sendBase("getItemDiscountMap", args);
676
    }
677
 
678
    public List<ItemCouponDiscount> recv_getItemDiscountMap() throws PromotionException, org.apache.thrift.TException
679
    {
680
      getItemDiscountMap_result result = new getItemDiscountMap_result();
681
      receiveBase(result, "getItemDiscountMap");
682
      if (result.isSetSuccess()) {
683
        return result.success;
684
      }
685
      if (result.pex != null) {
686
        throw result.pex;
687
      }
688
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemDiscountMap failed: unknown result");
689
    }
690
 
4494 varun.gupt 691
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
692
    {
693
      send_getDiscountsForEntity(entityId);
694
      return recv_getDiscountsForEntity();
695
    }
696
 
697
    public void send_getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
698
    {
699
      getDiscountsForEntity_args args = new getDiscountsForEntity_args();
700
      args.setEntityId(entityId);
701
      sendBase("getDiscountsForEntity", args);
702
    }
703
 
704
    public Map<String,Double> recv_getDiscountsForEntity() throws org.apache.thrift.TException
705
    {
706
      getDiscountsForEntity_result result = new getDiscountsForEntity_result();
707
      receiveBase(result, "getDiscountsForEntity");
708
      if (result.isSetSuccess()) {
709
        return result.success;
710
      }
711
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getDiscountsForEntity failed: unknown result");
712
    }
713
 
5469 rajveer 714
    public void addVoucher(Voucher voucher) throws org.apache.thrift.TException
715
    {
716
      send_addVoucher(voucher);
717
      recv_addVoucher();
718
    }
719
 
720
    public void send_addVoucher(Voucher voucher) throws org.apache.thrift.TException
721
    {
722
      addVoucher_args args = new addVoucher_args();
723
      args.setVoucher(voucher);
724
      sendBase("addVoucher", args);
725
    }
726
 
727
    public void recv_addVoucher() throws org.apache.thrift.TException
728
    {
729
      addVoucher_result result = new addVoucher_result();
730
      receiveBase(result, "addVoucher");
731
      return;
732
    }
733
 
734
    public Voucher assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException
735
    {
736
      send_assignVoucher(userId, userEmail, voucherType, amount);
737
      return recv_assignVoucher();
738
    }
739
 
740
    public void send_assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException
741
    {
742
      assignVoucher_args args = new assignVoucher_args();
743
      args.setUserId(userId);
744
      args.setUserEmail(userEmail);
745
      args.setVoucherType(voucherType);
746
      args.setAmount(amount);
747
      sendBase("assignVoucher", args);
748
    }
749
 
750
    public Voucher recv_assignVoucher() throws org.apache.thrift.TException
751
    {
752
      assignVoucher_result result = new assignVoucher_result();
753
      receiveBase(result, "assignVoucher");
754
      if (result.isSetSuccess()) {
755
        return result.success;
756
      }
757
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "assignVoucher failed: unknown result");
758
    }
759
 
760
    public boolean markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException
761
    {
762
      send_markVoucherAsRedeemed(voucherCode, redeemedOn);
763
      return recv_markVoucherAsRedeemed();
764
    }
765
 
766
    public void send_markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException
767
    {
768
      markVoucherAsRedeemed_args args = new markVoucherAsRedeemed_args();
769
      args.setVoucherCode(voucherCode);
770
      args.setRedeemedOn(redeemedOn);
771
      sendBase("markVoucherAsRedeemed", args);
772
    }
773
 
774
    public boolean recv_markVoucherAsRedeemed() throws org.apache.thrift.TException
775
    {
776
      markVoucherAsRedeemed_result result = new markVoucherAsRedeemed_result();
777
      receiveBase(result, "markVoucherAsRedeemed");
778
      if (result.isSetSuccess()) {
779
        return result.success;
780
      }
781
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "markVoucherAsRedeemed failed: unknown result");
782
    }
783
 
1982 varun.gupt 784
  }
3430 rajveer 785
  public static class AsyncClient extends in.shop2020.generic.GenericService.AsyncClient implements AsyncIface {
786
    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
787
      private org.apache.thrift.async.TAsyncClientManager clientManager;
788
      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
789
      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
790
        this.clientManager = clientManager;
791
        this.protocolFactory = protocolFactory;
792
      }
793
      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
794
        return new AsyncClient(protocolFactory, clientManager, transport);
795
      }
1982 varun.gupt 796
    }
797
 
3430 rajveer 798
    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
799
      super(protocolFactory, clientManager, transport);
800
    }
1982 varun.gupt 801
 
3430 rajveer 802
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn, org.apache.thrift.async.AsyncMethodCallback<createPromotion_call> resultHandler) throws org.apache.thrift.TException {
803
      checkReady();
804
      createPromotion_call method_call = new createPromotion_call(name, ruleExecutionSrc, startOn, endOn, resultHandler, this, ___protocolFactory, ___transport);
805
      this.___currentMethod = method_call;
806
      ___manager.call(method_call);
1982 varun.gupt 807
    }
808
 
3430 rajveer 809
    public static class createPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
810
      private String name;
811
      private String ruleExecutionSrc;
812
      private long startOn;
813
      private long endOn;
814
      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 {
815
        super(client, protocolFactory, transport, resultHandler, false);
816
        this.name = name;
817
        this.ruleExecutionSrc = ruleExecutionSrc;
818
        this.startOn = startOn;
819
        this.endOn = endOn;
1982 varun.gupt 820
      }
821
 
3430 rajveer 822
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
823
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
1982 varun.gupt 824
        createPromotion_args args = new createPromotion_args();
3430 rajveer 825
        args.setName(name);
826
        args.setRuleExecutionSrc(ruleExecutionSrc);
827
        args.setStartOn(startOn);
828
        args.setEndOn(endOn);
829
        args.write(prot);
830
        prot.writeMessageEnd();
1982 varun.gupt 831
      }
832
 
3430 rajveer 833
      public void getResult() throws PromotionException, org.apache.thrift.TException {
834
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
835
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 836
        }
3430 rajveer 837
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
838
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
839
        (new Client(prot)).recv_createPromotion();
1982 varun.gupt 840
      }
3430 rajveer 841
    }
1982 varun.gupt 842
 
6301 amit.gupta 843
    public void getCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getCoupon_call> resultHandler) throws org.apache.thrift.TException {
844
      checkReady();
845
      getCoupon_call method_call = new getCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
846
      this.___currentMethod = method_call;
847
      ___manager.call(method_call);
848
    }
849
 
850
    public static class getCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
851
      private String couponCode;
852
      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 {
853
        super(client, protocolFactory, transport, resultHandler, false);
854
        this.couponCode = couponCode;
855
      }
856
 
857
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
858
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
859
        getCoupon_args args = new getCoupon_args();
860
        args.setCouponCode(couponCode);
861
        args.write(prot);
862
        prot.writeMessageEnd();
863
      }
864
 
865
      public Coupon getResult() throws PromotionException, org.apache.thrift.TException {
866
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
867
          throw new IllegalStateException("Method call not finished!");
868
        }
869
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
870
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
871
        return (new Client(prot)).recv_getCoupon();
872
      }
873
    }
874
 
875
    public void isGiftVoucher(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isGiftVoucher_call> resultHandler) throws org.apache.thrift.TException {
876
      checkReady();
877
      isGiftVoucher_call method_call = new isGiftVoucher_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
878
      this.___currentMethod = method_call;
879
      ___manager.call(method_call);
880
    }
881
 
882
    public static class isGiftVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
883
      private String couponCode;
884
      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 {
885
        super(client, protocolFactory, transport, resultHandler, false);
886
        this.couponCode = couponCode;
887
      }
888
 
889
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
890
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isGiftVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
891
        isGiftVoucher_args args = new isGiftVoucher_args();
892
        args.setCouponCode(couponCode);
893
        args.write(prot);
894
        prot.writeMessageEnd();
895
      }
896
 
897
      public boolean getResult() throws PromotionException, org.apache.thrift.TException {
898
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
899
          throw new IllegalStateException("Method call not finished!");
900
        }
901
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
902
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
903
        return (new Client(prot)).recv_isGiftVoucher();
904
      }
905
    }
906
 
6356 amit.gupta 907
    public void isCodApplicable(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isCodApplicable_call> resultHandler) throws org.apache.thrift.TException {
908
      checkReady();
909
      isCodApplicable_call method_call = new isCodApplicable_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
910
      this.___currentMethod = method_call;
911
      ___manager.call(method_call);
912
    }
913
 
914
    public static class isCodApplicable_call extends org.apache.thrift.async.TAsyncMethodCall {
915
      private String couponCode;
916
      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 {
917
        super(client, protocolFactory, transport, resultHandler, false);
918
        this.couponCode = couponCode;
919
      }
920
 
921
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
922
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isCodApplicable", org.apache.thrift.protocol.TMessageType.CALL, 0));
923
        isCodApplicable_args args = new isCodApplicable_args();
924
        args.setCouponCode(couponCode);
925
        args.write(prot);
926
        prot.writeMessageEnd();
927
      }
928
 
929
      public boolean getResult() throws PromotionException, org.apache.thrift.TException {
930
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
931
          throw new IllegalStateException("Method call not finished!");
932
        }
933
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
934
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
935
        return (new Client(prot)).recv_isCodApplicable();
936
      }
937
    }
938
 
3430 rajveer 939
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<getAllPromotions_call> resultHandler) throws org.apache.thrift.TException {
940
      checkReady();
941
      getAllPromotions_call method_call = new getAllPromotions_call(resultHandler, this, ___protocolFactory, ___transport);
942
      this.___currentMethod = method_call;
943
      ___manager.call(method_call);
1982 varun.gupt 944
    }
945
 
3430 rajveer 946
    public static class getAllPromotions_call extends org.apache.thrift.async.TAsyncMethodCall {
947
      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 {
948
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 949
      }
950
 
3430 rajveer 951
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
952
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllPromotions", org.apache.thrift.protocol.TMessageType.CALL, 0));
953
        getAllPromotions_args args = new getAllPromotions_args();
954
        args.write(prot);
955
        prot.writeMessageEnd();
956
      }
1982 varun.gupt 957
 
3430 rajveer 958
      public List<Promotion> getResult() throws PromotionException, org.apache.thrift.TException {
959
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
960
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 961
        }
3430 rajveer 962
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
963
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
964
        return (new Client(prot)).recv_getAllPromotions();
1982 varun.gupt 965
      }
3430 rajveer 966
    }
1982 varun.gupt 967
 
3430 rajveer 968
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getPromotionById_call> resultHandler) throws org.apache.thrift.TException {
969
      checkReady();
970
      getPromotionById_call method_call = new getPromotionById_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
971
      this.___currentMethod = method_call;
972
      ___manager.call(method_call);
1982 varun.gupt 973
    }
974
 
3430 rajveer 975
    public static class getPromotionById_call extends org.apache.thrift.async.TAsyncMethodCall {
976
      private long promotionId;
977
      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 {
978
        super(client, protocolFactory, transport, resultHandler, false);
979
        this.promotionId = promotionId;
1982 varun.gupt 980
      }
981
 
3430 rajveer 982
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
983
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPromotionById", org.apache.thrift.protocol.TMessageType.CALL, 0));
984
        getPromotionById_args args = new getPromotionById_args();
985
        args.setPromotionId(promotionId);
986
        args.write(prot);
987
        prot.writeMessageEnd();
988
      }
1982 varun.gupt 989
 
3430 rajveer 990
      public Promotion getResult() throws PromotionException, org.apache.thrift.TException {
991
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
992
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 993
        }
3430 rajveer 994
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
995
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
996
        return (new Client(prot)).recv_getPromotionById();
1982 varun.gupt 997
      }
3430 rajveer 998
    }
1982 varun.gupt 999
 
3430 rajveer 1000
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException {
1001
      checkReady();
1002
      generateCouponsForPromotion_call method_call = new generateCouponsForPromotion_call(promotionId, couponCode, resultHandler, this, ___protocolFactory, ___transport);
1003
      this.___currentMethod = method_call;
1004
      ___manager.call(method_call);
1982 varun.gupt 1005
    }
1006
 
3430 rajveer 1007
    public static class generateCouponsForPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
1008
      private long promotionId;
1009
      private String couponCode;
1010
      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 {
1011
        super(client, protocolFactory, transport, resultHandler, false);
1012
        this.promotionId = promotionId;
1013
        this.couponCode = couponCode;
1982 varun.gupt 1014
      }
1015
 
3430 rajveer 1016
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1017
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("generateCouponsForPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
1018
        generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
1019
        args.setPromotionId(promotionId);
1020
        args.setCouponCode(couponCode);
1021
        args.write(prot);
1022
        prot.writeMessageEnd();
3385 varun.gupt 1023
      }
1024
 
3430 rajveer 1025
      public void getResult() throws PromotionException, org.apache.thrift.TException {
1026
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1027
          throw new IllegalStateException("Method call not finished!");
3385 varun.gupt 1028
        }
3430 rajveer 1029
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1030
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1031
        (new Client(prot)).recv_generateCouponsForPromotion();
3385 varun.gupt 1032
      }
1033
    }
1034
 
3430 rajveer 1035
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<applyCoupon_call> resultHandler) throws org.apache.thrift.TException {
1036
      checkReady();
1037
      applyCoupon_call method_call = new applyCoupon_call(couponCode, cartId, resultHandler, this, ___protocolFactory, ___transport);
1038
      this.___currentMethod = method_call;
1039
      ___manager.call(method_call);
3385 varun.gupt 1040
    }
1041
 
3430 rajveer 1042
    public static class applyCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1043
      private String couponCode;
1044
      private long cartId;
1045
      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 {
1046
        super(client, protocolFactory, transport, resultHandler, false);
1047
        this.couponCode = couponCode;
1048
        this.cartId = cartId;
1982 varun.gupt 1049
      }
1050
 
3430 rajveer 1051
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1052
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("applyCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1053
        applyCoupon_args args = new applyCoupon_args();
1054
        args.setCouponCode(couponCode);
1055
        args.setCartId(cartId);
1056
        args.write(prot);
1057
        prot.writeMessageEnd();
1982 varun.gupt 1058
      }
1059
 
3430 rajveer 1060
      public Cart getResult() throws PromotionException, org.apache.thrift.TException {
1061
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1062
          throw new IllegalStateException("Method call not finished!");
1063
        }
1064
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1065
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1066
        return (new Client(prot)).recv_applyCoupon();
1982 varun.gupt 1067
      }
3430 rajveer 1068
    }
1982 varun.gupt 1069
 
6736 amit.gupta 1070
    public void getEmiDiscount(long cartId, org.apache.thrift.async.AsyncMethodCallback<getEmiDiscount_call> resultHandler) throws org.apache.thrift.TException {
1071
      checkReady();
1072
      getEmiDiscount_call method_call = new getEmiDiscount_call(cartId, resultHandler, this, ___protocolFactory, ___transport);
1073
      this.___currentMethod = method_call;
1074
      ___manager.call(method_call);
1075
    }
1076
 
1077
    public static class getEmiDiscount_call extends org.apache.thrift.async.TAsyncMethodCall {
1078
      private long cartId;
1079
      public getEmiDiscount_call(long cartId, org.apache.thrift.async.AsyncMethodCallback<getEmiDiscount_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1080
        super(client, protocolFactory, transport, resultHandler, false);
1081
        this.cartId = cartId;
1082
      }
1083
 
1084
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1085
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getEmiDiscount", org.apache.thrift.protocol.TMessageType.CALL, 0));
1086
        getEmiDiscount_args args = new getEmiDiscount_args();
1087
        args.setCartId(cartId);
1088
        args.write(prot);
1089
        prot.writeMessageEnd();
1090
      }
1091
 
1092
      public Map<Long,Double> getResult() throws PromotionException, org.apache.thrift.TException {
1093
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1094
          throw new IllegalStateException("Method call not finished!");
1095
        }
1096
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1097
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1098
        return (new Client(prot)).recv_getEmiDiscount();
1099
      }
1100
    }
1101
 
6433 anupam.sin 1102
    public void applyRechargeCoupon(String couponCode, long totalAmount, long userId, org.apache.thrift.async.AsyncMethodCallback<applyRechargeCoupon_call> resultHandler) throws org.apache.thrift.TException {
1103
      checkReady();
1104
      applyRechargeCoupon_call method_call = new applyRechargeCoupon_call(couponCode, totalAmount, userId, resultHandler, this, ___protocolFactory, ___transport);
1105
      this.___currentMethod = method_call;
1106
      ___manager.call(method_call);
1107
    }
1108
 
1109
    public static class applyRechargeCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1110
      private String couponCode;
1111
      private long totalAmount;
1112
      private long userId;
1113
      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 {
1114
        super(client, protocolFactory, transport, resultHandler, false);
1115
        this.couponCode = couponCode;
1116
        this.totalAmount = totalAmount;
1117
        this.userId = userId;
1118
      }
1119
 
1120
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1121
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("applyRechargeCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1122
        applyRechargeCoupon_args args = new applyRechargeCoupon_args();
1123
        args.setCouponCode(couponCode);
1124
        args.setTotalAmount(totalAmount);
1125
        args.setUserId(userId);
1126
        args.write(prot);
1127
        prot.writeMessageEnd();
1128
      }
1129
 
1130
      public Map<Long,String> getResult() throws PromotionException, org.apache.thrift.TException {
1131
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1132
          throw new IllegalStateException("Method call not finished!");
1133
        }
1134
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1135
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1136
        return (new Client(prot)).recv_applyRechargeCoupon();
1137
      }
1138
    }
1139
 
3430 rajveer 1140
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException {
1141
      checkReady();
1142
      trackCouponUsage_call method_call = new trackCouponUsage_call(couponCode, transactionId, userId, resultHandler, this, ___protocolFactory, ___transport);
1143
      this.___currentMethod = method_call;
1144
      ___manager.call(method_call);
1145
    }
1982 varun.gupt 1146
 
3430 rajveer 1147
    public static class trackCouponUsage_call extends org.apache.thrift.async.TAsyncMethodCall {
1148
      private String couponCode;
1149
      private long transactionId;
1150
      private long userId;
1151
      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 {
1152
        super(client, protocolFactory, transport, resultHandler, false);
1153
        this.couponCode = couponCode;
1154
        this.transactionId = transactionId;
1155
        this.userId = userId;
1982 varun.gupt 1156
      }
1157
 
3430 rajveer 1158
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1159
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("trackCouponUsage", org.apache.thrift.protocol.TMessageType.CALL, 0));
1160
        trackCouponUsage_args args = new trackCouponUsage_args();
1161
        args.setCouponCode(couponCode);
1162
        args.setTransactionId(transactionId);
1163
        args.setUserId(userId);
1164
        args.write(prot);
1165
        prot.writeMessageEnd();
1982 varun.gupt 1166
      }
1167
 
3430 rajveer 1168
      public void getResult() throws PromotionException, org.apache.thrift.TException {
1169
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1170
          throw new IllegalStateException("Method call not finished!");
1171
        }
1172
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1173
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1174
        (new Client(prot)).recv_trackCouponUsage();
1982 varun.gupt 1175
      }
1176
    }
1177
 
3430 rajveer 1178
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException {
1179
      checkReady();
1180
      getCouponUsageCountByUser_call method_call = new getCouponUsageCountByUser_call(couponCode, userId, resultHandler, this, ___protocolFactory, ___transport);
1181
      this.___currentMethod = method_call;
1182
      ___manager.call(method_call);
1982 varun.gupt 1183
    }
1184
 
3430 rajveer 1185
    public static class getCouponUsageCountByUser_call extends org.apache.thrift.async.TAsyncMethodCall {
1186
      private String couponCode;
1187
      private long userId;
1188
      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 {
1189
        super(client, protocolFactory, transport, resultHandler, false);
1190
        this.couponCode = couponCode;
1191
        this.userId = userId;
1192
      }
1982 varun.gupt 1193
 
3430 rajveer 1194
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1195
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCouponUsageCountByUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
1196
        getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
1197
        args.setCouponCode(couponCode);
1198
        args.setUserId(userId);
1199
        args.write(prot);
1200
        prot.writeMessageEnd();
1201
      }
1982 varun.gupt 1202
 
3430 rajveer 1203
      public long getResult() throws PromotionException, org.apache.thrift.TException {
1204
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1205
          throw new IllegalStateException("Method call not finished!");
1206
        }
1207
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1208
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1209
        return (new Client(prot)).recv_getCouponUsageCountByUser();
1210
      }
1982 varun.gupt 1211
    }
1212
 
6497 amit.gupta 1213
    public void getActiveCodes(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getActiveCodes_call> resultHandler) throws org.apache.thrift.TException {
1214
      checkReady();
1215
      getActiveCodes_call method_call = new getActiveCodes_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
1216
      this.___currentMethod = method_call;
1217
      ___manager.call(method_call);
1218
    }
1219
 
1220
    public static class getActiveCodes_call extends org.apache.thrift.async.TAsyncMethodCall {
1221
      private long promotionId;
1222
      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 {
1223
        super(client, protocolFactory, transport, resultHandler, false);
1224
        this.promotionId = promotionId;
1225
      }
1226
 
1227
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1228
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getActiveCodes", org.apache.thrift.protocol.TMessageType.CALL, 0));
1229
        getActiveCodes_args args = new getActiveCodes_args();
1230
        args.setPromotionId(promotionId);
1231
        args.write(prot);
1232
        prot.writeMessageEnd();
1233
      }
1234
 
1235
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
1236
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1237
          throw new IllegalStateException("Method call not finished!");
1238
        }
1239
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1240
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1241
        return (new Client(prot)).recv_getActiveCodes();
1242
      }
1243
    }
1244
 
1245
    public void deleteCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<deleteCoupon_call> resultHandler) throws org.apache.thrift.TException {
1246
      checkReady();
1247
      deleteCoupon_call method_call = new deleteCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
1248
      this.___currentMethod = method_call;
1249
      ___manager.call(method_call);
1250
    }
1251
 
1252
    public static class deleteCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1253
      private String couponCode;
1254
      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 {
1255
        super(client, protocolFactory, transport, resultHandler, false);
1256
        this.couponCode = couponCode;
1257
      }
1258
 
1259
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1260
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1261
        deleteCoupon_args args = new deleteCoupon_args();
1262
        args.setCouponCode(couponCode);
1263
        args.write(prot);
1264
        prot.writeMessageEnd();
1265
      }
1266
 
1267
      public void getResult() throws PromotionException, org.apache.thrift.TException {
1268
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1269
          throw new IllegalStateException("Method call not finished!");
1270
        }
1271
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1272
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1273
        (new Client(prot)).recv_deleteCoupon();
1274
      }
1275
    }
1276
 
7092 amit.gupta 1277
    public void getAllCouponsByPromotionId(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getAllCouponsByPromotionId_call> resultHandler) throws org.apache.thrift.TException {
1278
      checkReady();
1279
      getAllCouponsByPromotionId_call method_call = new getAllCouponsByPromotionId_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
1280
      this.___currentMethod = method_call;
1281
      ___manager.call(method_call);
1282
    }
1283
 
1284
    public static class getAllCouponsByPromotionId_call extends org.apache.thrift.async.TAsyncMethodCall {
1285
      private long promotionId;
1286
      public getAllCouponsByPromotionId_call(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getAllCouponsByPromotionId_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1287
        super(client, protocolFactory, transport, resultHandler, false);
1288
        this.promotionId = promotionId;
1289
      }
1290
 
1291
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1292
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllCouponsByPromotionId", org.apache.thrift.protocol.TMessageType.CALL, 0));
1293
        getAllCouponsByPromotionId_args args = new getAllCouponsByPromotionId_args();
1294
        args.setPromotionId(promotionId);
1295
        args.write(prot);
1296
        prot.writeMessageEnd();
1297
      }
1298
 
1299
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
1300
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1301
          throw new IllegalStateException("Method call not finished!");
1302
        }
1303
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1304
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1305
        return (new Client(prot)).recv_getAllCouponsByPromotionId();
1306
      }
1307
    }
1308
 
3430 rajveer 1309
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException {
1310
      checkReady();
1311
      getActiveCoupons_call method_call = new getActiveCoupons_call(resultHandler, this, ___protocolFactory, ___transport);
1312
      this.___currentMethod = method_call;
1313
      ___manager.call(method_call);
1982 varun.gupt 1314
    }
1315
 
3430 rajveer 1316
    public static class getActiveCoupons_call extends org.apache.thrift.async.TAsyncMethodCall {
1317
      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 {
1318
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 1319
      }
1320
 
3430 rajveer 1321
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1322
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getActiveCoupons", org.apache.thrift.protocol.TMessageType.CALL, 0));
1323
        getActiveCoupons_args args = new getActiveCoupons_args();
1324
        args.write(prot);
1325
        prot.writeMessageEnd();
1326
      }
1982 varun.gupt 1327
 
3430 rajveer 1328
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
1329
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1330
          throw new IllegalStateException("Method call not finished!");
1331
        }
1332
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1333
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1334
        return (new Client(prot)).recv_getActiveCoupons();
1982 varun.gupt 1335
      }
1336
    }
1337
 
6730 anupam.sin 1338
    public void createCoupon(long promotionId, String couponCode, String arguments, boolean isCod, String prefix, org.apache.thrift.async.AsyncMethodCallback<createCoupon_call> resultHandler) throws org.apache.thrift.TException {
6250 amit.gupta 1339
      checkReady();
6730 anupam.sin 1340
      createCoupon_call method_call = new createCoupon_call(promotionId, couponCode, arguments, isCod, prefix, resultHandler, this, ___protocolFactory, ___transport);
6250 amit.gupta 1341
      this.___currentMethod = method_call;
1342
      ___manager.call(method_call);
1343
    }
1344
 
1345
    public static class createCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1346
      private long promotionId;
6730 anupam.sin 1347
      private String couponCode;
6679 anupam.sin 1348
      private String arguments;
6356 amit.gupta 1349
      private boolean isCod;
6561 amit.gupta 1350
      private String prefix;
6730 anupam.sin 1351
      public createCoupon_call(long promotionId, String couponCode, String arguments, boolean isCod, String prefix, org.apache.thrift.async.AsyncMethodCallback<createCoupon_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
6250 amit.gupta 1352
        super(client, protocolFactory, transport, resultHandler, false);
1353
        this.promotionId = promotionId;
6730 anupam.sin 1354
        this.couponCode = couponCode;
6679 anupam.sin 1355
        this.arguments = arguments;
6356 amit.gupta 1356
        this.isCod = isCod;
6561 amit.gupta 1357
        this.prefix = prefix;
6250 amit.gupta 1358
      }
1359
 
1360
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1361
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1362
        createCoupon_args args = new createCoupon_args();
1363
        args.setPromotionId(promotionId);
6730 anupam.sin 1364
        args.setCouponCode(couponCode);
6679 anupam.sin 1365
        args.setArguments(arguments);
6356 amit.gupta 1366
        args.setIsCod(isCod);
6561 amit.gupta 1367
        args.setPrefix(prefix);
6250 amit.gupta 1368
        args.write(prot);
1369
        prot.writeMessageEnd();
1370
      }
1371
 
1372
      public String getResult() throws PromotionException, org.apache.thrift.TException {
1373
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1374
          throw new IllegalStateException("Method call not finished!");
1375
        }
1376
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1377
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1378
        return (new Client(prot)).recv_createCoupon();
1379
      }
1380
    }
1381
 
3430 rajveer 1382
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException {
1383
      checkReady();
1384
      getSuccessfulPaymentCountForCoupon_call method_call = new getSuccessfulPaymentCountForCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
1385
      this.___currentMethod = method_call;
1386
      ___manager.call(method_call);
1982 varun.gupt 1387
    }
1388
 
3430 rajveer 1389
    public static class getSuccessfulPaymentCountForCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1390
      private String couponCode;
1391
      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 {
1392
        super(client, protocolFactory, transport, resultHandler, false);
1393
        this.couponCode = couponCode;
1982 varun.gupt 1394
      }
1395
 
3430 rajveer 1396
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1397
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSuccessfulPaymentCountForCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1398
        getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
1399
        args.setCouponCode(couponCode);
1400
        args.write(prot);
1401
        prot.writeMessageEnd();
1402
      }
1982 varun.gupt 1403
 
3430 rajveer 1404
      public long getResult() throws PromotionException, org.apache.thrift.TException {
1405
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1406
          throw new IllegalStateException("Method call not finished!");
1407
        }
1408
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1409
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1410
        return (new Client(prot)).recv_getSuccessfulPaymentCountForCoupon();
1411
      }
1982 varun.gupt 1412
    }
1413
 
3430 rajveer 1414
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<getRuleDocString_call> resultHandler) throws org.apache.thrift.TException {
1415
      checkReady();
1416
      getRuleDocString_call method_call = new getRuleDocString_call(ruleName, resultHandler, this, ___protocolFactory, ___transport);
1417
      this.___currentMethod = method_call;
1418
      ___manager.call(method_call);
1982 varun.gupt 1419
    }
1420
 
3430 rajveer 1421
    public static class getRuleDocString_call extends org.apache.thrift.async.TAsyncMethodCall {
1422
      private String ruleName;
1423
      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 {
1424
        super(client, protocolFactory, transport, resultHandler, false);
1425
        this.ruleName = ruleName;
1426
      }
1982 varun.gupt 1427
 
3430 rajveer 1428
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1429
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRuleDocString", org.apache.thrift.protocol.TMessageType.CALL, 0));
1430
        getRuleDocString_args args = new getRuleDocString_args();
1431
        args.setRuleName(ruleName);
1432
        args.write(prot);
1433
        prot.writeMessageEnd();
1982 varun.gupt 1434
      }
1435
 
3430 rajveer 1436
      public String getResult() throws org.apache.thrift.TException {
1437
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1438
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 1439
        }
3430 rajveer 1440
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1441
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1442
        return (new Client(prot)).recv_getRuleDocString();
1982 varun.gupt 1443
      }
1444
    }
1445
 
4189 varun.gupt 1446
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException {
1447
      checkReady();
1448
      getItemDiscountMap_call method_call = new getItemDiscountMap_call(itemIds, resultHandler, this, ___protocolFactory, ___transport);
1449
      this.___currentMethod = method_call;
1450
      ___manager.call(method_call);
1451
    }
1452
 
1453
    public static class getItemDiscountMap_call extends org.apache.thrift.async.TAsyncMethodCall {
1454
      private List<Long> itemIds;
1455
      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 {
1456
        super(client, protocolFactory, transport, resultHandler, false);
1457
        this.itemIds = itemIds;
1458
      }
1459
 
1460
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1461
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getItemDiscountMap", org.apache.thrift.protocol.TMessageType.CALL, 0));
1462
        getItemDiscountMap_args args = new getItemDiscountMap_args();
1463
        args.setItemIds(itemIds);
1464
        args.write(prot);
1465
        prot.writeMessageEnd();
1466
      }
1467
 
1468
      public List<ItemCouponDiscount> getResult() throws PromotionException, org.apache.thrift.TException {
1469
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1470
          throw new IllegalStateException("Method call not finished!");
1471
        }
1472
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1473
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1474
        return (new Client(prot)).recv_getItemDiscountMap();
1475
      }
1476
    }
1477
 
4494 varun.gupt 1478
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException {
1479
      checkReady();
1480
      getDiscountsForEntity_call method_call = new getDiscountsForEntity_call(entityId, resultHandler, this, ___protocolFactory, ___transport);
1481
      this.___currentMethod = method_call;
1482
      ___manager.call(method_call);
1483
    }
1484
 
1485
    public static class getDiscountsForEntity_call extends org.apache.thrift.async.TAsyncMethodCall {
1486
      private long entityId;
1487
      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 {
1488
        super(client, protocolFactory, transport, resultHandler, false);
1489
        this.entityId = entityId;
1490
      }
1491
 
1492
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1493
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getDiscountsForEntity", org.apache.thrift.protocol.TMessageType.CALL, 0));
1494
        getDiscountsForEntity_args args = new getDiscountsForEntity_args();
1495
        args.setEntityId(entityId);
1496
        args.write(prot);
1497
        prot.writeMessageEnd();
1498
      }
1499
 
1500
      public Map<String,Double> getResult() throws org.apache.thrift.TException {
1501
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1502
          throw new IllegalStateException("Method call not finished!");
1503
        }
1504
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1505
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1506
        return (new Client(prot)).recv_getDiscountsForEntity();
1507
      }
1508
    }
1509
 
5469 rajveer 1510
    public void addVoucher(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<addVoucher_call> resultHandler) throws org.apache.thrift.TException {
1511
      checkReady();
1512
      addVoucher_call method_call = new addVoucher_call(voucher, resultHandler, this, ___protocolFactory, ___transport);
1513
      this.___currentMethod = method_call;
1514
      ___manager.call(method_call);
1515
    }
1516
 
1517
    public static class addVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
1518
      private Voucher voucher;
1519
      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 {
1520
        super(client, protocolFactory, transport, resultHandler, false);
1521
        this.voucher = voucher;
1522
      }
1523
 
1524
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1525
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
1526
        addVoucher_args args = new addVoucher_args();
1527
        args.setVoucher(voucher);
1528
        args.write(prot);
1529
        prot.writeMessageEnd();
1530
      }
1531
 
1532
      public void getResult() throws org.apache.thrift.TException {
1533
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1534
          throw new IllegalStateException("Method call not finished!");
1535
        }
1536
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1537
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1538
        (new Client(prot)).recv_addVoucher();
1539
      }
1540
    }
1541
 
1542
    public void assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount, org.apache.thrift.async.AsyncMethodCallback<assignVoucher_call> resultHandler) throws org.apache.thrift.TException {
1543
      checkReady();
1544
      assignVoucher_call method_call = new assignVoucher_call(userId, userEmail, voucherType, amount, resultHandler, this, ___protocolFactory, ___transport);
1545
      this.___currentMethod = method_call;
1546
      ___manager.call(method_call);
1547
    }
1548
 
1549
    public static class assignVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
1550
      private long userId;
1551
      private String userEmail;
1552
      private VoucherType voucherType;
1553
      private long amount;
1554
      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 {
1555
        super(client, protocolFactory, transport, resultHandler, false);
1556
        this.userId = userId;
1557
        this.userEmail = userEmail;
1558
        this.voucherType = voucherType;
1559
        this.amount = amount;
1560
      }
1561
 
1562
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1563
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("assignVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
1564
        assignVoucher_args args = new assignVoucher_args();
1565
        args.setUserId(userId);
1566
        args.setUserEmail(userEmail);
1567
        args.setVoucherType(voucherType);
1568
        args.setAmount(amount);
1569
        args.write(prot);
1570
        prot.writeMessageEnd();
1571
      }
1572
 
1573
      public Voucher getResult() throws org.apache.thrift.TException {
1574
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1575
          throw new IllegalStateException("Method call not finished!");
1576
        }
1577
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1578
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1579
        return (new Client(prot)).recv_assignVoucher();
1580
      }
1581
    }
1582
 
1583
    public void markVoucherAsRedeemed(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<markVoucherAsRedeemed_call> resultHandler) throws org.apache.thrift.TException {
1584
      checkReady();
1585
      markVoucherAsRedeemed_call method_call = new markVoucherAsRedeemed_call(voucherCode, redeemedOn, resultHandler, this, ___protocolFactory, ___transport);
1586
      this.___currentMethod = method_call;
1587
      ___manager.call(method_call);
1588
    }
1589
 
1590
    public static class markVoucherAsRedeemed_call extends org.apache.thrift.async.TAsyncMethodCall {
1591
      private String voucherCode;
1592
      private long redeemedOn;
1593
      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 {
1594
        super(client, protocolFactory, transport, resultHandler, false);
1595
        this.voucherCode = voucherCode;
1596
        this.redeemedOn = redeemedOn;
1597
      }
1598
 
1599
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1600
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("markVoucherAsRedeemed", org.apache.thrift.protocol.TMessageType.CALL, 0));
1601
        markVoucherAsRedeemed_args args = new markVoucherAsRedeemed_args();
1602
        args.setVoucherCode(voucherCode);
1603
        args.setRedeemedOn(redeemedOn);
1604
        args.write(prot);
1605
        prot.writeMessageEnd();
1606
      }
1607
 
1608
      public boolean getResult() throws org.apache.thrift.TException {
1609
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1610
          throw new IllegalStateException("Method call not finished!");
1611
        }
1612
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1613
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1614
        return (new Client(prot)).recv_markVoucherAsRedeemed();
1615
      }
1616
    }
1617
 
3430 rajveer 1618
  }
1982 varun.gupt 1619
 
3430 rajveer 1620
  public static class Processor<I extends Iface> extends in.shop2020.generic.GenericService.Processor implements org.apache.thrift.TProcessor {
1621
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
1622
    public Processor(I iface) {
1623
      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
1982 varun.gupt 1624
    }
1625
 
3430 rajveer 1626
    protected Processor(I iface, Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
1627
      super(iface, getProcessMap(processMap));
1982 varun.gupt 1628
    }
1629
 
3430 rajveer 1630
    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) {
1631
      processMap.put("createPromotion", new createPromotion());
6301 amit.gupta 1632
      processMap.put("getCoupon", new getCoupon());
1633
      processMap.put("isGiftVoucher", new isGiftVoucher());
6356 amit.gupta 1634
      processMap.put("isCodApplicable", new isCodApplicable());
3430 rajveer 1635
      processMap.put("getAllPromotions", new getAllPromotions());
1636
      processMap.put("getPromotionById", new getPromotionById());
1637
      processMap.put("generateCouponsForPromotion", new generateCouponsForPromotion());
1638
      processMap.put("applyCoupon", new applyCoupon());
6736 amit.gupta 1639
      processMap.put("getEmiDiscount", new getEmiDiscount());
6433 anupam.sin 1640
      processMap.put("applyRechargeCoupon", new applyRechargeCoupon());
3430 rajveer 1641
      processMap.put("trackCouponUsage", new trackCouponUsage());
1642
      processMap.put("getCouponUsageCountByUser", new getCouponUsageCountByUser());
6497 amit.gupta 1643
      processMap.put("getActiveCodes", new getActiveCodes());
1644
      processMap.put("deleteCoupon", new deleteCoupon());
7092 amit.gupta 1645
      processMap.put("getAllCouponsByPromotionId", new getAllCouponsByPromotionId());
3430 rajveer 1646
      processMap.put("getActiveCoupons", new getActiveCoupons());
6250 amit.gupta 1647
      processMap.put("createCoupon", new createCoupon());
3430 rajveer 1648
      processMap.put("getSuccessfulPaymentCountForCoupon", new getSuccessfulPaymentCountForCoupon());
1649
      processMap.put("getRuleDocString", new getRuleDocString());
4189 varun.gupt 1650
      processMap.put("getItemDiscountMap", new getItemDiscountMap());
4494 varun.gupt 1651
      processMap.put("getDiscountsForEntity", new getDiscountsForEntity());
5469 rajveer 1652
      processMap.put("addVoucher", new addVoucher());
1653
      processMap.put("assignVoucher", new assignVoucher());
1654
      processMap.put("markVoucherAsRedeemed", new markVoucherAsRedeemed());
3430 rajveer 1655
      return processMap;
1982 varun.gupt 1656
    }
1657
 
3430 rajveer 1658
    private static class createPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createPromotion_args> {
1659
      public createPromotion() {
1660
        super("createPromotion");
1661
      }
1982 varun.gupt 1662
 
3430 rajveer 1663
      protected createPromotion_args getEmptyArgsInstance() {
1664
        return new createPromotion_args();
1665
      }
1982 varun.gupt 1666
 
3430 rajveer 1667
      protected createPromotion_result getResult(I iface, createPromotion_args args) throws org.apache.thrift.TException {
1668
        createPromotion_result result = new createPromotion_result();
1669
        try {
1670
          iface.createPromotion(args.name, args.ruleExecutionSrc, args.startOn, args.endOn);
1671
        } catch (PromotionException pex) {
1672
          result.pex = pex;
1982 varun.gupt 1673
        }
3430 rajveer 1674
        return result;
1982 varun.gupt 1675
      }
3430 rajveer 1676
    }
1982 varun.gupt 1677
 
6301 amit.gupta 1678
    private static class getCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCoupon_args> {
1679
      public getCoupon() {
1680
        super("getCoupon");
1681
      }
1682
 
1683
      protected getCoupon_args getEmptyArgsInstance() {
1684
        return new getCoupon_args();
1685
      }
1686
 
1687
      protected getCoupon_result getResult(I iface, getCoupon_args args) throws org.apache.thrift.TException {
1688
        getCoupon_result result = new getCoupon_result();
1689
        try {
1690
          result.success = iface.getCoupon(args.couponCode);
1691
        } catch (PromotionException pex) {
1692
          result.pex = pex;
1693
        }
1694
        return result;
1695
      }
1696
    }
1697
 
1698
    private static class isGiftVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isGiftVoucher_args> {
1699
      public isGiftVoucher() {
1700
        super("isGiftVoucher");
1701
      }
1702
 
1703
      protected isGiftVoucher_args getEmptyArgsInstance() {
1704
        return new isGiftVoucher_args();
1705
      }
1706
 
1707
      protected isGiftVoucher_result getResult(I iface, isGiftVoucher_args args) throws org.apache.thrift.TException {
1708
        isGiftVoucher_result result = new isGiftVoucher_result();
1709
        try {
1710
          result.success = iface.isGiftVoucher(args.couponCode);
1711
          result.setSuccessIsSet(true);
1712
        } catch (PromotionException pex) {
1713
          result.pex = pex;
1714
        }
1715
        return result;
1716
      }
1717
    }
1718
 
6356 amit.gupta 1719
    private static class isCodApplicable<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isCodApplicable_args> {
1720
      public isCodApplicable() {
1721
        super("isCodApplicable");
1722
      }
1723
 
1724
      protected isCodApplicable_args getEmptyArgsInstance() {
1725
        return new isCodApplicable_args();
1726
      }
1727
 
1728
      protected isCodApplicable_result getResult(I iface, isCodApplicable_args args) throws org.apache.thrift.TException {
1729
        isCodApplicable_result result = new isCodApplicable_result();
1730
        try {
1731
          result.success = iface.isCodApplicable(args.couponCode);
1732
          result.setSuccessIsSet(true);
1733
        } catch (PromotionException pex) {
1734
          result.pex = pex;
1735
        }
1736
        return result;
1737
      }
1738
    }
1739
 
3430 rajveer 1740
    private static class getAllPromotions<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllPromotions_args> {
1741
      public getAllPromotions() {
1742
        super("getAllPromotions");
1982 varun.gupt 1743
      }
1744
 
3430 rajveer 1745
      protected getAllPromotions_args getEmptyArgsInstance() {
1746
        return new getAllPromotions_args();
1982 varun.gupt 1747
      }
1748
 
3430 rajveer 1749
      protected getAllPromotions_result getResult(I iface, getAllPromotions_args args) throws org.apache.thrift.TException {
1750
        getAllPromotions_result result = new getAllPromotions_result();
1751
        try {
1752
          result.success = iface.getAllPromotions();
1753
        } catch (PromotionException pex) {
1754
          result.pex = pex;
1755
        }
1756
        return result;
1982 varun.gupt 1757
      }
3430 rajveer 1758
    }
1982 varun.gupt 1759
 
3430 rajveer 1760
    private static class getPromotionById<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPromotionById_args> {
1761
      public getPromotionById() {
1762
        super("getPromotionById");
1982 varun.gupt 1763
      }
1764
 
3430 rajveer 1765
      protected getPromotionById_args getEmptyArgsInstance() {
1766
        return new getPromotionById_args();
1982 varun.gupt 1767
      }
1768
 
3430 rajveer 1769
      protected getPromotionById_result getResult(I iface, getPromotionById_args args) throws org.apache.thrift.TException {
1770
        getPromotionById_result result = new getPromotionById_result();
1771
        try {
1772
          result.success = iface.getPromotionById(args.promotionId);
1773
        } catch (PromotionException pex) {
1774
          result.pex = pex;
1775
        }
1776
        return result;
1982 varun.gupt 1777
      }
1778
    }
1779
 
3430 rajveer 1780
    private static class generateCouponsForPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, generateCouponsForPromotion_args> {
1781
      public generateCouponsForPromotion() {
1782
        super("generateCouponsForPromotion");
1783
      }
1982 varun.gupt 1784
 
3430 rajveer 1785
      protected generateCouponsForPromotion_args getEmptyArgsInstance() {
1786
        return new generateCouponsForPromotion_args();
1787
      }
1982 varun.gupt 1788
 
3430 rajveer 1789
      protected generateCouponsForPromotion_result getResult(I iface, generateCouponsForPromotion_args args) throws org.apache.thrift.TException {
1790
        generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
1791
        try {
1792
          iface.generateCouponsForPromotion(args.promotionId, args.couponCode);
1793
        } catch (PromotionException pex) {
1794
          result.pex = pex;
1795
        }
1796
        return result;
1797
      }
1982 varun.gupt 1798
    }
1799
 
3430 rajveer 1800
    private static class applyCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, applyCoupon_args> {
1801
      public applyCoupon() {
1802
        super("applyCoupon");
1803
      }
1982 varun.gupt 1804
 
3430 rajveer 1805
      protected applyCoupon_args getEmptyArgsInstance() {
1806
        return new applyCoupon_args();
1807
      }
1982 varun.gupt 1808
 
3430 rajveer 1809
      protected applyCoupon_result getResult(I iface, applyCoupon_args args) throws org.apache.thrift.TException {
1810
        applyCoupon_result result = new applyCoupon_result();
1811
        try {
1812
          result.success = iface.applyCoupon(args.couponCode, args.cartId);
1813
        } catch (PromotionException pex) {
1814
          result.pex = pex;
1815
        }
1816
        return result;
1982 varun.gupt 1817
      }
1818
    }
1819
 
6736 amit.gupta 1820
    private static class getEmiDiscount<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getEmiDiscount_args> {
1821
      public getEmiDiscount() {
1822
        super("getEmiDiscount");
1823
      }
1824
 
1825
      protected getEmiDiscount_args getEmptyArgsInstance() {
1826
        return new getEmiDiscount_args();
1827
      }
1828
 
1829
      protected getEmiDiscount_result getResult(I iface, getEmiDiscount_args args) throws org.apache.thrift.TException {
1830
        getEmiDiscount_result result = new getEmiDiscount_result();
1831
        try {
1832
          result.success = iface.getEmiDiscount(args.cartId);
1833
        } catch (PromotionException pex) {
1834
          result.pex = pex;
1835
        }
1836
        return result;
1837
      }
1838
    }
1839
 
6433 anupam.sin 1840
    private static class applyRechargeCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, applyRechargeCoupon_args> {
1841
      public applyRechargeCoupon() {
1842
        super("applyRechargeCoupon");
1843
      }
1844
 
1845
      protected applyRechargeCoupon_args getEmptyArgsInstance() {
1846
        return new applyRechargeCoupon_args();
1847
      }
1848
 
1849
      protected applyRechargeCoupon_result getResult(I iface, applyRechargeCoupon_args args) throws org.apache.thrift.TException {
1850
        applyRechargeCoupon_result result = new applyRechargeCoupon_result();
1851
        try {
1852
          result.success = iface.applyRechargeCoupon(args.couponCode, args.totalAmount, args.userId);
1853
        } catch (PromotionException pex) {
1854
          result.pex = pex;
1855
        }
1856
        return result;
1857
      }
1858
    }
1859
 
3430 rajveer 1860
    private static class trackCouponUsage<I extends Iface> extends org.apache.thrift.ProcessFunction<I, trackCouponUsage_args> {
1861
      public trackCouponUsage() {
1862
        super("trackCouponUsage");
1863
      }
1982 varun.gupt 1864
 
3430 rajveer 1865
      protected trackCouponUsage_args getEmptyArgsInstance() {
1866
        return new trackCouponUsage_args();
1982 varun.gupt 1867
      }
1868
 
3430 rajveer 1869
      protected trackCouponUsage_result getResult(I iface, trackCouponUsage_args args) throws org.apache.thrift.TException {
1870
        trackCouponUsage_result result = new trackCouponUsage_result();
1871
        try {
1872
          iface.trackCouponUsage(args.couponCode, args.transactionId, args.userId);
1873
        } catch (PromotionException pex) {
1874
          result.pex = pex;
1875
        }
1876
        return result;
1877
      }
1982 varun.gupt 1878
    }
1879
 
3430 rajveer 1880
    private static class getCouponUsageCountByUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCouponUsageCountByUser_args> {
1881
      public getCouponUsageCountByUser() {
1882
        super("getCouponUsageCountByUser");
1982 varun.gupt 1883
      }
1884
 
3430 rajveer 1885
      protected getCouponUsageCountByUser_args getEmptyArgsInstance() {
1886
        return new getCouponUsageCountByUser_args();
1887
      }
1982 varun.gupt 1888
 
3430 rajveer 1889
      protected getCouponUsageCountByUser_result getResult(I iface, getCouponUsageCountByUser_args args) throws org.apache.thrift.TException {
1890
        getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
1891
        try {
1892
          result.success = iface.getCouponUsageCountByUser(args.couponCode, args.userId);
1893
          result.setSuccessIsSet(true);
1894
        } catch (PromotionException pex) {
1895
          result.pex = pex;
1896
        }
1897
        return result;
1898
      }
1982 varun.gupt 1899
    }
1900
 
6497 amit.gupta 1901
    private static class getActiveCodes<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getActiveCodes_args> {
1902
      public getActiveCodes() {
1903
        super("getActiveCodes");
1904
      }
1905
 
1906
      protected getActiveCodes_args getEmptyArgsInstance() {
1907
        return new getActiveCodes_args();
1908
      }
1909
 
1910
      protected getActiveCodes_result getResult(I iface, getActiveCodes_args args) throws org.apache.thrift.TException {
1911
        getActiveCodes_result result = new getActiveCodes_result();
1912
        try {
1913
          result.success = iface.getActiveCodes(args.promotionId);
1914
        } catch (PromotionException pex) {
1915
          result.pex = pex;
1916
        }
1917
        return result;
1918
      }
1919
    }
1920
 
1921
    private static class deleteCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, deleteCoupon_args> {
1922
      public deleteCoupon() {
1923
        super("deleteCoupon");
1924
      }
1925
 
1926
      protected deleteCoupon_args getEmptyArgsInstance() {
1927
        return new deleteCoupon_args();
1928
      }
1929
 
1930
      protected deleteCoupon_result getResult(I iface, deleteCoupon_args args) throws org.apache.thrift.TException {
1931
        deleteCoupon_result result = new deleteCoupon_result();
1932
        try {
1933
          iface.deleteCoupon(args.couponCode);
1934
        } catch (PromotionException pex) {
1935
          result.pex = pex;
1936
        }
1937
        return result;
1938
      }
1939
    }
1940
 
7092 amit.gupta 1941
    private static class getAllCouponsByPromotionId<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllCouponsByPromotionId_args> {
1942
      public getAllCouponsByPromotionId() {
1943
        super("getAllCouponsByPromotionId");
1944
      }
1945
 
1946
      protected getAllCouponsByPromotionId_args getEmptyArgsInstance() {
1947
        return new getAllCouponsByPromotionId_args();
1948
      }
1949
 
1950
      protected getAllCouponsByPromotionId_result getResult(I iface, getAllCouponsByPromotionId_args args) throws org.apache.thrift.TException {
1951
        getAllCouponsByPromotionId_result result = new getAllCouponsByPromotionId_result();
1952
        try {
1953
          result.success = iface.getAllCouponsByPromotionId(args.promotionId);
1954
        } catch (PromotionException pex) {
1955
          result.pex = pex;
1956
        }
1957
        return result;
1958
      }
1959
    }
1960
 
3430 rajveer 1961
    private static class getActiveCoupons<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getActiveCoupons_args> {
1962
      public getActiveCoupons() {
1963
        super("getActiveCoupons");
1964
      }
1982 varun.gupt 1965
 
3430 rajveer 1966
      protected getActiveCoupons_args getEmptyArgsInstance() {
1967
        return new getActiveCoupons_args();
1968
      }
1982 varun.gupt 1969
 
3430 rajveer 1970
      protected getActiveCoupons_result getResult(I iface, getActiveCoupons_args args) throws org.apache.thrift.TException {
1971
        getActiveCoupons_result result = new getActiveCoupons_result();
1972
        try {
1973
          result.success = iface.getActiveCoupons();
1974
        } catch (PromotionException pex) {
1975
          result.pex = pex;
1976
        }
1977
        return result;
1978
      }
1982 varun.gupt 1979
    }
1980
 
6250 amit.gupta 1981
    private static class createCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createCoupon_args> {
1982
      public createCoupon() {
1983
        super("createCoupon");
1984
      }
1985
 
1986
      protected createCoupon_args getEmptyArgsInstance() {
1987
        return new createCoupon_args();
1988
      }
1989
 
1990
      protected createCoupon_result getResult(I iface, createCoupon_args args) throws org.apache.thrift.TException {
1991
        createCoupon_result result = new createCoupon_result();
1992
        try {
6730 anupam.sin 1993
          result.success = iface.createCoupon(args.promotionId, args.couponCode, args.arguments, args.isCod, args.prefix);
6250 amit.gupta 1994
        } catch (PromotionException pex) {
1995
          result.pex = pex;
1996
        }
1997
        return result;
1998
      }
1999
    }
2000
 
3430 rajveer 2001
    private static class getSuccessfulPaymentCountForCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSuccessfulPaymentCountForCoupon_args> {
2002
      public getSuccessfulPaymentCountForCoupon() {
2003
        super("getSuccessfulPaymentCountForCoupon");
1982 varun.gupt 2004
      }
2005
 
3430 rajveer 2006
      protected getSuccessfulPaymentCountForCoupon_args getEmptyArgsInstance() {
2007
        return new getSuccessfulPaymentCountForCoupon_args();
2008
      }
1982 varun.gupt 2009
 
3430 rajveer 2010
      protected getSuccessfulPaymentCountForCoupon_result getResult(I iface, getSuccessfulPaymentCountForCoupon_args args) throws org.apache.thrift.TException {
2011
        getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
2012
        try {
2013
          result.success = iface.getSuccessfulPaymentCountForCoupon(args.couponCode);
2014
          result.setSuccessIsSet(true);
2015
        } catch (PromotionException pex) {
2016
          result.pex = pex;
1982 varun.gupt 2017
        }
3430 rajveer 2018
        return result;
1982 varun.gupt 2019
      }
2020
    }
2021
 
3430 rajveer 2022
    private static class getRuleDocString<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getRuleDocString_args> {
2023
      public getRuleDocString() {
2024
        super("getRuleDocString");
2025
      }
1982 varun.gupt 2026
 
3430 rajveer 2027
      protected getRuleDocString_args getEmptyArgsInstance() {
2028
        return new getRuleDocString_args();
2029
      }
1982 varun.gupt 2030
 
3430 rajveer 2031
      protected getRuleDocString_result getResult(I iface, getRuleDocString_args args) throws org.apache.thrift.TException {
2032
        getRuleDocString_result result = new getRuleDocString_result();
2033
        result.success = iface.getRuleDocString(args.ruleName);
2034
        return result;
2035
      }
1982 varun.gupt 2036
    }
2037
 
4189 varun.gupt 2038
    private static class getItemDiscountMap<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getItemDiscountMap_args> {
2039
      public getItemDiscountMap() {
2040
        super("getItemDiscountMap");
2041
      }
2042
 
2043
      protected getItemDiscountMap_args getEmptyArgsInstance() {
2044
        return new getItemDiscountMap_args();
2045
      }
2046
 
2047
      protected getItemDiscountMap_result getResult(I iface, getItemDiscountMap_args args) throws org.apache.thrift.TException {
2048
        getItemDiscountMap_result result = new getItemDiscountMap_result();
2049
        try {
2050
          result.success = iface.getItemDiscountMap(args.itemIds);
2051
        } catch (PromotionException pex) {
2052
          result.pex = pex;
2053
        }
2054
        return result;
2055
      }
2056
    }
2057
 
4494 varun.gupt 2058
    private static class getDiscountsForEntity<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getDiscountsForEntity_args> {
2059
      public getDiscountsForEntity() {
2060
        super("getDiscountsForEntity");
2061
      }
2062
 
2063
      protected getDiscountsForEntity_args getEmptyArgsInstance() {
2064
        return new getDiscountsForEntity_args();
2065
      }
2066
 
2067
      protected getDiscountsForEntity_result getResult(I iface, getDiscountsForEntity_args args) throws org.apache.thrift.TException {
2068
        getDiscountsForEntity_result result = new getDiscountsForEntity_result();
2069
        result.success = iface.getDiscountsForEntity(args.entityId);
2070
        return result;
2071
      }
2072
    }
2073
 
5469 rajveer 2074
    private static class addVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addVoucher_args> {
2075
      public addVoucher() {
2076
        super("addVoucher");
2077
      }
2078
 
2079
      protected addVoucher_args getEmptyArgsInstance() {
2080
        return new addVoucher_args();
2081
      }
2082
 
2083
      protected addVoucher_result getResult(I iface, addVoucher_args args) throws org.apache.thrift.TException {
2084
        addVoucher_result result = new addVoucher_result();
2085
        iface.addVoucher(args.voucher);
2086
        return result;
2087
      }
2088
    }
2089
 
2090
    private static class assignVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, assignVoucher_args> {
2091
      public assignVoucher() {
2092
        super("assignVoucher");
2093
      }
2094
 
2095
      protected assignVoucher_args getEmptyArgsInstance() {
2096
        return new assignVoucher_args();
2097
      }
2098
 
2099
      protected assignVoucher_result getResult(I iface, assignVoucher_args args) throws org.apache.thrift.TException {
2100
        assignVoucher_result result = new assignVoucher_result();
2101
        result.success = iface.assignVoucher(args.userId, args.userEmail, args.voucherType, args.amount);
2102
        return result;
2103
      }
2104
    }
2105
 
2106
    private static class markVoucherAsRedeemed<I extends Iface> extends org.apache.thrift.ProcessFunction<I, markVoucherAsRedeemed_args> {
2107
      public markVoucherAsRedeemed() {
2108
        super("markVoucherAsRedeemed");
2109
      }
2110
 
2111
      protected markVoucherAsRedeemed_args getEmptyArgsInstance() {
2112
        return new markVoucherAsRedeemed_args();
2113
      }
2114
 
2115
      protected markVoucherAsRedeemed_result getResult(I iface, markVoucherAsRedeemed_args args) throws org.apache.thrift.TException {
2116
        markVoucherAsRedeemed_result result = new markVoucherAsRedeemed_result();
2117
        result.success = iface.markVoucherAsRedeemed(args.voucherCode, args.redeemedOn);
2118
        result.setSuccessIsSet(true);
2119
        return result;
2120
      }
2121
    }
2122
 
1982 varun.gupt 2123
  }
2124
 
3430 rajveer 2125
  public static class createPromotion_args implements org.apache.thrift.TBase<createPromotion_args, createPromotion_args._Fields>, java.io.Serializable, Cloneable   {
2126
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_args");
1982 varun.gupt 2127
 
3430 rajveer 2128
    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);
2129
    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);
2130
    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);
2131
    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 2132
 
3430 rajveer 2133
    private String name; // required
2134
    private String ruleExecutionSrc; // required
2135
    private long startOn; // required
2136
    private long endOn; // required
1982 varun.gupt 2137
 
2138
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2139
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2140
      NAME((short)1, "name"),
2141
      RULE_EXECUTION_SRC((short)2, "ruleExecutionSrc"),
2142
      START_ON((short)3, "startOn"),
2143
      END_ON((short)4, "endOn");
2144
 
2145
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2146
 
2147
      static {
2148
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2149
          byName.put(field.getFieldName(), field);
2150
        }
2151
      }
2152
 
2153
      /**
2154
       * Find the _Fields constant that matches fieldId, or null if its not found.
2155
       */
2156
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2157
        switch(fieldId) {
2158
          case 1: // NAME
2159
            return NAME;
2160
          case 2: // RULE_EXECUTION_SRC
2161
            return RULE_EXECUTION_SRC;
2162
          case 3: // START_ON
2163
            return START_ON;
2164
          case 4: // END_ON
2165
            return END_ON;
2166
          default:
2167
            return null;
2168
        }
1982 varun.gupt 2169
      }
2170
 
2171
      /**
2172
       * Find the _Fields constant that matches fieldId, throwing an exception
2173
       * if it is not found.
2174
       */
2175
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2176
        _Fields fields = findByThriftId(fieldId);
2177
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2178
        return fields;
2179
      }
2180
 
2181
      /**
2182
       * Find the _Fields constant that matches name, or null if its not found.
2183
       */
2184
      public static _Fields findByName(String name) {
2185
        return byName.get(name);
2186
      }
2187
 
2188
      private final short _thriftId;
2189
      private final String _fieldName;
2190
 
2191
      _Fields(short thriftId, String fieldName) {
2192
        _thriftId = thriftId;
2193
        _fieldName = fieldName;
2194
      }
2195
 
2196
      public short getThriftFieldId() {
2197
        return _thriftId;
2198
      }
2199
 
2200
      public String getFieldName() {
2201
        return _fieldName;
2202
      }
2203
    }
2204
 
2205
    // isset id assignments
2206
    private static final int __STARTON_ISSET_ID = 0;
2207
    private static final int __ENDON_ISSET_ID = 1;
2208
    private BitSet __isset_bit_vector = new BitSet(2);
2209
 
3430 rajveer 2210
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2211
    static {
3430 rajveer 2212
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2213
      tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2214
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
2215
      tmpMap.put(_Fields.RULE_EXECUTION_SRC, new org.apache.thrift.meta_data.FieldMetaData("ruleExecutionSrc", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2216
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
2217
      tmpMap.put(_Fields.START_ON, new org.apache.thrift.meta_data.FieldMetaData("startOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2218
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
2219
      tmpMap.put(_Fields.END_ON, new org.apache.thrift.meta_data.FieldMetaData("endOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2220
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
2221
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2222
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_args.class, metaDataMap);
1982 varun.gupt 2223
    }
2224
 
2225
    public createPromotion_args() {
2226
    }
2227
 
2228
    public createPromotion_args(
2229
      String name,
2230
      String ruleExecutionSrc,
2231
      long startOn,
2232
      long endOn)
2233
    {
2234
      this();
2235
      this.name = name;
2236
      this.ruleExecutionSrc = ruleExecutionSrc;
2237
      this.startOn = startOn;
2238
      setStartOnIsSet(true);
2239
      this.endOn = endOn;
2240
      setEndOnIsSet(true);
2241
    }
2242
 
2243
    /**
2244
     * Performs a deep copy on <i>other</i>.
2245
     */
2246
    public createPromotion_args(createPromotion_args other) {
2247
      __isset_bit_vector.clear();
2248
      __isset_bit_vector.or(other.__isset_bit_vector);
2249
      if (other.isSetName()) {
2250
        this.name = other.name;
2251
      }
2252
      if (other.isSetRuleExecutionSrc()) {
2253
        this.ruleExecutionSrc = other.ruleExecutionSrc;
2254
      }
2255
      this.startOn = other.startOn;
2256
      this.endOn = other.endOn;
2257
    }
2258
 
2259
    public createPromotion_args deepCopy() {
2260
      return new createPromotion_args(this);
2261
    }
2262
 
3430 rajveer 2263
    @Override
2264
    public void clear() {
2265
      this.name = null;
2266
      this.ruleExecutionSrc = null;
2267
      setStartOnIsSet(false);
2268
      this.startOn = 0;
2269
      setEndOnIsSet(false);
2270
      this.endOn = 0;
1982 varun.gupt 2271
    }
2272
 
2273
    public String getName() {
2274
      return this.name;
2275
    }
2276
 
3430 rajveer 2277
    public void setName(String name) {
1982 varun.gupt 2278
      this.name = name;
2279
    }
2280
 
2281
    public void unsetName() {
2282
      this.name = null;
2283
    }
2284
 
3430 rajveer 2285
    /** Returns true if field name is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2286
    public boolean isSetName() {
2287
      return this.name != null;
2288
    }
2289
 
2290
    public void setNameIsSet(boolean value) {
2291
      if (!value) {
2292
        this.name = null;
2293
      }
2294
    }
2295
 
2296
    public String getRuleExecutionSrc() {
2297
      return this.ruleExecutionSrc;
2298
    }
2299
 
3430 rajveer 2300
    public void setRuleExecutionSrc(String ruleExecutionSrc) {
1982 varun.gupt 2301
      this.ruleExecutionSrc = ruleExecutionSrc;
2302
    }
2303
 
2304
    public void unsetRuleExecutionSrc() {
2305
      this.ruleExecutionSrc = null;
2306
    }
2307
 
3430 rajveer 2308
    /** Returns true if field ruleExecutionSrc is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2309
    public boolean isSetRuleExecutionSrc() {
2310
      return this.ruleExecutionSrc != null;
2311
    }
2312
 
2313
    public void setRuleExecutionSrcIsSet(boolean value) {
2314
      if (!value) {
2315
        this.ruleExecutionSrc = null;
2316
      }
2317
    }
2318
 
2319
    public long getStartOn() {
2320
      return this.startOn;
2321
    }
2322
 
3430 rajveer 2323
    public void setStartOn(long startOn) {
1982 varun.gupt 2324
      this.startOn = startOn;
2325
      setStartOnIsSet(true);
2326
    }
2327
 
2328
    public void unsetStartOn() {
2329
      __isset_bit_vector.clear(__STARTON_ISSET_ID);
2330
    }
2331
 
3430 rajveer 2332
    /** Returns true if field startOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2333
    public boolean isSetStartOn() {
2334
      return __isset_bit_vector.get(__STARTON_ISSET_ID);
2335
    }
2336
 
2337
    public void setStartOnIsSet(boolean value) {
2338
      __isset_bit_vector.set(__STARTON_ISSET_ID, value);
2339
    }
2340
 
2341
    public long getEndOn() {
2342
      return this.endOn;
2343
    }
2344
 
3430 rajveer 2345
    public void setEndOn(long endOn) {
1982 varun.gupt 2346
      this.endOn = endOn;
2347
      setEndOnIsSet(true);
2348
    }
2349
 
2350
    public void unsetEndOn() {
2351
      __isset_bit_vector.clear(__ENDON_ISSET_ID);
2352
    }
2353
 
3430 rajveer 2354
    /** Returns true if field endOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2355
    public boolean isSetEndOn() {
2356
      return __isset_bit_vector.get(__ENDON_ISSET_ID);
2357
    }
2358
 
2359
    public void setEndOnIsSet(boolean value) {
2360
      __isset_bit_vector.set(__ENDON_ISSET_ID, value);
2361
    }
2362
 
2363
    public void setFieldValue(_Fields field, Object value) {
2364
      switch (field) {
2365
      case NAME:
2366
        if (value == null) {
2367
          unsetName();
2368
        } else {
2369
          setName((String)value);
2370
        }
2371
        break;
2372
 
2373
      case RULE_EXECUTION_SRC:
2374
        if (value == null) {
2375
          unsetRuleExecutionSrc();
2376
        } else {
2377
          setRuleExecutionSrc((String)value);
2378
        }
2379
        break;
2380
 
2381
      case START_ON:
2382
        if (value == null) {
2383
          unsetStartOn();
2384
        } else {
2385
          setStartOn((Long)value);
2386
        }
2387
        break;
2388
 
2389
      case END_ON:
2390
        if (value == null) {
2391
          unsetEndOn();
2392
        } else {
2393
          setEndOn((Long)value);
2394
        }
2395
        break;
2396
 
2397
      }
2398
    }
2399
 
2400
    public Object getFieldValue(_Fields field) {
2401
      switch (field) {
2402
      case NAME:
2403
        return getName();
2404
 
2405
      case RULE_EXECUTION_SRC:
2406
        return getRuleExecutionSrc();
2407
 
2408
      case START_ON:
3430 rajveer 2409
        return Long.valueOf(getStartOn());
1982 varun.gupt 2410
 
2411
      case END_ON:
3430 rajveer 2412
        return Long.valueOf(getEndOn());
1982 varun.gupt 2413
 
2414
      }
2415
      throw new IllegalStateException();
2416
    }
2417
 
3430 rajveer 2418
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2419
    public boolean isSet(_Fields field) {
2420
      if (field == null) {
2421
        throw new IllegalArgumentException();
2422
      }
1982 varun.gupt 2423
 
2424
      switch (field) {
2425
      case NAME:
2426
        return isSetName();
2427
      case RULE_EXECUTION_SRC:
2428
        return isSetRuleExecutionSrc();
2429
      case START_ON:
2430
        return isSetStartOn();
2431
      case END_ON:
2432
        return isSetEndOn();
2433
      }
2434
      throw new IllegalStateException();
2435
    }
2436
 
2437
    @Override
2438
    public boolean equals(Object that) {
2439
      if (that == null)
2440
        return false;
2441
      if (that instanceof createPromotion_args)
2442
        return this.equals((createPromotion_args)that);
2443
      return false;
2444
    }
2445
 
2446
    public boolean equals(createPromotion_args that) {
2447
      if (that == null)
2448
        return false;
2449
 
2450
      boolean this_present_name = true && this.isSetName();
2451
      boolean that_present_name = true && that.isSetName();
2452
      if (this_present_name || that_present_name) {
2453
        if (!(this_present_name && that_present_name))
2454
          return false;
2455
        if (!this.name.equals(that.name))
2456
          return false;
2457
      }
2458
 
2459
      boolean this_present_ruleExecutionSrc = true && this.isSetRuleExecutionSrc();
2460
      boolean that_present_ruleExecutionSrc = true && that.isSetRuleExecutionSrc();
2461
      if (this_present_ruleExecutionSrc || that_present_ruleExecutionSrc) {
2462
        if (!(this_present_ruleExecutionSrc && that_present_ruleExecutionSrc))
2463
          return false;
2464
        if (!this.ruleExecutionSrc.equals(that.ruleExecutionSrc))
2465
          return false;
2466
      }
2467
 
2468
      boolean this_present_startOn = true;
2469
      boolean that_present_startOn = true;
2470
      if (this_present_startOn || that_present_startOn) {
2471
        if (!(this_present_startOn && that_present_startOn))
2472
          return false;
2473
        if (this.startOn != that.startOn)
2474
          return false;
2475
      }
2476
 
2477
      boolean this_present_endOn = true;
2478
      boolean that_present_endOn = true;
2479
      if (this_present_endOn || that_present_endOn) {
2480
        if (!(this_present_endOn && that_present_endOn))
2481
          return false;
2482
        if (this.endOn != that.endOn)
2483
          return false;
2484
      }
2485
 
2486
      return true;
2487
    }
2488
 
2489
    @Override
2490
    public int hashCode() {
2491
      return 0;
2492
    }
2493
 
2494
    public int compareTo(createPromotion_args other) {
2495
      if (!getClass().equals(other.getClass())) {
2496
        return getClass().getName().compareTo(other.getClass().getName());
2497
      }
2498
 
2499
      int lastComparison = 0;
2500
      createPromotion_args typedOther = (createPromotion_args)other;
2501
 
3430 rajveer 2502
      lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
1982 varun.gupt 2503
      if (lastComparison != 0) {
2504
        return lastComparison;
2505
      }
3430 rajveer 2506
      if (isSetName()) {
2507
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
2508
        if (lastComparison != 0) {
2509
          return lastComparison;
2510
        }
1982 varun.gupt 2511
      }
3430 rajveer 2512
      lastComparison = Boolean.valueOf(isSetRuleExecutionSrc()).compareTo(typedOther.isSetRuleExecutionSrc());
1982 varun.gupt 2513
      if (lastComparison != 0) {
2514
        return lastComparison;
2515
      }
3430 rajveer 2516
      if (isSetRuleExecutionSrc()) {
2517
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleExecutionSrc, typedOther.ruleExecutionSrc);
2518
        if (lastComparison != 0) {
2519
          return lastComparison;
2520
        }
1982 varun.gupt 2521
      }
3430 rajveer 2522
      lastComparison = Boolean.valueOf(isSetStartOn()).compareTo(typedOther.isSetStartOn());
1982 varun.gupt 2523
      if (lastComparison != 0) {
2524
        return lastComparison;
2525
      }
3430 rajveer 2526
      if (isSetStartOn()) {
2527
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startOn, typedOther.startOn);
2528
        if (lastComparison != 0) {
2529
          return lastComparison;
2530
        }
1982 varun.gupt 2531
      }
3430 rajveer 2532
      lastComparison = Boolean.valueOf(isSetEndOn()).compareTo(typedOther.isSetEndOn());
1982 varun.gupt 2533
      if (lastComparison != 0) {
2534
        return lastComparison;
2535
      }
3430 rajveer 2536
      if (isSetEndOn()) {
2537
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endOn, typedOther.endOn);
2538
        if (lastComparison != 0) {
2539
          return lastComparison;
2540
        }
1982 varun.gupt 2541
      }
2542
      return 0;
2543
    }
2544
 
3430 rajveer 2545
    public _Fields fieldForId(int fieldId) {
2546
      return _Fields.findByThriftId(fieldId);
2547
    }
2548
 
2549
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2550
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2551
      iprot.readStructBegin();
2552
      while (true)
2553
      {
2554
        field = iprot.readFieldBegin();
3430 rajveer 2555
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2556
          break;
2557
        }
3430 rajveer 2558
        switch (field.id) {
2559
          case 1: // NAME
2560
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
2561
              this.name = iprot.readString();
2562
            } else { 
2563
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2564
            }
2565
            break;
2566
          case 2: // RULE_EXECUTION_SRC
2567
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
2568
              this.ruleExecutionSrc = iprot.readString();
2569
            } else { 
2570
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2571
            }
2572
            break;
2573
          case 3: // START_ON
2574
            if (field.type == org.apache.thrift.protocol.TType.I64) {
2575
              this.startOn = iprot.readI64();
2576
              setStartOnIsSet(true);
2577
            } else { 
2578
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2579
            }
2580
            break;
2581
          case 4: // END_ON
2582
            if (field.type == org.apache.thrift.protocol.TType.I64) {
2583
              this.endOn = iprot.readI64();
2584
              setEndOnIsSet(true);
2585
            } else { 
2586
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2587
            }
2588
            break;
2589
          default:
2590
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2591
        }
3430 rajveer 2592
        iprot.readFieldEnd();
1982 varun.gupt 2593
      }
2594
      iprot.readStructEnd();
2595
      validate();
2596
    }
2597
 
3430 rajveer 2598
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2599
      validate();
2600
 
2601
      oprot.writeStructBegin(STRUCT_DESC);
2602
      if (this.name != null) {
2603
        oprot.writeFieldBegin(NAME_FIELD_DESC);
2604
        oprot.writeString(this.name);
2605
        oprot.writeFieldEnd();
2606
      }
2607
      if (this.ruleExecutionSrc != null) {
2608
        oprot.writeFieldBegin(RULE_EXECUTION_SRC_FIELD_DESC);
2609
        oprot.writeString(this.ruleExecutionSrc);
2610
        oprot.writeFieldEnd();
2611
      }
2612
      oprot.writeFieldBegin(START_ON_FIELD_DESC);
2613
      oprot.writeI64(this.startOn);
2614
      oprot.writeFieldEnd();
2615
      oprot.writeFieldBegin(END_ON_FIELD_DESC);
2616
      oprot.writeI64(this.endOn);
2617
      oprot.writeFieldEnd();
2618
      oprot.writeFieldStop();
2619
      oprot.writeStructEnd();
2620
    }
2621
 
2622
    @Override
2623
    public String toString() {
2624
      StringBuilder sb = new StringBuilder("createPromotion_args(");
2625
      boolean first = true;
2626
 
2627
      sb.append("name:");
2628
      if (this.name == null) {
2629
        sb.append("null");
2630
      } else {
2631
        sb.append(this.name);
2632
      }
2633
      first = false;
2634
      if (!first) sb.append(", ");
2635
      sb.append("ruleExecutionSrc:");
2636
      if (this.ruleExecutionSrc == null) {
2637
        sb.append("null");
2638
      } else {
2639
        sb.append(this.ruleExecutionSrc);
2640
      }
2641
      first = false;
2642
      if (!first) sb.append(", ");
2643
      sb.append("startOn:");
2644
      sb.append(this.startOn);
2645
      first = false;
2646
      if (!first) sb.append(", ");
2647
      sb.append("endOn:");
2648
      sb.append(this.endOn);
2649
      first = false;
2650
      sb.append(")");
2651
      return sb.toString();
2652
    }
2653
 
3430 rajveer 2654
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2655
      // check for required fields
2656
    }
2657
 
3430 rajveer 2658
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2659
      try {
2660
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2661
      } catch (org.apache.thrift.TException te) {
2662
        throw new java.io.IOException(te);
2663
      }
2664
    }
2665
 
2666
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2667
      try {
2668
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
2669
        __isset_bit_vector = new BitSet(1);
2670
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2671
      } catch (org.apache.thrift.TException te) {
2672
        throw new java.io.IOException(te);
2673
      }
2674
    }
2675
 
1982 varun.gupt 2676
  }
2677
 
3430 rajveer 2678
  public static class createPromotion_result implements org.apache.thrift.TBase<createPromotion_result, createPromotion_result._Fields>, java.io.Serializable, Cloneable   {
2679
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_result");
1982 varun.gupt 2680
 
3430 rajveer 2681
    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 2682
 
3430 rajveer 2683
    private PromotionException pex; // required
1982 varun.gupt 2684
 
2685
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2686
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2687
      PEX((short)1, "pex");
2688
 
2689
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2690
 
2691
      static {
2692
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2693
          byName.put(field.getFieldName(), field);
2694
        }
2695
      }
2696
 
2697
      /**
2698
       * Find the _Fields constant that matches fieldId, or null if its not found.
2699
       */
2700
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2701
        switch(fieldId) {
2702
          case 1: // PEX
2703
            return PEX;
2704
          default:
2705
            return null;
2706
        }
1982 varun.gupt 2707
      }
2708
 
2709
      /**
2710
       * Find the _Fields constant that matches fieldId, throwing an exception
2711
       * if it is not found.
2712
       */
2713
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2714
        _Fields fields = findByThriftId(fieldId);
2715
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2716
        return fields;
2717
      }
2718
 
2719
      /**
2720
       * Find the _Fields constant that matches name, or null if its not found.
2721
       */
2722
      public static _Fields findByName(String name) {
2723
        return byName.get(name);
2724
      }
2725
 
2726
      private final short _thriftId;
2727
      private final String _fieldName;
2728
 
2729
      _Fields(short thriftId, String fieldName) {
2730
        _thriftId = thriftId;
2731
        _fieldName = fieldName;
2732
      }
2733
 
2734
      public short getThriftFieldId() {
2735
        return _thriftId;
2736
      }
2737
 
2738
      public String getFieldName() {
2739
        return _fieldName;
2740
      }
2741
    }
2742
 
2743
    // isset id assignments
2744
 
3430 rajveer 2745
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2746
    static {
3430 rajveer 2747
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2748
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2749
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
2750
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2751
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_result.class, metaDataMap);
1982 varun.gupt 2752
    }
2753
 
2754
    public createPromotion_result() {
2755
    }
2756
 
2757
    public createPromotion_result(
2758
      PromotionException pex)
2759
    {
2760
      this();
2761
      this.pex = pex;
2762
    }
2763
 
2764
    /**
2765
     * Performs a deep copy on <i>other</i>.
2766
     */
2767
    public createPromotion_result(createPromotion_result other) {
2768
      if (other.isSetPex()) {
2769
        this.pex = new PromotionException(other.pex);
2770
      }
2771
    }
2772
 
2773
    public createPromotion_result deepCopy() {
2774
      return new createPromotion_result(this);
2775
    }
2776
 
3430 rajveer 2777
    @Override
2778
    public void clear() {
2779
      this.pex = null;
1982 varun.gupt 2780
    }
2781
 
2782
    public PromotionException getPex() {
2783
      return this.pex;
2784
    }
2785
 
3430 rajveer 2786
    public void setPex(PromotionException pex) {
1982 varun.gupt 2787
      this.pex = pex;
2788
    }
2789
 
2790
    public void unsetPex() {
2791
      this.pex = null;
2792
    }
2793
 
3430 rajveer 2794
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2795
    public boolean isSetPex() {
2796
      return this.pex != null;
2797
    }
2798
 
2799
    public void setPexIsSet(boolean value) {
2800
      if (!value) {
2801
        this.pex = null;
2802
      }
2803
    }
2804
 
2805
    public void setFieldValue(_Fields field, Object value) {
2806
      switch (field) {
2807
      case PEX:
2808
        if (value == null) {
2809
          unsetPex();
2810
        } else {
2811
          setPex((PromotionException)value);
2812
        }
2813
        break;
2814
 
2815
      }
2816
    }
2817
 
2818
    public Object getFieldValue(_Fields field) {
2819
      switch (field) {
2820
      case PEX:
2821
        return getPex();
2822
 
2823
      }
2824
      throw new IllegalStateException();
2825
    }
2826
 
3430 rajveer 2827
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2828
    public boolean isSet(_Fields field) {
2829
      if (field == null) {
2830
        throw new IllegalArgumentException();
2831
      }
1982 varun.gupt 2832
 
2833
      switch (field) {
2834
      case PEX:
2835
        return isSetPex();
2836
      }
2837
      throw new IllegalStateException();
2838
    }
2839
 
2840
    @Override
2841
    public boolean equals(Object that) {
2842
      if (that == null)
2843
        return false;
2844
      if (that instanceof createPromotion_result)
2845
        return this.equals((createPromotion_result)that);
2846
      return false;
2847
    }
2848
 
2849
    public boolean equals(createPromotion_result that) {
2850
      if (that == null)
2851
        return false;
2852
 
2853
      boolean this_present_pex = true && this.isSetPex();
2854
      boolean that_present_pex = true && that.isSetPex();
2855
      if (this_present_pex || that_present_pex) {
2856
        if (!(this_present_pex && that_present_pex))
2857
          return false;
2858
        if (!this.pex.equals(that.pex))
2859
          return false;
2860
      }
2861
 
2862
      return true;
2863
    }
2864
 
2865
    @Override
2866
    public int hashCode() {
2867
      return 0;
2868
    }
2869
 
2870
    public int compareTo(createPromotion_result other) {
2871
      if (!getClass().equals(other.getClass())) {
2872
        return getClass().getName().compareTo(other.getClass().getName());
2873
      }
2874
 
2875
      int lastComparison = 0;
2876
      createPromotion_result typedOther = (createPromotion_result)other;
2877
 
3430 rajveer 2878
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 2879
      if (lastComparison != 0) {
2880
        return lastComparison;
2881
      }
3430 rajveer 2882
      if (isSetPex()) {
2883
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
2884
        if (lastComparison != 0) {
2885
          return lastComparison;
2886
        }
1982 varun.gupt 2887
      }
2888
      return 0;
2889
    }
2890
 
3430 rajveer 2891
    public _Fields fieldForId(int fieldId) {
2892
      return _Fields.findByThriftId(fieldId);
2893
    }
2894
 
2895
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2896
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2897
      iprot.readStructBegin();
2898
      while (true)
2899
      {
2900
        field = iprot.readFieldBegin();
3430 rajveer 2901
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2902
          break;
2903
        }
3430 rajveer 2904
        switch (field.id) {
2905
          case 1: // PEX
2906
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
2907
              this.pex = new PromotionException();
2908
              this.pex.read(iprot);
2909
            } else { 
2910
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2911
            }
2912
            break;
2913
          default:
2914
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2915
        }
3430 rajveer 2916
        iprot.readFieldEnd();
1982 varun.gupt 2917
      }
2918
      iprot.readStructEnd();
2919
      validate();
2920
    }
2921
 
3430 rajveer 2922
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2923
      oprot.writeStructBegin(STRUCT_DESC);
2924
 
2925
      if (this.isSetPex()) {
2926
        oprot.writeFieldBegin(PEX_FIELD_DESC);
2927
        this.pex.write(oprot);
2928
        oprot.writeFieldEnd();
2929
      }
2930
      oprot.writeFieldStop();
2931
      oprot.writeStructEnd();
2932
    }
2933
 
2934
    @Override
2935
    public String toString() {
2936
      StringBuilder sb = new StringBuilder("createPromotion_result(");
2937
      boolean first = true;
2938
 
2939
      sb.append("pex:");
2940
      if (this.pex == null) {
2941
        sb.append("null");
2942
      } else {
2943
        sb.append(this.pex);
2944
      }
2945
      first = false;
2946
      sb.append(")");
2947
      return sb.toString();
2948
    }
2949
 
3430 rajveer 2950
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2951
      // check for required fields
2952
    }
2953
 
3430 rajveer 2954
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2955
      try {
2956
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2957
      } catch (org.apache.thrift.TException te) {
2958
        throw new java.io.IOException(te);
2959
      }
2960
    }
2961
 
2962
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2963
      try {
2964
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2965
      } catch (org.apache.thrift.TException te) {
2966
        throw new java.io.IOException(te);
2967
      }
2968
    }
2969
 
1982 varun.gupt 2970
  }
2971
 
6301 amit.gupta 2972
  public static class getCoupon_args implements org.apache.thrift.TBase<getCoupon_args, getCoupon_args._Fields>, java.io.Serializable, Cloneable   {
2973
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCoupon_args");
2974
 
2975
    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);
2976
 
2977
    private String couponCode; // required
2978
 
2979
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
2980
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
2981
      COUPON_CODE((short)1, "couponCode");
2982
 
2983
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2984
 
2985
      static {
2986
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2987
          byName.put(field.getFieldName(), field);
2988
        }
2989
      }
2990
 
2991
      /**
2992
       * Find the _Fields constant that matches fieldId, or null if its not found.
2993
       */
2994
      public static _Fields findByThriftId(int fieldId) {
2995
        switch(fieldId) {
2996
          case 1: // COUPON_CODE
2997
            return COUPON_CODE;
2998
          default:
2999
            return null;
3000
        }
3001
      }
3002
 
3003
      /**
3004
       * Find the _Fields constant that matches fieldId, throwing an exception
3005
       * if it is not found.
3006
       */
3007
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3008
        _Fields fields = findByThriftId(fieldId);
3009
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3010
        return fields;
3011
      }
3012
 
3013
      /**
3014
       * Find the _Fields constant that matches name, or null if its not found.
3015
       */
3016
      public static _Fields findByName(String name) {
3017
        return byName.get(name);
3018
      }
3019
 
3020
      private final short _thriftId;
3021
      private final String _fieldName;
3022
 
3023
      _Fields(short thriftId, String fieldName) {
3024
        _thriftId = thriftId;
3025
        _fieldName = fieldName;
3026
      }
3027
 
3028
      public short getThriftFieldId() {
3029
        return _thriftId;
3030
      }
3031
 
3032
      public String getFieldName() {
3033
        return _fieldName;
3034
      }
3035
    }
3036
 
3037
    // isset id assignments
3038
 
3039
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3040
    static {
3041
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3042
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3043
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
3044
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3045
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCoupon_args.class, metaDataMap);
3046
    }
3047
 
3048
    public getCoupon_args() {
3049
    }
3050
 
3051
    public getCoupon_args(
3052
      String couponCode)
3053
    {
3054
      this();
3055
      this.couponCode = couponCode;
3056
    }
3057
 
3058
    /**
3059
     * Performs a deep copy on <i>other</i>.
3060
     */
3061
    public getCoupon_args(getCoupon_args other) {
3062
      if (other.isSetCouponCode()) {
3063
        this.couponCode = other.couponCode;
3064
      }
3065
    }
3066
 
3067
    public getCoupon_args deepCopy() {
3068
      return new getCoupon_args(this);
3069
    }
3070
 
3071
    @Override
3072
    public void clear() {
3073
      this.couponCode = null;
3074
    }
3075
 
3076
    public String getCouponCode() {
3077
      return this.couponCode;
3078
    }
3079
 
3080
    public void setCouponCode(String couponCode) {
3081
      this.couponCode = couponCode;
3082
    }
3083
 
3084
    public void unsetCouponCode() {
3085
      this.couponCode = null;
3086
    }
3087
 
3088
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3089
    public boolean isSetCouponCode() {
3090
      return this.couponCode != null;
3091
    }
3092
 
3093
    public void setCouponCodeIsSet(boolean value) {
3094
      if (!value) {
3095
        this.couponCode = null;
3096
      }
3097
    }
3098
 
3099
    public void setFieldValue(_Fields field, Object value) {
3100
      switch (field) {
3101
      case COUPON_CODE:
3102
        if (value == null) {
3103
          unsetCouponCode();
3104
        } else {
3105
          setCouponCode((String)value);
3106
        }
3107
        break;
3108
 
3109
      }
3110
    }
3111
 
3112
    public Object getFieldValue(_Fields field) {
3113
      switch (field) {
3114
      case COUPON_CODE:
3115
        return getCouponCode();
3116
 
3117
      }
3118
      throw new IllegalStateException();
3119
    }
3120
 
3121
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3122
    public boolean isSet(_Fields field) {
3123
      if (field == null) {
3124
        throw new IllegalArgumentException();
3125
      }
3126
 
3127
      switch (field) {
3128
      case COUPON_CODE:
3129
        return isSetCouponCode();
3130
      }
3131
      throw new IllegalStateException();
3132
    }
3133
 
3134
    @Override
3135
    public boolean equals(Object that) {
3136
      if (that == null)
3137
        return false;
3138
      if (that instanceof getCoupon_args)
3139
        return this.equals((getCoupon_args)that);
3140
      return false;
3141
    }
3142
 
3143
    public boolean equals(getCoupon_args that) {
3144
      if (that == null)
3145
        return false;
3146
 
3147
      boolean this_present_couponCode = true && this.isSetCouponCode();
3148
      boolean that_present_couponCode = true && that.isSetCouponCode();
3149
      if (this_present_couponCode || that_present_couponCode) {
3150
        if (!(this_present_couponCode && that_present_couponCode))
3151
          return false;
3152
        if (!this.couponCode.equals(that.couponCode))
3153
          return false;
3154
      }
3155
 
3156
      return true;
3157
    }
3158
 
3159
    @Override
3160
    public int hashCode() {
3161
      return 0;
3162
    }
3163
 
3164
    public int compareTo(getCoupon_args other) {
3165
      if (!getClass().equals(other.getClass())) {
3166
        return getClass().getName().compareTo(other.getClass().getName());
3167
      }
3168
 
3169
      int lastComparison = 0;
3170
      getCoupon_args typedOther = (getCoupon_args)other;
3171
 
3172
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3173
      if (lastComparison != 0) {
3174
        return lastComparison;
3175
      }
3176
      if (isSetCouponCode()) {
3177
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
3178
        if (lastComparison != 0) {
3179
          return lastComparison;
3180
        }
3181
      }
3182
      return 0;
3183
    }
3184
 
3185
    public _Fields fieldForId(int fieldId) {
3186
      return _Fields.findByThriftId(fieldId);
3187
    }
3188
 
3189
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3190
      org.apache.thrift.protocol.TField field;
3191
      iprot.readStructBegin();
3192
      while (true)
3193
      {
3194
        field = iprot.readFieldBegin();
3195
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3196
          break;
3197
        }
3198
        switch (field.id) {
3199
          case 1: // COUPON_CODE
3200
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
3201
              this.couponCode = iprot.readString();
3202
            } else { 
3203
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3204
            }
3205
            break;
3206
          default:
3207
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3208
        }
3209
        iprot.readFieldEnd();
3210
      }
3211
      iprot.readStructEnd();
3212
      validate();
3213
    }
3214
 
3215
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3216
      validate();
3217
 
3218
      oprot.writeStructBegin(STRUCT_DESC);
3219
      if (this.couponCode != null) {
3220
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
3221
        oprot.writeString(this.couponCode);
3222
        oprot.writeFieldEnd();
3223
      }
3224
      oprot.writeFieldStop();
3225
      oprot.writeStructEnd();
3226
    }
3227
 
3228
    @Override
3229
    public String toString() {
3230
      StringBuilder sb = new StringBuilder("getCoupon_args(");
3231
      boolean first = true;
3232
 
3233
      sb.append("couponCode:");
3234
      if (this.couponCode == null) {
3235
        sb.append("null");
3236
      } else {
3237
        sb.append(this.couponCode);
3238
      }
3239
      first = false;
3240
      sb.append(")");
3241
      return sb.toString();
3242
    }
3243
 
3244
    public void validate() throws org.apache.thrift.TException {
3245
      // check for required fields
3246
    }
3247
 
3248
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3249
      try {
3250
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3251
      } catch (org.apache.thrift.TException te) {
3252
        throw new java.io.IOException(te);
3253
      }
3254
    }
3255
 
3256
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3257
      try {
3258
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3259
      } catch (org.apache.thrift.TException te) {
3260
        throw new java.io.IOException(te);
3261
      }
3262
    }
3263
 
3264
  }
3265
 
3266
  public static class getCoupon_result implements org.apache.thrift.TBase<getCoupon_result, getCoupon_result._Fields>, java.io.Serializable, Cloneable   {
3267
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCoupon_result");
3268
 
3269
    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);
3270
    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);
3271
 
3272
    private Coupon success; // required
3273
    private PromotionException pex; // required
3274
 
3275
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3276
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3277
      SUCCESS((short)0, "success"),
3278
      PEX((short)1, "pex");
3279
 
3280
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3281
 
3282
      static {
3283
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3284
          byName.put(field.getFieldName(), field);
3285
        }
3286
      }
3287
 
3288
      /**
3289
       * Find the _Fields constant that matches fieldId, or null if its not found.
3290
       */
3291
      public static _Fields findByThriftId(int fieldId) {
3292
        switch(fieldId) {
3293
          case 0: // SUCCESS
3294
            return SUCCESS;
3295
          case 1: // PEX
3296
            return PEX;
3297
          default:
3298
            return null;
3299
        }
3300
      }
3301
 
3302
      /**
3303
       * Find the _Fields constant that matches fieldId, throwing an exception
3304
       * if it is not found.
3305
       */
3306
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3307
        _Fields fields = findByThriftId(fieldId);
3308
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3309
        return fields;
3310
      }
3311
 
3312
      /**
3313
       * Find the _Fields constant that matches name, or null if its not found.
3314
       */
3315
      public static _Fields findByName(String name) {
3316
        return byName.get(name);
3317
      }
3318
 
3319
      private final short _thriftId;
3320
      private final String _fieldName;
3321
 
3322
      _Fields(short thriftId, String fieldName) {
3323
        _thriftId = thriftId;
3324
        _fieldName = fieldName;
3325
      }
3326
 
3327
      public short getThriftFieldId() {
3328
        return _thriftId;
3329
      }
3330
 
3331
      public String getFieldName() {
3332
        return _fieldName;
3333
      }
3334
    }
3335
 
3336
    // isset id assignments
3337
 
3338
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3339
    static {
3340
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3341
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3342
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class)));
3343
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3344
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
3345
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3346
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCoupon_result.class, metaDataMap);
3347
    }
3348
 
3349
    public getCoupon_result() {
3350
    }
3351
 
3352
    public getCoupon_result(
3353
      Coupon success,
3354
      PromotionException pex)
3355
    {
3356
      this();
3357
      this.success = success;
3358
      this.pex = pex;
3359
    }
3360
 
3361
    /**
3362
     * Performs a deep copy on <i>other</i>.
3363
     */
3364
    public getCoupon_result(getCoupon_result other) {
3365
      if (other.isSetSuccess()) {
3366
        this.success = new Coupon(other.success);
3367
      }
3368
      if (other.isSetPex()) {
3369
        this.pex = new PromotionException(other.pex);
3370
      }
3371
    }
3372
 
3373
    public getCoupon_result deepCopy() {
3374
      return new getCoupon_result(this);
3375
    }
3376
 
3377
    @Override
3378
    public void clear() {
3379
      this.success = null;
3380
      this.pex = null;
3381
    }
3382
 
3383
    public Coupon getSuccess() {
3384
      return this.success;
3385
    }
3386
 
3387
    public void setSuccess(Coupon success) {
3388
      this.success = success;
3389
    }
3390
 
3391
    public void unsetSuccess() {
3392
      this.success = null;
3393
    }
3394
 
3395
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3396
    public boolean isSetSuccess() {
3397
      return this.success != null;
3398
    }
3399
 
3400
    public void setSuccessIsSet(boolean value) {
3401
      if (!value) {
3402
        this.success = null;
3403
      }
3404
    }
3405
 
3406
    public PromotionException getPex() {
3407
      return this.pex;
3408
    }
3409
 
3410
    public void setPex(PromotionException pex) {
3411
      this.pex = pex;
3412
    }
3413
 
3414
    public void unsetPex() {
3415
      this.pex = null;
3416
    }
3417
 
3418
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3419
    public boolean isSetPex() {
3420
      return this.pex != null;
3421
    }
3422
 
3423
    public void setPexIsSet(boolean value) {
3424
      if (!value) {
3425
        this.pex = null;
3426
      }
3427
    }
3428
 
3429
    public void setFieldValue(_Fields field, Object value) {
3430
      switch (field) {
3431
      case SUCCESS:
3432
        if (value == null) {
3433
          unsetSuccess();
3434
        } else {
3435
          setSuccess((Coupon)value);
3436
        }
3437
        break;
3438
 
3439
      case PEX:
3440
        if (value == null) {
3441
          unsetPex();
3442
        } else {
3443
          setPex((PromotionException)value);
3444
        }
3445
        break;
3446
 
3447
      }
3448
    }
3449
 
3450
    public Object getFieldValue(_Fields field) {
3451
      switch (field) {
3452
      case SUCCESS:
3453
        return getSuccess();
3454
 
3455
      case PEX:
3456
        return getPex();
3457
 
3458
      }
3459
      throw new IllegalStateException();
3460
    }
3461
 
3462
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3463
    public boolean isSet(_Fields field) {
3464
      if (field == null) {
3465
        throw new IllegalArgumentException();
3466
      }
3467
 
3468
      switch (field) {
3469
      case SUCCESS:
3470
        return isSetSuccess();
3471
      case PEX:
3472
        return isSetPex();
3473
      }
3474
      throw new IllegalStateException();
3475
    }
3476
 
3477
    @Override
3478
    public boolean equals(Object that) {
3479
      if (that == null)
3480
        return false;
3481
      if (that instanceof getCoupon_result)
3482
        return this.equals((getCoupon_result)that);
3483
      return false;
3484
    }
3485
 
3486
    public boolean equals(getCoupon_result that) {
3487
      if (that == null)
3488
        return false;
3489
 
3490
      boolean this_present_success = true && this.isSetSuccess();
3491
      boolean that_present_success = true && that.isSetSuccess();
3492
      if (this_present_success || that_present_success) {
3493
        if (!(this_present_success && that_present_success))
3494
          return false;
3495
        if (!this.success.equals(that.success))
3496
          return false;
3497
      }
3498
 
3499
      boolean this_present_pex = true && this.isSetPex();
3500
      boolean that_present_pex = true && that.isSetPex();
3501
      if (this_present_pex || that_present_pex) {
3502
        if (!(this_present_pex && that_present_pex))
3503
          return false;
3504
        if (!this.pex.equals(that.pex))
3505
          return false;
3506
      }
3507
 
3508
      return true;
3509
    }
3510
 
3511
    @Override
3512
    public int hashCode() {
3513
      return 0;
3514
    }
3515
 
3516
    public int compareTo(getCoupon_result other) {
3517
      if (!getClass().equals(other.getClass())) {
3518
        return getClass().getName().compareTo(other.getClass().getName());
3519
      }
3520
 
3521
      int lastComparison = 0;
3522
      getCoupon_result typedOther = (getCoupon_result)other;
3523
 
3524
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3525
      if (lastComparison != 0) {
3526
        return lastComparison;
3527
      }
3528
      if (isSetSuccess()) {
3529
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
3530
        if (lastComparison != 0) {
3531
          return lastComparison;
3532
        }
3533
      }
3534
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3535
      if (lastComparison != 0) {
3536
        return lastComparison;
3537
      }
3538
      if (isSetPex()) {
3539
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
3540
        if (lastComparison != 0) {
3541
          return lastComparison;
3542
        }
3543
      }
3544
      return 0;
3545
    }
3546
 
3547
    public _Fields fieldForId(int fieldId) {
3548
      return _Fields.findByThriftId(fieldId);
3549
    }
3550
 
3551
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3552
      org.apache.thrift.protocol.TField field;
3553
      iprot.readStructBegin();
3554
      while (true)
3555
      {
3556
        field = iprot.readFieldBegin();
3557
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3558
          break;
3559
        }
3560
        switch (field.id) {
3561
          case 0: // SUCCESS
3562
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3563
              this.success = new Coupon();
3564
              this.success.read(iprot);
3565
            } else { 
3566
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3567
            }
3568
            break;
3569
          case 1: // PEX
3570
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3571
              this.pex = new PromotionException();
3572
              this.pex.read(iprot);
3573
            } else { 
3574
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3575
            }
3576
            break;
3577
          default:
3578
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3579
        }
3580
        iprot.readFieldEnd();
3581
      }
3582
      iprot.readStructEnd();
3583
      validate();
3584
    }
3585
 
3586
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3587
      oprot.writeStructBegin(STRUCT_DESC);
3588
 
3589
      if (this.isSetSuccess()) {
3590
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
3591
        this.success.write(oprot);
3592
        oprot.writeFieldEnd();
3593
      } else if (this.isSetPex()) {
3594
        oprot.writeFieldBegin(PEX_FIELD_DESC);
3595
        this.pex.write(oprot);
3596
        oprot.writeFieldEnd();
3597
      }
3598
      oprot.writeFieldStop();
3599
      oprot.writeStructEnd();
3600
    }
3601
 
3602
    @Override
3603
    public String toString() {
3604
      StringBuilder sb = new StringBuilder("getCoupon_result(");
3605
      boolean first = true;
3606
 
3607
      sb.append("success:");
3608
      if (this.success == null) {
3609
        sb.append("null");
3610
      } else {
3611
        sb.append(this.success);
3612
      }
3613
      first = false;
3614
      if (!first) sb.append(", ");
3615
      sb.append("pex:");
3616
      if (this.pex == null) {
3617
        sb.append("null");
3618
      } else {
3619
        sb.append(this.pex);
3620
      }
3621
      first = false;
3622
      sb.append(")");
3623
      return sb.toString();
3624
    }
3625
 
3626
    public void validate() throws org.apache.thrift.TException {
3627
      // check for required fields
3628
    }
3629
 
3630
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3631
      try {
3632
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3633
      } catch (org.apache.thrift.TException te) {
3634
        throw new java.io.IOException(te);
3635
      }
3636
    }
3637
 
3638
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3639
      try {
3640
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3641
      } catch (org.apache.thrift.TException te) {
3642
        throw new java.io.IOException(te);
3643
      }
3644
    }
3645
 
3646
  }
3647
 
3648
  public static class isGiftVoucher_args implements org.apache.thrift.TBase<isGiftVoucher_args, isGiftVoucher_args._Fields>, java.io.Serializable, Cloneable   {
3649
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isGiftVoucher_args");
3650
 
3651
    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);
3652
 
3653
    private String couponCode; // required
3654
 
3655
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3656
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3657
      COUPON_CODE((short)1, "couponCode");
3658
 
3659
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3660
 
3661
      static {
3662
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3663
          byName.put(field.getFieldName(), field);
3664
        }
3665
      }
3666
 
3667
      /**
3668
       * Find the _Fields constant that matches fieldId, or null if its not found.
3669
       */
3670
      public static _Fields findByThriftId(int fieldId) {
3671
        switch(fieldId) {
3672
          case 1: // COUPON_CODE
3673
            return COUPON_CODE;
3674
          default:
3675
            return null;
3676
        }
3677
      }
3678
 
3679
      /**
3680
       * Find the _Fields constant that matches fieldId, throwing an exception
3681
       * if it is not found.
3682
       */
3683
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3684
        _Fields fields = findByThriftId(fieldId);
3685
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3686
        return fields;
3687
      }
3688
 
3689
      /**
3690
       * Find the _Fields constant that matches name, or null if its not found.
3691
       */
3692
      public static _Fields findByName(String name) {
3693
        return byName.get(name);
3694
      }
3695
 
3696
      private final short _thriftId;
3697
      private final String _fieldName;
3698
 
3699
      _Fields(short thriftId, String fieldName) {
3700
        _thriftId = thriftId;
3701
        _fieldName = fieldName;
3702
      }
3703
 
3704
      public short getThriftFieldId() {
3705
        return _thriftId;
3706
      }
3707
 
3708
      public String getFieldName() {
3709
        return _fieldName;
3710
      }
3711
    }
3712
 
3713
    // isset id assignments
3714
 
3715
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3716
    static {
3717
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3718
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3719
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
3720
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3721
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isGiftVoucher_args.class, metaDataMap);
3722
    }
3723
 
3724
    public isGiftVoucher_args() {
3725
    }
3726
 
3727
    public isGiftVoucher_args(
3728
      String couponCode)
3729
    {
3730
      this();
3731
      this.couponCode = couponCode;
3732
    }
3733
 
3734
    /**
3735
     * Performs a deep copy on <i>other</i>.
3736
     */
3737
    public isGiftVoucher_args(isGiftVoucher_args other) {
3738
      if (other.isSetCouponCode()) {
3739
        this.couponCode = other.couponCode;
3740
      }
3741
    }
3742
 
3743
    public isGiftVoucher_args deepCopy() {
3744
      return new isGiftVoucher_args(this);
3745
    }
3746
 
3747
    @Override
3748
    public void clear() {
3749
      this.couponCode = null;
3750
    }
3751
 
3752
    public String getCouponCode() {
3753
      return this.couponCode;
3754
    }
3755
 
3756
    public void setCouponCode(String couponCode) {
3757
      this.couponCode = couponCode;
3758
    }
3759
 
3760
    public void unsetCouponCode() {
3761
      this.couponCode = null;
3762
    }
3763
 
3764
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3765
    public boolean isSetCouponCode() {
3766
      return this.couponCode != null;
3767
    }
3768
 
3769
    public void setCouponCodeIsSet(boolean value) {
3770
      if (!value) {
3771
        this.couponCode = null;
3772
      }
3773
    }
3774
 
3775
    public void setFieldValue(_Fields field, Object value) {
3776
      switch (field) {
3777
      case COUPON_CODE:
3778
        if (value == null) {
3779
          unsetCouponCode();
3780
        } else {
3781
          setCouponCode((String)value);
3782
        }
3783
        break;
3784
 
3785
      }
3786
    }
3787
 
3788
    public Object getFieldValue(_Fields field) {
3789
      switch (field) {
3790
      case COUPON_CODE:
3791
        return getCouponCode();
3792
 
3793
      }
3794
      throw new IllegalStateException();
3795
    }
3796
 
3797
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3798
    public boolean isSet(_Fields field) {
3799
      if (field == null) {
3800
        throw new IllegalArgumentException();
3801
      }
3802
 
3803
      switch (field) {
3804
      case COUPON_CODE:
3805
        return isSetCouponCode();
3806
      }
3807
      throw new IllegalStateException();
3808
    }
3809
 
3810
    @Override
3811
    public boolean equals(Object that) {
3812
      if (that == null)
3813
        return false;
3814
      if (that instanceof isGiftVoucher_args)
3815
        return this.equals((isGiftVoucher_args)that);
3816
      return false;
3817
    }
3818
 
3819
    public boolean equals(isGiftVoucher_args that) {
3820
      if (that == null)
3821
        return false;
3822
 
3823
      boolean this_present_couponCode = true && this.isSetCouponCode();
3824
      boolean that_present_couponCode = true && that.isSetCouponCode();
3825
      if (this_present_couponCode || that_present_couponCode) {
3826
        if (!(this_present_couponCode && that_present_couponCode))
3827
          return false;
3828
        if (!this.couponCode.equals(that.couponCode))
3829
          return false;
3830
      }
3831
 
3832
      return true;
3833
    }
3834
 
3835
    @Override
3836
    public int hashCode() {
3837
      return 0;
3838
    }
3839
 
3840
    public int compareTo(isGiftVoucher_args other) {
3841
      if (!getClass().equals(other.getClass())) {
3842
        return getClass().getName().compareTo(other.getClass().getName());
3843
      }
3844
 
3845
      int lastComparison = 0;
3846
      isGiftVoucher_args typedOther = (isGiftVoucher_args)other;
3847
 
3848
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3849
      if (lastComparison != 0) {
3850
        return lastComparison;
3851
      }
3852
      if (isSetCouponCode()) {
3853
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
3854
        if (lastComparison != 0) {
3855
          return lastComparison;
3856
        }
3857
      }
3858
      return 0;
3859
    }
3860
 
3861
    public _Fields fieldForId(int fieldId) {
3862
      return _Fields.findByThriftId(fieldId);
3863
    }
3864
 
3865
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3866
      org.apache.thrift.protocol.TField field;
3867
      iprot.readStructBegin();
3868
      while (true)
3869
      {
3870
        field = iprot.readFieldBegin();
3871
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3872
          break;
3873
        }
3874
        switch (field.id) {
3875
          case 1: // COUPON_CODE
3876
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
3877
              this.couponCode = iprot.readString();
3878
            } else { 
3879
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3880
            }
3881
            break;
3882
          default:
3883
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3884
        }
3885
        iprot.readFieldEnd();
3886
      }
3887
      iprot.readStructEnd();
3888
      validate();
3889
    }
3890
 
3891
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3892
      validate();
3893
 
3894
      oprot.writeStructBegin(STRUCT_DESC);
3895
      if (this.couponCode != null) {
3896
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
3897
        oprot.writeString(this.couponCode);
3898
        oprot.writeFieldEnd();
3899
      }
3900
      oprot.writeFieldStop();
3901
      oprot.writeStructEnd();
3902
    }
3903
 
3904
    @Override
3905
    public String toString() {
3906
      StringBuilder sb = new StringBuilder("isGiftVoucher_args(");
3907
      boolean first = true;
3908
 
3909
      sb.append("couponCode:");
3910
      if (this.couponCode == null) {
3911
        sb.append("null");
3912
      } else {
3913
        sb.append(this.couponCode);
3914
      }
3915
      first = false;
3916
      sb.append(")");
3917
      return sb.toString();
3918
    }
3919
 
3920
    public void validate() throws org.apache.thrift.TException {
3921
      // check for required fields
3922
    }
3923
 
3924
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3925
      try {
3926
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3927
      } catch (org.apache.thrift.TException te) {
3928
        throw new java.io.IOException(te);
3929
      }
3930
    }
3931
 
3932
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3933
      try {
3934
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3935
      } catch (org.apache.thrift.TException te) {
3936
        throw new java.io.IOException(te);
3937
      }
3938
    }
3939
 
3940
  }
3941
 
3942
  public static class isGiftVoucher_result implements org.apache.thrift.TBase<isGiftVoucher_result, isGiftVoucher_result._Fields>, java.io.Serializable, Cloneable   {
3943
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isGiftVoucher_result");
3944
 
3945
    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);
3946
    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);
3947
 
3948
    private boolean success; // required
3949
    private PromotionException pex; // required
3950
 
3951
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3952
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3953
      SUCCESS((short)0, "success"),
3954
      PEX((short)1, "pex");
3955
 
3956
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3957
 
3958
      static {
3959
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3960
          byName.put(field.getFieldName(), field);
3961
        }
3962
      }
3963
 
3964
      /**
3965
       * Find the _Fields constant that matches fieldId, or null if its not found.
3966
       */
3967
      public static _Fields findByThriftId(int fieldId) {
3968
        switch(fieldId) {
3969
          case 0: // SUCCESS
3970
            return SUCCESS;
3971
          case 1: // PEX
3972
            return PEX;
3973
          default:
3974
            return null;
3975
        }
3976
      }
3977
 
3978
      /**
3979
       * Find the _Fields constant that matches fieldId, throwing an exception
3980
       * if it is not found.
3981
       */
3982
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3983
        _Fields fields = findByThriftId(fieldId);
3984
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3985
        return fields;
3986
      }
3987
 
3988
      /**
3989
       * Find the _Fields constant that matches name, or null if its not found.
3990
       */
3991
      public static _Fields findByName(String name) {
3992
        return byName.get(name);
3993
      }
3994
 
3995
      private final short _thriftId;
3996
      private final String _fieldName;
3997
 
3998
      _Fields(short thriftId, String fieldName) {
3999
        _thriftId = thriftId;
4000
        _fieldName = fieldName;
4001
      }
4002
 
4003
      public short getThriftFieldId() {
4004
        return _thriftId;
4005
      }
4006
 
4007
      public String getFieldName() {
4008
        return _fieldName;
4009
      }
4010
    }
4011
 
4012
    // isset id assignments
4013
    private static final int __SUCCESS_ISSET_ID = 0;
4014
    private BitSet __isset_bit_vector = new BitSet(1);
4015
 
4016
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4017
    static {
4018
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4019
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4020
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
4021
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4022
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4023
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4024
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isGiftVoucher_result.class, metaDataMap);
4025
    }
4026
 
4027
    public isGiftVoucher_result() {
4028
    }
4029
 
4030
    public isGiftVoucher_result(
4031
      boolean success,
4032
      PromotionException pex)
4033
    {
4034
      this();
4035
      this.success = success;
4036
      setSuccessIsSet(true);
4037
      this.pex = pex;
4038
    }
4039
 
4040
    /**
4041
     * Performs a deep copy on <i>other</i>.
4042
     */
4043
    public isGiftVoucher_result(isGiftVoucher_result other) {
4044
      __isset_bit_vector.clear();
4045
      __isset_bit_vector.or(other.__isset_bit_vector);
4046
      this.success = other.success;
4047
      if (other.isSetPex()) {
4048
        this.pex = new PromotionException(other.pex);
4049
      }
4050
    }
4051
 
4052
    public isGiftVoucher_result deepCopy() {
4053
      return new isGiftVoucher_result(this);
4054
    }
4055
 
4056
    @Override
4057
    public void clear() {
4058
      setSuccessIsSet(false);
4059
      this.success = false;
4060
      this.pex = null;
4061
    }
4062
 
4063
    public boolean isSuccess() {
4064
      return this.success;
4065
    }
4066
 
4067
    public void setSuccess(boolean success) {
4068
      this.success = success;
4069
      setSuccessIsSet(true);
4070
    }
4071
 
4072
    public void unsetSuccess() {
4073
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
4074
    }
4075
 
4076
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
4077
    public boolean isSetSuccess() {
4078
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
4079
    }
4080
 
4081
    public void setSuccessIsSet(boolean value) {
4082
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
4083
    }
4084
 
4085
    public PromotionException getPex() {
4086
      return this.pex;
4087
    }
4088
 
4089
    public void setPex(PromotionException pex) {
4090
      this.pex = pex;
4091
    }
4092
 
4093
    public void unsetPex() {
4094
      this.pex = null;
4095
    }
4096
 
4097
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
4098
    public boolean isSetPex() {
4099
      return this.pex != null;
4100
    }
4101
 
4102
    public void setPexIsSet(boolean value) {
4103
      if (!value) {
4104
        this.pex = null;
4105
      }
4106
    }
4107
 
4108
    public void setFieldValue(_Fields field, Object value) {
4109
      switch (field) {
4110
      case SUCCESS:
4111
        if (value == null) {
4112
          unsetSuccess();
4113
        } else {
4114
          setSuccess((Boolean)value);
4115
        }
4116
        break;
4117
 
4118
      case PEX:
4119
        if (value == null) {
4120
          unsetPex();
4121
        } else {
4122
          setPex((PromotionException)value);
4123
        }
4124
        break;
4125
 
4126
      }
4127
    }
4128
 
4129
    public Object getFieldValue(_Fields field) {
4130
      switch (field) {
4131
      case SUCCESS:
4132
        return Boolean.valueOf(isSuccess());
4133
 
4134
      case PEX:
4135
        return getPex();
4136
 
4137
      }
4138
      throw new IllegalStateException();
4139
    }
4140
 
4141
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4142
    public boolean isSet(_Fields field) {
4143
      if (field == null) {
4144
        throw new IllegalArgumentException();
4145
      }
4146
 
4147
      switch (field) {
4148
      case SUCCESS:
4149
        return isSetSuccess();
4150
      case PEX:
4151
        return isSetPex();
4152
      }
4153
      throw new IllegalStateException();
4154
    }
4155
 
4156
    @Override
4157
    public boolean equals(Object that) {
4158
      if (that == null)
4159
        return false;
4160
      if (that instanceof isGiftVoucher_result)
4161
        return this.equals((isGiftVoucher_result)that);
4162
      return false;
4163
    }
4164
 
4165
    public boolean equals(isGiftVoucher_result that) {
4166
      if (that == null)
4167
        return false;
4168
 
4169
      boolean this_present_success = true;
4170
      boolean that_present_success = true;
4171
      if (this_present_success || that_present_success) {
4172
        if (!(this_present_success && that_present_success))
4173
          return false;
4174
        if (this.success != that.success)
4175
          return false;
4176
      }
4177
 
4178
      boolean this_present_pex = true && this.isSetPex();
4179
      boolean that_present_pex = true && that.isSetPex();
4180
      if (this_present_pex || that_present_pex) {
4181
        if (!(this_present_pex && that_present_pex))
4182
          return false;
4183
        if (!this.pex.equals(that.pex))
4184
          return false;
4185
      }
4186
 
4187
      return true;
4188
    }
4189
 
4190
    @Override
4191
    public int hashCode() {
4192
      return 0;
4193
    }
4194
 
4195
    public int compareTo(isGiftVoucher_result other) {
4196
      if (!getClass().equals(other.getClass())) {
4197
        return getClass().getName().compareTo(other.getClass().getName());
4198
      }
4199
 
4200
      int lastComparison = 0;
4201
      isGiftVoucher_result typedOther = (isGiftVoucher_result)other;
4202
 
4203
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
4204
      if (lastComparison != 0) {
4205
        return lastComparison;
4206
      }
4207
      if (isSetSuccess()) {
4208
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4209
        if (lastComparison != 0) {
4210
          return lastComparison;
4211
        }
4212
      }
4213
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
4214
      if (lastComparison != 0) {
4215
        return lastComparison;
4216
      }
4217
      if (isSetPex()) {
4218
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
4219
        if (lastComparison != 0) {
4220
          return lastComparison;
4221
        }
4222
      }
4223
      return 0;
4224
    }
4225
 
4226
    public _Fields fieldForId(int fieldId) {
4227
      return _Fields.findByThriftId(fieldId);
4228
    }
4229
 
4230
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4231
      org.apache.thrift.protocol.TField field;
4232
      iprot.readStructBegin();
4233
      while (true)
4234
      {
4235
        field = iprot.readFieldBegin();
4236
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4237
          break;
4238
        }
4239
        switch (field.id) {
4240
          case 0: // SUCCESS
4241
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
4242
              this.success = iprot.readBool();
4243
              setSuccessIsSet(true);
4244
            } else { 
4245
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4246
            }
4247
            break;
4248
          case 1: // PEX
4249
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4250
              this.pex = new PromotionException();
4251
              this.pex.read(iprot);
4252
            } else { 
4253
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4254
            }
4255
            break;
4256
          default:
4257
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4258
        }
4259
        iprot.readFieldEnd();
4260
      }
4261
      iprot.readStructEnd();
4262
      validate();
4263
    }
4264
 
4265
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4266
      oprot.writeStructBegin(STRUCT_DESC);
4267
 
4268
      if (this.isSetSuccess()) {
4269
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4270
        oprot.writeBool(this.success);
4271
        oprot.writeFieldEnd();
4272
      } else if (this.isSetPex()) {
4273
        oprot.writeFieldBegin(PEX_FIELD_DESC);
4274
        this.pex.write(oprot);
4275
        oprot.writeFieldEnd();
4276
      }
4277
      oprot.writeFieldStop();
4278
      oprot.writeStructEnd();
4279
    }
4280
 
4281
    @Override
4282
    public String toString() {
4283
      StringBuilder sb = new StringBuilder("isGiftVoucher_result(");
4284
      boolean first = true;
4285
 
4286
      sb.append("success:");
4287
      sb.append(this.success);
4288
      first = false;
4289
      if (!first) sb.append(", ");
4290
      sb.append("pex:");
4291
      if (this.pex == null) {
4292
        sb.append("null");
4293
      } else {
4294
        sb.append(this.pex);
4295
      }
4296
      first = false;
4297
      sb.append(")");
4298
      return sb.toString();
4299
    }
4300
 
4301
    public void validate() throws org.apache.thrift.TException {
4302
      // check for required fields
4303
    }
4304
 
4305
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4306
      try {
4307
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4308
      } catch (org.apache.thrift.TException te) {
4309
        throw new java.io.IOException(te);
4310
      }
4311
    }
4312
 
4313
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4314
      try {
4315
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4316
      } catch (org.apache.thrift.TException te) {
4317
        throw new java.io.IOException(te);
4318
      }
4319
    }
4320
 
4321
  }
4322
 
6356 amit.gupta 4323
  public static class isCodApplicable_args implements org.apache.thrift.TBase<isCodApplicable_args, isCodApplicable_args._Fields>, java.io.Serializable, Cloneable   {
4324
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isCodApplicable_args");
4325
 
4326
    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);
4327
 
4328
    private String couponCode; // required
4329
 
4330
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4331
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4332
      COUPON_CODE((short)1, "couponCode");
4333
 
4334
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4335
 
4336
      static {
4337
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4338
          byName.put(field.getFieldName(), field);
4339
        }
4340
      }
4341
 
4342
      /**
4343
       * Find the _Fields constant that matches fieldId, or null if its not found.
4344
       */
4345
      public static _Fields findByThriftId(int fieldId) {
4346
        switch(fieldId) {
4347
          case 1: // COUPON_CODE
4348
            return COUPON_CODE;
4349
          default:
4350
            return null;
4351
        }
4352
      }
4353
 
4354
      /**
4355
       * Find the _Fields constant that matches fieldId, throwing an exception
4356
       * if it is not found.
4357
       */
4358
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4359
        _Fields fields = findByThriftId(fieldId);
4360
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4361
        return fields;
4362
      }
4363
 
4364
      /**
4365
       * Find the _Fields constant that matches name, or null if its not found.
4366
       */
4367
      public static _Fields findByName(String name) {
4368
        return byName.get(name);
4369
      }
4370
 
4371
      private final short _thriftId;
4372
      private final String _fieldName;
4373
 
4374
      _Fields(short thriftId, String fieldName) {
4375
        _thriftId = thriftId;
4376
        _fieldName = fieldName;
4377
      }
4378
 
4379
      public short getThriftFieldId() {
4380
        return _thriftId;
4381
      }
4382
 
4383
      public String getFieldName() {
4384
        return _fieldName;
4385
      }
4386
    }
4387
 
4388
    // isset id assignments
4389
 
4390
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4391
    static {
4392
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4393
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4394
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
4395
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4396
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isCodApplicable_args.class, metaDataMap);
4397
    }
4398
 
4399
    public isCodApplicable_args() {
4400
    }
4401
 
4402
    public isCodApplicable_args(
4403
      String couponCode)
4404
    {
4405
      this();
4406
      this.couponCode = couponCode;
4407
    }
4408
 
4409
    /**
4410
     * Performs a deep copy on <i>other</i>.
4411
     */
4412
    public isCodApplicable_args(isCodApplicable_args other) {
4413
      if (other.isSetCouponCode()) {
4414
        this.couponCode = other.couponCode;
4415
      }
4416
    }
4417
 
4418
    public isCodApplicable_args deepCopy() {
4419
      return new isCodApplicable_args(this);
4420
    }
4421
 
4422
    @Override
4423
    public void clear() {
4424
      this.couponCode = null;
4425
    }
4426
 
4427
    public String getCouponCode() {
4428
      return this.couponCode;
4429
    }
4430
 
4431
    public void setCouponCode(String couponCode) {
4432
      this.couponCode = couponCode;
4433
    }
4434
 
4435
    public void unsetCouponCode() {
4436
      this.couponCode = null;
4437
    }
4438
 
4439
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
4440
    public boolean isSetCouponCode() {
4441
      return this.couponCode != null;
4442
    }
4443
 
4444
    public void setCouponCodeIsSet(boolean value) {
4445
      if (!value) {
4446
        this.couponCode = null;
4447
      }
4448
    }
4449
 
4450
    public void setFieldValue(_Fields field, Object value) {
4451
      switch (field) {
4452
      case COUPON_CODE:
4453
        if (value == null) {
4454
          unsetCouponCode();
4455
        } else {
4456
          setCouponCode((String)value);
4457
        }
4458
        break;
4459
 
4460
      }
4461
    }
4462
 
4463
    public Object getFieldValue(_Fields field) {
4464
      switch (field) {
4465
      case COUPON_CODE:
4466
        return getCouponCode();
4467
 
4468
      }
4469
      throw new IllegalStateException();
4470
    }
4471
 
4472
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4473
    public boolean isSet(_Fields field) {
4474
      if (field == null) {
4475
        throw new IllegalArgumentException();
4476
      }
4477
 
4478
      switch (field) {
4479
      case COUPON_CODE:
4480
        return isSetCouponCode();
4481
      }
4482
      throw new IllegalStateException();
4483
    }
4484
 
4485
    @Override
4486
    public boolean equals(Object that) {
4487
      if (that == null)
4488
        return false;
4489
      if (that instanceof isCodApplicable_args)
4490
        return this.equals((isCodApplicable_args)that);
4491
      return false;
4492
    }
4493
 
4494
    public boolean equals(isCodApplicable_args that) {
4495
      if (that == null)
4496
        return false;
4497
 
4498
      boolean this_present_couponCode = true && this.isSetCouponCode();
4499
      boolean that_present_couponCode = true && that.isSetCouponCode();
4500
      if (this_present_couponCode || that_present_couponCode) {
4501
        if (!(this_present_couponCode && that_present_couponCode))
4502
          return false;
4503
        if (!this.couponCode.equals(that.couponCode))
4504
          return false;
4505
      }
4506
 
4507
      return true;
4508
    }
4509
 
4510
    @Override
4511
    public int hashCode() {
4512
      return 0;
4513
    }
4514
 
4515
    public int compareTo(isCodApplicable_args other) {
4516
      if (!getClass().equals(other.getClass())) {
4517
        return getClass().getName().compareTo(other.getClass().getName());
4518
      }
4519
 
4520
      int lastComparison = 0;
4521
      isCodApplicable_args typedOther = (isCodApplicable_args)other;
4522
 
4523
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
4524
      if (lastComparison != 0) {
4525
        return lastComparison;
4526
      }
4527
      if (isSetCouponCode()) {
4528
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
4529
        if (lastComparison != 0) {
4530
          return lastComparison;
4531
        }
4532
      }
4533
      return 0;
4534
    }
4535
 
4536
    public _Fields fieldForId(int fieldId) {
4537
      return _Fields.findByThriftId(fieldId);
4538
    }
4539
 
4540
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4541
      org.apache.thrift.protocol.TField field;
4542
      iprot.readStructBegin();
4543
      while (true)
4544
      {
4545
        field = iprot.readFieldBegin();
4546
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4547
          break;
4548
        }
4549
        switch (field.id) {
4550
          case 1: // COUPON_CODE
4551
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
4552
              this.couponCode = iprot.readString();
4553
            } else { 
4554
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4555
            }
4556
            break;
4557
          default:
4558
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4559
        }
4560
        iprot.readFieldEnd();
4561
      }
4562
      iprot.readStructEnd();
4563
      validate();
4564
    }
4565
 
4566
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4567
      validate();
4568
 
4569
      oprot.writeStructBegin(STRUCT_DESC);
4570
      if (this.couponCode != null) {
4571
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
4572
        oprot.writeString(this.couponCode);
4573
        oprot.writeFieldEnd();
4574
      }
4575
      oprot.writeFieldStop();
4576
      oprot.writeStructEnd();
4577
    }
4578
 
4579
    @Override
4580
    public String toString() {
4581
      StringBuilder sb = new StringBuilder("isCodApplicable_args(");
4582
      boolean first = true;
4583
 
4584
      sb.append("couponCode:");
4585
      if (this.couponCode == null) {
4586
        sb.append("null");
4587
      } else {
4588
        sb.append(this.couponCode);
4589
      }
4590
      first = false;
4591
      sb.append(")");
4592
      return sb.toString();
4593
    }
4594
 
4595
    public void validate() throws org.apache.thrift.TException {
4596
      // check for required fields
4597
    }
4598
 
4599
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4600
      try {
4601
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4602
      } catch (org.apache.thrift.TException te) {
4603
        throw new java.io.IOException(te);
4604
      }
4605
    }
4606
 
4607
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4608
      try {
4609
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4610
      } catch (org.apache.thrift.TException te) {
4611
        throw new java.io.IOException(te);
4612
      }
4613
    }
4614
 
4615
  }
4616
 
4617
  public static class isCodApplicable_result implements org.apache.thrift.TBase<isCodApplicable_result, isCodApplicable_result._Fields>, java.io.Serializable, Cloneable   {
4618
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isCodApplicable_result");
4619
 
4620
    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);
4621
    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);
4622
 
4623
    private boolean success; // required
4624
    private PromotionException pex; // required
4625
 
4626
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4627
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4628
      SUCCESS((short)0, "success"),
4629
      PEX((short)1, "pex");
4630
 
4631
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4632
 
4633
      static {
4634
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4635
          byName.put(field.getFieldName(), field);
4636
        }
4637
      }
4638
 
4639
      /**
4640
       * Find the _Fields constant that matches fieldId, or null if its not found.
4641
       */
4642
      public static _Fields findByThriftId(int fieldId) {
4643
        switch(fieldId) {
4644
          case 0: // SUCCESS
4645
            return SUCCESS;
4646
          case 1: // PEX
4647
            return PEX;
4648
          default:
4649
            return null;
4650
        }
4651
      }
4652
 
4653
      /**
4654
       * Find the _Fields constant that matches fieldId, throwing an exception
4655
       * if it is not found.
4656
       */
4657
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4658
        _Fields fields = findByThriftId(fieldId);
4659
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4660
        return fields;
4661
      }
4662
 
4663
      /**
4664
       * Find the _Fields constant that matches name, or null if its not found.
4665
       */
4666
      public static _Fields findByName(String name) {
4667
        return byName.get(name);
4668
      }
4669
 
4670
      private final short _thriftId;
4671
      private final String _fieldName;
4672
 
4673
      _Fields(short thriftId, String fieldName) {
4674
        _thriftId = thriftId;
4675
        _fieldName = fieldName;
4676
      }
4677
 
4678
      public short getThriftFieldId() {
4679
        return _thriftId;
4680
      }
4681
 
4682
      public String getFieldName() {
4683
        return _fieldName;
4684
      }
4685
    }
4686
 
4687
    // isset id assignments
4688
    private static final int __SUCCESS_ISSET_ID = 0;
4689
    private BitSet __isset_bit_vector = new BitSet(1);
4690
 
4691
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4692
    static {
4693
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4694
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4695
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
4696
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4697
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4698
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4699
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isCodApplicable_result.class, metaDataMap);
4700
    }
4701
 
4702
    public isCodApplicable_result() {
4703
    }
4704
 
4705
    public isCodApplicable_result(
4706
      boolean success,
4707
      PromotionException pex)
4708
    {
4709
      this();
4710
      this.success = success;
4711
      setSuccessIsSet(true);
4712
      this.pex = pex;
4713
    }
4714
 
4715
    /**
4716
     * Performs a deep copy on <i>other</i>.
4717
     */
4718
    public isCodApplicable_result(isCodApplicable_result other) {
4719
      __isset_bit_vector.clear();
4720
      __isset_bit_vector.or(other.__isset_bit_vector);
4721
      this.success = other.success;
4722
      if (other.isSetPex()) {
4723
        this.pex = new PromotionException(other.pex);
4724
      }
4725
    }
4726
 
4727
    public isCodApplicable_result deepCopy() {
4728
      return new isCodApplicable_result(this);
4729
    }
4730
 
4731
    @Override
4732
    public void clear() {
4733
      setSuccessIsSet(false);
4734
      this.success = false;
4735
      this.pex = null;
4736
    }
4737
 
4738
    public boolean isSuccess() {
4739
      return this.success;
4740
    }
4741
 
4742
    public void setSuccess(boolean success) {
4743
      this.success = success;
4744
      setSuccessIsSet(true);
4745
    }
4746
 
4747
    public void unsetSuccess() {
4748
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
4749
    }
4750
 
4751
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
4752
    public boolean isSetSuccess() {
4753
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
4754
    }
4755
 
4756
    public void setSuccessIsSet(boolean value) {
4757
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
4758
    }
4759
 
4760
    public PromotionException getPex() {
4761
      return this.pex;
4762
    }
4763
 
4764
    public void setPex(PromotionException pex) {
4765
      this.pex = pex;
4766
    }
4767
 
4768
    public void unsetPex() {
4769
      this.pex = null;
4770
    }
4771
 
4772
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
4773
    public boolean isSetPex() {
4774
      return this.pex != null;
4775
    }
4776
 
4777
    public void setPexIsSet(boolean value) {
4778
      if (!value) {
4779
        this.pex = null;
4780
      }
4781
    }
4782
 
4783
    public void setFieldValue(_Fields field, Object value) {
4784
      switch (field) {
4785
      case SUCCESS:
4786
        if (value == null) {
4787
          unsetSuccess();
4788
        } else {
4789
          setSuccess((Boolean)value);
4790
        }
4791
        break;
4792
 
4793
      case PEX:
4794
        if (value == null) {
4795
          unsetPex();
4796
        } else {
4797
          setPex((PromotionException)value);
4798
        }
4799
        break;
4800
 
4801
      }
4802
    }
4803
 
4804
    public Object getFieldValue(_Fields field) {
4805
      switch (field) {
4806
      case SUCCESS:
4807
        return Boolean.valueOf(isSuccess());
4808
 
4809
      case PEX:
4810
        return getPex();
4811
 
4812
      }
4813
      throw new IllegalStateException();
4814
    }
4815
 
4816
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4817
    public boolean isSet(_Fields field) {
4818
      if (field == null) {
4819
        throw new IllegalArgumentException();
4820
      }
4821
 
4822
      switch (field) {
4823
      case SUCCESS:
4824
        return isSetSuccess();
4825
      case PEX:
4826
        return isSetPex();
4827
      }
4828
      throw new IllegalStateException();
4829
    }
4830
 
4831
    @Override
4832
    public boolean equals(Object that) {
4833
      if (that == null)
4834
        return false;
4835
      if (that instanceof isCodApplicable_result)
4836
        return this.equals((isCodApplicable_result)that);
4837
      return false;
4838
    }
4839
 
4840
    public boolean equals(isCodApplicable_result that) {
4841
      if (that == null)
4842
        return false;
4843
 
4844
      boolean this_present_success = true;
4845
      boolean that_present_success = true;
4846
      if (this_present_success || that_present_success) {
4847
        if (!(this_present_success && that_present_success))
4848
          return false;
4849
        if (this.success != that.success)
4850
          return false;
4851
      }
4852
 
4853
      boolean this_present_pex = true && this.isSetPex();
4854
      boolean that_present_pex = true && that.isSetPex();
4855
      if (this_present_pex || that_present_pex) {
4856
        if (!(this_present_pex && that_present_pex))
4857
          return false;
4858
        if (!this.pex.equals(that.pex))
4859
          return false;
4860
      }
4861
 
4862
      return true;
4863
    }
4864
 
4865
    @Override
4866
    public int hashCode() {
4867
      return 0;
4868
    }
4869
 
4870
    public int compareTo(isCodApplicable_result other) {
4871
      if (!getClass().equals(other.getClass())) {
4872
        return getClass().getName().compareTo(other.getClass().getName());
4873
      }
4874
 
4875
      int lastComparison = 0;
4876
      isCodApplicable_result typedOther = (isCodApplicable_result)other;
4877
 
4878
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
4879
      if (lastComparison != 0) {
4880
        return lastComparison;
4881
      }
4882
      if (isSetSuccess()) {
4883
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4884
        if (lastComparison != 0) {
4885
          return lastComparison;
4886
        }
4887
      }
4888
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
4889
      if (lastComparison != 0) {
4890
        return lastComparison;
4891
      }
4892
      if (isSetPex()) {
4893
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
4894
        if (lastComparison != 0) {
4895
          return lastComparison;
4896
        }
4897
      }
4898
      return 0;
4899
    }
4900
 
4901
    public _Fields fieldForId(int fieldId) {
4902
      return _Fields.findByThriftId(fieldId);
4903
    }
4904
 
4905
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4906
      org.apache.thrift.protocol.TField field;
4907
      iprot.readStructBegin();
4908
      while (true)
4909
      {
4910
        field = iprot.readFieldBegin();
4911
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4912
          break;
4913
        }
4914
        switch (field.id) {
4915
          case 0: // SUCCESS
4916
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
4917
              this.success = iprot.readBool();
4918
              setSuccessIsSet(true);
4919
            } else { 
4920
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4921
            }
4922
            break;
4923
          case 1: // PEX
4924
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4925
              this.pex = new PromotionException();
4926
              this.pex.read(iprot);
4927
            } else { 
4928
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4929
            }
4930
            break;
4931
          default:
4932
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4933
        }
4934
        iprot.readFieldEnd();
4935
      }
4936
      iprot.readStructEnd();
4937
      validate();
4938
    }
4939
 
4940
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4941
      oprot.writeStructBegin(STRUCT_DESC);
4942
 
4943
      if (this.isSetSuccess()) {
4944
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4945
        oprot.writeBool(this.success);
4946
        oprot.writeFieldEnd();
4947
      } else if (this.isSetPex()) {
4948
        oprot.writeFieldBegin(PEX_FIELD_DESC);
4949
        this.pex.write(oprot);
4950
        oprot.writeFieldEnd();
4951
      }
4952
      oprot.writeFieldStop();
4953
      oprot.writeStructEnd();
4954
    }
4955
 
4956
    @Override
4957
    public String toString() {
4958
      StringBuilder sb = new StringBuilder("isCodApplicable_result(");
4959
      boolean first = true;
4960
 
4961
      sb.append("success:");
4962
      sb.append(this.success);
4963
      first = false;
4964
      if (!first) sb.append(", ");
4965
      sb.append("pex:");
4966
      if (this.pex == null) {
4967
        sb.append("null");
4968
      } else {
4969
        sb.append(this.pex);
4970
      }
4971
      first = false;
4972
      sb.append(")");
4973
      return sb.toString();
4974
    }
4975
 
4976
    public void validate() throws org.apache.thrift.TException {
4977
      // check for required fields
4978
    }
4979
 
4980
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4981
      try {
4982
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4983
      } catch (org.apache.thrift.TException te) {
4984
        throw new java.io.IOException(te);
4985
      }
4986
    }
4987
 
4988
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4989
      try {
4990
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4991
      } catch (org.apache.thrift.TException te) {
4992
        throw new java.io.IOException(te);
4993
      }
4994
    }
4995
 
4996
  }
4997
 
3430 rajveer 4998
  public static class getAllPromotions_args implements org.apache.thrift.TBase<getAllPromotions_args, getAllPromotions_args._Fields>, java.io.Serializable, Cloneable   {
4999
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_args");
1982 varun.gupt 5000
 
5001
 
5002
 
5003
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5004
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5005
;
5006
 
5007
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5008
 
5009
      static {
5010
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5011
          byName.put(field.getFieldName(), field);
5012
        }
5013
      }
5014
 
5015
      /**
5016
       * Find the _Fields constant that matches fieldId, or null if its not found.
5017
       */
5018
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5019
        switch(fieldId) {
5020
          default:
5021
            return null;
5022
        }
1982 varun.gupt 5023
      }
5024
 
5025
      /**
5026
       * Find the _Fields constant that matches fieldId, throwing an exception
5027
       * if it is not found.
5028
       */
5029
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5030
        _Fields fields = findByThriftId(fieldId);
5031
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5032
        return fields;
5033
      }
5034
 
5035
      /**
5036
       * Find the _Fields constant that matches name, or null if its not found.
5037
       */
5038
      public static _Fields findByName(String name) {
5039
        return byName.get(name);
5040
      }
5041
 
5042
      private final short _thriftId;
5043
      private final String _fieldName;
5044
 
5045
      _Fields(short thriftId, String fieldName) {
5046
        _thriftId = thriftId;
5047
        _fieldName = fieldName;
5048
      }
5049
 
5050
      public short getThriftFieldId() {
5051
        return _thriftId;
5052
      }
5053
 
5054
      public String getFieldName() {
5055
        return _fieldName;
5056
      }
5057
    }
3430 rajveer 5058
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5059
    static {
3430 rajveer 5060
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5061
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5062
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_args.class, metaDataMap);
1982 varun.gupt 5063
    }
5064
 
5065
    public getAllPromotions_args() {
5066
    }
5067
 
5068
    /**
5069
     * Performs a deep copy on <i>other</i>.
5070
     */
5071
    public getAllPromotions_args(getAllPromotions_args other) {
5072
    }
5073
 
5074
    public getAllPromotions_args deepCopy() {
5075
      return new getAllPromotions_args(this);
5076
    }
5077
 
3430 rajveer 5078
    @Override
5079
    public void clear() {
1982 varun.gupt 5080
    }
5081
 
5082
    public void setFieldValue(_Fields field, Object value) {
5083
      switch (field) {
5084
      }
5085
    }
5086
 
5087
    public Object getFieldValue(_Fields field) {
5088
      switch (field) {
5089
      }
5090
      throw new IllegalStateException();
5091
    }
5092
 
3430 rajveer 5093
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5094
    public boolean isSet(_Fields field) {
5095
      if (field == null) {
5096
        throw new IllegalArgumentException();
5097
      }
1982 varun.gupt 5098
 
5099
      switch (field) {
5100
      }
5101
      throw new IllegalStateException();
5102
    }
5103
 
5104
    @Override
5105
    public boolean equals(Object that) {
5106
      if (that == null)
5107
        return false;
5108
      if (that instanceof getAllPromotions_args)
5109
        return this.equals((getAllPromotions_args)that);
5110
      return false;
5111
    }
5112
 
5113
    public boolean equals(getAllPromotions_args that) {
5114
      if (that == null)
5115
        return false;
5116
 
5117
      return true;
5118
    }
5119
 
5120
    @Override
5121
    public int hashCode() {
5122
      return 0;
5123
    }
5124
 
5125
    public int compareTo(getAllPromotions_args other) {
5126
      if (!getClass().equals(other.getClass())) {
5127
        return getClass().getName().compareTo(other.getClass().getName());
5128
      }
5129
 
5130
      int lastComparison = 0;
5131
      getAllPromotions_args typedOther = (getAllPromotions_args)other;
5132
 
5133
      return 0;
5134
    }
5135
 
3430 rajveer 5136
    public _Fields fieldForId(int fieldId) {
5137
      return _Fields.findByThriftId(fieldId);
5138
    }
5139
 
5140
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5141
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5142
      iprot.readStructBegin();
5143
      while (true)
5144
      {
5145
        field = iprot.readFieldBegin();
3430 rajveer 5146
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5147
          break;
5148
        }
3430 rajveer 5149
        switch (field.id) {
5150
          default:
5151
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5152
        }
3430 rajveer 5153
        iprot.readFieldEnd();
1982 varun.gupt 5154
      }
5155
      iprot.readStructEnd();
5156
      validate();
5157
    }
5158
 
3430 rajveer 5159
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5160
      validate();
5161
 
5162
      oprot.writeStructBegin(STRUCT_DESC);
5163
      oprot.writeFieldStop();
5164
      oprot.writeStructEnd();
5165
    }
5166
 
5167
    @Override
5168
    public String toString() {
5169
      StringBuilder sb = new StringBuilder("getAllPromotions_args(");
5170
      boolean first = true;
5171
 
5172
      sb.append(")");
5173
      return sb.toString();
5174
    }
5175
 
3430 rajveer 5176
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5177
      // check for required fields
5178
    }
5179
 
3430 rajveer 5180
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5181
      try {
5182
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5183
      } catch (org.apache.thrift.TException te) {
5184
        throw new java.io.IOException(te);
5185
      }
5186
    }
5187
 
5188
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5189
      try {
5190
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5191
      } catch (org.apache.thrift.TException te) {
5192
        throw new java.io.IOException(te);
5193
      }
5194
    }
5195
 
1982 varun.gupt 5196
  }
5197
 
3430 rajveer 5198
  public static class getAllPromotions_result implements org.apache.thrift.TBase<getAllPromotions_result, getAllPromotions_result._Fields>, java.io.Serializable, Cloneable   {
5199
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_result");
1982 varun.gupt 5200
 
3430 rajveer 5201
    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);
5202
    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 5203
 
3430 rajveer 5204
    private List<Promotion> success; // required
5205
    private PromotionException pex; // required
1982 varun.gupt 5206
 
5207
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5208
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5209
      SUCCESS((short)0, "success"),
5210
      PEX((short)1, "pex");
5211
 
5212
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5213
 
5214
      static {
5215
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5216
          byName.put(field.getFieldName(), field);
5217
        }
5218
      }
5219
 
5220
      /**
5221
       * Find the _Fields constant that matches fieldId, or null if its not found.
5222
       */
5223
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5224
        switch(fieldId) {
5225
          case 0: // SUCCESS
5226
            return SUCCESS;
5227
          case 1: // PEX
5228
            return PEX;
5229
          default:
5230
            return null;
5231
        }
1982 varun.gupt 5232
      }
5233
 
5234
      /**
5235
       * Find the _Fields constant that matches fieldId, throwing an exception
5236
       * if it is not found.
5237
       */
5238
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5239
        _Fields fields = findByThriftId(fieldId);
5240
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5241
        return fields;
5242
      }
5243
 
5244
      /**
5245
       * Find the _Fields constant that matches name, or null if its not found.
5246
       */
5247
      public static _Fields findByName(String name) {
5248
        return byName.get(name);
5249
      }
5250
 
5251
      private final short _thriftId;
5252
      private final String _fieldName;
5253
 
5254
      _Fields(short thriftId, String fieldName) {
5255
        _thriftId = thriftId;
5256
        _fieldName = fieldName;
5257
      }
5258
 
5259
      public short getThriftFieldId() {
5260
        return _thriftId;
5261
      }
5262
 
5263
      public String getFieldName() {
5264
        return _fieldName;
5265
      }
5266
    }
5267
 
5268
    // isset id assignments
5269
 
3430 rajveer 5270
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5271
    static {
3430 rajveer 5272
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5273
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5274
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
5275
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class))));
5276
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5277
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
5278
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5279
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_result.class, metaDataMap);
1982 varun.gupt 5280
    }
5281
 
5282
    public getAllPromotions_result() {
5283
    }
5284
 
5285
    public getAllPromotions_result(
5286
      List<Promotion> success,
5287
      PromotionException pex)
5288
    {
5289
      this();
5290
      this.success = success;
5291
      this.pex = pex;
5292
    }
5293
 
5294
    /**
5295
     * Performs a deep copy on <i>other</i>.
5296
     */
5297
    public getAllPromotions_result(getAllPromotions_result other) {
5298
      if (other.isSetSuccess()) {
5299
        List<Promotion> __this__success = new ArrayList<Promotion>();
5300
        for (Promotion other_element : other.success) {
5301
          __this__success.add(new Promotion(other_element));
5302
        }
5303
        this.success = __this__success;
5304
      }
5305
      if (other.isSetPex()) {
5306
        this.pex = new PromotionException(other.pex);
5307
      }
5308
    }
5309
 
5310
    public getAllPromotions_result deepCopy() {
5311
      return new getAllPromotions_result(this);
5312
    }
5313
 
3430 rajveer 5314
    @Override
5315
    public void clear() {
5316
      this.success = null;
5317
      this.pex = null;
1982 varun.gupt 5318
    }
5319
 
5320
    public int getSuccessSize() {
5321
      return (this.success == null) ? 0 : this.success.size();
5322
    }
5323
 
5324
    public java.util.Iterator<Promotion> getSuccessIterator() {
5325
      return (this.success == null) ? null : this.success.iterator();
5326
    }
5327
 
5328
    public void addToSuccess(Promotion elem) {
5329
      if (this.success == null) {
5330
        this.success = new ArrayList<Promotion>();
5331
      }
5332
      this.success.add(elem);
5333
    }
5334
 
5335
    public List<Promotion> getSuccess() {
5336
      return this.success;
5337
    }
5338
 
3430 rajveer 5339
    public void setSuccess(List<Promotion> success) {
1982 varun.gupt 5340
      this.success = success;
5341
    }
5342
 
5343
    public void unsetSuccess() {
5344
      this.success = null;
5345
    }
5346
 
3430 rajveer 5347
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5348
    public boolean isSetSuccess() {
5349
      return this.success != null;
5350
    }
5351
 
5352
    public void setSuccessIsSet(boolean value) {
5353
      if (!value) {
5354
        this.success = null;
5355
      }
5356
    }
5357
 
5358
    public PromotionException getPex() {
5359
      return this.pex;
5360
    }
5361
 
3430 rajveer 5362
    public void setPex(PromotionException pex) {
1982 varun.gupt 5363
      this.pex = pex;
5364
    }
5365
 
5366
    public void unsetPex() {
5367
      this.pex = null;
5368
    }
5369
 
3430 rajveer 5370
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5371
    public boolean isSetPex() {
5372
      return this.pex != null;
5373
    }
5374
 
5375
    public void setPexIsSet(boolean value) {
5376
      if (!value) {
5377
        this.pex = null;
5378
      }
5379
    }
5380
 
5381
    public void setFieldValue(_Fields field, Object value) {
5382
      switch (field) {
5383
      case SUCCESS:
5384
        if (value == null) {
5385
          unsetSuccess();
5386
        } else {
5387
          setSuccess((List<Promotion>)value);
5388
        }
5389
        break;
5390
 
5391
      case PEX:
5392
        if (value == null) {
5393
          unsetPex();
5394
        } else {
5395
          setPex((PromotionException)value);
5396
        }
5397
        break;
5398
 
5399
      }
5400
    }
5401
 
5402
    public Object getFieldValue(_Fields field) {
5403
      switch (field) {
5404
      case SUCCESS:
5405
        return getSuccess();
5406
 
5407
      case PEX:
5408
        return getPex();
5409
 
5410
      }
5411
      throw new IllegalStateException();
5412
    }
5413
 
3430 rajveer 5414
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5415
    public boolean isSet(_Fields field) {
5416
      if (field == null) {
5417
        throw new IllegalArgumentException();
5418
      }
1982 varun.gupt 5419
 
5420
      switch (field) {
5421
      case SUCCESS:
5422
        return isSetSuccess();
5423
      case PEX:
5424
        return isSetPex();
5425
      }
5426
      throw new IllegalStateException();
5427
    }
5428
 
5429
    @Override
5430
    public boolean equals(Object that) {
5431
      if (that == null)
5432
        return false;
5433
      if (that instanceof getAllPromotions_result)
5434
        return this.equals((getAllPromotions_result)that);
5435
      return false;
5436
    }
5437
 
5438
    public boolean equals(getAllPromotions_result that) {
5439
      if (that == null)
5440
        return false;
5441
 
5442
      boolean this_present_success = true && this.isSetSuccess();
5443
      boolean that_present_success = true && that.isSetSuccess();
5444
      if (this_present_success || that_present_success) {
5445
        if (!(this_present_success && that_present_success))
5446
          return false;
5447
        if (!this.success.equals(that.success))
5448
          return false;
5449
      }
5450
 
5451
      boolean this_present_pex = true && this.isSetPex();
5452
      boolean that_present_pex = true && that.isSetPex();
5453
      if (this_present_pex || that_present_pex) {
5454
        if (!(this_present_pex && that_present_pex))
5455
          return false;
5456
        if (!this.pex.equals(that.pex))
5457
          return false;
5458
      }
5459
 
5460
      return true;
5461
    }
5462
 
5463
    @Override
5464
    public int hashCode() {
5465
      return 0;
5466
    }
5467
 
5468
    public int compareTo(getAllPromotions_result other) {
5469
      if (!getClass().equals(other.getClass())) {
5470
        return getClass().getName().compareTo(other.getClass().getName());
5471
      }
5472
 
5473
      int lastComparison = 0;
5474
      getAllPromotions_result typedOther = (getAllPromotions_result)other;
5475
 
3430 rajveer 5476
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 5477
      if (lastComparison != 0) {
5478
        return lastComparison;
5479
      }
3430 rajveer 5480
      if (isSetSuccess()) {
5481
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
5482
        if (lastComparison != 0) {
5483
          return lastComparison;
5484
        }
1982 varun.gupt 5485
      }
3430 rajveer 5486
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 5487
      if (lastComparison != 0) {
5488
        return lastComparison;
5489
      }
3430 rajveer 5490
      if (isSetPex()) {
5491
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
5492
        if (lastComparison != 0) {
5493
          return lastComparison;
5494
        }
1982 varun.gupt 5495
      }
5496
      return 0;
5497
    }
5498
 
3430 rajveer 5499
    public _Fields fieldForId(int fieldId) {
5500
      return _Fields.findByThriftId(fieldId);
5501
    }
5502
 
5503
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5504
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5505
      iprot.readStructBegin();
5506
      while (true)
5507
      {
5508
        field = iprot.readFieldBegin();
3430 rajveer 5509
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5510
          break;
5511
        }
3430 rajveer 5512
        switch (field.id) {
5513
          case 0: // SUCCESS
5514
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
5515
              {
5327 rajveer 5516
                org.apache.thrift.protocol.TList _list12 = iprot.readListBegin();
5517
                this.success = new ArrayList<Promotion>(_list12.size);
5518
                for (int _i13 = 0; _i13 < _list12.size; ++_i13)
1982 varun.gupt 5519
                {
5327 rajveer 5520
                  Promotion _elem14; // required
5521
                  _elem14 = new Promotion();
5522
                  _elem14.read(iprot);
5523
                  this.success.add(_elem14);
1982 varun.gupt 5524
                }
3430 rajveer 5525
                iprot.readListEnd();
1982 varun.gupt 5526
              }
3430 rajveer 5527
            } else { 
5528
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5529
            }
5530
            break;
5531
          case 1: // PEX
5532
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5533
              this.pex = new PromotionException();
5534
              this.pex.read(iprot);
5535
            } else { 
5536
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5537
            }
5538
            break;
5539
          default:
5540
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5541
        }
3430 rajveer 5542
        iprot.readFieldEnd();
1982 varun.gupt 5543
      }
5544
      iprot.readStructEnd();
5545
      validate();
5546
    }
5547
 
3430 rajveer 5548
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5549
      oprot.writeStructBegin(STRUCT_DESC);
5550
 
5551
      if (this.isSetSuccess()) {
5552
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
5553
        {
3430 rajveer 5554
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
5327 rajveer 5555
          for (Promotion _iter15 : this.success)
1982 varun.gupt 5556
          {
5327 rajveer 5557
            _iter15.write(oprot);
1982 varun.gupt 5558
          }
5559
          oprot.writeListEnd();
5560
        }
5561
        oprot.writeFieldEnd();
5562
      } else if (this.isSetPex()) {
5563
        oprot.writeFieldBegin(PEX_FIELD_DESC);
5564
        this.pex.write(oprot);
5565
        oprot.writeFieldEnd();
5566
      }
5567
      oprot.writeFieldStop();
5568
      oprot.writeStructEnd();
5569
    }
5570
 
5571
    @Override
5572
    public String toString() {
5573
      StringBuilder sb = new StringBuilder("getAllPromotions_result(");
5574
      boolean first = true;
5575
 
5576
      sb.append("success:");
5577
      if (this.success == null) {
5578
        sb.append("null");
5579
      } else {
5580
        sb.append(this.success);
5581
      }
5582
      first = false;
5583
      if (!first) sb.append(", ");
5584
      sb.append("pex:");
5585
      if (this.pex == null) {
5586
        sb.append("null");
5587
      } else {
5588
        sb.append(this.pex);
5589
      }
5590
      first = false;
5591
      sb.append(")");
5592
      return sb.toString();
5593
    }
5594
 
3430 rajveer 5595
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5596
      // check for required fields
5597
    }
5598
 
3430 rajveer 5599
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5600
      try {
5601
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5602
      } catch (org.apache.thrift.TException te) {
5603
        throw new java.io.IOException(te);
5604
      }
5605
    }
5606
 
5607
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5608
      try {
5609
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5610
      } catch (org.apache.thrift.TException te) {
5611
        throw new java.io.IOException(te);
5612
      }
5613
    }
5614
 
1982 varun.gupt 5615
  }
5616
 
3430 rajveer 5617
  public static class getPromotionById_args implements org.apache.thrift.TBase<getPromotionById_args, getPromotionById_args._Fields>, java.io.Serializable, Cloneable   {
5618
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_args");
1982 varun.gupt 5619
 
3430 rajveer 5620
    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 5621
 
3430 rajveer 5622
    private long promotionId; // required
1982 varun.gupt 5623
 
5624
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5625
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5626
      PROMOTION_ID((short)1, "promotionId");
5627
 
5628
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5629
 
5630
      static {
5631
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5632
          byName.put(field.getFieldName(), field);
5633
        }
5634
      }
5635
 
5636
      /**
5637
       * Find the _Fields constant that matches fieldId, or null if its not found.
5638
       */
5639
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5640
        switch(fieldId) {
5641
          case 1: // PROMOTION_ID
5642
            return PROMOTION_ID;
5643
          default:
5644
            return null;
5645
        }
1982 varun.gupt 5646
      }
5647
 
5648
      /**
5649
       * Find the _Fields constant that matches fieldId, throwing an exception
5650
       * if it is not found.
5651
       */
5652
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5653
        _Fields fields = findByThriftId(fieldId);
5654
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5655
        return fields;
5656
      }
5657
 
5658
      /**
5659
       * Find the _Fields constant that matches name, or null if its not found.
5660
       */
5661
      public static _Fields findByName(String name) {
5662
        return byName.get(name);
5663
      }
5664
 
5665
      private final short _thriftId;
5666
      private final String _fieldName;
5667
 
5668
      _Fields(short thriftId, String fieldName) {
5669
        _thriftId = thriftId;
5670
        _fieldName = fieldName;
5671
      }
5672
 
5673
      public short getThriftFieldId() {
5674
        return _thriftId;
5675
      }
5676
 
5677
      public String getFieldName() {
5678
        return _fieldName;
5679
      }
5680
    }
5681
 
5682
    // isset id assignments
5683
    private static final int __PROMOTIONID_ISSET_ID = 0;
5684
    private BitSet __isset_bit_vector = new BitSet(1);
5685
 
3430 rajveer 5686
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5687
    static {
3430 rajveer 5688
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5689
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5690
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
5691
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5692
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_args.class, metaDataMap);
1982 varun.gupt 5693
    }
5694
 
5695
    public getPromotionById_args() {
5696
    }
5697
 
5698
    public getPromotionById_args(
5699
      long promotionId)
5700
    {
5701
      this();
5702
      this.promotionId = promotionId;
5703
      setPromotionIdIsSet(true);
5704
    }
5705
 
5706
    /**
5707
     * Performs a deep copy on <i>other</i>.
5708
     */
5709
    public getPromotionById_args(getPromotionById_args other) {
5710
      __isset_bit_vector.clear();
5711
      __isset_bit_vector.or(other.__isset_bit_vector);
5712
      this.promotionId = other.promotionId;
5713
    }
5714
 
5715
    public getPromotionById_args deepCopy() {
5716
      return new getPromotionById_args(this);
5717
    }
5718
 
3430 rajveer 5719
    @Override
5720
    public void clear() {
5721
      setPromotionIdIsSet(false);
5722
      this.promotionId = 0;
1982 varun.gupt 5723
    }
5724
 
5725
    public long getPromotionId() {
5726
      return this.promotionId;
5727
    }
5728
 
3430 rajveer 5729
    public void setPromotionId(long promotionId) {
1982 varun.gupt 5730
      this.promotionId = promotionId;
5731
      setPromotionIdIsSet(true);
5732
    }
5733
 
5734
    public void unsetPromotionId() {
5735
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
5736
    }
5737
 
3430 rajveer 5738
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 5739
    public boolean isSetPromotionId() {
5740
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
5741
    }
5742
 
5743
    public void setPromotionIdIsSet(boolean value) {
5744
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
5745
    }
5746
 
5747
    public void setFieldValue(_Fields field, Object value) {
5748
      switch (field) {
5749
      case PROMOTION_ID:
5750
        if (value == null) {
5751
          unsetPromotionId();
5752
        } else {
5753
          setPromotionId((Long)value);
5754
        }
5755
        break;
5756
 
5757
      }
5758
    }
5759
 
5760
    public Object getFieldValue(_Fields field) {
5761
      switch (field) {
5762
      case PROMOTION_ID:
3430 rajveer 5763
        return Long.valueOf(getPromotionId());
1982 varun.gupt 5764
 
5765
      }
5766
      throw new IllegalStateException();
5767
    }
5768
 
3430 rajveer 5769
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5770
    public boolean isSet(_Fields field) {
5771
      if (field == null) {
5772
        throw new IllegalArgumentException();
5773
      }
1982 varun.gupt 5774
 
5775
      switch (field) {
5776
      case PROMOTION_ID:
5777
        return isSetPromotionId();
5778
      }
5779
      throw new IllegalStateException();
5780
    }
5781
 
5782
    @Override
5783
    public boolean equals(Object that) {
5784
      if (that == null)
5785
        return false;
5786
      if (that instanceof getPromotionById_args)
5787
        return this.equals((getPromotionById_args)that);
5788
      return false;
5789
    }
5790
 
5791
    public boolean equals(getPromotionById_args that) {
5792
      if (that == null)
5793
        return false;
5794
 
5795
      boolean this_present_promotionId = true;
5796
      boolean that_present_promotionId = true;
5797
      if (this_present_promotionId || that_present_promotionId) {
5798
        if (!(this_present_promotionId && that_present_promotionId))
5799
          return false;
5800
        if (this.promotionId != that.promotionId)
5801
          return false;
5802
      }
5803
 
5804
      return true;
5805
    }
5806
 
5807
    @Override
5808
    public int hashCode() {
5809
      return 0;
5810
    }
5811
 
5812
    public int compareTo(getPromotionById_args other) {
5813
      if (!getClass().equals(other.getClass())) {
5814
        return getClass().getName().compareTo(other.getClass().getName());
5815
      }
5816
 
5817
      int lastComparison = 0;
5818
      getPromotionById_args typedOther = (getPromotionById_args)other;
5819
 
3430 rajveer 5820
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 5821
      if (lastComparison != 0) {
5822
        return lastComparison;
5823
      }
3430 rajveer 5824
      if (isSetPromotionId()) {
5825
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
5826
        if (lastComparison != 0) {
5827
          return lastComparison;
5828
        }
1982 varun.gupt 5829
      }
5830
      return 0;
5831
    }
5832
 
3430 rajveer 5833
    public _Fields fieldForId(int fieldId) {
5834
      return _Fields.findByThriftId(fieldId);
5835
    }
5836
 
5837
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5838
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5839
      iprot.readStructBegin();
5840
      while (true)
5841
      {
5842
        field = iprot.readFieldBegin();
3430 rajveer 5843
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5844
          break;
5845
        }
3430 rajveer 5846
        switch (field.id) {
5847
          case 1: // PROMOTION_ID
5848
            if (field.type == org.apache.thrift.protocol.TType.I64) {
5849
              this.promotionId = iprot.readI64();
5850
              setPromotionIdIsSet(true);
5851
            } else { 
5852
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5853
            }
5854
            break;
5855
          default:
5856
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5857
        }
3430 rajveer 5858
        iprot.readFieldEnd();
1982 varun.gupt 5859
      }
5860
      iprot.readStructEnd();
5861
      validate();
5862
    }
5863
 
3430 rajveer 5864
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5865
      validate();
5866
 
5867
      oprot.writeStructBegin(STRUCT_DESC);
5868
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
5869
      oprot.writeI64(this.promotionId);
5870
      oprot.writeFieldEnd();
5871
      oprot.writeFieldStop();
5872
      oprot.writeStructEnd();
5873
    }
5874
 
5875
    @Override
5876
    public String toString() {
5877
      StringBuilder sb = new StringBuilder("getPromotionById_args(");
5878
      boolean first = true;
5879
 
5880
      sb.append("promotionId:");
5881
      sb.append(this.promotionId);
5882
      first = false;
5883
      sb.append(")");
5884
      return sb.toString();
5885
    }
5886
 
3430 rajveer 5887
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5888
      // check for required fields
5889
    }
5890
 
3430 rajveer 5891
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5892
      try {
5893
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5894
      } catch (org.apache.thrift.TException te) {
5895
        throw new java.io.IOException(te);
5896
      }
5897
    }
5898
 
5899
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5900
      try {
5901
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
5902
        __isset_bit_vector = new BitSet(1);
5903
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5904
      } catch (org.apache.thrift.TException te) {
5905
        throw new java.io.IOException(te);
5906
      }
5907
    }
5908
 
1982 varun.gupt 5909
  }
5910
 
3430 rajveer 5911
  public static class getPromotionById_result implements org.apache.thrift.TBase<getPromotionById_result, getPromotionById_result._Fields>, java.io.Serializable, Cloneable   {
5912
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_result");
1982 varun.gupt 5913
 
3430 rajveer 5914
    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);
5915
    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 5916
 
3430 rajveer 5917
    private Promotion success; // required
5918
    private PromotionException pex; // required
1982 varun.gupt 5919
 
5920
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5921
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5922
      SUCCESS((short)0, "success"),
5923
      PEX((short)1, "pex");
5924
 
5925
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5926
 
5927
      static {
5928
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5929
          byName.put(field.getFieldName(), field);
5930
        }
5931
      }
5932
 
5933
      /**
5934
       * Find the _Fields constant that matches fieldId, or null if its not found.
5935
       */
5936
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5937
        switch(fieldId) {
5938
          case 0: // SUCCESS
5939
            return SUCCESS;
5940
          case 1: // PEX
5941
            return PEX;
5942
          default:
5943
            return null;
5944
        }
1982 varun.gupt 5945
      }
5946
 
5947
      /**
5948
       * Find the _Fields constant that matches fieldId, throwing an exception
5949
       * if it is not found.
5950
       */
5951
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5952
        _Fields fields = findByThriftId(fieldId);
5953
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5954
        return fields;
5955
      }
5956
 
5957
      /**
5958
       * Find the _Fields constant that matches name, or null if its not found.
5959
       */
5960
      public static _Fields findByName(String name) {
5961
        return byName.get(name);
5962
      }
5963
 
5964
      private final short _thriftId;
5965
      private final String _fieldName;
5966
 
5967
      _Fields(short thriftId, String fieldName) {
5968
        _thriftId = thriftId;
5969
        _fieldName = fieldName;
5970
      }
5971
 
5972
      public short getThriftFieldId() {
5973
        return _thriftId;
5974
      }
5975
 
5976
      public String getFieldName() {
5977
        return _fieldName;
5978
      }
5979
    }
5980
 
5981
    // isset id assignments
5982
 
3430 rajveer 5983
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5984
    static {
3430 rajveer 5985
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5986
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5987
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class)));
5988
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5989
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
5990
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5991
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_result.class, metaDataMap);
1982 varun.gupt 5992
    }
5993
 
5994
    public getPromotionById_result() {
5995
    }
5996
 
5997
    public getPromotionById_result(
5998
      Promotion success,
5999
      PromotionException pex)
6000
    {
6001
      this();
6002
      this.success = success;
6003
      this.pex = pex;
6004
    }
6005
 
6006
    /**
6007
     * Performs a deep copy on <i>other</i>.
6008
     */
6009
    public getPromotionById_result(getPromotionById_result other) {
6010
      if (other.isSetSuccess()) {
6011
        this.success = new Promotion(other.success);
6012
      }
6013
      if (other.isSetPex()) {
6014
        this.pex = new PromotionException(other.pex);
6015
      }
6016
    }
6017
 
6018
    public getPromotionById_result deepCopy() {
6019
      return new getPromotionById_result(this);
6020
    }
6021
 
3430 rajveer 6022
    @Override
6023
    public void clear() {
6024
      this.success = null;
6025
      this.pex = null;
1982 varun.gupt 6026
    }
6027
 
6028
    public Promotion getSuccess() {
6029
      return this.success;
6030
    }
6031
 
3430 rajveer 6032
    public void setSuccess(Promotion success) {
1982 varun.gupt 6033
      this.success = success;
6034
    }
6035
 
6036
    public void unsetSuccess() {
6037
      this.success = null;
6038
    }
6039
 
3430 rajveer 6040
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6041
    public boolean isSetSuccess() {
6042
      return this.success != null;
6043
    }
6044
 
6045
    public void setSuccessIsSet(boolean value) {
6046
      if (!value) {
6047
        this.success = null;
6048
      }
6049
    }
6050
 
6051
    public PromotionException getPex() {
6052
      return this.pex;
6053
    }
6054
 
3430 rajveer 6055
    public void setPex(PromotionException pex) {
1982 varun.gupt 6056
      this.pex = pex;
6057
    }
6058
 
6059
    public void unsetPex() {
6060
      this.pex = null;
6061
    }
6062
 
3430 rajveer 6063
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6064
    public boolean isSetPex() {
6065
      return this.pex != null;
6066
    }
6067
 
6068
    public void setPexIsSet(boolean value) {
6069
      if (!value) {
6070
        this.pex = null;
6071
      }
6072
    }
6073
 
6074
    public void setFieldValue(_Fields field, Object value) {
6075
      switch (field) {
6076
      case SUCCESS:
6077
        if (value == null) {
6078
          unsetSuccess();
6079
        } else {
6080
          setSuccess((Promotion)value);
6081
        }
6082
        break;
6083
 
6084
      case PEX:
6085
        if (value == null) {
6086
          unsetPex();
6087
        } else {
6088
          setPex((PromotionException)value);
6089
        }
6090
        break;
6091
 
6092
      }
6093
    }
6094
 
6095
    public Object getFieldValue(_Fields field) {
6096
      switch (field) {
6097
      case SUCCESS:
6098
        return getSuccess();
6099
 
6100
      case PEX:
6101
        return getPex();
6102
 
6103
      }
6104
      throw new IllegalStateException();
6105
    }
6106
 
3430 rajveer 6107
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6108
    public boolean isSet(_Fields field) {
6109
      if (field == null) {
6110
        throw new IllegalArgumentException();
6111
      }
1982 varun.gupt 6112
 
6113
      switch (field) {
6114
      case SUCCESS:
6115
        return isSetSuccess();
6116
      case PEX:
6117
        return isSetPex();
6118
      }
6119
      throw new IllegalStateException();
6120
    }
6121
 
6122
    @Override
6123
    public boolean equals(Object that) {
6124
      if (that == null)
6125
        return false;
6126
      if (that instanceof getPromotionById_result)
6127
        return this.equals((getPromotionById_result)that);
6128
      return false;
6129
    }
6130
 
6131
    public boolean equals(getPromotionById_result that) {
6132
      if (that == null)
6133
        return false;
6134
 
6135
      boolean this_present_success = true && this.isSetSuccess();
6136
      boolean that_present_success = true && that.isSetSuccess();
6137
      if (this_present_success || that_present_success) {
6138
        if (!(this_present_success && that_present_success))
6139
          return false;
6140
        if (!this.success.equals(that.success))
6141
          return false;
6142
      }
6143
 
6144
      boolean this_present_pex = true && this.isSetPex();
6145
      boolean that_present_pex = true && that.isSetPex();
6146
      if (this_present_pex || that_present_pex) {
6147
        if (!(this_present_pex && that_present_pex))
6148
          return false;
6149
        if (!this.pex.equals(that.pex))
6150
          return false;
6151
      }
6152
 
6153
      return true;
6154
    }
6155
 
6156
    @Override
6157
    public int hashCode() {
6158
      return 0;
6159
    }
6160
 
6161
    public int compareTo(getPromotionById_result other) {
6162
      if (!getClass().equals(other.getClass())) {
6163
        return getClass().getName().compareTo(other.getClass().getName());
6164
      }
6165
 
6166
      int lastComparison = 0;
6167
      getPromotionById_result typedOther = (getPromotionById_result)other;
6168
 
3430 rajveer 6169
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 6170
      if (lastComparison != 0) {
6171
        return lastComparison;
6172
      }
3430 rajveer 6173
      if (isSetSuccess()) {
6174
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
6175
        if (lastComparison != 0) {
6176
          return lastComparison;
6177
        }
1982 varun.gupt 6178
      }
3430 rajveer 6179
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 6180
      if (lastComparison != 0) {
6181
        return lastComparison;
6182
      }
3430 rajveer 6183
      if (isSetPex()) {
6184
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
6185
        if (lastComparison != 0) {
6186
          return lastComparison;
6187
        }
1982 varun.gupt 6188
      }
6189
      return 0;
6190
    }
6191
 
3430 rajveer 6192
    public _Fields fieldForId(int fieldId) {
6193
      return _Fields.findByThriftId(fieldId);
6194
    }
6195
 
6196
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6197
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6198
      iprot.readStructBegin();
6199
      while (true)
6200
      {
6201
        field = iprot.readFieldBegin();
3430 rajveer 6202
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6203
          break;
6204
        }
3430 rajveer 6205
        switch (field.id) {
6206
          case 0: // SUCCESS
6207
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6208
              this.success = new Promotion();
6209
              this.success.read(iprot);
6210
            } else { 
6211
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6212
            }
6213
            break;
6214
          case 1: // PEX
6215
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6216
              this.pex = new PromotionException();
6217
              this.pex.read(iprot);
6218
            } else { 
6219
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6220
            }
6221
            break;
6222
          default:
6223
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6224
        }
3430 rajveer 6225
        iprot.readFieldEnd();
1982 varun.gupt 6226
      }
6227
      iprot.readStructEnd();
6228
      validate();
6229
    }
6230
 
3430 rajveer 6231
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6232
      oprot.writeStructBegin(STRUCT_DESC);
6233
 
6234
      if (this.isSetSuccess()) {
6235
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
6236
        this.success.write(oprot);
6237
        oprot.writeFieldEnd();
6238
      } else if (this.isSetPex()) {
6239
        oprot.writeFieldBegin(PEX_FIELD_DESC);
6240
        this.pex.write(oprot);
6241
        oprot.writeFieldEnd();
6242
      }
6243
      oprot.writeFieldStop();
6244
      oprot.writeStructEnd();
6245
    }
6246
 
6247
    @Override
6248
    public String toString() {
6249
      StringBuilder sb = new StringBuilder("getPromotionById_result(");
6250
      boolean first = true;
6251
 
6252
      sb.append("success:");
6253
      if (this.success == null) {
6254
        sb.append("null");
6255
      } else {
6256
        sb.append(this.success);
6257
      }
6258
      first = false;
6259
      if (!first) sb.append(", ");
6260
      sb.append("pex:");
6261
      if (this.pex == null) {
6262
        sb.append("null");
6263
      } else {
6264
        sb.append(this.pex);
6265
      }
6266
      first = false;
6267
      sb.append(")");
6268
      return sb.toString();
6269
    }
6270
 
3430 rajveer 6271
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6272
      // check for required fields
6273
    }
6274
 
3430 rajveer 6275
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6276
      try {
6277
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6278
      } catch (org.apache.thrift.TException te) {
6279
        throw new java.io.IOException(te);
6280
      }
6281
    }
6282
 
6283
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6284
      try {
6285
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6286
      } catch (org.apache.thrift.TException te) {
6287
        throw new java.io.IOException(te);
6288
      }
6289
    }
6290
 
1982 varun.gupt 6291
  }
6292
 
3430 rajveer 6293
  public static class generateCouponsForPromotion_args implements org.apache.thrift.TBase<generateCouponsForPromotion_args, generateCouponsForPromotion_args._Fields>, java.io.Serializable, Cloneable   {
6294
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_args");
1982 varun.gupt 6295
 
3430 rajveer 6296
    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);
6297
    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 6298
 
3430 rajveer 6299
    private long promotionId; // required
6300
    private String couponCode; // required
1982 varun.gupt 6301
 
6302
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6303
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6304
      PROMOTION_ID((short)1, "promotionId"),
6305
      COUPON_CODE((short)2, "couponCode");
6306
 
6307
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6308
 
6309
      static {
6310
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6311
          byName.put(field.getFieldName(), field);
6312
        }
6313
      }
6314
 
6315
      /**
6316
       * Find the _Fields constant that matches fieldId, or null if its not found.
6317
       */
6318
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6319
        switch(fieldId) {
6320
          case 1: // PROMOTION_ID
6321
            return PROMOTION_ID;
6322
          case 2: // COUPON_CODE
6323
            return COUPON_CODE;
6324
          default:
6325
            return null;
6326
        }
1982 varun.gupt 6327
      }
6328
 
6329
      /**
6330
       * Find the _Fields constant that matches fieldId, throwing an exception
6331
       * if it is not found.
6332
       */
6333
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6334
        _Fields fields = findByThriftId(fieldId);
6335
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6336
        return fields;
6337
      }
6338
 
6339
      /**
6340
       * Find the _Fields constant that matches name, or null if its not found.
6341
       */
6342
      public static _Fields findByName(String name) {
6343
        return byName.get(name);
6344
      }
6345
 
6346
      private final short _thriftId;
6347
      private final String _fieldName;
6348
 
6349
      _Fields(short thriftId, String fieldName) {
6350
        _thriftId = thriftId;
6351
        _fieldName = fieldName;
6352
      }
6353
 
6354
      public short getThriftFieldId() {
6355
        return _thriftId;
6356
      }
6357
 
6358
      public String getFieldName() {
6359
        return _fieldName;
6360
      }
6361
    }
6362
 
6363
    // isset id assignments
6364
    private static final int __PROMOTIONID_ISSET_ID = 0;
6365
    private BitSet __isset_bit_vector = new BitSet(1);
6366
 
3430 rajveer 6367
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6368
    static {
3430 rajveer 6369
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6370
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6371
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6372
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6373
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6374
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6375
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_args.class, metaDataMap);
1982 varun.gupt 6376
    }
6377
 
6378
    public generateCouponsForPromotion_args() {
6379
    }
6380
 
6381
    public generateCouponsForPromotion_args(
6382
      long promotionId,
6383
      String couponCode)
6384
    {
6385
      this();
6386
      this.promotionId = promotionId;
6387
      setPromotionIdIsSet(true);
6388
      this.couponCode = couponCode;
6389
    }
6390
 
6391
    /**
6392
     * Performs a deep copy on <i>other</i>.
6393
     */
6394
    public generateCouponsForPromotion_args(generateCouponsForPromotion_args other) {
6395
      __isset_bit_vector.clear();
6396
      __isset_bit_vector.or(other.__isset_bit_vector);
6397
      this.promotionId = other.promotionId;
6398
      if (other.isSetCouponCode()) {
6399
        this.couponCode = other.couponCode;
6400
      }
6401
    }
6402
 
6403
    public generateCouponsForPromotion_args deepCopy() {
6404
      return new generateCouponsForPromotion_args(this);
6405
    }
6406
 
3430 rajveer 6407
    @Override
6408
    public void clear() {
6409
      setPromotionIdIsSet(false);
6410
      this.promotionId = 0;
6411
      this.couponCode = null;
1982 varun.gupt 6412
    }
6413
 
6414
    public long getPromotionId() {
6415
      return this.promotionId;
6416
    }
6417
 
3430 rajveer 6418
    public void setPromotionId(long promotionId) {
1982 varun.gupt 6419
      this.promotionId = promotionId;
6420
      setPromotionIdIsSet(true);
6421
    }
6422
 
6423
    public void unsetPromotionId() {
6424
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
6425
    }
6426
 
3430 rajveer 6427
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6428
    public boolean isSetPromotionId() {
6429
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
6430
    }
6431
 
6432
    public void setPromotionIdIsSet(boolean value) {
6433
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
6434
    }
6435
 
6436
    public String getCouponCode() {
6437
      return this.couponCode;
6438
    }
6439
 
3430 rajveer 6440
    public void setCouponCode(String couponCode) {
1982 varun.gupt 6441
      this.couponCode = couponCode;
6442
    }
6443
 
6444
    public void unsetCouponCode() {
6445
      this.couponCode = null;
6446
    }
6447
 
3430 rajveer 6448
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6449
    public boolean isSetCouponCode() {
6450
      return this.couponCode != null;
6451
    }
6452
 
6453
    public void setCouponCodeIsSet(boolean value) {
6454
      if (!value) {
6455
        this.couponCode = null;
6456
      }
6457
    }
6458
 
6459
    public void setFieldValue(_Fields field, Object value) {
6460
      switch (field) {
6461
      case PROMOTION_ID:
6462
        if (value == null) {
6463
          unsetPromotionId();
6464
        } else {
6465
          setPromotionId((Long)value);
6466
        }
6467
        break;
6468
 
6469
      case COUPON_CODE:
6470
        if (value == null) {
6471
          unsetCouponCode();
6472
        } else {
6473
          setCouponCode((String)value);
6474
        }
6475
        break;
6476
 
6477
      }
6478
    }
6479
 
6480
    public Object getFieldValue(_Fields field) {
6481
      switch (field) {
6482
      case PROMOTION_ID:
3430 rajveer 6483
        return Long.valueOf(getPromotionId());
1982 varun.gupt 6484
 
6485
      case COUPON_CODE:
6486
        return getCouponCode();
6487
 
6488
      }
6489
      throw new IllegalStateException();
6490
    }
6491
 
3430 rajveer 6492
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6493
    public boolean isSet(_Fields field) {
6494
      if (field == null) {
6495
        throw new IllegalArgumentException();
6496
      }
1982 varun.gupt 6497
 
6498
      switch (field) {
6499
      case PROMOTION_ID:
6500
        return isSetPromotionId();
6501
      case COUPON_CODE:
6502
        return isSetCouponCode();
6503
      }
6504
      throw new IllegalStateException();
6505
    }
6506
 
6507
    @Override
6508
    public boolean equals(Object that) {
6509
      if (that == null)
6510
        return false;
6511
      if (that instanceof generateCouponsForPromotion_args)
6512
        return this.equals((generateCouponsForPromotion_args)that);
6513
      return false;
6514
    }
6515
 
6516
    public boolean equals(generateCouponsForPromotion_args that) {
6517
      if (that == null)
6518
        return false;
6519
 
6520
      boolean this_present_promotionId = true;
6521
      boolean that_present_promotionId = true;
6522
      if (this_present_promotionId || that_present_promotionId) {
6523
        if (!(this_present_promotionId && that_present_promotionId))
6524
          return false;
6525
        if (this.promotionId != that.promotionId)
6526
          return false;
6527
      }
6528
 
6529
      boolean this_present_couponCode = true && this.isSetCouponCode();
6530
      boolean that_present_couponCode = true && that.isSetCouponCode();
6531
      if (this_present_couponCode || that_present_couponCode) {
6532
        if (!(this_present_couponCode && that_present_couponCode))
6533
          return false;
6534
        if (!this.couponCode.equals(that.couponCode))
6535
          return false;
6536
      }
6537
 
6538
      return true;
6539
    }
6540
 
6541
    @Override
6542
    public int hashCode() {
6543
      return 0;
6544
    }
6545
 
6546
    public int compareTo(generateCouponsForPromotion_args other) {
6547
      if (!getClass().equals(other.getClass())) {
6548
        return getClass().getName().compareTo(other.getClass().getName());
6549
      }
6550
 
6551
      int lastComparison = 0;
6552
      generateCouponsForPromotion_args typedOther = (generateCouponsForPromotion_args)other;
6553
 
3430 rajveer 6554
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 6555
      if (lastComparison != 0) {
6556
        return lastComparison;
6557
      }
3430 rajveer 6558
      if (isSetPromotionId()) {
6559
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
6560
        if (lastComparison != 0) {
6561
          return lastComparison;
6562
        }
1982 varun.gupt 6563
      }
3430 rajveer 6564
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 6565
      if (lastComparison != 0) {
6566
        return lastComparison;
6567
      }
3430 rajveer 6568
      if (isSetCouponCode()) {
6569
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
6570
        if (lastComparison != 0) {
6571
          return lastComparison;
6572
        }
1982 varun.gupt 6573
      }
6574
      return 0;
6575
    }
6576
 
3430 rajveer 6577
    public _Fields fieldForId(int fieldId) {
6578
      return _Fields.findByThriftId(fieldId);
6579
    }
6580
 
6581
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6582
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6583
      iprot.readStructBegin();
6584
      while (true)
6585
      {
6586
        field = iprot.readFieldBegin();
3430 rajveer 6587
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6588
          break;
6589
        }
3430 rajveer 6590
        switch (field.id) {
6591
          case 1: // PROMOTION_ID
6592
            if (field.type == org.apache.thrift.protocol.TType.I64) {
6593
              this.promotionId = iprot.readI64();
6594
              setPromotionIdIsSet(true);
6595
            } else { 
6596
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6597
            }
6598
            break;
6599
          case 2: // COUPON_CODE
6600
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
6601
              this.couponCode = iprot.readString();
6602
            } else { 
6603
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6604
            }
6605
            break;
6606
          default:
6607
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6608
        }
3430 rajveer 6609
        iprot.readFieldEnd();
1982 varun.gupt 6610
      }
6611
      iprot.readStructEnd();
6612
      validate();
6613
    }
6614
 
3430 rajveer 6615
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6616
      validate();
6617
 
6618
      oprot.writeStructBegin(STRUCT_DESC);
6619
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
6620
      oprot.writeI64(this.promotionId);
6621
      oprot.writeFieldEnd();
6622
      if (this.couponCode != null) {
6623
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
6624
        oprot.writeString(this.couponCode);
6625
        oprot.writeFieldEnd();
6626
      }
6627
      oprot.writeFieldStop();
6628
      oprot.writeStructEnd();
6629
    }
6630
 
6631
    @Override
6632
    public String toString() {
6633
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_args(");
6634
      boolean first = true;
6635
 
6636
      sb.append("promotionId:");
6637
      sb.append(this.promotionId);
6638
      first = false;
6639
      if (!first) sb.append(", ");
6640
      sb.append("couponCode:");
6641
      if (this.couponCode == null) {
6642
        sb.append("null");
6643
      } else {
6644
        sb.append(this.couponCode);
6645
      }
6646
      first = false;
6647
      sb.append(")");
6648
      return sb.toString();
6649
    }
6650
 
3430 rajveer 6651
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6652
      // check for required fields
6653
    }
6654
 
3430 rajveer 6655
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6656
      try {
6657
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6658
      } catch (org.apache.thrift.TException te) {
6659
        throw new java.io.IOException(te);
6660
      }
6661
    }
6662
 
6663
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6664
      try {
6665
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
6666
        __isset_bit_vector = new BitSet(1);
6667
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6668
      } catch (org.apache.thrift.TException te) {
6669
        throw new java.io.IOException(te);
6670
      }
6671
    }
6672
 
1982 varun.gupt 6673
  }
6674
 
3430 rajveer 6675
  public static class generateCouponsForPromotion_result implements org.apache.thrift.TBase<generateCouponsForPromotion_result, generateCouponsForPromotion_result._Fields>, java.io.Serializable, Cloneable   {
6676
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_result");
1982 varun.gupt 6677
 
3430 rajveer 6678
    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 6679
 
3430 rajveer 6680
    private PromotionException pex; // required
1982 varun.gupt 6681
 
6682
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6683
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6684
      PEX((short)1, "pex");
6685
 
6686
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6687
 
6688
      static {
6689
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6690
          byName.put(field.getFieldName(), field);
6691
        }
6692
      }
6693
 
6694
      /**
6695
       * Find the _Fields constant that matches fieldId, or null if its not found.
6696
       */
6697
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6698
        switch(fieldId) {
6699
          case 1: // PEX
6700
            return PEX;
6701
          default:
6702
            return null;
6703
        }
1982 varun.gupt 6704
      }
6705
 
6706
      /**
6707
       * Find the _Fields constant that matches fieldId, throwing an exception
6708
       * if it is not found.
6709
       */
6710
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6711
        _Fields fields = findByThriftId(fieldId);
6712
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6713
        return fields;
6714
      }
6715
 
6716
      /**
6717
       * Find the _Fields constant that matches name, or null if its not found.
6718
       */
6719
      public static _Fields findByName(String name) {
6720
        return byName.get(name);
6721
      }
6722
 
6723
      private final short _thriftId;
6724
      private final String _fieldName;
6725
 
6726
      _Fields(short thriftId, String fieldName) {
6727
        _thriftId = thriftId;
6728
        _fieldName = fieldName;
6729
      }
6730
 
6731
      public short getThriftFieldId() {
6732
        return _thriftId;
6733
      }
6734
 
6735
      public String getFieldName() {
6736
        return _fieldName;
6737
      }
6738
    }
6739
 
6740
    // isset id assignments
6741
 
3430 rajveer 6742
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6743
    static {
3430 rajveer 6744
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6745
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6746
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
6747
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6748
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_result.class, metaDataMap);
1982 varun.gupt 6749
    }
6750
 
6751
    public generateCouponsForPromotion_result() {
6752
    }
6753
 
6754
    public generateCouponsForPromotion_result(
6755
      PromotionException pex)
6756
    {
6757
      this();
6758
      this.pex = pex;
6759
    }
6760
 
6761
    /**
6762
     * Performs a deep copy on <i>other</i>.
6763
     */
6764
    public generateCouponsForPromotion_result(generateCouponsForPromotion_result other) {
6765
      if (other.isSetPex()) {
6766
        this.pex = new PromotionException(other.pex);
6767
      }
6768
    }
6769
 
6770
    public generateCouponsForPromotion_result deepCopy() {
6771
      return new generateCouponsForPromotion_result(this);
6772
    }
6773
 
3430 rajveer 6774
    @Override
6775
    public void clear() {
6776
      this.pex = null;
1982 varun.gupt 6777
    }
6778
 
6779
    public PromotionException getPex() {
6780
      return this.pex;
6781
    }
6782
 
3430 rajveer 6783
    public void setPex(PromotionException pex) {
1982 varun.gupt 6784
      this.pex = pex;
6785
    }
6786
 
6787
    public void unsetPex() {
6788
      this.pex = null;
6789
    }
6790
 
3430 rajveer 6791
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6792
    public boolean isSetPex() {
6793
      return this.pex != null;
6794
    }
6795
 
6796
    public void setPexIsSet(boolean value) {
6797
      if (!value) {
6798
        this.pex = null;
6799
      }
6800
    }
6801
 
6802
    public void setFieldValue(_Fields field, Object value) {
6803
      switch (field) {
6804
      case PEX:
6805
        if (value == null) {
6806
          unsetPex();
6807
        } else {
6808
          setPex((PromotionException)value);
6809
        }
6810
        break;
6811
 
6812
      }
6813
    }
6814
 
6815
    public Object getFieldValue(_Fields field) {
6816
      switch (field) {
6817
      case PEX:
6818
        return getPex();
6819
 
6820
      }
6821
      throw new IllegalStateException();
6822
    }
6823
 
3430 rajveer 6824
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6825
    public boolean isSet(_Fields field) {
6826
      if (field == null) {
6827
        throw new IllegalArgumentException();
6828
      }
1982 varun.gupt 6829
 
6830
      switch (field) {
6831
      case PEX:
6832
        return isSetPex();
6833
      }
6834
      throw new IllegalStateException();
6835
    }
6836
 
6837
    @Override
6838
    public boolean equals(Object that) {
6839
      if (that == null)
6840
        return false;
6841
      if (that instanceof generateCouponsForPromotion_result)
6842
        return this.equals((generateCouponsForPromotion_result)that);
6843
      return false;
6844
    }
6845
 
6846
    public boolean equals(generateCouponsForPromotion_result that) {
6847
      if (that == null)
6848
        return false;
6849
 
6850
      boolean this_present_pex = true && this.isSetPex();
6851
      boolean that_present_pex = true && that.isSetPex();
6852
      if (this_present_pex || that_present_pex) {
6853
        if (!(this_present_pex && that_present_pex))
6854
          return false;
6855
        if (!this.pex.equals(that.pex))
6856
          return false;
6857
      }
6858
 
6859
      return true;
6860
    }
6861
 
6862
    @Override
6863
    public int hashCode() {
6864
      return 0;
6865
    }
6866
 
6867
    public int compareTo(generateCouponsForPromotion_result other) {
6868
      if (!getClass().equals(other.getClass())) {
6869
        return getClass().getName().compareTo(other.getClass().getName());
6870
      }
6871
 
6872
      int lastComparison = 0;
6873
      generateCouponsForPromotion_result typedOther = (generateCouponsForPromotion_result)other;
6874
 
3430 rajveer 6875
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 6876
      if (lastComparison != 0) {
6877
        return lastComparison;
6878
      }
3430 rajveer 6879
      if (isSetPex()) {
6880
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
6881
        if (lastComparison != 0) {
6882
          return lastComparison;
6883
        }
1982 varun.gupt 6884
      }
6885
      return 0;
6886
    }
6887
 
3430 rajveer 6888
    public _Fields fieldForId(int fieldId) {
6889
      return _Fields.findByThriftId(fieldId);
6890
    }
6891
 
6892
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6893
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6894
      iprot.readStructBegin();
6895
      while (true)
6896
      {
6897
        field = iprot.readFieldBegin();
3430 rajveer 6898
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6899
          break;
6900
        }
3430 rajveer 6901
        switch (field.id) {
6902
          case 1: // PEX
6903
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6904
              this.pex = new PromotionException();
6905
              this.pex.read(iprot);
6906
            } else { 
6907
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6908
            }
6909
            break;
6910
          default:
6911
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6912
        }
3430 rajveer 6913
        iprot.readFieldEnd();
1982 varun.gupt 6914
      }
6915
      iprot.readStructEnd();
6916
      validate();
6917
    }
6918
 
3430 rajveer 6919
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6920
      oprot.writeStructBegin(STRUCT_DESC);
6921
 
6922
      if (this.isSetPex()) {
6923
        oprot.writeFieldBegin(PEX_FIELD_DESC);
6924
        this.pex.write(oprot);
6925
        oprot.writeFieldEnd();
6926
      }
6927
      oprot.writeFieldStop();
6928
      oprot.writeStructEnd();
6929
    }
6930
 
6931
    @Override
6932
    public String toString() {
6933
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_result(");
6934
      boolean first = true;
6935
 
6936
      sb.append("pex:");
6937
      if (this.pex == null) {
6938
        sb.append("null");
6939
      } else {
6940
        sb.append(this.pex);
6941
      }
6942
      first = false;
6943
      sb.append(")");
6944
      return sb.toString();
6945
    }
6946
 
3430 rajveer 6947
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6948
      // check for required fields
6949
    }
6950
 
3430 rajveer 6951
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6952
      try {
6953
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6954
      } catch (org.apache.thrift.TException te) {
6955
        throw new java.io.IOException(te);
6956
      }
6957
    }
6958
 
6959
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6960
      try {
6961
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6962
      } catch (org.apache.thrift.TException te) {
6963
        throw new java.io.IOException(te);
6964
      }
6965
    }
6966
 
1982 varun.gupt 6967
  }
6968
 
3430 rajveer 6969
  public static class applyCoupon_args implements org.apache.thrift.TBase<applyCoupon_args, applyCoupon_args._Fields>, java.io.Serializable, Cloneable   {
6970
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_args");
1982 varun.gupt 6971
 
3430 rajveer 6972
    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);
6973
    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 6974
 
3430 rajveer 6975
    private String couponCode; // required
6976
    private long cartId; // required
1982 varun.gupt 6977
 
6978
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6979
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6980
      COUPON_CODE((short)1, "couponCode"),
6981
      CART_ID((short)2, "cartId");
6982
 
6983
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6984
 
6985
      static {
6986
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6987
          byName.put(field.getFieldName(), field);
6988
        }
6989
      }
6990
 
6991
      /**
6992
       * Find the _Fields constant that matches fieldId, or null if its not found.
6993
       */
6994
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6995
        switch(fieldId) {
6996
          case 1: // COUPON_CODE
6997
            return COUPON_CODE;
6998
          case 2: // CART_ID
6999
            return CART_ID;
7000
          default:
7001
            return null;
7002
        }
1982 varun.gupt 7003
      }
7004
 
7005
      /**
7006
       * Find the _Fields constant that matches fieldId, throwing an exception
7007
       * if it is not found.
7008
       */
7009
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7010
        _Fields fields = findByThriftId(fieldId);
7011
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7012
        return fields;
7013
      }
7014
 
7015
      /**
7016
       * Find the _Fields constant that matches name, or null if its not found.
7017
       */
7018
      public static _Fields findByName(String name) {
7019
        return byName.get(name);
7020
      }
7021
 
7022
      private final short _thriftId;
7023
      private final String _fieldName;
7024
 
7025
      _Fields(short thriftId, String fieldName) {
7026
        _thriftId = thriftId;
7027
        _fieldName = fieldName;
7028
      }
7029
 
7030
      public short getThriftFieldId() {
7031
        return _thriftId;
7032
      }
7033
 
7034
      public String getFieldName() {
7035
        return _fieldName;
7036
      }
7037
    }
7038
 
7039
    // isset id assignments
7040
    private static final int __CARTID_ISSET_ID = 0;
7041
    private BitSet __isset_bit_vector = new BitSet(1);
7042
 
3430 rajveer 7043
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 7044
    static {
3430 rajveer 7045
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7046
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7047
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
7048
      tmpMap.put(_Fields.CART_ID, new org.apache.thrift.meta_data.FieldMetaData("cartId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7049
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7050
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7051
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_args.class, metaDataMap);
1982 varun.gupt 7052
    }
7053
 
7054
    public applyCoupon_args() {
7055
    }
7056
 
7057
    public applyCoupon_args(
7058
      String couponCode,
7059
      long cartId)
7060
    {
7061
      this();
7062
      this.couponCode = couponCode;
7063
      this.cartId = cartId;
7064
      setCartIdIsSet(true);
7065
    }
7066
 
7067
    /**
7068
     * Performs a deep copy on <i>other</i>.
7069
     */
7070
    public applyCoupon_args(applyCoupon_args other) {
7071
      __isset_bit_vector.clear();
7072
      __isset_bit_vector.or(other.__isset_bit_vector);
7073
      if (other.isSetCouponCode()) {
7074
        this.couponCode = other.couponCode;
7075
      }
7076
      this.cartId = other.cartId;
7077
    }
7078
 
7079
    public applyCoupon_args deepCopy() {
7080
      return new applyCoupon_args(this);
7081
    }
7082
 
3430 rajveer 7083
    @Override
7084
    public void clear() {
7085
      this.couponCode = null;
7086
      setCartIdIsSet(false);
7087
      this.cartId = 0;
1982 varun.gupt 7088
    }
7089
 
7090
    public String getCouponCode() {
7091
      return this.couponCode;
7092
    }
7093
 
3430 rajveer 7094
    public void setCouponCode(String couponCode) {
1982 varun.gupt 7095
      this.couponCode = couponCode;
7096
    }
7097
 
7098
    public void unsetCouponCode() {
7099
      this.couponCode = null;
7100
    }
7101
 
3430 rajveer 7102
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7103
    public boolean isSetCouponCode() {
7104
      return this.couponCode != null;
7105
    }
7106
 
7107
    public void setCouponCodeIsSet(boolean value) {
7108
      if (!value) {
7109
        this.couponCode = null;
7110
      }
7111
    }
7112
 
7113
    public long getCartId() {
7114
      return this.cartId;
7115
    }
7116
 
3430 rajveer 7117
    public void setCartId(long cartId) {
1982 varun.gupt 7118
      this.cartId = cartId;
7119
      setCartIdIsSet(true);
7120
    }
7121
 
7122
    public void unsetCartId() {
7123
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
7124
    }
7125
 
3430 rajveer 7126
    /** Returns true if field cartId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7127
    public boolean isSetCartId() {
7128
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
7129
    }
7130
 
7131
    public void setCartIdIsSet(boolean value) {
7132
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
7133
    }
7134
 
7135
    public void setFieldValue(_Fields field, Object value) {
7136
      switch (field) {
7137
      case COUPON_CODE:
7138
        if (value == null) {
7139
          unsetCouponCode();
7140
        } else {
7141
          setCouponCode((String)value);
7142
        }
7143
        break;
7144
 
7145
      case CART_ID:
7146
        if (value == null) {
7147
          unsetCartId();
7148
        } else {
7149
          setCartId((Long)value);
7150
        }
7151
        break;
7152
 
7153
      }
7154
    }
7155
 
7156
    public Object getFieldValue(_Fields field) {
7157
      switch (field) {
7158
      case COUPON_CODE:
7159
        return getCouponCode();
7160
 
7161
      case CART_ID:
3430 rajveer 7162
        return Long.valueOf(getCartId());
1982 varun.gupt 7163
 
7164
      }
7165
      throw new IllegalStateException();
7166
    }
7167
 
3430 rajveer 7168
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7169
    public boolean isSet(_Fields field) {
7170
      if (field == null) {
7171
        throw new IllegalArgumentException();
7172
      }
1982 varun.gupt 7173
 
7174
      switch (field) {
7175
      case COUPON_CODE:
7176
        return isSetCouponCode();
7177
      case CART_ID:
7178
        return isSetCartId();
7179
      }
7180
      throw new IllegalStateException();
7181
    }
7182
 
7183
    @Override
7184
    public boolean equals(Object that) {
7185
      if (that == null)
7186
        return false;
7187
      if (that instanceof applyCoupon_args)
7188
        return this.equals((applyCoupon_args)that);
7189
      return false;
7190
    }
7191
 
7192
    public boolean equals(applyCoupon_args that) {
7193
      if (that == null)
7194
        return false;
7195
 
7196
      boolean this_present_couponCode = true && this.isSetCouponCode();
7197
      boolean that_present_couponCode = true && that.isSetCouponCode();
7198
      if (this_present_couponCode || that_present_couponCode) {
7199
        if (!(this_present_couponCode && that_present_couponCode))
7200
          return false;
7201
        if (!this.couponCode.equals(that.couponCode))
7202
          return false;
7203
      }
7204
 
7205
      boolean this_present_cartId = true;
7206
      boolean that_present_cartId = true;
7207
      if (this_present_cartId || that_present_cartId) {
7208
        if (!(this_present_cartId && that_present_cartId))
7209
          return false;
7210
        if (this.cartId != that.cartId)
7211
          return false;
7212
      }
7213
 
7214
      return true;
7215
    }
7216
 
7217
    @Override
7218
    public int hashCode() {
7219
      return 0;
7220
    }
7221
 
7222
    public int compareTo(applyCoupon_args other) {
7223
      if (!getClass().equals(other.getClass())) {
7224
        return getClass().getName().compareTo(other.getClass().getName());
7225
      }
7226
 
7227
      int lastComparison = 0;
7228
      applyCoupon_args typedOther = (applyCoupon_args)other;
7229
 
3430 rajveer 7230
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 7231
      if (lastComparison != 0) {
7232
        return lastComparison;
7233
      }
3430 rajveer 7234
      if (isSetCouponCode()) {
7235
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
7236
        if (lastComparison != 0) {
7237
          return lastComparison;
7238
        }
1982 varun.gupt 7239
      }
3430 rajveer 7240
      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(typedOther.isSetCartId());
1982 varun.gupt 7241
      if (lastComparison != 0) {
7242
        return lastComparison;
7243
      }
3430 rajveer 7244
      if (isSetCartId()) {
7245
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cartId, typedOther.cartId);
7246
        if (lastComparison != 0) {
7247
          return lastComparison;
7248
        }
1982 varun.gupt 7249
      }
7250
      return 0;
7251
    }
7252
 
3430 rajveer 7253
    public _Fields fieldForId(int fieldId) {
7254
      return _Fields.findByThriftId(fieldId);
7255
    }
7256
 
7257
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7258
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 7259
      iprot.readStructBegin();
7260
      while (true)
7261
      {
7262
        field = iprot.readFieldBegin();
3430 rajveer 7263
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 7264
          break;
7265
        }
3430 rajveer 7266
        switch (field.id) {
7267
          case 1: // COUPON_CODE
7268
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
7269
              this.couponCode = iprot.readString();
7270
            } else { 
7271
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7272
            }
7273
            break;
7274
          case 2: // CART_ID
7275
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7276
              this.cartId = iprot.readI64();
7277
              setCartIdIsSet(true);
7278
            } else { 
7279
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7280
            }
7281
            break;
7282
          default:
7283
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 7284
        }
3430 rajveer 7285
        iprot.readFieldEnd();
1982 varun.gupt 7286
      }
7287
      iprot.readStructEnd();
7288
      validate();
7289
    }
7290
 
3430 rajveer 7291
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 7292
      validate();
7293
 
7294
      oprot.writeStructBegin(STRUCT_DESC);
7295
      if (this.couponCode != null) {
7296
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
7297
        oprot.writeString(this.couponCode);
7298
        oprot.writeFieldEnd();
7299
      }
7300
      oprot.writeFieldBegin(CART_ID_FIELD_DESC);
7301
      oprot.writeI64(this.cartId);
7302
      oprot.writeFieldEnd();
7303
      oprot.writeFieldStop();
7304
      oprot.writeStructEnd();
7305
    }
7306
 
7307
    @Override
7308
    public String toString() {
7309
      StringBuilder sb = new StringBuilder("applyCoupon_args(");
7310
      boolean first = true;
7311
 
7312
      sb.append("couponCode:");
7313
      if (this.couponCode == null) {
7314
        sb.append("null");
7315
      } else {
7316
        sb.append(this.couponCode);
7317
      }
7318
      first = false;
7319
      if (!first) sb.append(", ");
7320
      sb.append("cartId:");
7321
      sb.append(this.cartId);
7322
      first = false;
7323
      sb.append(")");
7324
      return sb.toString();
7325
    }
7326
 
3430 rajveer 7327
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7328
      // check for required fields
7329
    }
7330
 
3430 rajveer 7331
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7332
      try {
7333
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7334
      } catch (org.apache.thrift.TException te) {
7335
        throw new java.io.IOException(te);
7336
      }
7337
    }
7338
 
7339
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7340
      try {
7341
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
7342
        __isset_bit_vector = new BitSet(1);
7343
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7344
      } catch (org.apache.thrift.TException te) {
7345
        throw new java.io.IOException(te);
7346
      }
7347
    }
7348
 
1982 varun.gupt 7349
  }
7350
 
3430 rajveer 7351
  public static class applyCoupon_result implements org.apache.thrift.TBase<applyCoupon_result, applyCoupon_result._Fields>, java.io.Serializable, Cloneable   {
7352
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_result");
1982 varun.gupt 7353
 
3430 rajveer 7354
    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);
7355
    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 7356
 
3430 rajveer 7357
    private Cart success; // required
7358
    private PromotionException pex; // required
1982 varun.gupt 7359
 
7360
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7361
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 7362
      SUCCESS((short)0, "success"),
7363
      PEX((short)1, "pex");
7364
 
7365
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7366
 
7367
      static {
7368
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7369
          byName.put(field.getFieldName(), field);
7370
        }
7371
      }
7372
 
7373
      /**
7374
       * Find the _Fields constant that matches fieldId, or null if its not found.
7375
       */
7376
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7377
        switch(fieldId) {
7378
          case 0: // SUCCESS
7379
            return SUCCESS;
7380
          case 1: // PEX
7381
            return PEX;
7382
          default:
7383
            return null;
7384
        }
1982 varun.gupt 7385
      }
7386
 
7387
      /**
7388
       * Find the _Fields constant that matches fieldId, throwing an exception
7389
       * if it is not found.
7390
       */
7391
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7392
        _Fields fields = findByThriftId(fieldId);
7393
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7394
        return fields;
7395
      }
7396
 
7397
      /**
7398
       * Find the _Fields constant that matches name, or null if its not found.
7399
       */
7400
      public static _Fields findByName(String name) {
7401
        return byName.get(name);
7402
      }
7403
 
7404
      private final short _thriftId;
7405
      private final String _fieldName;
7406
 
7407
      _Fields(short thriftId, String fieldName) {
7408
        _thriftId = thriftId;
7409
        _fieldName = fieldName;
7410
      }
7411
 
7412
      public short getThriftFieldId() {
7413
        return _thriftId;
7414
      }
7415
 
7416
      public String getFieldName() {
7417
        return _fieldName;
7418
      }
7419
    }
7420
 
7421
    // isset id assignments
7422
 
3430 rajveer 7423
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 7424
    static {
3430 rajveer 7425
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7426
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7427
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Cart.class)));
7428
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7429
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
7430
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7431
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_result.class, metaDataMap);
1982 varun.gupt 7432
    }
7433
 
7434
    public applyCoupon_result() {
7435
    }
7436
 
7437
    public applyCoupon_result(
7438
      Cart success,
7439
      PromotionException pex)
7440
    {
7441
      this();
7442
      this.success = success;
7443
      this.pex = pex;
7444
    }
7445
 
7446
    /**
7447
     * Performs a deep copy on <i>other</i>.
7448
     */
7449
    public applyCoupon_result(applyCoupon_result other) {
7450
      if (other.isSetSuccess()) {
7451
        this.success = new Cart(other.success);
7452
      }
7453
      if (other.isSetPex()) {
7454
        this.pex = new PromotionException(other.pex);
7455
      }
7456
    }
7457
 
7458
    public applyCoupon_result deepCopy() {
7459
      return new applyCoupon_result(this);
7460
    }
7461
 
3430 rajveer 7462
    @Override
7463
    public void clear() {
7464
      this.success = null;
7465
      this.pex = null;
1982 varun.gupt 7466
    }
7467
 
7468
    public Cart getSuccess() {
7469
      return this.success;
7470
    }
7471
 
3430 rajveer 7472
    public void setSuccess(Cart success) {
1982 varun.gupt 7473
      this.success = success;
7474
    }
7475
 
7476
    public void unsetSuccess() {
7477
      this.success = null;
7478
    }
7479
 
3430 rajveer 7480
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7481
    public boolean isSetSuccess() {
7482
      return this.success != null;
7483
    }
7484
 
7485
    public void setSuccessIsSet(boolean value) {
7486
      if (!value) {
7487
        this.success = null;
7488
      }
7489
    }
7490
 
7491
    public PromotionException getPex() {
7492
      return this.pex;
7493
    }
7494
 
3430 rajveer 7495
    public void setPex(PromotionException pex) {
1982 varun.gupt 7496
      this.pex = pex;
7497
    }
7498
 
7499
    public void unsetPex() {
7500
      this.pex = null;
7501
    }
7502
 
3430 rajveer 7503
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7504
    public boolean isSetPex() {
7505
      return this.pex != null;
7506
    }
7507
 
7508
    public void setPexIsSet(boolean value) {
7509
      if (!value) {
7510
        this.pex = null;
7511
      }
7512
    }
7513
 
7514
    public void setFieldValue(_Fields field, Object value) {
7515
      switch (field) {
7516
      case SUCCESS:
7517
        if (value == null) {
7518
          unsetSuccess();
7519
        } else {
7520
          setSuccess((Cart)value);
7521
        }
7522
        break;
7523
 
7524
      case PEX:
7525
        if (value == null) {
7526
          unsetPex();
7527
        } else {
7528
          setPex((PromotionException)value);
7529
        }
7530
        break;
7531
 
7532
      }
7533
    }
7534
 
7535
    public Object getFieldValue(_Fields field) {
7536
      switch (field) {
7537
      case SUCCESS:
7538
        return getSuccess();
7539
 
7540
      case PEX:
7541
        return getPex();
7542
 
7543
      }
7544
      throw new IllegalStateException();
7545
    }
7546
 
3430 rajveer 7547
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7548
    public boolean isSet(_Fields field) {
7549
      if (field == null) {
7550
        throw new IllegalArgumentException();
7551
      }
1982 varun.gupt 7552
 
7553
      switch (field) {
7554
      case SUCCESS:
7555
        return isSetSuccess();
7556
      case PEX:
7557
        return isSetPex();
7558
      }
7559
      throw new IllegalStateException();
7560
    }
7561
 
7562
    @Override
7563
    public boolean equals(Object that) {
7564
      if (that == null)
7565
        return false;
7566
      if (that instanceof applyCoupon_result)
7567
        return this.equals((applyCoupon_result)that);
7568
      return false;
7569
    }
7570
 
7571
    public boolean equals(applyCoupon_result that) {
7572
      if (that == null)
7573
        return false;
7574
 
7575
      boolean this_present_success = true && this.isSetSuccess();
7576
      boolean that_present_success = true && that.isSetSuccess();
7577
      if (this_present_success || that_present_success) {
7578
        if (!(this_present_success && that_present_success))
7579
          return false;
7580
        if (!this.success.equals(that.success))
7581
          return false;
7582
      }
7583
 
7584
      boolean this_present_pex = true && this.isSetPex();
7585
      boolean that_present_pex = true && that.isSetPex();
7586
      if (this_present_pex || that_present_pex) {
7587
        if (!(this_present_pex && that_present_pex))
7588
          return false;
7589
        if (!this.pex.equals(that.pex))
7590
          return false;
7591
      }
7592
 
7593
      return true;
7594
    }
7595
 
7596
    @Override
7597
    public int hashCode() {
7598
      return 0;
7599
    }
7600
 
7601
    public int compareTo(applyCoupon_result other) {
7602
      if (!getClass().equals(other.getClass())) {
7603
        return getClass().getName().compareTo(other.getClass().getName());
7604
      }
7605
 
7606
      int lastComparison = 0;
7607
      applyCoupon_result typedOther = (applyCoupon_result)other;
7608
 
3430 rajveer 7609
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 7610
      if (lastComparison != 0) {
7611
        return lastComparison;
7612
      }
3430 rajveer 7613
      if (isSetSuccess()) {
7614
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
7615
        if (lastComparison != 0) {
7616
          return lastComparison;
7617
        }
1982 varun.gupt 7618
      }
3430 rajveer 7619
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 7620
      if (lastComparison != 0) {
7621
        return lastComparison;
7622
      }
3430 rajveer 7623
      if (isSetPex()) {
7624
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
7625
        if (lastComparison != 0) {
7626
          return lastComparison;
7627
        }
1982 varun.gupt 7628
      }
7629
      return 0;
7630
    }
7631
 
3430 rajveer 7632
    public _Fields fieldForId(int fieldId) {
7633
      return _Fields.findByThriftId(fieldId);
7634
    }
7635
 
7636
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7637
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 7638
      iprot.readStructBegin();
7639
      while (true)
7640
      {
7641
        field = iprot.readFieldBegin();
3430 rajveer 7642
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 7643
          break;
7644
        }
3430 rajveer 7645
        switch (field.id) {
7646
          case 0: // SUCCESS
7647
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
7648
              this.success = new Cart();
7649
              this.success.read(iprot);
7650
            } else { 
7651
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7652
            }
7653
            break;
7654
          case 1: // PEX
7655
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
7656
              this.pex = new PromotionException();
7657
              this.pex.read(iprot);
7658
            } else { 
7659
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7660
            }
7661
            break;
7662
          default:
7663
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 7664
        }
3430 rajveer 7665
        iprot.readFieldEnd();
1982 varun.gupt 7666
      }
7667
      iprot.readStructEnd();
7668
      validate();
7669
    }
7670
 
3430 rajveer 7671
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 7672
      oprot.writeStructBegin(STRUCT_DESC);
7673
 
7674
      if (this.isSetSuccess()) {
7675
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
7676
        this.success.write(oprot);
7677
        oprot.writeFieldEnd();
7678
      } else if (this.isSetPex()) {
7679
        oprot.writeFieldBegin(PEX_FIELD_DESC);
7680
        this.pex.write(oprot);
7681
        oprot.writeFieldEnd();
7682
      }
7683
      oprot.writeFieldStop();
7684
      oprot.writeStructEnd();
7685
    }
7686
 
7687
    @Override
7688
    public String toString() {
7689
      StringBuilder sb = new StringBuilder("applyCoupon_result(");
7690
      boolean first = true;
7691
 
7692
      sb.append("success:");
7693
      if (this.success == null) {
7694
        sb.append("null");
7695
      } else {
7696
        sb.append(this.success);
7697
      }
7698
      first = false;
7699
      if (!first) sb.append(", ");
7700
      sb.append("pex:");
7701
      if (this.pex == null) {
7702
        sb.append("null");
7703
      } else {
7704
        sb.append(this.pex);
7705
      }
7706
      first = false;
7707
      sb.append(")");
7708
      return sb.toString();
7709
    }
7710
 
3430 rajveer 7711
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7712
      // check for required fields
7713
    }
7714
 
3430 rajveer 7715
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7716
      try {
7717
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7718
      } catch (org.apache.thrift.TException te) {
7719
        throw new java.io.IOException(te);
7720
      }
7721
    }
7722
 
7723
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7724
      try {
7725
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7726
      } catch (org.apache.thrift.TException te) {
7727
        throw new java.io.IOException(te);
7728
      }
7729
    }
7730
 
1982 varun.gupt 7731
  }
7732
 
6736 amit.gupta 7733
  public static class getEmiDiscount_args implements org.apache.thrift.TBase<getEmiDiscount_args, getEmiDiscount_args._Fields>, java.io.Serializable, Cloneable   {
7734
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getEmiDiscount_args");
7735
 
7736
    private static final org.apache.thrift.protocol.TField CART_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("cartId", org.apache.thrift.protocol.TType.I64, (short)1);
7737
 
7738
    private long cartId; // required
7739
 
7740
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
7741
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
7742
      CART_ID((short)1, "cartId");
7743
 
7744
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7745
 
7746
      static {
7747
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7748
          byName.put(field.getFieldName(), field);
7749
        }
7750
      }
7751
 
7752
      /**
7753
       * Find the _Fields constant that matches fieldId, or null if its not found.
7754
       */
7755
      public static _Fields findByThriftId(int fieldId) {
7756
        switch(fieldId) {
7757
          case 1: // CART_ID
7758
            return CART_ID;
7759
          default:
7760
            return null;
7761
        }
7762
      }
7763
 
7764
      /**
7765
       * Find the _Fields constant that matches fieldId, throwing an exception
7766
       * if it is not found.
7767
       */
7768
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7769
        _Fields fields = findByThriftId(fieldId);
7770
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7771
        return fields;
7772
      }
7773
 
7774
      /**
7775
       * Find the _Fields constant that matches name, or null if its not found.
7776
       */
7777
      public static _Fields findByName(String name) {
7778
        return byName.get(name);
7779
      }
7780
 
7781
      private final short _thriftId;
7782
      private final String _fieldName;
7783
 
7784
      _Fields(short thriftId, String fieldName) {
7785
        _thriftId = thriftId;
7786
        _fieldName = fieldName;
7787
      }
7788
 
7789
      public short getThriftFieldId() {
7790
        return _thriftId;
7791
      }
7792
 
7793
      public String getFieldName() {
7794
        return _fieldName;
7795
      }
7796
    }
7797
 
7798
    // isset id assignments
7799
    private static final int __CARTID_ISSET_ID = 0;
7800
    private BitSet __isset_bit_vector = new BitSet(1);
7801
 
7802
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
7803
    static {
7804
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7805
      tmpMap.put(_Fields.CART_ID, new org.apache.thrift.meta_data.FieldMetaData("cartId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7806
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7807
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7808
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getEmiDiscount_args.class, metaDataMap);
7809
    }
7810
 
7811
    public getEmiDiscount_args() {
7812
    }
7813
 
7814
    public getEmiDiscount_args(
7815
      long cartId)
7816
    {
7817
      this();
7818
      this.cartId = cartId;
7819
      setCartIdIsSet(true);
7820
    }
7821
 
7822
    /**
7823
     * Performs a deep copy on <i>other</i>.
7824
     */
7825
    public getEmiDiscount_args(getEmiDiscount_args other) {
7826
      __isset_bit_vector.clear();
7827
      __isset_bit_vector.or(other.__isset_bit_vector);
7828
      this.cartId = other.cartId;
7829
    }
7830
 
7831
    public getEmiDiscount_args deepCopy() {
7832
      return new getEmiDiscount_args(this);
7833
    }
7834
 
7835
    @Override
7836
    public void clear() {
7837
      setCartIdIsSet(false);
7838
      this.cartId = 0;
7839
    }
7840
 
7841
    public long getCartId() {
7842
      return this.cartId;
7843
    }
7844
 
7845
    public void setCartId(long cartId) {
7846
      this.cartId = cartId;
7847
      setCartIdIsSet(true);
7848
    }
7849
 
7850
    public void unsetCartId() {
7851
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
7852
    }
7853
 
7854
    /** Returns true if field cartId is set (has been assigned a value) and false otherwise */
7855
    public boolean isSetCartId() {
7856
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
7857
    }
7858
 
7859
    public void setCartIdIsSet(boolean value) {
7860
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
7861
    }
7862
 
7863
    public void setFieldValue(_Fields field, Object value) {
7864
      switch (field) {
7865
      case CART_ID:
7866
        if (value == null) {
7867
          unsetCartId();
7868
        } else {
7869
          setCartId((Long)value);
7870
        }
7871
        break;
7872
 
7873
      }
7874
    }
7875
 
7876
    public Object getFieldValue(_Fields field) {
7877
      switch (field) {
7878
      case CART_ID:
7879
        return Long.valueOf(getCartId());
7880
 
7881
      }
7882
      throw new IllegalStateException();
7883
    }
7884
 
7885
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7886
    public boolean isSet(_Fields field) {
7887
      if (field == null) {
7888
        throw new IllegalArgumentException();
7889
      }
7890
 
7891
      switch (field) {
7892
      case CART_ID:
7893
        return isSetCartId();
7894
      }
7895
      throw new IllegalStateException();
7896
    }
7897
 
7898
    @Override
7899
    public boolean equals(Object that) {
7900
      if (that == null)
7901
        return false;
7902
      if (that instanceof getEmiDiscount_args)
7903
        return this.equals((getEmiDiscount_args)that);
7904
      return false;
7905
    }
7906
 
7907
    public boolean equals(getEmiDiscount_args that) {
7908
      if (that == null)
7909
        return false;
7910
 
7911
      boolean this_present_cartId = true;
7912
      boolean that_present_cartId = true;
7913
      if (this_present_cartId || that_present_cartId) {
7914
        if (!(this_present_cartId && that_present_cartId))
7915
          return false;
7916
        if (this.cartId != that.cartId)
7917
          return false;
7918
      }
7919
 
7920
      return true;
7921
    }
7922
 
7923
    @Override
7924
    public int hashCode() {
7925
      return 0;
7926
    }
7927
 
7928
    public int compareTo(getEmiDiscount_args other) {
7929
      if (!getClass().equals(other.getClass())) {
7930
        return getClass().getName().compareTo(other.getClass().getName());
7931
      }
7932
 
7933
      int lastComparison = 0;
7934
      getEmiDiscount_args typedOther = (getEmiDiscount_args)other;
7935
 
7936
      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(typedOther.isSetCartId());
7937
      if (lastComparison != 0) {
7938
        return lastComparison;
7939
      }
7940
      if (isSetCartId()) {
7941
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cartId, typedOther.cartId);
7942
        if (lastComparison != 0) {
7943
          return lastComparison;
7944
        }
7945
      }
7946
      return 0;
7947
    }
7948
 
7949
    public _Fields fieldForId(int fieldId) {
7950
      return _Fields.findByThriftId(fieldId);
7951
    }
7952
 
7953
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7954
      org.apache.thrift.protocol.TField field;
7955
      iprot.readStructBegin();
7956
      while (true)
7957
      {
7958
        field = iprot.readFieldBegin();
7959
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
7960
          break;
7961
        }
7962
        switch (field.id) {
7963
          case 1: // CART_ID
7964
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7965
              this.cartId = iprot.readI64();
7966
              setCartIdIsSet(true);
7967
            } else { 
7968
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7969
            }
7970
            break;
7971
          default:
7972
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7973
        }
7974
        iprot.readFieldEnd();
7975
      }
7976
      iprot.readStructEnd();
7977
      validate();
7978
    }
7979
 
7980
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
7981
      validate();
7982
 
7983
      oprot.writeStructBegin(STRUCT_DESC);
7984
      oprot.writeFieldBegin(CART_ID_FIELD_DESC);
7985
      oprot.writeI64(this.cartId);
7986
      oprot.writeFieldEnd();
7987
      oprot.writeFieldStop();
7988
      oprot.writeStructEnd();
7989
    }
7990
 
7991
    @Override
7992
    public String toString() {
7993
      StringBuilder sb = new StringBuilder("getEmiDiscount_args(");
7994
      boolean first = true;
7995
 
7996
      sb.append("cartId:");
7997
      sb.append(this.cartId);
7998
      first = false;
7999
      sb.append(")");
8000
      return sb.toString();
8001
    }
8002
 
8003
    public void validate() throws org.apache.thrift.TException {
8004
      // check for required fields
8005
    }
8006
 
8007
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8008
      try {
8009
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8010
      } catch (org.apache.thrift.TException te) {
8011
        throw new java.io.IOException(te);
8012
      }
8013
    }
8014
 
8015
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8016
      try {
8017
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
8018
        __isset_bit_vector = new BitSet(1);
8019
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8020
      } catch (org.apache.thrift.TException te) {
8021
        throw new java.io.IOException(te);
8022
      }
8023
    }
8024
 
8025
  }
8026
 
8027
  public static class getEmiDiscount_result implements org.apache.thrift.TBase<getEmiDiscount_result, getEmiDiscount_result._Fields>, java.io.Serializable, Cloneable   {
8028
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getEmiDiscount_result");
8029
 
8030
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0);
8031
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
8032
 
8033
    private Map<Long,Double> success; // required
8034
    private PromotionException pex; // required
8035
 
8036
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8037
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
8038
      SUCCESS((short)0, "success"),
8039
      PEX((short)1, "pex");
8040
 
8041
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8042
 
8043
      static {
8044
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8045
          byName.put(field.getFieldName(), field);
8046
        }
8047
      }
8048
 
8049
      /**
8050
       * Find the _Fields constant that matches fieldId, or null if its not found.
8051
       */
8052
      public static _Fields findByThriftId(int fieldId) {
8053
        switch(fieldId) {
8054
          case 0: // SUCCESS
8055
            return SUCCESS;
8056
          case 1: // PEX
8057
            return PEX;
8058
          default:
8059
            return null;
8060
        }
8061
      }
8062
 
8063
      /**
8064
       * Find the _Fields constant that matches fieldId, throwing an exception
8065
       * if it is not found.
8066
       */
8067
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8068
        _Fields fields = findByThriftId(fieldId);
8069
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8070
        return fields;
8071
      }
8072
 
8073
      /**
8074
       * Find the _Fields constant that matches name, or null if its not found.
8075
       */
8076
      public static _Fields findByName(String name) {
8077
        return byName.get(name);
8078
      }
8079
 
8080
      private final short _thriftId;
8081
      private final String _fieldName;
8082
 
8083
      _Fields(short thriftId, String fieldName) {
8084
        _thriftId = thriftId;
8085
        _fieldName = fieldName;
8086
      }
8087
 
8088
      public short getThriftFieldId() {
8089
        return _thriftId;
8090
      }
8091
 
8092
      public String getFieldName() {
8093
        return _fieldName;
8094
      }
8095
    }
8096
 
8097
    // isset id assignments
8098
 
8099
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
8100
    static {
8101
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8102
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8103
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
8104
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), 
8105
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
8106
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8107
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
8108
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8109
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getEmiDiscount_result.class, metaDataMap);
8110
    }
8111
 
8112
    public getEmiDiscount_result() {
8113
    }
8114
 
8115
    public getEmiDiscount_result(
8116
      Map<Long,Double> success,
8117
      PromotionException pex)
8118
    {
8119
      this();
8120
      this.success = success;
8121
      this.pex = pex;
8122
    }
8123
 
8124
    /**
8125
     * Performs a deep copy on <i>other</i>.
8126
     */
8127
    public getEmiDiscount_result(getEmiDiscount_result other) {
8128
      if (other.isSetSuccess()) {
8129
        Map<Long,Double> __this__success = new HashMap<Long,Double>();
8130
        for (Map.Entry<Long, Double> other_element : other.success.entrySet()) {
8131
 
8132
          Long other_element_key = other_element.getKey();
8133
          Double other_element_value = other_element.getValue();
8134
 
8135
          Long __this__success_copy_key = other_element_key;
8136
 
8137
          Double __this__success_copy_value = other_element_value;
8138
 
8139
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
8140
        }
8141
        this.success = __this__success;
8142
      }
8143
      if (other.isSetPex()) {
8144
        this.pex = new PromotionException(other.pex);
8145
      }
8146
    }
8147
 
8148
    public getEmiDiscount_result deepCopy() {
8149
      return new getEmiDiscount_result(this);
8150
    }
8151
 
8152
    @Override
8153
    public void clear() {
8154
      this.success = null;
8155
      this.pex = null;
8156
    }
8157
 
8158
    public int getSuccessSize() {
8159
      return (this.success == null) ? 0 : this.success.size();
8160
    }
8161
 
8162
    public void putToSuccess(long key, double val) {
8163
      if (this.success == null) {
8164
        this.success = new HashMap<Long,Double>();
8165
      }
8166
      this.success.put(key, val);
8167
    }
8168
 
8169
    public Map<Long,Double> getSuccess() {
8170
      return this.success;
8171
    }
8172
 
8173
    public void setSuccess(Map<Long,Double> success) {
8174
      this.success = success;
8175
    }
8176
 
8177
    public void unsetSuccess() {
8178
      this.success = null;
8179
    }
8180
 
8181
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
8182
    public boolean isSetSuccess() {
8183
      return this.success != null;
8184
    }
8185
 
8186
    public void setSuccessIsSet(boolean value) {
8187
      if (!value) {
8188
        this.success = null;
8189
      }
8190
    }
8191
 
8192
    public PromotionException getPex() {
8193
      return this.pex;
8194
    }
8195
 
8196
    public void setPex(PromotionException pex) {
8197
      this.pex = pex;
8198
    }
8199
 
8200
    public void unsetPex() {
8201
      this.pex = null;
8202
    }
8203
 
8204
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
8205
    public boolean isSetPex() {
8206
      return this.pex != null;
8207
    }
8208
 
8209
    public void setPexIsSet(boolean value) {
8210
      if (!value) {
8211
        this.pex = null;
8212
      }
8213
    }
8214
 
8215
    public void setFieldValue(_Fields field, Object value) {
8216
      switch (field) {
8217
      case SUCCESS:
8218
        if (value == null) {
8219
          unsetSuccess();
8220
        } else {
8221
          setSuccess((Map<Long,Double>)value);
8222
        }
8223
        break;
8224
 
8225
      case PEX:
8226
        if (value == null) {
8227
          unsetPex();
8228
        } else {
8229
          setPex((PromotionException)value);
8230
        }
8231
        break;
8232
 
8233
      }
8234
    }
8235
 
8236
    public Object getFieldValue(_Fields field) {
8237
      switch (field) {
8238
      case SUCCESS:
8239
        return getSuccess();
8240
 
8241
      case PEX:
8242
        return getPex();
8243
 
8244
      }
8245
      throw new IllegalStateException();
8246
    }
8247
 
8248
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8249
    public boolean isSet(_Fields field) {
8250
      if (field == null) {
8251
        throw new IllegalArgumentException();
8252
      }
8253
 
8254
      switch (field) {
8255
      case SUCCESS:
8256
        return isSetSuccess();
8257
      case PEX:
8258
        return isSetPex();
8259
      }
8260
      throw new IllegalStateException();
8261
    }
8262
 
8263
    @Override
8264
    public boolean equals(Object that) {
8265
      if (that == null)
8266
        return false;
8267
      if (that instanceof getEmiDiscount_result)
8268
        return this.equals((getEmiDiscount_result)that);
8269
      return false;
8270
    }
8271
 
8272
    public boolean equals(getEmiDiscount_result that) {
8273
      if (that == null)
8274
        return false;
8275
 
8276
      boolean this_present_success = true && this.isSetSuccess();
8277
      boolean that_present_success = true && that.isSetSuccess();
8278
      if (this_present_success || that_present_success) {
8279
        if (!(this_present_success && that_present_success))
8280
          return false;
8281
        if (!this.success.equals(that.success))
8282
          return false;
8283
      }
8284
 
8285
      boolean this_present_pex = true && this.isSetPex();
8286
      boolean that_present_pex = true && that.isSetPex();
8287
      if (this_present_pex || that_present_pex) {
8288
        if (!(this_present_pex && that_present_pex))
8289
          return false;
8290
        if (!this.pex.equals(that.pex))
8291
          return false;
8292
      }
8293
 
8294
      return true;
8295
    }
8296
 
8297
    @Override
8298
    public int hashCode() {
8299
      return 0;
8300
    }
8301
 
8302
    public int compareTo(getEmiDiscount_result other) {
8303
      if (!getClass().equals(other.getClass())) {
8304
        return getClass().getName().compareTo(other.getClass().getName());
8305
      }
8306
 
8307
      int lastComparison = 0;
8308
      getEmiDiscount_result typedOther = (getEmiDiscount_result)other;
8309
 
8310
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
8311
      if (lastComparison != 0) {
8312
        return lastComparison;
8313
      }
8314
      if (isSetSuccess()) {
8315
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
8316
        if (lastComparison != 0) {
8317
          return lastComparison;
8318
        }
8319
      }
8320
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
8321
      if (lastComparison != 0) {
8322
        return lastComparison;
8323
      }
8324
      if (isSetPex()) {
8325
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
8326
        if (lastComparison != 0) {
8327
          return lastComparison;
8328
        }
8329
      }
8330
      return 0;
8331
    }
8332
 
8333
    public _Fields fieldForId(int fieldId) {
8334
      return _Fields.findByThriftId(fieldId);
8335
    }
8336
 
8337
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8338
      org.apache.thrift.protocol.TField field;
8339
      iprot.readStructBegin();
8340
      while (true)
8341
      {
8342
        field = iprot.readFieldBegin();
8343
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
8344
          break;
8345
        }
8346
        switch (field.id) {
8347
          case 0: // SUCCESS
8348
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
8349
              {
8350
                org.apache.thrift.protocol.TMap _map16 = iprot.readMapBegin();
8351
                this.success = new HashMap<Long,Double>(2*_map16.size);
8352
                for (int _i17 = 0; _i17 < _map16.size; ++_i17)
8353
                {
8354
                  long _key18; // required
8355
                  double _val19; // required
8356
                  _key18 = iprot.readI64();
8357
                  _val19 = iprot.readDouble();
8358
                  this.success.put(_key18, _val19);
8359
                }
8360
                iprot.readMapEnd();
8361
              }
8362
            } else { 
8363
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8364
            }
8365
            break;
8366
          case 1: // PEX
8367
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
8368
              this.pex = new PromotionException();
8369
              this.pex.read(iprot);
8370
            } else { 
8371
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8372
            }
8373
            break;
8374
          default:
8375
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8376
        }
8377
        iprot.readFieldEnd();
8378
      }
8379
      iprot.readStructEnd();
8380
      validate();
8381
    }
8382
 
8383
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
8384
      oprot.writeStructBegin(STRUCT_DESC);
8385
 
8386
      if (this.isSetSuccess()) {
8387
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
8388
        {
8389
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.DOUBLE, this.success.size()));
8390
          for (Map.Entry<Long, Double> _iter20 : this.success.entrySet())
8391
          {
8392
            oprot.writeI64(_iter20.getKey());
8393
            oprot.writeDouble(_iter20.getValue());
8394
          }
8395
          oprot.writeMapEnd();
8396
        }
8397
        oprot.writeFieldEnd();
8398
      } else if (this.isSetPex()) {
8399
        oprot.writeFieldBegin(PEX_FIELD_DESC);
8400
        this.pex.write(oprot);
8401
        oprot.writeFieldEnd();
8402
      }
8403
      oprot.writeFieldStop();
8404
      oprot.writeStructEnd();
8405
    }
8406
 
8407
    @Override
8408
    public String toString() {
8409
      StringBuilder sb = new StringBuilder("getEmiDiscount_result(");
8410
      boolean first = true;
8411
 
8412
      sb.append("success:");
8413
      if (this.success == null) {
8414
        sb.append("null");
8415
      } else {
8416
        sb.append(this.success);
8417
      }
8418
      first = false;
8419
      if (!first) sb.append(", ");
8420
      sb.append("pex:");
8421
      if (this.pex == null) {
8422
        sb.append("null");
8423
      } else {
8424
        sb.append(this.pex);
8425
      }
8426
      first = false;
8427
      sb.append(")");
8428
      return sb.toString();
8429
    }
8430
 
8431
    public void validate() throws org.apache.thrift.TException {
8432
      // check for required fields
8433
    }
8434
 
8435
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8436
      try {
8437
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8438
      } catch (org.apache.thrift.TException te) {
8439
        throw new java.io.IOException(te);
8440
      }
8441
    }
8442
 
8443
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8444
      try {
8445
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8446
      } catch (org.apache.thrift.TException te) {
8447
        throw new java.io.IOException(te);
8448
      }
8449
    }
8450
 
8451
  }
8452
 
6433 anupam.sin 8453
  public static class applyRechargeCoupon_args implements org.apache.thrift.TBase<applyRechargeCoupon_args, applyRechargeCoupon_args._Fields>, java.io.Serializable, Cloneable   {
8454
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyRechargeCoupon_args");
8455
 
8456
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)1);
8457
    private static final org.apache.thrift.protocol.TField TOTAL_AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("totalAmount", org.apache.thrift.protocol.TType.I64, (short)2);
8458
    private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.I64, (short)3);
8459
 
8460
    private String couponCode; // required
8461
    private long totalAmount; // required
8462
    private long userId; // required
8463
 
8464
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8465
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
8466
      COUPON_CODE((short)1, "couponCode"),
8467
      TOTAL_AMOUNT((short)2, "totalAmount"),
8468
      USER_ID((short)3, "userId");
8469
 
8470
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8471
 
8472
      static {
8473
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8474
          byName.put(field.getFieldName(), field);
8475
        }
8476
      }
8477
 
8478
      /**
8479
       * Find the _Fields constant that matches fieldId, or null if its not found.
8480
       */
8481
      public static _Fields findByThriftId(int fieldId) {
8482
        switch(fieldId) {
8483
          case 1: // COUPON_CODE
8484
            return COUPON_CODE;
8485
          case 2: // TOTAL_AMOUNT
8486
            return TOTAL_AMOUNT;
8487
          case 3: // USER_ID
8488
            return USER_ID;
8489
          default:
8490
            return null;
8491
        }
8492
      }
8493
 
8494
      /**
8495
       * Find the _Fields constant that matches fieldId, throwing an exception
8496
       * if it is not found.
8497
       */
8498
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8499
        _Fields fields = findByThriftId(fieldId);
8500
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8501
        return fields;
8502
      }
8503
 
8504
      /**
8505
       * Find the _Fields constant that matches name, or null if its not found.
8506
       */
8507
      public static _Fields findByName(String name) {
8508
        return byName.get(name);
8509
      }
8510
 
8511
      private final short _thriftId;
8512
      private final String _fieldName;
8513
 
8514
      _Fields(short thriftId, String fieldName) {
8515
        _thriftId = thriftId;
8516
        _fieldName = fieldName;
8517
      }
8518
 
8519
      public short getThriftFieldId() {
8520
        return _thriftId;
8521
      }
8522
 
8523
      public String getFieldName() {
8524
        return _fieldName;
8525
      }
8526
    }
8527
 
8528
    // isset id assignments
8529
    private static final int __TOTALAMOUNT_ISSET_ID = 0;
8530
    private static final int __USERID_ISSET_ID = 1;
8531
    private BitSet __isset_bit_vector = new BitSet(2);
8532
 
8533
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
8534
    static {
8535
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8536
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8537
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
8538
      tmpMap.put(_Fields.TOTAL_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("totalAmount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8539
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8540
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8541
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8542
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8543
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyRechargeCoupon_args.class, metaDataMap);
8544
    }
8545
 
8546
    public applyRechargeCoupon_args() {
8547
    }
8548
 
8549
    public applyRechargeCoupon_args(
8550
      String couponCode,
8551
      long totalAmount,
8552
      long userId)
8553
    {
8554
      this();
8555
      this.couponCode = couponCode;
8556
      this.totalAmount = totalAmount;
8557
      setTotalAmountIsSet(true);
8558
      this.userId = userId;
8559
      setUserIdIsSet(true);
8560
    }
8561
 
8562
    /**
8563
     * Performs a deep copy on <i>other</i>.
8564
     */
8565
    public applyRechargeCoupon_args(applyRechargeCoupon_args other) {
8566
      __isset_bit_vector.clear();
8567
      __isset_bit_vector.or(other.__isset_bit_vector);
8568
      if (other.isSetCouponCode()) {
8569
        this.couponCode = other.couponCode;
8570
      }
8571
      this.totalAmount = other.totalAmount;
8572
      this.userId = other.userId;
8573
    }
8574
 
8575
    public applyRechargeCoupon_args deepCopy() {
8576
      return new applyRechargeCoupon_args(this);
8577
    }
8578
 
8579
    @Override
8580
    public void clear() {
8581
      this.couponCode = null;
8582
      setTotalAmountIsSet(false);
8583
      this.totalAmount = 0;
8584
      setUserIdIsSet(false);
8585
      this.userId = 0;
8586
    }
8587
 
8588
    public String getCouponCode() {
8589
      return this.couponCode;
8590
    }
8591
 
8592
    public void setCouponCode(String couponCode) {
8593
      this.couponCode = couponCode;
8594
    }
8595
 
8596
    public void unsetCouponCode() {
8597
      this.couponCode = null;
8598
    }
8599
 
8600
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
8601
    public boolean isSetCouponCode() {
8602
      return this.couponCode != null;
8603
    }
8604
 
8605
    public void setCouponCodeIsSet(boolean value) {
8606
      if (!value) {
8607
        this.couponCode = null;
8608
      }
8609
    }
8610
 
8611
    public long getTotalAmount() {
8612
      return this.totalAmount;
8613
    }
8614
 
8615
    public void setTotalAmount(long totalAmount) {
8616
      this.totalAmount = totalAmount;
8617
      setTotalAmountIsSet(true);
8618
    }
8619
 
8620
    public void unsetTotalAmount() {
8621
      __isset_bit_vector.clear(__TOTALAMOUNT_ISSET_ID);
8622
    }
8623
 
8624
    /** Returns true if field totalAmount is set (has been assigned a value) and false otherwise */
8625
    public boolean isSetTotalAmount() {
8626
      return __isset_bit_vector.get(__TOTALAMOUNT_ISSET_ID);
8627
    }
8628
 
8629
    public void setTotalAmountIsSet(boolean value) {
8630
      __isset_bit_vector.set(__TOTALAMOUNT_ISSET_ID, value);
8631
    }
8632
 
8633
    public long getUserId() {
8634
      return this.userId;
8635
    }
8636
 
8637
    public void setUserId(long userId) {
8638
      this.userId = userId;
8639
      setUserIdIsSet(true);
8640
    }
8641
 
8642
    public void unsetUserId() {
8643
      __isset_bit_vector.clear(__USERID_ISSET_ID);
8644
    }
8645
 
8646
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
8647
    public boolean isSetUserId() {
8648
      return __isset_bit_vector.get(__USERID_ISSET_ID);
8649
    }
8650
 
8651
    public void setUserIdIsSet(boolean value) {
8652
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
8653
    }
8654
 
8655
    public void setFieldValue(_Fields field, Object value) {
8656
      switch (field) {
8657
      case COUPON_CODE:
8658
        if (value == null) {
8659
          unsetCouponCode();
8660
        } else {
8661
          setCouponCode((String)value);
8662
        }
8663
        break;
8664
 
8665
      case TOTAL_AMOUNT:
8666
        if (value == null) {
8667
          unsetTotalAmount();
8668
        } else {
8669
          setTotalAmount((Long)value);
8670
        }
8671
        break;
8672
 
8673
      case USER_ID:
8674
        if (value == null) {
8675
          unsetUserId();
8676
        } else {
8677
          setUserId((Long)value);
8678
        }
8679
        break;
8680
 
8681
      }
8682
    }
8683
 
8684
    public Object getFieldValue(_Fields field) {
8685
      switch (field) {
8686
      case COUPON_CODE:
8687
        return getCouponCode();
8688
 
8689
      case TOTAL_AMOUNT:
8690
        return Long.valueOf(getTotalAmount());
8691
 
8692
      case USER_ID:
8693
        return Long.valueOf(getUserId());
8694
 
8695
      }
8696
      throw new IllegalStateException();
8697
    }
8698
 
8699
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8700
    public boolean isSet(_Fields field) {
8701
      if (field == null) {
8702
        throw new IllegalArgumentException();
8703
      }
8704
 
8705
      switch (field) {
8706
      case COUPON_CODE:
8707
        return isSetCouponCode();
8708
      case TOTAL_AMOUNT:
8709
        return isSetTotalAmount();
8710
      case USER_ID:
8711
        return isSetUserId();
8712
      }
8713
      throw new IllegalStateException();
8714
    }
8715
 
8716
    @Override
8717
    public boolean equals(Object that) {
8718
      if (that == null)
8719
        return false;
8720
      if (that instanceof applyRechargeCoupon_args)
8721
        return this.equals((applyRechargeCoupon_args)that);
8722
      return false;
8723
    }
8724
 
8725
    public boolean equals(applyRechargeCoupon_args that) {
8726
      if (that == null)
8727
        return false;
8728
 
8729
      boolean this_present_couponCode = true && this.isSetCouponCode();
8730
      boolean that_present_couponCode = true && that.isSetCouponCode();
8731
      if (this_present_couponCode || that_present_couponCode) {
8732
        if (!(this_present_couponCode && that_present_couponCode))
8733
          return false;
8734
        if (!this.couponCode.equals(that.couponCode))
8735
          return false;
8736
      }
8737
 
8738
      boolean this_present_totalAmount = true;
8739
      boolean that_present_totalAmount = true;
8740
      if (this_present_totalAmount || that_present_totalAmount) {
8741
        if (!(this_present_totalAmount && that_present_totalAmount))
8742
          return false;
8743
        if (this.totalAmount != that.totalAmount)
8744
          return false;
8745
      }
8746
 
8747
      boolean this_present_userId = true;
8748
      boolean that_present_userId = true;
8749
      if (this_present_userId || that_present_userId) {
8750
        if (!(this_present_userId && that_present_userId))
8751
          return false;
8752
        if (this.userId != that.userId)
8753
          return false;
8754
      }
8755
 
8756
      return true;
8757
    }
8758
 
8759
    @Override
8760
    public int hashCode() {
8761
      return 0;
8762
    }
8763
 
8764
    public int compareTo(applyRechargeCoupon_args other) {
8765
      if (!getClass().equals(other.getClass())) {
8766
        return getClass().getName().compareTo(other.getClass().getName());
8767
      }
8768
 
8769
      int lastComparison = 0;
8770
      applyRechargeCoupon_args typedOther = (applyRechargeCoupon_args)other;
8771
 
8772
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
8773
      if (lastComparison != 0) {
8774
        return lastComparison;
8775
      }
8776
      if (isSetCouponCode()) {
8777
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
8778
        if (lastComparison != 0) {
8779
          return lastComparison;
8780
        }
8781
      }
8782
      lastComparison = Boolean.valueOf(isSetTotalAmount()).compareTo(typedOther.isSetTotalAmount());
8783
      if (lastComparison != 0) {
8784
        return lastComparison;
8785
      }
8786
      if (isSetTotalAmount()) {
8787
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.totalAmount, typedOther.totalAmount);
8788
        if (lastComparison != 0) {
8789
          return lastComparison;
8790
        }
8791
      }
8792
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
8793
      if (lastComparison != 0) {
8794
        return lastComparison;
8795
      }
8796
      if (isSetUserId()) {
8797
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
8798
        if (lastComparison != 0) {
8799
          return lastComparison;
8800
        }
8801
      }
8802
      return 0;
8803
    }
8804
 
8805
    public _Fields fieldForId(int fieldId) {
8806
      return _Fields.findByThriftId(fieldId);
8807
    }
8808
 
8809
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8810
      org.apache.thrift.protocol.TField field;
8811
      iprot.readStructBegin();
8812
      while (true)
8813
      {
8814
        field = iprot.readFieldBegin();
8815
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
8816
          break;
8817
        }
8818
        switch (field.id) {
8819
          case 1: // COUPON_CODE
8820
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
8821
              this.couponCode = iprot.readString();
8822
            } else { 
8823
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8824
            }
8825
            break;
8826
          case 2: // TOTAL_AMOUNT
8827
            if (field.type == org.apache.thrift.protocol.TType.I64) {
8828
              this.totalAmount = iprot.readI64();
8829
              setTotalAmountIsSet(true);
8830
            } else { 
8831
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8832
            }
8833
            break;
8834
          case 3: // USER_ID
8835
            if (field.type == org.apache.thrift.protocol.TType.I64) {
8836
              this.userId = iprot.readI64();
8837
              setUserIdIsSet(true);
8838
            } else { 
8839
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8840
            }
8841
            break;
8842
          default:
8843
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8844
        }
8845
        iprot.readFieldEnd();
8846
      }
8847
      iprot.readStructEnd();
8848
      validate();
8849
    }
8850
 
8851
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
8852
      validate();
8853
 
8854
      oprot.writeStructBegin(STRUCT_DESC);
8855
      if (this.couponCode != null) {
8856
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
8857
        oprot.writeString(this.couponCode);
8858
        oprot.writeFieldEnd();
8859
      }
8860
      oprot.writeFieldBegin(TOTAL_AMOUNT_FIELD_DESC);
8861
      oprot.writeI64(this.totalAmount);
8862
      oprot.writeFieldEnd();
8863
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
8864
      oprot.writeI64(this.userId);
8865
      oprot.writeFieldEnd();
8866
      oprot.writeFieldStop();
8867
      oprot.writeStructEnd();
8868
    }
8869
 
8870
    @Override
8871
    public String toString() {
8872
      StringBuilder sb = new StringBuilder("applyRechargeCoupon_args(");
8873
      boolean first = true;
8874
 
8875
      sb.append("couponCode:");
8876
      if (this.couponCode == null) {
8877
        sb.append("null");
8878
      } else {
8879
        sb.append(this.couponCode);
8880
      }
8881
      first = false;
8882
      if (!first) sb.append(", ");
8883
      sb.append("totalAmount:");
8884
      sb.append(this.totalAmount);
8885
      first = false;
8886
      if (!first) sb.append(", ");
8887
      sb.append("userId:");
8888
      sb.append(this.userId);
8889
      first = false;
8890
      sb.append(")");
8891
      return sb.toString();
8892
    }
8893
 
8894
    public void validate() throws org.apache.thrift.TException {
8895
      // check for required fields
8896
    }
8897
 
8898
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8899
      try {
8900
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8901
      } catch (org.apache.thrift.TException te) {
8902
        throw new java.io.IOException(te);
8903
      }
8904
    }
8905
 
8906
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8907
      try {
8908
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
8909
        __isset_bit_vector = new BitSet(1);
8910
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8911
      } catch (org.apache.thrift.TException te) {
8912
        throw new java.io.IOException(te);
8913
      }
8914
    }
8915
 
8916
  }
8917
 
8918
  public static class applyRechargeCoupon_result implements org.apache.thrift.TBase<applyRechargeCoupon_result, applyRechargeCoupon_result._Fields>, java.io.Serializable, Cloneable   {
8919
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyRechargeCoupon_result");
8920
 
8921
    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);
8922
    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);
8923
 
8924
    private Map<Long,String> success; // required
8925
    private PromotionException pex; // required
8926
 
8927
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8928
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
8929
      SUCCESS((short)0, "success"),
8930
      PEX((short)1, "pex");
8931
 
8932
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8933
 
8934
      static {
8935
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8936
          byName.put(field.getFieldName(), field);
8937
        }
8938
      }
8939
 
8940
      /**
8941
       * Find the _Fields constant that matches fieldId, or null if its not found.
8942
       */
8943
      public static _Fields findByThriftId(int fieldId) {
8944
        switch(fieldId) {
8945
          case 0: // SUCCESS
8946
            return SUCCESS;
8947
          case 1: // PEX
8948
            return PEX;
8949
          default:
8950
            return null;
8951
        }
8952
      }
8953
 
8954
      /**
8955
       * Find the _Fields constant that matches fieldId, throwing an exception
8956
       * if it is not found.
8957
       */
8958
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8959
        _Fields fields = findByThriftId(fieldId);
8960
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8961
        return fields;
8962
      }
8963
 
8964
      /**
8965
       * Find the _Fields constant that matches name, or null if its not found.
8966
       */
8967
      public static _Fields findByName(String name) {
8968
        return byName.get(name);
8969
      }
8970
 
8971
      private final short _thriftId;
8972
      private final String _fieldName;
8973
 
8974
      _Fields(short thriftId, String fieldName) {
8975
        _thriftId = thriftId;
8976
        _fieldName = fieldName;
8977
      }
8978
 
8979
      public short getThriftFieldId() {
8980
        return _thriftId;
8981
      }
8982
 
8983
      public String getFieldName() {
8984
        return _fieldName;
8985
      }
8986
    }
8987
 
8988
    // isset id assignments
8989
 
8990
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
8991
    static {
8992
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8993
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8994
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
8995
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), 
8996
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
8997
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8998
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
8999
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9000
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyRechargeCoupon_result.class, metaDataMap);
9001
    }
9002
 
9003
    public applyRechargeCoupon_result() {
9004
    }
9005
 
9006
    public applyRechargeCoupon_result(
9007
      Map<Long,String> success,
9008
      PromotionException pex)
9009
    {
9010
      this();
9011
      this.success = success;
9012
      this.pex = pex;
9013
    }
9014
 
9015
    /**
9016
     * Performs a deep copy on <i>other</i>.
9017
     */
9018
    public applyRechargeCoupon_result(applyRechargeCoupon_result other) {
9019
      if (other.isSetSuccess()) {
9020
        Map<Long,String> __this__success = new HashMap<Long,String>();
9021
        for (Map.Entry<Long, String> other_element : other.success.entrySet()) {
9022
 
9023
          Long other_element_key = other_element.getKey();
9024
          String other_element_value = other_element.getValue();
9025
 
9026
          Long __this__success_copy_key = other_element_key;
9027
 
9028
          String __this__success_copy_value = other_element_value;
9029
 
9030
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
9031
        }
9032
        this.success = __this__success;
9033
      }
9034
      if (other.isSetPex()) {
9035
        this.pex = new PromotionException(other.pex);
9036
      }
9037
    }
9038
 
9039
    public applyRechargeCoupon_result deepCopy() {
9040
      return new applyRechargeCoupon_result(this);
9041
    }
9042
 
9043
    @Override
9044
    public void clear() {
9045
      this.success = null;
9046
      this.pex = null;
9047
    }
9048
 
9049
    public int getSuccessSize() {
9050
      return (this.success == null) ? 0 : this.success.size();
9051
    }
9052
 
9053
    public void putToSuccess(long key, String val) {
9054
      if (this.success == null) {
9055
        this.success = new HashMap<Long,String>();
9056
      }
9057
      this.success.put(key, val);
9058
    }
9059
 
9060
    public Map<Long,String> getSuccess() {
9061
      return this.success;
9062
    }
9063
 
9064
    public void setSuccess(Map<Long,String> success) {
9065
      this.success = success;
9066
    }
9067
 
9068
    public void unsetSuccess() {
9069
      this.success = null;
9070
    }
9071
 
9072
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
9073
    public boolean isSetSuccess() {
9074
      return this.success != null;
9075
    }
9076
 
9077
    public void setSuccessIsSet(boolean value) {
9078
      if (!value) {
9079
        this.success = null;
9080
      }
9081
    }
9082
 
9083
    public PromotionException getPex() {
9084
      return this.pex;
9085
    }
9086
 
9087
    public void setPex(PromotionException pex) {
9088
      this.pex = pex;
9089
    }
9090
 
9091
    public void unsetPex() {
9092
      this.pex = null;
9093
    }
9094
 
9095
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
9096
    public boolean isSetPex() {
9097
      return this.pex != null;
9098
    }
9099
 
9100
    public void setPexIsSet(boolean value) {
9101
      if (!value) {
9102
        this.pex = null;
9103
      }
9104
    }
9105
 
9106
    public void setFieldValue(_Fields field, Object value) {
9107
      switch (field) {
9108
      case SUCCESS:
9109
        if (value == null) {
9110
          unsetSuccess();
9111
        } else {
9112
          setSuccess((Map<Long,String>)value);
9113
        }
9114
        break;
9115
 
9116
      case PEX:
9117
        if (value == null) {
9118
          unsetPex();
9119
        } else {
9120
          setPex((PromotionException)value);
9121
        }
9122
        break;
9123
 
9124
      }
9125
    }
9126
 
9127
    public Object getFieldValue(_Fields field) {
9128
      switch (field) {
9129
      case SUCCESS:
9130
        return getSuccess();
9131
 
9132
      case PEX:
9133
        return getPex();
9134
 
9135
      }
9136
      throw new IllegalStateException();
9137
    }
9138
 
9139
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9140
    public boolean isSet(_Fields field) {
9141
      if (field == null) {
9142
        throw new IllegalArgumentException();
9143
      }
9144
 
9145
      switch (field) {
9146
      case SUCCESS:
9147
        return isSetSuccess();
9148
      case PEX:
9149
        return isSetPex();
9150
      }
9151
      throw new IllegalStateException();
9152
    }
9153
 
9154
    @Override
9155
    public boolean equals(Object that) {
9156
      if (that == null)
9157
        return false;
9158
      if (that instanceof applyRechargeCoupon_result)
9159
        return this.equals((applyRechargeCoupon_result)that);
9160
      return false;
9161
    }
9162
 
9163
    public boolean equals(applyRechargeCoupon_result that) {
9164
      if (that == null)
9165
        return false;
9166
 
9167
      boolean this_present_success = true && this.isSetSuccess();
9168
      boolean that_present_success = true && that.isSetSuccess();
9169
      if (this_present_success || that_present_success) {
9170
        if (!(this_present_success && that_present_success))
9171
          return false;
9172
        if (!this.success.equals(that.success))
9173
          return false;
9174
      }
9175
 
9176
      boolean this_present_pex = true && this.isSetPex();
9177
      boolean that_present_pex = true && that.isSetPex();
9178
      if (this_present_pex || that_present_pex) {
9179
        if (!(this_present_pex && that_present_pex))
9180
          return false;
9181
        if (!this.pex.equals(that.pex))
9182
          return false;
9183
      }
9184
 
9185
      return true;
9186
    }
9187
 
9188
    @Override
9189
    public int hashCode() {
9190
      return 0;
9191
    }
9192
 
9193
    public int compareTo(applyRechargeCoupon_result other) {
9194
      if (!getClass().equals(other.getClass())) {
9195
        return getClass().getName().compareTo(other.getClass().getName());
9196
      }
9197
 
9198
      int lastComparison = 0;
9199
      applyRechargeCoupon_result typedOther = (applyRechargeCoupon_result)other;
9200
 
9201
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
9202
      if (lastComparison != 0) {
9203
        return lastComparison;
9204
      }
9205
      if (isSetSuccess()) {
9206
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
9207
        if (lastComparison != 0) {
9208
          return lastComparison;
9209
        }
9210
      }
9211
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
9212
      if (lastComparison != 0) {
9213
        return lastComparison;
9214
      }
9215
      if (isSetPex()) {
9216
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
9217
        if (lastComparison != 0) {
9218
          return lastComparison;
9219
        }
9220
      }
9221
      return 0;
9222
    }
9223
 
9224
    public _Fields fieldForId(int fieldId) {
9225
      return _Fields.findByThriftId(fieldId);
9226
    }
9227
 
9228
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9229
      org.apache.thrift.protocol.TField field;
9230
      iprot.readStructBegin();
9231
      while (true)
9232
      {
9233
        field = iprot.readFieldBegin();
9234
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
9235
          break;
9236
        }
9237
        switch (field.id) {
9238
          case 0: // SUCCESS
9239
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
9240
              {
6736 amit.gupta 9241
                org.apache.thrift.protocol.TMap _map21 = iprot.readMapBegin();
9242
                this.success = new HashMap<Long,String>(2*_map21.size);
9243
                for (int _i22 = 0; _i22 < _map21.size; ++_i22)
6433 anupam.sin 9244
                {
6736 amit.gupta 9245
                  long _key23; // required
9246
                  String _val24; // required
9247
                  _key23 = iprot.readI64();
9248
                  _val24 = iprot.readString();
9249
                  this.success.put(_key23, _val24);
6433 anupam.sin 9250
                }
9251
                iprot.readMapEnd();
9252
              }
9253
            } else { 
9254
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9255
            }
9256
            break;
9257
          case 1: // PEX
9258
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
9259
              this.pex = new PromotionException();
9260
              this.pex.read(iprot);
9261
            } else { 
9262
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9263
            }
9264
            break;
9265
          default:
9266
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9267
        }
9268
        iprot.readFieldEnd();
9269
      }
9270
      iprot.readStructEnd();
9271
      validate();
9272
    }
9273
 
9274
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
9275
      oprot.writeStructBegin(STRUCT_DESC);
9276
 
9277
      if (this.isSetSuccess()) {
9278
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
9279
        {
9280
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.STRING, this.success.size()));
6736 amit.gupta 9281
          for (Map.Entry<Long, String> _iter25 : this.success.entrySet())
6433 anupam.sin 9282
          {
6736 amit.gupta 9283
            oprot.writeI64(_iter25.getKey());
9284
            oprot.writeString(_iter25.getValue());
6433 anupam.sin 9285
          }
9286
          oprot.writeMapEnd();
9287
        }
9288
        oprot.writeFieldEnd();
9289
      } else if (this.isSetPex()) {
9290
        oprot.writeFieldBegin(PEX_FIELD_DESC);
9291
        this.pex.write(oprot);
9292
        oprot.writeFieldEnd();
9293
      }
9294
      oprot.writeFieldStop();
9295
      oprot.writeStructEnd();
9296
    }
9297
 
9298
    @Override
9299
    public String toString() {
9300
      StringBuilder sb = new StringBuilder("applyRechargeCoupon_result(");
9301
      boolean first = true;
9302
 
9303
      sb.append("success:");
9304
      if (this.success == null) {
9305
        sb.append("null");
9306
      } else {
9307
        sb.append(this.success);
9308
      }
9309
      first = false;
9310
      if (!first) sb.append(", ");
9311
      sb.append("pex:");
9312
      if (this.pex == null) {
9313
        sb.append("null");
9314
      } else {
9315
        sb.append(this.pex);
9316
      }
9317
      first = false;
9318
      sb.append(")");
9319
      return sb.toString();
9320
    }
9321
 
9322
    public void validate() throws org.apache.thrift.TException {
9323
      // check for required fields
9324
    }
9325
 
9326
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9327
      try {
9328
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9329
      } catch (org.apache.thrift.TException te) {
9330
        throw new java.io.IOException(te);
9331
      }
9332
    }
9333
 
9334
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9335
      try {
9336
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9337
      } catch (org.apache.thrift.TException te) {
9338
        throw new java.io.IOException(te);
9339
      }
9340
    }
9341
 
9342
  }
9343
 
3430 rajveer 9344
  public static class trackCouponUsage_args implements org.apache.thrift.TBase<trackCouponUsage_args, trackCouponUsage_args._Fields>, java.io.Serializable, Cloneable   {
9345
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_args");
1982 varun.gupt 9346
 
3430 rajveer 9347
    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);
9348
    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);
9349
    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 9350
 
3430 rajveer 9351
    private String couponCode; // required
9352
    private long transactionId; // required
9353
    private long userId; // required
1982 varun.gupt 9354
 
9355
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 9356
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 9357
      COUPON_CODE((short)1, "couponCode"),
9358
      TRANSACTION_ID((short)2, "transactionId"),
9359
      USER_ID((short)3, "userId");
9360
 
9361
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9362
 
9363
      static {
9364
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9365
          byName.put(field.getFieldName(), field);
9366
        }
9367
      }
9368
 
9369
      /**
9370
       * Find the _Fields constant that matches fieldId, or null if its not found.
9371
       */
9372
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 9373
        switch(fieldId) {
9374
          case 1: // COUPON_CODE
9375
            return COUPON_CODE;
9376
          case 2: // TRANSACTION_ID
9377
            return TRANSACTION_ID;
9378
          case 3: // USER_ID
9379
            return USER_ID;
9380
          default:
9381
            return null;
9382
        }
1982 varun.gupt 9383
      }
9384
 
9385
      /**
9386
       * Find the _Fields constant that matches fieldId, throwing an exception
9387
       * if it is not found.
9388
       */
9389
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9390
        _Fields fields = findByThriftId(fieldId);
9391
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9392
        return fields;
9393
      }
9394
 
9395
      /**
9396
       * Find the _Fields constant that matches name, or null if its not found.
9397
       */
9398
      public static _Fields findByName(String name) {
9399
        return byName.get(name);
9400
      }
9401
 
9402
      private final short _thriftId;
9403
      private final String _fieldName;
9404
 
9405
      _Fields(short thriftId, String fieldName) {
9406
        _thriftId = thriftId;
9407
        _fieldName = fieldName;
9408
      }
9409
 
9410
      public short getThriftFieldId() {
9411
        return _thriftId;
9412
      }
9413
 
9414
      public String getFieldName() {
9415
        return _fieldName;
9416
      }
9417
    }
9418
 
9419
    // isset id assignments
9420
    private static final int __TRANSACTIONID_ISSET_ID = 0;
9421
    private static final int __USERID_ISSET_ID = 1;
9422
    private BitSet __isset_bit_vector = new BitSet(2);
9423
 
3430 rajveer 9424
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 9425
    static {
3430 rajveer 9426
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9427
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9428
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
9429
      tmpMap.put(_Fields.TRANSACTION_ID, new org.apache.thrift.meta_data.FieldMetaData("transactionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9430
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9431
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9432
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9433
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9434
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_args.class, metaDataMap);
1982 varun.gupt 9435
    }
9436
 
9437
    public trackCouponUsage_args() {
9438
    }
9439
 
9440
    public trackCouponUsage_args(
9441
      String couponCode,
9442
      long transactionId,
9443
      long userId)
9444
    {
9445
      this();
9446
      this.couponCode = couponCode;
9447
      this.transactionId = transactionId;
9448
      setTransactionIdIsSet(true);
9449
      this.userId = userId;
9450
      setUserIdIsSet(true);
9451
    }
9452
 
9453
    /**
9454
     * Performs a deep copy on <i>other</i>.
9455
     */
9456
    public trackCouponUsage_args(trackCouponUsage_args other) {
9457
      __isset_bit_vector.clear();
9458
      __isset_bit_vector.or(other.__isset_bit_vector);
9459
      if (other.isSetCouponCode()) {
9460
        this.couponCode = other.couponCode;
9461
      }
9462
      this.transactionId = other.transactionId;
9463
      this.userId = other.userId;
9464
    }
9465
 
9466
    public trackCouponUsage_args deepCopy() {
9467
      return new trackCouponUsage_args(this);
9468
    }
9469
 
3430 rajveer 9470
    @Override
9471
    public void clear() {
9472
      this.couponCode = null;
9473
      setTransactionIdIsSet(false);
9474
      this.transactionId = 0;
9475
      setUserIdIsSet(false);
9476
      this.userId = 0;
1982 varun.gupt 9477
    }
9478
 
9479
    public String getCouponCode() {
9480
      return this.couponCode;
9481
    }
9482
 
3430 rajveer 9483
    public void setCouponCode(String couponCode) {
1982 varun.gupt 9484
      this.couponCode = couponCode;
9485
    }
9486
 
9487
    public void unsetCouponCode() {
9488
      this.couponCode = null;
9489
    }
9490
 
3430 rajveer 9491
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 9492
    public boolean isSetCouponCode() {
9493
      return this.couponCode != null;
9494
    }
9495
 
9496
    public void setCouponCodeIsSet(boolean value) {
9497
      if (!value) {
9498
        this.couponCode = null;
9499
      }
9500
    }
9501
 
9502
    public long getTransactionId() {
9503
      return this.transactionId;
9504
    }
9505
 
3430 rajveer 9506
    public void setTransactionId(long transactionId) {
1982 varun.gupt 9507
      this.transactionId = transactionId;
9508
      setTransactionIdIsSet(true);
9509
    }
9510
 
9511
    public void unsetTransactionId() {
9512
      __isset_bit_vector.clear(__TRANSACTIONID_ISSET_ID);
9513
    }
9514
 
3430 rajveer 9515
    /** Returns true if field transactionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 9516
    public boolean isSetTransactionId() {
9517
      return __isset_bit_vector.get(__TRANSACTIONID_ISSET_ID);
9518
    }
9519
 
9520
    public void setTransactionIdIsSet(boolean value) {
9521
      __isset_bit_vector.set(__TRANSACTIONID_ISSET_ID, value);
9522
    }
9523
 
9524
    public long getUserId() {
9525
      return this.userId;
9526
    }
9527
 
3430 rajveer 9528
    public void setUserId(long userId) {
1982 varun.gupt 9529
      this.userId = userId;
9530
      setUserIdIsSet(true);
9531
    }
9532
 
9533
    public void unsetUserId() {
9534
      __isset_bit_vector.clear(__USERID_ISSET_ID);
9535
    }
9536
 
3430 rajveer 9537
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 9538
    public boolean isSetUserId() {
9539
      return __isset_bit_vector.get(__USERID_ISSET_ID);
9540
    }
9541
 
9542
    public void setUserIdIsSet(boolean value) {
9543
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
9544
    }
9545
 
9546
    public void setFieldValue(_Fields field, Object value) {
9547
      switch (field) {
9548
      case COUPON_CODE:
9549
        if (value == null) {
9550
          unsetCouponCode();
9551
        } else {
9552
          setCouponCode((String)value);
9553
        }
9554
        break;
9555
 
9556
      case TRANSACTION_ID:
9557
        if (value == null) {
9558
          unsetTransactionId();
9559
        } else {
9560
          setTransactionId((Long)value);
9561
        }
9562
        break;
9563
 
9564
      case USER_ID:
9565
        if (value == null) {
9566
          unsetUserId();
9567
        } else {
9568
          setUserId((Long)value);
9569
        }
9570
        break;
9571
 
9572
      }
9573
    }
9574
 
9575
    public Object getFieldValue(_Fields field) {
9576
      switch (field) {
9577
      case COUPON_CODE:
9578
        return getCouponCode();
9579
 
9580
      case TRANSACTION_ID:
3430 rajveer 9581
        return Long.valueOf(getTransactionId());
1982 varun.gupt 9582
 
9583
      case USER_ID:
3430 rajveer 9584
        return Long.valueOf(getUserId());
1982 varun.gupt 9585
 
9586
      }
9587
      throw new IllegalStateException();
9588
    }
9589
 
3430 rajveer 9590
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9591
    public boolean isSet(_Fields field) {
9592
      if (field == null) {
9593
        throw new IllegalArgumentException();
9594
      }
1982 varun.gupt 9595
 
9596
      switch (field) {
9597
      case COUPON_CODE:
9598
        return isSetCouponCode();
9599
      case TRANSACTION_ID:
9600
        return isSetTransactionId();
9601
      case USER_ID:
9602
        return isSetUserId();
9603
      }
9604
      throw new IllegalStateException();
9605
    }
9606
 
9607
    @Override
9608
    public boolean equals(Object that) {
9609
      if (that == null)
9610
        return false;
9611
      if (that instanceof trackCouponUsage_args)
9612
        return this.equals((trackCouponUsage_args)that);
9613
      return false;
9614
    }
9615
 
9616
    public boolean equals(trackCouponUsage_args that) {
9617
      if (that == null)
9618
        return false;
9619
 
9620
      boolean this_present_couponCode = true && this.isSetCouponCode();
9621
      boolean that_present_couponCode = true && that.isSetCouponCode();
9622
      if (this_present_couponCode || that_present_couponCode) {
9623
        if (!(this_present_couponCode && that_present_couponCode))
9624
          return false;
9625
        if (!this.couponCode.equals(that.couponCode))
9626
          return false;
9627
      }
9628
 
9629
      boolean this_present_transactionId = true;
9630
      boolean that_present_transactionId = true;
9631
      if (this_present_transactionId || that_present_transactionId) {
9632
        if (!(this_present_transactionId && that_present_transactionId))
9633
          return false;
9634
        if (this.transactionId != that.transactionId)
9635
          return false;
9636
      }
9637
 
9638
      boolean this_present_userId = true;
9639
      boolean that_present_userId = true;
9640
      if (this_present_userId || that_present_userId) {
9641
        if (!(this_present_userId && that_present_userId))
9642
          return false;
9643
        if (this.userId != that.userId)
9644
          return false;
9645
      }
9646
 
9647
      return true;
9648
    }
9649
 
9650
    @Override
9651
    public int hashCode() {
9652
      return 0;
9653
    }
9654
 
9655
    public int compareTo(trackCouponUsage_args other) {
9656
      if (!getClass().equals(other.getClass())) {
9657
        return getClass().getName().compareTo(other.getClass().getName());
9658
      }
9659
 
9660
      int lastComparison = 0;
9661
      trackCouponUsage_args typedOther = (trackCouponUsage_args)other;
9662
 
3430 rajveer 9663
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 9664
      if (lastComparison != 0) {
9665
        return lastComparison;
9666
      }
3430 rajveer 9667
      if (isSetCouponCode()) {
9668
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
9669
        if (lastComparison != 0) {
9670
          return lastComparison;
9671
        }
1982 varun.gupt 9672
      }
3430 rajveer 9673
      lastComparison = Boolean.valueOf(isSetTransactionId()).compareTo(typedOther.isSetTransactionId());
1982 varun.gupt 9674
      if (lastComparison != 0) {
9675
        return lastComparison;
9676
      }
3430 rajveer 9677
      if (isSetTransactionId()) {
9678
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transactionId, typedOther.transactionId);
9679
        if (lastComparison != 0) {
9680
          return lastComparison;
9681
        }
1982 varun.gupt 9682
      }
3430 rajveer 9683
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 9684
      if (lastComparison != 0) {
9685
        return lastComparison;
9686
      }
3430 rajveer 9687
      if (isSetUserId()) {
9688
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
9689
        if (lastComparison != 0) {
9690
          return lastComparison;
9691
        }
1982 varun.gupt 9692
      }
9693
      return 0;
9694
    }
9695
 
3430 rajveer 9696
    public _Fields fieldForId(int fieldId) {
9697
      return _Fields.findByThriftId(fieldId);
9698
    }
9699
 
9700
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9701
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 9702
      iprot.readStructBegin();
9703
      while (true)
9704
      {
9705
        field = iprot.readFieldBegin();
3430 rajveer 9706
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 9707
          break;
9708
        }
3430 rajveer 9709
        switch (field.id) {
9710
          case 1: // COUPON_CODE
9711
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
9712
              this.couponCode = iprot.readString();
9713
            } else { 
9714
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9715
            }
9716
            break;
9717
          case 2: // TRANSACTION_ID
9718
            if (field.type == org.apache.thrift.protocol.TType.I64) {
9719
              this.transactionId = iprot.readI64();
9720
              setTransactionIdIsSet(true);
9721
            } else { 
9722
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9723
            }
9724
            break;
9725
          case 3: // USER_ID
9726
            if (field.type == org.apache.thrift.protocol.TType.I64) {
9727
              this.userId = iprot.readI64();
9728
              setUserIdIsSet(true);
9729
            } else { 
9730
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9731
            }
9732
            break;
9733
          default:
9734
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 9735
        }
3430 rajveer 9736
        iprot.readFieldEnd();
1982 varun.gupt 9737
      }
9738
      iprot.readStructEnd();
9739
      validate();
9740
    }
9741
 
3430 rajveer 9742
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 9743
      validate();
9744
 
9745
      oprot.writeStructBegin(STRUCT_DESC);
9746
      if (this.couponCode != null) {
9747
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
9748
        oprot.writeString(this.couponCode);
9749
        oprot.writeFieldEnd();
9750
      }
9751
      oprot.writeFieldBegin(TRANSACTION_ID_FIELD_DESC);
9752
      oprot.writeI64(this.transactionId);
9753
      oprot.writeFieldEnd();
9754
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
9755
      oprot.writeI64(this.userId);
9756
      oprot.writeFieldEnd();
9757
      oprot.writeFieldStop();
9758
      oprot.writeStructEnd();
9759
    }
9760
 
9761
    @Override
9762
    public String toString() {
9763
      StringBuilder sb = new StringBuilder("trackCouponUsage_args(");
9764
      boolean first = true;
9765
 
9766
      sb.append("couponCode:");
9767
      if (this.couponCode == null) {
9768
        sb.append("null");
9769
      } else {
9770
        sb.append(this.couponCode);
9771
      }
9772
      first = false;
9773
      if (!first) sb.append(", ");
9774
      sb.append("transactionId:");
9775
      sb.append(this.transactionId);
9776
      first = false;
9777
      if (!first) sb.append(", ");
9778
      sb.append("userId:");
9779
      sb.append(this.userId);
9780
      first = false;
9781
      sb.append(")");
9782
      return sb.toString();
9783
    }
9784
 
3430 rajveer 9785
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 9786
      // check for required fields
9787
    }
9788
 
3430 rajveer 9789
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9790
      try {
9791
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9792
      } catch (org.apache.thrift.TException te) {
9793
        throw new java.io.IOException(te);
9794
      }
9795
    }
9796
 
9797
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9798
      try {
9799
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
9800
        __isset_bit_vector = new BitSet(1);
9801
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9802
      } catch (org.apache.thrift.TException te) {
9803
        throw new java.io.IOException(te);
9804
      }
9805
    }
9806
 
1982 varun.gupt 9807
  }
9808
 
3430 rajveer 9809
  public static class trackCouponUsage_result implements org.apache.thrift.TBase<trackCouponUsage_result, trackCouponUsage_result._Fields>, java.io.Serializable, Cloneable   {
9810
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_result");
1982 varun.gupt 9811
 
3430 rajveer 9812
    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 9813
 
3430 rajveer 9814
    private PromotionException pex; // required
1982 varun.gupt 9815
 
9816
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 9817
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 9818
      PEX((short)1, "pex");
9819
 
9820
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9821
 
9822
      static {
9823
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9824
          byName.put(field.getFieldName(), field);
9825
        }
9826
      }
9827
 
9828
      /**
9829
       * Find the _Fields constant that matches fieldId, or null if its not found.
9830
       */
9831
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 9832
        switch(fieldId) {
9833
          case 1: // PEX
9834
            return PEX;
9835
          default:
9836
            return null;
9837
        }
1982 varun.gupt 9838
      }
9839
 
9840
      /**
9841
       * Find the _Fields constant that matches fieldId, throwing an exception
9842
       * if it is not found.
9843
       */
9844
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9845
        _Fields fields = findByThriftId(fieldId);
9846
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9847
        return fields;
9848
      }
9849
 
9850
      /**
9851
       * Find the _Fields constant that matches name, or null if its not found.
9852
       */
9853
      public static _Fields findByName(String name) {
9854
        return byName.get(name);
9855
      }
9856
 
9857
      private final short _thriftId;
9858
      private final String _fieldName;
9859
 
9860
      _Fields(short thriftId, String fieldName) {
9861
        _thriftId = thriftId;
9862
        _fieldName = fieldName;
9863
      }
9864
 
9865
      public short getThriftFieldId() {
9866
        return _thriftId;
9867
      }
9868
 
9869
      public String getFieldName() {
9870
        return _fieldName;
9871
      }
9872
    }
9873
 
9874
    // isset id assignments
9875
 
3430 rajveer 9876
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 9877
    static {
3430 rajveer 9878
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9879
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9880
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
9881
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9882
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_result.class, metaDataMap);
1982 varun.gupt 9883
    }
9884
 
9885
    public trackCouponUsage_result() {
9886
    }
9887
 
9888
    public trackCouponUsage_result(
9889
      PromotionException pex)
9890
    {
9891
      this();
9892
      this.pex = pex;
9893
    }
9894
 
9895
    /**
9896
     * Performs a deep copy on <i>other</i>.
9897
     */
9898
    public trackCouponUsage_result(trackCouponUsage_result other) {
9899
      if (other.isSetPex()) {
9900
        this.pex = new PromotionException(other.pex);
9901
      }
9902
    }
9903
 
9904
    public trackCouponUsage_result deepCopy() {
9905
      return new trackCouponUsage_result(this);
9906
    }
9907
 
3430 rajveer 9908
    @Override
9909
    public void clear() {
9910
      this.pex = null;
1982 varun.gupt 9911
    }
9912
 
9913
    public PromotionException getPex() {
9914
      return this.pex;
9915
    }
9916
 
3430 rajveer 9917
    public void setPex(PromotionException pex) {
1982 varun.gupt 9918
      this.pex = pex;
9919
    }
9920
 
9921
    public void unsetPex() {
9922
      this.pex = null;
9923
    }
9924
 
3430 rajveer 9925
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 9926
    public boolean isSetPex() {
9927
      return this.pex != null;
9928
    }
9929
 
9930
    public void setPexIsSet(boolean value) {
9931
      if (!value) {
9932
        this.pex = null;
9933
      }
9934
    }
9935
 
9936
    public void setFieldValue(_Fields field, Object value) {
9937
      switch (field) {
9938
      case PEX:
9939
        if (value == null) {
9940
          unsetPex();
9941
        } else {
9942
          setPex((PromotionException)value);
9943
        }
9944
        break;
9945
 
9946
      }
9947
    }
9948
 
9949
    public Object getFieldValue(_Fields field) {
9950
      switch (field) {
9951
      case PEX:
9952
        return getPex();
9953
 
9954
      }
9955
      throw new IllegalStateException();
9956
    }
9957
 
3430 rajveer 9958
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9959
    public boolean isSet(_Fields field) {
9960
      if (field == null) {
9961
        throw new IllegalArgumentException();
9962
      }
1982 varun.gupt 9963
 
9964
      switch (field) {
9965
      case PEX:
9966
        return isSetPex();
9967
      }
9968
      throw new IllegalStateException();
9969
    }
9970
 
9971
    @Override
9972
    public boolean equals(Object that) {
9973
      if (that == null)
9974
        return false;
9975
      if (that instanceof trackCouponUsage_result)
9976
        return this.equals((trackCouponUsage_result)that);
9977
      return false;
9978
    }
9979
 
9980
    public boolean equals(trackCouponUsage_result that) {
9981
      if (that == null)
9982
        return false;
9983
 
9984
      boolean this_present_pex = true && this.isSetPex();
9985
      boolean that_present_pex = true && that.isSetPex();
9986
      if (this_present_pex || that_present_pex) {
9987
        if (!(this_present_pex && that_present_pex))
9988
          return false;
9989
        if (!this.pex.equals(that.pex))
9990
          return false;
9991
      }
9992
 
9993
      return true;
9994
    }
9995
 
9996
    @Override
9997
    public int hashCode() {
9998
      return 0;
9999
    }
10000
 
10001
    public int compareTo(trackCouponUsage_result other) {
10002
      if (!getClass().equals(other.getClass())) {
10003
        return getClass().getName().compareTo(other.getClass().getName());
10004
      }
10005
 
10006
      int lastComparison = 0;
10007
      trackCouponUsage_result typedOther = (trackCouponUsage_result)other;
10008
 
3430 rajveer 10009
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 10010
      if (lastComparison != 0) {
10011
        return lastComparison;
10012
      }
3430 rajveer 10013
      if (isSetPex()) {
10014
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
10015
        if (lastComparison != 0) {
10016
          return lastComparison;
10017
        }
1982 varun.gupt 10018
      }
10019
      return 0;
10020
    }
10021
 
3430 rajveer 10022
    public _Fields fieldForId(int fieldId) {
10023
      return _Fields.findByThriftId(fieldId);
10024
    }
10025
 
10026
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10027
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 10028
      iprot.readStructBegin();
10029
      while (true)
10030
      {
10031
        field = iprot.readFieldBegin();
3430 rajveer 10032
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 10033
          break;
10034
        }
3430 rajveer 10035
        switch (field.id) {
10036
          case 1: // PEX
10037
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
10038
              this.pex = new PromotionException();
10039
              this.pex.read(iprot);
10040
            } else { 
10041
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10042
            }
10043
            break;
10044
          default:
10045
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 10046
        }
3430 rajveer 10047
        iprot.readFieldEnd();
1982 varun.gupt 10048
      }
10049
      iprot.readStructEnd();
10050
      validate();
10051
    }
10052
 
3430 rajveer 10053
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 10054
      oprot.writeStructBegin(STRUCT_DESC);
10055
 
10056
      if (this.isSetPex()) {
10057
        oprot.writeFieldBegin(PEX_FIELD_DESC);
10058
        this.pex.write(oprot);
10059
        oprot.writeFieldEnd();
10060
      }
10061
      oprot.writeFieldStop();
10062
      oprot.writeStructEnd();
10063
    }
10064
 
10065
    @Override
10066
    public String toString() {
10067
      StringBuilder sb = new StringBuilder("trackCouponUsage_result(");
10068
      boolean first = true;
10069
 
10070
      sb.append("pex:");
10071
      if (this.pex == null) {
10072
        sb.append("null");
10073
      } else {
10074
        sb.append(this.pex);
10075
      }
10076
      first = false;
10077
      sb.append(")");
10078
      return sb.toString();
10079
    }
10080
 
3430 rajveer 10081
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 10082
      // check for required fields
10083
    }
10084
 
3430 rajveer 10085
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10086
      try {
10087
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10088
      } catch (org.apache.thrift.TException te) {
10089
        throw new java.io.IOException(te);
10090
      }
10091
    }
10092
 
10093
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10094
      try {
10095
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10096
      } catch (org.apache.thrift.TException te) {
10097
        throw new java.io.IOException(te);
10098
      }
10099
    }
10100
 
1982 varun.gupt 10101
  }
10102
 
3430 rajveer 10103
  public static class getCouponUsageCountByUser_args implements org.apache.thrift.TBase<getCouponUsageCountByUser_args, getCouponUsageCountByUser_args._Fields>, java.io.Serializable, Cloneable   {
10104
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_args");
1982 varun.gupt 10105
 
3430 rajveer 10106
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)1);
10107
    private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.I64, (short)2);
1982 varun.gupt 10108
 
3430 rajveer 10109
    private String couponCode; // required
10110
    private long userId; // required
1982 varun.gupt 10111
 
10112
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 10113
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 10114
      COUPON_CODE((short)1, "couponCode"),
10115
      USER_ID((short)2, "userId");
10116
 
10117
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10118
 
10119
      static {
10120
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10121
          byName.put(field.getFieldName(), field);
10122
        }
10123
      }
10124
 
10125
      /**
10126
       * Find the _Fields constant that matches fieldId, or null if its not found.
10127
       */
10128
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 10129
        switch(fieldId) {
10130
          case 1: // COUPON_CODE
10131
            return COUPON_CODE;
10132
          case 2: // USER_ID
10133
            return USER_ID;
10134
          default:
10135
            return null;
10136
        }
1982 varun.gupt 10137
      }
10138
 
10139
      /**
10140
       * Find the _Fields constant that matches fieldId, throwing an exception
10141
       * if it is not found.
10142
       */
10143
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10144
        _Fields fields = findByThriftId(fieldId);
10145
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10146
        return fields;
10147
      }
10148
 
10149
      /**
10150
       * Find the _Fields constant that matches name, or null if its not found.
10151
       */
10152
      public static _Fields findByName(String name) {
10153
        return byName.get(name);
10154
      }
10155
 
10156
      private final short _thriftId;
10157
      private final String _fieldName;
10158
 
10159
      _Fields(short thriftId, String fieldName) {
10160
        _thriftId = thriftId;
10161
        _fieldName = fieldName;
10162
      }
10163
 
10164
      public short getThriftFieldId() {
10165
        return _thriftId;
10166
      }
10167
 
10168
      public String getFieldName() {
10169
        return _fieldName;
10170
      }
10171
    }
10172
 
10173
    // isset id assignments
10174
    private static final int __USERID_ISSET_ID = 0;
10175
    private BitSet __isset_bit_vector = new BitSet(1);
10176
 
3430 rajveer 10177
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 10178
    static {
3430 rajveer 10179
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10180
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10181
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
10182
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10183
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
10184
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10185
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_args.class, metaDataMap);
1982 varun.gupt 10186
    }
10187
 
10188
    public getCouponUsageCountByUser_args() {
10189
    }
10190
 
10191
    public getCouponUsageCountByUser_args(
10192
      String couponCode,
10193
      long userId)
10194
    {
10195
      this();
10196
      this.couponCode = couponCode;
10197
      this.userId = userId;
10198
      setUserIdIsSet(true);
10199
    }
10200
 
10201
    /**
10202
     * Performs a deep copy on <i>other</i>.
10203
     */
10204
    public getCouponUsageCountByUser_args(getCouponUsageCountByUser_args other) {
10205
      __isset_bit_vector.clear();
10206
      __isset_bit_vector.or(other.__isset_bit_vector);
10207
      if (other.isSetCouponCode()) {
10208
        this.couponCode = other.couponCode;
10209
      }
10210
      this.userId = other.userId;
10211
    }
10212
 
10213
    public getCouponUsageCountByUser_args deepCopy() {
10214
      return new getCouponUsageCountByUser_args(this);
10215
    }
10216
 
3430 rajveer 10217
    @Override
10218
    public void clear() {
10219
      this.couponCode = null;
10220
      setUserIdIsSet(false);
10221
      this.userId = 0;
1982 varun.gupt 10222
    }
10223
 
10224
    public String getCouponCode() {
10225
      return this.couponCode;
10226
    }
10227
 
3430 rajveer 10228
    public void setCouponCode(String couponCode) {
1982 varun.gupt 10229
      this.couponCode = couponCode;
10230
    }
10231
 
10232
    public void unsetCouponCode() {
10233
      this.couponCode = null;
10234
    }
10235
 
3430 rajveer 10236
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 10237
    public boolean isSetCouponCode() {
10238
      return this.couponCode != null;
10239
    }
10240
 
10241
    public void setCouponCodeIsSet(boolean value) {
10242
      if (!value) {
10243
        this.couponCode = null;
10244
      }
10245
    }
10246
 
10247
    public long getUserId() {
10248
      return this.userId;
10249
    }
10250
 
3430 rajveer 10251
    public void setUserId(long userId) {
1982 varun.gupt 10252
      this.userId = userId;
10253
      setUserIdIsSet(true);
10254
    }
10255
 
10256
    public void unsetUserId() {
10257
      __isset_bit_vector.clear(__USERID_ISSET_ID);
10258
    }
10259
 
3430 rajveer 10260
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 10261
    public boolean isSetUserId() {
10262
      return __isset_bit_vector.get(__USERID_ISSET_ID);
10263
    }
10264
 
10265
    public void setUserIdIsSet(boolean value) {
10266
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
10267
    }
10268
 
10269
    public void setFieldValue(_Fields field, Object value) {
10270
      switch (field) {
10271
      case COUPON_CODE:
10272
        if (value == null) {
10273
          unsetCouponCode();
10274
        } else {
10275
          setCouponCode((String)value);
10276
        }
10277
        break;
10278
 
10279
      case USER_ID:
10280
        if (value == null) {
10281
          unsetUserId();
10282
        } else {
10283
          setUserId((Long)value);
10284
        }
10285
        break;
10286
 
10287
      }
10288
    }
10289
 
10290
    public Object getFieldValue(_Fields field) {
10291
      switch (field) {
10292
      case COUPON_CODE:
10293
        return getCouponCode();
10294
 
10295
      case USER_ID:
3430 rajveer 10296
        return Long.valueOf(getUserId());
1982 varun.gupt 10297
 
10298
      }
10299
      throw new IllegalStateException();
10300
    }
10301
 
3430 rajveer 10302
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10303
    public boolean isSet(_Fields field) {
10304
      if (field == null) {
10305
        throw new IllegalArgumentException();
10306
      }
1982 varun.gupt 10307
 
10308
      switch (field) {
10309
      case COUPON_CODE:
10310
        return isSetCouponCode();
10311
      case USER_ID:
10312
        return isSetUserId();
10313
      }
10314
      throw new IllegalStateException();
10315
    }
10316
 
10317
    @Override
10318
    public boolean equals(Object that) {
10319
      if (that == null)
10320
        return false;
10321
      if (that instanceof getCouponUsageCountByUser_args)
10322
        return this.equals((getCouponUsageCountByUser_args)that);
10323
      return false;
10324
    }
10325
 
10326
    public boolean equals(getCouponUsageCountByUser_args that) {
10327
      if (that == null)
10328
        return false;
10329
 
10330
      boolean this_present_couponCode = true && this.isSetCouponCode();
10331
      boolean that_present_couponCode = true && that.isSetCouponCode();
10332
      if (this_present_couponCode || that_present_couponCode) {
10333
        if (!(this_present_couponCode && that_present_couponCode))
10334
          return false;
10335
        if (!this.couponCode.equals(that.couponCode))
10336
          return false;
10337
      }
10338
 
10339
      boolean this_present_userId = true;
10340
      boolean that_present_userId = true;
10341
      if (this_present_userId || that_present_userId) {
10342
        if (!(this_present_userId && that_present_userId))
10343
          return false;
10344
        if (this.userId != that.userId)
10345
          return false;
10346
      }
10347
 
10348
      return true;
10349
    }
10350
 
10351
    @Override
10352
    public int hashCode() {
10353
      return 0;
10354
    }
10355
 
10356
    public int compareTo(getCouponUsageCountByUser_args other) {
10357
      if (!getClass().equals(other.getClass())) {
10358
        return getClass().getName().compareTo(other.getClass().getName());
10359
      }
10360
 
10361
      int lastComparison = 0;
10362
      getCouponUsageCountByUser_args typedOther = (getCouponUsageCountByUser_args)other;
10363
 
3430 rajveer 10364
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 10365
      if (lastComparison != 0) {
10366
        return lastComparison;
10367
      }
3430 rajveer 10368
      if (isSetCouponCode()) {
10369
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
10370
        if (lastComparison != 0) {
10371
          return lastComparison;
10372
        }
1982 varun.gupt 10373
      }
3430 rajveer 10374
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 10375
      if (lastComparison != 0) {
10376
        return lastComparison;
10377
      }
3430 rajveer 10378
      if (isSetUserId()) {
10379
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
10380
        if (lastComparison != 0) {
10381
          return lastComparison;
10382
        }
1982 varun.gupt 10383
      }
10384
      return 0;
10385
    }
10386
 
3430 rajveer 10387
    public _Fields fieldForId(int fieldId) {
10388
      return _Fields.findByThriftId(fieldId);
10389
    }
10390
 
10391
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10392
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 10393
      iprot.readStructBegin();
10394
      while (true)
10395
      {
10396
        field = iprot.readFieldBegin();
3430 rajveer 10397
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 10398
          break;
10399
        }
3430 rajveer 10400
        switch (field.id) {
10401
          case 1: // COUPON_CODE
10402
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
10403
              this.couponCode = iprot.readString();
10404
            } else { 
10405
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10406
            }
10407
            break;
10408
          case 2: // USER_ID
10409
            if (field.type == org.apache.thrift.protocol.TType.I64) {
10410
              this.userId = iprot.readI64();
10411
              setUserIdIsSet(true);
10412
            } else { 
10413
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10414
            }
10415
            break;
10416
          default:
10417
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 10418
        }
3430 rajveer 10419
        iprot.readFieldEnd();
1982 varun.gupt 10420
      }
10421
      iprot.readStructEnd();
10422
      validate();
10423
    }
10424
 
3430 rajveer 10425
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 10426
      validate();
10427
 
10428
      oprot.writeStructBegin(STRUCT_DESC);
10429
      if (this.couponCode != null) {
10430
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
10431
        oprot.writeString(this.couponCode);
10432
        oprot.writeFieldEnd();
10433
      }
10434
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
10435
      oprot.writeI64(this.userId);
10436
      oprot.writeFieldEnd();
10437
      oprot.writeFieldStop();
10438
      oprot.writeStructEnd();
10439
    }
10440
 
10441
    @Override
10442
    public String toString() {
10443
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_args(");
10444
      boolean first = true;
10445
 
10446
      sb.append("couponCode:");
10447
      if (this.couponCode == null) {
10448
        sb.append("null");
10449
      } else {
10450
        sb.append(this.couponCode);
10451
      }
10452
      first = false;
10453
      if (!first) sb.append(", ");
10454
      sb.append("userId:");
10455
      sb.append(this.userId);
10456
      first = false;
10457
      sb.append(")");
10458
      return sb.toString();
10459
    }
10460
 
3430 rajveer 10461
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 10462
      // check for required fields
10463
    }
10464
 
3430 rajveer 10465
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10466
      try {
10467
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10468
      } catch (org.apache.thrift.TException te) {
10469
        throw new java.io.IOException(te);
10470
      }
10471
    }
10472
 
10473
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10474
      try {
10475
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
10476
        __isset_bit_vector = new BitSet(1);
10477
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10478
      } catch (org.apache.thrift.TException te) {
10479
        throw new java.io.IOException(te);
10480
      }
10481
    }
10482
 
1982 varun.gupt 10483
  }
10484
 
3430 rajveer 10485
  public static class getCouponUsageCountByUser_result implements org.apache.thrift.TBase<getCouponUsageCountByUser_result, getCouponUsageCountByUser_result._Fields>, java.io.Serializable, Cloneable   {
10486
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_result");
1982 varun.gupt 10487
 
3430 rajveer 10488
    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);
10489
    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 10490
 
3430 rajveer 10491
    private long success; // required
10492
    private PromotionException pex; // required
1982 varun.gupt 10493
 
10494
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 10495
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 10496
      SUCCESS((short)0, "success"),
10497
      PEX((short)1, "pex");
10498
 
10499
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10500
 
10501
      static {
10502
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10503
          byName.put(field.getFieldName(), field);
10504
        }
10505
      }
10506
 
10507
      /**
10508
       * Find the _Fields constant that matches fieldId, or null if its not found.
10509
       */
10510
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 10511
        switch(fieldId) {
10512
          case 0: // SUCCESS
10513
            return SUCCESS;
10514
          case 1: // PEX
10515
            return PEX;
10516
          default:
10517
            return null;
10518
        }
1982 varun.gupt 10519
      }
10520
 
10521
      /**
10522
       * Find the _Fields constant that matches fieldId, throwing an exception
10523
       * if it is not found.
10524
       */
10525
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10526
        _Fields fields = findByThriftId(fieldId);
10527
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10528
        return fields;
10529
      }
10530
 
10531
      /**
10532
       * Find the _Fields constant that matches name, or null if its not found.
10533
       */
10534
      public static _Fields findByName(String name) {
10535
        return byName.get(name);
10536
      }
10537
 
10538
      private final short _thriftId;
10539
      private final String _fieldName;
10540
 
10541
      _Fields(short thriftId, String fieldName) {
10542
        _thriftId = thriftId;
10543
        _fieldName = fieldName;
10544
      }
10545
 
10546
      public short getThriftFieldId() {
10547
        return _thriftId;
10548
      }
10549
 
10550
      public String getFieldName() {
10551
        return _fieldName;
10552
      }
10553
    }
10554
 
10555
    // isset id assignments
10556
    private static final int __SUCCESS_ISSET_ID = 0;
10557
    private BitSet __isset_bit_vector = new BitSet(1);
10558
 
3430 rajveer 10559
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 10560
    static {
3430 rajveer 10561
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10562
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10563
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
10564
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10565
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
10566
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10567
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_result.class, metaDataMap);
1982 varun.gupt 10568
    }
10569
 
10570
    public getCouponUsageCountByUser_result() {
10571
    }
10572
 
10573
    public getCouponUsageCountByUser_result(
10574
      long success,
10575
      PromotionException pex)
10576
    {
10577
      this();
10578
      this.success = success;
10579
      setSuccessIsSet(true);
10580
      this.pex = pex;
10581
    }
10582
 
10583
    /**
10584
     * Performs a deep copy on <i>other</i>.
10585
     */
10586
    public getCouponUsageCountByUser_result(getCouponUsageCountByUser_result other) {
10587
      __isset_bit_vector.clear();
10588
      __isset_bit_vector.or(other.__isset_bit_vector);
10589
      this.success = other.success;
10590
      if (other.isSetPex()) {
10591
        this.pex = new PromotionException(other.pex);
10592
      }
10593
    }
10594
 
10595
    public getCouponUsageCountByUser_result deepCopy() {
10596
      return new getCouponUsageCountByUser_result(this);
10597
    }
10598
 
3430 rajveer 10599
    @Override
10600
    public void clear() {
10601
      setSuccessIsSet(false);
10602
      this.success = 0;
10603
      this.pex = null;
1982 varun.gupt 10604
    }
10605
 
10606
    public long getSuccess() {
10607
      return this.success;
10608
    }
10609
 
3430 rajveer 10610
    public void setSuccess(long success) {
1982 varun.gupt 10611
      this.success = success;
10612
      setSuccessIsSet(true);
10613
    }
10614
 
10615
    public void unsetSuccess() {
10616
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
10617
    }
10618
 
3430 rajveer 10619
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 10620
    public boolean isSetSuccess() {
10621
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
10622
    }
10623
 
10624
    public void setSuccessIsSet(boolean value) {
10625
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
10626
    }
10627
 
10628
    public PromotionException getPex() {
10629
      return this.pex;
10630
    }
10631
 
3430 rajveer 10632
    public void setPex(PromotionException pex) {
1982 varun.gupt 10633
      this.pex = pex;
10634
    }
10635
 
10636
    public void unsetPex() {
10637
      this.pex = null;
10638
    }
10639
 
3430 rajveer 10640
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 10641
    public boolean isSetPex() {
10642
      return this.pex != null;
10643
    }
10644
 
10645
    public void setPexIsSet(boolean value) {
10646
      if (!value) {
10647
        this.pex = null;
10648
      }
10649
    }
10650
 
10651
    public void setFieldValue(_Fields field, Object value) {
10652
      switch (field) {
10653
      case SUCCESS:
10654
        if (value == null) {
10655
          unsetSuccess();
10656
        } else {
10657
          setSuccess((Long)value);
10658
        }
10659
        break;
10660
 
10661
      case PEX:
10662
        if (value == null) {
10663
          unsetPex();
10664
        } else {
10665
          setPex((PromotionException)value);
10666
        }
10667
        break;
10668
 
10669
      }
10670
    }
10671
 
10672
    public Object getFieldValue(_Fields field) {
10673
      switch (field) {
10674
      case SUCCESS:
3430 rajveer 10675
        return Long.valueOf(getSuccess());
1982 varun.gupt 10676
 
10677
      case PEX:
10678
        return getPex();
10679
 
10680
      }
10681
      throw new IllegalStateException();
10682
    }
10683
 
3430 rajveer 10684
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10685
    public boolean isSet(_Fields field) {
10686
      if (field == null) {
10687
        throw new IllegalArgumentException();
10688
      }
1982 varun.gupt 10689
 
10690
      switch (field) {
10691
      case SUCCESS:
10692
        return isSetSuccess();
10693
      case PEX:
10694
        return isSetPex();
10695
      }
10696
      throw new IllegalStateException();
10697
    }
10698
 
10699
    @Override
10700
    public boolean equals(Object that) {
10701
      if (that == null)
10702
        return false;
10703
      if (that instanceof getCouponUsageCountByUser_result)
10704
        return this.equals((getCouponUsageCountByUser_result)that);
10705
      return false;
10706
    }
10707
 
10708
    public boolean equals(getCouponUsageCountByUser_result that) {
10709
      if (that == null)
10710
        return false;
10711
 
10712
      boolean this_present_success = true;
10713
      boolean that_present_success = true;
10714
      if (this_present_success || that_present_success) {
10715
        if (!(this_present_success && that_present_success))
10716
          return false;
10717
        if (this.success != that.success)
10718
          return false;
10719
      }
10720
 
10721
      boolean this_present_pex = true && this.isSetPex();
10722
      boolean that_present_pex = true && that.isSetPex();
10723
      if (this_present_pex || that_present_pex) {
10724
        if (!(this_present_pex && that_present_pex))
10725
          return false;
10726
        if (!this.pex.equals(that.pex))
10727
          return false;
10728
      }
10729
 
10730
      return true;
10731
    }
10732
 
10733
    @Override
10734
    public int hashCode() {
10735
      return 0;
10736
    }
10737
 
10738
    public int compareTo(getCouponUsageCountByUser_result other) {
10739
      if (!getClass().equals(other.getClass())) {
10740
        return getClass().getName().compareTo(other.getClass().getName());
10741
      }
10742
 
10743
      int lastComparison = 0;
10744
      getCouponUsageCountByUser_result typedOther = (getCouponUsageCountByUser_result)other;
10745
 
3430 rajveer 10746
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 10747
      if (lastComparison != 0) {
10748
        return lastComparison;
10749
      }
3430 rajveer 10750
      if (isSetSuccess()) {
10751
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
10752
        if (lastComparison != 0) {
10753
          return lastComparison;
10754
        }
1982 varun.gupt 10755
      }
3430 rajveer 10756
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 10757
      if (lastComparison != 0) {
10758
        return lastComparison;
10759
      }
3430 rajveer 10760
      if (isSetPex()) {
10761
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
10762
        if (lastComparison != 0) {
10763
          return lastComparison;
10764
        }
1982 varun.gupt 10765
      }
10766
      return 0;
10767
    }
10768
 
3430 rajveer 10769
    public _Fields fieldForId(int fieldId) {
10770
      return _Fields.findByThriftId(fieldId);
10771
    }
10772
 
10773
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10774
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 10775
      iprot.readStructBegin();
10776
      while (true)
10777
      {
10778
        field = iprot.readFieldBegin();
3430 rajveer 10779
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 10780
          break;
10781
        }
3430 rajveer 10782
        switch (field.id) {
10783
          case 0: // SUCCESS
10784
            if (field.type == org.apache.thrift.protocol.TType.I64) {
10785
              this.success = iprot.readI64();
10786
              setSuccessIsSet(true);
10787
            } else { 
10788
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10789
            }
10790
            break;
10791
          case 1: // PEX
10792
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
10793
              this.pex = new PromotionException();
10794
              this.pex.read(iprot);
10795
            } else { 
10796
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10797
            }
10798
            break;
10799
          default:
10800
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 10801
        }
3430 rajveer 10802
        iprot.readFieldEnd();
1982 varun.gupt 10803
      }
10804
      iprot.readStructEnd();
10805
      validate();
10806
    }
10807
 
3430 rajveer 10808
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 10809
      oprot.writeStructBegin(STRUCT_DESC);
10810
 
10811
      if (this.isSetSuccess()) {
10812
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
10813
        oprot.writeI64(this.success);
10814
        oprot.writeFieldEnd();
10815
      } else if (this.isSetPex()) {
10816
        oprot.writeFieldBegin(PEX_FIELD_DESC);
10817
        this.pex.write(oprot);
10818
        oprot.writeFieldEnd();
10819
      }
10820
      oprot.writeFieldStop();
10821
      oprot.writeStructEnd();
10822
    }
10823
 
10824
    @Override
10825
    public String toString() {
10826
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_result(");
10827
      boolean first = true;
10828
 
10829
      sb.append("success:");
10830
      sb.append(this.success);
10831
      first = false;
10832
      if (!first) sb.append(", ");
10833
      sb.append("pex:");
10834
      if (this.pex == null) {
10835
        sb.append("null");
10836
      } else {
10837
        sb.append(this.pex);
10838
      }
10839
      first = false;
10840
      sb.append(")");
10841
      return sb.toString();
10842
    }
10843
 
3430 rajveer 10844
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 10845
      // check for required fields
10846
    }
10847
 
3430 rajveer 10848
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10849
      try {
10850
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10851
      } catch (org.apache.thrift.TException te) {
10852
        throw new java.io.IOException(te);
10853
      }
10854
    }
10855
 
10856
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10857
      try {
10858
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10859
      } catch (org.apache.thrift.TException te) {
10860
        throw new java.io.IOException(te);
10861
      }
10862
    }
10863
 
1982 varun.gupt 10864
  }
10865
 
6497 amit.gupta 10866
  public static class getActiveCodes_args implements org.apache.thrift.TBase<getActiveCodes_args, getActiveCodes_args._Fields>, java.io.Serializable, Cloneable   {
10867
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCodes_args");
10868
 
10869
    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);
10870
 
10871
    private long promotionId; // required
10872
 
10873
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
10874
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
10875
      PROMOTION_ID((short)1, "promotionId");
10876
 
10877
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10878
 
10879
      static {
10880
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10881
          byName.put(field.getFieldName(), field);
10882
        }
10883
      }
10884
 
10885
      /**
10886
       * Find the _Fields constant that matches fieldId, or null if its not found.
10887
       */
10888
      public static _Fields findByThriftId(int fieldId) {
10889
        switch(fieldId) {
10890
          case 1: // PROMOTION_ID
10891
            return PROMOTION_ID;
10892
          default:
10893
            return null;
10894
        }
10895
      }
10896
 
10897
      /**
10898
       * Find the _Fields constant that matches fieldId, throwing an exception
10899
       * if it is not found.
10900
       */
10901
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10902
        _Fields fields = findByThriftId(fieldId);
10903
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10904
        return fields;
10905
      }
10906
 
10907
      /**
10908
       * Find the _Fields constant that matches name, or null if its not found.
10909
       */
10910
      public static _Fields findByName(String name) {
10911
        return byName.get(name);
10912
      }
10913
 
10914
      private final short _thriftId;
10915
      private final String _fieldName;
10916
 
10917
      _Fields(short thriftId, String fieldName) {
10918
        _thriftId = thriftId;
10919
        _fieldName = fieldName;
10920
      }
10921
 
10922
      public short getThriftFieldId() {
10923
        return _thriftId;
10924
      }
10925
 
10926
      public String getFieldName() {
10927
        return _fieldName;
10928
      }
10929
    }
10930
 
10931
    // isset id assignments
10932
    private static final int __PROMOTIONID_ISSET_ID = 0;
10933
    private BitSet __isset_bit_vector = new BitSet(1);
10934
 
10935
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
10936
    static {
10937
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10938
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10939
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
10940
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10941
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCodes_args.class, metaDataMap);
10942
    }
10943
 
10944
    public getActiveCodes_args() {
10945
    }
10946
 
10947
    public getActiveCodes_args(
10948
      long promotionId)
10949
    {
10950
      this();
10951
      this.promotionId = promotionId;
10952
      setPromotionIdIsSet(true);
10953
    }
10954
 
10955
    /**
10956
     * Performs a deep copy on <i>other</i>.
10957
     */
10958
    public getActiveCodes_args(getActiveCodes_args other) {
10959
      __isset_bit_vector.clear();
10960
      __isset_bit_vector.or(other.__isset_bit_vector);
10961
      this.promotionId = other.promotionId;
10962
    }
10963
 
10964
    public getActiveCodes_args deepCopy() {
10965
      return new getActiveCodes_args(this);
10966
    }
10967
 
10968
    @Override
10969
    public void clear() {
10970
      setPromotionIdIsSet(false);
10971
      this.promotionId = 0;
10972
    }
10973
 
10974
    public long getPromotionId() {
10975
      return this.promotionId;
10976
    }
10977
 
10978
    public void setPromotionId(long promotionId) {
10979
      this.promotionId = promotionId;
10980
      setPromotionIdIsSet(true);
10981
    }
10982
 
10983
    public void unsetPromotionId() {
10984
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
10985
    }
10986
 
10987
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
10988
    public boolean isSetPromotionId() {
10989
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
10990
    }
10991
 
10992
    public void setPromotionIdIsSet(boolean value) {
10993
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
10994
    }
10995
 
10996
    public void setFieldValue(_Fields field, Object value) {
10997
      switch (field) {
10998
      case PROMOTION_ID:
10999
        if (value == null) {
11000
          unsetPromotionId();
11001
        } else {
11002
          setPromotionId((Long)value);
11003
        }
11004
        break;
11005
 
11006
      }
11007
    }
11008
 
11009
    public Object getFieldValue(_Fields field) {
11010
      switch (field) {
11011
      case PROMOTION_ID:
11012
        return Long.valueOf(getPromotionId());
11013
 
11014
      }
11015
      throw new IllegalStateException();
11016
    }
11017
 
11018
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11019
    public boolean isSet(_Fields field) {
11020
      if (field == null) {
11021
        throw new IllegalArgumentException();
11022
      }
11023
 
11024
      switch (field) {
11025
      case PROMOTION_ID:
11026
        return isSetPromotionId();
11027
      }
11028
      throw new IllegalStateException();
11029
    }
11030
 
11031
    @Override
11032
    public boolean equals(Object that) {
11033
      if (that == null)
11034
        return false;
11035
      if (that instanceof getActiveCodes_args)
11036
        return this.equals((getActiveCodes_args)that);
11037
      return false;
11038
    }
11039
 
11040
    public boolean equals(getActiveCodes_args that) {
11041
      if (that == null)
11042
        return false;
11043
 
11044
      boolean this_present_promotionId = true;
11045
      boolean that_present_promotionId = true;
11046
      if (this_present_promotionId || that_present_promotionId) {
11047
        if (!(this_present_promotionId && that_present_promotionId))
11048
          return false;
11049
        if (this.promotionId != that.promotionId)
11050
          return false;
11051
      }
11052
 
11053
      return true;
11054
    }
11055
 
11056
    @Override
11057
    public int hashCode() {
11058
      return 0;
11059
    }
11060
 
11061
    public int compareTo(getActiveCodes_args other) {
11062
      if (!getClass().equals(other.getClass())) {
11063
        return getClass().getName().compareTo(other.getClass().getName());
11064
      }
11065
 
11066
      int lastComparison = 0;
11067
      getActiveCodes_args typedOther = (getActiveCodes_args)other;
11068
 
11069
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
11070
      if (lastComparison != 0) {
11071
        return lastComparison;
11072
      }
11073
      if (isSetPromotionId()) {
11074
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
11075
        if (lastComparison != 0) {
11076
          return lastComparison;
11077
        }
11078
      }
11079
      return 0;
11080
    }
11081
 
11082
    public _Fields fieldForId(int fieldId) {
11083
      return _Fields.findByThriftId(fieldId);
11084
    }
11085
 
11086
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11087
      org.apache.thrift.protocol.TField field;
11088
      iprot.readStructBegin();
11089
      while (true)
11090
      {
11091
        field = iprot.readFieldBegin();
11092
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
11093
          break;
11094
        }
11095
        switch (field.id) {
11096
          case 1: // PROMOTION_ID
11097
            if (field.type == org.apache.thrift.protocol.TType.I64) {
11098
              this.promotionId = iprot.readI64();
11099
              setPromotionIdIsSet(true);
11100
            } else { 
11101
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11102
            }
11103
            break;
11104
          default:
11105
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11106
        }
11107
        iprot.readFieldEnd();
11108
      }
11109
      iprot.readStructEnd();
11110
      validate();
11111
    }
11112
 
11113
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
11114
      validate();
11115
 
11116
      oprot.writeStructBegin(STRUCT_DESC);
11117
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
11118
      oprot.writeI64(this.promotionId);
11119
      oprot.writeFieldEnd();
11120
      oprot.writeFieldStop();
11121
      oprot.writeStructEnd();
11122
    }
11123
 
11124
    @Override
11125
    public String toString() {
11126
      StringBuilder sb = new StringBuilder("getActiveCodes_args(");
11127
      boolean first = true;
11128
 
11129
      sb.append("promotionId:");
11130
      sb.append(this.promotionId);
11131
      first = false;
11132
      sb.append(")");
11133
      return sb.toString();
11134
    }
11135
 
11136
    public void validate() throws org.apache.thrift.TException {
11137
      // check for required fields
11138
    }
11139
 
11140
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11141
      try {
11142
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11143
      } catch (org.apache.thrift.TException te) {
11144
        throw new java.io.IOException(te);
11145
      }
11146
    }
11147
 
11148
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11149
      try {
11150
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
11151
        __isset_bit_vector = new BitSet(1);
11152
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11153
      } catch (org.apache.thrift.TException te) {
11154
        throw new java.io.IOException(te);
11155
      }
11156
    }
11157
 
11158
  }
11159
 
11160
  public static class getActiveCodes_result implements org.apache.thrift.TBase<getActiveCodes_result, getActiveCodes_result._Fields>, java.io.Serializable, Cloneable   {
11161
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCodes_result");
11162
 
11163
    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);
11164
    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);
11165
 
11166
    private List<Coupon> success; // required
11167
    private PromotionException pex; // required
11168
 
11169
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11170
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11171
      SUCCESS((short)0, "success"),
11172
      PEX((short)1, "pex");
11173
 
11174
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11175
 
11176
      static {
11177
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11178
          byName.put(field.getFieldName(), field);
11179
        }
11180
      }
11181
 
11182
      /**
11183
       * Find the _Fields constant that matches fieldId, or null if its not found.
11184
       */
11185
      public static _Fields findByThriftId(int fieldId) {
11186
        switch(fieldId) {
11187
          case 0: // SUCCESS
11188
            return SUCCESS;
11189
          case 1: // PEX
11190
            return PEX;
11191
          default:
11192
            return null;
11193
        }
11194
      }
11195
 
11196
      /**
11197
       * Find the _Fields constant that matches fieldId, throwing an exception
11198
       * if it is not found.
11199
       */
11200
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11201
        _Fields fields = findByThriftId(fieldId);
11202
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11203
        return fields;
11204
      }
11205
 
11206
      /**
11207
       * Find the _Fields constant that matches name, or null if its not found.
11208
       */
11209
      public static _Fields findByName(String name) {
11210
        return byName.get(name);
11211
      }
11212
 
11213
      private final short _thriftId;
11214
      private final String _fieldName;
11215
 
11216
      _Fields(short thriftId, String fieldName) {
11217
        _thriftId = thriftId;
11218
        _fieldName = fieldName;
11219
      }
11220
 
11221
      public short getThriftFieldId() {
11222
        return _thriftId;
11223
      }
11224
 
11225
      public String getFieldName() {
11226
        return _fieldName;
11227
      }
11228
    }
11229
 
11230
    // isset id assignments
11231
 
11232
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
11233
    static {
11234
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11235
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11236
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
11237
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
11238
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11239
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
11240
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11241
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCodes_result.class, metaDataMap);
11242
    }
11243
 
11244
    public getActiveCodes_result() {
11245
    }
11246
 
11247
    public getActiveCodes_result(
11248
      List<Coupon> success,
11249
      PromotionException pex)
11250
    {
11251
      this();
11252
      this.success = success;
11253
      this.pex = pex;
11254
    }
11255
 
11256
    /**
11257
     * Performs a deep copy on <i>other</i>.
11258
     */
11259
    public getActiveCodes_result(getActiveCodes_result other) {
11260
      if (other.isSetSuccess()) {
11261
        List<Coupon> __this__success = new ArrayList<Coupon>();
11262
        for (Coupon other_element : other.success) {
11263
          __this__success.add(new Coupon(other_element));
11264
        }
11265
        this.success = __this__success;
11266
      }
11267
      if (other.isSetPex()) {
11268
        this.pex = new PromotionException(other.pex);
11269
      }
11270
    }
11271
 
11272
    public getActiveCodes_result deepCopy() {
11273
      return new getActiveCodes_result(this);
11274
    }
11275
 
11276
    @Override
11277
    public void clear() {
11278
      this.success = null;
11279
      this.pex = null;
11280
    }
11281
 
11282
    public int getSuccessSize() {
11283
      return (this.success == null) ? 0 : this.success.size();
11284
    }
11285
 
11286
    public java.util.Iterator<Coupon> getSuccessIterator() {
11287
      return (this.success == null) ? null : this.success.iterator();
11288
    }
11289
 
11290
    public void addToSuccess(Coupon elem) {
11291
      if (this.success == null) {
11292
        this.success = new ArrayList<Coupon>();
11293
      }
11294
      this.success.add(elem);
11295
    }
11296
 
11297
    public List<Coupon> getSuccess() {
11298
      return this.success;
11299
    }
11300
 
11301
    public void setSuccess(List<Coupon> success) {
11302
      this.success = success;
11303
    }
11304
 
11305
    public void unsetSuccess() {
11306
      this.success = null;
11307
    }
11308
 
11309
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
11310
    public boolean isSetSuccess() {
11311
      return this.success != null;
11312
    }
11313
 
11314
    public void setSuccessIsSet(boolean value) {
11315
      if (!value) {
11316
        this.success = null;
11317
      }
11318
    }
11319
 
11320
    public PromotionException getPex() {
11321
      return this.pex;
11322
    }
11323
 
11324
    public void setPex(PromotionException pex) {
11325
      this.pex = pex;
11326
    }
11327
 
11328
    public void unsetPex() {
11329
      this.pex = null;
11330
    }
11331
 
11332
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
11333
    public boolean isSetPex() {
11334
      return this.pex != null;
11335
    }
11336
 
11337
    public void setPexIsSet(boolean value) {
11338
      if (!value) {
11339
        this.pex = null;
11340
      }
11341
    }
11342
 
11343
    public void setFieldValue(_Fields field, Object value) {
11344
      switch (field) {
11345
      case SUCCESS:
11346
        if (value == null) {
11347
          unsetSuccess();
11348
        } else {
11349
          setSuccess((List<Coupon>)value);
11350
        }
11351
        break;
11352
 
11353
      case PEX:
11354
        if (value == null) {
11355
          unsetPex();
11356
        } else {
11357
          setPex((PromotionException)value);
11358
        }
11359
        break;
11360
 
11361
      }
11362
    }
11363
 
11364
    public Object getFieldValue(_Fields field) {
11365
      switch (field) {
11366
      case SUCCESS:
11367
        return getSuccess();
11368
 
11369
      case PEX:
11370
        return getPex();
11371
 
11372
      }
11373
      throw new IllegalStateException();
11374
    }
11375
 
11376
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11377
    public boolean isSet(_Fields field) {
11378
      if (field == null) {
11379
        throw new IllegalArgumentException();
11380
      }
11381
 
11382
      switch (field) {
11383
      case SUCCESS:
11384
        return isSetSuccess();
11385
      case PEX:
11386
        return isSetPex();
11387
      }
11388
      throw new IllegalStateException();
11389
    }
11390
 
11391
    @Override
11392
    public boolean equals(Object that) {
11393
      if (that == null)
11394
        return false;
11395
      if (that instanceof getActiveCodes_result)
11396
        return this.equals((getActiveCodes_result)that);
11397
      return false;
11398
    }
11399
 
11400
    public boolean equals(getActiveCodes_result that) {
11401
      if (that == null)
11402
        return false;
11403
 
11404
      boolean this_present_success = true && this.isSetSuccess();
11405
      boolean that_present_success = true && that.isSetSuccess();
11406
      if (this_present_success || that_present_success) {
11407
        if (!(this_present_success && that_present_success))
11408
          return false;
11409
        if (!this.success.equals(that.success))
11410
          return false;
11411
      }
11412
 
11413
      boolean this_present_pex = true && this.isSetPex();
11414
      boolean that_present_pex = true && that.isSetPex();
11415
      if (this_present_pex || that_present_pex) {
11416
        if (!(this_present_pex && that_present_pex))
11417
          return false;
11418
        if (!this.pex.equals(that.pex))
11419
          return false;
11420
      }
11421
 
11422
      return true;
11423
    }
11424
 
11425
    @Override
11426
    public int hashCode() {
11427
      return 0;
11428
    }
11429
 
11430
    public int compareTo(getActiveCodes_result other) {
11431
      if (!getClass().equals(other.getClass())) {
11432
        return getClass().getName().compareTo(other.getClass().getName());
11433
      }
11434
 
11435
      int lastComparison = 0;
11436
      getActiveCodes_result typedOther = (getActiveCodes_result)other;
11437
 
11438
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
11439
      if (lastComparison != 0) {
11440
        return lastComparison;
11441
      }
11442
      if (isSetSuccess()) {
11443
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
11444
        if (lastComparison != 0) {
11445
          return lastComparison;
11446
        }
11447
      }
11448
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
11449
      if (lastComparison != 0) {
11450
        return lastComparison;
11451
      }
11452
      if (isSetPex()) {
11453
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
11454
        if (lastComparison != 0) {
11455
          return lastComparison;
11456
        }
11457
      }
11458
      return 0;
11459
    }
11460
 
11461
    public _Fields fieldForId(int fieldId) {
11462
      return _Fields.findByThriftId(fieldId);
11463
    }
11464
 
11465
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11466
      org.apache.thrift.protocol.TField field;
11467
      iprot.readStructBegin();
11468
      while (true)
11469
      {
11470
        field = iprot.readFieldBegin();
11471
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
11472
          break;
11473
        }
11474
        switch (field.id) {
11475
          case 0: // SUCCESS
11476
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
11477
              {
6736 amit.gupta 11478
                org.apache.thrift.protocol.TList _list26 = iprot.readListBegin();
11479
                this.success = new ArrayList<Coupon>(_list26.size);
11480
                for (int _i27 = 0; _i27 < _list26.size; ++_i27)
6497 amit.gupta 11481
                {
6736 amit.gupta 11482
                  Coupon _elem28; // required
11483
                  _elem28 = new Coupon();
11484
                  _elem28.read(iprot);
11485
                  this.success.add(_elem28);
6497 amit.gupta 11486
                }
11487
                iprot.readListEnd();
11488
              }
11489
            } else { 
11490
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11491
            }
11492
            break;
11493
          case 1: // PEX
11494
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
11495
              this.pex = new PromotionException();
11496
              this.pex.read(iprot);
11497
            } else { 
11498
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11499
            }
11500
            break;
11501
          default:
11502
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11503
        }
11504
        iprot.readFieldEnd();
11505
      }
11506
      iprot.readStructEnd();
11507
      validate();
11508
    }
11509
 
11510
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
11511
      oprot.writeStructBegin(STRUCT_DESC);
11512
 
11513
      if (this.isSetSuccess()) {
11514
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
11515
        {
11516
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
6736 amit.gupta 11517
          for (Coupon _iter29 : this.success)
6497 amit.gupta 11518
          {
6736 amit.gupta 11519
            _iter29.write(oprot);
6497 amit.gupta 11520
          }
11521
          oprot.writeListEnd();
11522
        }
11523
        oprot.writeFieldEnd();
11524
      } else if (this.isSetPex()) {
11525
        oprot.writeFieldBegin(PEX_FIELD_DESC);
11526
        this.pex.write(oprot);
11527
        oprot.writeFieldEnd();
11528
      }
11529
      oprot.writeFieldStop();
11530
      oprot.writeStructEnd();
11531
    }
11532
 
11533
    @Override
11534
    public String toString() {
11535
      StringBuilder sb = new StringBuilder("getActiveCodes_result(");
11536
      boolean first = true;
11537
 
11538
      sb.append("success:");
11539
      if (this.success == null) {
11540
        sb.append("null");
11541
      } else {
11542
        sb.append(this.success);
11543
      }
11544
      first = false;
11545
      if (!first) sb.append(", ");
11546
      sb.append("pex:");
11547
      if (this.pex == null) {
11548
        sb.append("null");
11549
      } else {
11550
        sb.append(this.pex);
11551
      }
11552
      first = false;
11553
      sb.append(")");
11554
      return sb.toString();
11555
    }
11556
 
11557
    public void validate() throws org.apache.thrift.TException {
11558
      // check for required fields
11559
    }
11560
 
11561
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11562
      try {
11563
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11564
      } catch (org.apache.thrift.TException te) {
11565
        throw new java.io.IOException(te);
11566
      }
11567
    }
11568
 
11569
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11570
      try {
11571
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11572
      } catch (org.apache.thrift.TException te) {
11573
        throw new java.io.IOException(te);
11574
      }
11575
    }
11576
 
11577
  }
11578
 
11579
  public static class deleteCoupon_args implements org.apache.thrift.TBase<deleteCoupon_args, deleteCoupon_args._Fields>, java.io.Serializable, Cloneable   {
11580
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteCoupon_args");
11581
 
11582
    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);
11583
 
11584
    private String couponCode; // required
11585
 
11586
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11587
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11588
      COUPON_CODE((short)1, "couponCode");
11589
 
11590
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11591
 
11592
      static {
11593
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11594
          byName.put(field.getFieldName(), field);
11595
        }
11596
      }
11597
 
11598
      /**
11599
       * Find the _Fields constant that matches fieldId, or null if its not found.
11600
       */
11601
      public static _Fields findByThriftId(int fieldId) {
11602
        switch(fieldId) {
11603
          case 1: // COUPON_CODE
11604
            return COUPON_CODE;
11605
          default:
11606
            return null;
11607
        }
11608
      }
11609
 
11610
      /**
11611
       * Find the _Fields constant that matches fieldId, throwing an exception
11612
       * if it is not found.
11613
       */
11614
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11615
        _Fields fields = findByThriftId(fieldId);
11616
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11617
        return fields;
11618
      }
11619
 
11620
      /**
11621
       * Find the _Fields constant that matches name, or null if its not found.
11622
       */
11623
      public static _Fields findByName(String name) {
11624
        return byName.get(name);
11625
      }
11626
 
11627
      private final short _thriftId;
11628
      private final String _fieldName;
11629
 
11630
      _Fields(short thriftId, String fieldName) {
11631
        _thriftId = thriftId;
11632
        _fieldName = fieldName;
11633
      }
11634
 
11635
      public short getThriftFieldId() {
11636
        return _thriftId;
11637
      }
11638
 
11639
      public String getFieldName() {
11640
        return _fieldName;
11641
      }
11642
    }
11643
 
11644
    // isset id assignments
11645
 
11646
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
11647
    static {
11648
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11649
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11650
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
11651
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11652
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteCoupon_args.class, metaDataMap);
11653
    }
11654
 
11655
    public deleteCoupon_args() {
11656
    }
11657
 
11658
    public deleteCoupon_args(
11659
      String couponCode)
11660
    {
11661
      this();
11662
      this.couponCode = couponCode;
11663
    }
11664
 
11665
    /**
11666
     * Performs a deep copy on <i>other</i>.
11667
     */
11668
    public deleteCoupon_args(deleteCoupon_args other) {
11669
      if (other.isSetCouponCode()) {
11670
        this.couponCode = other.couponCode;
11671
      }
11672
    }
11673
 
11674
    public deleteCoupon_args deepCopy() {
11675
      return new deleteCoupon_args(this);
11676
    }
11677
 
11678
    @Override
11679
    public void clear() {
11680
      this.couponCode = null;
11681
    }
11682
 
11683
    public String getCouponCode() {
11684
      return this.couponCode;
11685
    }
11686
 
11687
    public void setCouponCode(String couponCode) {
11688
      this.couponCode = couponCode;
11689
    }
11690
 
11691
    public void unsetCouponCode() {
11692
      this.couponCode = null;
11693
    }
11694
 
11695
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
11696
    public boolean isSetCouponCode() {
11697
      return this.couponCode != null;
11698
    }
11699
 
11700
    public void setCouponCodeIsSet(boolean value) {
11701
      if (!value) {
11702
        this.couponCode = null;
11703
      }
11704
    }
11705
 
11706
    public void setFieldValue(_Fields field, Object value) {
11707
      switch (field) {
11708
      case COUPON_CODE:
11709
        if (value == null) {
11710
          unsetCouponCode();
11711
        } else {
11712
          setCouponCode((String)value);
11713
        }
11714
        break;
11715
 
11716
      }
11717
    }
11718
 
11719
    public Object getFieldValue(_Fields field) {
11720
      switch (field) {
11721
      case COUPON_CODE:
11722
        return getCouponCode();
11723
 
11724
      }
11725
      throw new IllegalStateException();
11726
    }
11727
 
11728
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11729
    public boolean isSet(_Fields field) {
11730
      if (field == null) {
11731
        throw new IllegalArgumentException();
11732
      }
11733
 
11734
      switch (field) {
11735
      case COUPON_CODE:
11736
        return isSetCouponCode();
11737
      }
11738
      throw new IllegalStateException();
11739
    }
11740
 
11741
    @Override
11742
    public boolean equals(Object that) {
11743
      if (that == null)
11744
        return false;
11745
      if (that instanceof deleteCoupon_args)
11746
        return this.equals((deleteCoupon_args)that);
11747
      return false;
11748
    }
11749
 
11750
    public boolean equals(deleteCoupon_args that) {
11751
      if (that == null)
11752
        return false;
11753
 
11754
      boolean this_present_couponCode = true && this.isSetCouponCode();
11755
      boolean that_present_couponCode = true && that.isSetCouponCode();
11756
      if (this_present_couponCode || that_present_couponCode) {
11757
        if (!(this_present_couponCode && that_present_couponCode))
11758
          return false;
11759
        if (!this.couponCode.equals(that.couponCode))
11760
          return false;
11761
      }
11762
 
11763
      return true;
11764
    }
11765
 
11766
    @Override
11767
    public int hashCode() {
11768
      return 0;
11769
    }
11770
 
11771
    public int compareTo(deleteCoupon_args other) {
11772
      if (!getClass().equals(other.getClass())) {
11773
        return getClass().getName().compareTo(other.getClass().getName());
11774
      }
11775
 
11776
      int lastComparison = 0;
11777
      deleteCoupon_args typedOther = (deleteCoupon_args)other;
11778
 
11779
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
11780
      if (lastComparison != 0) {
11781
        return lastComparison;
11782
      }
11783
      if (isSetCouponCode()) {
11784
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
11785
        if (lastComparison != 0) {
11786
          return lastComparison;
11787
        }
11788
      }
11789
      return 0;
11790
    }
11791
 
11792
    public _Fields fieldForId(int fieldId) {
11793
      return _Fields.findByThriftId(fieldId);
11794
    }
11795
 
11796
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11797
      org.apache.thrift.protocol.TField field;
11798
      iprot.readStructBegin();
11799
      while (true)
11800
      {
11801
        field = iprot.readFieldBegin();
11802
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
11803
          break;
11804
        }
11805
        switch (field.id) {
11806
          case 1: // COUPON_CODE
11807
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
11808
              this.couponCode = iprot.readString();
11809
            } else { 
11810
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11811
            }
11812
            break;
11813
          default:
11814
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11815
        }
11816
        iprot.readFieldEnd();
11817
      }
11818
      iprot.readStructEnd();
11819
      validate();
11820
    }
11821
 
11822
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
11823
      validate();
11824
 
11825
      oprot.writeStructBegin(STRUCT_DESC);
11826
      if (this.couponCode != null) {
11827
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
11828
        oprot.writeString(this.couponCode);
11829
        oprot.writeFieldEnd();
11830
      }
11831
      oprot.writeFieldStop();
11832
      oprot.writeStructEnd();
11833
    }
11834
 
11835
    @Override
11836
    public String toString() {
11837
      StringBuilder sb = new StringBuilder("deleteCoupon_args(");
11838
      boolean first = true;
11839
 
11840
      sb.append("couponCode:");
11841
      if (this.couponCode == null) {
11842
        sb.append("null");
11843
      } else {
11844
        sb.append(this.couponCode);
11845
      }
11846
      first = false;
11847
      sb.append(")");
11848
      return sb.toString();
11849
    }
11850
 
11851
    public void validate() throws org.apache.thrift.TException {
11852
      // check for required fields
11853
    }
11854
 
11855
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11856
      try {
11857
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11858
      } catch (org.apache.thrift.TException te) {
11859
        throw new java.io.IOException(te);
11860
      }
11861
    }
11862
 
11863
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11864
      try {
11865
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11866
      } catch (org.apache.thrift.TException te) {
11867
        throw new java.io.IOException(te);
11868
      }
11869
    }
11870
 
11871
  }
11872
 
11873
  public static class deleteCoupon_result implements org.apache.thrift.TBase<deleteCoupon_result, deleteCoupon_result._Fields>, java.io.Serializable, Cloneable   {
11874
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteCoupon_result");
11875
 
11876
    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);
11877
 
11878
    private PromotionException pex; // required
11879
 
11880
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11881
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11882
      PEX((short)1, "pex");
11883
 
11884
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11885
 
11886
      static {
11887
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11888
          byName.put(field.getFieldName(), field);
11889
        }
11890
      }
11891
 
11892
      /**
11893
       * Find the _Fields constant that matches fieldId, or null if its not found.
11894
       */
11895
      public static _Fields findByThriftId(int fieldId) {
11896
        switch(fieldId) {
11897
          case 1: // PEX
11898
            return PEX;
11899
          default:
11900
            return null;
11901
        }
11902
      }
11903
 
11904
      /**
11905
       * Find the _Fields constant that matches fieldId, throwing an exception
11906
       * if it is not found.
11907
       */
11908
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11909
        _Fields fields = findByThriftId(fieldId);
11910
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11911
        return fields;
11912
      }
11913
 
11914
      /**
11915
       * Find the _Fields constant that matches name, or null if its not found.
11916
       */
11917
      public static _Fields findByName(String name) {
11918
        return byName.get(name);
11919
      }
11920
 
11921
      private final short _thriftId;
11922
      private final String _fieldName;
11923
 
11924
      _Fields(short thriftId, String fieldName) {
11925
        _thriftId = thriftId;
11926
        _fieldName = fieldName;
11927
      }
11928
 
11929
      public short getThriftFieldId() {
11930
        return _thriftId;
11931
      }
11932
 
11933
      public String getFieldName() {
11934
        return _fieldName;
11935
      }
11936
    }
11937
 
11938
    // isset id assignments
11939
 
11940
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
11941
    static {
11942
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11943
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11944
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
11945
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11946
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteCoupon_result.class, metaDataMap);
11947
    }
11948
 
11949
    public deleteCoupon_result() {
11950
    }
11951
 
11952
    public deleteCoupon_result(
11953
      PromotionException pex)
11954
    {
11955
      this();
11956
      this.pex = pex;
11957
    }
11958
 
11959
    /**
11960
     * Performs a deep copy on <i>other</i>.
11961
     */
11962
    public deleteCoupon_result(deleteCoupon_result other) {
11963
      if (other.isSetPex()) {
11964
        this.pex = new PromotionException(other.pex);
11965
      }
11966
    }
11967
 
11968
    public deleteCoupon_result deepCopy() {
11969
      return new deleteCoupon_result(this);
11970
    }
11971
 
11972
    @Override
11973
    public void clear() {
11974
      this.pex = null;
11975
    }
11976
 
11977
    public PromotionException getPex() {
11978
      return this.pex;
11979
    }
11980
 
11981
    public void setPex(PromotionException pex) {
11982
      this.pex = pex;
11983
    }
11984
 
11985
    public void unsetPex() {
11986
      this.pex = null;
11987
    }
11988
 
11989
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
11990
    public boolean isSetPex() {
11991
      return this.pex != null;
11992
    }
11993
 
11994
    public void setPexIsSet(boolean value) {
11995
      if (!value) {
11996
        this.pex = null;
11997
      }
11998
    }
11999
 
12000
    public void setFieldValue(_Fields field, Object value) {
12001
      switch (field) {
12002
      case PEX:
12003
        if (value == null) {
12004
          unsetPex();
12005
        } else {
12006
          setPex((PromotionException)value);
12007
        }
12008
        break;
12009
 
12010
      }
12011
    }
12012
 
12013
    public Object getFieldValue(_Fields field) {
12014
      switch (field) {
12015
      case PEX:
12016
        return getPex();
12017
 
12018
      }
12019
      throw new IllegalStateException();
12020
    }
12021
 
12022
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12023
    public boolean isSet(_Fields field) {
12024
      if (field == null) {
12025
        throw new IllegalArgumentException();
12026
      }
12027
 
12028
      switch (field) {
12029
      case PEX:
12030
        return isSetPex();
12031
      }
12032
      throw new IllegalStateException();
12033
    }
12034
 
12035
    @Override
12036
    public boolean equals(Object that) {
12037
      if (that == null)
12038
        return false;
12039
      if (that instanceof deleteCoupon_result)
12040
        return this.equals((deleteCoupon_result)that);
12041
      return false;
12042
    }
12043
 
12044
    public boolean equals(deleteCoupon_result that) {
12045
      if (that == null)
12046
        return false;
12047
 
12048
      boolean this_present_pex = true && this.isSetPex();
12049
      boolean that_present_pex = true && that.isSetPex();
12050
      if (this_present_pex || that_present_pex) {
12051
        if (!(this_present_pex && that_present_pex))
12052
          return false;
12053
        if (!this.pex.equals(that.pex))
12054
          return false;
12055
      }
12056
 
12057
      return true;
12058
    }
12059
 
12060
    @Override
12061
    public int hashCode() {
12062
      return 0;
12063
    }
12064
 
12065
    public int compareTo(deleteCoupon_result other) {
12066
      if (!getClass().equals(other.getClass())) {
12067
        return getClass().getName().compareTo(other.getClass().getName());
12068
      }
12069
 
12070
      int lastComparison = 0;
12071
      deleteCoupon_result typedOther = (deleteCoupon_result)other;
12072
 
12073
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
12074
      if (lastComparison != 0) {
12075
        return lastComparison;
12076
      }
12077
      if (isSetPex()) {
12078
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
12079
        if (lastComparison != 0) {
12080
          return lastComparison;
12081
        }
12082
      }
12083
      return 0;
12084
    }
12085
 
12086
    public _Fields fieldForId(int fieldId) {
12087
      return _Fields.findByThriftId(fieldId);
12088
    }
12089
 
12090
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12091
      org.apache.thrift.protocol.TField field;
12092
      iprot.readStructBegin();
12093
      while (true)
12094
      {
12095
        field = iprot.readFieldBegin();
12096
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12097
          break;
12098
        }
12099
        switch (field.id) {
12100
          case 1: // PEX
12101
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
12102
              this.pex = new PromotionException();
12103
              this.pex.read(iprot);
12104
            } else { 
12105
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12106
            }
12107
            break;
12108
          default:
12109
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12110
        }
12111
        iprot.readFieldEnd();
12112
      }
12113
      iprot.readStructEnd();
12114
      validate();
12115
    }
12116
 
12117
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12118
      oprot.writeStructBegin(STRUCT_DESC);
12119
 
12120
      if (this.isSetPex()) {
12121
        oprot.writeFieldBegin(PEX_FIELD_DESC);
12122
        this.pex.write(oprot);
12123
        oprot.writeFieldEnd();
12124
      }
12125
      oprot.writeFieldStop();
12126
      oprot.writeStructEnd();
12127
    }
12128
 
12129
    @Override
12130
    public String toString() {
12131
      StringBuilder sb = new StringBuilder("deleteCoupon_result(");
12132
      boolean first = true;
12133
 
12134
      sb.append("pex:");
12135
      if (this.pex == null) {
12136
        sb.append("null");
12137
      } else {
12138
        sb.append(this.pex);
12139
      }
12140
      first = false;
12141
      sb.append(")");
12142
      return sb.toString();
12143
    }
12144
 
12145
    public void validate() throws org.apache.thrift.TException {
12146
      // check for required fields
12147
    }
12148
 
12149
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12150
      try {
12151
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12152
      } catch (org.apache.thrift.TException te) {
12153
        throw new java.io.IOException(te);
12154
      }
12155
    }
12156
 
12157
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12158
      try {
12159
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12160
      } catch (org.apache.thrift.TException te) {
12161
        throw new java.io.IOException(te);
12162
      }
12163
    }
12164
 
12165
  }
12166
 
7092 amit.gupta 12167
  public static class getAllCouponsByPromotionId_args implements org.apache.thrift.TBase<getAllCouponsByPromotionId_args, getAllCouponsByPromotionId_args._Fields>, java.io.Serializable, Cloneable   {
12168
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllCouponsByPromotionId_args");
12169
 
12170
    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);
12171
 
12172
    private long promotionId; // required
12173
 
12174
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12175
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12176
      PROMOTION_ID((short)1, "promotionId");
12177
 
12178
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12179
 
12180
      static {
12181
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12182
          byName.put(field.getFieldName(), field);
12183
        }
12184
      }
12185
 
12186
      /**
12187
       * Find the _Fields constant that matches fieldId, or null if its not found.
12188
       */
12189
      public static _Fields findByThriftId(int fieldId) {
12190
        switch(fieldId) {
12191
          case 1: // PROMOTION_ID
12192
            return PROMOTION_ID;
12193
          default:
12194
            return null;
12195
        }
12196
      }
12197
 
12198
      /**
12199
       * Find the _Fields constant that matches fieldId, throwing an exception
12200
       * if it is not found.
12201
       */
12202
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12203
        _Fields fields = findByThriftId(fieldId);
12204
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12205
        return fields;
12206
      }
12207
 
12208
      /**
12209
       * Find the _Fields constant that matches name, or null if its not found.
12210
       */
12211
      public static _Fields findByName(String name) {
12212
        return byName.get(name);
12213
      }
12214
 
12215
      private final short _thriftId;
12216
      private final String _fieldName;
12217
 
12218
      _Fields(short thriftId, String fieldName) {
12219
        _thriftId = thriftId;
12220
        _fieldName = fieldName;
12221
      }
12222
 
12223
      public short getThriftFieldId() {
12224
        return _thriftId;
12225
      }
12226
 
12227
      public String getFieldName() {
12228
        return _fieldName;
12229
      }
12230
    }
12231
 
12232
    // isset id assignments
12233
    private static final int __PROMOTIONID_ISSET_ID = 0;
12234
    private BitSet __isset_bit_vector = new BitSet(1);
12235
 
12236
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12237
    static {
12238
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12239
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12240
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
12241
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12242
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllCouponsByPromotionId_args.class, metaDataMap);
12243
    }
12244
 
12245
    public getAllCouponsByPromotionId_args() {
12246
    }
12247
 
12248
    public getAllCouponsByPromotionId_args(
12249
      long promotionId)
12250
    {
12251
      this();
12252
      this.promotionId = promotionId;
12253
      setPromotionIdIsSet(true);
12254
    }
12255
 
12256
    /**
12257
     * Performs a deep copy on <i>other</i>.
12258
     */
12259
    public getAllCouponsByPromotionId_args(getAllCouponsByPromotionId_args other) {
12260
      __isset_bit_vector.clear();
12261
      __isset_bit_vector.or(other.__isset_bit_vector);
12262
      this.promotionId = other.promotionId;
12263
    }
12264
 
12265
    public getAllCouponsByPromotionId_args deepCopy() {
12266
      return new getAllCouponsByPromotionId_args(this);
12267
    }
12268
 
12269
    @Override
12270
    public void clear() {
12271
      setPromotionIdIsSet(false);
12272
      this.promotionId = 0;
12273
    }
12274
 
12275
    public long getPromotionId() {
12276
      return this.promotionId;
12277
    }
12278
 
12279
    public void setPromotionId(long promotionId) {
12280
      this.promotionId = promotionId;
12281
      setPromotionIdIsSet(true);
12282
    }
12283
 
12284
    public void unsetPromotionId() {
12285
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
12286
    }
12287
 
12288
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
12289
    public boolean isSetPromotionId() {
12290
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
12291
    }
12292
 
12293
    public void setPromotionIdIsSet(boolean value) {
12294
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
12295
    }
12296
 
12297
    public void setFieldValue(_Fields field, Object value) {
12298
      switch (field) {
12299
      case PROMOTION_ID:
12300
        if (value == null) {
12301
          unsetPromotionId();
12302
        } else {
12303
          setPromotionId((Long)value);
12304
        }
12305
        break;
12306
 
12307
      }
12308
    }
12309
 
12310
    public Object getFieldValue(_Fields field) {
12311
      switch (field) {
12312
      case PROMOTION_ID:
12313
        return Long.valueOf(getPromotionId());
12314
 
12315
      }
12316
      throw new IllegalStateException();
12317
    }
12318
 
12319
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12320
    public boolean isSet(_Fields field) {
12321
      if (field == null) {
12322
        throw new IllegalArgumentException();
12323
      }
12324
 
12325
      switch (field) {
12326
      case PROMOTION_ID:
12327
        return isSetPromotionId();
12328
      }
12329
      throw new IllegalStateException();
12330
    }
12331
 
12332
    @Override
12333
    public boolean equals(Object that) {
12334
      if (that == null)
12335
        return false;
12336
      if (that instanceof getAllCouponsByPromotionId_args)
12337
        return this.equals((getAllCouponsByPromotionId_args)that);
12338
      return false;
12339
    }
12340
 
12341
    public boolean equals(getAllCouponsByPromotionId_args that) {
12342
      if (that == null)
12343
        return false;
12344
 
12345
      boolean this_present_promotionId = true;
12346
      boolean that_present_promotionId = true;
12347
      if (this_present_promotionId || that_present_promotionId) {
12348
        if (!(this_present_promotionId && that_present_promotionId))
12349
          return false;
12350
        if (this.promotionId != that.promotionId)
12351
          return false;
12352
      }
12353
 
12354
      return true;
12355
    }
12356
 
12357
    @Override
12358
    public int hashCode() {
12359
      return 0;
12360
    }
12361
 
12362
    public int compareTo(getAllCouponsByPromotionId_args other) {
12363
      if (!getClass().equals(other.getClass())) {
12364
        return getClass().getName().compareTo(other.getClass().getName());
12365
      }
12366
 
12367
      int lastComparison = 0;
12368
      getAllCouponsByPromotionId_args typedOther = (getAllCouponsByPromotionId_args)other;
12369
 
12370
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
12371
      if (lastComparison != 0) {
12372
        return lastComparison;
12373
      }
12374
      if (isSetPromotionId()) {
12375
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
12376
        if (lastComparison != 0) {
12377
          return lastComparison;
12378
        }
12379
      }
12380
      return 0;
12381
    }
12382
 
12383
    public _Fields fieldForId(int fieldId) {
12384
      return _Fields.findByThriftId(fieldId);
12385
    }
12386
 
12387
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12388
      org.apache.thrift.protocol.TField field;
12389
      iprot.readStructBegin();
12390
      while (true)
12391
      {
12392
        field = iprot.readFieldBegin();
12393
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12394
          break;
12395
        }
12396
        switch (field.id) {
12397
          case 1: // PROMOTION_ID
12398
            if (field.type == org.apache.thrift.protocol.TType.I64) {
12399
              this.promotionId = iprot.readI64();
12400
              setPromotionIdIsSet(true);
12401
            } else { 
12402
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12403
            }
12404
            break;
12405
          default:
12406
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12407
        }
12408
        iprot.readFieldEnd();
12409
      }
12410
      iprot.readStructEnd();
12411
      validate();
12412
    }
12413
 
12414
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12415
      validate();
12416
 
12417
      oprot.writeStructBegin(STRUCT_DESC);
12418
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
12419
      oprot.writeI64(this.promotionId);
12420
      oprot.writeFieldEnd();
12421
      oprot.writeFieldStop();
12422
      oprot.writeStructEnd();
12423
    }
12424
 
12425
    @Override
12426
    public String toString() {
12427
      StringBuilder sb = new StringBuilder("getAllCouponsByPromotionId_args(");
12428
      boolean first = true;
12429
 
12430
      sb.append("promotionId:");
12431
      sb.append(this.promotionId);
12432
      first = false;
12433
      sb.append(")");
12434
      return sb.toString();
12435
    }
12436
 
12437
    public void validate() throws org.apache.thrift.TException {
12438
      // check for required fields
12439
    }
12440
 
12441
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12442
      try {
12443
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12444
      } catch (org.apache.thrift.TException te) {
12445
        throw new java.io.IOException(te);
12446
      }
12447
    }
12448
 
12449
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12450
      try {
12451
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
12452
        __isset_bit_vector = new BitSet(1);
12453
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12454
      } catch (org.apache.thrift.TException te) {
12455
        throw new java.io.IOException(te);
12456
      }
12457
    }
12458
 
12459
  }
12460
 
12461
  public static class getAllCouponsByPromotionId_result implements org.apache.thrift.TBase<getAllCouponsByPromotionId_result, getAllCouponsByPromotionId_result._Fields>, java.io.Serializable, Cloneable   {
12462
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllCouponsByPromotionId_result");
12463
 
12464
    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);
12465
    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);
12466
 
12467
    private List<Coupon> success; // required
12468
    private PromotionException pex; // required
12469
 
12470
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12471
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12472
      SUCCESS((short)0, "success"),
12473
      PEX((short)1, "pex");
12474
 
12475
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12476
 
12477
      static {
12478
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12479
          byName.put(field.getFieldName(), field);
12480
        }
12481
      }
12482
 
12483
      /**
12484
       * Find the _Fields constant that matches fieldId, or null if its not found.
12485
       */
12486
      public static _Fields findByThriftId(int fieldId) {
12487
        switch(fieldId) {
12488
          case 0: // SUCCESS
12489
            return SUCCESS;
12490
          case 1: // PEX
12491
            return PEX;
12492
          default:
12493
            return null;
12494
        }
12495
      }
12496
 
12497
      /**
12498
       * Find the _Fields constant that matches fieldId, throwing an exception
12499
       * if it is not found.
12500
       */
12501
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12502
        _Fields fields = findByThriftId(fieldId);
12503
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12504
        return fields;
12505
      }
12506
 
12507
      /**
12508
       * Find the _Fields constant that matches name, or null if its not found.
12509
       */
12510
      public static _Fields findByName(String name) {
12511
        return byName.get(name);
12512
      }
12513
 
12514
      private final short _thriftId;
12515
      private final String _fieldName;
12516
 
12517
      _Fields(short thriftId, String fieldName) {
12518
        _thriftId = thriftId;
12519
        _fieldName = fieldName;
12520
      }
12521
 
12522
      public short getThriftFieldId() {
12523
        return _thriftId;
12524
      }
12525
 
12526
      public String getFieldName() {
12527
        return _fieldName;
12528
      }
12529
    }
12530
 
12531
    // isset id assignments
12532
 
12533
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12534
    static {
12535
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12536
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12537
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
12538
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
12539
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12540
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
12541
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12542
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllCouponsByPromotionId_result.class, metaDataMap);
12543
    }
12544
 
12545
    public getAllCouponsByPromotionId_result() {
12546
    }
12547
 
12548
    public getAllCouponsByPromotionId_result(
12549
      List<Coupon> success,
12550
      PromotionException pex)
12551
    {
12552
      this();
12553
      this.success = success;
12554
      this.pex = pex;
12555
    }
12556
 
12557
    /**
12558
     * Performs a deep copy on <i>other</i>.
12559
     */
12560
    public getAllCouponsByPromotionId_result(getAllCouponsByPromotionId_result other) {
12561
      if (other.isSetSuccess()) {
12562
        List<Coupon> __this__success = new ArrayList<Coupon>();
12563
        for (Coupon other_element : other.success) {
12564
          __this__success.add(new Coupon(other_element));
12565
        }
12566
        this.success = __this__success;
12567
      }
12568
      if (other.isSetPex()) {
12569
        this.pex = new PromotionException(other.pex);
12570
      }
12571
    }
12572
 
12573
    public getAllCouponsByPromotionId_result deepCopy() {
12574
      return new getAllCouponsByPromotionId_result(this);
12575
    }
12576
 
12577
    @Override
12578
    public void clear() {
12579
      this.success = null;
12580
      this.pex = null;
12581
    }
12582
 
12583
    public int getSuccessSize() {
12584
      return (this.success == null) ? 0 : this.success.size();
12585
    }
12586
 
12587
    public java.util.Iterator<Coupon> getSuccessIterator() {
12588
      return (this.success == null) ? null : this.success.iterator();
12589
    }
12590
 
12591
    public void addToSuccess(Coupon elem) {
12592
      if (this.success == null) {
12593
        this.success = new ArrayList<Coupon>();
12594
      }
12595
      this.success.add(elem);
12596
    }
12597
 
12598
    public List<Coupon> getSuccess() {
12599
      return this.success;
12600
    }
12601
 
12602
    public void setSuccess(List<Coupon> success) {
12603
      this.success = success;
12604
    }
12605
 
12606
    public void unsetSuccess() {
12607
      this.success = null;
12608
    }
12609
 
12610
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
12611
    public boolean isSetSuccess() {
12612
      return this.success != null;
12613
    }
12614
 
12615
    public void setSuccessIsSet(boolean value) {
12616
      if (!value) {
12617
        this.success = null;
12618
      }
12619
    }
12620
 
12621
    public PromotionException getPex() {
12622
      return this.pex;
12623
    }
12624
 
12625
    public void setPex(PromotionException pex) {
12626
      this.pex = pex;
12627
    }
12628
 
12629
    public void unsetPex() {
12630
      this.pex = null;
12631
    }
12632
 
12633
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
12634
    public boolean isSetPex() {
12635
      return this.pex != null;
12636
    }
12637
 
12638
    public void setPexIsSet(boolean value) {
12639
      if (!value) {
12640
        this.pex = null;
12641
      }
12642
    }
12643
 
12644
    public void setFieldValue(_Fields field, Object value) {
12645
      switch (field) {
12646
      case SUCCESS:
12647
        if (value == null) {
12648
          unsetSuccess();
12649
        } else {
12650
          setSuccess((List<Coupon>)value);
12651
        }
12652
        break;
12653
 
12654
      case PEX:
12655
        if (value == null) {
12656
          unsetPex();
12657
        } else {
12658
          setPex((PromotionException)value);
12659
        }
12660
        break;
12661
 
12662
      }
12663
    }
12664
 
12665
    public Object getFieldValue(_Fields field) {
12666
      switch (field) {
12667
      case SUCCESS:
12668
        return getSuccess();
12669
 
12670
      case PEX:
12671
        return getPex();
12672
 
12673
      }
12674
      throw new IllegalStateException();
12675
    }
12676
 
12677
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12678
    public boolean isSet(_Fields field) {
12679
      if (field == null) {
12680
        throw new IllegalArgumentException();
12681
      }
12682
 
12683
      switch (field) {
12684
      case SUCCESS:
12685
        return isSetSuccess();
12686
      case PEX:
12687
        return isSetPex();
12688
      }
12689
      throw new IllegalStateException();
12690
    }
12691
 
12692
    @Override
12693
    public boolean equals(Object that) {
12694
      if (that == null)
12695
        return false;
12696
      if (that instanceof getAllCouponsByPromotionId_result)
12697
        return this.equals((getAllCouponsByPromotionId_result)that);
12698
      return false;
12699
    }
12700
 
12701
    public boolean equals(getAllCouponsByPromotionId_result that) {
12702
      if (that == null)
12703
        return false;
12704
 
12705
      boolean this_present_success = true && this.isSetSuccess();
12706
      boolean that_present_success = true && that.isSetSuccess();
12707
      if (this_present_success || that_present_success) {
12708
        if (!(this_present_success && that_present_success))
12709
          return false;
12710
        if (!this.success.equals(that.success))
12711
          return false;
12712
      }
12713
 
12714
      boolean this_present_pex = true && this.isSetPex();
12715
      boolean that_present_pex = true && that.isSetPex();
12716
      if (this_present_pex || that_present_pex) {
12717
        if (!(this_present_pex && that_present_pex))
12718
          return false;
12719
        if (!this.pex.equals(that.pex))
12720
          return false;
12721
      }
12722
 
12723
      return true;
12724
    }
12725
 
12726
    @Override
12727
    public int hashCode() {
12728
      return 0;
12729
    }
12730
 
12731
    public int compareTo(getAllCouponsByPromotionId_result other) {
12732
      if (!getClass().equals(other.getClass())) {
12733
        return getClass().getName().compareTo(other.getClass().getName());
12734
      }
12735
 
12736
      int lastComparison = 0;
12737
      getAllCouponsByPromotionId_result typedOther = (getAllCouponsByPromotionId_result)other;
12738
 
12739
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
12740
      if (lastComparison != 0) {
12741
        return lastComparison;
12742
      }
12743
      if (isSetSuccess()) {
12744
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
12745
        if (lastComparison != 0) {
12746
          return lastComparison;
12747
        }
12748
      }
12749
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
12750
      if (lastComparison != 0) {
12751
        return lastComparison;
12752
      }
12753
      if (isSetPex()) {
12754
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
12755
        if (lastComparison != 0) {
12756
          return lastComparison;
12757
        }
12758
      }
12759
      return 0;
12760
    }
12761
 
12762
    public _Fields fieldForId(int fieldId) {
12763
      return _Fields.findByThriftId(fieldId);
12764
    }
12765
 
12766
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12767
      org.apache.thrift.protocol.TField field;
12768
      iprot.readStructBegin();
12769
      while (true)
12770
      {
12771
        field = iprot.readFieldBegin();
12772
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12773
          break;
12774
        }
12775
        switch (field.id) {
12776
          case 0: // SUCCESS
12777
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
12778
              {
12779
                org.apache.thrift.protocol.TList _list30 = iprot.readListBegin();
12780
                this.success = new ArrayList<Coupon>(_list30.size);
12781
                for (int _i31 = 0; _i31 < _list30.size; ++_i31)
12782
                {
12783
                  Coupon _elem32; // required
12784
                  _elem32 = new Coupon();
12785
                  _elem32.read(iprot);
12786
                  this.success.add(_elem32);
12787
                }
12788
                iprot.readListEnd();
12789
              }
12790
            } else { 
12791
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12792
            }
12793
            break;
12794
          case 1: // PEX
12795
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
12796
              this.pex = new PromotionException();
12797
              this.pex.read(iprot);
12798
            } else { 
12799
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12800
            }
12801
            break;
12802
          default:
12803
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12804
        }
12805
        iprot.readFieldEnd();
12806
      }
12807
      iprot.readStructEnd();
12808
      validate();
12809
    }
12810
 
12811
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12812
      oprot.writeStructBegin(STRUCT_DESC);
12813
 
12814
      if (this.isSetSuccess()) {
12815
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
12816
        {
12817
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
12818
          for (Coupon _iter33 : this.success)
12819
          {
12820
            _iter33.write(oprot);
12821
          }
12822
          oprot.writeListEnd();
12823
        }
12824
        oprot.writeFieldEnd();
12825
      } else if (this.isSetPex()) {
12826
        oprot.writeFieldBegin(PEX_FIELD_DESC);
12827
        this.pex.write(oprot);
12828
        oprot.writeFieldEnd();
12829
      }
12830
      oprot.writeFieldStop();
12831
      oprot.writeStructEnd();
12832
    }
12833
 
12834
    @Override
12835
    public String toString() {
12836
      StringBuilder sb = new StringBuilder("getAllCouponsByPromotionId_result(");
12837
      boolean first = true;
12838
 
12839
      sb.append("success:");
12840
      if (this.success == null) {
12841
        sb.append("null");
12842
      } else {
12843
        sb.append(this.success);
12844
      }
12845
      first = false;
12846
      if (!first) sb.append(", ");
12847
      sb.append("pex:");
12848
      if (this.pex == null) {
12849
        sb.append("null");
12850
      } else {
12851
        sb.append(this.pex);
12852
      }
12853
      first = false;
12854
      sb.append(")");
12855
      return sb.toString();
12856
    }
12857
 
12858
    public void validate() throws org.apache.thrift.TException {
12859
      // check for required fields
12860
    }
12861
 
12862
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12863
      try {
12864
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12865
      } catch (org.apache.thrift.TException te) {
12866
        throw new java.io.IOException(te);
12867
      }
12868
    }
12869
 
12870
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12871
      try {
12872
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12873
      } catch (org.apache.thrift.TException te) {
12874
        throw new java.io.IOException(te);
12875
      }
12876
    }
12877
 
12878
  }
12879
 
3430 rajveer 12880
  public static class getActiveCoupons_args implements org.apache.thrift.TBase<getActiveCoupons_args, getActiveCoupons_args._Fields>, java.io.Serializable, Cloneable   {
12881
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_args");
3385 varun.gupt 12882
 
12883
 
12884
 
12885
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 12886
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 12887
;
12888
 
12889
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12890
 
12891
      static {
12892
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12893
          byName.put(field.getFieldName(), field);
12894
        }
12895
      }
12896
 
12897
      /**
12898
       * Find the _Fields constant that matches fieldId, or null if its not found.
12899
       */
12900
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 12901
        switch(fieldId) {
12902
          default:
12903
            return null;
12904
        }
3385 varun.gupt 12905
      }
12906
 
12907
      /**
12908
       * Find the _Fields constant that matches fieldId, throwing an exception
12909
       * if it is not found.
12910
       */
12911
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12912
        _Fields fields = findByThriftId(fieldId);
12913
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12914
        return fields;
12915
      }
12916
 
12917
      /**
12918
       * Find the _Fields constant that matches name, or null if its not found.
12919
       */
12920
      public static _Fields findByName(String name) {
12921
        return byName.get(name);
12922
      }
12923
 
12924
      private final short _thriftId;
12925
      private final String _fieldName;
12926
 
12927
      _Fields(short thriftId, String fieldName) {
12928
        _thriftId = thriftId;
12929
        _fieldName = fieldName;
12930
      }
12931
 
12932
      public short getThriftFieldId() {
12933
        return _thriftId;
12934
      }
12935
 
12936
      public String getFieldName() {
12937
        return _fieldName;
12938
      }
12939
    }
3430 rajveer 12940
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 12941
    static {
3430 rajveer 12942
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12943
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12944
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_args.class, metaDataMap);
3385 varun.gupt 12945
    }
12946
 
12947
    public getActiveCoupons_args() {
12948
    }
12949
 
12950
    /**
12951
     * Performs a deep copy on <i>other</i>.
12952
     */
12953
    public getActiveCoupons_args(getActiveCoupons_args other) {
12954
    }
12955
 
12956
    public getActiveCoupons_args deepCopy() {
12957
      return new getActiveCoupons_args(this);
12958
    }
12959
 
3430 rajveer 12960
    @Override
12961
    public void clear() {
3385 varun.gupt 12962
    }
12963
 
12964
    public void setFieldValue(_Fields field, Object value) {
12965
      switch (field) {
12966
      }
12967
    }
12968
 
12969
    public Object getFieldValue(_Fields field) {
12970
      switch (field) {
12971
      }
12972
      throw new IllegalStateException();
12973
    }
12974
 
3430 rajveer 12975
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12976
    public boolean isSet(_Fields field) {
12977
      if (field == null) {
12978
        throw new IllegalArgumentException();
12979
      }
3385 varun.gupt 12980
 
12981
      switch (field) {
12982
      }
12983
      throw new IllegalStateException();
12984
    }
12985
 
12986
    @Override
12987
    public boolean equals(Object that) {
12988
      if (that == null)
12989
        return false;
12990
      if (that instanceof getActiveCoupons_args)
12991
        return this.equals((getActiveCoupons_args)that);
12992
      return false;
12993
    }
12994
 
12995
    public boolean equals(getActiveCoupons_args that) {
12996
      if (that == null)
12997
        return false;
12998
 
12999
      return true;
13000
    }
13001
 
13002
    @Override
13003
    public int hashCode() {
13004
      return 0;
13005
    }
13006
 
13007
    public int compareTo(getActiveCoupons_args other) {
13008
      if (!getClass().equals(other.getClass())) {
13009
        return getClass().getName().compareTo(other.getClass().getName());
13010
      }
13011
 
13012
      int lastComparison = 0;
13013
      getActiveCoupons_args typedOther = (getActiveCoupons_args)other;
13014
 
13015
      return 0;
13016
    }
13017
 
3430 rajveer 13018
    public _Fields fieldForId(int fieldId) {
13019
      return _Fields.findByThriftId(fieldId);
13020
    }
13021
 
13022
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13023
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 13024
      iprot.readStructBegin();
13025
      while (true)
13026
      {
13027
        field = iprot.readFieldBegin();
3430 rajveer 13028
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 13029
          break;
13030
        }
3430 rajveer 13031
        switch (field.id) {
13032
          default:
13033
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 13034
        }
3430 rajveer 13035
        iprot.readFieldEnd();
3385 varun.gupt 13036
      }
13037
      iprot.readStructEnd();
13038
      validate();
13039
    }
13040
 
3430 rajveer 13041
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 13042
      validate();
13043
 
13044
      oprot.writeStructBegin(STRUCT_DESC);
13045
      oprot.writeFieldStop();
13046
      oprot.writeStructEnd();
13047
    }
13048
 
13049
    @Override
13050
    public String toString() {
13051
      StringBuilder sb = new StringBuilder("getActiveCoupons_args(");
13052
      boolean first = true;
13053
 
13054
      sb.append(")");
13055
      return sb.toString();
13056
    }
13057
 
3430 rajveer 13058
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 13059
      // check for required fields
13060
    }
13061
 
3430 rajveer 13062
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13063
      try {
13064
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13065
      } catch (org.apache.thrift.TException te) {
13066
        throw new java.io.IOException(te);
13067
      }
13068
    }
13069
 
13070
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13071
      try {
13072
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13073
      } catch (org.apache.thrift.TException te) {
13074
        throw new java.io.IOException(te);
13075
      }
13076
    }
13077
 
3385 varun.gupt 13078
  }
13079
 
3430 rajveer 13080
  public static class getActiveCoupons_result implements org.apache.thrift.TBase<getActiveCoupons_result, getActiveCoupons_result._Fields>, java.io.Serializable, Cloneable   {
13081
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_result");
3385 varun.gupt 13082
 
3430 rajveer 13083
    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);
13084
    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 13085
 
3430 rajveer 13086
    private List<Coupon> success; // required
13087
    private PromotionException pex; // required
3385 varun.gupt 13088
 
13089
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 13090
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 13091
      SUCCESS((short)0, "success"),
13092
      PEX((short)1, "pex");
13093
 
13094
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13095
 
13096
      static {
13097
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13098
          byName.put(field.getFieldName(), field);
13099
        }
13100
      }
13101
 
13102
      /**
13103
       * Find the _Fields constant that matches fieldId, or null if its not found.
13104
       */
13105
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 13106
        switch(fieldId) {
13107
          case 0: // SUCCESS
13108
            return SUCCESS;
13109
          case 1: // PEX
13110
            return PEX;
13111
          default:
13112
            return null;
13113
        }
3385 varun.gupt 13114
      }
13115
 
13116
      /**
13117
       * Find the _Fields constant that matches fieldId, throwing an exception
13118
       * if it is not found.
13119
       */
13120
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13121
        _Fields fields = findByThriftId(fieldId);
13122
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13123
        return fields;
13124
      }
13125
 
13126
      /**
13127
       * Find the _Fields constant that matches name, or null if its not found.
13128
       */
13129
      public static _Fields findByName(String name) {
13130
        return byName.get(name);
13131
      }
13132
 
13133
      private final short _thriftId;
13134
      private final String _fieldName;
13135
 
13136
      _Fields(short thriftId, String fieldName) {
13137
        _thriftId = thriftId;
13138
        _fieldName = fieldName;
13139
      }
13140
 
13141
      public short getThriftFieldId() {
13142
        return _thriftId;
13143
      }
13144
 
13145
      public String getFieldName() {
13146
        return _fieldName;
13147
      }
13148
    }
13149
 
13150
    // isset id assignments
13151
 
3430 rajveer 13152
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 13153
    static {
3430 rajveer 13154
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13155
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13156
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
13157
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
13158
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13159
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
13160
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13161
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_result.class, metaDataMap);
3385 varun.gupt 13162
    }
13163
 
13164
    public getActiveCoupons_result() {
13165
    }
13166
 
13167
    public getActiveCoupons_result(
13168
      List<Coupon> success,
13169
      PromotionException pex)
13170
    {
13171
      this();
13172
      this.success = success;
13173
      this.pex = pex;
13174
    }
13175
 
13176
    /**
13177
     * Performs a deep copy on <i>other</i>.
13178
     */
13179
    public getActiveCoupons_result(getActiveCoupons_result other) {
13180
      if (other.isSetSuccess()) {
13181
        List<Coupon> __this__success = new ArrayList<Coupon>();
13182
        for (Coupon other_element : other.success) {
13183
          __this__success.add(new Coupon(other_element));
13184
        }
13185
        this.success = __this__success;
13186
      }
13187
      if (other.isSetPex()) {
13188
        this.pex = new PromotionException(other.pex);
13189
      }
13190
    }
13191
 
13192
    public getActiveCoupons_result deepCopy() {
13193
      return new getActiveCoupons_result(this);
13194
    }
13195
 
3430 rajveer 13196
    @Override
13197
    public void clear() {
13198
      this.success = null;
13199
      this.pex = null;
3385 varun.gupt 13200
    }
13201
 
13202
    public int getSuccessSize() {
13203
      return (this.success == null) ? 0 : this.success.size();
13204
    }
13205
 
13206
    public java.util.Iterator<Coupon> getSuccessIterator() {
13207
      return (this.success == null) ? null : this.success.iterator();
13208
    }
13209
 
13210
    public void addToSuccess(Coupon elem) {
13211
      if (this.success == null) {
13212
        this.success = new ArrayList<Coupon>();
13213
      }
13214
      this.success.add(elem);
13215
    }
13216
 
13217
    public List<Coupon> getSuccess() {
13218
      return this.success;
13219
    }
13220
 
3430 rajveer 13221
    public void setSuccess(List<Coupon> success) {
3385 varun.gupt 13222
      this.success = success;
13223
    }
13224
 
13225
    public void unsetSuccess() {
13226
      this.success = null;
13227
    }
13228
 
3430 rajveer 13229
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 13230
    public boolean isSetSuccess() {
13231
      return this.success != null;
13232
    }
13233
 
13234
    public void setSuccessIsSet(boolean value) {
13235
      if (!value) {
13236
        this.success = null;
13237
      }
13238
    }
13239
 
13240
    public PromotionException getPex() {
13241
      return this.pex;
13242
    }
13243
 
3430 rajveer 13244
    public void setPex(PromotionException pex) {
3385 varun.gupt 13245
      this.pex = pex;
13246
    }
13247
 
13248
    public void unsetPex() {
13249
      this.pex = null;
13250
    }
13251
 
3430 rajveer 13252
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 13253
    public boolean isSetPex() {
13254
      return this.pex != null;
13255
    }
13256
 
13257
    public void setPexIsSet(boolean value) {
13258
      if (!value) {
13259
        this.pex = null;
13260
      }
13261
    }
13262
 
13263
    public void setFieldValue(_Fields field, Object value) {
13264
      switch (field) {
13265
      case SUCCESS:
13266
        if (value == null) {
13267
          unsetSuccess();
13268
        } else {
13269
          setSuccess((List<Coupon>)value);
13270
        }
13271
        break;
13272
 
13273
      case PEX:
13274
        if (value == null) {
13275
          unsetPex();
13276
        } else {
13277
          setPex((PromotionException)value);
13278
        }
13279
        break;
13280
 
13281
      }
13282
    }
13283
 
13284
    public Object getFieldValue(_Fields field) {
13285
      switch (field) {
13286
      case SUCCESS:
13287
        return getSuccess();
13288
 
13289
      case PEX:
13290
        return getPex();
13291
 
13292
      }
13293
      throw new IllegalStateException();
13294
    }
13295
 
3430 rajveer 13296
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13297
    public boolean isSet(_Fields field) {
13298
      if (field == null) {
13299
        throw new IllegalArgumentException();
13300
      }
3385 varun.gupt 13301
 
13302
      switch (field) {
13303
      case SUCCESS:
13304
        return isSetSuccess();
13305
      case PEX:
13306
        return isSetPex();
13307
      }
13308
      throw new IllegalStateException();
13309
    }
13310
 
13311
    @Override
13312
    public boolean equals(Object that) {
13313
      if (that == null)
13314
        return false;
13315
      if (that instanceof getActiveCoupons_result)
13316
        return this.equals((getActiveCoupons_result)that);
13317
      return false;
13318
    }
13319
 
13320
    public boolean equals(getActiveCoupons_result that) {
13321
      if (that == null)
13322
        return false;
13323
 
13324
      boolean this_present_success = true && this.isSetSuccess();
13325
      boolean that_present_success = true && that.isSetSuccess();
13326
      if (this_present_success || that_present_success) {
13327
        if (!(this_present_success && that_present_success))
13328
          return false;
13329
        if (!this.success.equals(that.success))
13330
          return false;
13331
      }
13332
 
13333
      boolean this_present_pex = true && this.isSetPex();
13334
      boolean that_present_pex = true && that.isSetPex();
13335
      if (this_present_pex || that_present_pex) {
13336
        if (!(this_present_pex && that_present_pex))
13337
          return false;
13338
        if (!this.pex.equals(that.pex))
13339
          return false;
13340
      }
13341
 
13342
      return true;
13343
    }
13344
 
13345
    @Override
13346
    public int hashCode() {
13347
      return 0;
13348
    }
13349
 
13350
    public int compareTo(getActiveCoupons_result other) {
13351
      if (!getClass().equals(other.getClass())) {
13352
        return getClass().getName().compareTo(other.getClass().getName());
13353
      }
13354
 
13355
      int lastComparison = 0;
13356
      getActiveCoupons_result typedOther = (getActiveCoupons_result)other;
13357
 
3430 rajveer 13358
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 13359
      if (lastComparison != 0) {
13360
        return lastComparison;
13361
      }
3430 rajveer 13362
      if (isSetSuccess()) {
13363
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
13364
        if (lastComparison != 0) {
13365
          return lastComparison;
13366
        }
3385 varun.gupt 13367
      }
3430 rajveer 13368
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 13369
      if (lastComparison != 0) {
13370
        return lastComparison;
13371
      }
3430 rajveer 13372
      if (isSetPex()) {
13373
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
13374
        if (lastComparison != 0) {
13375
          return lastComparison;
13376
        }
3385 varun.gupt 13377
      }
13378
      return 0;
13379
    }
13380
 
3430 rajveer 13381
    public _Fields fieldForId(int fieldId) {
13382
      return _Fields.findByThriftId(fieldId);
13383
    }
13384
 
13385
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13386
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 13387
      iprot.readStructBegin();
13388
      while (true)
13389
      {
13390
        field = iprot.readFieldBegin();
3430 rajveer 13391
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 13392
          break;
13393
        }
3430 rajveer 13394
        switch (field.id) {
13395
          case 0: // SUCCESS
13396
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
13397
              {
7092 amit.gupta 13398
                org.apache.thrift.protocol.TList _list34 = iprot.readListBegin();
13399
                this.success = new ArrayList<Coupon>(_list34.size);
13400
                for (int _i35 = 0; _i35 < _list34.size; ++_i35)
3385 varun.gupt 13401
                {
7092 amit.gupta 13402
                  Coupon _elem36; // required
13403
                  _elem36 = new Coupon();
13404
                  _elem36.read(iprot);
13405
                  this.success.add(_elem36);
3385 varun.gupt 13406
                }
3430 rajveer 13407
                iprot.readListEnd();
3385 varun.gupt 13408
              }
3430 rajveer 13409
            } else { 
13410
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13411
            }
13412
            break;
13413
          case 1: // PEX
13414
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
13415
              this.pex = new PromotionException();
13416
              this.pex.read(iprot);
13417
            } else { 
13418
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13419
            }
13420
            break;
13421
          default:
13422
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 13423
        }
3430 rajveer 13424
        iprot.readFieldEnd();
3385 varun.gupt 13425
      }
13426
      iprot.readStructEnd();
13427
      validate();
13428
    }
13429
 
3430 rajveer 13430
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 13431
      oprot.writeStructBegin(STRUCT_DESC);
13432
 
13433
      if (this.isSetSuccess()) {
13434
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
13435
        {
3430 rajveer 13436
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
7092 amit.gupta 13437
          for (Coupon _iter37 : this.success)
3385 varun.gupt 13438
          {
7092 amit.gupta 13439
            _iter37.write(oprot);
3385 varun.gupt 13440
          }
13441
          oprot.writeListEnd();
13442
        }
13443
        oprot.writeFieldEnd();
13444
      } else if (this.isSetPex()) {
13445
        oprot.writeFieldBegin(PEX_FIELD_DESC);
13446
        this.pex.write(oprot);
13447
        oprot.writeFieldEnd();
13448
      }
13449
      oprot.writeFieldStop();
13450
      oprot.writeStructEnd();
13451
    }
13452
 
13453
    @Override
13454
    public String toString() {
13455
      StringBuilder sb = new StringBuilder("getActiveCoupons_result(");
13456
      boolean first = true;
13457
 
13458
      sb.append("success:");
13459
      if (this.success == null) {
13460
        sb.append("null");
13461
      } else {
13462
        sb.append(this.success);
13463
      }
13464
      first = false;
13465
      if (!first) sb.append(", ");
13466
      sb.append("pex:");
13467
      if (this.pex == null) {
13468
        sb.append("null");
13469
      } else {
13470
        sb.append(this.pex);
13471
      }
13472
      first = false;
13473
      sb.append(")");
13474
      return sb.toString();
13475
    }
13476
 
3430 rajveer 13477
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 13478
      // check for required fields
13479
    }
13480
 
3430 rajveer 13481
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13482
      try {
13483
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13484
      } catch (org.apache.thrift.TException te) {
13485
        throw new java.io.IOException(te);
13486
      }
13487
    }
13488
 
13489
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13490
      try {
13491
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13492
      } catch (org.apache.thrift.TException te) {
13493
        throw new java.io.IOException(te);
13494
      }
13495
    }
13496
 
3385 varun.gupt 13497
  }
13498
 
6250 amit.gupta 13499
  public static class createCoupon_args implements org.apache.thrift.TBase<createCoupon_args, createCoupon_args._Fields>, java.io.Serializable, Cloneable   {
13500
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_args");
13501
 
13502
    private static final org.apache.thrift.protocol.TField PROMOTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("promotionId", org.apache.thrift.protocol.TType.I64, (short)1);
6730 anupam.sin 13503
    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);
13504
    private static final org.apache.thrift.protocol.TField ARGUMENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("arguments", org.apache.thrift.protocol.TType.STRING, (short)3);
13505
    private static final org.apache.thrift.protocol.TField IS_COD_FIELD_DESC = new org.apache.thrift.protocol.TField("isCod", org.apache.thrift.protocol.TType.BOOL, (short)4);
13506
    private static final org.apache.thrift.protocol.TField PREFIX_FIELD_DESC = new org.apache.thrift.protocol.TField("prefix", org.apache.thrift.protocol.TType.STRING, (short)5);
6250 amit.gupta 13507
 
13508
    private long promotionId; // required
6730 anupam.sin 13509
    private String couponCode; // required
6679 anupam.sin 13510
    private String arguments; // required
6356 amit.gupta 13511
    private boolean isCod; // required
6561 amit.gupta 13512
    private String prefix; // required
6250 amit.gupta 13513
 
13514
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
13515
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
13516
      PROMOTION_ID((short)1, "promotionId"),
6730 anupam.sin 13517
      COUPON_CODE((short)2, "couponCode"),
13518
      ARGUMENTS((short)3, "arguments"),
13519
      IS_COD((short)4, "isCod"),
13520
      PREFIX((short)5, "prefix");
6250 amit.gupta 13521
 
13522
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13523
 
13524
      static {
13525
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13526
          byName.put(field.getFieldName(), field);
13527
        }
13528
      }
13529
 
13530
      /**
13531
       * Find the _Fields constant that matches fieldId, or null if its not found.
13532
       */
13533
      public static _Fields findByThriftId(int fieldId) {
13534
        switch(fieldId) {
13535
          case 1: // PROMOTION_ID
13536
            return PROMOTION_ID;
6730 anupam.sin 13537
          case 2: // COUPON_CODE
13538
            return COUPON_CODE;
13539
          case 3: // ARGUMENTS
6679 anupam.sin 13540
            return ARGUMENTS;
6730 anupam.sin 13541
          case 4: // IS_COD
6356 amit.gupta 13542
            return IS_COD;
6730 anupam.sin 13543
          case 5: // PREFIX
6561 amit.gupta 13544
            return PREFIX;
6250 amit.gupta 13545
          default:
13546
            return null;
13547
        }
13548
      }
13549
 
13550
      /**
13551
       * Find the _Fields constant that matches fieldId, throwing an exception
13552
       * if it is not found.
13553
       */
13554
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13555
        _Fields fields = findByThriftId(fieldId);
13556
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13557
        return fields;
13558
      }
13559
 
13560
      /**
13561
       * Find the _Fields constant that matches name, or null if its not found.
13562
       */
13563
      public static _Fields findByName(String name) {
13564
        return byName.get(name);
13565
      }
13566
 
13567
      private final short _thriftId;
13568
      private final String _fieldName;
13569
 
13570
      _Fields(short thriftId, String fieldName) {
13571
        _thriftId = thriftId;
13572
        _fieldName = fieldName;
13573
      }
13574
 
13575
      public short getThriftFieldId() {
13576
        return _thriftId;
13577
      }
13578
 
13579
      public String getFieldName() {
13580
        return _fieldName;
13581
      }
13582
    }
13583
 
13584
    // isset id assignments
13585
    private static final int __PROMOTIONID_ISSET_ID = 0;
6679 anupam.sin 13586
    private static final int __ISCOD_ISSET_ID = 1;
13587
    private BitSet __isset_bit_vector = new BitSet(2);
6250 amit.gupta 13588
 
13589
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
13590
    static {
13591
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13592
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13593
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6730 anupam.sin 13594
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13595
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6679 anupam.sin 13596
      tmpMap.put(_Fields.ARGUMENTS, new org.apache.thrift.meta_data.FieldMetaData("arguments", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6250 amit.gupta 13597
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6356 amit.gupta 13598
      tmpMap.put(_Fields.IS_COD, new org.apache.thrift.meta_data.FieldMetaData("isCod", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13599
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
6561 amit.gupta 13600
      tmpMap.put(_Fields.PREFIX, new org.apache.thrift.meta_data.FieldMetaData("prefix", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13601
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6250 amit.gupta 13602
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13603
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_args.class, metaDataMap);
13604
    }
13605
 
13606
    public createCoupon_args() {
13607
    }
13608
 
13609
    public createCoupon_args(
13610
      long promotionId,
6730 anupam.sin 13611
      String couponCode,
6679 anupam.sin 13612
      String arguments,
6356 amit.gupta 13613
      boolean isCod,
6561 amit.gupta 13614
      String prefix)
6250 amit.gupta 13615
    {
13616
      this();
13617
      this.promotionId = promotionId;
13618
      setPromotionIdIsSet(true);
6730 anupam.sin 13619
      this.couponCode = couponCode;
6679 anupam.sin 13620
      this.arguments = arguments;
6356 amit.gupta 13621
      this.isCod = isCod;
13622
      setIsCodIsSet(true);
6561 amit.gupta 13623
      this.prefix = prefix;
6250 amit.gupta 13624
    }
13625
 
13626
    /**
13627
     * Performs a deep copy on <i>other</i>.
13628
     */
13629
    public createCoupon_args(createCoupon_args other) {
13630
      __isset_bit_vector.clear();
13631
      __isset_bit_vector.or(other.__isset_bit_vector);
13632
      this.promotionId = other.promotionId;
6730 anupam.sin 13633
      if (other.isSetCouponCode()) {
13634
        this.couponCode = other.couponCode;
13635
      }
6679 anupam.sin 13636
      if (other.isSetArguments()) {
13637
        this.arguments = other.arguments;
6250 amit.gupta 13638
      }
6356 amit.gupta 13639
      this.isCod = other.isCod;
6561 amit.gupta 13640
      if (other.isSetPrefix()) {
13641
        this.prefix = other.prefix;
13642
      }
6250 amit.gupta 13643
    }
13644
 
13645
    public createCoupon_args deepCopy() {
13646
      return new createCoupon_args(this);
13647
    }
13648
 
13649
    @Override
13650
    public void clear() {
13651
      setPromotionIdIsSet(false);
13652
      this.promotionId = 0;
6730 anupam.sin 13653
      this.couponCode = null;
6679 anupam.sin 13654
      this.arguments = null;
6356 amit.gupta 13655
      setIsCodIsSet(false);
13656
      this.isCod = false;
6561 amit.gupta 13657
      this.prefix = null;
6250 amit.gupta 13658
    }
13659
 
13660
    public long getPromotionId() {
13661
      return this.promotionId;
13662
    }
13663
 
13664
    public void setPromotionId(long promotionId) {
13665
      this.promotionId = promotionId;
13666
      setPromotionIdIsSet(true);
13667
    }
13668
 
13669
    public void unsetPromotionId() {
13670
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
13671
    }
13672
 
13673
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
13674
    public boolean isSetPromotionId() {
13675
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
13676
    }
13677
 
13678
    public void setPromotionIdIsSet(boolean value) {
13679
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
13680
    }
13681
 
6730 anupam.sin 13682
    public String getCouponCode() {
13683
      return this.couponCode;
13684
    }
13685
 
13686
    public void setCouponCode(String couponCode) {
13687
      this.couponCode = couponCode;
13688
    }
13689
 
13690
    public void unsetCouponCode() {
13691
      this.couponCode = null;
13692
    }
13693
 
13694
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
13695
    public boolean isSetCouponCode() {
13696
      return this.couponCode != null;
13697
    }
13698
 
13699
    public void setCouponCodeIsSet(boolean value) {
13700
      if (!value) {
13701
        this.couponCode = null;
13702
      }
13703
    }
13704
 
6679 anupam.sin 13705
    public String getArguments() {
13706
      return this.arguments;
6250 amit.gupta 13707
    }
13708
 
6679 anupam.sin 13709
    public void setArguments(String arguments) {
13710
      this.arguments = arguments;
6250 amit.gupta 13711
    }
13712
 
6679 anupam.sin 13713
    public void unsetArguments() {
13714
      this.arguments = null;
6250 amit.gupta 13715
    }
13716
 
6679 anupam.sin 13717
    /** Returns true if field arguments is set (has been assigned a value) and false otherwise */
13718
    public boolean isSetArguments() {
13719
      return this.arguments != null;
6250 amit.gupta 13720
    }
13721
 
6679 anupam.sin 13722
    public void setArgumentsIsSet(boolean value) {
6250 amit.gupta 13723
      if (!value) {
6679 anupam.sin 13724
        this.arguments = null;
6250 amit.gupta 13725
      }
13726
    }
13727
 
6356 amit.gupta 13728
    public boolean isIsCod() {
13729
      return this.isCod;
13730
    }
13731
 
13732
    public void setIsCod(boolean isCod) {
13733
      this.isCod = isCod;
13734
      setIsCodIsSet(true);
13735
    }
13736
 
13737
    public void unsetIsCod() {
13738
      __isset_bit_vector.clear(__ISCOD_ISSET_ID);
13739
    }
13740
 
13741
    /** Returns true if field isCod is set (has been assigned a value) and false otherwise */
13742
    public boolean isSetIsCod() {
13743
      return __isset_bit_vector.get(__ISCOD_ISSET_ID);
13744
    }
13745
 
13746
    public void setIsCodIsSet(boolean value) {
13747
      __isset_bit_vector.set(__ISCOD_ISSET_ID, value);
13748
    }
13749
 
6561 amit.gupta 13750
    public String getPrefix() {
13751
      return this.prefix;
13752
    }
13753
 
13754
    public void setPrefix(String prefix) {
13755
      this.prefix = prefix;
13756
    }
13757
 
13758
    public void unsetPrefix() {
13759
      this.prefix = null;
13760
    }
13761
 
13762
    /** Returns true if field prefix is set (has been assigned a value) and false otherwise */
13763
    public boolean isSetPrefix() {
13764
      return this.prefix != null;
13765
    }
13766
 
13767
    public void setPrefixIsSet(boolean value) {
13768
      if (!value) {
13769
        this.prefix = null;
13770
      }
13771
    }
13772
 
6250 amit.gupta 13773
    public void setFieldValue(_Fields field, Object value) {
13774
      switch (field) {
13775
      case PROMOTION_ID:
13776
        if (value == null) {
13777
          unsetPromotionId();
13778
        } else {
13779
          setPromotionId((Long)value);
13780
        }
13781
        break;
13782
 
6730 anupam.sin 13783
      case COUPON_CODE:
13784
        if (value == null) {
13785
          unsetCouponCode();
13786
        } else {
13787
          setCouponCode((String)value);
13788
        }
13789
        break;
13790
 
6679 anupam.sin 13791
      case ARGUMENTS:
6250 amit.gupta 13792
        if (value == null) {
6679 anupam.sin 13793
          unsetArguments();
6250 amit.gupta 13794
        } else {
6679 anupam.sin 13795
          setArguments((String)value);
6250 amit.gupta 13796
        }
13797
        break;
13798
 
6356 amit.gupta 13799
      case IS_COD:
13800
        if (value == null) {
13801
          unsetIsCod();
13802
        } else {
13803
          setIsCod((Boolean)value);
13804
        }
13805
        break;
13806
 
6561 amit.gupta 13807
      case PREFIX:
13808
        if (value == null) {
13809
          unsetPrefix();
13810
        } else {
13811
          setPrefix((String)value);
13812
        }
13813
        break;
13814
 
6250 amit.gupta 13815
      }
13816
    }
13817
 
13818
    public Object getFieldValue(_Fields field) {
13819
      switch (field) {
13820
      case PROMOTION_ID:
13821
        return Long.valueOf(getPromotionId());
13822
 
6730 anupam.sin 13823
      case COUPON_CODE:
13824
        return getCouponCode();
13825
 
6679 anupam.sin 13826
      case ARGUMENTS:
13827
        return getArguments();
6250 amit.gupta 13828
 
6356 amit.gupta 13829
      case IS_COD:
13830
        return Boolean.valueOf(isIsCod());
13831
 
6561 amit.gupta 13832
      case PREFIX:
13833
        return getPrefix();
13834
 
6250 amit.gupta 13835
      }
13836
      throw new IllegalStateException();
13837
    }
13838
 
13839
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13840
    public boolean isSet(_Fields field) {
13841
      if (field == null) {
13842
        throw new IllegalArgumentException();
13843
      }
13844
 
13845
      switch (field) {
13846
      case PROMOTION_ID:
13847
        return isSetPromotionId();
6730 anupam.sin 13848
      case COUPON_CODE:
13849
        return isSetCouponCode();
6679 anupam.sin 13850
      case ARGUMENTS:
13851
        return isSetArguments();
6356 amit.gupta 13852
      case IS_COD:
13853
        return isSetIsCod();
6561 amit.gupta 13854
      case PREFIX:
13855
        return isSetPrefix();
6250 amit.gupta 13856
      }
13857
      throw new IllegalStateException();
13858
    }
13859
 
13860
    @Override
13861
    public boolean equals(Object that) {
13862
      if (that == null)
13863
        return false;
13864
      if (that instanceof createCoupon_args)
13865
        return this.equals((createCoupon_args)that);
13866
      return false;
13867
    }
13868
 
13869
    public boolean equals(createCoupon_args that) {
13870
      if (that == null)
13871
        return false;
13872
 
13873
      boolean this_present_promotionId = true;
13874
      boolean that_present_promotionId = true;
13875
      if (this_present_promotionId || that_present_promotionId) {
13876
        if (!(this_present_promotionId && that_present_promotionId))
13877
          return false;
13878
        if (this.promotionId != that.promotionId)
13879
          return false;
13880
      }
13881
 
6730 anupam.sin 13882
      boolean this_present_couponCode = true && this.isSetCouponCode();
13883
      boolean that_present_couponCode = true && that.isSetCouponCode();
13884
      if (this_present_couponCode || that_present_couponCode) {
13885
        if (!(this_present_couponCode && that_present_couponCode))
13886
          return false;
13887
        if (!this.couponCode.equals(that.couponCode))
13888
          return false;
13889
      }
13890
 
6679 anupam.sin 13891
      boolean this_present_arguments = true && this.isSetArguments();
13892
      boolean that_present_arguments = true && that.isSetArguments();
13893
      if (this_present_arguments || that_present_arguments) {
13894
        if (!(this_present_arguments && that_present_arguments))
6250 amit.gupta 13895
          return false;
6679 anupam.sin 13896
        if (!this.arguments.equals(that.arguments))
6250 amit.gupta 13897
          return false;
13898
      }
13899
 
6356 amit.gupta 13900
      boolean this_present_isCod = true;
13901
      boolean that_present_isCod = true;
13902
      if (this_present_isCod || that_present_isCod) {
13903
        if (!(this_present_isCod && that_present_isCod))
13904
          return false;
13905
        if (this.isCod != that.isCod)
13906
          return false;
13907
      }
13908
 
6561 amit.gupta 13909
      boolean this_present_prefix = true && this.isSetPrefix();
13910
      boolean that_present_prefix = true && that.isSetPrefix();
13911
      if (this_present_prefix || that_present_prefix) {
13912
        if (!(this_present_prefix && that_present_prefix))
13913
          return false;
13914
        if (!this.prefix.equals(that.prefix))
13915
          return false;
13916
      }
13917
 
6250 amit.gupta 13918
      return true;
13919
    }
13920
 
13921
    @Override
13922
    public int hashCode() {
13923
      return 0;
13924
    }
13925
 
13926
    public int compareTo(createCoupon_args other) {
13927
      if (!getClass().equals(other.getClass())) {
13928
        return getClass().getName().compareTo(other.getClass().getName());
13929
      }
13930
 
13931
      int lastComparison = 0;
13932
      createCoupon_args typedOther = (createCoupon_args)other;
13933
 
13934
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
13935
      if (lastComparison != 0) {
13936
        return lastComparison;
13937
      }
13938
      if (isSetPromotionId()) {
13939
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
13940
        if (lastComparison != 0) {
13941
          return lastComparison;
13942
        }
13943
      }
6730 anupam.sin 13944
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
13945
      if (lastComparison != 0) {
13946
        return lastComparison;
13947
      }
13948
      if (isSetCouponCode()) {
13949
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
13950
        if (lastComparison != 0) {
13951
          return lastComparison;
13952
        }
13953
      }
6679 anupam.sin 13954
      lastComparison = Boolean.valueOf(isSetArguments()).compareTo(typedOther.isSetArguments());
6250 amit.gupta 13955
      if (lastComparison != 0) {
13956
        return lastComparison;
13957
      }
6679 anupam.sin 13958
      if (isSetArguments()) {
13959
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.arguments, typedOther.arguments);
6250 amit.gupta 13960
        if (lastComparison != 0) {
13961
          return lastComparison;
13962
        }
13963
      }
6356 amit.gupta 13964
      lastComparison = Boolean.valueOf(isSetIsCod()).compareTo(typedOther.isSetIsCod());
13965
      if (lastComparison != 0) {
13966
        return lastComparison;
13967
      }
13968
      if (isSetIsCod()) {
13969
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isCod, typedOther.isCod);
13970
        if (lastComparison != 0) {
13971
          return lastComparison;
13972
        }
13973
      }
6561 amit.gupta 13974
      lastComparison = Boolean.valueOf(isSetPrefix()).compareTo(typedOther.isSetPrefix());
13975
      if (lastComparison != 0) {
13976
        return lastComparison;
13977
      }
13978
      if (isSetPrefix()) {
13979
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.prefix, typedOther.prefix);
13980
        if (lastComparison != 0) {
13981
          return lastComparison;
13982
        }
13983
      }
6250 amit.gupta 13984
      return 0;
13985
    }
13986
 
13987
    public _Fields fieldForId(int fieldId) {
13988
      return _Fields.findByThriftId(fieldId);
13989
    }
13990
 
13991
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13992
      org.apache.thrift.protocol.TField field;
13993
      iprot.readStructBegin();
13994
      while (true)
13995
      {
13996
        field = iprot.readFieldBegin();
13997
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
13998
          break;
13999
        }
14000
        switch (field.id) {
14001
          case 1: // PROMOTION_ID
14002
            if (field.type == org.apache.thrift.protocol.TType.I64) {
14003
              this.promotionId = iprot.readI64();
14004
              setPromotionIdIsSet(true);
14005
            } else { 
14006
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14007
            }
14008
            break;
6730 anupam.sin 14009
          case 2: // COUPON_CODE
6250 amit.gupta 14010
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
6730 anupam.sin 14011
              this.couponCode = iprot.readString();
14012
            } else { 
14013
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14014
            }
14015
            break;
14016
          case 3: // ARGUMENTS
14017
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
6679 anupam.sin 14018
              this.arguments = iprot.readString();
6250 amit.gupta 14019
            } else { 
14020
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14021
            }
14022
            break;
6730 anupam.sin 14023
          case 4: // IS_COD
6356 amit.gupta 14024
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
14025
              this.isCod = iprot.readBool();
14026
              setIsCodIsSet(true);
14027
            } else { 
14028
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14029
            }
14030
            break;
6730 anupam.sin 14031
          case 5: // PREFIX
6561 amit.gupta 14032
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
14033
              this.prefix = iprot.readString();
14034
            } else { 
14035
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14036
            }
14037
            break;
6250 amit.gupta 14038
          default:
14039
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14040
        }
14041
        iprot.readFieldEnd();
14042
      }
14043
      iprot.readStructEnd();
14044
      validate();
14045
    }
14046
 
14047
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
14048
      validate();
14049
 
14050
      oprot.writeStructBegin(STRUCT_DESC);
14051
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
14052
      oprot.writeI64(this.promotionId);
14053
      oprot.writeFieldEnd();
6730 anupam.sin 14054
      if (this.couponCode != null) {
14055
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
14056
        oprot.writeString(this.couponCode);
14057
        oprot.writeFieldEnd();
14058
      }
6679 anupam.sin 14059
      if (this.arguments != null) {
14060
        oprot.writeFieldBegin(ARGUMENTS_FIELD_DESC);
14061
        oprot.writeString(this.arguments);
6250 amit.gupta 14062
        oprot.writeFieldEnd();
14063
      }
6356 amit.gupta 14064
      oprot.writeFieldBegin(IS_COD_FIELD_DESC);
14065
      oprot.writeBool(this.isCod);
14066
      oprot.writeFieldEnd();
6561 amit.gupta 14067
      if (this.prefix != null) {
14068
        oprot.writeFieldBegin(PREFIX_FIELD_DESC);
14069
        oprot.writeString(this.prefix);
14070
        oprot.writeFieldEnd();
14071
      }
6250 amit.gupta 14072
      oprot.writeFieldStop();
14073
      oprot.writeStructEnd();
14074
    }
14075
 
14076
    @Override
14077
    public String toString() {
14078
      StringBuilder sb = new StringBuilder("createCoupon_args(");
14079
      boolean first = true;
14080
 
14081
      sb.append("promotionId:");
14082
      sb.append(this.promotionId);
14083
      first = false;
14084
      if (!first) sb.append(", ");
6730 anupam.sin 14085
      sb.append("couponCode:");
14086
      if (this.couponCode == null) {
14087
        sb.append("null");
14088
      } else {
14089
        sb.append(this.couponCode);
14090
      }
14091
      first = false;
14092
      if (!first) sb.append(", ");
6679 anupam.sin 14093
      sb.append("arguments:");
14094
      if (this.arguments == null) {
6250 amit.gupta 14095
        sb.append("null");
14096
      } else {
6679 anupam.sin 14097
        sb.append(this.arguments);
6250 amit.gupta 14098
      }
14099
      first = false;
14100
      if (!first) sb.append(", ");
6356 amit.gupta 14101
      sb.append("isCod:");
14102
      sb.append(this.isCod);
14103
      first = false;
14104
      if (!first) sb.append(", ");
6561 amit.gupta 14105
      sb.append("prefix:");
14106
      if (this.prefix == null) {
14107
        sb.append("null");
14108
      } else {
14109
        sb.append(this.prefix);
14110
      }
14111
      first = false;
6250 amit.gupta 14112
      sb.append(")");
14113
      return sb.toString();
14114
    }
14115
 
14116
    public void validate() throws org.apache.thrift.TException {
14117
      // check for required fields
14118
    }
14119
 
14120
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14121
      try {
14122
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14123
      } catch (org.apache.thrift.TException te) {
14124
        throw new java.io.IOException(te);
14125
      }
14126
    }
14127
 
14128
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14129
      try {
6561 amit.gupta 14130
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
14131
        __isset_bit_vector = new BitSet(1);
6250 amit.gupta 14132
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14133
      } catch (org.apache.thrift.TException te) {
14134
        throw new java.io.IOException(te);
14135
      }
14136
    }
14137
 
14138
  }
14139
 
14140
  public static class createCoupon_result implements org.apache.thrift.TBase<createCoupon_result, createCoupon_result._Fields>, java.io.Serializable, Cloneable   {
14141
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_result");
14142
 
14143
    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);
14144
    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);
14145
 
14146
    private String success; // required
14147
    private PromotionException pex; // required
14148
 
14149
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14150
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
14151
      SUCCESS((short)0, "success"),
14152
      PEX((short)1, "pex");
14153
 
14154
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14155
 
14156
      static {
14157
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14158
          byName.put(field.getFieldName(), field);
14159
        }
14160
      }
14161
 
14162
      /**
14163
       * Find the _Fields constant that matches fieldId, or null if its not found.
14164
       */
14165
      public static _Fields findByThriftId(int fieldId) {
14166
        switch(fieldId) {
14167
          case 0: // SUCCESS
14168
            return SUCCESS;
14169
          case 1: // PEX
14170
            return PEX;
14171
          default:
14172
            return null;
14173
        }
14174
      }
14175
 
14176
      /**
14177
       * Find the _Fields constant that matches fieldId, throwing an exception
14178
       * if it is not found.
14179
       */
14180
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14181
        _Fields fields = findByThriftId(fieldId);
14182
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14183
        return fields;
14184
      }
14185
 
14186
      /**
14187
       * Find the _Fields constant that matches name, or null if its not found.
14188
       */
14189
      public static _Fields findByName(String name) {
14190
        return byName.get(name);
14191
      }
14192
 
14193
      private final short _thriftId;
14194
      private final String _fieldName;
14195
 
14196
      _Fields(short thriftId, String fieldName) {
14197
        _thriftId = thriftId;
14198
        _fieldName = fieldName;
14199
      }
14200
 
14201
      public short getThriftFieldId() {
14202
        return _thriftId;
14203
      }
14204
 
14205
      public String getFieldName() {
14206
        return _fieldName;
14207
      }
14208
    }
14209
 
14210
    // isset id assignments
14211
 
14212
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
14213
    static {
14214
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
14215
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14216
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
14217
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14218
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
14219
      metaDataMap = Collections.unmodifiableMap(tmpMap);
14220
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_result.class, metaDataMap);
14221
    }
14222
 
14223
    public createCoupon_result() {
14224
    }
14225
 
14226
    public createCoupon_result(
14227
      String success,
14228
      PromotionException pex)
14229
    {
14230
      this();
14231
      this.success = success;
14232
      this.pex = pex;
14233
    }
14234
 
14235
    /**
14236
     * Performs a deep copy on <i>other</i>.
14237
     */
14238
    public createCoupon_result(createCoupon_result other) {
14239
      if (other.isSetSuccess()) {
14240
        this.success = other.success;
14241
      }
14242
      if (other.isSetPex()) {
14243
        this.pex = new PromotionException(other.pex);
14244
      }
14245
    }
14246
 
14247
    public createCoupon_result deepCopy() {
14248
      return new createCoupon_result(this);
14249
    }
14250
 
14251
    @Override
14252
    public void clear() {
14253
      this.success = null;
14254
      this.pex = null;
14255
    }
14256
 
14257
    public String getSuccess() {
14258
      return this.success;
14259
    }
14260
 
14261
    public void setSuccess(String success) {
14262
      this.success = success;
14263
    }
14264
 
14265
    public void unsetSuccess() {
14266
      this.success = null;
14267
    }
14268
 
14269
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
14270
    public boolean isSetSuccess() {
14271
      return this.success != null;
14272
    }
14273
 
14274
    public void setSuccessIsSet(boolean value) {
14275
      if (!value) {
14276
        this.success = null;
14277
      }
14278
    }
14279
 
14280
    public PromotionException getPex() {
14281
      return this.pex;
14282
    }
14283
 
14284
    public void setPex(PromotionException pex) {
14285
      this.pex = pex;
14286
    }
14287
 
14288
    public void unsetPex() {
14289
      this.pex = null;
14290
    }
14291
 
14292
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
14293
    public boolean isSetPex() {
14294
      return this.pex != null;
14295
    }
14296
 
14297
    public void setPexIsSet(boolean value) {
14298
      if (!value) {
14299
        this.pex = null;
14300
      }
14301
    }
14302
 
14303
    public void setFieldValue(_Fields field, Object value) {
14304
      switch (field) {
14305
      case SUCCESS:
14306
        if (value == null) {
14307
          unsetSuccess();
14308
        } else {
14309
          setSuccess((String)value);
14310
        }
14311
        break;
14312
 
14313
      case PEX:
14314
        if (value == null) {
14315
          unsetPex();
14316
        } else {
14317
          setPex((PromotionException)value);
14318
        }
14319
        break;
14320
 
14321
      }
14322
    }
14323
 
14324
    public Object getFieldValue(_Fields field) {
14325
      switch (field) {
14326
      case SUCCESS:
14327
        return getSuccess();
14328
 
14329
      case PEX:
14330
        return getPex();
14331
 
14332
      }
14333
      throw new IllegalStateException();
14334
    }
14335
 
14336
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14337
    public boolean isSet(_Fields field) {
14338
      if (field == null) {
14339
        throw new IllegalArgumentException();
14340
      }
14341
 
14342
      switch (field) {
14343
      case SUCCESS:
14344
        return isSetSuccess();
14345
      case PEX:
14346
        return isSetPex();
14347
      }
14348
      throw new IllegalStateException();
14349
    }
14350
 
14351
    @Override
14352
    public boolean equals(Object that) {
14353
      if (that == null)
14354
        return false;
14355
      if (that instanceof createCoupon_result)
14356
        return this.equals((createCoupon_result)that);
14357
      return false;
14358
    }
14359
 
14360
    public boolean equals(createCoupon_result that) {
14361
      if (that == null)
14362
        return false;
14363
 
14364
      boolean this_present_success = true && this.isSetSuccess();
14365
      boolean that_present_success = true && that.isSetSuccess();
14366
      if (this_present_success || that_present_success) {
14367
        if (!(this_present_success && that_present_success))
14368
          return false;
14369
        if (!this.success.equals(that.success))
14370
          return false;
14371
      }
14372
 
14373
      boolean this_present_pex = true && this.isSetPex();
14374
      boolean that_present_pex = true && that.isSetPex();
14375
      if (this_present_pex || that_present_pex) {
14376
        if (!(this_present_pex && that_present_pex))
14377
          return false;
14378
        if (!this.pex.equals(that.pex))
14379
          return false;
14380
      }
14381
 
14382
      return true;
14383
    }
14384
 
14385
    @Override
14386
    public int hashCode() {
14387
      return 0;
14388
    }
14389
 
14390
    public int compareTo(createCoupon_result other) {
14391
      if (!getClass().equals(other.getClass())) {
14392
        return getClass().getName().compareTo(other.getClass().getName());
14393
      }
14394
 
14395
      int lastComparison = 0;
14396
      createCoupon_result typedOther = (createCoupon_result)other;
14397
 
14398
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
14399
      if (lastComparison != 0) {
14400
        return lastComparison;
14401
      }
14402
      if (isSetSuccess()) {
14403
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
14404
        if (lastComparison != 0) {
14405
          return lastComparison;
14406
        }
14407
      }
14408
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
14409
      if (lastComparison != 0) {
14410
        return lastComparison;
14411
      }
14412
      if (isSetPex()) {
14413
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
14414
        if (lastComparison != 0) {
14415
          return lastComparison;
14416
        }
14417
      }
14418
      return 0;
14419
    }
14420
 
14421
    public _Fields fieldForId(int fieldId) {
14422
      return _Fields.findByThriftId(fieldId);
14423
    }
14424
 
14425
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14426
      org.apache.thrift.protocol.TField field;
14427
      iprot.readStructBegin();
14428
      while (true)
14429
      {
14430
        field = iprot.readFieldBegin();
14431
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
14432
          break;
14433
        }
14434
        switch (field.id) {
14435
          case 0: // SUCCESS
14436
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
14437
              this.success = iprot.readString();
14438
            } else { 
14439
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14440
            }
14441
            break;
14442
          case 1: // PEX
14443
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
14444
              this.pex = new PromotionException();
14445
              this.pex.read(iprot);
14446
            } else { 
14447
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14448
            }
14449
            break;
14450
          default:
14451
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14452
        }
14453
        iprot.readFieldEnd();
14454
      }
14455
      iprot.readStructEnd();
14456
      validate();
14457
    }
14458
 
14459
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
14460
      oprot.writeStructBegin(STRUCT_DESC);
14461
 
14462
      if (this.isSetSuccess()) {
14463
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
14464
        oprot.writeString(this.success);
14465
        oprot.writeFieldEnd();
14466
      } else if (this.isSetPex()) {
14467
        oprot.writeFieldBegin(PEX_FIELD_DESC);
14468
        this.pex.write(oprot);
14469
        oprot.writeFieldEnd();
14470
      }
14471
      oprot.writeFieldStop();
14472
      oprot.writeStructEnd();
14473
    }
14474
 
14475
    @Override
14476
    public String toString() {
14477
      StringBuilder sb = new StringBuilder("createCoupon_result(");
14478
      boolean first = true;
14479
 
14480
      sb.append("success:");
14481
      if (this.success == null) {
14482
        sb.append("null");
14483
      } else {
14484
        sb.append(this.success);
14485
      }
14486
      first = false;
14487
      if (!first) sb.append(", ");
14488
      sb.append("pex:");
14489
      if (this.pex == null) {
14490
        sb.append("null");
14491
      } else {
14492
        sb.append(this.pex);
14493
      }
14494
      first = false;
14495
      sb.append(")");
14496
      return sb.toString();
14497
    }
14498
 
14499
    public void validate() throws org.apache.thrift.TException {
14500
      // check for required fields
14501
    }
14502
 
14503
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14504
      try {
14505
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14506
      } catch (org.apache.thrift.TException te) {
14507
        throw new java.io.IOException(te);
14508
      }
14509
    }
14510
 
14511
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14512
      try {
14513
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14514
      } catch (org.apache.thrift.TException te) {
14515
        throw new java.io.IOException(te);
14516
      }
14517
    }
14518
 
14519
  }
14520
 
3430 rajveer 14521
  public static class getSuccessfulPaymentCountForCoupon_args implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_args, getSuccessfulPaymentCountForCoupon_args._Fields>, java.io.Serializable, Cloneable   {
14522
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_args");
3385 varun.gupt 14523
 
3430 rajveer 14524
    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 14525
 
3430 rajveer 14526
    private String couponCode; // required
3385 varun.gupt 14527
 
14528
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 14529
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 14530
      COUPON_CODE((short)1, "couponCode");
14531
 
14532
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14533
 
14534
      static {
14535
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14536
          byName.put(field.getFieldName(), field);
14537
        }
14538
      }
14539
 
14540
      /**
14541
       * Find the _Fields constant that matches fieldId, or null if its not found.
14542
       */
14543
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 14544
        switch(fieldId) {
14545
          case 1: // COUPON_CODE
14546
            return COUPON_CODE;
14547
          default:
14548
            return null;
14549
        }
3385 varun.gupt 14550
      }
14551
 
14552
      /**
14553
       * Find the _Fields constant that matches fieldId, throwing an exception
14554
       * if it is not found.
14555
       */
14556
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14557
        _Fields fields = findByThriftId(fieldId);
14558
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14559
        return fields;
14560
      }
14561
 
14562
      /**
14563
       * Find the _Fields constant that matches name, or null if its not found.
14564
       */
14565
      public static _Fields findByName(String name) {
14566
        return byName.get(name);
14567
      }
14568
 
14569
      private final short _thriftId;
14570
      private final String _fieldName;
14571
 
14572
      _Fields(short thriftId, String fieldName) {
14573
        _thriftId = thriftId;
14574
        _fieldName = fieldName;
14575
      }
14576
 
14577
      public short getThriftFieldId() {
14578
        return _thriftId;
14579
      }
14580
 
14581
      public String getFieldName() {
14582
        return _fieldName;
14583
      }
14584
    }
14585
 
14586
    // isset id assignments
14587
 
3430 rajveer 14588
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 14589
    static {
3430 rajveer 14590
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
14591
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14592
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
14593
      metaDataMap = Collections.unmodifiableMap(tmpMap);
14594
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_args.class, metaDataMap);
3385 varun.gupt 14595
    }
14596
 
14597
    public getSuccessfulPaymentCountForCoupon_args() {
14598
    }
14599
 
14600
    public getSuccessfulPaymentCountForCoupon_args(
14601
      String couponCode)
14602
    {
14603
      this();
14604
      this.couponCode = couponCode;
14605
    }
14606
 
14607
    /**
14608
     * Performs a deep copy on <i>other</i>.
14609
     */
14610
    public getSuccessfulPaymentCountForCoupon_args(getSuccessfulPaymentCountForCoupon_args other) {
14611
      if (other.isSetCouponCode()) {
14612
        this.couponCode = other.couponCode;
14613
      }
14614
    }
14615
 
14616
    public getSuccessfulPaymentCountForCoupon_args deepCopy() {
14617
      return new getSuccessfulPaymentCountForCoupon_args(this);
14618
    }
14619
 
3430 rajveer 14620
    @Override
14621
    public void clear() {
14622
      this.couponCode = null;
3385 varun.gupt 14623
    }
14624
 
14625
    public String getCouponCode() {
14626
      return this.couponCode;
14627
    }
14628
 
3430 rajveer 14629
    public void setCouponCode(String couponCode) {
3385 varun.gupt 14630
      this.couponCode = couponCode;
14631
    }
14632
 
14633
    public void unsetCouponCode() {
14634
      this.couponCode = null;
14635
    }
14636
 
3430 rajveer 14637
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3385 varun.gupt 14638
    public boolean isSetCouponCode() {
14639
      return this.couponCode != null;
14640
    }
14641
 
14642
    public void setCouponCodeIsSet(boolean value) {
14643
      if (!value) {
14644
        this.couponCode = null;
14645
      }
14646
    }
14647
 
14648
    public void setFieldValue(_Fields field, Object value) {
14649
      switch (field) {
14650
      case COUPON_CODE:
14651
        if (value == null) {
14652
          unsetCouponCode();
14653
        } else {
14654
          setCouponCode((String)value);
14655
        }
14656
        break;
14657
 
14658
      }
14659
    }
14660
 
14661
    public Object getFieldValue(_Fields field) {
14662
      switch (field) {
14663
      case COUPON_CODE:
14664
        return getCouponCode();
14665
 
14666
      }
14667
      throw new IllegalStateException();
14668
    }
14669
 
3430 rajveer 14670
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14671
    public boolean isSet(_Fields field) {
14672
      if (field == null) {
14673
        throw new IllegalArgumentException();
14674
      }
3385 varun.gupt 14675
 
14676
      switch (field) {
14677
      case COUPON_CODE:
14678
        return isSetCouponCode();
14679
      }
14680
      throw new IllegalStateException();
14681
    }
14682
 
14683
    @Override
14684
    public boolean equals(Object that) {
14685
      if (that == null)
14686
        return false;
14687
      if (that instanceof getSuccessfulPaymentCountForCoupon_args)
14688
        return this.equals((getSuccessfulPaymentCountForCoupon_args)that);
14689
      return false;
14690
    }
14691
 
14692
    public boolean equals(getSuccessfulPaymentCountForCoupon_args that) {
14693
      if (that == null)
14694
        return false;
14695
 
14696
      boolean this_present_couponCode = true && this.isSetCouponCode();
14697
      boolean that_present_couponCode = true && that.isSetCouponCode();
14698
      if (this_present_couponCode || that_present_couponCode) {
14699
        if (!(this_present_couponCode && that_present_couponCode))
14700
          return false;
14701
        if (!this.couponCode.equals(that.couponCode))
14702
          return false;
14703
      }
14704
 
14705
      return true;
14706
    }
14707
 
14708
    @Override
14709
    public int hashCode() {
14710
      return 0;
14711
    }
14712
 
14713
    public int compareTo(getSuccessfulPaymentCountForCoupon_args other) {
14714
      if (!getClass().equals(other.getClass())) {
14715
        return getClass().getName().compareTo(other.getClass().getName());
14716
      }
14717
 
14718
      int lastComparison = 0;
14719
      getSuccessfulPaymentCountForCoupon_args typedOther = (getSuccessfulPaymentCountForCoupon_args)other;
14720
 
3430 rajveer 14721
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3385 varun.gupt 14722
      if (lastComparison != 0) {
14723
        return lastComparison;
14724
      }
3430 rajveer 14725
      if (isSetCouponCode()) {
14726
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
14727
        if (lastComparison != 0) {
14728
          return lastComparison;
14729
        }
3385 varun.gupt 14730
      }
14731
      return 0;
14732
    }
14733
 
3430 rajveer 14734
    public _Fields fieldForId(int fieldId) {
14735
      return _Fields.findByThriftId(fieldId);
14736
    }
14737
 
14738
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14739
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 14740
      iprot.readStructBegin();
14741
      while (true)
14742
      {
14743
        field = iprot.readFieldBegin();
3430 rajveer 14744
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 14745
          break;
14746
        }
3430 rajveer 14747
        switch (field.id) {
14748
          case 1: // COUPON_CODE
14749
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
14750
              this.couponCode = iprot.readString();
14751
            } else { 
14752
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14753
            }
14754
            break;
14755
          default:
14756
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 14757
        }
3430 rajveer 14758
        iprot.readFieldEnd();
3385 varun.gupt 14759
      }
14760
      iprot.readStructEnd();
14761
      validate();
14762
    }
14763
 
3430 rajveer 14764
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 14765
      validate();
14766
 
14767
      oprot.writeStructBegin(STRUCT_DESC);
14768
      if (this.couponCode != null) {
14769
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
14770
        oprot.writeString(this.couponCode);
14771
        oprot.writeFieldEnd();
14772
      }
14773
      oprot.writeFieldStop();
14774
      oprot.writeStructEnd();
14775
    }
14776
 
14777
    @Override
14778
    public String toString() {
14779
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_args(");
14780
      boolean first = true;
14781
 
14782
      sb.append("couponCode:");
14783
      if (this.couponCode == null) {
14784
        sb.append("null");
14785
      } else {
14786
        sb.append(this.couponCode);
14787
      }
14788
      first = false;
14789
      sb.append(")");
14790
      return sb.toString();
14791
    }
14792
 
3430 rajveer 14793
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 14794
      // check for required fields
14795
    }
14796
 
3430 rajveer 14797
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14798
      try {
14799
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14800
      } catch (org.apache.thrift.TException te) {
14801
        throw new java.io.IOException(te);
14802
      }
14803
    }
14804
 
14805
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14806
      try {
14807
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14808
      } catch (org.apache.thrift.TException te) {
14809
        throw new java.io.IOException(te);
14810
      }
14811
    }
14812
 
3385 varun.gupt 14813
  }
14814
 
3430 rajveer 14815
  public static class getSuccessfulPaymentCountForCoupon_result implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_result, getSuccessfulPaymentCountForCoupon_result._Fields>, java.io.Serializable, Cloneable   {
14816
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_result");
3385 varun.gupt 14817
 
3430 rajveer 14818
    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);
14819
    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 14820
 
3430 rajveer 14821
    private long success; // required
14822
    private PromotionException pex; // required
3385 varun.gupt 14823
 
14824
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 14825
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 14826
      SUCCESS((short)0, "success"),
14827
      PEX((short)1, "pex");
14828
 
14829
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14830
 
14831
      static {
14832
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14833
          byName.put(field.getFieldName(), field);
14834
        }
14835
      }
14836
 
14837
      /**
14838
       * Find the _Fields constant that matches fieldId, or null if its not found.
14839
       */
14840
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 14841
        switch(fieldId) {
14842
          case 0: // SUCCESS
14843
            return SUCCESS;
14844
          case 1: // PEX
14845
            return PEX;
14846
          default:
14847
            return null;
14848
        }
3385 varun.gupt 14849
      }
14850
 
14851
      /**
14852
       * Find the _Fields constant that matches fieldId, throwing an exception
14853
       * if it is not found.
14854
       */
14855
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14856
        _Fields fields = findByThriftId(fieldId);
14857
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14858
        return fields;
14859
      }
14860
 
14861
      /**
14862
       * Find the _Fields constant that matches name, or null if its not found.
14863
       */
14864
      public static _Fields findByName(String name) {
14865
        return byName.get(name);
14866
      }
14867
 
14868
      private final short _thriftId;
14869
      private final String _fieldName;
14870
 
14871
      _Fields(short thriftId, String fieldName) {
14872
        _thriftId = thriftId;
14873
        _fieldName = fieldName;
14874
      }
14875
 
14876
      public short getThriftFieldId() {
14877
        return _thriftId;
14878
      }
14879
 
14880
      public String getFieldName() {
14881
        return _fieldName;
14882
      }
14883
    }
14884
 
14885
    // isset id assignments
14886
    private static final int __SUCCESS_ISSET_ID = 0;
14887
    private BitSet __isset_bit_vector = new BitSet(1);
14888
 
3430 rajveer 14889
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 14890
    static {
3430 rajveer 14891
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
14892
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14893
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
14894
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14895
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
14896
      metaDataMap = Collections.unmodifiableMap(tmpMap);
14897
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_result.class, metaDataMap);
3385 varun.gupt 14898
    }
14899
 
14900
    public getSuccessfulPaymentCountForCoupon_result() {
14901
    }
14902
 
14903
    public getSuccessfulPaymentCountForCoupon_result(
14904
      long success,
14905
      PromotionException pex)
14906
    {
14907
      this();
14908
      this.success = success;
14909
      setSuccessIsSet(true);
14910
      this.pex = pex;
14911
    }
14912
 
14913
    /**
14914
     * Performs a deep copy on <i>other</i>.
14915
     */
14916
    public getSuccessfulPaymentCountForCoupon_result(getSuccessfulPaymentCountForCoupon_result other) {
14917
      __isset_bit_vector.clear();
14918
      __isset_bit_vector.or(other.__isset_bit_vector);
14919
      this.success = other.success;
14920
      if (other.isSetPex()) {
14921
        this.pex = new PromotionException(other.pex);
14922
      }
14923
    }
14924
 
14925
    public getSuccessfulPaymentCountForCoupon_result deepCopy() {
14926
      return new getSuccessfulPaymentCountForCoupon_result(this);
14927
    }
14928
 
3430 rajveer 14929
    @Override
14930
    public void clear() {
14931
      setSuccessIsSet(false);
14932
      this.success = 0;
14933
      this.pex = null;
3385 varun.gupt 14934
    }
14935
 
14936
    public long getSuccess() {
14937
      return this.success;
14938
    }
14939
 
3430 rajveer 14940
    public void setSuccess(long success) {
3385 varun.gupt 14941
      this.success = success;
14942
      setSuccessIsSet(true);
14943
    }
14944
 
14945
    public void unsetSuccess() {
14946
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
14947
    }
14948
 
3430 rajveer 14949
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 14950
    public boolean isSetSuccess() {
14951
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
14952
    }
14953
 
14954
    public void setSuccessIsSet(boolean value) {
14955
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
14956
    }
14957
 
14958
    public PromotionException getPex() {
14959
      return this.pex;
14960
    }
14961
 
3430 rajveer 14962
    public void setPex(PromotionException pex) {
3385 varun.gupt 14963
      this.pex = pex;
14964
    }
14965
 
14966
    public void unsetPex() {
14967
      this.pex = null;
14968
    }
14969
 
3430 rajveer 14970
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 14971
    public boolean isSetPex() {
14972
      return this.pex != null;
14973
    }
14974
 
14975
    public void setPexIsSet(boolean value) {
14976
      if (!value) {
14977
        this.pex = null;
14978
      }
14979
    }
14980
 
14981
    public void setFieldValue(_Fields field, Object value) {
14982
      switch (field) {
14983
      case SUCCESS:
14984
        if (value == null) {
14985
          unsetSuccess();
14986
        } else {
14987
          setSuccess((Long)value);
14988
        }
14989
        break;
14990
 
14991
      case PEX:
14992
        if (value == null) {
14993
          unsetPex();
14994
        } else {
14995
          setPex((PromotionException)value);
14996
        }
14997
        break;
14998
 
14999
      }
15000
    }
15001
 
15002
    public Object getFieldValue(_Fields field) {
15003
      switch (field) {
15004
      case SUCCESS:
3430 rajveer 15005
        return Long.valueOf(getSuccess());
3385 varun.gupt 15006
 
15007
      case PEX:
15008
        return getPex();
15009
 
15010
      }
15011
      throw new IllegalStateException();
15012
    }
15013
 
3430 rajveer 15014
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15015
    public boolean isSet(_Fields field) {
15016
      if (field == null) {
15017
        throw new IllegalArgumentException();
15018
      }
3385 varun.gupt 15019
 
15020
      switch (field) {
15021
      case SUCCESS:
15022
        return isSetSuccess();
15023
      case PEX:
15024
        return isSetPex();
15025
      }
15026
      throw new IllegalStateException();
15027
    }
15028
 
15029
    @Override
15030
    public boolean equals(Object that) {
15031
      if (that == null)
15032
        return false;
15033
      if (that instanceof getSuccessfulPaymentCountForCoupon_result)
15034
        return this.equals((getSuccessfulPaymentCountForCoupon_result)that);
15035
      return false;
15036
    }
15037
 
15038
    public boolean equals(getSuccessfulPaymentCountForCoupon_result that) {
15039
      if (that == null)
15040
        return false;
15041
 
15042
      boolean this_present_success = true;
15043
      boolean that_present_success = true;
15044
      if (this_present_success || that_present_success) {
15045
        if (!(this_present_success && that_present_success))
15046
          return false;
15047
        if (this.success != that.success)
15048
          return false;
15049
      }
15050
 
15051
      boolean this_present_pex = true && this.isSetPex();
15052
      boolean that_present_pex = true && that.isSetPex();
15053
      if (this_present_pex || that_present_pex) {
15054
        if (!(this_present_pex && that_present_pex))
15055
          return false;
15056
        if (!this.pex.equals(that.pex))
15057
          return false;
15058
      }
15059
 
15060
      return true;
15061
    }
15062
 
15063
    @Override
15064
    public int hashCode() {
15065
      return 0;
15066
    }
15067
 
15068
    public int compareTo(getSuccessfulPaymentCountForCoupon_result other) {
15069
      if (!getClass().equals(other.getClass())) {
15070
        return getClass().getName().compareTo(other.getClass().getName());
15071
      }
15072
 
15073
      int lastComparison = 0;
15074
      getSuccessfulPaymentCountForCoupon_result typedOther = (getSuccessfulPaymentCountForCoupon_result)other;
15075
 
3430 rajveer 15076
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 15077
      if (lastComparison != 0) {
15078
        return lastComparison;
15079
      }
3430 rajveer 15080
      if (isSetSuccess()) {
15081
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
15082
        if (lastComparison != 0) {
15083
          return lastComparison;
15084
        }
3385 varun.gupt 15085
      }
3430 rajveer 15086
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 15087
      if (lastComparison != 0) {
15088
        return lastComparison;
15089
      }
3430 rajveer 15090
      if (isSetPex()) {
15091
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
15092
        if (lastComparison != 0) {
15093
          return lastComparison;
15094
        }
3385 varun.gupt 15095
      }
15096
      return 0;
15097
    }
15098
 
3430 rajveer 15099
    public _Fields fieldForId(int fieldId) {
15100
      return _Fields.findByThriftId(fieldId);
15101
    }
15102
 
15103
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15104
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 15105
      iprot.readStructBegin();
15106
      while (true)
15107
      {
15108
        field = iprot.readFieldBegin();
3430 rajveer 15109
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 15110
          break;
15111
        }
3430 rajveer 15112
        switch (field.id) {
15113
          case 0: // SUCCESS
15114
            if (field.type == org.apache.thrift.protocol.TType.I64) {
15115
              this.success = iprot.readI64();
15116
              setSuccessIsSet(true);
15117
            } else { 
15118
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15119
            }
15120
            break;
15121
          case 1: // PEX
15122
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
15123
              this.pex = new PromotionException();
15124
              this.pex.read(iprot);
15125
            } else { 
15126
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15127
            }
15128
            break;
15129
          default:
15130
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 15131
        }
3430 rajveer 15132
        iprot.readFieldEnd();
3385 varun.gupt 15133
      }
15134
      iprot.readStructEnd();
15135
      validate();
15136
    }
15137
 
3430 rajveer 15138
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 15139
      oprot.writeStructBegin(STRUCT_DESC);
15140
 
15141
      if (this.isSetSuccess()) {
15142
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
15143
        oprot.writeI64(this.success);
15144
        oprot.writeFieldEnd();
15145
      } else if (this.isSetPex()) {
15146
        oprot.writeFieldBegin(PEX_FIELD_DESC);
15147
        this.pex.write(oprot);
15148
        oprot.writeFieldEnd();
15149
      }
15150
      oprot.writeFieldStop();
15151
      oprot.writeStructEnd();
15152
    }
15153
 
15154
    @Override
15155
    public String toString() {
15156
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_result(");
15157
      boolean first = true;
15158
 
15159
      sb.append("success:");
15160
      sb.append(this.success);
15161
      first = false;
15162
      if (!first) sb.append(", ");
15163
      sb.append("pex:");
15164
      if (this.pex == null) {
15165
        sb.append("null");
15166
      } else {
15167
        sb.append(this.pex);
15168
      }
15169
      first = false;
15170
      sb.append(")");
15171
      return sb.toString();
15172
    }
15173
 
3430 rajveer 15174
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 15175
      // check for required fields
15176
    }
15177
 
3430 rajveer 15178
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15179
      try {
15180
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15181
      } catch (org.apache.thrift.TException te) {
15182
        throw new java.io.IOException(te);
15183
      }
15184
    }
15185
 
15186
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15187
      try {
15188
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15189
      } catch (org.apache.thrift.TException te) {
15190
        throw new java.io.IOException(te);
15191
      }
15192
    }
15193
 
3385 varun.gupt 15194
  }
15195
 
3430 rajveer 15196
  public static class getRuleDocString_args implements org.apache.thrift.TBase<getRuleDocString_args, getRuleDocString_args._Fields>, java.io.Serializable, Cloneable   {
15197
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_args");
3385 varun.gupt 15198
 
3430 rajveer 15199
    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 15200
 
3430 rajveer 15201
    private String ruleName; // required
3385 varun.gupt 15202
 
15203
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 15204
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 15205
      RULE_NAME((short)1, "ruleName");
15206
 
15207
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15208
 
15209
      static {
15210
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15211
          byName.put(field.getFieldName(), field);
15212
        }
15213
      }
15214
 
15215
      /**
15216
       * Find the _Fields constant that matches fieldId, or null if its not found.
15217
       */
15218
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 15219
        switch(fieldId) {
15220
          case 1: // RULE_NAME
15221
            return RULE_NAME;
15222
          default:
15223
            return null;
15224
        }
3385 varun.gupt 15225
      }
15226
 
15227
      /**
15228
       * Find the _Fields constant that matches fieldId, throwing an exception
15229
       * if it is not found.
15230
       */
15231
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15232
        _Fields fields = findByThriftId(fieldId);
15233
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15234
        return fields;
15235
      }
15236
 
15237
      /**
15238
       * Find the _Fields constant that matches name, or null if its not found.
15239
       */
15240
      public static _Fields findByName(String name) {
15241
        return byName.get(name);
15242
      }
15243
 
15244
      private final short _thriftId;
15245
      private final String _fieldName;
15246
 
15247
      _Fields(short thriftId, String fieldName) {
15248
        _thriftId = thriftId;
15249
        _fieldName = fieldName;
15250
      }
15251
 
15252
      public short getThriftFieldId() {
15253
        return _thriftId;
15254
      }
15255
 
15256
      public String getFieldName() {
15257
        return _fieldName;
15258
      }
15259
    }
15260
 
15261
    // isset id assignments
15262
 
3430 rajveer 15263
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 15264
    static {
3430 rajveer 15265
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15266
      tmpMap.put(_Fields.RULE_NAME, new org.apache.thrift.meta_data.FieldMetaData("ruleName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15267
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
15268
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15269
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_args.class, metaDataMap);
3385 varun.gupt 15270
    }
15271
 
15272
    public getRuleDocString_args() {
15273
    }
15274
 
15275
    public getRuleDocString_args(
15276
      String ruleName)
15277
    {
15278
      this();
15279
      this.ruleName = ruleName;
15280
    }
15281
 
15282
    /**
15283
     * Performs a deep copy on <i>other</i>.
15284
     */
15285
    public getRuleDocString_args(getRuleDocString_args other) {
15286
      if (other.isSetRuleName()) {
15287
        this.ruleName = other.ruleName;
15288
      }
15289
    }
15290
 
15291
    public getRuleDocString_args deepCopy() {
15292
      return new getRuleDocString_args(this);
15293
    }
15294
 
3430 rajveer 15295
    @Override
15296
    public void clear() {
15297
      this.ruleName = null;
3385 varun.gupt 15298
    }
15299
 
15300
    public String getRuleName() {
15301
      return this.ruleName;
15302
    }
15303
 
3430 rajveer 15304
    public void setRuleName(String ruleName) {
3385 varun.gupt 15305
      this.ruleName = ruleName;
15306
    }
15307
 
15308
    public void unsetRuleName() {
15309
      this.ruleName = null;
15310
    }
15311
 
3430 rajveer 15312
    /** Returns true if field ruleName is set (has been assigned a value) and false otherwise */
3385 varun.gupt 15313
    public boolean isSetRuleName() {
15314
      return this.ruleName != null;
15315
    }
15316
 
15317
    public void setRuleNameIsSet(boolean value) {
15318
      if (!value) {
15319
        this.ruleName = null;
15320
      }
15321
    }
15322
 
15323
    public void setFieldValue(_Fields field, Object value) {
15324
      switch (field) {
15325
      case RULE_NAME:
15326
        if (value == null) {
15327
          unsetRuleName();
15328
        } else {
15329
          setRuleName((String)value);
15330
        }
15331
        break;
15332
 
15333
      }
15334
    }
15335
 
15336
    public Object getFieldValue(_Fields field) {
15337
      switch (field) {
15338
      case RULE_NAME:
15339
        return getRuleName();
15340
 
15341
      }
15342
      throw new IllegalStateException();
15343
    }
15344
 
3430 rajveer 15345
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15346
    public boolean isSet(_Fields field) {
15347
      if (field == null) {
15348
        throw new IllegalArgumentException();
15349
      }
3385 varun.gupt 15350
 
15351
      switch (field) {
15352
      case RULE_NAME:
15353
        return isSetRuleName();
15354
      }
15355
      throw new IllegalStateException();
15356
    }
15357
 
15358
    @Override
15359
    public boolean equals(Object that) {
15360
      if (that == null)
15361
        return false;
15362
      if (that instanceof getRuleDocString_args)
15363
        return this.equals((getRuleDocString_args)that);
15364
      return false;
15365
    }
15366
 
15367
    public boolean equals(getRuleDocString_args that) {
15368
      if (that == null)
15369
        return false;
15370
 
15371
      boolean this_present_ruleName = true && this.isSetRuleName();
15372
      boolean that_present_ruleName = true && that.isSetRuleName();
15373
      if (this_present_ruleName || that_present_ruleName) {
15374
        if (!(this_present_ruleName && that_present_ruleName))
15375
          return false;
15376
        if (!this.ruleName.equals(that.ruleName))
15377
          return false;
15378
      }
15379
 
15380
      return true;
15381
    }
15382
 
15383
    @Override
15384
    public int hashCode() {
15385
      return 0;
15386
    }
15387
 
15388
    public int compareTo(getRuleDocString_args other) {
15389
      if (!getClass().equals(other.getClass())) {
15390
        return getClass().getName().compareTo(other.getClass().getName());
15391
      }
15392
 
15393
      int lastComparison = 0;
15394
      getRuleDocString_args typedOther = (getRuleDocString_args)other;
15395
 
3430 rajveer 15396
      lastComparison = Boolean.valueOf(isSetRuleName()).compareTo(typedOther.isSetRuleName());
3385 varun.gupt 15397
      if (lastComparison != 0) {
15398
        return lastComparison;
15399
      }
3430 rajveer 15400
      if (isSetRuleName()) {
15401
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleName, typedOther.ruleName);
15402
        if (lastComparison != 0) {
15403
          return lastComparison;
15404
        }
3385 varun.gupt 15405
      }
15406
      return 0;
15407
    }
15408
 
3430 rajveer 15409
    public _Fields fieldForId(int fieldId) {
15410
      return _Fields.findByThriftId(fieldId);
15411
    }
15412
 
15413
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15414
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 15415
      iprot.readStructBegin();
15416
      while (true)
15417
      {
15418
        field = iprot.readFieldBegin();
3430 rajveer 15419
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 15420
          break;
15421
        }
3430 rajveer 15422
        switch (field.id) {
15423
          case 1: // RULE_NAME
15424
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
15425
              this.ruleName = iprot.readString();
15426
            } else { 
15427
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15428
            }
15429
            break;
15430
          default:
15431
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 15432
        }
3430 rajveer 15433
        iprot.readFieldEnd();
3385 varun.gupt 15434
      }
15435
      iprot.readStructEnd();
15436
      validate();
15437
    }
15438
 
3430 rajveer 15439
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 15440
      validate();
15441
 
15442
      oprot.writeStructBegin(STRUCT_DESC);
15443
      if (this.ruleName != null) {
15444
        oprot.writeFieldBegin(RULE_NAME_FIELD_DESC);
15445
        oprot.writeString(this.ruleName);
15446
        oprot.writeFieldEnd();
15447
      }
15448
      oprot.writeFieldStop();
15449
      oprot.writeStructEnd();
15450
    }
15451
 
15452
    @Override
15453
    public String toString() {
15454
      StringBuilder sb = new StringBuilder("getRuleDocString_args(");
15455
      boolean first = true;
15456
 
15457
      sb.append("ruleName:");
15458
      if (this.ruleName == null) {
15459
        sb.append("null");
15460
      } else {
15461
        sb.append(this.ruleName);
15462
      }
15463
      first = false;
15464
      sb.append(")");
15465
      return sb.toString();
15466
    }
15467
 
3430 rajveer 15468
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 15469
      // check for required fields
15470
    }
15471
 
3430 rajveer 15472
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15473
      try {
15474
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15475
      } catch (org.apache.thrift.TException te) {
15476
        throw new java.io.IOException(te);
15477
      }
15478
    }
15479
 
15480
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15481
      try {
15482
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15483
      } catch (org.apache.thrift.TException te) {
15484
        throw new java.io.IOException(te);
15485
      }
15486
    }
15487
 
3385 varun.gupt 15488
  }
15489
 
3430 rajveer 15490
  public static class getRuleDocString_result implements org.apache.thrift.TBase<getRuleDocString_result, getRuleDocString_result._Fields>, java.io.Serializable, Cloneable   {
15491
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_result");
3385 varun.gupt 15492
 
3430 rajveer 15493
    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 15494
 
3430 rajveer 15495
    private String success; // required
3385 varun.gupt 15496
 
15497
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 15498
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 15499
      SUCCESS((short)0, "success");
15500
 
15501
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15502
 
15503
      static {
15504
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15505
          byName.put(field.getFieldName(), field);
15506
        }
15507
      }
15508
 
15509
      /**
15510
       * Find the _Fields constant that matches fieldId, or null if its not found.
15511
       */
15512
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 15513
        switch(fieldId) {
15514
          case 0: // SUCCESS
15515
            return SUCCESS;
15516
          default:
15517
            return null;
15518
        }
3385 varun.gupt 15519
      }
15520
 
15521
      /**
15522
       * Find the _Fields constant that matches fieldId, throwing an exception
15523
       * if it is not found.
15524
       */
15525
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15526
        _Fields fields = findByThriftId(fieldId);
15527
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15528
        return fields;
15529
      }
15530
 
15531
      /**
15532
       * Find the _Fields constant that matches name, or null if its not found.
15533
       */
15534
      public static _Fields findByName(String name) {
15535
        return byName.get(name);
15536
      }
15537
 
15538
      private final short _thriftId;
15539
      private final String _fieldName;
15540
 
15541
      _Fields(short thriftId, String fieldName) {
15542
        _thriftId = thriftId;
15543
        _fieldName = fieldName;
15544
      }
15545
 
15546
      public short getThriftFieldId() {
15547
        return _thriftId;
15548
      }
15549
 
15550
      public String getFieldName() {
15551
        return _fieldName;
15552
      }
15553
    }
15554
 
15555
    // isset id assignments
15556
 
3430 rajveer 15557
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 15558
    static {
3430 rajveer 15559
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15560
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15561
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
15562
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15563
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_result.class, metaDataMap);
3385 varun.gupt 15564
    }
15565
 
15566
    public getRuleDocString_result() {
15567
    }
15568
 
15569
    public getRuleDocString_result(
15570
      String success)
15571
    {
15572
      this();
15573
      this.success = success;
15574
    }
15575
 
15576
    /**
15577
     * Performs a deep copy on <i>other</i>.
15578
     */
15579
    public getRuleDocString_result(getRuleDocString_result other) {
15580
      if (other.isSetSuccess()) {
15581
        this.success = other.success;
15582
      }
15583
    }
15584
 
15585
    public getRuleDocString_result deepCopy() {
15586
      return new getRuleDocString_result(this);
15587
    }
15588
 
3430 rajveer 15589
    @Override
15590
    public void clear() {
15591
      this.success = null;
3385 varun.gupt 15592
    }
15593
 
15594
    public String getSuccess() {
15595
      return this.success;
15596
    }
15597
 
3430 rajveer 15598
    public void setSuccess(String success) {
3385 varun.gupt 15599
      this.success = success;
15600
    }
15601
 
15602
    public void unsetSuccess() {
15603
      this.success = null;
15604
    }
15605
 
3430 rajveer 15606
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 15607
    public boolean isSetSuccess() {
15608
      return this.success != null;
15609
    }
15610
 
15611
    public void setSuccessIsSet(boolean value) {
15612
      if (!value) {
15613
        this.success = null;
15614
      }
15615
    }
15616
 
15617
    public void setFieldValue(_Fields field, Object value) {
15618
      switch (field) {
15619
      case SUCCESS:
15620
        if (value == null) {
15621
          unsetSuccess();
15622
        } else {
15623
          setSuccess((String)value);
15624
        }
15625
        break;
15626
 
15627
      }
15628
    }
15629
 
15630
    public Object getFieldValue(_Fields field) {
15631
      switch (field) {
15632
      case SUCCESS:
15633
        return getSuccess();
15634
 
15635
      }
15636
      throw new IllegalStateException();
15637
    }
15638
 
3430 rajveer 15639
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15640
    public boolean isSet(_Fields field) {
15641
      if (field == null) {
15642
        throw new IllegalArgumentException();
15643
      }
3385 varun.gupt 15644
 
15645
      switch (field) {
15646
      case SUCCESS:
15647
        return isSetSuccess();
15648
      }
15649
      throw new IllegalStateException();
15650
    }
15651
 
15652
    @Override
15653
    public boolean equals(Object that) {
15654
      if (that == null)
15655
        return false;
15656
      if (that instanceof getRuleDocString_result)
15657
        return this.equals((getRuleDocString_result)that);
15658
      return false;
15659
    }
15660
 
15661
    public boolean equals(getRuleDocString_result that) {
15662
      if (that == null)
15663
        return false;
15664
 
15665
      boolean this_present_success = true && this.isSetSuccess();
15666
      boolean that_present_success = true && that.isSetSuccess();
15667
      if (this_present_success || that_present_success) {
15668
        if (!(this_present_success && that_present_success))
15669
          return false;
15670
        if (!this.success.equals(that.success))
15671
          return false;
15672
      }
15673
 
15674
      return true;
15675
    }
15676
 
15677
    @Override
15678
    public int hashCode() {
15679
      return 0;
15680
    }
15681
 
15682
    public int compareTo(getRuleDocString_result other) {
15683
      if (!getClass().equals(other.getClass())) {
15684
        return getClass().getName().compareTo(other.getClass().getName());
15685
      }
15686
 
15687
      int lastComparison = 0;
15688
      getRuleDocString_result typedOther = (getRuleDocString_result)other;
15689
 
3430 rajveer 15690
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 15691
      if (lastComparison != 0) {
15692
        return lastComparison;
15693
      }
3430 rajveer 15694
      if (isSetSuccess()) {
15695
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
15696
        if (lastComparison != 0) {
15697
          return lastComparison;
15698
        }
3385 varun.gupt 15699
      }
15700
      return 0;
15701
    }
15702
 
3430 rajveer 15703
    public _Fields fieldForId(int fieldId) {
15704
      return _Fields.findByThriftId(fieldId);
15705
    }
15706
 
15707
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15708
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 15709
      iprot.readStructBegin();
15710
      while (true)
15711
      {
15712
        field = iprot.readFieldBegin();
3430 rajveer 15713
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 15714
          break;
15715
        }
3430 rajveer 15716
        switch (field.id) {
15717
          case 0: // SUCCESS
15718
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
15719
              this.success = iprot.readString();
15720
            } else { 
15721
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15722
            }
15723
            break;
15724
          default:
15725
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 15726
        }
3430 rajveer 15727
        iprot.readFieldEnd();
3385 varun.gupt 15728
      }
15729
      iprot.readStructEnd();
15730
      validate();
15731
    }
15732
 
3430 rajveer 15733
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 15734
      oprot.writeStructBegin(STRUCT_DESC);
15735
 
15736
      if (this.isSetSuccess()) {
15737
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
15738
        oprot.writeString(this.success);
15739
        oprot.writeFieldEnd();
15740
      }
15741
      oprot.writeFieldStop();
15742
      oprot.writeStructEnd();
15743
    }
15744
 
15745
    @Override
15746
    public String toString() {
15747
      StringBuilder sb = new StringBuilder("getRuleDocString_result(");
15748
      boolean first = true;
15749
 
15750
      sb.append("success:");
15751
      if (this.success == null) {
15752
        sb.append("null");
15753
      } else {
15754
        sb.append(this.success);
15755
      }
15756
      first = false;
15757
      sb.append(")");
15758
      return sb.toString();
15759
    }
15760
 
3430 rajveer 15761
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 15762
      // check for required fields
15763
    }
15764
 
3430 rajveer 15765
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15766
      try {
15767
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15768
      } catch (org.apache.thrift.TException te) {
15769
        throw new java.io.IOException(te);
15770
      }
15771
    }
15772
 
15773
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15774
      try {
15775
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15776
      } catch (org.apache.thrift.TException te) {
15777
        throw new java.io.IOException(te);
15778
      }
15779
    }
15780
 
3385 varun.gupt 15781
  }
15782
 
4189 varun.gupt 15783
  public static class getItemDiscountMap_args implements org.apache.thrift.TBase<getItemDiscountMap_args, getItemDiscountMap_args._Fields>, java.io.Serializable, Cloneable   {
15784
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_args");
15785
 
15786
    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);
15787
 
15788
    private List<Long> itemIds; // required
15789
 
15790
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
15791
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
15792
      ITEM_IDS((short)1, "itemIds");
15793
 
15794
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15795
 
15796
      static {
15797
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15798
          byName.put(field.getFieldName(), field);
15799
        }
15800
      }
15801
 
15802
      /**
15803
       * Find the _Fields constant that matches fieldId, or null if its not found.
15804
       */
15805
      public static _Fields findByThriftId(int fieldId) {
15806
        switch(fieldId) {
15807
          case 1: // ITEM_IDS
15808
            return ITEM_IDS;
15809
          default:
15810
            return null;
15811
        }
15812
      }
15813
 
15814
      /**
15815
       * Find the _Fields constant that matches fieldId, throwing an exception
15816
       * if it is not found.
15817
       */
15818
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15819
        _Fields fields = findByThriftId(fieldId);
15820
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15821
        return fields;
15822
      }
15823
 
15824
      /**
15825
       * Find the _Fields constant that matches name, or null if its not found.
15826
       */
15827
      public static _Fields findByName(String name) {
15828
        return byName.get(name);
15829
      }
15830
 
15831
      private final short _thriftId;
15832
      private final String _fieldName;
15833
 
15834
      _Fields(short thriftId, String fieldName) {
15835
        _thriftId = thriftId;
15836
        _fieldName = fieldName;
15837
      }
15838
 
15839
      public short getThriftFieldId() {
15840
        return _thriftId;
15841
      }
15842
 
15843
      public String getFieldName() {
15844
        return _fieldName;
15845
      }
15846
    }
15847
 
15848
    // isset id assignments
15849
 
15850
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
15851
    static {
15852
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15853
      tmpMap.put(_Fields.ITEM_IDS, new org.apache.thrift.meta_data.FieldMetaData("itemIds", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15854
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
15855
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
15856
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15857
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_args.class, metaDataMap);
15858
    }
15859
 
15860
    public getItemDiscountMap_args() {
15861
    }
15862
 
15863
    public getItemDiscountMap_args(
15864
      List<Long> itemIds)
15865
    {
15866
      this();
15867
      this.itemIds = itemIds;
15868
    }
15869
 
15870
    /**
15871
     * Performs a deep copy on <i>other</i>.
15872
     */
15873
    public getItemDiscountMap_args(getItemDiscountMap_args other) {
15874
      if (other.isSetItemIds()) {
15875
        List<Long> __this__itemIds = new ArrayList<Long>();
15876
        for (Long other_element : other.itemIds) {
15877
          __this__itemIds.add(other_element);
15878
        }
15879
        this.itemIds = __this__itemIds;
15880
      }
15881
    }
15882
 
15883
    public getItemDiscountMap_args deepCopy() {
15884
      return new getItemDiscountMap_args(this);
15885
    }
15886
 
15887
    @Override
15888
    public void clear() {
15889
      this.itemIds = null;
15890
    }
15891
 
15892
    public int getItemIdsSize() {
15893
      return (this.itemIds == null) ? 0 : this.itemIds.size();
15894
    }
15895
 
15896
    public java.util.Iterator<Long> getItemIdsIterator() {
15897
      return (this.itemIds == null) ? null : this.itemIds.iterator();
15898
    }
15899
 
15900
    public void addToItemIds(long elem) {
15901
      if (this.itemIds == null) {
15902
        this.itemIds = new ArrayList<Long>();
15903
      }
15904
      this.itemIds.add(elem);
15905
    }
15906
 
15907
    public List<Long> getItemIds() {
15908
      return this.itemIds;
15909
    }
15910
 
15911
    public void setItemIds(List<Long> itemIds) {
15912
      this.itemIds = itemIds;
15913
    }
15914
 
15915
    public void unsetItemIds() {
15916
      this.itemIds = null;
15917
    }
15918
 
15919
    /** Returns true if field itemIds is set (has been assigned a value) and false otherwise */
15920
    public boolean isSetItemIds() {
15921
      return this.itemIds != null;
15922
    }
15923
 
15924
    public void setItemIdsIsSet(boolean value) {
15925
      if (!value) {
15926
        this.itemIds = null;
15927
      }
15928
    }
15929
 
15930
    public void setFieldValue(_Fields field, Object value) {
15931
      switch (field) {
15932
      case ITEM_IDS:
15933
        if (value == null) {
15934
          unsetItemIds();
15935
        } else {
15936
          setItemIds((List<Long>)value);
15937
        }
15938
        break;
15939
 
15940
      }
15941
    }
15942
 
15943
    public Object getFieldValue(_Fields field) {
15944
      switch (field) {
15945
      case ITEM_IDS:
15946
        return getItemIds();
15947
 
15948
      }
15949
      throw new IllegalStateException();
15950
    }
15951
 
15952
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15953
    public boolean isSet(_Fields field) {
15954
      if (field == null) {
15955
        throw new IllegalArgumentException();
15956
      }
15957
 
15958
      switch (field) {
15959
      case ITEM_IDS:
15960
        return isSetItemIds();
15961
      }
15962
      throw new IllegalStateException();
15963
    }
15964
 
15965
    @Override
15966
    public boolean equals(Object that) {
15967
      if (that == null)
15968
        return false;
15969
      if (that instanceof getItemDiscountMap_args)
15970
        return this.equals((getItemDiscountMap_args)that);
15971
      return false;
15972
    }
15973
 
15974
    public boolean equals(getItemDiscountMap_args that) {
15975
      if (that == null)
15976
        return false;
15977
 
15978
      boolean this_present_itemIds = true && this.isSetItemIds();
15979
      boolean that_present_itemIds = true && that.isSetItemIds();
15980
      if (this_present_itemIds || that_present_itemIds) {
15981
        if (!(this_present_itemIds && that_present_itemIds))
15982
          return false;
15983
        if (!this.itemIds.equals(that.itemIds))
15984
          return false;
15985
      }
15986
 
15987
      return true;
15988
    }
15989
 
15990
    @Override
15991
    public int hashCode() {
15992
      return 0;
15993
    }
15994
 
15995
    public int compareTo(getItemDiscountMap_args other) {
15996
      if (!getClass().equals(other.getClass())) {
15997
        return getClass().getName().compareTo(other.getClass().getName());
15998
      }
15999
 
16000
      int lastComparison = 0;
16001
      getItemDiscountMap_args typedOther = (getItemDiscountMap_args)other;
16002
 
16003
      lastComparison = Boolean.valueOf(isSetItemIds()).compareTo(typedOther.isSetItemIds());
16004
      if (lastComparison != 0) {
16005
        return lastComparison;
16006
      }
16007
      if (isSetItemIds()) {
16008
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemIds, typedOther.itemIds);
16009
        if (lastComparison != 0) {
16010
          return lastComparison;
16011
        }
16012
      }
16013
      return 0;
16014
    }
16015
 
16016
    public _Fields fieldForId(int fieldId) {
16017
      return _Fields.findByThriftId(fieldId);
16018
    }
16019
 
16020
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16021
      org.apache.thrift.protocol.TField field;
16022
      iprot.readStructBegin();
16023
      while (true)
16024
      {
16025
        field = iprot.readFieldBegin();
16026
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
16027
          break;
16028
        }
16029
        switch (field.id) {
16030
          case 1: // ITEM_IDS
16031
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
16032
              {
7092 amit.gupta 16033
                org.apache.thrift.protocol.TList _list38 = iprot.readListBegin();
16034
                this.itemIds = new ArrayList<Long>(_list38.size);
16035
                for (int _i39 = 0; _i39 < _list38.size; ++_i39)
4189 varun.gupt 16036
                {
7092 amit.gupta 16037
                  long _elem40; // required
16038
                  _elem40 = iprot.readI64();
16039
                  this.itemIds.add(_elem40);
4189 varun.gupt 16040
                }
16041
                iprot.readListEnd();
16042
              }
16043
            } else { 
16044
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16045
            }
16046
            break;
16047
          default:
16048
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16049
        }
16050
        iprot.readFieldEnd();
16051
      }
16052
      iprot.readStructEnd();
16053
      validate();
16054
    }
16055
 
16056
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
16057
      validate();
16058
 
16059
      oprot.writeStructBegin(STRUCT_DESC);
16060
      if (this.itemIds != null) {
16061
        oprot.writeFieldBegin(ITEM_IDS_FIELD_DESC);
16062
        {
16063
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.itemIds.size()));
7092 amit.gupta 16064
          for (long _iter41 : this.itemIds)
4189 varun.gupt 16065
          {
7092 amit.gupta 16066
            oprot.writeI64(_iter41);
4189 varun.gupt 16067
          }
16068
          oprot.writeListEnd();
16069
        }
16070
        oprot.writeFieldEnd();
16071
      }
16072
      oprot.writeFieldStop();
16073
      oprot.writeStructEnd();
16074
    }
16075
 
16076
    @Override
16077
    public String toString() {
16078
      StringBuilder sb = new StringBuilder("getItemDiscountMap_args(");
16079
      boolean first = true;
16080
 
16081
      sb.append("itemIds:");
16082
      if (this.itemIds == null) {
16083
        sb.append("null");
16084
      } else {
16085
        sb.append(this.itemIds);
16086
      }
16087
      first = false;
16088
      sb.append(")");
16089
      return sb.toString();
16090
    }
16091
 
16092
    public void validate() throws org.apache.thrift.TException {
16093
      // check for required fields
16094
    }
16095
 
16096
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16097
      try {
16098
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16099
      } catch (org.apache.thrift.TException te) {
16100
        throw new java.io.IOException(te);
16101
      }
16102
    }
16103
 
16104
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16105
      try {
16106
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16107
      } catch (org.apache.thrift.TException te) {
16108
        throw new java.io.IOException(te);
16109
      }
16110
    }
16111
 
16112
  }
16113
 
16114
  public static class getItemDiscountMap_result implements org.apache.thrift.TBase<getItemDiscountMap_result, getItemDiscountMap_result._Fields>, java.io.Serializable, Cloneable   {
16115
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_result");
16116
 
16117
    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);
16118
    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);
16119
 
16120
    private List<ItemCouponDiscount> success; // required
16121
    private PromotionException pex; // required
16122
 
16123
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
16124
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
16125
      SUCCESS((short)0, "success"),
16126
      PEX((short)1, "pex");
16127
 
16128
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16129
 
16130
      static {
16131
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16132
          byName.put(field.getFieldName(), field);
16133
        }
16134
      }
16135
 
16136
      /**
16137
       * Find the _Fields constant that matches fieldId, or null if its not found.
16138
       */
16139
      public static _Fields findByThriftId(int fieldId) {
16140
        switch(fieldId) {
16141
          case 0: // SUCCESS
16142
            return SUCCESS;
16143
          case 1: // PEX
16144
            return PEX;
16145
          default:
16146
            return null;
16147
        }
16148
      }
16149
 
16150
      /**
16151
       * Find the _Fields constant that matches fieldId, throwing an exception
16152
       * if it is not found.
16153
       */
16154
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16155
        _Fields fields = findByThriftId(fieldId);
16156
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16157
        return fields;
16158
      }
16159
 
16160
      /**
16161
       * Find the _Fields constant that matches name, or null if its not found.
16162
       */
16163
      public static _Fields findByName(String name) {
16164
        return byName.get(name);
16165
      }
16166
 
16167
      private final short _thriftId;
16168
      private final String _fieldName;
16169
 
16170
      _Fields(short thriftId, String fieldName) {
16171
        _thriftId = thriftId;
16172
        _fieldName = fieldName;
16173
      }
16174
 
16175
      public short getThriftFieldId() {
16176
        return _thriftId;
16177
      }
16178
 
16179
      public String getFieldName() {
16180
        return _fieldName;
16181
      }
16182
    }
16183
 
16184
    // isset id assignments
16185
 
16186
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
16187
    static {
16188
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16189
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16190
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
16191
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ItemCouponDiscount.class))));
16192
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16193
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
16194
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16195
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_result.class, metaDataMap);
16196
    }
16197
 
16198
    public getItemDiscountMap_result() {
16199
    }
16200
 
16201
    public getItemDiscountMap_result(
16202
      List<ItemCouponDiscount> success,
16203
      PromotionException pex)
16204
    {
16205
      this();
16206
      this.success = success;
16207
      this.pex = pex;
16208
    }
16209
 
16210
    /**
16211
     * Performs a deep copy on <i>other</i>.
16212
     */
16213
    public getItemDiscountMap_result(getItemDiscountMap_result other) {
16214
      if (other.isSetSuccess()) {
16215
        List<ItemCouponDiscount> __this__success = new ArrayList<ItemCouponDiscount>();
16216
        for (ItemCouponDiscount other_element : other.success) {
16217
          __this__success.add(new ItemCouponDiscount(other_element));
16218
        }
16219
        this.success = __this__success;
16220
      }
16221
      if (other.isSetPex()) {
16222
        this.pex = new PromotionException(other.pex);
16223
      }
16224
    }
16225
 
16226
    public getItemDiscountMap_result deepCopy() {
16227
      return new getItemDiscountMap_result(this);
16228
    }
16229
 
16230
    @Override
16231
    public void clear() {
16232
      this.success = null;
16233
      this.pex = null;
16234
    }
16235
 
16236
    public int getSuccessSize() {
16237
      return (this.success == null) ? 0 : this.success.size();
16238
    }
16239
 
16240
    public java.util.Iterator<ItemCouponDiscount> getSuccessIterator() {
16241
      return (this.success == null) ? null : this.success.iterator();
16242
    }
16243
 
16244
    public void addToSuccess(ItemCouponDiscount elem) {
16245
      if (this.success == null) {
16246
        this.success = new ArrayList<ItemCouponDiscount>();
16247
      }
16248
      this.success.add(elem);
16249
    }
16250
 
16251
    public List<ItemCouponDiscount> getSuccess() {
16252
      return this.success;
16253
    }
16254
 
16255
    public void setSuccess(List<ItemCouponDiscount> success) {
16256
      this.success = success;
16257
    }
16258
 
16259
    public void unsetSuccess() {
16260
      this.success = null;
16261
    }
16262
 
16263
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
16264
    public boolean isSetSuccess() {
16265
      return this.success != null;
16266
    }
16267
 
16268
    public void setSuccessIsSet(boolean value) {
16269
      if (!value) {
16270
        this.success = null;
16271
      }
16272
    }
16273
 
16274
    public PromotionException getPex() {
16275
      return this.pex;
16276
    }
16277
 
16278
    public void setPex(PromotionException pex) {
16279
      this.pex = pex;
16280
    }
16281
 
16282
    public void unsetPex() {
16283
      this.pex = null;
16284
    }
16285
 
16286
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
16287
    public boolean isSetPex() {
16288
      return this.pex != null;
16289
    }
16290
 
16291
    public void setPexIsSet(boolean value) {
16292
      if (!value) {
16293
        this.pex = null;
16294
      }
16295
    }
16296
 
16297
    public void setFieldValue(_Fields field, Object value) {
16298
      switch (field) {
16299
      case SUCCESS:
16300
        if (value == null) {
16301
          unsetSuccess();
16302
        } else {
16303
          setSuccess((List<ItemCouponDiscount>)value);
16304
        }
16305
        break;
16306
 
16307
      case PEX:
16308
        if (value == null) {
16309
          unsetPex();
16310
        } else {
16311
          setPex((PromotionException)value);
16312
        }
16313
        break;
16314
 
16315
      }
16316
    }
16317
 
16318
    public Object getFieldValue(_Fields field) {
16319
      switch (field) {
16320
      case SUCCESS:
16321
        return getSuccess();
16322
 
16323
      case PEX:
16324
        return getPex();
16325
 
16326
      }
16327
      throw new IllegalStateException();
16328
    }
16329
 
16330
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16331
    public boolean isSet(_Fields field) {
16332
      if (field == null) {
16333
        throw new IllegalArgumentException();
16334
      }
16335
 
16336
      switch (field) {
16337
      case SUCCESS:
16338
        return isSetSuccess();
16339
      case PEX:
16340
        return isSetPex();
16341
      }
16342
      throw new IllegalStateException();
16343
    }
16344
 
16345
    @Override
16346
    public boolean equals(Object that) {
16347
      if (that == null)
16348
        return false;
16349
      if (that instanceof getItemDiscountMap_result)
16350
        return this.equals((getItemDiscountMap_result)that);
16351
      return false;
16352
    }
16353
 
16354
    public boolean equals(getItemDiscountMap_result that) {
16355
      if (that == null)
16356
        return false;
16357
 
16358
      boolean this_present_success = true && this.isSetSuccess();
16359
      boolean that_present_success = true && that.isSetSuccess();
16360
      if (this_present_success || that_present_success) {
16361
        if (!(this_present_success && that_present_success))
16362
          return false;
16363
        if (!this.success.equals(that.success))
16364
          return false;
16365
      }
16366
 
16367
      boolean this_present_pex = true && this.isSetPex();
16368
      boolean that_present_pex = true && that.isSetPex();
16369
      if (this_present_pex || that_present_pex) {
16370
        if (!(this_present_pex && that_present_pex))
16371
          return false;
16372
        if (!this.pex.equals(that.pex))
16373
          return false;
16374
      }
16375
 
16376
      return true;
16377
    }
16378
 
16379
    @Override
16380
    public int hashCode() {
16381
      return 0;
16382
    }
16383
 
16384
    public int compareTo(getItemDiscountMap_result other) {
16385
      if (!getClass().equals(other.getClass())) {
16386
        return getClass().getName().compareTo(other.getClass().getName());
16387
      }
16388
 
16389
      int lastComparison = 0;
16390
      getItemDiscountMap_result typedOther = (getItemDiscountMap_result)other;
16391
 
16392
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
16393
      if (lastComparison != 0) {
16394
        return lastComparison;
16395
      }
16396
      if (isSetSuccess()) {
16397
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
16398
        if (lastComparison != 0) {
16399
          return lastComparison;
16400
        }
16401
      }
16402
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
16403
      if (lastComparison != 0) {
16404
        return lastComparison;
16405
      }
16406
      if (isSetPex()) {
16407
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
16408
        if (lastComparison != 0) {
16409
          return lastComparison;
16410
        }
16411
      }
16412
      return 0;
16413
    }
16414
 
16415
    public _Fields fieldForId(int fieldId) {
16416
      return _Fields.findByThriftId(fieldId);
16417
    }
16418
 
16419
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16420
      org.apache.thrift.protocol.TField field;
16421
      iprot.readStructBegin();
16422
      while (true)
16423
      {
16424
        field = iprot.readFieldBegin();
16425
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
16426
          break;
16427
        }
16428
        switch (field.id) {
16429
          case 0: // SUCCESS
16430
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
16431
              {
7092 amit.gupta 16432
                org.apache.thrift.protocol.TList _list42 = iprot.readListBegin();
16433
                this.success = new ArrayList<ItemCouponDiscount>(_list42.size);
16434
                for (int _i43 = 0; _i43 < _list42.size; ++_i43)
4189 varun.gupt 16435
                {
7092 amit.gupta 16436
                  ItemCouponDiscount _elem44; // required
16437
                  _elem44 = new ItemCouponDiscount();
16438
                  _elem44.read(iprot);
16439
                  this.success.add(_elem44);
4189 varun.gupt 16440
                }
16441
                iprot.readListEnd();
16442
              }
16443
            } else { 
16444
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16445
            }
16446
            break;
16447
          case 1: // PEX
16448
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
16449
              this.pex = new PromotionException();
16450
              this.pex.read(iprot);
16451
            } else { 
16452
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16453
            }
16454
            break;
16455
          default:
16456
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16457
        }
16458
        iprot.readFieldEnd();
16459
      }
16460
      iprot.readStructEnd();
16461
      validate();
16462
    }
16463
 
16464
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
16465
      oprot.writeStructBegin(STRUCT_DESC);
16466
 
16467
      if (this.isSetSuccess()) {
16468
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
16469
        {
16470
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
7092 amit.gupta 16471
          for (ItemCouponDiscount _iter45 : this.success)
4189 varun.gupt 16472
          {
7092 amit.gupta 16473
            _iter45.write(oprot);
4189 varun.gupt 16474
          }
16475
          oprot.writeListEnd();
16476
        }
16477
        oprot.writeFieldEnd();
16478
      } else if (this.isSetPex()) {
16479
        oprot.writeFieldBegin(PEX_FIELD_DESC);
16480
        this.pex.write(oprot);
16481
        oprot.writeFieldEnd();
16482
      }
16483
      oprot.writeFieldStop();
16484
      oprot.writeStructEnd();
16485
    }
16486
 
16487
    @Override
16488
    public String toString() {
16489
      StringBuilder sb = new StringBuilder("getItemDiscountMap_result(");
16490
      boolean first = true;
16491
 
16492
      sb.append("success:");
16493
      if (this.success == null) {
16494
        sb.append("null");
16495
      } else {
16496
        sb.append(this.success);
16497
      }
16498
      first = false;
16499
      if (!first) sb.append(", ");
16500
      sb.append("pex:");
16501
      if (this.pex == null) {
16502
        sb.append("null");
16503
      } else {
16504
        sb.append(this.pex);
16505
      }
16506
      first = false;
16507
      sb.append(")");
16508
      return sb.toString();
16509
    }
16510
 
16511
    public void validate() throws org.apache.thrift.TException {
16512
      // check for required fields
16513
    }
16514
 
16515
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16516
      try {
16517
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16518
      } catch (org.apache.thrift.TException te) {
16519
        throw new java.io.IOException(te);
16520
      }
16521
    }
16522
 
16523
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16524
      try {
16525
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16526
      } catch (org.apache.thrift.TException te) {
16527
        throw new java.io.IOException(te);
16528
      }
16529
    }
16530
 
16531
  }
16532
 
4494 varun.gupt 16533
  public static class getDiscountsForEntity_args implements org.apache.thrift.TBase<getDiscountsForEntity_args, getDiscountsForEntity_args._Fields>, java.io.Serializable, Cloneable   {
16534
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_args");
16535
 
16536
    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);
16537
 
16538
    private long entityId; // required
16539
 
16540
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
16541
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
16542
      ENTITY_ID((short)1, "entityId");
16543
 
16544
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16545
 
16546
      static {
16547
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16548
          byName.put(field.getFieldName(), field);
16549
        }
16550
      }
16551
 
16552
      /**
16553
       * Find the _Fields constant that matches fieldId, or null if its not found.
16554
       */
16555
      public static _Fields findByThriftId(int fieldId) {
16556
        switch(fieldId) {
16557
          case 1: // ENTITY_ID
16558
            return ENTITY_ID;
16559
          default:
16560
            return null;
16561
        }
16562
      }
16563
 
16564
      /**
16565
       * Find the _Fields constant that matches fieldId, throwing an exception
16566
       * if it is not found.
16567
       */
16568
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16569
        _Fields fields = findByThriftId(fieldId);
16570
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16571
        return fields;
16572
      }
16573
 
16574
      /**
16575
       * Find the _Fields constant that matches name, or null if its not found.
16576
       */
16577
      public static _Fields findByName(String name) {
16578
        return byName.get(name);
16579
      }
16580
 
16581
      private final short _thriftId;
16582
      private final String _fieldName;
16583
 
16584
      _Fields(short thriftId, String fieldName) {
16585
        _thriftId = thriftId;
16586
        _fieldName = fieldName;
16587
      }
16588
 
16589
      public short getThriftFieldId() {
16590
        return _thriftId;
16591
      }
16592
 
16593
      public String getFieldName() {
16594
        return _fieldName;
16595
      }
16596
    }
16597
 
16598
    // isset id assignments
16599
    private static final int __ENTITYID_ISSET_ID = 0;
16600
    private BitSet __isset_bit_vector = new BitSet(1);
16601
 
16602
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
16603
    static {
16604
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16605
      tmpMap.put(_Fields.ENTITY_ID, new org.apache.thrift.meta_data.FieldMetaData("entityId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16606
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
16607
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16608
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_args.class, metaDataMap);
16609
    }
16610
 
16611
    public getDiscountsForEntity_args() {
16612
    }
16613
 
16614
    public getDiscountsForEntity_args(
16615
      long entityId)
16616
    {
16617
      this();
16618
      this.entityId = entityId;
16619
      setEntityIdIsSet(true);
16620
    }
16621
 
16622
    /**
16623
     * Performs a deep copy on <i>other</i>.
16624
     */
16625
    public getDiscountsForEntity_args(getDiscountsForEntity_args other) {
16626
      __isset_bit_vector.clear();
16627
      __isset_bit_vector.or(other.__isset_bit_vector);
16628
      this.entityId = other.entityId;
16629
    }
16630
 
16631
    public getDiscountsForEntity_args deepCopy() {
16632
      return new getDiscountsForEntity_args(this);
16633
    }
16634
 
16635
    @Override
16636
    public void clear() {
16637
      setEntityIdIsSet(false);
16638
      this.entityId = 0;
16639
    }
16640
 
16641
    public long getEntityId() {
16642
      return this.entityId;
16643
    }
16644
 
16645
    public void setEntityId(long entityId) {
16646
      this.entityId = entityId;
16647
      setEntityIdIsSet(true);
16648
    }
16649
 
16650
    public void unsetEntityId() {
16651
      __isset_bit_vector.clear(__ENTITYID_ISSET_ID);
16652
    }
16653
 
16654
    /** Returns true if field entityId is set (has been assigned a value) and false otherwise */
16655
    public boolean isSetEntityId() {
16656
      return __isset_bit_vector.get(__ENTITYID_ISSET_ID);
16657
    }
16658
 
16659
    public void setEntityIdIsSet(boolean value) {
16660
      __isset_bit_vector.set(__ENTITYID_ISSET_ID, value);
16661
    }
16662
 
16663
    public void setFieldValue(_Fields field, Object value) {
16664
      switch (field) {
16665
      case ENTITY_ID:
16666
        if (value == null) {
16667
          unsetEntityId();
16668
        } else {
16669
          setEntityId((Long)value);
16670
        }
16671
        break;
16672
 
16673
      }
16674
    }
16675
 
16676
    public Object getFieldValue(_Fields field) {
16677
      switch (field) {
16678
      case ENTITY_ID:
16679
        return Long.valueOf(getEntityId());
16680
 
16681
      }
16682
      throw new IllegalStateException();
16683
    }
16684
 
16685
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16686
    public boolean isSet(_Fields field) {
16687
      if (field == null) {
16688
        throw new IllegalArgumentException();
16689
      }
16690
 
16691
      switch (field) {
16692
      case ENTITY_ID:
16693
        return isSetEntityId();
16694
      }
16695
      throw new IllegalStateException();
16696
    }
16697
 
16698
    @Override
16699
    public boolean equals(Object that) {
16700
      if (that == null)
16701
        return false;
16702
      if (that instanceof getDiscountsForEntity_args)
16703
        return this.equals((getDiscountsForEntity_args)that);
16704
      return false;
16705
    }
16706
 
16707
    public boolean equals(getDiscountsForEntity_args that) {
16708
      if (that == null)
16709
        return false;
16710
 
16711
      boolean this_present_entityId = true;
16712
      boolean that_present_entityId = true;
16713
      if (this_present_entityId || that_present_entityId) {
16714
        if (!(this_present_entityId && that_present_entityId))
16715
          return false;
16716
        if (this.entityId != that.entityId)
16717
          return false;
16718
      }
16719
 
16720
      return true;
16721
    }
16722
 
16723
    @Override
16724
    public int hashCode() {
16725
      return 0;
16726
    }
16727
 
16728
    public int compareTo(getDiscountsForEntity_args other) {
16729
      if (!getClass().equals(other.getClass())) {
16730
        return getClass().getName().compareTo(other.getClass().getName());
16731
      }
16732
 
16733
      int lastComparison = 0;
16734
      getDiscountsForEntity_args typedOther = (getDiscountsForEntity_args)other;
16735
 
16736
      lastComparison = Boolean.valueOf(isSetEntityId()).compareTo(typedOther.isSetEntityId());
16737
      if (lastComparison != 0) {
16738
        return lastComparison;
16739
      }
16740
      if (isSetEntityId()) {
16741
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityId, typedOther.entityId);
16742
        if (lastComparison != 0) {
16743
          return lastComparison;
16744
        }
16745
      }
16746
      return 0;
16747
    }
16748
 
16749
    public _Fields fieldForId(int fieldId) {
16750
      return _Fields.findByThriftId(fieldId);
16751
    }
16752
 
16753
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16754
      org.apache.thrift.protocol.TField field;
16755
      iprot.readStructBegin();
16756
      while (true)
16757
      {
16758
        field = iprot.readFieldBegin();
16759
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
16760
          break;
16761
        }
16762
        switch (field.id) {
16763
          case 1: // ENTITY_ID
16764
            if (field.type == org.apache.thrift.protocol.TType.I64) {
16765
              this.entityId = iprot.readI64();
16766
              setEntityIdIsSet(true);
16767
            } else { 
16768
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16769
            }
16770
            break;
16771
          default:
16772
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16773
        }
16774
        iprot.readFieldEnd();
16775
      }
16776
      iprot.readStructEnd();
16777
      validate();
16778
    }
16779
 
16780
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
16781
      validate();
16782
 
16783
      oprot.writeStructBegin(STRUCT_DESC);
16784
      oprot.writeFieldBegin(ENTITY_ID_FIELD_DESC);
16785
      oprot.writeI64(this.entityId);
16786
      oprot.writeFieldEnd();
16787
      oprot.writeFieldStop();
16788
      oprot.writeStructEnd();
16789
    }
16790
 
16791
    @Override
16792
    public String toString() {
16793
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_args(");
16794
      boolean first = true;
16795
 
16796
      sb.append("entityId:");
16797
      sb.append(this.entityId);
16798
      first = false;
16799
      sb.append(")");
16800
      return sb.toString();
16801
    }
16802
 
16803
    public void validate() throws org.apache.thrift.TException {
16804
      // check for required fields
16805
    }
16806
 
16807
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16808
      try {
16809
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16810
      } catch (org.apache.thrift.TException te) {
16811
        throw new java.io.IOException(te);
16812
      }
16813
    }
16814
 
16815
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16816
      try {
16817
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
16818
        __isset_bit_vector = new BitSet(1);
16819
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16820
      } catch (org.apache.thrift.TException te) {
16821
        throw new java.io.IOException(te);
16822
      }
16823
    }
16824
 
16825
  }
16826
 
16827
  public static class getDiscountsForEntity_result implements org.apache.thrift.TBase<getDiscountsForEntity_result, getDiscountsForEntity_result._Fields>, java.io.Serializable, Cloneable   {
16828
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_result");
16829
 
16830
    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);
16831
 
16832
    private Map<String,Double> success; // required
16833
 
16834
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
16835
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
16836
      SUCCESS((short)0, "success");
16837
 
16838
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16839
 
16840
      static {
16841
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16842
          byName.put(field.getFieldName(), field);
16843
        }
16844
      }
16845
 
16846
      /**
16847
       * Find the _Fields constant that matches fieldId, or null if its not found.
16848
       */
16849
      public static _Fields findByThriftId(int fieldId) {
16850
        switch(fieldId) {
16851
          case 0: // SUCCESS
16852
            return SUCCESS;
16853
          default:
16854
            return null;
16855
        }
16856
      }
16857
 
16858
      /**
16859
       * Find the _Fields constant that matches fieldId, throwing an exception
16860
       * if it is not found.
16861
       */
16862
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16863
        _Fields fields = findByThriftId(fieldId);
16864
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16865
        return fields;
16866
      }
16867
 
16868
      /**
16869
       * Find the _Fields constant that matches name, or null if its not found.
16870
       */
16871
      public static _Fields findByName(String name) {
16872
        return byName.get(name);
16873
      }
16874
 
16875
      private final short _thriftId;
16876
      private final String _fieldName;
16877
 
16878
      _Fields(short thriftId, String fieldName) {
16879
        _thriftId = thriftId;
16880
        _fieldName = fieldName;
16881
      }
16882
 
16883
      public short getThriftFieldId() {
16884
        return _thriftId;
16885
      }
16886
 
16887
      public String getFieldName() {
16888
        return _fieldName;
16889
      }
16890
    }
16891
 
16892
    // isset id assignments
16893
 
16894
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
16895
    static {
16896
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16897
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16898
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
16899
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
16900
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
16901
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16902
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_result.class, metaDataMap);
16903
    }
16904
 
16905
    public getDiscountsForEntity_result() {
16906
    }
16907
 
16908
    public getDiscountsForEntity_result(
16909
      Map<String,Double> success)
16910
    {
16911
      this();
16912
      this.success = success;
16913
    }
16914
 
16915
    /**
16916
     * Performs a deep copy on <i>other</i>.
16917
     */
16918
    public getDiscountsForEntity_result(getDiscountsForEntity_result other) {
16919
      if (other.isSetSuccess()) {
16920
        Map<String,Double> __this__success = new HashMap<String,Double>();
16921
        for (Map.Entry<String, Double> other_element : other.success.entrySet()) {
16922
 
16923
          String other_element_key = other_element.getKey();
16924
          Double other_element_value = other_element.getValue();
16925
 
16926
          String __this__success_copy_key = other_element_key;
16927
 
16928
          Double __this__success_copy_value = other_element_value;
16929
 
16930
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
16931
        }
16932
        this.success = __this__success;
16933
      }
16934
    }
16935
 
16936
    public getDiscountsForEntity_result deepCopy() {
16937
      return new getDiscountsForEntity_result(this);
16938
    }
16939
 
16940
    @Override
16941
    public void clear() {
16942
      this.success = null;
16943
    }
16944
 
16945
    public int getSuccessSize() {
16946
      return (this.success == null) ? 0 : this.success.size();
16947
    }
16948
 
16949
    public void putToSuccess(String key, double val) {
16950
      if (this.success == null) {
16951
        this.success = new HashMap<String,Double>();
16952
      }
16953
      this.success.put(key, val);
16954
    }
16955
 
16956
    public Map<String,Double> getSuccess() {
16957
      return this.success;
16958
    }
16959
 
16960
    public void setSuccess(Map<String,Double> success) {
16961
      this.success = success;
16962
    }
16963
 
16964
    public void unsetSuccess() {
16965
      this.success = null;
16966
    }
16967
 
16968
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
16969
    public boolean isSetSuccess() {
16970
      return this.success != null;
16971
    }
16972
 
16973
    public void setSuccessIsSet(boolean value) {
16974
      if (!value) {
16975
        this.success = null;
16976
      }
16977
    }
16978
 
16979
    public void setFieldValue(_Fields field, Object value) {
16980
      switch (field) {
16981
      case SUCCESS:
16982
        if (value == null) {
16983
          unsetSuccess();
16984
        } else {
16985
          setSuccess((Map<String,Double>)value);
16986
        }
16987
        break;
16988
 
16989
      }
16990
    }
16991
 
16992
    public Object getFieldValue(_Fields field) {
16993
      switch (field) {
16994
      case SUCCESS:
16995
        return getSuccess();
16996
 
16997
      }
16998
      throw new IllegalStateException();
16999
    }
17000
 
17001
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
17002
    public boolean isSet(_Fields field) {
17003
      if (field == null) {
17004
        throw new IllegalArgumentException();
17005
      }
17006
 
17007
      switch (field) {
17008
      case SUCCESS:
17009
        return isSetSuccess();
17010
      }
17011
      throw new IllegalStateException();
17012
    }
17013
 
17014
    @Override
17015
    public boolean equals(Object that) {
17016
      if (that == null)
17017
        return false;
17018
      if (that instanceof getDiscountsForEntity_result)
17019
        return this.equals((getDiscountsForEntity_result)that);
17020
      return false;
17021
    }
17022
 
17023
    public boolean equals(getDiscountsForEntity_result that) {
17024
      if (that == null)
17025
        return false;
17026
 
17027
      boolean this_present_success = true && this.isSetSuccess();
17028
      boolean that_present_success = true && that.isSetSuccess();
17029
      if (this_present_success || that_present_success) {
17030
        if (!(this_present_success && that_present_success))
17031
          return false;
17032
        if (!this.success.equals(that.success))
17033
          return false;
17034
      }
17035
 
17036
      return true;
17037
    }
17038
 
17039
    @Override
17040
    public int hashCode() {
17041
      return 0;
17042
    }
17043
 
17044
    public int compareTo(getDiscountsForEntity_result other) {
17045
      if (!getClass().equals(other.getClass())) {
17046
        return getClass().getName().compareTo(other.getClass().getName());
17047
      }
17048
 
17049
      int lastComparison = 0;
17050
      getDiscountsForEntity_result typedOther = (getDiscountsForEntity_result)other;
17051
 
17052
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
17053
      if (lastComparison != 0) {
17054
        return lastComparison;
17055
      }
17056
      if (isSetSuccess()) {
17057
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
17058
        if (lastComparison != 0) {
17059
          return lastComparison;
17060
        }
17061
      }
17062
      return 0;
17063
    }
17064
 
17065
    public _Fields fieldForId(int fieldId) {
17066
      return _Fields.findByThriftId(fieldId);
17067
    }
17068
 
17069
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17070
      org.apache.thrift.protocol.TField field;
17071
      iprot.readStructBegin();
17072
      while (true)
17073
      {
17074
        field = iprot.readFieldBegin();
17075
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17076
          break;
17077
        }
17078
        switch (field.id) {
17079
          case 0: // SUCCESS
17080
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
17081
              {
7092 amit.gupta 17082
                org.apache.thrift.protocol.TMap _map46 = iprot.readMapBegin();
17083
                this.success = new HashMap<String,Double>(2*_map46.size);
17084
                for (int _i47 = 0; _i47 < _map46.size; ++_i47)
4494 varun.gupt 17085
                {
7092 amit.gupta 17086
                  String _key48; // required
17087
                  double _val49; // required
17088
                  _key48 = iprot.readString();
17089
                  _val49 = iprot.readDouble();
17090
                  this.success.put(_key48, _val49);
4494 varun.gupt 17091
                }
17092
                iprot.readMapEnd();
17093
              }
17094
            } else { 
17095
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17096
            }
17097
            break;
17098
          default:
17099
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17100
        }
17101
        iprot.readFieldEnd();
17102
      }
17103
      iprot.readStructEnd();
17104
      validate();
17105
    }
17106
 
17107
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17108
      oprot.writeStructBegin(STRUCT_DESC);
17109
 
17110
      if (this.isSetSuccess()) {
17111
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
17112
        {
17113
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.DOUBLE, this.success.size()));
7092 amit.gupta 17114
          for (Map.Entry<String, Double> _iter50 : this.success.entrySet())
4494 varun.gupt 17115
          {
7092 amit.gupta 17116
            oprot.writeString(_iter50.getKey());
17117
            oprot.writeDouble(_iter50.getValue());
4494 varun.gupt 17118
          }
17119
          oprot.writeMapEnd();
17120
        }
17121
        oprot.writeFieldEnd();
17122
      }
17123
      oprot.writeFieldStop();
17124
      oprot.writeStructEnd();
17125
    }
17126
 
17127
    @Override
17128
    public String toString() {
17129
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_result(");
17130
      boolean first = true;
17131
 
17132
      sb.append("success:");
17133
      if (this.success == null) {
17134
        sb.append("null");
17135
      } else {
17136
        sb.append(this.success);
17137
      }
17138
      first = false;
17139
      sb.append(")");
17140
      return sb.toString();
17141
    }
17142
 
17143
    public void validate() throws org.apache.thrift.TException {
17144
      // check for required fields
17145
    }
17146
 
17147
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17148
      try {
17149
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17150
      } catch (org.apache.thrift.TException te) {
17151
        throw new java.io.IOException(te);
17152
      }
17153
    }
17154
 
17155
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
17156
      try {
17157
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
17158
      } catch (org.apache.thrift.TException te) {
17159
        throw new java.io.IOException(te);
17160
      }
17161
    }
17162
 
17163
  }
17164
 
5469 rajveer 17165
  public static class addVoucher_args implements org.apache.thrift.TBase<addVoucher_args, addVoucher_args._Fields>, java.io.Serializable, Cloneable   {
17166
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_args");
17167
 
17168
    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);
17169
 
17170
    private Voucher voucher; // required
17171
 
17172
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
17173
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
17174
      VOUCHER((short)1, "voucher");
17175
 
17176
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
17177
 
17178
      static {
17179
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
17180
          byName.put(field.getFieldName(), field);
17181
        }
17182
      }
17183
 
17184
      /**
17185
       * Find the _Fields constant that matches fieldId, or null if its not found.
17186
       */
17187
      public static _Fields findByThriftId(int fieldId) {
17188
        switch(fieldId) {
17189
          case 1: // VOUCHER
17190
            return VOUCHER;
17191
          default:
17192
            return null;
17193
        }
17194
      }
17195
 
17196
      /**
17197
       * Find the _Fields constant that matches fieldId, throwing an exception
17198
       * if it is not found.
17199
       */
17200
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17201
        _Fields fields = findByThriftId(fieldId);
17202
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17203
        return fields;
17204
      }
17205
 
17206
      /**
17207
       * Find the _Fields constant that matches name, or null if its not found.
17208
       */
17209
      public static _Fields findByName(String name) {
17210
        return byName.get(name);
17211
      }
17212
 
17213
      private final short _thriftId;
17214
      private final String _fieldName;
17215
 
17216
      _Fields(short thriftId, String fieldName) {
17217
        _thriftId = thriftId;
17218
        _fieldName = fieldName;
17219
      }
17220
 
17221
      public short getThriftFieldId() {
17222
        return _thriftId;
17223
      }
17224
 
17225
      public String getFieldName() {
17226
        return _fieldName;
17227
      }
17228
    }
17229
 
17230
    // isset id assignments
17231
 
17232
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
17233
    static {
17234
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
17235
      tmpMap.put(_Fields.VOUCHER, new org.apache.thrift.meta_data.FieldMetaData("voucher", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17236
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
17237
      metaDataMap = Collections.unmodifiableMap(tmpMap);
17238
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_args.class, metaDataMap);
17239
    }
17240
 
17241
    public addVoucher_args() {
17242
    }
17243
 
17244
    public addVoucher_args(
17245
      Voucher voucher)
17246
    {
17247
      this();
17248
      this.voucher = voucher;
17249
    }
17250
 
17251
    /**
17252
     * Performs a deep copy on <i>other</i>.
17253
     */
17254
    public addVoucher_args(addVoucher_args other) {
17255
      if (other.isSetVoucher()) {
17256
        this.voucher = new Voucher(other.voucher);
17257
      }
17258
    }
17259
 
17260
    public addVoucher_args deepCopy() {
17261
      return new addVoucher_args(this);
17262
    }
17263
 
17264
    @Override
17265
    public void clear() {
17266
      this.voucher = null;
17267
    }
17268
 
17269
    public Voucher getVoucher() {
17270
      return this.voucher;
17271
    }
17272
 
17273
    public void setVoucher(Voucher voucher) {
17274
      this.voucher = voucher;
17275
    }
17276
 
17277
    public void unsetVoucher() {
17278
      this.voucher = null;
17279
    }
17280
 
17281
    /** Returns true if field voucher is set (has been assigned a value) and false otherwise */
17282
    public boolean isSetVoucher() {
17283
      return this.voucher != null;
17284
    }
17285
 
17286
    public void setVoucherIsSet(boolean value) {
17287
      if (!value) {
17288
        this.voucher = null;
17289
      }
17290
    }
17291
 
17292
    public void setFieldValue(_Fields field, Object value) {
17293
      switch (field) {
17294
      case VOUCHER:
17295
        if (value == null) {
17296
          unsetVoucher();
17297
        } else {
17298
          setVoucher((Voucher)value);
17299
        }
17300
        break;
17301
 
17302
      }
17303
    }
17304
 
17305
    public Object getFieldValue(_Fields field) {
17306
      switch (field) {
17307
      case VOUCHER:
17308
        return getVoucher();
17309
 
17310
      }
17311
      throw new IllegalStateException();
17312
    }
17313
 
17314
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
17315
    public boolean isSet(_Fields field) {
17316
      if (field == null) {
17317
        throw new IllegalArgumentException();
17318
      }
17319
 
17320
      switch (field) {
17321
      case VOUCHER:
17322
        return isSetVoucher();
17323
      }
17324
      throw new IllegalStateException();
17325
    }
17326
 
17327
    @Override
17328
    public boolean equals(Object that) {
17329
      if (that == null)
17330
        return false;
17331
      if (that instanceof addVoucher_args)
17332
        return this.equals((addVoucher_args)that);
17333
      return false;
17334
    }
17335
 
17336
    public boolean equals(addVoucher_args that) {
17337
      if (that == null)
17338
        return false;
17339
 
17340
      boolean this_present_voucher = true && this.isSetVoucher();
17341
      boolean that_present_voucher = true && that.isSetVoucher();
17342
      if (this_present_voucher || that_present_voucher) {
17343
        if (!(this_present_voucher && that_present_voucher))
17344
          return false;
17345
        if (!this.voucher.equals(that.voucher))
17346
          return false;
17347
      }
17348
 
17349
      return true;
17350
    }
17351
 
17352
    @Override
17353
    public int hashCode() {
17354
      return 0;
17355
    }
17356
 
17357
    public int compareTo(addVoucher_args other) {
17358
      if (!getClass().equals(other.getClass())) {
17359
        return getClass().getName().compareTo(other.getClass().getName());
17360
      }
17361
 
17362
      int lastComparison = 0;
17363
      addVoucher_args typedOther = (addVoucher_args)other;
17364
 
17365
      lastComparison = Boolean.valueOf(isSetVoucher()).compareTo(typedOther.isSetVoucher());
17366
      if (lastComparison != 0) {
17367
        return lastComparison;
17368
      }
17369
      if (isSetVoucher()) {
17370
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucher, typedOther.voucher);
17371
        if (lastComparison != 0) {
17372
          return lastComparison;
17373
        }
17374
      }
17375
      return 0;
17376
    }
17377
 
17378
    public _Fields fieldForId(int fieldId) {
17379
      return _Fields.findByThriftId(fieldId);
17380
    }
17381
 
17382
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17383
      org.apache.thrift.protocol.TField field;
17384
      iprot.readStructBegin();
17385
      while (true)
17386
      {
17387
        field = iprot.readFieldBegin();
17388
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17389
          break;
17390
        }
17391
        switch (field.id) {
17392
          case 1: // VOUCHER
17393
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
17394
              this.voucher = new Voucher();
17395
              this.voucher.read(iprot);
17396
            } else { 
17397
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17398
            }
17399
            break;
17400
          default:
17401
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17402
        }
17403
        iprot.readFieldEnd();
17404
      }
17405
      iprot.readStructEnd();
17406
      validate();
17407
    }
17408
 
17409
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17410
      validate();
17411
 
17412
      oprot.writeStructBegin(STRUCT_DESC);
17413
      if (this.voucher != null) {
17414
        oprot.writeFieldBegin(VOUCHER_FIELD_DESC);
17415
        this.voucher.write(oprot);
17416
        oprot.writeFieldEnd();
17417
      }
17418
      oprot.writeFieldStop();
17419
      oprot.writeStructEnd();
17420
    }
17421
 
17422
    @Override
17423
    public String toString() {
17424
      StringBuilder sb = new StringBuilder("addVoucher_args(");
17425
      boolean first = true;
17426
 
17427
      sb.append("voucher:");
17428
      if (this.voucher == null) {
17429
        sb.append("null");
17430
      } else {
17431
        sb.append(this.voucher);
17432
      }
17433
      first = false;
17434
      sb.append(")");
17435
      return sb.toString();
17436
    }
17437
 
17438
    public void validate() throws org.apache.thrift.TException {
17439
      // check for required fields
17440
    }
17441
 
17442
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17443
      try {
17444
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17445
      } catch (org.apache.thrift.TException te) {
17446
        throw new java.io.IOException(te);
17447
      }
17448
    }
17449
 
17450
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
17451
      try {
17452
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
17453
      } catch (org.apache.thrift.TException te) {
17454
        throw new java.io.IOException(te);
17455
      }
17456
    }
17457
 
17458
  }
17459
 
17460
  public static class addVoucher_result implements org.apache.thrift.TBase<addVoucher_result, addVoucher_result._Fields>, java.io.Serializable, Cloneable   {
17461
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_result");
17462
 
17463
 
17464
 
17465
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
17466
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
17467
;
17468
 
17469
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
17470
 
17471
      static {
17472
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
17473
          byName.put(field.getFieldName(), field);
17474
        }
17475
      }
17476
 
17477
      /**
17478
       * Find the _Fields constant that matches fieldId, or null if its not found.
17479
       */
17480
      public static _Fields findByThriftId(int fieldId) {
17481
        switch(fieldId) {
17482
          default:
17483
            return null;
17484
        }
17485
      }
17486
 
17487
      /**
17488
       * Find the _Fields constant that matches fieldId, throwing an exception
17489
       * if it is not found.
17490
       */
17491
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17492
        _Fields fields = findByThriftId(fieldId);
17493
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17494
        return fields;
17495
      }
17496
 
17497
      /**
17498
       * Find the _Fields constant that matches name, or null if its not found.
17499
       */
17500
      public static _Fields findByName(String name) {
17501
        return byName.get(name);
17502
      }
17503
 
17504
      private final short _thriftId;
17505
      private final String _fieldName;
17506
 
17507
      _Fields(short thriftId, String fieldName) {
17508
        _thriftId = thriftId;
17509
        _fieldName = fieldName;
17510
      }
17511
 
17512
      public short getThriftFieldId() {
17513
        return _thriftId;
17514
      }
17515
 
17516
      public String getFieldName() {
17517
        return _fieldName;
17518
      }
17519
    }
17520
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
17521
    static {
17522
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
17523
      metaDataMap = Collections.unmodifiableMap(tmpMap);
17524
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_result.class, metaDataMap);
17525
    }
17526
 
17527
    public addVoucher_result() {
17528
    }
17529
 
17530
    /**
17531
     * Performs a deep copy on <i>other</i>.
17532
     */
17533
    public addVoucher_result(addVoucher_result other) {
17534
    }
17535
 
17536
    public addVoucher_result deepCopy() {
17537
      return new addVoucher_result(this);
17538
    }
17539
 
17540
    @Override
17541
    public void clear() {
17542
    }
17543
 
17544
    public void setFieldValue(_Fields field, Object value) {
17545
      switch (field) {
17546
      }
17547
    }
17548
 
17549
    public Object getFieldValue(_Fields field) {
17550
      switch (field) {
17551
      }
17552
      throw new IllegalStateException();
17553
    }
17554
 
17555
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
17556
    public boolean isSet(_Fields field) {
17557
      if (field == null) {
17558
        throw new IllegalArgumentException();
17559
      }
17560
 
17561
      switch (field) {
17562
      }
17563
      throw new IllegalStateException();
17564
    }
17565
 
17566
    @Override
17567
    public boolean equals(Object that) {
17568
      if (that == null)
17569
        return false;
17570
      if (that instanceof addVoucher_result)
17571
        return this.equals((addVoucher_result)that);
17572
      return false;
17573
    }
17574
 
17575
    public boolean equals(addVoucher_result that) {
17576
      if (that == null)
17577
        return false;
17578
 
17579
      return true;
17580
    }
17581
 
17582
    @Override
17583
    public int hashCode() {
17584
      return 0;
17585
    }
17586
 
17587
    public int compareTo(addVoucher_result other) {
17588
      if (!getClass().equals(other.getClass())) {
17589
        return getClass().getName().compareTo(other.getClass().getName());
17590
      }
17591
 
17592
      int lastComparison = 0;
17593
      addVoucher_result typedOther = (addVoucher_result)other;
17594
 
17595
      return 0;
17596
    }
17597
 
17598
    public _Fields fieldForId(int fieldId) {
17599
      return _Fields.findByThriftId(fieldId);
17600
    }
17601
 
17602
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17603
      org.apache.thrift.protocol.TField field;
17604
      iprot.readStructBegin();
17605
      while (true)
17606
      {
17607
        field = iprot.readFieldBegin();
17608
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17609
          break;
17610
        }
17611
        switch (field.id) {
17612
          default:
17613
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17614
        }
17615
        iprot.readFieldEnd();
17616
      }
17617
      iprot.readStructEnd();
17618
      validate();
17619
    }
17620
 
17621
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17622
      oprot.writeStructBegin(STRUCT_DESC);
17623
 
17624
      oprot.writeFieldStop();
17625
      oprot.writeStructEnd();
17626
    }
17627
 
17628
    @Override
17629
    public String toString() {
17630
      StringBuilder sb = new StringBuilder("addVoucher_result(");
17631
      boolean first = true;
17632
 
17633
      sb.append(")");
17634
      return sb.toString();
17635
    }
17636
 
17637
    public void validate() throws org.apache.thrift.TException {
17638
      // check for required fields
17639
    }
17640
 
17641
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17642
      try {
17643
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17644
      } catch (org.apache.thrift.TException te) {
17645
        throw new java.io.IOException(te);
17646
      }
17647
    }
17648
 
17649
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
17650
      try {
17651
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
17652
      } catch (org.apache.thrift.TException te) {
17653
        throw new java.io.IOException(te);
17654
      }
17655
    }
17656
 
17657
  }
17658
 
17659
  public static class assignVoucher_args implements org.apache.thrift.TBase<assignVoucher_args, assignVoucher_args._Fields>, java.io.Serializable, Cloneable   {
17660
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_args");
17661
 
17662
    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);
17663
    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);
17664
    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);
17665
    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);
17666
 
17667
    private long userId; // required
17668
    private String userEmail; // required
17669
    private VoucherType voucherType; // required
17670
    private long amount; // required
17671
 
17672
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
17673
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
17674
      USER_ID((short)1, "userId"),
17675
      USER_EMAIL((short)2, "userEmail"),
17676
      /**
17677
       * 
17678
       * @see VoucherType
17679
       */
17680
      VOUCHER_TYPE((short)3, "voucherType"),
17681
      AMOUNT((short)4, "amount");
17682
 
17683
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
17684
 
17685
      static {
17686
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
17687
          byName.put(field.getFieldName(), field);
17688
        }
17689
      }
17690
 
17691
      /**
17692
       * Find the _Fields constant that matches fieldId, or null if its not found.
17693
       */
17694
      public static _Fields findByThriftId(int fieldId) {
17695
        switch(fieldId) {
17696
          case 1: // USER_ID
17697
            return USER_ID;
17698
          case 2: // USER_EMAIL
17699
            return USER_EMAIL;
17700
          case 3: // VOUCHER_TYPE
17701
            return VOUCHER_TYPE;
17702
          case 4: // AMOUNT
17703
            return AMOUNT;
17704
          default:
17705
            return null;
17706
        }
17707
      }
17708
 
17709
      /**
17710
       * Find the _Fields constant that matches fieldId, throwing an exception
17711
       * if it is not found.
17712
       */
17713
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17714
        _Fields fields = findByThriftId(fieldId);
17715
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17716
        return fields;
17717
      }
17718
 
17719
      /**
17720
       * Find the _Fields constant that matches name, or null if its not found.
17721
       */
17722
      public static _Fields findByName(String name) {
17723
        return byName.get(name);
17724
      }
17725
 
17726
      private final short _thriftId;
17727
      private final String _fieldName;
17728
 
17729
      _Fields(short thriftId, String fieldName) {
17730
        _thriftId = thriftId;
17731
        _fieldName = fieldName;
17732
      }
17733
 
17734
      public short getThriftFieldId() {
17735
        return _thriftId;
17736
      }
17737
 
17738
      public String getFieldName() {
17739
        return _fieldName;
17740
      }
17741
    }
17742
 
17743
    // isset id assignments
17744
    private static final int __USERID_ISSET_ID = 0;
17745
    private static final int __AMOUNT_ISSET_ID = 1;
17746
    private BitSet __isset_bit_vector = new BitSet(2);
17747
 
17748
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
17749
    static {
17750
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
17751
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17752
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
17753
      tmpMap.put(_Fields.USER_EMAIL, new org.apache.thrift.meta_data.FieldMetaData("userEmail", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17754
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
17755
      tmpMap.put(_Fields.VOUCHER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("voucherType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17756
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, VoucherType.class)));
17757
      tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17758
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
17759
      metaDataMap = Collections.unmodifiableMap(tmpMap);
17760
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_args.class, metaDataMap);
17761
    }
17762
 
17763
    public assignVoucher_args() {
17764
    }
17765
 
17766
    public assignVoucher_args(
17767
      long userId,
17768
      String userEmail,
17769
      VoucherType voucherType,
17770
      long amount)
17771
    {
17772
      this();
17773
      this.userId = userId;
17774
      setUserIdIsSet(true);
17775
      this.userEmail = userEmail;
17776
      this.voucherType = voucherType;
17777
      this.amount = amount;
17778
      setAmountIsSet(true);
17779
    }
17780
 
17781
    /**
17782
     * Performs a deep copy on <i>other</i>.
17783
     */
17784
    public assignVoucher_args(assignVoucher_args other) {
17785
      __isset_bit_vector.clear();
17786
      __isset_bit_vector.or(other.__isset_bit_vector);
17787
      this.userId = other.userId;
17788
      if (other.isSetUserEmail()) {
17789
        this.userEmail = other.userEmail;
17790
      }
17791
      if (other.isSetVoucherType()) {
17792
        this.voucherType = other.voucherType;
17793
      }
17794
      this.amount = other.amount;
17795
    }
17796
 
17797
    public assignVoucher_args deepCopy() {
17798
      return new assignVoucher_args(this);
17799
    }
17800
 
17801
    @Override
17802
    public void clear() {
17803
      setUserIdIsSet(false);
17804
      this.userId = 0;
17805
      this.userEmail = null;
17806
      this.voucherType = null;
17807
      setAmountIsSet(false);
17808
      this.amount = 0;
17809
    }
17810
 
17811
    public long getUserId() {
17812
      return this.userId;
17813
    }
17814
 
17815
    public void setUserId(long userId) {
17816
      this.userId = userId;
17817
      setUserIdIsSet(true);
17818
    }
17819
 
17820
    public void unsetUserId() {
17821
      __isset_bit_vector.clear(__USERID_ISSET_ID);
17822
    }
17823
 
17824
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
17825
    public boolean isSetUserId() {
17826
      return __isset_bit_vector.get(__USERID_ISSET_ID);
17827
    }
17828
 
17829
    public void setUserIdIsSet(boolean value) {
17830
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
17831
    }
17832
 
17833
    public String getUserEmail() {
17834
      return this.userEmail;
17835
    }
17836
 
17837
    public void setUserEmail(String userEmail) {
17838
      this.userEmail = userEmail;
17839
    }
17840
 
17841
    public void unsetUserEmail() {
17842
      this.userEmail = null;
17843
    }
17844
 
17845
    /** Returns true if field userEmail is set (has been assigned a value) and false otherwise */
17846
    public boolean isSetUserEmail() {
17847
      return this.userEmail != null;
17848
    }
17849
 
17850
    public void setUserEmailIsSet(boolean value) {
17851
      if (!value) {
17852
        this.userEmail = null;
17853
      }
17854
    }
17855
 
17856
    /**
17857
     * 
17858
     * @see VoucherType
17859
     */
17860
    public VoucherType getVoucherType() {
17861
      return this.voucherType;
17862
    }
17863
 
17864
    /**
17865
     * 
17866
     * @see VoucherType
17867
     */
17868
    public void setVoucherType(VoucherType voucherType) {
17869
      this.voucherType = voucherType;
17870
    }
17871
 
17872
    public void unsetVoucherType() {
17873
      this.voucherType = null;
17874
    }
17875
 
17876
    /** Returns true if field voucherType is set (has been assigned a value) and false otherwise */
17877
    public boolean isSetVoucherType() {
17878
      return this.voucherType != null;
17879
    }
17880
 
17881
    public void setVoucherTypeIsSet(boolean value) {
17882
      if (!value) {
17883
        this.voucherType = null;
17884
      }
17885
    }
17886
 
17887
    public long getAmount() {
17888
      return this.amount;
17889
    }
17890
 
17891
    public void setAmount(long amount) {
17892
      this.amount = amount;
17893
      setAmountIsSet(true);
17894
    }
17895
 
17896
    public void unsetAmount() {
17897
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
17898
    }
17899
 
17900
    /** Returns true if field amount is set (has been assigned a value) and false otherwise */
17901
    public boolean isSetAmount() {
17902
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
17903
    }
17904
 
17905
    public void setAmountIsSet(boolean value) {
17906
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
17907
    }
17908
 
17909
    public void setFieldValue(_Fields field, Object value) {
17910
      switch (field) {
17911
      case USER_ID:
17912
        if (value == null) {
17913
          unsetUserId();
17914
        } else {
17915
          setUserId((Long)value);
17916
        }
17917
        break;
17918
 
17919
      case USER_EMAIL:
17920
        if (value == null) {
17921
          unsetUserEmail();
17922
        } else {
17923
          setUserEmail((String)value);
17924
        }
17925
        break;
17926
 
17927
      case VOUCHER_TYPE:
17928
        if (value == null) {
17929
          unsetVoucherType();
17930
        } else {
17931
          setVoucherType((VoucherType)value);
17932
        }
17933
        break;
17934
 
17935
      case AMOUNT:
17936
        if (value == null) {
17937
          unsetAmount();
17938
        } else {
17939
          setAmount((Long)value);
17940
        }
17941
        break;
17942
 
17943
      }
17944
    }
17945
 
17946
    public Object getFieldValue(_Fields field) {
17947
      switch (field) {
17948
      case USER_ID:
17949
        return Long.valueOf(getUserId());
17950
 
17951
      case USER_EMAIL:
17952
        return getUserEmail();
17953
 
17954
      case VOUCHER_TYPE:
17955
        return getVoucherType();
17956
 
17957
      case AMOUNT:
17958
        return Long.valueOf(getAmount());
17959
 
17960
      }
17961
      throw new IllegalStateException();
17962
    }
17963
 
17964
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
17965
    public boolean isSet(_Fields field) {
17966
      if (field == null) {
17967
        throw new IllegalArgumentException();
17968
      }
17969
 
17970
      switch (field) {
17971
      case USER_ID:
17972
        return isSetUserId();
17973
      case USER_EMAIL:
17974
        return isSetUserEmail();
17975
      case VOUCHER_TYPE:
17976
        return isSetVoucherType();
17977
      case AMOUNT:
17978
        return isSetAmount();
17979
      }
17980
      throw new IllegalStateException();
17981
    }
17982
 
17983
    @Override
17984
    public boolean equals(Object that) {
17985
      if (that == null)
17986
        return false;
17987
      if (that instanceof assignVoucher_args)
17988
        return this.equals((assignVoucher_args)that);
17989
      return false;
17990
    }
17991
 
17992
    public boolean equals(assignVoucher_args that) {
17993
      if (that == null)
17994
        return false;
17995
 
17996
      boolean this_present_userId = true;
17997
      boolean that_present_userId = true;
17998
      if (this_present_userId || that_present_userId) {
17999
        if (!(this_present_userId && that_present_userId))
18000
          return false;
18001
        if (this.userId != that.userId)
18002
          return false;
18003
      }
18004
 
18005
      boolean this_present_userEmail = true && this.isSetUserEmail();
18006
      boolean that_present_userEmail = true && that.isSetUserEmail();
18007
      if (this_present_userEmail || that_present_userEmail) {
18008
        if (!(this_present_userEmail && that_present_userEmail))
18009
          return false;
18010
        if (!this.userEmail.equals(that.userEmail))
18011
          return false;
18012
      }
18013
 
18014
      boolean this_present_voucherType = true && this.isSetVoucherType();
18015
      boolean that_present_voucherType = true && that.isSetVoucherType();
18016
      if (this_present_voucherType || that_present_voucherType) {
18017
        if (!(this_present_voucherType && that_present_voucherType))
18018
          return false;
18019
        if (!this.voucherType.equals(that.voucherType))
18020
          return false;
18021
      }
18022
 
18023
      boolean this_present_amount = true;
18024
      boolean that_present_amount = true;
18025
      if (this_present_amount || that_present_amount) {
18026
        if (!(this_present_amount && that_present_amount))
18027
          return false;
18028
        if (this.amount != that.amount)
18029
          return false;
18030
      }
18031
 
18032
      return true;
18033
    }
18034
 
18035
    @Override
18036
    public int hashCode() {
18037
      return 0;
18038
    }
18039
 
18040
    public int compareTo(assignVoucher_args other) {
18041
      if (!getClass().equals(other.getClass())) {
18042
        return getClass().getName().compareTo(other.getClass().getName());
18043
      }
18044
 
18045
      int lastComparison = 0;
18046
      assignVoucher_args typedOther = (assignVoucher_args)other;
18047
 
18048
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
18049
      if (lastComparison != 0) {
18050
        return lastComparison;
18051
      }
18052
      if (isSetUserId()) {
18053
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
18054
        if (lastComparison != 0) {
18055
          return lastComparison;
18056
        }
18057
      }
18058
      lastComparison = Boolean.valueOf(isSetUserEmail()).compareTo(typedOther.isSetUserEmail());
18059
      if (lastComparison != 0) {
18060
        return lastComparison;
18061
      }
18062
      if (isSetUserEmail()) {
18063
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userEmail, typedOther.userEmail);
18064
        if (lastComparison != 0) {
18065
          return lastComparison;
18066
        }
18067
      }
18068
      lastComparison = Boolean.valueOf(isSetVoucherType()).compareTo(typedOther.isSetVoucherType());
18069
      if (lastComparison != 0) {
18070
        return lastComparison;
18071
      }
18072
      if (isSetVoucherType()) {
18073
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherType, typedOther.voucherType);
18074
        if (lastComparison != 0) {
18075
          return lastComparison;
18076
        }
18077
      }
18078
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
18079
      if (lastComparison != 0) {
18080
        return lastComparison;
18081
      }
18082
      if (isSetAmount()) {
18083
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
18084
        if (lastComparison != 0) {
18085
          return lastComparison;
18086
        }
18087
      }
18088
      return 0;
18089
    }
18090
 
18091
    public _Fields fieldForId(int fieldId) {
18092
      return _Fields.findByThriftId(fieldId);
18093
    }
18094
 
18095
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
18096
      org.apache.thrift.protocol.TField field;
18097
      iprot.readStructBegin();
18098
      while (true)
18099
      {
18100
        field = iprot.readFieldBegin();
18101
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
18102
          break;
18103
        }
18104
        switch (field.id) {
18105
          case 1: // USER_ID
18106
            if (field.type == org.apache.thrift.protocol.TType.I64) {
18107
              this.userId = iprot.readI64();
18108
              setUserIdIsSet(true);
18109
            } else { 
18110
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18111
            }
18112
            break;
18113
          case 2: // USER_EMAIL
18114
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
18115
              this.userEmail = iprot.readString();
18116
            } else { 
18117
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18118
            }
18119
            break;
18120
          case 3: // VOUCHER_TYPE
18121
            if (field.type == org.apache.thrift.protocol.TType.I32) {
18122
              this.voucherType = VoucherType.findByValue(iprot.readI32());
18123
            } else { 
18124
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18125
            }
18126
            break;
18127
          case 4: // AMOUNT
18128
            if (field.type == org.apache.thrift.protocol.TType.I64) {
18129
              this.amount = iprot.readI64();
18130
              setAmountIsSet(true);
18131
            } else { 
18132
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18133
            }
18134
            break;
18135
          default:
18136
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18137
        }
18138
        iprot.readFieldEnd();
18139
      }
18140
      iprot.readStructEnd();
18141
      validate();
18142
    }
18143
 
18144
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
18145
      validate();
18146
 
18147
      oprot.writeStructBegin(STRUCT_DESC);
18148
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
18149
      oprot.writeI64(this.userId);
18150
      oprot.writeFieldEnd();
18151
      if (this.userEmail != null) {
18152
        oprot.writeFieldBegin(USER_EMAIL_FIELD_DESC);
18153
        oprot.writeString(this.userEmail);
18154
        oprot.writeFieldEnd();
18155
      }
18156
      if (this.voucherType != null) {
18157
        oprot.writeFieldBegin(VOUCHER_TYPE_FIELD_DESC);
18158
        oprot.writeI32(this.voucherType.getValue());
18159
        oprot.writeFieldEnd();
18160
      }
18161
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
18162
      oprot.writeI64(this.amount);
18163
      oprot.writeFieldEnd();
18164
      oprot.writeFieldStop();
18165
      oprot.writeStructEnd();
18166
    }
18167
 
18168
    @Override
18169
    public String toString() {
18170
      StringBuilder sb = new StringBuilder("assignVoucher_args(");
18171
      boolean first = true;
18172
 
18173
      sb.append("userId:");
18174
      sb.append(this.userId);
18175
      first = false;
18176
      if (!first) sb.append(", ");
18177
      sb.append("userEmail:");
18178
      if (this.userEmail == null) {
18179
        sb.append("null");
18180
      } else {
18181
        sb.append(this.userEmail);
18182
      }
18183
      first = false;
18184
      if (!first) sb.append(", ");
18185
      sb.append("voucherType:");
18186
      if (this.voucherType == null) {
18187
        sb.append("null");
18188
      } else {
18189
        sb.append(this.voucherType);
18190
      }
18191
      first = false;
18192
      if (!first) sb.append(", ");
18193
      sb.append("amount:");
18194
      sb.append(this.amount);
18195
      first = false;
18196
      sb.append(")");
18197
      return sb.toString();
18198
    }
18199
 
18200
    public void validate() throws org.apache.thrift.TException {
18201
      // check for required fields
18202
    }
18203
 
18204
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
18205
      try {
18206
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
18207
      } catch (org.apache.thrift.TException te) {
18208
        throw new java.io.IOException(te);
18209
      }
18210
    }
18211
 
18212
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
18213
      try {
18214
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
18215
        __isset_bit_vector = new BitSet(1);
18216
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
18217
      } catch (org.apache.thrift.TException te) {
18218
        throw new java.io.IOException(te);
18219
      }
18220
    }
18221
 
18222
  }
18223
 
18224
  public static class assignVoucher_result implements org.apache.thrift.TBase<assignVoucher_result, assignVoucher_result._Fields>, java.io.Serializable, Cloneable   {
18225
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_result");
18226
 
18227
    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);
18228
 
18229
    private Voucher success; // required
18230
 
18231
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
18232
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
18233
      SUCCESS((short)0, "success");
18234
 
18235
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
18236
 
18237
      static {
18238
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
18239
          byName.put(field.getFieldName(), field);
18240
        }
18241
      }
18242
 
18243
      /**
18244
       * Find the _Fields constant that matches fieldId, or null if its not found.
18245
       */
18246
      public static _Fields findByThriftId(int fieldId) {
18247
        switch(fieldId) {
18248
          case 0: // SUCCESS
18249
            return SUCCESS;
18250
          default:
18251
            return null;
18252
        }
18253
      }
18254
 
18255
      /**
18256
       * Find the _Fields constant that matches fieldId, throwing an exception
18257
       * if it is not found.
18258
       */
18259
      public static _Fields findByThriftIdOrThrow(int fieldId) {
18260
        _Fields fields = findByThriftId(fieldId);
18261
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
18262
        return fields;
18263
      }
18264
 
18265
      /**
18266
       * Find the _Fields constant that matches name, or null if its not found.
18267
       */
18268
      public static _Fields findByName(String name) {
18269
        return byName.get(name);
18270
      }
18271
 
18272
      private final short _thriftId;
18273
      private final String _fieldName;
18274
 
18275
      _Fields(short thriftId, String fieldName) {
18276
        _thriftId = thriftId;
18277
        _fieldName = fieldName;
18278
      }
18279
 
18280
      public short getThriftFieldId() {
18281
        return _thriftId;
18282
      }
18283
 
18284
      public String getFieldName() {
18285
        return _fieldName;
18286
      }
18287
    }
18288
 
18289
    // isset id assignments
18290
 
18291
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
18292
    static {
18293
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
18294
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18295
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
18296
      metaDataMap = Collections.unmodifiableMap(tmpMap);
18297
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_result.class, metaDataMap);
18298
    }
18299
 
18300
    public assignVoucher_result() {
18301
    }
18302
 
18303
    public assignVoucher_result(
18304
      Voucher success)
18305
    {
18306
      this();
18307
      this.success = success;
18308
    }
18309
 
18310
    /**
18311
     * Performs a deep copy on <i>other</i>.
18312
     */
18313
    public assignVoucher_result(assignVoucher_result other) {
18314
      if (other.isSetSuccess()) {
18315
        this.success = new Voucher(other.success);
18316
      }
18317
    }
18318
 
18319
    public assignVoucher_result deepCopy() {
18320
      return new assignVoucher_result(this);
18321
    }
18322
 
18323
    @Override
18324
    public void clear() {
18325
      this.success = null;
18326
    }
18327
 
18328
    public Voucher getSuccess() {
18329
      return this.success;
18330
    }
18331
 
18332
    public void setSuccess(Voucher success) {
18333
      this.success = success;
18334
    }
18335
 
18336
    public void unsetSuccess() {
18337
      this.success = null;
18338
    }
18339
 
18340
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
18341
    public boolean isSetSuccess() {
18342
      return this.success != null;
18343
    }
18344
 
18345
    public void setSuccessIsSet(boolean value) {
18346
      if (!value) {
18347
        this.success = null;
18348
      }
18349
    }
18350
 
18351
    public void setFieldValue(_Fields field, Object value) {
18352
      switch (field) {
18353
      case SUCCESS:
18354
        if (value == null) {
18355
          unsetSuccess();
18356
        } else {
18357
          setSuccess((Voucher)value);
18358
        }
18359
        break;
18360
 
18361
      }
18362
    }
18363
 
18364
    public Object getFieldValue(_Fields field) {
18365
      switch (field) {
18366
      case SUCCESS:
18367
        return getSuccess();
18368
 
18369
      }
18370
      throw new IllegalStateException();
18371
    }
18372
 
18373
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
18374
    public boolean isSet(_Fields field) {
18375
      if (field == null) {
18376
        throw new IllegalArgumentException();
18377
      }
18378
 
18379
      switch (field) {
18380
      case SUCCESS:
18381
        return isSetSuccess();
18382
      }
18383
      throw new IllegalStateException();
18384
    }
18385
 
18386
    @Override
18387
    public boolean equals(Object that) {
18388
      if (that == null)
18389
        return false;
18390
      if (that instanceof assignVoucher_result)
18391
        return this.equals((assignVoucher_result)that);
18392
      return false;
18393
    }
18394
 
18395
    public boolean equals(assignVoucher_result that) {
18396
      if (that == null)
18397
        return false;
18398
 
18399
      boolean this_present_success = true && this.isSetSuccess();
18400
      boolean that_present_success = true && that.isSetSuccess();
18401
      if (this_present_success || that_present_success) {
18402
        if (!(this_present_success && that_present_success))
18403
          return false;
18404
        if (!this.success.equals(that.success))
18405
          return false;
18406
      }
18407
 
18408
      return true;
18409
    }
18410
 
18411
    @Override
18412
    public int hashCode() {
18413
      return 0;
18414
    }
18415
 
18416
    public int compareTo(assignVoucher_result other) {
18417
      if (!getClass().equals(other.getClass())) {
18418
        return getClass().getName().compareTo(other.getClass().getName());
18419
      }
18420
 
18421
      int lastComparison = 0;
18422
      assignVoucher_result typedOther = (assignVoucher_result)other;
18423
 
18424
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
18425
      if (lastComparison != 0) {
18426
        return lastComparison;
18427
      }
18428
      if (isSetSuccess()) {
18429
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
18430
        if (lastComparison != 0) {
18431
          return lastComparison;
18432
        }
18433
      }
18434
      return 0;
18435
    }
18436
 
18437
    public _Fields fieldForId(int fieldId) {
18438
      return _Fields.findByThriftId(fieldId);
18439
    }
18440
 
18441
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
18442
      org.apache.thrift.protocol.TField field;
18443
      iprot.readStructBegin();
18444
      while (true)
18445
      {
18446
        field = iprot.readFieldBegin();
18447
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
18448
          break;
18449
        }
18450
        switch (field.id) {
18451
          case 0: // SUCCESS
18452
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
18453
              this.success = new Voucher();
18454
              this.success.read(iprot);
18455
            } else { 
18456
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18457
            }
18458
            break;
18459
          default:
18460
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18461
        }
18462
        iprot.readFieldEnd();
18463
      }
18464
      iprot.readStructEnd();
18465
      validate();
18466
    }
18467
 
18468
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
18469
      oprot.writeStructBegin(STRUCT_DESC);
18470
 
18471
      if (this.isSetSuccess()) {
18472
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
18473
        this.success.write(oprot);
18474
        oprot.writeFieldEnd();
18475
      }
18476
      oprot.writeFieldStop();
18477
      oprot.writeStructEnd();
18478
    }
18479
 
18480
    @Override
18481
    public String toString() {
18482
      StringBuilder sb = new StringBuilder("assignVoucher_result(");
18483
      boolean first = true;
18484
 
18485
      sb.append("success:");
18486
      if (this.success == null) {
18487
        sb.append("null");
18488
      } else {
18489
        sb.append(this.success);
18490
      }
18491
      first = false;
18492
      sb.append(")");
18493
      return sb.toString();
18494
    }
18495
 
18496
    public void validate() throws org.apache.thrift.TException {
18497
      // check for required fields
18498
    }
18499
 
18500
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
18501
      try {
18502
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
18503
      } catch (org.apache.thrift.TException te) {
18504
        throw new java.io.IOException(te);
18505
      }
18506
    }
18507
 
18508
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
18509
      try {
18510
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
18511
      } catch (org.apache.thrift.TException te) {
18512
        throw new java.io.IOException(te);
18513
      }
18514
    }
18515
 
18516
  }
18517
 
18518
  public static class markVoucherAsRedeemed_args implements org.apache.thrift.TBase<markVoucherAsRedeemed_args, markVoucherAsRedeemed_args._Fields>, java.io.Serializable, Cloneable   {
18519
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_args");
18520
 
18521
    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);
18522
    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);
18523
 
18524
    private String voucherCode; // required
18525
    private long redeemedOn; // required
18526
 
18527
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
18528
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
18529
      VOUCHER_CODE((short)1, "voucherCode"),
18530
      REDEEMED_ON((short)2, "redeemedOn");
18531
 
18532
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
18533
 
18534
      static {
18535
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
18536
          byName.put(field.getFieldName(), field);
18537
        }
18538
      }
18539
 
18540
      /**
18541
       * Find the _Fields constant that matches fieldId, or null if its not found.
18542
       */
18543
      public static _Fields findByThriftId(int fieldId) {
18544
        switch(fieldId) {
18545
          case 1: // VOUCHER_CODE
18546
            return VOUCHER_CODE;
18547
          case 2: // REDEEMED_ON
18548
            return REDEEMED_ON;
18549
          default:
18550
            return null;
18551
        }
18552
      }
18553
 
18554
      /**
18555
       * Find the _Fields constant that matches fieldId, throwing an exception
18556
       * if it is not found.
18557
       */
18558
      public static _Fields findByThriftIdOrThrow(int fieldId) {
18559
        _Fields fields = findByThriftId(fieldId);
18560
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
18561
        return fields;
18562
      }
18563
 
18564
      /**
18565
       * Find the _Fields constant that matches name, or null if its not found.
18566
       */
18567
      public static _Fields findByName(String name) {
18568
        return byName.get(name);
18569
      }
18570
 
18571
      private final short _thriftId;
18572
      private final String _fieldName;
18573
 
18574
      _Fields(short thriftId, String fieldName) {
18575
        _thriftId = thriftId;
18576
        _fieldName = fieldName;
18577
      }
18578
 
18579
      public short getThriftFieldId() {
18580
        return _thriftId;
18581
      }
18582
 
18583
      public String getFieldName() {
18584
        return _fieldName;
18585
      }
18586
    }
18587
 
18588
    // isset id assignments
18589
    private static final int __REDEEMEDON_ISSET_ID = 0;
18590
    private BitSet __isset_bit_vector = new BitSet(1);
18591
 
18592
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
18593
    static {
18594
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
18595
      tmpMap.put(_Fields.VOUCHER_CODE, new org.apache.thrift.meta_data.FieldMetaData("voucherCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18596
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
18597
      tmpMap.put(_Fields.REDEEMED_ON, new org.apache.thrift.meta_data.FieldMetaData("redeemedOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18598
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
18599
      metaDataMap = Collections.unmodifiableMap(tmpMap);
18600
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_args.class, metaDataMap);
18601
    }
18602
 
18603
    public markVoucherAsRedeemed_args() {
18604
    }
18605
 
18606
    public markVoucherAsRedeemed_args(
18607
      String voucherCode,
18608
      long redeemedOn)
18609
    {
18610
      this();
18611
      this.voucherCode = voucherCode;
18612
      this.redeemedOn = redeemedOn;
18613
      setRedeemedOnIsSet(true);
18614
    }
18615
 
18616
    /**
18617
     * Performs a deep copy on <i>other</i>.
18618
     */
18619
    public markVoucherAsRedeemed_args(markVoucherAsRedeemed_args other) {
18620
      __isset_bit_vector.clear();
18621
      __isset_bit_vector.or(other.__isset_bit_vector);
18622
      if (other.isSetVoucherCode()) {
18623
        this.voucherCode = other.voucherCode;
18624
      }
18625
      this.redeemedOn = other.redeemedOn;
18626
    }
18627
 
18628
    public markVoucherAsRedeemed_args deepCopy() {
18629
      return new markVoucherAsRedeemed_args(this);
18630
    }
18631
 
18632
    @Override
18633
    public void clear() {
18634
      this.voucherCode = null;
18635
      setRedeemedOnIsSet(false);
18636
      this.redeemedOn = 0;
18637
    }
18638
 
18639
    public String getVoucherCode() {
18640
      return this.voucherCode;
18641
    }
18642
 
18643
    public void setVoucherCode(String voucherCode) {
18644
      this.voucherCode = voucherCode;
18645
    }
18646
 
18647
    public void unsetVoucherCode() {
18648
      this.voucherCode = null;
18649
    }
18650
 
18651
    /** Returns true if field voucherCode is set (has been assigned a value) and false otherwise */
18652
    public boolean isSetVoucherCode() {
18653
      return this.voucherCode != null;
18654
    }
18655
 
18656
    public void setVoucherCodeIsSet(boolean value) {
18657
      if (!value) {
18658
        this.voucherCode = null;
18659
      }
18660
    }
18661
 
18662
    public long getRedeemedOn() {
18663
      return this.redeemedOn;
18664
    }
18665
 
18666
    public void setRedeemedOn(long redeemedOn) {
18667
      this.redeemedOn = redeemedOn;
18668
      setRedeemedOnIsSet(true);
18669
    }
18670
 
18671
    public void unsetRedeemedOn() {
18672
      __isset_bit_vector.clear(__REDEEMEDON_ISSET_ID);
18673
    }
18674
 
18675
    /** Returns true if field redeemedOn is set (has been assigned a value) and false otherwise */
18676
    public boolean isSetRedeemedOn() {
18677
      return __isset_bit_vector.get(__REDEEMEDON_ISSET_ID);
18678
    }
18679
 
18680
    public void setRedeemedOnIsSet(boolean value) {
18681
      __isset_bit_vector.set(__REDEEMEDON_ISSET_ID, value);
18682
    }
18683
 
18684
    public void setFieldValue(_Fields field, Object value) {
18685
      switch (field) {
18686
      case VOUCHER_CODE:
18687
        if (value == null) {
18688
          unsetVoucherCode();
18689
        } else {
18690
          setVoucherCode((String)value);
18691
        }
18692
        break;
18693
 
18694
      case REDEEMED_ON:
18695
        if (value == null) {
18696
          unsetRedeemedOn();
18697
        } else {
18698
          setRedeemedOn((Long)value);
18699
        }
18700
        break;
18701
 
18702
      }
18703
    }
18704
 
18705
    public Object getFieldValue(_Fields field) {
18706
      switch (field) {
18707
      case VOUCHER_CODE:
18708
        return getVoucherCode();
18709
 
18710
      case REDEEMED_ON:
18711
        return Long.valueOf(getRedeemedOn());
18712
 
18713
      }
18714
      throw new IllegalStateException();
18715
    }
18716
 
18717
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
18718
    public boolean isSet(_Fields field) {
18719
      if (field == null) {
18720
        throw new IllegalArgumentException();
18721
      }
18722
 
18723
      switch (field) {
18724
      case VOUCHER_CODE:
18725
        return isSetVoucherCode();
18726
      case REDEEMED_ON:
18727
        return isSetRedeemedOn();
18728
      }
18729
      throw new IllegalStateException();
18730
    }
18731
 
18732
    @Override
18733
    public boolean equals(Object that) {
18734
      if (that == null)
18735
        return false;
18736
      if (that instanceof markVoucherAsRedeemed_args)
18737
        return this.equals((markVoucherAsRedeemed_args)that);
18738
      return false;
18739
    }
18740
 
18741
    public boolean equals(markVoucherAsRedeemed_args that) {
18742
      if (that == null)
18743
        return false;
18744
 
18745
      boolean this_present_voucherCode = true && this.isSetVoucherCode();
18746
      boolean that_present_voucherCode = true && that.isSetVoucherCode();
18747
      if (this_present_voucherCode || that_present_voucherCode) {
18748
        if (!(this_present_voucherCode && that_present_voucherCode))
18749
          return false;
18750
        if (!this.voucherCode.equals(that.voucherCode))
18751
          return false;
18752
      }
18753
 
18754
      boolean this_present_redeemedOn = true;
18755
      boolean that_present_redeemedOn = true;
18756
      if (this_present_redeemedOn || that_present_redeemedOn) {
18757
        if (!(this_present_redeemedOn && that_present_redeemedOn))
18758
          return false;
18759
        if (this.redeemedOn != that.redeemedOn)
18760
          return false;
18761
      }
18762
 
18763
      return true;
18764
    }
18765
 
18766
    @Override
18767
    public int hashCode() {
18768
      return 0;
18769
    }
18770
 
18771
    public int compareTo(markVoucherAsRedeemed_args other) {
18772
      if (!getClass().equals(other.getClass())) {
18773
        return getClass().getName().compareTo(other.getClass().getName());
18774
      }
18775
 
18776
      int lastComparison = 0;
18777
      markVoucherAsRedeemed_args typedOther = (markVoucherAsRedeemed_args)other;
18778
 
18779
      lastComparison = Boolean.valueOf(isSetVoucherCode()).compareTo(typedOther.isSetVoucherCode());
18780
      if (lastComparison != 0) {
18781
        return lastComparison;
18782
      }
18783
      if (isSetVoucherCode()) {
18784
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherCode, typedOther.voucherCode);
18785
        if (lastComparison != 0) {
18786
          return lastComparison;
18787
        }
18788
      }
18789
      lastComparison = Boolean.valueOf(isSetRedeemedOn()).compareTo(typedOther.isSetRedeemedOn());
18790
      if (lastComparison != 0) {
18791
        return lastComparison;
18792
      }
18793
      if (isSetRedeemedOn()) {
18794
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.redeemedOn, typedOther.redeemedOn);
18795
        if (lastComparison != 0) {
18796
          return lastComparison;
18797
        }
18798
      }
18799
      return 0;
18800
    }
18801
 
18802
    public _Fields fieldForId(int fieldId) {
18803
      return _Fields.findByThriftId(fieldId);
18804
    }
18805
 
18806
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
18807
      org.apache.thrift.protocol.TField field;
18808
      iprot.readStructBegin();
18809
      while (true)
18810
      {
18811
        field = iprot.readFieldBegin();
18812
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
18813
          break;
18814
        }
18815
        switch (field.id) {
18816
          case 1: // VOUCHER_CODE
18817
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
18818
              this.voucherCode = iprot.readString();
18819
            } else { 
18820
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18821
            }
18822
            break;
18823
          case 2: // REDEEMED_ON
18824
            if (field.type == org.apache.thrift.protocol.TType.I64) {
18825
              this.redeemedOn = iprot.readI64();
18826
              setRedeemedOnIsSet(true);
18827
            } else { 
18828
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18829
            }
18830
            break;
18831
          default:
18832
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18833
        }
18834
        iprot.readFieldEnd();
18835
      }
18836
      iprot.readStructEnd();
18837
      validate();
18838
    }
18839
 
18840
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
18841
      validate();
18842
 
18843
      oprot.writeStructBegin(STRUCT_DESC);
18844
      if (this.voucherCode != null) {
18845
        oprot.writeFieldBegin(VOUCHER_CODE_FIELD_DESC);
18846
        oprot.writeString(this.voucherCode);
18847
        oprot.writeFieldEnd();
18848
      }
18849
      oprot.writeFieldBegin(REDEEMED_ON_FIELD_DESC);
18850
      oprot.writeI64(this.redeemedOn);
18851
      oprot.writeFieldEnd();
18852
      oprot.writeFieldStop();
18853
      oprot.writeStructEnd();
18854
    }
18855
 
18856
    @Override
18857
    public String toString() {
18858
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_args(");
18859
      boolean first = true;
18860
 
18861
      sb.append("voucherCode:");
18862
      if (this.voucherCode == null) {
18863
        sb.append("null");
18864
      } else {
18865
        sb.append(this.voucherCode);
18866
      }
18867
      first = false;
18868
      if (!first) sb.append(", ");
18869
      sb.append("redeemedOn:");
18870
      sb.append(this.redeemedOn);
18871
      first = false;
18872
      sb.append(")");
18873
      return sb.toString();
18874
    }
18875
 
18876
    public void validate() throws org.apache.thrift.TException {
18877
      // check for required fields
18878
    }
18879
 
18880
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
18881
      try {
18882
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
18883
      } catch (org.apache.thrift.TException te) {
18884
        throw new java.io.IOException(te);
18885
      }
18886
    }
18887
 
18888
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
18889
      try {
18890
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
18891
        __isset_bit_vector = new BitSet(1);
18892
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
18893
      } catch (org.apache.thrift.TException te) {
18894
        throw new java.io.IOException(te);
18895
      }
18896
    }
18897
 
18898
  }
18899
 
18900
  public static class markVoucherAsRedeemed_result implements org.apache.thrift.TBase<markVoucherAsRedeemed_result, markVoucherAsRedeemed_result._Fields>, java.io.Serializable, Cloneable   {
18901
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_result");
18902
 
18903
    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);
18904
 
18905
    private boolean success; // required
18906
 
18907
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
18908
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
18909
      SUCCESS((short)0, "success");
18910
 
18911
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
18912
 
18913
      static {
18914
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
18915
          byName.put(field.getFieldName(), field);
18916
        }
18917
      }
18918
 
18919
      /**
18920
       * Find the _Fields constant that matches fieldId, or null if its not found.
18921
       */
18922
      public static _Fields findByThriftId(int fieldId) {
18923
        switch(fieldId) {
18924
          case 0: // SUCCESS
18925
            return SUCCESS;
18926
          default:
18927
            return null;
18928
        }
18929
      }
18930
 
18931
      /**
18932
       * Find the _Fields constant that matches fieldId, throwing an exception
18933
       * if it is not found.
18934
       */
18935
      public static _Fields findByThriftIdOrThrow(int fieldId) {
18936
        _Fields fields = findByThriftId(fieldId);
18937
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
18938
        return fields;
18939
      }
18940
 
18941
      /**
18942
       * Find the _Fields constant that matches name, or null if its not found.
18943
       */
18944
      public static _Fields findByName(String name) {
18945
        return byName.get(name);
18946
      }
18947
 
18948
      private final short _thriftId;
18949
      private final String _fieldName;
18950
 
18951
      _Fields(short thriftId, String fieldName) {
18952
        _thriftId = thriftId;
18953
        _fieldName = fieldName;
18954
      }
18955
 
18956
      public short getThriftFieldId() {
18957
        return _thriftId;
18958
      }
18959
 
18960
      public String getFieldName() {
18961
        return _fieldName;
18962
      }
18963
    }
18964
 
18965
    // isset id assignments
18966
    private static final int __SUCCESS_ISSET_ID = 0;
18967
    private BitSet __isset_bit_vector = new BitSet(1);
18968
 
18969
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
18970
    static {
18971
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
18972
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18973
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
18974
      metaDataMap = Collections.unmodifiableMap(tmpMap);
18975
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_result.class, metaDataMap);
18976
    }
18977
 
18978
    public markVoucherAsRedeemed_result() {
18979
    }
18980
 
18981
    public markVoucherAsRedeemed_result(
18982
      boolean success)
18983
    {
18984
      this();
18985
      this.success = success;
18986
      setSuccessIsSet(true);
18987
    }
18988
 
18989
    /**
18990
     * Performs a deep copy on <i>other</i>.
18991
     */
18992
    public markVoucherAsRedeemed_result(markVoucherAsRedeemed_result other) {
18993
      __isset_bit_vector.clear();
18994
      __isset_bit_vector.or(other.__isset_bit_vector);
18995
      this.success = other.success;
18996
    }
18997
 
18998
    public markVoucherAsRedeemed_result deepCopy() {
18999
      return new markVoucherAsRedeemed_result(this);
19000
    }
19001
 
19002
    @Override
19003
    public void clear() {
19004
      setSuccessIsSet(false);
19005
      this.success = false;
19006
    }
19007
 
19008
    public boolean isSuccess() {
19009
      return this.success;
19010
    }
19011
 
19012
    public void setSuccess(boolean success) {
19013
      this.success = success;
19014
      setSuccessIsSet(true);
19015
    }
19016
 
19017
    public void unsetSuccess() {
19018
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
19019
    }
19020
 
19021
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
19022
    public boolean isSetSuccess() {
19023
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
19024
    }
19025
 
19026
    public void setSuccessIsSet(boolean value) {
19027
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
19028
    }
19029
 
19030
    public void setFieldValue(_Fields field, Object value) {
19031
      switch (field) {
19032
      case SUCCESS:
19033
        if (value == null) {
19034
          unsetSuccess();
19035
        } else {
19036
          setSuccess((Boolean)value);
19037
        }
19038
        break;
19039
 
19040
      }
19041
    }
19042
 
19043
    public Object getFieldValue(_Fields field) {
19044
      switch (field) {
19045
      case SUCCESS:
19046
        return Boolean.valueOf(isSuccess());
19047
 
19048
      }
19049
      throw new IllegalStateException();
19050
    }
19051
 
19052
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
19053
    public boolean isSet(_Fields field) {
19054
      if (field == null) {
19055
        throw new IllegalArgumentException();
19056
      }
19057
 
19058
      switch (field) {
19059
      case SUCCESS:
19060
        return isSetSuccess();
19061
      }
19062
      throw new IllegalStateException();
19063
    }
19064
 
19065
    @Override
19066
    public boolean equals(Object that) {
19067
      if (that == null)
19068
        return false;
19069
      if (that instanceof markVoucherAsRedeemed_result)
19070
        return this.equals((markVoucherAsRedeemed_result)that);
19071
      return false;
19072
    }
19073
 
19074
    public boolean equals(markVoucherAsRedeemed_result that) {
19075
      if (that == null)
19076
        return false;
19077
 
19078
      boolean this_present_success = true;
19079
      boolean that_present_success = true;
19080
      if (this_present_success || that_present_success) {
19081
        if (!(this_present_success && that_present_success))
19082
          return false;
19083
        if (this.success != that.success)
19084
          return false;
19085
      }
19086
 
19087
      return true;
19088
    }
19089
 
19090
    @Override
19091
    public int hashCode() {
19092
      return 0;
19093
    }
19094
 
19095
    public int compareTo(markVoucherAsRedeemed_result other) {
19096
      if (!getClass().equals(other.getClass())) {
19097
        return getClass().getName().compareTo(other.getClass().getName());
19098
      }
19099
 
19100
      int lastComparison = 0;
19101
      markVoucherAsRedeemed_result typedOther = (markVoucherAsRedeemed_result)other;
19102
 
19103
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
19104
      if (lastComparison != 0) {
19105
        return lastComparison;
19106
      }
19107
      if (isSetSuccess()) {
19108
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
19109
        if (lastComparison != 0) {
19110
          return lastComparison;
19111
        }
19112
      }
19113
      return 0;
19114
    }
19115
 
19116
    public _Fields fieldForId(int fieldId) {
19117
      return _Fields.findByThriftId(fieldId);
19118
    }
19119
 
19120
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
19121
      org.apache.thrift.protocol.TField field;
19122
      iprot.readStructBegin();
19123
      while (true)
19124
      {
19125
        field = iprot.readFieldBegin();
19126
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
19127
          break;
19128
        }
19129
        switch (field.id) {
19130
          case 0: // SUCCESS
19131
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
19132
              this.success = iprot.readBool();
19133
              setSuccessIsSet(true);
19134
            } else { 
19135
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19136
            }
19137
            break;
19138
          default:
19139
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19140
        }
19141
        iprot.readFieldEnd();
19142
      }
19143
      iprot.readStructEnd();
19144
      validate();
19145
    }
19146
 
19147
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
19148
      oprot.writeStructBegin(STRUCT_DESC);
19149
 
19150
      if (this.isSetSuccess()) {
19151
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
19152
        oprot.writeBool(this.success);
19153
        oprot.writeFieldEnd();
19154
      }
19155
      oprot.writeFieldStop();
19156
      oprot.writeStructEnd();
19157
    }
19158
 
19159
    @Override
19160
    public String toString() {
19161
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_result(");
19162
      boolean first = true;
19163
 
19164
      sb.append("success:");
19165
      sb.append(this.success);
19166
      first = false;
19167
      sb.append(")");
19168
      return sb.toString();
19169
    }
19170
 
19171
    public void validate() throws org.apache.thrift.TException {
19172
      // check for required fields
19173
    }
19174
 
19175
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
19176
      try {
19177
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
19178
      } catch (org.apache.thrift.TException te) {
19179
        throw new java.io.IOException(te);
19180
      }
19181
    }
19182
 
19183
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
19184
      try {
19185
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
19186
      } catch (org.apache.thrift.TException te) {
19187
        throw new java.io.IOException(te);
19188
      }
19189
    }
19190
 
19191
  }
19192
 
1982 varun.gupt 19193
}