Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
1982 varun.gupt 1
/**
3430 rajveer 2
 * Autogenerated by Thrift Compiler (0.7.0)
1982 varun.gupt 3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.model.v1.user;
7
 
8
import java.util.List;
9
import java.util.ArrayList;
10
import java.util.Map;
11
import java.util.HashMap;
12
import java.util.EnumMap;
13
import java.util.Set;
14
import java.util.HashSet;
15
import java.util.EnumSet;
16
import java.util.Collections;
17
import java.util.BitSet;
3430 rajveer 18
import java.nio.ByteBuffer;
1982 varun.gupt 19
import java.util.Arrays;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22
 
23
public class PromotionService {
24
 
25
  /**
26
   * Promotion Service
27
   */
3374 rajveer 28
  public interface Iface extends in.shop2020.generic.GenericService.Iface {
1982 varun.gupt 29
 
3430 rajveer 30
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 31
 
7746 amit.gupta 32
    public long removeAllCouponsByPromotionId(long promotionId) throws PromotionException, org.apache.thrift.TException;
33
 
6301 amit.gupta 34
    public Coupon getCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
35
 
36
    public boolean isGiftVoucher(String couponCode) throws PromotionException, org.apache.thrift.TException;
37
 
6356 amit.gupta 38
    public boolean isCodApplicable(String couponCode) throws PromotionException, org.apache.thrift.TException;
39
 
3430 rajveer 40
    public List<Promotion> getAllPromotions() throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 41
 
3430 rajveer 42
    public Promotion getPromotionById(long promotionId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 43
 
3430 rajveer 44
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 45
 
3430 rajveer 46
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 47
 
6736 amit.gupta 48
    public Map<Long,Double> getEmiDiscount(long cartId) throws PromotionException, org.apache.thrift.TException;
49
 
6433 anupam.sin 50
    public Map<Long,String> applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws PromotionException, org.apache.thrift.TException;
51
 
3430 rajveer 52
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 53
 
3430 rajveer 54
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException;
1982 varun.gupt 55
 
6497 amit.gupta 56
    public List<Coupon> getActiveCodes(long promotionId) throws PromotionException, org.apache.thrift.TException;
57
 
58
    public void deleteCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
59
 
7092 amit.gupta 60
    public List<Coupon> getAllCouponsByPromotionId(long promotionId) throws PromotionException, org.apache.thrift.TException;
61
 
3385 varun.gupt 62
    /**
63
     * Returns a list of active coupons
64
     */
3430 rajveer 65
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException;
3385 varun.gupt 66
 
67
    /**
6561 amit.gupta 68
     * Creates a coupon with prefix (optional, pass null)and returns couponcode if successfully created.
6250 amit.gupta 69
     * 
70
     * @param promotionId
6730 anupam.sin 71
     * @param couponCode
6679 anupam.sin 72
     * @param arguments
6356 amit.gupta 73
     * @param isCod
6561 amit.gupta 74
     * @param prefix
6250 amit.gupta 75
     */
6730 anupam.sin 76
    public String createCoupon(long promotionId, String couponCode, String arguments, boolean isCod, String prefix) throws PromotionException, org.apache.thrift.TException;
6250 amit.gupta 77
 
78
    /**
3385 varun.gupt 79
     * Returns the count of successful payments done using a given coupon
80
     * 
81
     * @param couponCode
82
     */
3430 rajveer 83
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException;
3385 varun.gupt 84
 
85
    /**
86
     * Returns the doc string of the rule module
87
     * 
88
     * @param ruleName
89
     */
3430 rajveer 90
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException;
3385 varun.gupt 91
 
4189 varun.gupt 92
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException;
93
 
4494 varun.gupt 94
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException;
95
 
5469 rajveer 96
    public void addVoucher(Voucher voucher) throws org.apache.thrift.TException;
97
 
98
    public Voucher assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException;
99
 
100
    public boolean markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException;
101
 
1982 varun.gupt 102
  }
103
 
3430 rajveer 104
  public interface AsyncIface extends in.shop2020.generic.GenericService .AsyncIface {
1982 varun.gupt 105
 
3430 rajveer 106
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.createPromotion_call> resultHandler) throws org.apache.thrift.TException;
1982 varun.gupt 107
 
7746 amit.gupta 108
    public void removeAllCouponsByPromotionId(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.removeAllCouponsByPromotionId_call> resultHandler) throws org.apache.thrift.TException;
109
 
6301 amit.gupta 110
    public void getCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCoupon_call> resultHandler) throws org.apache.thrift.TException;
111
 
112
    public void isGiftVoucher(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.isGiftVoucher_call> resultHandler) throws org.apache.thrift.TException;
113
 
6356 amit.gupta 114
    public void isCodApplicable(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.isCodApplicable_call> resultHandler) throws org.apache.thrift.TException;
115
 
3430 rajveer 116
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllPromotions_call> resultHandler) throws org.apache.thrift.TException;
117
 
118
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getPromotionById_call> resultHandler) throws org.apache.thrift.TException;
119
 
120
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException;
121
 
122
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyCoupon_call> resultHandler) throws org.apache.thrift.TException;
123
 
6736 amit.gupta 124
    public void getEmiDiscount(long cartId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getEmiDiscount_call> resultHandler) throws org.apache.thrift.TException;
125
 
6433 anupam.sin 126
    public void applyRechargeCoupon(String couponCode, long totalAmount, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.applyRechargeCoupon_call> resultHandler) throws org.apache.thrift.TException;
127
 
3430 rajveer 128
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException;
129
 
130
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException;
131
 
6497 amit.gupta 132
    public void getActiveCodes(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getActiveCodes_call> resultHandler) throws org.apache.thrift.TException;
133
 
134
    public void deleteCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.deleteCoupon_call> resultHandler) throws org.apache.thrift.TException;
135
 
7092 amit.gupta 136
    public void getAllCouponsByPromotionId(long promotionId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAllCouponsByPromotionId_call> resultHandler) throws org.apache.thrift.TException;
137
 
3430 rajveer 138
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException;
139
 
6730 anupam.sin 140
    public void createCoupon(long promotionId, String couponCode, String arguments, boolean isCod, String prefix, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.createCoupon_call> resultHandler) throws org.apache.thrift.TException;
6250 amit.gupta 141
 
3430 rajveer 142
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException;
143
 
144
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getRuleDocString_call> resultHandler) throws org.apache.thrift.TException;
145
 
4189 varun.gupt 146
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException;
147
 
4494 varun.gupt 148
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException;
149
 
5469 rajveer 150
    public void addVoucher(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.addVoucher_call> resultHandler) throws org.apache.thrift.TException;
151
 
152
    public void assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.assignVoucher_call> resultHandler) throws org.apache.thrift.TException;
153
 
154
    public void markVoucherAsRedeemed(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.markVoucherAsRedeemed_call> resultHandler) throws org.apache.thrift.TException;
155
 
3430 rajveer 156
  }
157
 
158
  public static class Client extends in.shop2020.generic.GenericService.Client implements Iface {
159
    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
160
      public Factory() {}
161
      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
162
        return new Client(prot);
163
      }
164
      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
165
        return new Client(iprot, oprot);
166
      }
1982 varun.gupt 167
    }
168
 
3430 rajveer 169
    public Client(org.apache.thrift.protocol.TProtocol prot)
1982 varun.gupt 170
    {
3430 rajveer 171
      super(prot, prot);
1982 varun.gupt 172
    }
173
 
3430 rajveer 174
    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
175
      super(iprot, oprot);
1982 varun.gupt 176
    }
177
 
3430 rajveer 178
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 179
    {
180
      send_createPromotion(name, ruleExecutionSrc, startOn, endOn);
181
      recv_createPromotion();
182
    }
183
 
3430 rajveer 184
    public void send_createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn) throws org.apache.thrift.TException
1982 varun.gupt 185
    {
186
      createPromotion_args args = new createPromotion_args();
3430 rajveer 187
      args.setName(name);
188
      args.setRuleExecutionSrc(ruleExecutionSrc);
189
      args.setStartOn(startOn);
190
      args.setEndOn(endOn);
191
      sendBase("createPromotion", args);
1982 varun.gupt 192
    }
193
 
3430 rajveer 194
    public void recv_createPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 195
    {
196
      createPromotion_result result = new createPromotion_result();
3430 rajveer 197
      receiveBase(result, "createPromotion");
1982 varun.gupt 198
      if (result.pex != null) {
199
        throw result.pex;
200
      }
201
      return;
202
    }
203
 
7746 amit.gupta 204
    public long removeAllCouponsByPromotionId(long promotionId) throws PromotionException, org.apache.thrift.TException
205
    {
206
      send_removeAllCouponsByPromotionId(promotionId);
207
      return recv_removeAllCouponsByPromotionId();
208
    }
209
 
210
    public void send_removeAllCouponsByPromotionId(long promotionId) throws org.apache.thrift.TException
211
    {
212
      removeAllCouponsByPromotionId_args args = new removeAllCouponsByPromotionId_args();
213
      args.setPromotionId(promotionId);
214
      sendBase("removeAllCouponsByPromotionId", args);
215
    }
216
 
217
    public long recv_removeAllCouponsByPromotionId() throws PromotionException, org.apache.thrift.TException
218
    {
219
      removeAllCouponsByPromotionId_result result = new removeAllCouponsByPromotionId_result();
220
      receiveBase(result, "removeAllCouponsByPromotionId");
221
      if (result.isSetSuccess()) {
222
        return result.success;
223
      }
224
      if (result.pex != null) {
225
        throw result.pex;
226
      }
227
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "removeAllCouponsByPromotionId failed: unknown result");
228
    }
229
 
6301 amit.gupta 230
    public Coupon getCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
231
    {
232
      send_getCoupon(couponCode);
233
      return recv_getCoupon();
234
    }
235
 
236
    public void send_getCoupon(String couponCode) throws org.apache.thrift.TException
237
    {
238
      getCoupon_args args = new getCoupon_args();
239
      args.setCouponCode(couponCode);
240
      sendBase("getCoupon", args);
241
    }
242
 
243
    public Coupon recv_getCoupon() throws PromotionException, org.apache.thrift.TException
244
    {
245
      getCoupon_result result = new getCoupon_result();
246
      receiveBase(result, "getCoupon");
247
      if (result.isSetSuccess()) {
248
        return result.success;
249
      }
250
      if (result.pex != null) {
251
        throw result.pex;
252
      }
253
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCoupon failed: unknown result");
254
    }
255
 
256
    public boolean isGiftVoucher(String couponCode) throws PromotionException, org.apache.thrift.TException
257
    {
258
      send_isGiftVoucher(couponCode);
259
      return recv_isGiftVoucher();
260
    }
261
 
262
    public void send_isGiftVoucher(String couponCode) throws org.apache.thrift.TException
263
    {
264
      isGiftVoucher_args args = new isGiftVoucher_args();
265
      args.setCouponCode(couponCode);
266
      sendBase("isGiftVoucher", args);
267
    }
268
 
269
    public boolean recv_isGiftVoucher() throws PromotionException, org.apache.thrift.TException
270
    {
271
      isGiftVoucher_result result = new isGiftVoucher_result();
272
      receiveBase(result, "isGiftVoucher");
273
      if (result.isSetSuccess()) {
274
        return result.success;
275
      }
276
      if (result.pex != null) {
277
        throw result.pex;
278
      }
279
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isGiftVoucher failed: unknown result");
280
    }
281
 
6356 amit.gupta 282
    public boolean isCodApplicable(String couponCode) throws PromotionException, org.apache.thrift.TException
283
    {
284
      send_isCodApplicable(couponCode);
285
      return recv_isCodApplicable();
286
    }
287
 
288
    public void send_isCodApplicable(String couponCode) throws org.apache.thrift.TException
289
    {
290
      isCodApplicable_args args = new isCodApplicable_args();
291
      args.setCouponCode(couponCode);
292
      sendBase("isCodApplicable", args);
293
    }
294
 
295
    public boolean recv_isCodApplicable() throws PromotionException, org.apache.thrift.TException
296
    {
297
      isCodApplicable_result result = new isCodApplicable_result();
298
      receiveBase(result, "isCodApplicable");
299
      if (result.isSetSuccess()) {
300
        return result.success;
301
      }
302
      if (result.pex != null) {
303
        throw result.pex;
304
      }
305
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isCodApplicable failed: unknown result");
306
    }
307
 
3430 rajveer 308
    public List<Promotion> getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 309
    {
310
      send_getAllPromotions();
311
      return recv_getAllPromotions();
312
    }
313
 
3430 rajveer 314
    public void send_getAllPromotions() throws org.apache.thrift.TException
1982 varun.gupt 315
    {
316
      getAllPromotions_args args = new getAllPromotions_args();
3430 rajveer 317
      sendBase("getAllPromotions", args);
1982 varun.gupt 318
    }
319
 
3430 rajveer 320
    public List<Promotion> recv_getAllPromotions() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 321
    {
322
      getAllPromotions_result result = new getAllPromotions_result();
3430 rajveer 323
      receiveBase(result, "getAllPromotions");
1982 varun.gupt 324
      if (result.isSetSuccess()) {
325
        return result.success;
326
      }
327
      if (result.pex != null) {
328
        throw result.pex;
329
      }
3430 rajveer 330
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllPromotions failed: unknown result");
1982 varun.gupt 331
    }
332
 
3430 rajveer 333
    public Promotion getPromotionById(long promotionId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 334
    {
335
      send_getPromotionById(promotionId);
336
      return recv_getPromotionById();
337
    }
338
 
3430 rajveer 339
    public void send_getPromotionById(long promotionId) throws org.apache.thrift.TException
1982 varun.gupt 340
    {
341
      getPromotionById_args args = new getPromotionById_args();
3430 rajveer 342
      args.setPromotionId(promotionId);
343
      sendBase("getPromotionById", args);
1982 varun.gupt 344
    }
345
 
3430 rajveer 346
    public Promotion recv_getPromotionById() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 347
    {
348
      getPromotionById_result result = new getPromotionById_result();
3430 rajveer 349
      receiveBase(result, "getPromotionById");
1982 varun.gupt 350
      if (result.isSetSuccess()) {
351
        return result.success;
352
      }
353
      if (result.pex != null) {
354
        throw result.pex;
355
      }
3430 rajveer 356
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPromotionById failed: unknown result");
1982 varun.gupt 357
    }
358
 
3430 rajveer 359
    public void generateCouponsForPromotion(long promotionId, String couponCode) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 360
    {
361
      send_generateCouponsForPromotion(promotionId, couponCode);
362
      recv_generateCouponsForPromotion();
363
    }
364
 
3430 rajveer 365
    public void send_generateCouponsForPromotion(long promotionId, String couponCode) throws org.apache.thrift.TException
1982 varun.gupt 366
    {
367
      generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
3430 rajveer 368
      args.setPromotionId(promotionId);
369
      args.setCouponCode(couponCode);
370
      sendBase("generateCouponsForPromotion", args);
1982 varun.gupt 371
    }
372
 
3430 rajveer 373
    public void recv_generateCouponsForPromotion() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 374
    {
375
      generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
3430 rajveer 376
      receiveBase(result, "generateCouponsForPromotion");
1982 varun.gupt 377
      if (result.pex != null) {
378
        throw result.pex;
379
      }
380
      return;
381
    }
382
 
3430 rajveer 383
    public Cart applyCoupon(String couponCode, long cartId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 384
    {
385
      send_applyCoupon(couponCode, cartId);
386
      return recv_applyCoupon();
387
    }
388
 
3430 rajveer 389
    public void send_applyCoupon(String couponCode, long cartId) throws org.apache.thrift.TException
1982 varun.gupt 390
    {
391
      applyCoupon_args args = new applyCoupon_args();
3430 rajveer 392
      args.setCouponCode(couponCode);
393
      args.setCartId(cartId);
394
      sendBase("applyCoupon", args);
1982 varun.gupt 395
    }
396
 
3430 rajveer 397
    public Cart recv_applyCoupon() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 398
    {
399
      applyCoupon_result result = new applyCoupon_result();
3430 rajveer 400
      receiveBase(result, "applyCoupon");
1982 varun.gupt 401
      if (result.isSetSuccess()) {
402
        return result.success;
403
      }
404
      if (result.pex != null) {
405
        throw result.pex;
406
      }
3430 rajveer 407
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "applyCoupon failed: unknown result");
1982 varun.gupt 408
    }
409
 
6736 amit.gupta 410
    public Map<Long,Double> getEmiDiscount(long cartId) throws PromotionException, org.apache.thrift.TException
411
    {
412
      send_getEmiDiscount(cartId);
413
      return recv_getEmiDiscount();
414
    }
415
 
416
    public void send_getEmiDiscount(long cartId) throws org.apache.thrift.TException
417
    {
418
      getEmiDiscount_args args = new getEmiDiscount_args();
419
      args.setCartId(cartId);
420
      sendBase("getEmiDiscount", args);
421
    }
422
 
423
    public Map<Long,Double> recv_getEmiDiscount() throws PromotionException, org.apache.thrift.TException
424
    {
425
      getEmiDiscount_result result = new getEmiDiscount_result();
426
      receiveBase(result, "getEmiDiscount");
427
      if (result.isSetSuccess()) {
428
        return result.success;
429
      }
430
      if (result.pex != null) {
431
        throw result.pex;
432
      }
433
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getEmiDiscount failed: unknown result");
434
    }
435
 
6433 anupam.sin 436
    public Map<Long,String> applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws PromotionException, org.apache.thrift.TException
437
    {
438
      send_applyRechargeCoupon(couponCode, totalAmount, userId);
439
      return recv_applyRechargeCoupon();
440
    }
441
 
442
    public void send_applyRechargeCoupon(String couponCode, long totalAmount, long userId) throws org.apache.thrift.TException
443
    {
444
      applyRechargeCoupon_args args = new applyRechargeCoupon_args();
445
      args.setCouponCode(couponCode);
446
      args.setTotalAmount(totalAmount);
447
      args.setUserId(userId);
448
      sendBase("applyRechargeCoupon", args);
449
    }
450
 
451
    public Map<Long,String> recv_applyRechargeCoupon() throws PromotionException, org.apache.thrift.TException
452
    {
453
      applyRechargeCoupon_result result = new applyRechargeCoupon_result();
454
      receiveBase(result, "applyRechargeCoupon");
455
      if (result.isSetSuccess()) {
456
        return result.success;
457
      }
458
      if (result.pex != null) {
459
        throw result.pex;
460
      }
461
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "applyRechargeCoupon failed: unknown result");
462
    }
463
 
3430 rajveer 464
    public void trackCouponUsage(String couponCode, long transactionId, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 465
    {
466
      send_trackCouponUsage(couponCode, transactionId, userId);
467
      recv_trackCouponUsage();
468
    }
469
 
3430 rajveer 470
    public void send_trackCouponUsage(String couponCode, long transactionId, long userId) throws org.apache.thrift.TException
1982 varun.gupt 471
    {
472
      trackCouponUsage_args args = new trackCouponUsage_args();
3430 rajveer 473
      args.setCouponCode(couponCode);
474
      args.setTransactionId(transactionId);
475
      args.setUserId(userId);
476
      sendBase("trackCouponUsage", args);
1982 varun.gupt 477
    }
478
 
3430 rajveer 479
    public void recv_trackCouponUsage() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 480
    {
481
      trackCouponUsage_result result = new trackCouponUsage_result();
3430 rajveer 482
      receiveBase(result, "trackCouponUsage");
1982 varun.gupt 483
      if (result.pex != null) {
484
        throw result.pex;
485
      }
486
      return;
487
    }
488
 
3430 rajveer 489
    public long getCouponUsageCountByUser(String couponCode, long userId) throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 490
    {
491
      send_getCouponUsageCountByUser(couponCode, userId);
492
      return recv_getCouponUsageCountByUser();
493
    }
494
 
3430 rajveer 495
    public void send_getCouponUsageCountByUser(String couponCode, long userId) throws org.apache.thrift.TException
1982 varun.gupt 496
    {
497
      getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
3430 rajveer 498
      args.setCouponCode(couponCode);
499
      args.setUserId(userId);
500
      sendBase("getCouponUsageCountByUser", args);
1982 varun.gupt 501
    }
502
 
3430 rajveer 503
    public long recv_getCouponUsageCountByUser() throws PromotionException, org.apache.thrift.TException
1982 varun.gupt 504
    {
505
      getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
3430 rajveer 506
      receiveBase(result, "getCouponUsageCountByUser");
1982 varun.gupt 507
      if (result.isSetSuccess()) {
508
        return result.success;
509
      }
510
      if (result.pex != null) {
511
        throw result.pex;
512
      }
3430 rajveer 513
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getCouponUsageCountByUser failed: unknown result");
1982 varun.gupt 514
    }
515
 
6497 amit.gupta 516
    public List<Coupon> getActiveCodes(long promotionId) throws PromotionException, org.apache.thrift.TException
517
    {
518
      send_getActiveCodes(promotionId);
519
      return recv_getActiveCodes();
520
    }
521
 
522
    public void send_getActiveCodes(long promotionId) throws org.apache.thrift.TException
523
    {
524
      getActiveCodes_args args = new getActiveCodes_args();
525
      args.setPromotionId(promotionId);
526
      sendBase("getActiveCodes", args);
527
    }
528
 
529
    public List<Coupon> recv_getActiveCodes() throws PromotionException, org.apache.thrift.TException
530
    {
531
      getActiveCodes_result result = new getActiveCodes_result();
532
      receiveBase(result, "getActiveCodes");
533
      if (result.isSetSuccess()) {
534
        return result.success;
535
      }
536
      if (result.pex != null) {
537
        throw result.pex;
538
      }
539
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getActiveCodes failed: unknown result");
540
    }
541
 
542
    public void deleteCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
543
    {
544
      send_deleteCoupon(couponCode);
545
      recv_deleteCoupon();
546
    }
547
 
548
    public void send_deleteCoupon(String couponCode) throws org.apache.thrift.TException
549
    {
550
      deleteCoupon_args args = new deleteCoupon_args();
551
      args.setCouponCode(couponCode);
552
      sendBase("deleteCoupon", args);
553
    }
554
 
555
    public void recv_deleteCoupon() throws PromotionException, org.apache.thrift.TException
556
    {
557
      deleteCoupon_result result = new deleteCoupon_result();
558
      receiveBase(result, "deleteCoupon");
559
      if (result.pex != null) {
560
        throw result.pex;
561
      }
562
      return;
563
    }
564
 
7092 amit.gupta 565
    public List<Coupon> getAllCouponsByPromotionId(long promotionId) throws PromotionException, org.apache.thrift.TException
566
    {
567
      send_getAllCouponsByPromotionId(promotionId);
568
      return recv_getAllCouponsByPromotionId();
569
    }
570
 
571
    public void send_getAllCouponsByPromotionId(long promotionId) throws org.apache.thrift.TException
572
    {
573
      getAllCouponsByPromotionId_args args = new getAllCouponsByPromotionId_args();
574
      args.setPromotionId(promotionId);
575
      sendBase("getAllCouponsByPromotionId", args);
576
    }
577
 
578
    public List<Coupon> recv_getAllCouponsByPromotionId() throws PromotionException, org.apache.thrift.TException
579
    {
580
      getAllCouponsByPromotionId_result result = new getAllCouponsByPromotionId_result();
581
      receiveBase(result, "getAllCouponsByPromotionId");
582
      if (result.isSetSuccess()) {
583
        return result.success;
584
      }
585
      if (result.pex != null) {
586
        throw result.pex;
587
      }
588
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllCouponsByPromotionId failed: unknown result");
589
    }
590
 
3430 rajveer 591
    public List<Coupon> getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 592
    {
593
      send_getActiveCoupons();
594
      return recv_getActiveCoupons();
595
    }
596
 
3430 rajveer 597
    public void send_getActiveCoupons() throws org.apache.thrift.TException
3385 varun.gupt 598
    {
599
      getActiveCoupons_args args = new getActiveCoupons_args();
3430 rajveer 600
      sendBase("getActiveCoupons", args);
3385 varun.gupt 601
    }
602
 
3430 rajveer 603
    public List<Coupon> recv_getActiveCoupons() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 604
    {
605
      getActiveCoupons_result result = new getActiveCoupons_result();
3430 rajveer 606
      receiveBase(result, "getActiveCoupons");
3385 varun.gupt 607
      if (result.isSetSuccess()) {
608
        return result.success;
609
      }
610
      if (result.pex != null) {
611
        throw result.pex;
612
      }
3430 rajveer 613
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getActiveCoupons failed: unknown result");
3385 varun.gupt 614
    }
615
 
6730 anupam.sin 616
    public String createCoupon(long promotionId, String couponCode, String arguments, boolean isCod, String prefix) throws PromotionException, org.apache.thrift.TException
6250 amit.gupta 617
    {
6730 anupam.sin 618
      send_createCoupon(promotionId, couponCode, arguments, isCod, prefix);
6250 amit.gupta 619
      return recv_createCoupon();
620
    }
621
 
6730 anupam.sin 622
    public void send_createCoupon(long promotionId, String couponCode, String arguments, boolean isCod, String prefix) throws org.apache.thrift.TException
6250 amit.gupta 623
    {
624
      createCoupon_args args = new createCoupon_args();
625
      args.setPromotionId(promotionId);
6730 anupam.sin 626
      args.setCouponCode(couponCode);
6679 anupam.sin 627
      args.setArguments(arguments);
6356 amit.gupta 628
      args.setIsCod(isCod);
6561 amit.gupta 629
      args.setPrefix(prefix);
6250 amit.gupta 630
      sendBase("createCoupon", args);
631
    }
632
 
633
    public String recv_createCoupon() throws PromotionException, org.apache.thrift.TException
634
    {
635
      createCoupon_result result = new createCoupon_result();
636
      receiveBase(result, "createCoupon");
637
      if (result.isSetSuccess()) {
638
        return result.success;
639
      }
640
      if (result.pex != null) {
641
        throw result.pex;
642
      }
643
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createCoupon failed: unknown result");
644
    }
645
 
3430 rajveer 646
    public long getSuccessfulPaymentCountForCoupon(String couponCode) throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 647
    {
648
      send_getSuccessfulPaymentCountForCoupon(couponCode);
649
      return recv_getSuccessfulPaymentCountForCoupon();
650
    }
651
 
3430 rajveer 652
    public void send_getSuccessfulPaymentCountForCoupon(String couponCode) throws org.apache.thrift.TException
3385 varun.gupt 653
    {
654
      getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
3430 rajveer 655
      args.setCouponCode(couponCode);
656
      sendBase("getSuccessfulPaymentCountForCoupon", args);
3385 varun.gupt 657
    }
658
 
3430 rajveer 659
    public long recv_getSuccessfulPaymentCountForCoupon() throws PromotionException, org.apache.thrift.TException
3385 varun.gupt 660
    {
661
      getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
3430 rajveer 662
      receiveBase(result, "getSuccessfulPaymentCountForCoupon");
3385 varun.gupt 663
      if (result.isSetSuccess()) {
664
        return result.success;
665
      }
666
      if (result.pex != null) {
667
        throw result.pex;
668
      }
3430 rajveer 669
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSuccessfulPaymentCountForCoupon failed: unknown result");
3385 varun.gupt 670
    }
671
 
3430 rajveer 672
    public String getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 673
    {
674
      send_getRuleDocString(ruleName);
675
      return recv_getRuleDocString();
676
    }
677
 
3430 rajveer 678
    public void send_getRuleDocString(String ruleName) throws org.apache.thrift.TException
3385 varun.gupt 679
    {
680
      getRuleDocString_args args = new getRuleDocString_args();
3430 rajveer 681
      args.setRuleName(ruleName);
682
      sendBase("getRuleDocString", args);
3385 varun.gupt 683
    }
684
 
3430 rajveer 685
    public String recv_getRuleDocString() throws org.apache.thrift.TException
3385 varun.gupt 686
    {
687
      getRuleDocString_result result = new getRuleDocString_result();
3430 rajveer 688
      receiveBase(result, "getRuleDocString");
3385 varun.gupt 689
      if (result.isSetSuccess()) {
690
        return result.success;
691
      }
3430 rajveer 692
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRuleDocString failed: unknown result");
3385 varun.gupt 693
    }
694
 
4189 varun.gupt 695
    public List<ItemCouponDiscount> getItemDiscountMap(List<Long> itemIds) throws PromotionException, org.apache.thrift.TException
696
    {
697
      send_getItemDiscountMap(itemIds);
698
      return recv_getItemDiscountMap();
699
    }
700
 
701
    public void send_getItemDiscountMap(List<Long> itemIds) throws org.apache.thrift.TException
702
    {
703
      getItemDiscountMap_args args = new getItemDiscountMap_args();
704
      args.setItemIds(itemIds);
705
      sendBase("getItemDiscountMap", args);
706
    }
707
 
708
    public List<ItemCouponDiscount> recv_getItemDiscountMap() throws PromotionException, org.apache.thrift.TException
709
    {
710
      getItemDiscountMap_result result = new getItemDiscountMap_result();
711
      receiveBase(result, "getItemDiscountMap");
712
      if (result.isSetSuccess()) {
713
        return result.success;
714
      }
715
      if (result.pex != null) {
716
        throw result.pex;
717
      }
718
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemDiscountMap failed: unknown result");
719
    }
720
 
4494 varun.gupt 721
    public Map<String,Double> getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
722
    {
723
      send_getDiscountsForEntity(entityId);
724
      return recv_getDiscountsForEntity();
725
    }
726
 
727
    public void send_getDiscountsForEntity(long entityId) throws org.apache.thrift.TException
728
    {
729
      getDiscountsForEntity_args args = new getDiscountsForEntity_args();
730
      args.setEntityId(entityId);
731
      sendBase("getDiscountsForEntity", args);
732
    }
733
 
734
    public Map<String,Double> recv_getDiscountsForEntity() throws org.apache.thrift.TException
735
    {
736
      getDiscountsForEntity_result result = new getDiscountsForEntity_result();
737
      receiveBase(result, "getDiscountsForEntity");
738
      if (result.isSetSuccess()) {
739
        return result.success;
740
      }
741
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getDiscountsForEntity failed: unknown result");
742
    }
743
 
5469 rajveer 744
    public void addVoucher(Voucher voucher) throws org.apache.thrift.TException
745
    {
746
      send_addVoucher(voucher);
747
      recv_addVoucher();
748
    }
749
 
750
    public void send_addVoucher(Voucher voucher) throws org.apache.thrift.TException
751
    {
752
      addVoucher_args args = new addVoucher_args();
753
      args.setVoucher(voucher);
754
      sendBase("addVoucher", args);
755
    }
756
 
757
    public void recv_addVoucher() throws org.apache.thrift.TException
758
    {
759
      addVoucher_result result = new addVoucher_result();
760
      receiveBase(result, "addVoucher");
761
      return;
762
    }
763
 
764
    public Voucher assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException
765
    {
766
      send_assignVoucher(userId, userEmail, voucherType, amount);
767
      return recv_assignVoucher();
768
    }
769
 
770
    public void send_assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount) throws org.apache.thrift.TException
771
    {
772
      assignVoucher_args args = new assignVoucher_args();
773
      args.setUserId(userId);
774
      args.setUserEmail(userEmail);
775
      args.setVoucherType(voucherType);
776
      args.setAmount(amount);
777
      sendBase("assignVoucher", args);
778
    }
779
 
780
    public Voucher recv_assignVoucher() throws org.apache.thrift.TException
781
    {
782
      assignVoucher_result result = new assignVoucher_result();
783
      receiveBase(result, "assignVoucher");
784
      if (result.isSetSuccess()) {
785
        return result.success;
786
      }
787
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "assignVoucher failed: unknown result");
788
    }
789
 
790
    public boolean markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException
791
    {
792
      send_markVoucherAsRedeemed(voucherCode, redeemedOn);
793
      return recv_markVoucherAsRedeemed();
794
    }
795
 
796
    public void send_markVoucherAsRedeemed(String voucherCode, long redeemedOn) throws org.apache.thrift.TException
797
    {
798
      markVoucherAsRedeemed_args args = new markVoucherAsRedeemed_args();
799
      args.setVoucherCode(voucherCode);
800
      args.setRedeemedOn(redeemedOn);
801
      sendBase("markVoucherAsRedeemed", args);
802
    }
803
 
804
    public boolean recv_markVoucherAsRedeemed() throws org.apache.thrift.TException
805
    {
806
      markVoucherAsRedeemed_result result = new markVoucherAsRedeemed_result();
807
      receiveBase(result, "markVoucherAsRedeemed");
808
      if (result.isSetSuccess()) {
809
        return result.success;
810
      }
811
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "markVoucherAsRedeemed failed: unknown result");
812
    }
813
 
1982 varun.gupt 814
  }
3430 rajveer 815
  public static class AsyncClient extends in.shop2020.generic.GenericService.AsyncClient implements AsyncIface {
816
    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
817
      private org.apache.thrift.async.TAsyncClientManager clientManager;
818
      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
819
      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
820
        this.clientManager = clientManager;
821
        this.protocolFactory = protocolFactory;
822
      }
823
      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
824
        return new AsyncClient(protocolFactory, clientManager, transport);
825
      }
1982 varun.gupt 826
    }
827
 
3430 rajveer 828
    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
829
      super(protocolFactory, clientManager, transport);
830
    }
1982 varun.gupt 831
 
3430 rajveer 832
    public void createPromotion(String name, String ruleExecutionSrc, long startOn, long endOn, org.apache.thrift.async.AsyncMethodCallback<createPromotion_call> resultHandler) throws org.apache.thrift.TException {
833
      checkReady();
834
      createPromotion_call method_call = new createPromotion_call(name, ruleExecutionSrc, startOn, endOn, resultHandler, this, ___protocolFactory, ___transport);
835
      this.___currentMethod = method_call;
836
      ___manager.call(method_call);
1982 varun.gupt 837
    }
838
 
3430 rajveer 839
    public static class createPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
840
      private String name;
841
      private String ruleExecutionSrc;
842
      private long startOn;
843
      private long endOn;
844
      public createPromotion_call(String name, String ruleExecutionSrc, long startOn, long endOn, org.apache.thrift.async.AsyncMethodCallback<createPromotion_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
845
        super(client, protocolFactory, transport, resultHandler, false);
846
        this.name = name;
847
        this.ruleExecutionSrc = ruleExecutionSrc;
848
        this.startOn = startOn;
849
        this.endOn = endOn;
1982 varun.gupt 850
      }
851
 
3430 rajveer 852
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
853
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
1982 varun.gupt 854
        createPromotion_args args = new createPromotion_args();
3430 rajveer 855
        args.setName(name);
856
        args.setRuleExecutionSrc(ruleExecutionSrc);
857
        args.setStartOn(startOn);
858
        args.setEndOn(endOn);
859
        args.write(prot);
860
        prot.writeMessageEnd();
1982 varun.gupt 861
      }
862
 
3430 rajveer 863
      public void getResult() throws PromotionException, org.apache.thrift.TException {
864
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
865
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 866
        }
3430 rajveer 867
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
868
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
869
        (new Client(prot)).recv_createPromotion();
1982 varun.gupt 870
      }
3430 rajveer 871
    }
1982 varun.gupt 872
 
7746 amit.gupta 873
    public void removeAllCouponsByPromotionId(long promotionId, org.apache.thrift.async.AsyncMethodCallback<removeAllCouponsByPromotionId_call> resultHandler) throws org.apache.thrift.TException {
874
      checkReady();
875
      removeAllCouponsByPromotionId_call method_call = new removeAllCouponsByPromotionId_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
876
      this.___currentMethod = method_call;
877
      ___manager.call(method_call);
878
    }
879
 
880
    public static class removeAllCouponsByPromotionId_call extends org.apache.thrift.async.TAsyncMethodCall {
881
      private long promotionId;
882
      public removeAllCouponsByPromotionId_call(long promotionId, org.apache.thrift.async.AsyncMethodCallback<removeAllCouponsByPromotionId_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
883
        super(client, protocolFactory, transport, resultHandler, false);
884
        this.promotionId = promotionId;
885
      }
886
 
887
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
888
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("removeAllCouponsByPromotionId", org.apache.thrift.protocol.TMessageType.CALL, 0));
889
        removeAllCouponsByPromotionId_args args = new removeAllCouponsByPromotionId_args();
890
        args.setPromotionId(promotionId);
891
        args.write(prot);
892
        prot.writeMessageEnd();
893
      }
894
 
895
      public long getResult() throws PromotionException, org.apache.thrift.TException {
896
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
897
          throw new IllegalStateException("Method call not finished!");
898
        }
899
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
900
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
901
        return (new Client(prot)).recv_removeAllCouponsByPromotionId();
902
      }
903
    }
904
 
6301 amit.gupta 905
    public void getCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getCoupon_call> resultHandler) throws org.apache.thrift.TException {
906
      checkReady();
907
      getCoupon_call method_call = new getCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
908
      this.___currentMethod = method_call;
909
      ___manager.call(method_call);
910
    }
911
 
912
    public static class getCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
913
      private String couponCode;
914
      public getCoupon_call(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getCoupon_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
915
        super(client, protocolFactory, transport, resultHandler, false);
916
        this.couponCode = couponCode;
917
      }
918
 
919
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
920
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
921
        getCoupon_args args = new getCoupon_args();
922
        args.setCouponCode(couponCode);
923
        args.write(prot);
924
        prot.writeMessageEnd();
925
      }
926
 
927
      public Coupon getResult() throws PromotionException, org.apache.thrift.TException {
928
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
929
          throw new IllegalStateException("Method call not finished!");
930
        }
931
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
932
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
933
        return (new Client(prot)).recv_getCoupon();
934
      }
935
    }
936
 
937
    public void isGiftVoucher(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isGiftVoucher_call> resultHandler) throws org.apache.thrift.TException {
938
      checkReady();
939
      isGiftVoucher_call method_call = new isGiftVoucher_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
940
      this.___currentMethod = method_call;
941
      ___manager.call(method_call);
942
    }
943
 
944
    public static class isGiftVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
945
      private String couponCode;
946
      public isGiftVoucher_call(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isGiftVoucher_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
947
        super(client, protocolFactory, transport, resultHandler, false);
948
        this.couponCode = couponCode;
949
      }
950
 
951
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
952
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isGiftVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
953
        isGiftVoucher_args args = new isGiftVoucher_args();
954
        args.setCouponCode(couponCode);
955
        args.write(prot);
956
        prot.writeMessageEnd();
957
      }
958
 
959
      public boolean getResult() throws PromotionException, org.apache.thrift.TException {
960
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
961
          throw new IllegalStateException("Method call not finished!");
962
        }
963
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
964
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
965
        return (new Client(prot)).recv_isGiftVoucher();
966
      }
967
    }
968
 
6356 amit.gupta 969
    public void isCodApplicable(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isCodApplicable_call> resultHandler) throws org.apache.thrift.TException {
970
      checkReady();
971
      isCodApplicable_call method_call = new isCodApplicable_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
972
      this.___currentMethod = method_call;
973
      ___manager.call(method_call);
974
    }
975
 
976
    public static class isCodApplicable_call extends org.apache.thrift.async.TAsyncMethodCall {
977
      private String couponCode;
978
      public isCodApplicable_call(String couponCode, org.apache.thrift.async.AsyncMethodCallback<isCodApplicable_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
979
        super(client, protocolFactory, transport, resultHandler, false);
980
        this.couponCode = couponCode;
981
      }
982
 
983
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
984
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isCodApplicable", org.apache.thrift.protocol.TMessageType.CALL, 0));
985
        isCodApplicable_args args = new isCodApplicable_args();
986
        args.setCouponCode(couponCode);
987
        args.write(prot);
988
        prot.writeMessageEnd();
989
      }
990
 
991
      public boolean getResult() throws PromotionException, org.apache.thrift.TException {
992
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
993
          throw new IllegalStateException("Method call not finished!");
994
        }
995
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
996
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
997
        return (new Client(prot)).recv_isCodApplicable();
998
      }
999
    }
1000
 
3430 rajveer 1001
    public void getAllPromotions(org.apache.thrift.async.AsyncMethodCallback<getAllPromotions_call> resultHandler) throws org.apache.thrift.TException {
1002
      checkReady();
1003
      getAllPromotions_call method_call = new getAllPromotions_call(resultHandler, this, ___protocolFactory, ___transport);
1004
      this.___currentMethod = method_call;
1005
      ___manager.call(method_call);
1982 varun.gupt 1006
    }
1007
 
3430 rajveer 1008
    public static class getAllPromotions_call extends org.apache.thrift.async.TAsyncMethodCall {
1009
      public getAllPromotions_call(org.apache.thrift.async.AsyncMethodCallback<getAllPromotions_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1010
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 1011
      }
1012
 
3430 rajveer 1013
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1014
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllPromotions", org.apache.thrift.protocol.TMessageType.CALL, 0));
1015
        getAllPromotions_args args = new getAllPromotions_args();
1016
        args.write(prot);
1017
        prot.writeMessageEnd();
1018
      }
1982 varun.gupt 1019
 
3430 rajveer 1020
      public List<Promotion> getResult() throws PromotionException, org.apache.thrift.TException {
1021
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1022
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 1023
        }
3430 rajveer 1024
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1025
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1026
        return (new Client(prot)).recv_getAllPromotions();
1982 varun.gupt 1027
      }
3430 rajveer 1028
    }
1982 varun.gupt 1029
 
3430 rajveer 1030
    public void getPromotionById(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getPromotionById_call> resultHandler) throws org.apache.thrift.TException {
1031
      checkReady();
1032
      getPromotionById_call method_call = new getPromotionById_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
1033
      this.___currentMethod = method_call;
1034
      ___manager.call(method_call);
1982 varun.gupt 1035
    }
1036
 
3430 rajveer 1037
    public static class getPromotionById_call extends org.apache.thrift.async.TAsyncMethodCall {
1038
      private long promotionId;
1039
      public getPromotionById_call(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getPromotionById_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1040
        super(client, protocolFactory, transport, resultHandler, false);
1041
        this.promotionId = promotionId;
1982 varun.gupt 1042
      }
1043
 
3430 rajveer 1044
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1045
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPromotionById", org.apache.thrift.protocol.TMessageType.CALL, 0));
1046
        getPromotionById_args args = new getPromotionById_args();
1047
        args.setPromotionId(promotionId);
1048
        args.write(prot);
1049
        prot.writeMessageEnd();
1050
      }
1982 varun.gupt 1051
 
3430 rajveer 1052
      public Promotion getResult() throws PromotionException, org.apache.thrift.TException {
1053
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1054
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 1055
        }
3430 rajveer 1056
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1057
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1058
        return (new Client(prot)).recv_getPromotionById();
1982 varun.gupt 1059
      }
3430 rajveer 1060
    }
1982 varun.gupt 1061
 
3430 rajveer 1062
    public void generateCouponsForPromotion(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<generateCouponsForPromotion_call> resultHandler) throws org.apache.thrift.TException {
1063
      checkReady();
1064
      generateCouponsForPromotion_call method_call = new generateCouponsForPromotion_call(promotionId, couponCode, resultHandler, this, ___protocolFactory, ___transport);
1065
      this.___currentMethod = method_call;
1066
      ___manager.call(method_call);
1982 varun.gupt 1067
    }
1068
 
3430 rajveer 1069
    public static class generateCouponsForPromotion_call extends org.apache.thrift.async.TAsyncMethodCall {
1070
      private long promotionId;
1071
      private String couponCode;
1072
      public generateCouponsForPromotion_call(long promotionId, String couponCode, org.apache.thrift.async.AsyncMethodCallback<generateCouponsForPromotion_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1073
        super(client, protocolFactory, transport, resultHandler, false);
1074
        this.promotionId = promotionId;
1075
        this.couponCode = couponCode;
1982 varun.gupt 1076
      }
1077
 
3430 rajveer 1078
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1079
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("generateCouponsForPromotion", org.apache.thrift.protocol.TMessageType.CALL, 0));
1080
        generateCouponsForPromotion_args args = new generateCouponsForPromotion_args();
1081
        args.setPromotionId(promotionId);
1082
        args.setCouponCode(couponCode);
1083
        args.write(prot);
1084
        prot.writeMessageEnd();
3385 varun.gupt 1085
      }
1086
 
3430 rajveer 1087
      public void getResult() throws PromotionException, org.apache.thrift.TException {
1088
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1089
          throw new IllegalStateException("Method call not finished!");
3385 varun.gupt 1090
        }
3430 rajveer 1091
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1092
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1093
        (new Client(prot)).recv_generateCouponsForPromotion();
3385 varun.gupt 1094
      }
1095
    }
1096
 
3430 rajveer 1097
    public void applyCoupon(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<applyCoupon_call> resultHandler) throws org.apache.thrift.TException {
1098
      checkReady();
1099
      applyCoupon_call method_call = new applyCoupon_call(couponCode, cartId, resultHandler, this, ___protocolFactory, ___transport);
1100
      this.___currentMethod = method_call;
1101
      ___manager.call(method_call);
3385 varun.gupt 1102
    }
1103
 
3430 rajveer 1104
    public static class applyCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1105
      private String couponCode;
1106
      private long cartId;
1107
      public applyCoupon_call(String couponCode, long cartId, org.apache.thrift.async.AsyncMethodCallback<applyCoupon_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1108
        super(client, protocolFactory, transport, resultHandler, false);
1109
        this.couponCode = couponCode;
1110
        this.cartId = cartId;
1982 varun.gupt 1111
      }
1112
 
3430 rajveer 1113
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1114
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("applyCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1115
        applyCoupon_args args = new applyCoupon_args();
1116
        args.setCouponCode(couponCode);
1117
        args.setCartId(cartId);
1118
        args.write(prot);
1119
        prot.writeMessageEnd();
1982 varun.gupt 1120
      }
1121
 
3430 rajveer 1122
      public Cart getResult() throws PromotionException, org.apache.thrift.TException {
1123
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1124
          throw new IllegalStateException("Method call not finished!");
1125
        }
1126
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1127
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1128
        return (new Client(prot)).recv_applyCoupon();
1982 varun.gupt 1129
      }
3430 rajveer 1130
    }
1982 varun.gupt 1131
 
6736 amit.gupta 1132
    public void getEmiDiscount(long cartId, org.apache.thrift.async.AsyncMethodCallback<getEmiDiscount_call> resultHandler) throws org.apache.thrift.TException {
1133
      checkReady();
1134
      getEmiDiscount_call method_call = new getEmiDiscount_call(cartId, resultHandler, this, ___protocolFactory, ___transport);
1135
      this.___currentMethod = method_call;
1136
      ___manager.call(method_call);
1137
    }
1138
 
1139
    public static class getEmiDiscount_call extends org.apache.thrift.async.TAsyncMethodCall {
1140
      private long cartId;
1141
      public getEmiDiscount_call(long cartId, org.apache.thrift.async.AsyncMethodCallback<getEmiDiscount_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1142
        super(client, protocolFactory, transport, resultHandler, false);
1143
        this.cartId = cartId;
1144
      }
1145
 
1146
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1147
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getEmiDiscount", org.apache.thrift.protocol.TMessageType.CALL, 0));
1148
        getEmiDiscount_args args = new getEmiDiscount_args();
1149
        args.setCartId(cartId);
1150
        args.write(prot);
1151
        prot.writeMessageEnd();
1152
      }
1153
 
1154
      public Map<Long,Double> getResult() throws PromotionException, org.apache.thrift.TException {
1155
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1156
          throw new IllegalStateException("Method call not finished!");
1157
        }
1158
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1159
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1160
        return (new Client(prot)).recv_getEmiDiscount();
1161
      }
1162
    }
1163
 
6433 anupam.sin 1164
    public void applyRechargeCoupon(String couponCode, long totalAmount, long userId, org.apache.thrift.async.AsyncMethodCallback<applyRechargeCoupon_call> resultHandler) throws org.apache.thrift.TException {
1165
      checkReady();
1166
      applyRechargeCoupon_call method_call = new applyRechargeCoupon_call(couponCode, totalAmount, userId, resultHandler, this, ___protocolFactory, ___transport);
1167
      this.___currentMethod = method_call;
1168
      ___manager.call(method_call);
1169
    }
1170
 
1171
    public static class applyRechargeCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1172
      private String couponCode;
1173
      private long totalAmount;
1174
      private long userId;
1175
      public applyRechargeCoupon_call(String couponCode, long totalAmount, long userId, org.apache.thrift.async.AsyncMethodCallback<applyRechargeCoupon_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1176
        super(client, protocolFactory, transport, resultHandler, false);
1177
        this.couponCode = couponCode;
1178
        this.totalAmount = totalAmount;
1179
        this.userId = userId;
1180
      }
1181
 
1182
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1183
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("applyRechargeCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1184
        applyRechargeCoupon_args args = new applyRechargeCoupon_args();
1185
        args.setCouponCode(couponCode);
1186
        args.setTotalAmount(totalAmount);
1187
        args.setUserId(userId);
1188
        args.write(prot);
1189
        prot.writeMessageEnd();
1190
      }
1191
 
1192
      public Map<Long,String> getResult() throws PromotionException, org.apache.thrift.TException {
1193
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1194
          throw new IllegalStateException("Method call not finished!");
1195
        }
1196
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1197
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1198
        return (new Client(prot)).recv_applyRechargeCoupon();
1199
      }
1200
    }
1201
 
3430 rajveer 1202
    public void trackCouponUsage(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<trackCouponUsage_call> resultHandler) throws org.apache.thrift.TException {
1203
      checkReady();
1204
      trackCouponUsage_call method_call = new trackCouponUsage_call(couponCode, transactionId, userId, resultHandler, this, ___protocolFactory, ___transport);
1205
      this.___currentMethod = method_call;
1206
      ___manager.call(method_call);
1207
    }
1982 varun.gupt 1208
 
3430 rajveer 1209
    public static class trackCouponUsage_call extends org.apache.thrift.async.TAsyncMethodCall {
1210
      private String couponCode;
1211
      private long transactionId;
1212
      private long userId;
1213
      public trackCouponUsage_call(String couponCode, long transactionId, long userId, org.apache.thrift.async.AsyncMethodCallback<trackCouponUsage_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1214
        super(client, protocolFactory, transport, resultHandler, false);
1215
        this.couponCode = couponCode;
1216
        this.transactionId = transactionId;
1217
        this.userId = userId;
1982 varun.gupt 1218
      }
1219
 
3430 rajveer 1220
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1221
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("trackCouponUsage", org.apache.thrift.protocol.TMessageType.CALL, 0));
1222
        trackCouponUsage_args args = new trackCouponUsage_args();
1223
        args.setCouponCode(couponCode);
1224
        args.setTransactionId(transactionId);
1225
        args.setUserId(userId);
1226
        args.write(prot);
1227
        prot.writeMessageEnd();
1982 varun.gupt 1228
      }
1229
 
3430 rajveer 1230
      public void getResult() throws PromotionException, org.apache.thrift.TException {
1231
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1232
          throw new IllegalStateException("Method call not finished!");
1233
        }
1234
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1235
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1236
        (new Client(prot)).recv_trackCouponUsage();
1982 varun.gupt 1237
      }
1238
    }
1239
 
3430 rajveer 1240
    public void getCouponUsageCountByUser(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<getCouponUsageCountByUser_call> resultHandler) throws org.apache.thrift.TException {
1241
      checkReady();
1242
      getCouponUsageCountByUser_call method_call = new getCouponUsageCountByUser_call(couponCode, userId, resultHandler, this, ___protocolFactory, ___transport);
1243
      this.___currentMethod = method_call;
1244
      ___manager.call(method_call);
1982 varun.gupt 1245
    }
1246
 
3430 rajveer 1247
    public static class getCouponUsageCountByUser_call extends org.apache.thrift.async.TAsyncMethodCall {
1248
      private String couponCode;
1249
      private long userId;
1250
      public getCouponUsageCountByUser_call(String couponCode, long userId, org.apache.thrift.async.AsyncMethodCallback<getCouponUsageCountByUser_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1251
        super(client, protocolFactory, transport, resultHandler, false);
1252
        this.couponCode = couponCode;
1253
        this.userId = userId;
1254
      }
1982 varun.gupt 1255
 
3430 rajveer 1256
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1257
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getCouponUsageCountByUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
1258
        getCouponUsageCountByUser_args args = new getCouponUsageCountByUser_args();
1259
        args.setCouponCode(couponCode);
1260
        args.setUserId(userId);
1261
        args.write(prot);
1262
        prot.writeMessageEnd();
1263
      }
1982 varun.gupt 1264
 
3430 rajveer 1265
      public long getResult() throws PromotionException, org.apache.thrift.TException {
1266
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1267
          throw new IllegalStateException("Method call not finished!");
1268
        }
1269
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1270
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1271
        return (new Client(prot)).recv_getCouponUsageCountByUser();
1272
      }
1982 varun.gupt 1273
    }
1274
 
6497 amit.gupta 1275
    public void getActiveCodes(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getActiveCodes_call> resultHandler) throws org.apache.thrift.TException {
1276
      checkReady();
1277
      getActiveCodes_call method_call = new getActiveCodes_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
1278
      this.___currentMethod = method_call;
1279
      ___manager.call(method_call);
1280
    }
1281
 
1282
    public static class getActiveCodes_call extends org.apache.thrift.async.TAsyncMethodCall {
1283
      private long promotionId;
1284
      public getActiveCodes_call(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getActiveCodes_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1285
        super(client, protocolFactory, transport, resultHandler, false);
1286
        this.promotionId = promotionId;
1287
      }
1288
 
1289
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1290
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getActiveCodes", org.apache.thrift.protocol.TMessageType.CALL, 0));
1291
        getActiveCodes_args args = new getActiveCodes_args();
1292
        args.setPromotionId(promotionId);
1293
        args.write(prot);
1294
        prot.writeMessageEnd();
1295
      }
1296
 
1297
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
1298
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1299
          throw new IllegalStateException("Method call not finished!");
1300
        }
1301
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1302
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1303
        return (new Client(prot)).recv_getActiveCodes();
1304
      }
1305
    }
1306
 
1307
    public void deleteCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<deleteCoupon_call> resultHandler) throws org.apache.thrift.TException {
1308
      checkReady();
1309
      deleteCoupon_call method_call = new deleteCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
1310
      this.___currentMethod = method_call;
1311
      ___manager.call(method_call);
1312
    }
1313
 
1314
    public static class deleteCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1315
      private String couponCode;
1316
      public deleteCoupon_call(String couponCode, org.apache.thrift.async.AsyncMethodCallback<deleteCoupon_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1317
        super(client, protocolFactory, transport, resultHandler, false);
1318
        this.couponCode = couponCode;
1319
      }
1320
 
1321
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1322
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1323
        deleteCoupon_args args = new deleteCoupon_args();
1324
        args.setCouponCode(couponCode);
1325
        args.write(prot);
1326
        prot.writeMessageEnd();
1327
      }
1328
 
1329
      public void getResult() throws PromotionException, org.apache.thrift.TException {
1330
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1331
          throw new IllegalStateException("Method call not finished!");
1332
        }
1333
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1334
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1335
        (new Client(prot)).recv_deleteCoupon();
1336
      }
1337
    }
1338
 
7092 amit.gupta 1339
    public void getAllCouponsByPromotionId(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getAllCouponsByPromotionId_call> resultHandler) throws org.apache.thrift.TException {
1340
      checkReady();
1341
      getAllCouponsByPromotionId_call method_call = new getAllCouponsByPromotionId_call(promotionId, resultHandler, this, ___protocolFactory, ___transport);
1342
      this.___currentMethod = method_call;
1343
      ___manager.call(method_call);
1344
    }
1345
 
1346
    public static class getAllCouponsByPromotionId_call extends org.apache.thrift.async.TAsyncMethodCall {
1347
      private long promotionId;
1348
      public getAllCouponsByPromotionId_call(long promotionId, org.apache.thrift.async.AsyncMethodCallback<getAllCouponsByPromotionId_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1349
        super(client, protocolFactory, transport, resultHandler, false);
1350
        this.promotionId = promotionId;
1351
      }
1352
 
1353
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1354
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllCouponsByPromotionId", org.apache.thrift.protocol.TMessageType.CALL, 0));
1355
        getAllCouponsByPromotionId_args args = new getAllCouponsByPromotionId_args();
1356
        args.setPromotionId(promotionId);
1357
        args.write(prot);
1358
        prot.writeMessageEnd();
1359
      }
1360
 
1361
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
1362
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1363
          throw new IllegalStateException("Method call not finished!");
1364
        }
1365
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1366
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1367
        return (new Client(prot)).recv_getAllCouponsByPromotionId();
1368
      }
1369
    }
1370
 
3430 rajveer 1371
    public void getActiveCoupons(org.apache.thrift.async.AsyncMethodCallback<getActiveCoupons_call> resultHandler) throws org.apache.thrift.TException {
1372
      checkReady();
1373
      getActiveCoupons_call method_call = new getActiveCoupons_call(resultHandler, this, ___protocolFactory, ___transport);
1374
      this.___currentMethod = method_call;
1375
      ___manager.call(method_call);
1982 varun.gupt 1376
    }
1377
 
3430 rajveer 1378
    public static class getActiveCoupons_call extends org.apache.thrift.async.TAsyncMethodCall {
1379
      public getActiveCoupons_call(org.apache.thrift.async.AsyncMethodCallback<getActiveCoupons_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1380
        super(client, protocolFactory, transport, resultHandler, false);
1982 varun.gupt 1381
      }
1382
 
3430 rajveer 1383
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1384
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getActiveCoupons", org.apache.thrift.protocol.TMessageType.CALL, 0));
1385
        getActiveCoupons_args args = new getActiveCoupons_args();
1386
        args.write(prot);
1387
        prot.writeMessageEnd();
1388
      }
1982 varun.gupt 1389
 
3430 rajveer 1390
      public List<Coupon> getResult() throws PromotionException, org.apache.thrift.TException {
1391
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1392
          throw new IllegalStateException("Method call not finished!");
1393
        }
1394
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1395
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1396
        return (new Client(prot)).recv_getActiveCoupons();
1982 varun.gupt 1397
      }
1398
    }
1399
 
6730 anupam.sin 1400
    public void createCoupon(long promotionId, String couponCode, String arguments, boolean isCod, String prefix, org.apache.thrift.async.AsyncMethodCallback<createCoupon_call> resultHandler) throws org.apache.thrift.TException {
6250 amit.gupta 1401
      checkReady();
6730 anupam.sin 1402
      createCoupon_call method_call = new createCoupon_call(promotionId, couponCode, arguments, isCod, prefix, resultHandler, this, ___protocolFactory, ___transport);
6250 amit.gupta 1403
      this.___currentMethod = method_call;
1404
      ___manager.call(method_call);
1405
    }
1406
 
1407
    public static class createCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1408
      private long promotionId;
6730 anupam.sin 1409
      private String couponCode;
6679 anupam.sin 1410
      private String arguments;
6356 amit.gupta 1411
      private boolean isCod;
6561 amit.gupta 1412
      private String prefix;
6730 anupam.sin 1413
      public createCoupon_call(long promotionId, String couponCode, String arguments, boolean isCod, String prefix, org.apache.thrift.async.AsyncMethodCallback<createCoupon_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
6250 amit.gupta 1414
        super(client, protocolFactory, transport, resultHandler, false);
1415
        this.promotionId = promotionId;
6730 anupam.sin 1416
        this.couponCode = couponCode;
6679 anupam.sin 1417
        this.arguments = arguments;
6356 amit.gupta 1418
        this.isCod = isCod;
6561 amit.gupta 1419
        this.prefix = prefix;
6250 amit.gupta 1420
      }
1421
 
1422
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1423
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1424
        createCoupon_args args = new createCoupon_args();
1425
        args.setPromotionId(promotionId);
6730 anupam.sin 1426
        args.setCouponCode(couponCode);
6679 anupam.sin 1427
        args.setArguments(arguments);
6356 amit.gupta 1428
        args.setIsCod(isCod);
6561 amit.gupta 1429
        args.setPrefix(prefix);
6250 amit.gupta 1430
        args.write(prot);
1431
        prot.writeMessageEnd();
1432
      }
1433
 
1434
      public String getResult() throws PromotionException, org.apache.thrift.TException {
1435
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1436
          throw new IllegalStateException("Method call not finished!");
1437
        }
1438
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1439
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1440
        return (new Client(prot)).recv_createCoupon();
1441
      }
1442
    }
1443
 
3430 rajveer 1444
    public void getSuccessfulPaymentCountForCoupon(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getSuccessfulPaymentCountForCoupon_call> resultHandler) throws org.apache.thrift.TException {
1445
      checkReady();
1446
      getSuccessfulPaymentCountForCoupon_call method_call = new getSuccessfulPaymentCountForCoupon_call(couponCode, resultHandler, this, ___protocolFactory, ___transport);
1447
      this.___currentMethod = method_call;
1448
      ___manager.call(method_call);
1982 varun.gupt 1449
    }
1450
 
3430 rajveer 1451
    public static class getSuccessfulPaymentCountForCoupon_call extends org.apache.thrift.async.TAsyncMethodCall {
1452
      private String couponCode;
1453
      public getSuccessfulPaymentCountForCoupon_call(String couponCode, org.apache.thrift.async.AsyncMethodCallback<getSuccessfulPaymentCountForCoupon_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1454
        super(client, protocolFactory, transport, resultHandler, false);
1455
        this.couponCode = couponCode;
1982 varun.gupt 1456
      }
1457
 
3430 rajveer 1458
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1459
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSuccessfulPaymentCountForCoupon", org.apache.thrift.protocol.TMessageType.CALL, 0));
1460
        getSuccessfulPaymentCountForCoupon_args args = new getSuccessfulPaymentCountForCoupon_args();
1461
        args.setCouponCode(couponCode);
1462
        args.write(prot);
1463
        prot.writeMessageEnd();
1464
      }
1982 varun.gupt 1465
 
3430 rajveer 1466
      public long getResult() throws PromotionException, org.apache.thrift.TException {
1467
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1468
          throw new IllegalStateException("Method call not finished!");
1469
        }
1470
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1471
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1472
        return (new Client(prot)).recv_getSuccessfulPaymentCountForCoupon();
1473
      }
1982 varun.gupt 1474
    }
1475
 
3430 rajveer 1476
    public void getRuleDocString(String ruleName, org.apache.thrift.async.AsyncMethodCallback<getRuleDocString_call> resultHandler) throws org.apache.thrift.TException {
1477
      checkReady();
1478
      getRuleDocString_call method_call = new getRuleDocString_call(ruleName, resultHandler, this, ___protocolFactory, ___transport);
1479
      this.___currentMethod = method_call;
1480
      ___manager.call(method_call);
1982 varun.gupt 1481
    }
1482
 
3430 rajveer 1483
    public static class getRuleDocString_call extends org.apache.thrift.async.TAsyncMethodCall {
1484
      private String ruleName;
1485
      public getRuleDocString_call(String ruleName, org.apache.thrift.async.AsyncMethodCallback<getRuleDocString_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1486
        super(client, protocolFactory, transport, resultHandler, false);
1487
        this.ruleName = ruleName;
1488
      }
1982 varun.gupt 1489
 
3430 rajveer 1490
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1491
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRuleDocString", org.apache.thrift.protocol.TMessageType.CALL, 0));
1492
        getRuleDocString_args args = new getRuleDocString_args();
1493
        args.setRuleName(ruleName);
1494
        args.write(prot);
1495
        prot.writeMessageEnd();
1982 varun.gupt 1496
      }
1497
 
3430 rajveer 1498
      public String getResult() throws org.apache.thrift.TException {
1499
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1500
          throw new IllegalStateException("Method call not finished!");
1982 varun.gupt 1501
        }
3430 rajveer 1502
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1503
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1504
        return (new Client(prot)).recv_getRuleDocString();
1982 varun.gupt 1505
      }
1506
    }
1507
 
4189 varun.gupt 1508
    public void getItemDiscountMap(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<getItemDiscountMap_call> resultHandler) throws org.apache.thrift.TException {
1509
      checkReady();
1510
      getItemDiscountMap_call method_call = new getItemDiscountMap_call(itemIds, resultHandler, this, ___protocolFactory, ___transport);
1511
      this.___currentMethod = method_call;
1512
      ___manager.call(method_call);
1513
    }
1514
 
1515
    public static class getItemDiscountMap_call extends org.apache.thrift.async.TAsyncMethodCall {
1516
      private List<Long> itemIds;
1517
      public getItemDiscountMap_call(List<Long> itemIds, org.apache.thrift.async.AsyncMethodCallback<getItemDiscountMap_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1518
        super(client, protocolFactory, transport, resultHandler, false);
1519
        this.itemIds = itemIds;
1520
      }
1521
 
1522
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1523
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getItemDiscountMap", org.apache.thrift.protocol.TMessageType.CALL, 0));
1524
        getItemDiscountMap_args args = new getItemDiscountMap_args();
1525
        args.setItemIds(itemIds);
1526
        args.write(prot);
1527
        prot.writeMessageEnd();
1528
      }
1529
 
1530
      public List<ItemCouponDiscount> getResult() throws PromotionException, org.apache.thrift.TException {
1531
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1532
          throw new IllegalStateException("Method call not finished!");
1533
        }
1534
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1535
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1536
        return (new Client(prot)).recv_getItemDiscountMap();
1537
      }
1538
    }
1539
 
4494 varun.gupt 1540
    public void getDiscountsForEntity(long entityId, org.apache.thrift.async.AsyncMethodCallback<getDiscountsForEntity_call> resultHandler) throws org.apache.thrift.TException {
1541
      checkReady();
1542
      getDiscountsForEntity_call method_call = new getDiscountsForEntity_call(entityId, resultHandler, this, ___protocolFactory, ___transport);
1543
      this.___currentMethod = method_call;
1544
      ___manager.call(method_call);
1545
    }
1546
 
1547
    public static class getDiscountsForEntity_call extends org.apache.thrift.async.TAsyncMethodCall {
1548
      private long entityId;
1549
      public getDiscountsForEntity_call(long entityId, org.apache.thrift.async.AsyncMethodCallback<getDiscountsForEntity_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1550
        super(client, protocolFactory, transport, resultHandler, false);
1551
        this.entityId = entityId;
1552
      }
1553
 
1554
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1555
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getDiscountsForEntity", org.apache.thrift.protocol.TMessageType.CALL, 0));
1556
        getDiscountsForEntity_args args = new getDiscountsForEntity_args();
1557
        args.setEntityId(entityId);
1558
        args.write(prot);
1559
        prot.writeMessageEnd();
1560
      }
1561
 
1562
      public Map<String,Double> getResult() throws org.apache.thrift.TException {
1563
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1564
          throw new IllegalStateException("Method call not finished!");
1565
        }
1566
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1567
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1568
        return (new Client(prot)).recv_getDiscountsForEntity();
1569
      }
1570
    }
1571
 
5469 rajveer 1572
    public void addVoucher(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<addVoucher_call> resultHandler) throws org.apache.thrift.TException {
1573
      checkReady();
1574
      addVoucher_call method_call = new addVoucher_call(voucher, resultHandler, this, ___protocolFactory, ___transport);
1575
      this.___currentMethod = method_call;
1576
      ___manager.call(method_call);
1577
    }
1578
 
1579
    public static class addVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
1580
      private Voucher voucher;
1581
      public addVoucher_call(Voucher voucher, org.apache.thrift.async.AsyncMethodCallback<addVoucher_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1582
        super(client, protocolFactory, transport, resultHandler, false);
1583
        this.voucher = voucher;
1584
      }
1585
 
1586
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1587
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
1588
        addVoucher_args args = new addVoucher_args();
1589
        args.setVoucher(voucher);
1590
        args.write(prot);
1591
        prot.writeMessageEnd();
1592
      }
1593
 
1594
      public void getResult() throws org.apache.thrift.TException {
1595
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1596
          throw new IllegalStateException("Method call not finished!");
1597
        }
1598
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1599
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1600
        (new Client(prot)).recv_addVoucher();
1601
      }
1602
    }
1603
 
1604
    public void assignVoucher(long userId, String userEmail, VoucherType voucherType, long amount, org.apache.thrift.async.AsyncMethodCallback<assignVoucher_call> resultHandler) throws org.apache.thrift.TException {
1605
      checkReady();
1606
      assignVoucher_call method_call = new assignVoucher_call(userId, userEmail, voucherType, amount, resultHandler, this, ___protocolFactory, ___transport);
1607
      this.___currentMethod = method_call;
1608
      ___manager.call(method_call);
1609
    }
1610
 
1611
    public static class assignVoucher_call extends org.apache.thrift.async.TAsyncMethodCall {
1612
      private long userId;
1613
      private String userEmail;
1614
      private VoucherType voucherType;
1615
      private long amount;
1616
      public assignVoucher_call(long userId, String userEmail, VoucherType voucherType, long amount, org.apache.thrift.async.AsyncMethodCallback<assignVoucher_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1617
        super(client, protocolFactory, transport, resultHandler, false);
1618
        this.userId = userId;
1619
        this.userEmail = userEmail;
1620
        this.voucherType = voucherType;
1621
        this.amount = amount;
1622
      }
1623
 
1624
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1625
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("assignVoucher", org.apache.thrift.protocol.TMessageType.CALL, 0));
1626
        assignVoucher_args args = new assignVoucher_args();
1627
        args.setUserId(userId);
1628
        args.setUserEmail(userEmail);
1629
        args.setVoucherType(voucherType);
1630
        args.setAmount(amount);
1631
        args.write(prot);
1632
        prot.writeMessageEnd();
1633
      }
1634
 
1635
      public Voucher getResult() throws org.apache.thrift.TException {
1636
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1637
          throw new IllegalStateException("Method call not finished!");
1638
        }
1639
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1640
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1641
        return (new Client(prot)).recv_assignVoucher();
1642
      }
1643
    }
1644
 
1645
    public void markVoucherAsRedeemed(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<markVoucherAsRedeemed_call> resultHandler) throws org.apache.thrift.TException {
1646
      checkReady();
1647
      markVoucherAsRedeemed_call method_call = new markVoucherAsRedeemed_call(voucherCode, redeemedOn, resultHandler, this, ___protocolFactory, ___transport);
1648
      this.___currentMethod = method_call;
1649
      ___manager.call(method_call);
1650
    }
1651
 
1652
    public static class markVoucherAsRedeemed_call extends org.apache.thrift.async.TAsyncMethodCall {
1653
      private String voucherCode;
1654
      private long redeemedOn;
1655
      public markVoucherAsRedeemed_call(String voucherCode, long redeemedOn, org.apache.thrift.async.AsyncMethodCallback<markVoucherAsRedeemed_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
1656
        super(client, protocolFactory, transport, resultHandler, false);
1657
        this.voucherCode = voucherCode;
1658
        this.redeemedOn = redeemedOn;
1659
      }
1660
 
1661
      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
1662
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("markVoucherAsRedeemed", org.apache.thrift.protocol.TMessageType.CALL, 0));
1663
        markVoucherAsRedeemed_args args = new markVoucherAsRedeemed_args();
1664
        args.setVoucherCode(voucherCode);
1665
        args.setRedeemedOn(redeemedOn);
1666
        args.write(prot);
1667
        prot.writeMessageEnd();
1668
      }
1669
 
1670
      public boolean getResult() throws org.apache.thrift.TException {
1671
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
1672
          throw new IllegalStateException("Method call not finished!");
1673
        }
1674
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
1675
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
1676
        return (new Client(prot)).recv_markVoucherAsRedeemed();
1677
      }
1678
    }
1679
 
3430 rajveer 1680
  }
1982 varun.gupt 1681
 
3430 rajveer 1682
  public static class Processor<I extends Iface> extends in.shop2020.generic.GenericService.Processor implements org.apache.thrift.TProcessor {
1683
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
1684
    public Processor(I iface) {
1685
      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
1982 varun.gupt 1686
    }
1687
 
3430 rajveer 1688
    protected Processor(I iface, Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
1689
      super(iface, getProcessMap(processMap));
1982 varun.gupt 1690
    }
1691
 
3430 rajveer 1692
    private static <I extends Iface> Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> getProcessMap(Map<String,  org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
1693
      processMap.put("createPromotion", new createPromotion());
7746 amit.gupta 1694
      processMap.put("removeAllCouponsByPromotionId", new removeAllCouponsByPromotionId());
6301 amit.gupta 1695
      processMap.put("getCoupon", new getCoupon());
1696
      processMap.put("isGiftVoucher", new isGiftVoucher());
6356 amit.gupta 1697
      processMap.put("isCodApplicable", new isCodApplicable());
3430 rajveer 1698
      processMap.put("getAllPromotions", new getAllPromotions());
1699
      processMap.put("getPromotionById", new getPromotionById());
1700
      processMap.put("generateCouponsForPromotion", new generateCouponsForPromotion());
1701
      processMap.put("applyCoupon", new applyCoupon());
6736 amit.gupta 1702
      processMap.put("getEmiDiscount", new getEmiDiscount());
6433 anupam.sin 1703
      processMap.put("applyRechargeCoupon", new applyRechargeCoupon());
3430 rajveer 1704
      processMap.put("trackCouponUsage", new trackCouponUsage());
1705
      processMap.put("getCouponUsageCountByUser", new getCouponUsageCountByUser());
6497 amit.gupta 1706
      processMap.put("getActiveCodes", new getActiveCodes());
1707
      processMap.put("deleteCoupon", new deleteCoupon());
7092 amit.gupta 1708
      processMap.put("getAllCouponsByPromotionId", new getAllCouponsByPromotionId());
3430 rajveer 1709
      processMap.put("getActiveCoupons", new getActiveCoupons());
6250 amit.gupta 1710
      processMap.put("createCoupon", new createCoupon());
3430 rajveer 1711
      processMap.put("getSuccessfulPaymentCountForCoupon", new getSuccessfulPaymentCountForCoupon());
1712
      processMap.put("getRuleDocString", new getRuleDocString());
4189 varun.gupt 1713
      processMap.put("getItemDiscountMap", new getItemDiscountMap());
4494 varun.gupt 1714
      processMap.put("getDiscountsForEntity", new getDiscountsForEntity());
5469 rajveer 1715
      processMap.put("addVoucher", new addVoucher());
1716
      processMap.put("assignVoucher", new assignVoucher());
1717
      processMap.put("markVoucherAsRedeemed", new markVoucherAsRedeemed());
3430 rajveer 1718
      return processMap;
1982 varun.gupt 1719
    }
1720
 
3430 rajveer 1721
    private static class createPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createPromotion_args> {
1722
      public createPromotion() {
1723
        super("createPromotion");
1724
      }
1982 varun.gupt 1725
 
3430 rajveer 1726
      protected createPromotion_args getEmptyArgsInstance() {
1727
        return new createPromotion_args();
1728
      }
1982 varun.gupt 1729
 
3430 rajveer 1730
      protected createPromotion_result getResult(I iface, createPromotion_args args) throws org.apache.thrift.TException {
1731
        createPromotion_result result = new createPromotion_result();
1732
        try {
1733
          iface.createPromotion(args.name, args.ruleExecutionSrc, args.startOn, args.endOn);
1734
        } catch (PromotionException pex) {
1735
          result.pex = pex;
1982 varun.gupt 1736
        }
3430 rajveer 1737
        return result;
1982 varun.gupt 1738
      }
3430 rajveer 1739
    }
1982 varun.gupt 1740
 
7746 amit.gupta 1741
    private static class removeAllCouponsByPromotionId<I extends Iface> extends org.apache.thrift.ProcessFunction<I, removeAllCouponsByPromotionId_args> {
1742
      public removeAllCouponsByPromotionId() {
1743
        super("removeAllCouponsByPromotionId");
1744
      }
1745
 
1746
      protected removeAllCouponsByPromotionId_args getEmptyArgsInstance() {
1747
        return new removeAllCouponsByPromotionId_args();
1748
      }
1749
 
1750
      protected removeAllCouponsByPromotionId_result getResult(I iface, removeAllCouponsByPromotionId_args args) throws org.apache.thrift.TException {
1751
        removeAllCouponsByPromotionId_result result = new removeAllCouponsByPromotionId_result();
1752
        try {
1753
          result.success = iface.removeAllCouponsByPromotionId(args.promotionId);
1754
          result.setSuccessIsSet(true);
1755
        } catch (PromotionException pex) {
1756
          result.pex = pex;
1757
        }
1758
        return result;
1759
      }
1760
    }
1761
 
6301 amit.gupta 1762
    private static class getCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCoupon_args> {
1763
      public getCoupon() {
1764
        super("getCoupon");
1765
      }
1766
 
1767
      protected getCoupon_args getEmptyArgsInstance() {
1768
        return new getCoupon_args();
1769
      }
1770
 
1771
      protected getCoupon_result getResult(I iface, getCoupon_args args) throws org.apache.thrift.TException {
1772
        getCoupon_result result = new getCoupon_result();
1773
        try {
1774
          result.success = iface.getCoupon(args.couponCode);
1775
        } catch (PromotionException pex) {
1776
          result.pex = pex;
1777
        }
1778
        return result;
1779
      }
1780
    }
1781
 
1782
    private static class isGiftVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isGiftVoucher_args> {
1783
      public isGiftVoucher() {
1784
        super("isGiftVoucher");
1785
      }
1786
 
1787
      protected isGiftVoucher_args getEmptyArgsInstance() {
1788
        return new isGiftVoucher_args();
1789
      }
1790
 
1791
      protected isGiftVoucher_result getResult(I iface, isGiftVoucher_args args) throws org.apache.thrift.TException {
1792
        isGiftVoucher_result result = new isGiftVoucher_result();
1793
        try {
1794
          result.success = iface.isGiftVoucher(args.couponCode);
1795
          result.setSuccessIsSet(true);
1796
        } catch (PromotionException pex) {
1797
          result.pex = pex;
1798
        }
1799
        return result;
1800
      }
1801
    }
1802
 
6356 amit.gupta 1803
    private static class isCodApplicable<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isCodApplicable_args> {
1804
      public isCodApplicable() {
1805
        super("isCodApplicable");
1806
      }
1807
 
1808
      protected isCodApplicable_args getEmptyArgsInstance() {
1809
        return new isCodApplicable_args();
1810
      }
1811
 
1812
      protected isCodApplicable_result getResult(I iface, isCodApplicable_args args) throws org.apache.thrift.TException {
1813
        isCodApplicable_result result = new isCodApplicable_result();
1814
        try {
1815
          result.success = iface.isCodApplicable(args.couponCode);
1816
          result.setSuccessIsSet(true);
1817
        } catch (PromotionException pex) {
1818
          result.pex = pex;
1819
        }
1820
        return result;
1821
      }
1822
    }
1823
 
3430 rajveer 1824
    private static class getAllPromotions<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllPromotions_args> {
1825
      public getAllPromotions() {
1826
        super("getAllPromotions");
1982 varun.gupt 1827
      }
1828
 
3430 rajveer 1829
      protected getAllPromotions_args getEmptyArgsInstance() {
1830
        return new getAllPromotions_args();
1982 varun.gupt 1831
      }
1832
 
3430 rajveer 1833
      protected getAllPromotions_result getResult(I iface, getAllPromotions_args args) throws org.apache.thrift.TException {
1834
        getAllPromotions_result result = new getAllPromotions_result();
1835
        try {
1836
          result.success = iface.getAllPromotions();
1837
        } catch (PromotionException pex) {
1838
          result.pex = pex;
1839
        }
1840
        return result;
1982 varun.gupt 1841
      }
3430 rajveer 1842
    }
1982 varun.gupt 1843
 
3430 rajveer 1844
    private static class getPromotionById<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getPromotionById_args> {
1845
      public getPromotionById() {
1846
        super("getPromotionById");
1982 varun.gupt 1847
      }
1848
 
3430 rajveer 1849
      protected getPromotionById_args getEmptyArgsInstance() {
1850
        return new getPromotionById_args();
1982 varun.gupt 1851
      }
1852
 
3430 rajveer 1853
      protected getPromotionById_result getResult(I iface, getPromotionById_args args) throws org.apache.thrift.TException {
1854
        getPromotionById_result result = new getPromotionById_result();
1855
        try {
1856
          result.success = iface.getPromotionById(args.promotionId);
1857
        } catch (PromotionException pex) {
1858
          result.pex = pex;
1859
        }
1860
        return result;
1982 varun.gupt 1861
      }
1862
    }
1863
 
3430 rajveer 1864
    private static class generateCouponsForPromotion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, generateCouponsForPromotion_args> {
1865
      public generateCouponsForPromotion() {
1866
        super("generateCouponsForPromotion");
1867
      }
1982 varun.gupt 1868
 
3430 rajveer 1869
      protected generateCouponsForPromotion_args getEmptyArgsInstance() {
1870
        return new generateCouponsForPromotion_args();
1871
      }
1982 varun.gupt 1872
 
3430 rajveer 1873
      protected generateCouponsForPromotion_result getResult(I iface, generateCouponsForPromotion_args args) throws org.apache.thrift.TException {
1874
        generateCouponsForPromotion_result result = new generateCouponsForPromotion_result();
1875
        try {
1876
          iface.generateCouponsForPromotion(args.promotionId, args.couponCode);
1877
        } catch (PromotionException pex) {
1878
          result.pex = pex;
1879
        }
1880
        return result;
1881
      }
1982 varun.gupt 1882
    }
1883
 
3430 rajveer 1884
    private static class applyCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, applyCoupon_args> {
1885
      public applyCoupon() {
1886
        super("applyCoupon");
1887
      }
1982 varun.gupt 1888
 
3430 rajveer 1889
      protected applyCoupon_args getEmptyArgsInstance() {
1890
        return new applyCoupon_args();
1891
      }
1982 varun.gupt 1892
 
3430 rajveer 1893
      protected applyCoupon_result getResult(I iface, applyCoupon_args args) throws org.apache.thrift.TException {
1894
        applyCoupon_result result = new applyCoupon_result();
1895
        try {
1896
          result.success = iface.applyCoupon(args.couponCode, args.cartId);
1897
        } catch (PromotionException pex) {
1898
          result.pex = pex;
1899
        }
1900
        return result;
1982 varun.gupt 1901
      }
1902
    }
1903
 
6736 amit.gupta 1904
    private static class getEmiDiscount<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getEmiDiscount_args> {
1905
      public getEmiDiscount() {
1906
        super("getEmiDiscount");
1907
      }
1908
 
1909
      protected getEmiDiscount_args getEmptyArgsInstance() {
1910
        return new getEmiDiscount_args();
1911
      }
1912
 
1913
      protected getEmiDiscount_result getResult(I iface, getEmiDiscount_args args) throws org.apache.thrift.TException {
1914
        getEmiDiscount_result result = new getEmiDiscount_result();
1915
        try {
1916
          result.success = iface.getEmiDiscount(args.cartId);
1917
        } catch (PromotionException pex) {
1918
          result.pex = pex;
1919
        }
1920
        return result;
1921
      }
1922
    }
1923
 
6433 anupam.sin 1924
    private static class applyRechargeCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, applyRechargeCoupon_args> {
1925
      public applyRechargeCoupon() {
1926
        super("applyRechargeCoupon");
1927
      }
1928
 
1929
      protected applyRechargeCoupon_args getEmptyArgsInstance() {
1930
        return new applyRechargeCoupon_args();
1931
      }
1932
 
1933
      protected applyRechargeCoupon_result getResult(I iface, applyRechargeCoupon_args args) throws org.apache.thrift.TException {
1934
        applyRechargeCoupon_result result = new applyRechargeCoupon_result();
1935
        try {
1936
          result.success = iface.applyRechargeCoupon(args.couponCode, args.totalAmount, args.userId);
1937
        } catch (PromotionException pex) {
1938
          result.pex = pex;
1939
        }
1940
        return result;
1941
      }
1942
    }
1943
 
3430 rajveer 1944
    private static class trackCouponUsage<I extends Iface> extends org.apache.thrift.ProcessFunction<I, trackCouponUsage_args> {
1945
      public trackCouponUsage() {
1946
        super("trackCouponUsage");
1947
      }
1982 varun.gupt 1948
 
3430 rajveer 1949
      protected trackCouponUsage_args getEmptyArgsInstance() {
1950
        return new trackCouponUsage_args();
1982 varun.gupt 1951
      }
1952
 
3430 rajveer 1953
      protected trackCouponUsage_result getResult(I iface, trackCouponUsage_args args) throws org.apache.thrift.TException {
1954
        trackCouponUsage_result result = new trackCouponUsage_result();
1955
        try {
1956
          iface.trackCouponUsage(args.couponCode, args.transactionId, args.userId);
1957
        } catch (PromotionException pex) {
1958
          result.pex = pex;
1959
        }
1960
        return result;
1961
      }
1982 varun.gupt 1962
    }
1963
 
3430 rajveer 1964
    private static class getCouponUsageCountByUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getCouponUsageCountByUser_args> {
1965
      public getCouponUsageCountByUser() {
1966
        super("getCouponUsageCountByUser");
1982 varun.gupt 1967
      }
1968
 
3430 rajveer 1969
      protected getCouponUsageCountByUser_args getEmptyArgsInstance() {
1970
        return new getCouponUsageCountByUser_args();
1971
      }
1982 varun.gupt 1972
 
3430 rajveer 1973
      protected getCouponUsageCountByUser_result getResult(I iface, getCouponUsageCountByUser_args args) throws org.apache.thrift.TException {
1974
        getCouponUsageCountByUser_result result = new getCouponUsageCountByUser_result();
1975
        try {
1976
          result.success = iface.getCouponUsageCountByUser(args.couponCode, args.userId);
1977
          result.setSuccessIsSet(true);
1978
        } catch (PromotionException pex) {
1979
          result.pex = pex;
1980
        }
1981
        return result;
1982
      }
1982 varun.gupt 1983
    }
1984
 
6497 amit.gupta 1985
    private static class getActiveCodes<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getActiveCodes_args> {
1986
      public getActiveCodes() {
1987
        super("getActiveCodes");
1988
      }
1989
 
1990
      protected getActiveCodes_args getEmptyArgsInstance() {
1991
        return new getActiveCodes_args();
1992
      }
1993
 
1994
      protected getActiveCodes_result getResult(I iface, getActiveCodes_args args) throws org.apache.thrift.TException {
1995
        getActiveCodes_result result = new getActiveCodes_result();
1996
        try {
1997
          result.success = iface.getActiveCodes(args.promotionId);
1998
        } catch (PromotionException pex) {
1999
          result.pex = pex;
2000
        }
2001
        return result;
2002
      }
2003
    }
2004
 
2005
    private static class deleteCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, deleteCoupon_args> {
2006
      public deleteCoupon() {
2007
        super("deleteCoupon");
2008
      }
2009
 
2010
      protected deleteCoupon_args getEmptyArgsInstance() {
2011
        return new deleteCoupon_args();
2012
      }
2013
 
2014
      protected deleteCoupon_result getResult(I iface, deleteCoupon_args args) throws org.apache.thrift.TException {
2015
        deleteCoupon_result result = new deleteCoupon_result();
2016
        try {
2017
          iface.deleteCoupon(args.couponCode);
2018
        } catch (PromotionException pex) {
2019
          result.pex = pex;
2020
        }
2021
        return result;
2022
      }
2023
    }
2024
 
7092 amit.gupta 2025
    private static class getAllCouponsByPromotionId<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllCouponsByPromotionId_args> {
2026
      public getAllCouponsByPromotionId() {
2027
        super("getAllCouponsByPromotionId");
2028
      }
2029
 
2030
      protected getAllCouponsByPromotionId_args getEmptyArgsInstance() {
2031
        return new getAllCouponsByPromotionId_args();
2032
      }
2033
 
2034
      protected getAllCouponsByPromotionId_result getResult(I iface, getAllCouponsByPromotionId_args args) throws org.apache.thrift.TException {
2035
        getAllCouponsByPromotionId_result result = new getAllCouponsByPromotionId_result();
2036
        try {
2037
          result.success = iface.getAllCouponsByPromotionId(args.promotionId);
2038
        } catch (PromotionException pex) {
2039
          result.pex = pex;
2040
        }
2041
        return result;
2042
      }
2043
    }
2044
 
3430 rajveer 2045
    private static class getActiveCoupons<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getActiveCoupons_args> {
2046
      public getActiveCoupons() {
2047
        super("getActiveCoupons");
2048
      }
1982 varun.gupt 2049
 
3430 rajveer 2050
      protected getActiveCoupons_args getEmptyArgsInstance() {
2051
        return new getActiveCoupons_args();
2052
      }
1982 varun.gupt 2053
 
3430 rajveer 2054
      protected getActiveCoupons_result getResult(I iface, getActiveCoupons_args args) throws org.apache.thrift.TException {
2055
        getActiveCoupons_result result = new getActiveCoupons_result();
2056
        try {
2057
          result.success = iface.getActiveCoupons();
2058
        } catch (PromotionException pex) {
2059
          result.pex = pex;
2060
        }
2061
        return result;
2062
      }
1982 varun.gupt 2063
    }
2064
 
6250 amit.gupta 2065
    private static class createCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createCoupon_args> {
2066
      public createCoupon() {
2067
        super("createCoupon");
2068
      }
2069
 
2070
      protected createCoupon_args getEmptyArgsInstance() {
2071
        return new createCoupon_args();
2072
      }
2073
 
2074
      protected createCoupon_result getResult(I iface, createCoupon_args args) throws org.apache.thrift.TException {
2075
        createCoupon_result result = new createCoupon_result();
2076
        try {
6730 anupam.sin 2077
          result.success = iface.createCoupon(args.promotionId, args.couponCode, args.arguments, args.isCod, args.prefix);
6250 amit.gupta 2078
        } catch (PromotionException pex) {
2079
          result.pex = pex;
2080
        }
2081
        return result;
2082
      }
2083
    }
2084
 
3430 rajveer 2085
    private static class getSuccessfulPaymentCountForCoupon<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSuccessfulPaymentCountForCoupon_args> {
2086
      public getSuccessfulPaymentCountForCoupon() {
2087
        super("getSuccessfulPaymentCountForCoupon");
1982 varun.gupt 2088
      }
2089
 
3430 rajveer 2090
      protected getSuccessfulPaymentCountForCoupon_args getEmptyArgsInstance() {
2091
        return new getSuccessfulPaymentCountForCoupon_args();
2092
      }
1982 varun.gupt 2093
 
3430 rajveer 2094
      protected getSuccessfulPaymentCountForCoupon_result getResult(I iface, getSuccessfulPaymentCountForCoupon_args args) throws org.apache.thrift.TException {
2095
        getSuccessfulPaymentCountForCoupon_result result = new getSuccessfulPaymentCountForCoupon_result();
2096
        try {
2097
          result.success = iface.getSuccessfulPaymentCountForCoupon(args.couponCode);
2098
          result.setSuccessIsSet(true);
2099
        } catch (PromotionException pex) {
2100
          result.pex = pex;
1982 varun.gupt 2101
        }
3430 rajveer 2102
        return result;
1982 varun.gupt 2103
      }
2104
    }
2105
 
3430 rajveer 2106
    private static class getRuleDocString<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getRuleDocString_args> {
2107
      public getRuleDocString() {
2108
        super("getRuleDocString");
2109
      }
1982 varun.gupt 2110
 
3430 rajveer 2111
      protected getRuleDocString_args getEmptyArgsInstance() {
2112
        return new getRuleDocString_args();
2113
      }
1982 varun.gupt 2114
 
3430 rajveer 2115
      protected getRuleDocString_result getResult(I iface, getRuleDocString_args args) throws org.apache.thrift.TException {
2116
        getRuleDocString_result result = new getRuleDocString_result();
2117
        result.success = iface.getRuleDocString(args.ruleName);
2118
        return result;
2119
      }
1982 varun.gupt 2120
    }
2121
 
4189 varun.gupt 2122
    private static class getItemDiscountMap<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getItemDiscountMap_args> {
2123
      public getItemDiscountMap() {
2124
        super("getItemDiscountMap");
2125
      }
2126
 
2127
      protected getItemDiscountMap_args getEmptyArgsInstance() {
2128
        return new getItemDiscountMap_args();
2129
      }
2130
 
2131
      protected getItemDiscountMap_result getResult(I iface, getItemDiscountMap_args args) throws org.apache.thrift.TException {
2132
        getItemDiscountMap_result result = new getItemDiscountMap_result();
2133
        try {
2134
          result.success = iface.getItemDiscountMap(args.itemIds);
2135
        } catch (PromotionException pex) {
2136
          result.pex = pex;
2137
        }
2138
        return result;
2139
      }
2140
    }
2141
 
4494 varun.gupt 2142
    private static class getDiscountsForEntity<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getDiscountsForEntity_args> {
2143
      public getDiscountsForEntity() {
2144
        super("getDiscountsForEntity");
2145
      }
2146
 
2147
      protected getDiscountsForEntity_args getEmptyArgsInstance() {
2148
        return new getDiscountsForEntity_args();
2149
      }
2150
 
2151
      protected getDiscountsForEntity_result getResult(I iface, getDiscountsForEntity_args args) throws org.apache.thrift.TException {
2152
        getDiscountsForEntity_result result = new getDiscountsForEntity_result();
2153
        result.success = iface.getDiscountsForEntity(args.entityId);
2154
        return result;
2155
      }
2156
    }
2157
 
5469 rajveer 2158
    private static class addVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addVoucher_args> {
2159
      public addVoucher() {
2160
        super("addVoucher");
2161
      }
2162
 
2163
      protected addVoucher_args getEmptyArgsInstance() {
2164
        return new addVoucher_args();
2165
      }
2166
 
2167
      protected addVoucher_result getResult(I iface, addVoucher_args args) throws org.apache.thrift.TException {
2168
        addVoucher_result result = new addVoucher_result();
2169
        iface.addVoucher(args.voucher);
2170
        return result;
2171
      }
2172
    }
2173
 
2174
    private static class assignVoucher<I extends Iface> extends org.apache.thrift.ProcessFunction<I, assignVoucher_args> {
2175
      public assignVoucher() {
2176
        super("assignVoucher");
2177
      }
2178
 
2179
      protected assignVoucher_args getEmptyArgsInstance() {
2180
        return new assignVoucher_args();
2181
      }
2182
 
2183
      protected assignVoucher_result getResult(I iface, assignVoucher_args args) throws org.apache.thrift.TException {
2184
        assignVoucher_result result = new assignVoucher_result();
2185
        result.success = iface.assignVoucher(args.userId, args.userEmail, args.voucherType, args.amount);
2186
        return result;
2187
      }
2188
    }
2189
 
2190
    private static class markVoucherAsRedeemed<I extends Iface> extends org.apache.thrift.ProcessFunction<I, markVoucherAsRedeemed_args> {
2191
      public markVoucherAsRedeemed() {
2192
        super("markVoucherAsRedeemed");
2193
      }
2194
 
2195
      protected markVoucherAsRedeemed_args getEmptyArgsInstance() {
2196
        return new markVoucherAsRedeemed_args();
2197
      }
2198
 
2199
      protected markVoucherAsRedeemed_result getResult(I iface, markVoucherAsRedeemed_args args) throws org.apache.thrift.TException {
2200
        markVoucherAsRedeemed_result result = new markVoucherAsRedeemed_result();
2201
        result.success = iface.markVoucherAsRedeemed(args.voucherCode, args.redeemedOn);
2202
        result.setSuccessIsSet(true);
2203
        return result;
2204
      }
2205
    }
2206
 
1982 varun.gupt 2207
  }
2208
 
3430 rajveer 2209
  public static class createPromotion_args implements org.apache.thrift.TBase<createPromotion_args, createPromotion_args._Fields>, java.io.Serializable, Cloneable   {
2210
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_args");
1982 varun.gupt 2211
 
3430 rajveer 2212
    private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1);
2213
    private static final org.apache.thrift.protocol.TField RULE_EXECUTION_SRC_FIELD_DESC = new org.apache.thrift.protocol.TField("ruleExecutionSrc", org.apache.thrift.protocol.TType.STRING, (short)2);
2214
    private static final org.apache.thrift.protocol.TField START_ON_FIELD_DESC = new org.apache.thrift.protocol.TField("startOn", org.apache.thrift.protocol.TType.I64, (short)3);
2215
    private static final org.apache.thrift.protocol.TField END_ON_FIELD_DESC = new org.apache.thrift.protocol.TField("endOn", org.apache.thrift.protocol.TType.I64, (short)4);
1982 varun.gupt 2216
 
3430 rajveer 2217
    private String name; // required
2218
    private String ruleExecutionSrc; // required
2219
    private long startOn; // required
2220
    private long endOn; // required
1982 varun.gupt 2221
 
2222
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2223
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2224
      NAME((short)1, "name"),
2225
      RULE_EXECUTION_SRC((short)2, "ruleExecutionSrc"),
2226
      START_ON((short)3, "startOn"),
2227
      END_ON((short)4, "endOn");
2228
 
2229
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2230
 
2231
      static {
2232
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2233
          byName.put(field.getFieldName(), field);
2234
        }
2235
      }
2236
 
2237
      /**
2238
       * Find the _Fields constant that matches fieldId, or null if its not found.
2239
       */
2240
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2241
        switch(fieldId) {
2242
          case 1: // NAME
2243
            return NAME;
2244
          case 2: // RULE_EXECUTION_SRC
2245
            return RULE_EXECUTION_SRC;
2246
          case 3: // START_ON
2247
            return START_ON;
2248
          case 4: // END_ON
2249
            return END_ON;
2250
          default:
2251
            return null;
2252
        }
1982 varun.gupt 2253
      }
2254
 
2255
      /**
2256
       * Find the _Fields constant that matches fieldId, throwing an exception
2257
       * if it is not found.
2258
       */
2259
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2260
        _Fields fields = findByThriftId(fieldId);
2261
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2262
        return fields;
2263
      }
2264
 
2265
      /**
2266
       * Find the _Fields constant that matches name, or null if its not found.
2267
       */
2268
      public static _Fields findByName(String name) {
2269
        return byName.get(name);
2270
      }
2271
 
2272
      private final short _thriftId;
2273
      private final String _fieldName;
2274
 
2275
      _Fields(short thriftId, String fieldName) {
2276
        _thriftId = thriftId;
2277
        _fieldName = fieldName;
2278
      }
2279
 
2280
      public short getThriftFieldId() {
2281
        return _thriftId;
2282
      }
2283
 
2284
      public String getFieldName() {
2285
        return _fieldName;
2286
      }
2287
    }
2288
 
2289
    // isset id assignments
2290
    private static final int __STARTON_ISSET_ID = 0;
2291
    private static final int __ENDON_ISSET_ID = 1;
2292
    private BitSet __isset_bit_vector = new BitSet(2);
2293
 
3430 rajveer 2294
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2295
    static {
3430 rajveer 2296
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2297
      tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2298
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
2299
      tmpMap.put(_Fields.RULE_EXECUTION_SRC, new org.apache.thrift.meta_data.FieldMetaData("ruleExecutionSrc", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2300
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
2301
      tmpMap.put(_Fields.START_ON, new org.apache.thrift.meta_data.FieldMetaData("startOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2302
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
2303
      tmpMap.put(_Fields.END_ON, new org.apache.thrift.meta_data.FieldMetaData("endOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2304
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
2305
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2306
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_args.class, metaDataMap);
1982 varun.gupt 2307
    }
2308
 
2309
    public createPromotion_args() {
2310
    }
2311
 
2312
    public createPromotion_args(
2313
      String name,
2314
      String ruleExecutionSrc,
2315
      long startOn,
2316
      long endOn)
2317
    {
2318
      this();
2319
      this.name = name;
2320
      this.ruleExecutionSrc = ruleExecutionSrc;
2321
      this.startOn = startOn;
2322
      setStartOnIsSet(true);
2323
      this.endOn = endOn;
2324
      setEndOnIsSet(true);
2325
    }
2326
 
2327
    /**
2328
     * Performs a deep copy on <i>other</i>.
2329
     */
2330
    public createPromotion_args(createPromotion_args other) {
2331
      __isset_bit_vector.clear();
2332
      __isset_bit_vector.or(other.__isset_bit_vector);
2333
      if (other.isSetName()) {
2334
        this.name = other.name;
2335
      }
2336
      if (other.isSetRuleExecutionSrc()) {
2337
        this.ruleExecutionSrc = other.ruleExecutionSrc;
2338
      }
2339
      this.startOn = other.startOn;
2340
      this.endOn = other.endOn;
2341
    }
2342
 
2343
    public createPromotion_args deepCopy() {
2344
      return new createPromotion_args(this);
2345
    }
2346
 
3430 rajveer 2347
    @Override
2348
    public void clear() {
2349
      this.name = null;
2350
      this.ruleExecutionSrc = null;
2351
      setStartOnIsSet(false);
2352
      this.startOn = 0;
2353
      setEndOnIsSet(false);
2354
      this.endOn = 0;
1982 varun.gupt 2355
    }
2356
 
2357
    public String getName() {
2358
      return this.name;
2359
    }
2360
 
3430 rajveer 2361
    public void setName(String name) {
1982 varun.gupt 2362
      this.name = name;
2363
    }
2364
 
2365
    public void unsetName() {
2366
      this.name = null;
2367
    }
2368
 
3430 rajveer 2369
    /** Returns true if field name is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2370
    public boolean isSetName() {
2371
      return this.name != null;
2372
    }
2373
 
2374
    public void setNameIsSet(boolean value) {
2375
      if (!value) {
2376
        this.name = null;
2377
      }
2378
    }
2379
 
2380
    public String getRuleExecutionSrc() {
2381
      return this.ruleExecutionSrc;
2382
    }
2383
 
3430 rajveer 2384
    public void setRuleExecutionSrc(String ruleExecutionSrc) {
1982 varun.gupt 2385
      this.ruleExecutionSrc = ruleExecutionSrc;
2386
    }
2387
 
2388
    public void unsetRuleExecutionSrc() {
2389
      this.ruleExecutionSrc = null;
2390
    }
2391
 
3430 rajveer 2392
    /** Returns true if field ruleExecutionSrc is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2393
    public boolean isSetRuleExecutionSrc() {
2394
      return this.ruleExecutionSrc != null;
2395
    }
2396
 
2397
    public void setRuleExecutionSrcIsSet(boolean value) {
2398
      if (!value) {
2399
        this.ruleExecutionSrc = null;
2400
      }
2401
    }
2402
 
2403
    public long getStartOn() {
2404
      return this.startOn;
2405
    }
2406
 
3430 rajveer 2407
    public void setStartOn(long startOn) {
1982 varun.gupt 2408
      this.startOn = startOn;
2409
      setStartOnIsSet(true);
2410
    }
2411
 
2412
    public void unsetStartOn() {
2413
      __isset_bit_vector.clear(__STARTON_ISSET_ID);
2414
    }
2415
 
3430 rajveer 2416
    /** Returns true if field startOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2417
    public boolean isSetStartOn() {
2418
      return __isset_bit_vector.get(__STARTON_ISSET_ID);
2419
    }
2420
 
2421
    public void setStartOnIsSet(boolean value) {
2422
      __isset_bit_vector.set(__STARTON_ISSET_ID, value);
2423
    }
2424
 
2425
    public long getEndOn() {
2426
      return this.endOn;
2427
    }
2428
 
3430 rajveer 2429
    public void setEndOn(long endOn) {
1982 varun.gupt 2430
      this.endOn = endOn;
2431
      setEndOnIsSet(true);
2432
    }
2433
 
2434
    public void unsetEndOn() {
2435
      __isset_bit_vector.clear(__ENDON_ISSET_ID);
2436
    }
2437
 
3430 rajveer 2438
    /** Returns true if field endOn is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2439
    public boolean isSetEndOn() {
2440
      return __isset_bit_vector.get(__ENDON_ISSET_ID);
2441
    }
2442
 
2443
    public void setEndOnIsSet(boolean value) {
2444
      __isset_bit_vector.set(__ENDON_ISSET_ID, value);
2445
    }
2446
 
2447
    public void setFieldValue(_Fields field, Object value) {
2448
      switch (field) {
2449
      case NAME:
2450
        if (value == null) {
2451
          unsetName();
2452
        } else {
2453
          setName((String)value);
2454
        }
2455
        break;
2456
 
2457
      case RULE_EXECUTION_SRC:
2458
        if (value == null) {
2459
          unsetRuleExecutionSrc();
2460
        } else {
2461
          setRuleExecutionSrc((String)value);
2462
        }
2463
        break;
2464
 
2465
      case START_ON:
2466
        if (value == null) {
2467
          unsetStartOn();
2468
        } else {
2469
          setStartOn((Long)value);
2470
        }
2471
        break;
2472
 
2473
      case END_ON:
2474
        if (value == null) {
2475
          unsetEndOn();
2476
        } else {
2477
          setEndOn((Long)value);
2478
        }
2479
        break;
2480
 
2481
      }
2482
    }
2483
 
2484
    public Object getFieldValue(_Fields field) {
2485
      switch (field) {
2486
      case NAME:
2487
        return getName();
2488
 
2489
      case RULE_EXECUTION_SRC:
2490
        return getRuleExecutionSrc();
2491
 
2492
      case START_ON:
3430 rajveer 2493
        return Long.valueOf(getStartOn());
1982 varun.gupt 2494
 
2495
      case END_ON:
3430 rajveer 2496
        return Long.valueOf(getEndOn());
1982 varun.gupt 2497
 
2498
      }
2499
      throw new IllegalStateException();
2500
    }
2501
 
3430 rajveer 2502
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2503
    public boolean isSet(_Fields field) {
2504
      if (field == null) {
2505
        throw new IllegalArgumentException();
2506
      }
1982 varun.gupt 2507
 
2508
      switch (field) {
2509
      case NAME:
2510
        return isSetName();
2511
      case RULE_EXECUTION_SRC:
2512
        return isSetRuleExecutionSrc();
2513
      case START_ON:
2514
        return isSetStartOn();
2515
      case END_ON:
2516
        return isSetEndOn();
2517
      }
2518
      throw new IllegalStateException();
2519
    }
2520
 
2521
    @Override
2522
    public boolean equals(Object that) {
2523
      if (that == null)
2524
        return false;
2525
      if (that instanceof createPromotion_args)
2526
        return this.equals((createPromotion_args)that);
2527
      return false;
2528
    }
2529
 
2530
    public boolean equals(createPromotion_args that) {
2531
      if (that == null)
2532
        return false;
2533
 
2534
      boolean this_present_name = true && this.isSetName();
2535
      boolean that_present_name = true && that.isSetName();
2536
      if (this_present_name || that_present_name) {
2537
        if (!(this_present_name && that_present_name))
2538
          return false;
2539
        if (!this.name.equals(that.name))
2540
          return false;
2541
      }
2542
 
2543
      boolean this_present_ruleExecutionSrc = true && this.isSetRuleExecutionSrc();
2544
      boolean that_present_ruleExecutionSrc = true && that.isSetRuleExecutionSrc();
2545
      if (this_present_ruleExecutionSrc || that_present_ruleExecutionSrc) {
2546
        if (!(this_present_ruleExecutionSrc && that_present_ruleExecutionSrc))
2547
          return false;
2548
        if (!this.ruleExecutionSrc.equals(that.ruleExecutionSrc))
2549
          return false;
2550
      }
2551
 
2552
      boolean this_present_startOn = true;
2553
      boolean that_present_startOn = true;
2554
      if (this_present_startOn || that_present_startOn) {
2555
        if (!(this_present_startOn && that_present_startOn))
2556
          return false;
2557
        if (this.startOn != that.startOn)
2558
          return false;
2559
      }
2560
 
2561
      boolean this_present_endOn = true;
2562
      boolean that_present_endOn = true;
2563
      if (this_present_endOn || that_present_endOn) {
2564
        if (!(this_present_endOn && that_present_endOn))
2565
          return false;
2566
        if (this.endOn != that.endOn)
2567
          return false;
2568
      }
2569
 
2570
      return true;
2571
    }
2572
 
2573
    @Override
2574
    public int hashCode() {
2575
      return 0;
2576
    }
2577
 
2578
    public int compareTo(createPromotion_args other) {
2579
      if (!getClass().equals(other.getClass())) {
2580
        return getClass().getName().compareTo(other.getClass().getName());
2581
      }
2582
 
2583
      int lastComparison = 0;
2584
      createPromotion_args typedOther = (createPromotion_args)other;
2585
 
3430 rajveer 2586
      lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
1982 varun.gupt 2587
      if (lastComparison != 0) {
2588
        return lastComparison;
2589
      }
3430 rajveer 2590
      if (isSetName()) {
2591
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
2592
        if (lastComparison != 0) {
2593
          return lastComparison;
2594
        }
1982 varun.gupt 2595
      }
3430 rajveer 2596
      lastComparison = Boolean.valueOf(isSetRuleExecutionSrc()).compareTo(typedOther.isSetRuleExecutionSrc());
1982 varun.gupt 2597
      if (lastComparison != 0) {
2598
        return lastComparison;
2599
      }
3430 rajveer 2600
      if (isSetRuleExecutionSrc()) {
2601
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleExecutionSrc, typedOther.ruleExecutionSrc);
2602
        if (lastComparison != 0) {
2603
          return lastComparison;
2604
        }
1982 varun.gupt 2605
      }
3430 rajveer 2606
      lastComparison = Boolean.valueOf(isSetStartOn()).compareTo(typedOther.isSetStartOn());
1982 varun.gupt 2607
      if (lastComparison != 0) {
2608
        return lastComparison;
2609
      }
3430 rajveer 2610
      if (isSetStartOn()) {
2611
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startOn, typedOther.startOn);
2612
        if (lastComparison != 0) {
2613
          return lastComparison;
2614
        }
1982 varun.gupt 2615
      }
3430 rajveer 2616
      lastComparison = Boolean.valueOf(isSetEndOn()).compareTo(typedOther.isSetEndOn());
1982 varun.gupt 2617
      if (lastComparison != 0) {
2618
        return lastComparison;
2619
      }
3430 rajveer 2620
      if (isSetEndOn()) {
2621
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endOn, typedOther.endOn);
2622
        if (lastComparison != 0) {
2623
          return lastComparison;
2624
        }
1982 varun.gupt 2625
      }
2626
      return 0;
2627
    }
2628
 
3430 rajveer 2629
    public _Fields fieldForId(int fieldId) {
2630
      return _Fields.findByThriftId(fieldId);
2631
    }
2632
 
2633
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2634
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2635
      iprot.readStructBegin();
2636
      while (true)
2637
      {
2638
        field = iprot.readFieldBegin();
3430 rajveer 2639
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2640
          break;
2641
        }
3430 rajveer 2642
        switch (field.id) {
2643
          case 1: // NAME
2644
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
2645
              this.name = iprot.readString();
2646
            } else { 
2647
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2648
            }
2649
            break;
2650
          case 2: // RULE_EXECUTION_SRC
2651
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
2652
              this.ruleExecutionSrc = iprot.readString();
2653
            } else { 
2654
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2655
            }
2656
            break;
2657
          case 3: // START_ON
2658
            if (field.type == org.apache.thrift.protocol.TType.I64) {
2659
              this.startOn = iprot.readI64();
2660
              setStartOnIsSet(true);
2661
            } else { 
2662
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2663
            }
2664
            break;
2665
          case 4: // END_ON
2666
            if (field.type == org.apache.thrift.protocol.TType.I64) {
2667
              this.endOn = iprot.readI64();
2668
              setEndOnIsSet(true);
2669
            } else { 
2670
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2671
            }
2672
            break;
2673
          default:
2674
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2675
        }
3430 rajveer 2676
        iprot.readFieldEnd();
1982 varun.gupt 2677
      }
2678
      iprot.readStructEnd();
2679
      validate();
2680
    }
2681
 
3430 rajveer 2682
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 2683
      validate();
2684
 
2685
      oprot.writeStructBegin(STRUCT_DESC);
2686
      if (this.name != null) {
2687
        oprot.writeFieldBegin(NAME_FIELD_DESC);
2688
        oprot.writeString(this.name);
2689
        oprot.writeFieldEnd();
2690
      }
2691
      if (this.ruleExecutionSrc != null) {
2692
        oprot.writeFieldBegin(RULE_EXECUTION_SRC_FIELD_DESC);
2693
        oprot.writeString(this.ruleExecutionSrc);
2694
        oprot.writeFieldEnd();
2695
      }
2696
      oprot.writeFieldBegin(START_ON_FIELD_DESC);
2697
      oprot.writeI64(this.startOn);
2698
      oprot.writeFieldEnd();
2699
      oprot.writeFieldBegin(END_ON_FIELD_DESC);
2700
      oprot.writeI64(this.endOn);
2701
      oprot.writeFieldEnd();
2702
      oprot.writeFieldStop();
2703
      oprot.writeStructEnd();
2704
    }
2705
 
2706
    @Override
2707
    public String toString() {
2708
      StringBuilder sb = new StringBuilder("createPromotion_args(");
2709
      boolean first = true;
2710
 
2711
      sb.append("name:");
2712
      if (this.name == null) {
2713
        sb.append("null");
2714
      } else {
2715
        sb.append(this.name);
2716
      }
2717
      first = false;
2718
      if (!first) sb.append(", ");
2719
      sb.append("ruleExecutionSrc:");
2720
      if (this.ruleExecutionSrc == null) {
2721
        sb.append("null");
2722
      } else {
2723
        sb.append(this.ruleExecutionSrc);
2724
      }
2725
      first = false;
2726
      if (!first) sb.append(", ");
2727
      sb.append("startOn:");
2728
      sb.append(this.startOn);
2729
      first = false;
2730
      if (!first) sb.append(", ");
2731
      sb.append("endOn:");
2732
      sb.append(this.endOn);
2733
      first = false;
2734
      sb.append(")");
2735
      return sb.toString();
2736
    }
2737
 
3430 rajveer 2738
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 2739
      // check for required fields
2740
    }
2741
 
3430 rajveer 2742
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
2743
      try {
2744
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
2745
      } catch (org.apache.thrift.TException te) {
2746
        throw new java.io.IOException(te);
2747
      }
2748
    }
2749
 
2750
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
2751
      try {
2752
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
2753
        __isset_bit_vector = new BitSet(1);
2754
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
2755
      } catch (org.apache.thrift.TException te) {
2756
        throw new java.io.IOException(te);
2757
      }
2758
    }
2759
 
1982 varun.gupt 2760
  }
2761
 
3430 rajveer 2762
  public static class createPromotion_result implements org.apache.thrift.TBase<createPromotion_result, createPromotion_result._Fields>, java.io.Serializable, Cloneable   {
2763
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createPromotion_result");
1982 varun.gupt 2764
 
3430 rajveer 2765
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
1982 varun.gupt 2766
 
3430 rajveer 2767
    private PromotionException pex; // required
1982 varun.gupt 2768
 
2769
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 2770
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 2771
      PEX((short)1, "pex");
2772
 
2773
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
2774
 
2775
      static {
2776
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
2777
          byName.put(field.getFieldName(), field);
2778
        }
2779
      }
2780
 
2781
      /**
2782
       * Find the _Fields constant that matches fieldId, or null if its not found.
2783
       */
2784
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 2785
        switch(fieldId) {
2786
          case 1: // PEX
2787
            return PEX;
2788
          default:
2789
            return null;
2790
        }
1982 varun.gupt 2791
      }
2792
 
2793
      /**
2794
       * Find the _Fields constant that matches fieldId, throwing an exception
2795
       * if it is not found.
2796
       */
2797
      public static _Fields findByThriftIdOrThrow(int fieldId) {
2798
        _Fields fields = findByThriftId(fieldId);
2799
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
2800
        return fields;
2801
      }
2802
 
2803
      /**
2804
       * Find the _Fields constant that matches name, or null if its not found.
2805
       */
2806
      public static _Fields findByName(String name) {
2807
        return byName.get(name);
2808
      }
2809
 
2810
      private final short _thriftId;
2811
      private final String _fieldName;
2812
 
2813
      _Fields(short thriftId, String fieldName) {
2814
        _thriftId = thriftId;
2815
        _fieldName = fieldName;
2816
      }
2817
 
2818
      public short getThriftFieldId() {
2819
        return _thriftId;
2820
      }
2821
 
2822
      public String getFieldName() {
2823
        return _fieldName;
2824
      }
2825
    }
2826
 
2827
    // isset id assignments
2828
 
3430 rajveer 2829
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 2830
    static {
3430 rajveer 2831
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
2832
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
2833
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
2834
      metaDataMap = Collections.unmodifiableMap(tmpMap);
2835
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createPromotion_result.class, metaDataMap);
1982 varun.gupt 2836
    }
2837
 
2838
    public createPromotion_result() {
2839
    }
2840
 
2841
    public createPromotion_result(
2842
      PromotionException pex)
2843
    {
2844
      this();
2845
      this.pex = pex;
2846
    }
2847
 
2848
    /**
2849
     * Performs a deep copy on <i>other</i>.
2850
     */
2851
    public createPromotion_result(createPromotion_result other) {
2852
      if (other.isSetPex()) {
2853
        this.pex = new PromotionException(other.pex);
2854
      }
2855
    }
2856
 
2857
    public createPromotion_result deepCopy() {
2858
      return new createPromotion_result(this);
2859
    }
2860
 
3430 rajveer 2861
    @Override
2862
    public void clear() {
2863
      this.pex = null;
1982 varun.gupt 2864
    }
2865
 
2866
    public PromotionException getPex() {
2867
      return this.pex;
2868
    }
2869
 
3430 rajveer 2870
    public void setPex(PromotionException pex) {
1982 varun.gupt 2871
      this.pex = pex;
2872
    }
2873
 
2874
    public void unsetPex() {
2875
      this.pex = null;
2876
    }
2877
 
3430 rajveer 2878
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 2879
    public boolean isSetPex() {
2880
      return this.pex != null;
2881
    }
2882
 
2883
    public void setPexIsSet(boolean value) {
2884
      if (!value) {
2885
        this.pex = null;
2886
      }
2887
    }
2888
 
2889
    public void setFieldValue(_Fields field, Object value) {
2890
      switch (field) {
2891
      case PEX:
2892
        if (value == null) {
2893
          unsetPex();
2894
        } else {
2895
          setPex((PromotionException)value);
2896
        }
2897
        break;
2898
 
2899
      }
2900
    }
2901
 
2902
    public Object getFieldValue(_Fields field) {
2903
      switch (field) {
2904
      case PEX:
2905
        return getPex();
2906
 
2907
      }
2908
      throw new IllegalStateException();
2909
    }
2910
 
3430 rajveer 2911
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
2912
    public boolean isSet(_Fields field) {
2913
      if (field == null) {
2914
        throw new IllegalArgumentException();
2915
      }
1982 varun.gupt 2916
 
2917
      switch (field) {
2918
      case PEX:
2919
        return isSetPex();
2920
      }
2921
      throw new IllegalStateException();
2922
    }
2923
 
2924
    @Override
2925
    public boolean equals(Object that) {
2926
      if (that == null)
2927
        return false;
2928
      if (that instanceof createPromotion_result)
2929
        return this.equals((createPromotion_result)that);
2930
      return false;
2931
    }
2932
 
2933
    public boolean equals(createPromotion_result that) {
2934
      if (that == null)
2935
        return false;
2936
 
2937
      boolean this_present_pex = true && this.isSetPex();
2938
      boolean that_present_pex = true && that.isSetPex();
2939
      if (this_present_pex || that_present_pex) {
2940
        if (!(this_present_pex && that_present_pex))
2941
          return false;
2942
        if (!this.pex.equals(that.pex))
2943
          return false;
2944
      }
2945
 
2946
      return true;
2947
    }
2948
 
2949
    @Override
2950
    public int hashCode() {
2951
      return 0;
2952
    }
2953
 
2954
    public int compareTo(createPromotion_result other) {
2955
      if (!getClass().equals(other.getClass())) {
2956
        return getClass().getName().compareTo(other.getClass().getName());
2957
      }
2958
 
2959
      int lastComparison = 0;
2960
      createPromotion_result typedOther = (createPromotion_result)other;
2961
 
3430 rajveer 2962
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 2963
      if (lastComparison != 0) {
2964
        return lastComparison;
2965
      }
3430 rajveer 2966
      if (isSetPex()) {
2967
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
2968
        if (lastComparison != 0) {
2969
          return lastComparison;
2970
        }
1982 varun.gupt 2971
      }
2972
      return 0;
2973
    }
2974
 
3430 rajveer 2975
    public _Fields fieldForId(int fieldId) {
2976
      return _Fields.findByThriftId(fieldId);
2977
    }
2978
 
2979
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
2980
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 2981
      iprot.readStructBegin();
2982
      while (true)
2983
      {
2984
        field = iprot.readFieldBegin();
3430 rajveer 2985
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 2986
          break;
2987
        }
3430 rajveer 2988
        switch (field.id) {
2989
          case 1: // PEX
2990
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
2991
              this.pex = new PromotionException();
2992
              this.pex.read(iprot);
2993
            } else { 
2994
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2995
            }
2996
            break;
2997
          default:
2998
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 2999
        }
3430 rajveer 3000
        iprot.readFieldEnd();
1982 varun.gupt 3001
      }
3002
      iprot.readStructEnd();
3003
      validate();
3004
    }
3005
 
3430 rajveer 3006
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 3007
      oprot.writeStructBegin(STRUCT_DESC);
3008
 
3009
      if (this.isSetPex()) {
3010
        oprot.writeFieldBegin(PEX_FIELD_DESC);
3011
        this.pex.write(oprot);
3012
        oprot.writeFieldEnd();
3013
      }
3014
      oprot.writeFieldStop();
3015
      oprot.writeStructEnd();
3016
    }
3017
 
3018
    @Override
3019
    public String toString() {
3020
      StringBuilder sb = new StringBuilder("createPromotion_result(");
3021
      boolean first = true;
3022
 
3023
      sb.append("pex:");
3024
      if (this.pex == null) {
3025
        sb.append("null");
3026
      } else {
3027
        sb.append(this.pex);
3028
      }
3029
      first = false;
3030
      sb.append(")");
3031
      return sb.toString();
3032
    }
3033
 
3430 rajveer 3034
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 3035
      // check for required fields
3036
    }
3037
 
3430 rajveer 3038
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3039
      try {
3040
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3041
      } catch (org.apache.thrift.TException te) {
3042
        throw new java.io.IOException(te);
3043
      }
3044
    }
3045
 
3046
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3047
      try {
3048
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3049
      } catch (org.apache.thrift.TException te) {
3050
        throw new java.io.IOException(te);
3051
      }
3052
    }
3053
 
1982 varun.gupt 3054
  }
3055
 
7746 amit.gupta 3056
  public static class removeAllCouponsByPromotionId_args implements org.apache.thrift.TBase<removeAllCouponsByPromotionId_args, removeAllCouponsByPromotionId_args._Fields>, java.io.Serializable, Cloneable   {
3057
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("removeAllCouponsByPromotionId_args");
3058
 
3059
    private static final org.apache.thrift.protocol.TField PROMOTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("promotionId", org.apache.thrift.protocol.TType.I64, (short)1);
3060
 
3061
    private long promotionId; // required
3062
 
3063
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3064
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3065
      PROMOTION_ID((short)1, "promotionId");
3066
 
3067
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3068
 
3069
      static {
3070
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3071
          byName.put(field.getFieldName(), field);
3072
        }
3073
      }
3074
 
3075
      /**
3076
       * Find the _Fields constant that matches fieldId, or null if its not found.
3077
       */
3078
      public static _Fields findByThriftId(int fieldId) {
3079
        switch(fieldId) {
3080
          case 1: // PROMOTION_ID
3081
            return PROMOTION_ID;
3082
          default:
3083
            return null;
3084
        }
3085
      }
3086
 
3087
      /**
3088
       * Find the _Fields constant that matches fieldId, throwing an exception
3089
       * if it is not found.
3090
       */
3091
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3092
        _Fields fields = findByThriftId(fieldId);
3093
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3094
        return fields;
3095
      }
3096
 
3097
      /**
3098
       * Find the _Fields constant that matches name, or null if its not found.
3099
       */
3100
      public static _Fields findByName(String name) {
3101
        return byName.get(name);
3102
      }
3103
 
3104
      private final short _thriftId;
3105
      private final String _fieldName;
3106
 
3107
      _Fields(short thriftId, String fieldName) {
3108
        _thriftId = thriftId;
3109
        _fieldName = fieldName;
3110
      }
3111
 
3112
      public short getThriftFieldId() {
3113
        return _thriftId;
3114
      }
3115
 
3116
      public String getFieldName() {
3117
        return _fieldName;
3118
      }
3119
    }
3120
 
3121
    // isset id assignments
3122
    private static final int __PROMOTIONID_ISSET_ID = 0;
3123
    private BitSet __isset_bit_vector = new BitSet(1);
3124
 
3125
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3126
    static {
3127
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3128
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3129
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
3130
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3131
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(removeAllCouponsByPromotionId_args.class, metaDataMap);
3132
    }
3133
 
3134
    public removeAllCouponsByPromotionId_args() {
3135
    }
3136
 
3137
    public removeAllCouponsByPromotionId_args(
3138
      long promotionId)
3139
    {
3140
      this();
3141
      this.promotionId = promotionId;
3142
      setPromotionIdIsSet(true);
3143
    }
3144
 
3145
    /**
3146
     * Performs a deep copy on <i>other</i>.
3147
     */
3148
    public removeAllCouponsByPromotionId_args(removeAllCouponsByPromotionId_args other) {
3149
      __isset_bit_vector.clear();
3150
      __isset_bit_vector.or(other.__isset_bit_vector);
3151
      this.promotionId = other.promotionId;
3152
    }
3153
 
3154
    public removeAllCouponsByPromotionId_args deepCopy() {
3155
      return new removeAllCouponsByPromotionId_args(this);
3156
    }
3157
 
3158
    @Override
3159
    public void clear() {
3160
      setPromotionIdIsSet(false);
3161
      this.promotionId = 0;
3162
    }
3163
 
3164
    public long getPromotionId() {
3165
      return this.promotionId;
3166
    }
3167
 
3168
    public void setPromotionId(long promotionId) {
3169
      this.promotionId = promotionId;
3170
      setPromotionIdIsSet(true);
3171
    }
3172
 
3173
    public void unsetPromotionId() {
3174
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
3175
    }
3176
 
3177
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
3178
    public boolean isSetPromotionId() {
3179
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
3180
    }
3181
 
3182
    public void setPromotionIdIsSet(boolean value) {
3183
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
3184
    }
3185
 
3186
    public void setFieldValue(_Fields field, Object value) {
3187
      switch (field) {
3188
      case PROMOTION_ID:
3189
        if (value == null) {
3190
          unsetPromotionId();
3191
        } else {
3192
          setPromotionId((Long)value);
3193
        }
3194
        break;
3195
 
3196
      }
3197
    }
3198
 
3199
    public Object getFieldValue(_Fields field) {
3200
      switch (field) {
3201
      case PROMOTION_ID:
3202
        return Long.valueOf(getPromotionId());
3203
 
3204
      }
3205
      throw new IllegalStateException();
3206
    }
3207
 
3208
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3209
    public boolean isSet(_Fields field) {
3210
      if (field == null) {
3211
        throw new IllegalArgumentException();
3212
      }
3213
 
3214
      switch (field) {
3215
      case PROMOTION_ID:
3216
        return isSetPromotionId();
3217
      }
3218
      throw new IllegalStateException();
3219
    }
3220
 
3221
    @Override
3222
    public boolean equals(Object that) {
3223
      if (that == null)
3224
        return false;
3225
      if (that instanceof removeAllCouponsByPromotionId_args)
3226
        return this.equals((removeAllCouponsByPromotionId_args)that);
3227
      return false;
3228
    }
3229
 
3230
    public boolean equals(removeAllCouponsByPromotionId_args that) {
3231
      if (that == null)
3232
        return false;
3233
 
3234
      boolean this_present_promotionId = true;
3235
      boolean that_present_promotionId = true;
3236
      if (this_present_promotionId || that_present_promotionId) {
3237
        if (!(this_present_promotionId && that_present_promotionId))
3238
          return false;
3239
        if (this.promotionId != that.promotionId)
3240
          return false;
3241
      }
3242
 
3243
      return true;
3244
    }
3245
 
3246
    @Override
3247
    public int hashCode() {
3248
      return 0;
3249
    }
3250
 
3251
    public int compareTo(removeAllCouponsByPromotionId_args other) {
3252
      if (!getClass().equals(other.getClass())) {
3253
        return getClass().getName().compareTo(other.getClass().getName());
3254
      }
3255
 
3256
      int lastComparison = 0;
3257
      removeAllCouponsByPromotionId_args typedOther = (removeAllCouponsByPromotionId_args)other;
3258
 
3259
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
3260
      if (lastComparison != 0) {
3261
        return lastComparison;
3262
      }
3263
      if (isSetPromotionId()) {
3264
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
3265
        if (lastComparison != 0) {
3266
          return lastComparison;
3267
        }
3268
      }
3269
      return 0;
3270
    }
3271
 
3272
    public _Fields fieldForId(int fieldId) {
3273
      return _Fields.findByThriftId(fieldId);
3274
    }
3275
 
3276
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3277
      org.apache.thrift.protocol.TField field;
3278
      iprot.readStructBegin();
3279
      while (true)
3280
      {
3281
        field = iprot.readFieldBegin();
3282
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3283
          break;
3284
        }
3285
        switch (field.id) {
3286
          case 1: // PROMOTION_ID
3287
            if (field.type == org.apache.thrift.protocol.TType.I64) {
3288
              this.promotionId = iprot.readI64();
3289
              setPromotionIdIsSet(true);
3290
            } else { 
3291
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3292
            }
3293
            break;
3294
          default:
3295
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3296
        }
3297
        iprot.readFieldEnd();
3298
      }
3299
      iprot.readStructEnd();
3300
      validate();
3301
    }
3302
 
3303
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3304
      validate();
3305
 
3306
      oprot.writeStructBegin(STRUCT_DESC);
3307
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
3308
      oprot.writeI64(this.promotionId);
3309
      oprot.writeFieldEnd();
3310
      oprot.writeFieldStop();
3311
      oprot.writeStructEnd();
3312
    }
3313
 
3314
    @Override
3315
    public String toString() {
3316
      StringBuilder sb = new StringBuilder("removeAllCouponsByPromotionId_args(");
3317
      boolean first = true;
3318
 
3319
      sb.append("promotionId:");
3320
      sb.append(this.promotionId);
3321
      first = false;
3322
      sb.append(")");
3323
      return sb.toString();
3324
    }
3325
 
3326
    public void validate() throws org.apache.thrift.TException {
3327
      // check for required fields
3328
    }
3329
 
3330
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3331
      try {
3332
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3333
      } catch (org.apache.thrift.TException te) {
3334
        throw new java.io.IOException(te);
3335
      }
3336
    }
3337
 
3338
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3339
      try {
3340
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
3341
        __isset_bit_vector = new BitSet(1);
3342
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3343
      } catch (org.apache.thrift.TException te) {
3344
        throw new java.io.IOException(te);
3345
      }
3346
    }
3347
 
3348
  }
3349
 
3350
  public static class removeAllCouponsByPromotionId_result implements org.apache.thrift.TBase<removeAllCouponsByPromotionId_result, removeAllCouponsByPromotionId_result._Fields>, java.io.Serializable, Cloneable   {
3351
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("removeAllCouponsByPromotionId_result");
3352
 
3353
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0);
3354
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
3355
 
3356
    private long success; // required
3357
    private PromotionException pex; // required
3358
 
3359
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3360
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3361
      SUCCESS((short)0, "success"),
3362
      PEX((short)1, "pex");
3363
 
3364
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3365
 
3366
      static {
3367
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3368
          byName.put(field.getFieldName(), field);
3369
        }
3370
      }
3371
 
3372
      /**
3373
       * Find the _Fields constant that matches fieldId, or null if its not found.
3374
       */
3375
      public static _Fields findByThriftId(int fieldId) {
3376
        switch(fieldId) {
3377
          case 0: // SUCCESS
3378
            return SUCCESS;
3379
          case 1: // PEX
3380
            return PEX;
3381
          default:
3382
            return null;
3383
        }
3384
      }
3385
 
3386
      /**
3387
       * Find the _Fields constant that matches fieldId, throwing an exception
3388
       * if it is not found.
3389
       */
3390
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3391
        _Fields fields = findByThriftId(fieldId);
3392
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3393
        return fields;
3394
      }
3395
 
3396
      /**
3397
       * Find the _Fields constant that matches name, or null if its not found.
3398
       */
3399
      public static _Fields findByName(String name) {
3400
        return byName.get(name);
3401
      }
3402
 
3403
      private final short _thriftId;
3404
      private final String _fieldName;
3405
 
3406
      _Fields(short thriftId, String fieldName) {
3407
        _thriftId = thriftId;
3408
        _fieldName = fieldName;
3409
      }
3410
 
3411
      public short getThriftFieldId() {
3412
        return _thriftId;
3413
      }
3414
 
3415
      public String getFieldName() {
3416
        return _fieldName;
3417
      }
3418
    }
3419
 
3420
    // isset id assignments
3421
    private static final int __SUCCESS_ISSET_ID = 0;
3422
    private BitSet __isset_bit_vector = new BitSet(1);
3423
 
3424
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3425
    static {
3426
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3427
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3428
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
3429
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3430
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
3431
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3432
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(removeAllCouponsByPromotionId_result.class, metaDataMap);
3433
    }
3434
 
3435
    public removeAllCouponsByPromotionId_result() {
3436
    }
3437
 
3438
    public removeAllCouponsByPromotionId_result(
3439
      long success,
3440
      PromotionException pex)
3441
    {
3442
      this();
3443
      this.success = success;
3444
      setSuccessIsSet(true);
3445
      this.pex = pex;
3446
    }
3447
 
3448
    /**
3449
     * Performs a deep copy on <i>other</i>.
3450
     */
3451
    public removeAllCouponsByPromotionId_result(removeAllCouponsByPromotionId_result other) {
3452
      __isset_bit_vector.clear();
3453
      __isset_bit_vector.or(other.__isset_bit_vector);
3454
      this.success = other.success;
3455
      if (other.isSetPex()) {
3456
        this.pex = new PromotionException(other.pex);
3457
      }
3458
    }
3459
 
3460
    public removeAllCouponsByPromotionId_result deepCopy() {
3461
      return new removeAllCouponsByPromotionId_result(this);
3462
    }
3463
 
3464
    @Override
3465
    public void clear() {
3466
      setSuccessIsSet(false);
3467
      this.success = 0;
3468
      this.pex = null;
3469
    }
3470
 
3471
    public long getSuccess() {
3472
      return this.success;
3473
    }
3474
 
3475
    public void setSuccess(long success) {
3476
      this.success = success;
3477
      setSuccessIsSet(true);
3478
    }
3479
 
3480
    public void unsetSuccess() {
3481
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
3482
    }
3483
 
3484
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3485
    public boolean isSetSuccess() {
3486
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
3487
    }
3488
 
3489
    public void setSuccessIsSet(boolean value) {
3490
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
3491
    }
3492
 
3493
    public PromotionException getPex() {
3494
      return this.pex;
3495
    }
3496
 
3497
    public void setPex(PromotionException pex) {
3498
      this.pex = pex;
3499
    }
3500
 
3501
    public void unsetPex() {
3502
      this.pex = null;
3503
    }
3504
 
3505
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3506
    public boolean isSetPex() {
3507
      return this.pex != null;
3508
    }
3509
 
3510
    public void setPexIsSet(boolean value) {
3511
      if (!value) {
3512
        this.pex = null;
3513
      }
3514
    }
3515
 
3516
    public void setFieldValue(_Fields field, Object value) {
3517
      switch (field) {
3518
      case SUCCESS:
3519
        if (value == null) {
3520
          unsetSuccess();
3521
        } else {
3522
          setSuccess((Long)value);
3523
        }
3524
        break;
3525
 
3526
      case PEX:
3527
        if (value == null) {
3528
          unsetPex();
3529
        } else {
3530
          setPex((PromotionException)value);
3531
        }
3532
        break;
3533
 
3534
      }
3535
    }
3536
 
3537
    public Object getFieldValue(_Fields field) {
3538
      switch (field) {
3539
      case SUCCESS:
3540
        return Long.valueOf(getSuccess());
3541
 
3542
      case PEX:
3543
        return getPex();
3544
 
3545
      }
3546
      throw new IllegalStateException();
3547
    }
3548
 
3549
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3550
    public boolean isSet(_Fields field) {
3551
      if (field == null) {
3552
        throw new IllegalArgumentException();
3553
      }
3554
 
3555
      switch (field) {
3556
      case SUCCESS:
3557
        return isSetSuccess();
3558
      case PEX:
3559
        return isSetPex();
3560
      }
3561
      throw new IllegalStateException();
3562
    }
3563
 
3564
    @Override
3565
    public boolean equals(Object that) {
3566
      if (that == null)
3567
        return false;
3568
      if (that instanceof removeAllCouponsByPromotionId_result)
3569
        return this.equals((removeAllCouponsByPromotionId_result)that);
3570
      return false;
3571
    }
3572
 
3573
    public boolean equals(removeAllCouponsByPromotionId_result that) {
3574
      if (that == null)
3575
        return false;
3576
 
3577
      boolean this_present_success = true;
3578
      boolean that_present_success = true;
3579
      if (this_present_success || that_present_success) {
3580
        if (!(this_present_success && that_present_success))
3581
          return false;
3582
        if (this.success != that.success)
3583
          return false;
3584
      }
3585
 
3586
      boolean this_present_pex = true && this.isSetPex();
3587
      boolean that_present_pex = true && that.isSetPex();
3588
      if (this_present_pex || that_present_pex) {
3589
        if (!(this_present_pex && that_present_pex))
3590
          return false;
3591
        if (!this.pex.equals(that.pex))
3592
          return false;
3593
      }
3594
 
3595
      return true;
3596
    }
3597
 
3598
    @Override
3599
    public int hashCode() {
3600
      return 0;
3601
    }
3602
 
3603
    public int compareTo(removeAllCouponsByPromotionId_result other) {
3604
      if (!getClass().equals(other.getClass())) {
3605
        return getClass().getName().compareTo(other.getClass().getName());
3606
      }
3607
 
3608
      int lastComparison = 0;
3609
      removeAllCouponsByPromotionId_result typedOther = (removeAllCouponsByPromotionId_result)other;
3610
 
3611
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3612
      if (lastComparison != 0) {
3613
        return lastComparison;
3614
      }
3615
      if (isSetSuccess()) {
3616
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
3617
        if (lastComparison != 0) {
3618
          return lastComparison;
3619
        }
3620
      }
3621
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3622
      if (lastComparison != 0) {
3623
        return lastComparison;
3624
      }
3625
      if (isSetPex()) {
3626
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
3627
        if (lastComparison != 0) {
3628
          return lastComparison;
3629
        }
3630
      }
3631
      return 0;
3632
    }
3633
 
3634
    public _Fields fieldForId(int fieldId) {
3635
      return _Fields.findByThriftId(fieldId);
3636
    }
3637
 
3638
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3639
      org.apache.thrift.protocol.TField field;
3640
      iprot.readStructBegin();
3641
      while (true)
3642
      {
3643
        field = iprot.readFieldBegin();
3644
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3645
          break;
3646
        }
3647
        switch (field.id) {
3648
          case 0: // SUCCESS
3649
            if (field.type == org.apache.thrift.protocol.TType.I64) {
3650
              this.success = iprot.readI64();
3651
              setSuccessIsSet(true);
3652
            } else { 
3653
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3654
            }
3655
            break;
3656
          case 1: // PEX
3657
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
3658
              this.pex = new PromotionException();
3659
              this.pex.read(iprot);
3660
            } else { 
3661
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3662
            }
3663
            break;
3664
          default:
3665
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3666
        }
3667
        iprot.readFieldEnd();
3668
      }
3669
      iprot.readStructEnd();
3670
      validate();
3671
    }
3672
 
3673
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3674
      oprot.writeStructBegin(STRUCT_DESC);
3675
 
3676
      if (this.isSetSuccess()) {
3677
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
3678
        oprot.writeI64(this.success);
3679
        oprot.writeFieldEnd();
3680
      } else if (this.isSetPex()) {
3681
        oprot.writeFieldBegin(PEX_FIELD_DESC);
3682
        this.pex.write(oprot);
3683
        oprot.writeFieldEnd();
3684
      }
3685
      oprot.writeFieldStop();
3686
      oprot.writeStructEnd();
3687
    }
3688
 
3689
    @Override
3690
    public String toString() {
3691
      StringBuilder sb = new StringBuilder("removeAllCouponsByPromotionId_result(");
3692
      boolean first = true;
3693
 
3694
      sb.append("success:");
3695
      sb.append(this.success);
3696
      first = false;
3697
      if (!first) sb.append(", ");
3698
      sb.append("pex:");
3699
      if (this.pex == null) {
3700
        sb.append("null");
3701
      } else {
3702
        sb.append(this.pex);
3703
      }
3704
      first = false;
3705
      sb.append(")");
3706
      return sb.toString();
3707
    }
3708
 
3709
    public void validate() throws org.apache.thrift.TException {
3710
      // check for required fields
3711
    }
3712
 
3713
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
3714
      try {
3715
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
3716
      } catch (org.apache.thrift.TException te) {
3717
        throw new java.io.IOException(te);
3718
      }
3719
    }
3720
 
3721
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
3722
      try {
3723
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
3724
      } catch (org.apache.thrift.TException te) {
3725
        throw new java.io.IOException(te);
3726
      }
3727
    }
3728
 
3729
  }
3730
 
6301 amit.gupta 3731
  public static class getCoupon_args implements org.apache.thrift.TBase<getCoupon_args, getCoupon_args._Fields>, java.io.Serializable, Cloneable   {
3732
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCoupon_args");
3733
 
3734
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)1);
3735
 
3736
    private String couponCode; // required
3737
 
3738
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3739
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3740
      COUPON_CODE((short)1, "couponCode");
3741
 
3742
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
3743
 
3744
      static {
3745
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
3746
          byName.put(field.getFieldName(), field);
3747
        }
3748
      }
3749
 
3750
      /**
3751
       * Find the _Fields constant that matches fieldId, or null if its not found.
3752
       */
3753
      public static _Fields findByThriftId(int fieldId) {
3754
        switch(fieldId) {
3755
          case 1: // COUPON_CODE
3756
            return COUPON_CODE;
3757
          default:
3758
            return null;
3759
        }
3760
      }
3761
 
3762
      /**
3763
       * Find the _Fields constant that matches fieldId, throwing an exception
3764
       * if it is not found.
3765
       */
3766
      public static _Fields findByThriftIdOrThrow(int fieldId) {
3767
        _Fields fields = findByThriftId(fieldId);
3768
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
3769
        return fields;
3770
      }
3771
 
3772
      /**
3773
       * Find the _Fields constant that matches name, or null if its not found.
3774
       */
3775
      public static _Fields findByName(String name) {
3776
        return byName.get(name);
3777
      }
3778
 
3779
      private final short _thriftId;
3780
      private final String _fieldName;
3781
 
3782
      _Fields(short thriftId, String fieldName) {
3783
        _thriftId = thriftId;
3784
        _fieldName = fieldName;
3785
      }
3786
 
3787
      public short getThriftFieldId() {
3788
        return _thriftId;
3789
      }
3790
 
3791
      public String getFieldName() {
3792
        return _fieldName;
3793
      }
3794
    }
3795
 
3796
    // isset id assignments
3797
 
3798
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3799
    static {
3800
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
3801
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
3802
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
3803
      metaDataMap = Collections.unmodifiableMap(tmpMap);
3804
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCoupon_args.class, metaDataMap);
3805
    }
3806
 
3807
    public getCoupon_args() {
3808
    }
3809
 
3810
    public getCoupon_args(
3811
      String couponCode)
3812
    {
3813
      this();
3814
      this.couponCode = couponCode;
3815
    }
3816
 
3817
    /**
3818
     * Performs a deep copy on <i>other</i>.
3819
     */
3820
    public getCoupon_args(getCoupon_args other) {
3821
      if (other.isSetCouponCode()) {
3822
        this.couponCode = other.couponCode;
3823
      }
3824
    }
3825
 
3826
    public getCoupon_args deepCopy() {
3827
      return new getCoupon_args(this);
3828
    }
3829
 
3830
    @Override
3831
    public void clear() {
3832
      this.couponCode = null;
3833
    }
3834
 
3835
    public String getCouponCode() {
3836
      return this.couponCode;
3837
    }
3838
 
3839
    public void setCouponCode(String couponCode) {
3840
      this.couponCode = couponCode;
3841
    }
3842
 
3843
    public void unsetCouponCode() {
3844
      this.couponCode = null;
3845
    }
3846
 
3847
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3848
    public boolean isSetCouponCode() {
3849
      return this.couponCode != null;
3850
    }
3851
 
3852
    public void setCouponCodeIsSet(boolean value) {
3853
      if (!value) {
3854
        this.couponCode = null;
3855
      }
3856
    }
3857
 
3858
    public void setFieldValue(_Fields field, Object value) {
3859
      switch (field) {
3860
      case COUPON_CODE:
3861
        if (value == null) {
3862
          unsetCouponCode();
3863
        } else {
3864
          setCouponCode((String)value);
3865
        }
3866
        break;
3867
 
3868
      }
3869
    }
3870
 
3871
    public Object getFieldValue(_Fields field) {
3872
      switch (field) {
3873
      case COUPON_CODE:
3874
        return getCouponCode();
3875
 
3876
      }
3877
      throw new IllegalStateException();
3878
    }
3879
 
3880
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
3881
    public boolean isSet(_Fields field) {
3882
      if (field == null) {
3883
        throw new IllegalArgumentException();
3884
      }
3885
 
3886
      switch (field) {
3887
      case COUPON_CODE:
3888
        return isSetCouponCode();
3889
      }
3890
      throw new IllegalStateException();
3891
    }
3892
 
3893
    @Override
3894
    public boolean equals(Object that) {
3895
      if (that == null)
3896
        return false;
3897
      if (that instanceof getCoupon_args)
3898
        return this.equals((getCoupon_args)that);
3899
      return false;
3900
    }
3901
 
3902
    public boolean equals(getCoupon_args that) {
3903
      if (that == null)
3904
        return false;
3905
 
3906
      boolean this_present_couponCode = true && this.isSetCouponCode();
3907
      boolean that_present_couponCode = true && that.isSetCouponCode();
3908
      if (this_present_couponCode || that_present_couponCode) {
3909
        if (!(this_present_couponCode && that_present_couponCode))
3910
          return false;
3911
        if (!this.couponCode.equals(that.couponCode))
3912
          return false;
3913
      }
3914
 
3915
      return true;
3916
    }
3917
 
3918
    @Override
3919
    public int hashCode() {
3920
      return 0;
3921
    }
3922
 
3923
    public int compareTo(getCoupon_args other) {
3924
      if (!getClass().equals(other.getClass())) {
3925
        return getClass().getName().compareTo(other.getClass().getName());
3926
      }
3927
 
3928
      int lastComparison = 0;
3929
      getCoupon_args typedOther = (getCoupon_args)other;
3930
 
3931
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3932
      if (lastComparison != 0) {
3933
        return lastComparison;
3934
      }
3935
      if (isSetCouponCode()) {
3936
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
3937
        if (lastComparison != 0) {
3938
          return lastComparison;
3939
        }
3940
      }
3941
      return 0;
3942
    }
3943
 
3944
    public _Fields fieldForId(int fieldId) {
3945
      return _Fields.findByThriftId(fieldId);
3946
    }
3947
 
3948
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
3949
      org.apache.thrift.protocol.TField field;
3950
      iprot.readStructBegin();
3951
      while (true)
3952
      {
3953
        field = iprot.readFieldBegin();
3954
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3955
          break;
3956
        }
3957
        switch (field.id) {
3958
          case 1: // COUPON_CODE
3959
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
3960
              this.couponCode = iprot.readString();
3961
            } else { 
3962
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3963
            }
3964
            break;
3965
          default:
3966
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3967
        }
3968
        iprot.readFieldEnd();
3969
      }
3970
      iprot.readStructEnd();
3971
      validate();
3972
    }
3973
 
3974
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3975
      validate();
3976
 
3977
      oprot.writeStructBegin(STRUCT_DESC);
3978
      if (this.couponCode != null) {
3979
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
3980
        oprot.writeString(this.couponCode);
3981
        oprot.writeFieldEnd();
3982
      }
3983
      oprot.writeFieldStop();
3984
      oprot.writeStructEnd();
3985
    }
3986
 
3987
    @Override
3988
    public String toString() {
3989
      StringBuilder sb = new StringBuilder("getCoupon_args(");
3990
      boolean first = true;
3991
 
3992
      sb.append("couponCode:");
3993
      if (this.couponCode == null) {
3994
        sb.append("null");
3995
      } else {
3996
        sb.append(this.couponCode);
3997
      }
3998
      first = false;
3999
      sb.append(")");
4000
      return sb.toString();
4001
    }
4002
 
4003
    public void validate() throws org.apache.thrift.TException {
4004
      // check for required fields
4005
    }
4006
 
4007
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4008
      try {
4009
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4010
      } catch (org.apache.thrift.TException te) {
4011
        throw new java.io.IOException(te);
4012
      }
4013
    }
4014
 
4015
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4016
      try {
4017
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4018
      } catch (org.apache.thrift.TException te) {
4019
        throw new java.io.IOException(te);
4020
      }
4021
    }
4022
 
4023
  }
4024
 
4025
  public static class getCoupon_result implements org.apache.thrift.TBase<getCoupon_result, getCoupon_result._Fields>, java.io.Serializable, Cloneable   {
4026
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCoupon_result");
4027
 
4028
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
4029
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
4030
 
4031
    private Coupon success; // required
4032
    private PromotionException pex; // required
4033
 
4034
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4035
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4036
      SUCCESS((short)0, "success"),
4037
      PEX((short)1, "pex");
4038
 
4039
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4040
 
4041
      static {
4042
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4043
          byName.put(field.getFieldName(), field);
4044
        }
4045
      }
4046
 
4047
      /**
4048
       * Find the _Fields constant that matches fieldId, or null if its not found.
4049
       */
4050
      public static _Fields findByThriftId(int fieldId) {
4051
        switch(fieldId) {
4052
          case 0: // SUCCESS
4053
            return SUCCESS;
4054
          case 1: // PEX
4055
            return PEX;
4056
          default:
4057
            return null;
4058
        }
4059
      }
4060
 
4061
      /**
4062
       * Find the _Fields constant that matches fieldId, throwing an exception
4063
       * if it is not found.
4064
       */
4065
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4066
        _Fields fields = findByThriftId(fieldId);
4067
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4068
        return fields;
4069
      }
4070
 
4071
      /**
4072
       * Find the _Fields constant that matches name, or null if its not found.
4073
       */
4074
      public static _Fields findByName(String name) {
4075
        return byName.get(name);
4076
      }
4077
 
4078
      private final short _thriftId;
4079
      private final String _fieldName;
4080
 
4081
      _Fields(short thriftId, String fieldName) {
4082
        _thriftId = thriftId;
4083
        _fieldName = fieldName;
4084
      }
4085
 
4086
      public short getThriftFieldId() {
4087
        return _thriftId;
4088
      }
4089
 
4090
      public String getFieldName() {
4091
        return _fieldName;
4092
      }
4093
    }
4094
 
4095
    // isset id assignments
4096
 
4097
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4098
    static {
4099
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4100
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4101
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class)));
4102
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4103
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4104
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4105
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCoupon_result.class, metaDataMap);
4106
    }
4107
 
4108
    public getCoupon_result() {
4109
    }
4110
 
4111
    public getCoupon_result(
4112
      Coupon success,
4113
      PromotionException pex)
4114
    {
4115
      this();
4116
      this.success = success;
4117
      this.pex = pex;
4118
    }
4119
 
4120
    /**
4121
     * Performs a deep copy on <i>other</i>.
4122
     */
4123
    public getCoupon_result(getCoupon_result other) {
4124
      if (other.isSetSuccess()) {
4125
        this.success = new Coupon(other.success);
4126
      }
4127
      if (other.isSetPex()) {
4128
        this.pex = new PromotionException(other.pex);
4129
      }
4130
    }
4131
 
4132
    public getCoupon_result deepCopy() {
4133
      return new getCoupon_result(this);
4134
    }
4135
 
4136
    @Override
4137
    public void clear() {
4138
      this.success = null;
4139
      this.pex = null;
4140
    }
4141
 
4142
    public Coupon getSuccess() {
4143
      return this.success;
4144
    }
4145
 
4146
    public void setSuccess(Coupon success) {
4147
      this.success = success;
4148
    }
4149
 
4150
    public void unsetSuccess() {
4151
      this.success = null;
4152
    }
4153
 
4154
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
4155
    public boolean isSetSuccess() {
4156
      return this.success != null;
4157
    }
4158
 
4159
    public void setSuccessIsSet(boolean value) {
4160
      if (!value) {
4161
        this.success = null;
4162
      }
4163
    }
4164
 
4165
    public PromotionException getPex() {
4166
      return this.pex;
4167
    }
4168
 
4169
    public void setPex(PromotionException pex) {
4170
      this.pex = pex;
4171
    }
4172
 
4173
    public void unsetPex() {
4174
      this.pex = null;
4175
    }
4176
 
4177
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
4178
    public boolean isSetPex() {
4179
      return this.pex != null;
4180
    }
4181
 
4182
    public void setPexIsSet(boolean value) {
4183
      if (!value) {
4184
        this.pex = null;
4185
      }
4186
    }
4187
 
4188
    public void setFieldValue(_Fields field, Object value) {
4189
      switch (field) {
4190
      case SUCCESS:
4191
        if (value == null) {
4192
          unsetSuccess();
4193
        } else {
4194
          setSuccess((Coupon)value);
4195
        }
4196
        break;
4197
 
4198
      case PEX:
4199
        if (value == null) {
4200
          unsetPex();
4201
        } else {
4202
          setPex((PromotionException)value);
4203
        }
4204
        break;
4205
 
4206
      }
4207
    }
4208
 
4209
    public Object getFieldValue(_Fields field) {
4210
      switch (field) {
4211
      case SUCCESS:
4212
        return getSuccess();
4213
 
4214
      case PEX:
4215
        return getPex();
4216
 
4217
      }
4218
      throw new IllegalStateException();
4219
    }
4220
 
4221
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4222
    public boolean isSet(_Fields field) {
4223
      if (field == null) {
4224
        throw new IllegalArgumentException();
4225
      }
4226
 
4227
      switch (field) {
4228
      case SUCCESS:
4229
        return isSetSuccess();
4230
      case PEX:
4231
        return isSetPex();
4232
      }
4233
      throw new IllegalStateException();
4234
    }
4235
 
4236
    @Override
4237
    public boolean equals(Object that) {
4238
      if (that == null)
4239
        return false;
4240
      if (that instanceof getCoupon_result)
4241
        return this.equals((getCoupon_result)that);
4242
      return false;
4243
    }
4244
 
4245
    public boolean equals(getCoupon_result that) {
4246
      if (that == null)
4247
        return false;
4248
 
4249
      boolean this_present_success = true && this.isSetSuccess();
4250
      boolean that_present_success = true && that.isSetSuccess();
4251
      if (this_present_success || that_present_success) {
4252
        if (!(this_present_success && that_present_success))
4253
          return false;
4254
        if (!this.success.equals(that.success))
4255
          return false;
4256
      }
4257
 
4258
      boolean this_present_pex = true && this.isSetPex();
4259
      boolean that_present_pex = true && that.isSetPex();
4260
      if (this_present_pex || that_present_pex) {
4261
        if (!(this_present_pex && that_present_pex))
4262
          return false;
4263
        if (!this.pex.equals(that.pex))
4264
          return false;
4265
      }
4266
 
4267
      return true;
4268
    }
4269
 
4270
    @Override
4271
    public int hashCode() {
4272
      return 0;
4273
    }
4274
 
4275
    public int compareTo(getCoupon_result other) {
4276
      if (!getClass().equals(other.getClass())) {
4277
        return getClass().getName().compareTo(other.getClass().getName());
4278
      }
4279
 
4280
      int lastComparison = 0;
4281
      getCoupon_result typedOther = (getCoupon_result)other;
4282
 
4283
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
4284
      if (lastComparison != 0) {
4285
        return lastComparison;
4286
      }
4287
      if (isSetSuccess()) {
4288
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4289
        if (lastComparison != 0) {
4290
          return lastComparison;
4291
        }
4292
      }
4293
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
4294
      if (lastComparison != 0) {
4295
        return lastComparison;
4296
      }
4297
      if (isSetPex()) {
4298
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
4299
        if (lastComparison != 0) {
4300
          return lastComparison;
4301
        }
4302
      }
4303
      return 0;
4304
    }
4305
 
4306
    public _Fields fieldForId(int fieldId) {
4307
      return _Fields.findByThriftId(fieldId);
4308
    }
4309
 
4310
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4311
      org.apache.thrift.protocol.TField field;
4312
      iprot.readStructBegin();
4313
      while (true)
4314
      {
4315
        field = iprot.readFieldBegin();
4316
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4317
          break;
4318
        }
4319
        switch (field.id) {
4320
          case 0: // SUCCESS
4321
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4322
              this.success = new Coupon();
4323
              this.success.read(iprot);
4324
            } else { 
4325
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4326
            }
4327
            break;
4328
          case 1: // PEX
4329
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
4330
              this.pex = new PromotionException();
4331
              this.pex.read(iprot);
4332
            } else { 
4333
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4334
            }
4335
            break;
4336
          default:
4337
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4338
        }
4339
        iprot.readFieldEnd();
4340
      }
4341
      iprot.readStructEnd();
4342
      validate();
4343
    }
4344
 
4345
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4346
      oprot.writeStructBegin(STRUCT_DESC);
4347
 
4348
      if (this.isSetSuccess()) {
4349
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
4350
        this.success.write(oprot);
4351
        oprot.writeFieldEnd();
4352
      } else if (this.isSetPex()) {
4353
        oprot.writeFieldBegin(PEX_FIELD_DESC);
4354
        this.pex.write(oprot);
4355
        oprot.writeFieldEnd();
4356
      }
4357
      oprot.writeFieldStop();
4358
      oprot.writeStructEnd();
4359
    }
4360
 
4361
    @Override
4362
    public String toString() {
4363
      StringBuilder sb = new StringBuilder("getCoupon_result(");
4364
      boolean first = true;
4365
 
4366
      sb.append("success:");
4367
      if (this.success == null) {
4368
        sb.append("null");
4369
      } else {
4370
        sb.append(this.success);
4371
      }
4372
      first = false;
4373
      if (!first) sb.append(", ");
4374
      sb.append("pex:");
4375
      if (this.pex == null) {
4376
        sb.append("null");
4377
      } else {
4378
        sb.append(this.pex);
4379
      }
4380
      first = false;
4381
      sb.append(")");
4382
      return sb.toString();
4383
    }
4384
 
4385
    public void validate() throws org.apache.thrift.TException {
4386
      // check for required fields
4387
    }
4388
 
4389
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4390
      try {
4391
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4392
      } catch (org.apache.thrift.TException te) {
4393
        throw new java.io.IOException(te);
4394
      }
4395
    }
4396
 
4397
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4398
      try {
4399
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4400
      } catch (org.apache.thrift.TException te) {
4401
        throw new java.io.IOException(te);
4402
      }
4403
    }
4404
 
4405
  }
4406
 
4407
  public static class isGiftVoucher_args implements org.apache.thrift.TBase<isGiftVoucher_args, isGiftVoucher_args._Fields>, java.io.Serializable, Cloneable   {
4408
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isGiftVoucher_args");
4409
 
4410
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)1);
4411
 
4412
    private String couponCode; // required
4413
 
4414
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4415
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4416
      COUPON_CODE((short)1, "couponCode");
4417
 
4418
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4419
 
4420
      static {
4421
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4422
          byName.put(field.getFieldName(), field);
4423
        }
4424
      }
4425
 
4426
      /**
4427
       * Find the _Fields constant that matches fieldId, or null if its not found.
4428
       */
4429
      public static _Fields findByThriftId(int fieldId) {
4430
        switch(fieldId) {
4431
          case 1: // COUPON_CODE
4432
            return COUPON_CODE;
4433
          default:
4434
            return null;
4435
        }
4436
      }
4437
 
4438
      /**
4439
       * Find the _Fields constant that matches fieldId, throwing an exception
4440
       * if it is not found.
4441
       */
4442
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4443
        _Fields fields = findByThriftId(fieldId);
4444
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4445
        return fields;
4446
      }
4447
 
4448
      /**
4449
       * Find the _Fields constant that matches name, or null if its not found.
4450
       */
4451
      public static _Fields findByName(String name) {
4452
        return byName.get(name);
4453
      }
4454
 
4455
      private final short _thriftId;
4456
      private final String _fieldName;
4457
 
4458
      _Fields(short thriftId, String fieldName) {
4459
        _thriftId = thriftId;
4460
        _fieldName = fieldName;
4461
      }
4462
 
4463
      public short getThriftFieldId() {
4464
        return _thriftId;
4465
      }
4466
 
4467
      public String getFieldName() {
4468
        return _fieldName;
4469
      }
4470
    }
4471
 
4472
    // isset id assignments
4473
 
4474
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4475
    static {
4476
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4477
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4478
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
4479
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4480
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isGiftVoucher_args.class, metaDataMap);
4481
    }
4482
 
4483
    public isGiftVoucher_args() {
4484
    }
4485
 
4486
    public isGiftVoucher_args(
4487
      String couponCode)
4488
    {
4489
      this();
4490
      this.couponCode = couponCode;
4491
    }
4492
 
4493
    /**
4494
     * Performs a deep copy on <i>other</i>.
4495
     */
4496
    public isGiftVoucher_args(isGiftVoucher_args other) {
4497
      if (other.isSetCouponCode()) {
4498
        this.couponCode = other.couponCode;
4499
      }
4500
    }
4501
 
4502
    public isGiftVoucher_args deepCopy() {
4503
      return new isGiftVoucher_args(this);
4504
    }
4505
 
4506
    @Override
4507
    public void clear() {
4508
      this.couponCode = null;
4509
    }
4510
 
4511
    public String getCouponCode() {
4512
      return this.couponCode;
4513
    }
4514
 
4515
    public void setCouponCode(String couponCode) {
4516
      this.couponCode = couponCode;
4517
    }
4518
 
4519
    public void unsetCouponCode() {
4520
      this.couponCode = null;
4521
    }
4522
 
4523
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
4524
    public boolean isSetCouponCode() {
4525
      return this.couponCode != null;
4526
    }
4527
 
4528
    public void setCouponCodeIsSet(boolean value) {
4529
      if (!value) {
4530
        this.couponCode = null;
4531
      }
4532
    }
4533
 
4534
    public void setFieldValue(_Fields field, Object value) {
4535
      switch (field) {
4536
      case COUPON_CODE:
4537
        if (value == null) {
4538
          unsetCouponCode();
4539
        } else {
4540
          setCouponCode((String)value);
4541
        }
4542
        break;
4543
 
4544
      }
4545
    }
4546
 
4547
    public Object getFieldValue(_Fields field) {
4548
      switch (field) {
4549
      case COUPON_CODE:
4550
        return getCouponCode();
4551
 
4552
      }
4553
      throw new IllegalStateException();
4554
    }
4555
 
4556
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4557
    public boolean isSet(_Fields field) {
4558
      if (field == null) {
4559
        throw new IllegalArgumentException();
4560
      }
4561
 
4562
      switch (field) {
4563
      case COUPON_CODE:
4564
        return isSetCouponCode();
4565
      }
4566
      throw new IllegalStateException();
4567
    }
4568
 
4569
    @Override
4570
    public boolean equals(Object that) {
4571
      if (that == null)
4572
        return false;
4573
      if (that instanceof isGiftVoucher_args)
4574
        return this.equals((isGiftVoucher_args)that);
4575
      return false;
4576
    }
4577
 
4578
    public boolean equals(isGiftVoucher_args that) {
4579
      if (that == null)
4580
        return false;
4581
 
4582
      boolean this_present_couponCode = true && this.isSetCouponCode();
4583
      boolean that_present_couponCode = true && that.isSetCouponCode();
4584
      if (this_present_couponCode || that_present_couponCode) {
4585
        if (!(this_present_couponCode && that_present_couponCode))
4586
          return false;
4587
        if (!this.couponCode.equals(that.couponCode))
4588
          return false;
4589
      }
4590
 
4591
      return true;
4592
    }
4593
 
4594
    @Override
4595
    public int hashCode() {
4596
      return 0;
4597
    }
4598
 
4599
    public int compareTo(isGiftVoucher_args other) {
4600
      if (!getClass().equals(other.getClass())) {
4601
        return getClass().getName().compareTo(other.getClass().getName());
4602
      }
4603
 
4604
      int lastComparison = 0;
4605
      isGiftVoucher_args typedOther = (isGiftVoucher_args)other;
4606
 
4607
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
4608
      if (lastComparison != 0) {
4609
        return lastComparison;
4610
      }
4611
      if (isSetCouponCode()) {
4612
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
4613
        if (lastComparison != 0) {
4614
          return lastComparison;
4615
        }
4616
      }
4617
      return 0;
4618
    }
4619
 
4620
    public _Fields fieldForId(int fieldId) {
4621
      return _Fields.findByThriftId(fieldId);
4622
    }
4623
 
4624
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4625
      org.apache.thrift.protocol.TField field;
4626
      iprot.readStructBegin();
4627
      while (true)
4628
      {
4629
        field = iprot.readFieldBegin();
4630
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4631
          break;
4632
        }
4633
        switch (field.id) {
4634
          case 1: // COUPON_CODE
4635
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
4636
              this.couponCode = iprot.readString();
4637
            } else { 
4638
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4639
            }
4640
            break;
4641
          default:
4642
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
4643
        }
4644
        iprot.readFieldEnd();
4645
      }
4646
      iprot.readStructEnd();
4647
      validate();
4648
    }
4649
 
4650
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
4651
      validate();
4652
 
4653
      oprot.writeStructBegin(STRUCT_DESC);
4654
      if (this.couponCode != null) {
4655
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
4656
        oprot.writeString(this.couponCode);
4657
        oprot.writeFieldEnd();
4658
      }
4659
      oprot.writeFieldStop();
4660
      oprot.writeStructEnd();
4661
    }
4662
 
4663
    @Override
4664
    public String toString() {
4665
      StringBuilder sb = new StringBuilder("isGiftVoucher_args(");
4666
      boolean first = true;
4667
 
4668
      sb.append("couponCode:");
4669
      if (this.couponCode == null) {
4670
        sb.append("null");
4671
      } else {
4672
        sb.append(this.couponCode);
4673
      }
4674
      first = false;
4675
      sb.append(")");
4676
      return sb.toString();
4677
    }
4678
 
4679
    public void validate() throws org.apache.thrift.TException {
4680
      // check for required fields
4681
    }
4682
 
4683
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
4684
      try {
4685
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
4686
      } catch (org.apache.thrift.TException te) {
4687
        throw new java.io.IOException(te);
4688
      }
4689
    }
4690
 
4691
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
4692
      try {
4693
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
4694
      } catch (org.apache.thrift.TException te) {
4695
        throw new java.io.IOException(te);
4696
      }
4697
    }
4698
 
4699
  }
4700
 
4701
  public static class isGiftVoucher_result implements org.apache.thrift.TBase<isGiftVoucher_result, isGiftVoucher_result._Fields>, java.io.Serializable, Cloneable   {
4702
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isGiftVoucher_result");
4703
 
4704
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
4705
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
4706
 
4707
    private boolean success; // required
4708
    private PromotionException pex; // required
4709
 
4710
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
4711
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
4712
      SUCCESS((short)0, "success"),
4713
      PEX((short)1, "pex");
4714
 
4715
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
4716
 
4717
      static {
4718
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
4719
          byName.put(field.getFieldName(), field);
4720
        }
4721
      }
4722
 
4723
      /**
4724
       * Find the _Fields constant that matches fieldId, or null if its not found.
4725
       */
4726
      public static _Fields findByThriftId(int fieldId) {
4727
        switch(fieldId) {
4728
          case 0: // SUCCESS
4729
            return SUCCESS;
4730
          case 1: // PEX
4731
            return PEX;
4732
          default:
4733
            return null;
4734
        }
4735
      }
4736
 
4737
      /**
4738
       * Find the _Fields constant that matches fieldId, throwing an exception
4739
       * if it is not found.
4740
       */
4741
      public static _Fields findByThriftIdOrThrow(int fieldId) {
4742
        _Fields fields = findByThriftId(fieldId);
4743
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
4744
        return fields;
4745
      }
4746
 
4747
      /**
4748
       * Find the _Fields constant that matches name, or null if its not found.
4749
       */
4750
      public static _Fields findByName(String name) {
4751
        return byName.get(name);
4752
      }
4753
 
4754
      private final short _thriftId;
4755
      private final String _fieldName;
4756
 
4757
      _Fields(short thriftId, String fieldName) {
4758
        _thriftId = thriftId;
4759
        _fieldName = fieldName;
4760
      }
4761
 
4762
      public short getThriftFieldId() {
4763
        return _thriftId;
4764
      }
4765
 
4766
      public String getFieldName() {
4767
        return _fieldName;
4768
      }
4769
    }
4770
 
4771
    // isset id assignments
4772
    private static final int __SUCCESS_ISSET_ID = 0;
4773
    private BitSet __isset_bit_vector = new BitSet(1);
4774
 
4775
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
4776
    static {
4777
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
4778
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4779
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
4780
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
4781
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
4782
      metaDataMap = Collections.unmodifiableMap(tmpMap);
4783
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isGiftVoucher_result.class, metaDataMap);
4784
    }
4785
 
4786
    public isGiftVoucher_result() {
4787
    }
4788
 
4789
    public isGiftVoucher_result(
4790
      boolean success,
4791
      PromotionException pex)
4792
    {
4793
      this();
4794
      this.success = success;
4795
      setSuccessIsSet(true);
4796
      this.pex = pex;
4797
    }
4798
 
4799
    /**
4800
     * Performs a deep copy on <i>other</i>.
4801
     */
4802
    public isGiftVoucher_result(isGiftVoucher_result other) {
4803
      __isset_bit_vector.clear();
4804
      __isset_bit_vector.or(other.__isset_bit_vector);
4805
      this.success = other.success;
4806
      if (other.isSetPex()) {
4807
        this.pex = new PromotionException(other.pex);
4808
      }
4809
    }
4810
 
4811
    public isGiftVoucher_result deepCopy() {
4812
      return new isGiftVoucher_result(this);
4813
    }
4814
 
4815
    @Override
4816
    public void clear() {
4817
      setSuccessIsSet(false);
4818
      this.success = false;
4819
      this.pex = null;
4820
    }
4821
 
4822
    public boolean isSuccess() {
4823
      return this.success;
4824
    }
4825
 
4826
    public void setSuccess(boolean success) {
4827
      this.success = success;
4828
      setSuccessIsSet(true);
4829
    }
4830
 
4831
    public void unsetSuccess() {
4832
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
4833
    }
4834
 
4835
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
4836
    public boolean isSetSuccess() {
4837
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
4838
    }
4839
 
4840
    public void setSuccessIsSet(boolean value) {
4841
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
4842
    }
4843
 
4844
    public PromotionException getPex() {
4845
      return this.pex;
4846
    }
4847
 
4848
    public void setPex(PromotionException pex) {
4849
      this.pex = pex;
4850
    }
4851
 
4852
    public void unsetPex() {
4853
      this.pex = null;
4854
    }
4855
 
4856
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
4857
    public boolean isSetPex() {
4858
      return this.pex != null;
4859
    }
4860
 
4861
    public void setPexIsSet(boolean value) {
4862
      if (!value) {
4863
        this.pex = null;
4864
      }
4865
    }
4866
 
4867
    public void setFieldValue(_Fields field, Object value) {
4868
      switch (field) {
4869
      case SUCCESS:
4870
        if (value == null) {
4871
          unsetSuccess();
4872
        } else {
4873
          setSuccess((Boolean)value);
4874
        }
4875
        break;
4876
 
4877
      case PEX:
4878
        if (value == null) {
4879
          unsetPex();
4880
        } else {
4881
          setPex((PromotionException)value);
4882
        }
4883
        break;
4884
 
4885
      }
4886
    }
4887
 
4888
    public Object getFieldValue(_Fields field) {
4889
      switch (field) {
4890
      case SUCCESS:
4891
        return Boolean.valueOf(isSuccess());
4892
 
4893
      case PEX:
4894
        return getPex();
4895
 
4896
      }
4897
      throw new IllegalStateException();
4898
    }
4899
 
4900
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
4901
    public boolean isSet(_Fields field) {
4902
      if (field == null) {
4903
        throw new IllegalArgumentException();
4904
      }
4905
 
4906
      switch (field) {
4907
      case SUCCESS:
4908
        return isSetSuccess();
4909
      case PEX:
4910
        return isSetPex();
4911
      }
4912
      throw new IllegalStateException();
4913
    }
4914
 
4915
    @Override
4916
    public boolean equals(Object that) {
4917
      if (that == null)
4918
        return false;
4919
      if (that instanceof isGiftVoucher_result)
4920
        return this.equals((isGiftVoucher_result)that);
4921
      return false;
4922
    }
4923
 
4924
    public boolean equals(isGiftVoucher_result that) {
4925
      if (that == null)
4926
        return false;
4927
 
4928
      boolean this_present_success = true;
4929
      boolean that_present_success = true;
4930
      if (this_present_success || that_present_success) {
4931
        if (!(this_present_success && that_present_success))
4932
          return false;
4933
        if (this.success != that.success)
4934
          return false;
4935
      }
4936
 
4937
      boolean this_present_pex = true && this.isSetPex();
4938
      boolean that_present_pex = true && that.isSetPex();
4939
      if (this_present_pex || that_present_pex) {
4940
        if (!(this_present_pex && that_present_pex))
4941
          return false;
4942
        if (!this.pex.equals(that.pex))
4943
          return false;
4944
      }
4945
 
4946
      return true;
4947
    }
4948
 
4949
    @Override
4950
    public int hashCode() {
4951
      return 0;
4952
    }
4953
 
4954
    public int compareTo(isGiftVoucher_result other) {
4955
      if (!getClass().equals(other.getClass())) {
4956
        return getClass().getName().compareTo(other.getClass().getName());
4957
      }
4958
 
4959
      int lastComparison = 0;
4960
      isGiftVoucher_result typedOther = (isGiftVoucher_result)other;
4961
 
4962
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
4963
      if (lastComparison != 0) {
4964
        return lastComparison;
4965
      }
4966
      if (isSetSuccess()) {
4967
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
4968
        if (lastComparison != 0) {
4969
          return lastComparison;
4970
        }
4971
      }
4972
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
4973
      if (lastComparison != 0) {
4974
        return lastComparison;
4975
      }
4976
      if (isSetPex()) {
4977
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
4978
        if (lastComparison != 0) {
4979
          return lastComparison;
4980
        }
4981
      }
4982
      return 0;
4983
    }
4984
 
4985
    public _Fields fieldForId(int fieldId) {
4986
      return _Fields.findByThriftId(fieldId);
4987
    }
4988
 
4989
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
4990
      org.apache.thrift.protocol.TField field;
4991
      iprot.readStructBegin();
4992
      while (true)
4993
      {
4994
        field = iprot.readFieldBegin();
4995
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
4996
          break;
4997
        }
4998
        switch (field.id) {
4999
          case 0: // SUCCESS
5000
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
5001
              this.success = iprot.readBool();
5002
              setSuccessIsSet(true);
5003
            } else { 
5004
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5005
            }
5006
            break;
5007
          case 1: // PEX
5008
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5009
              this.pex = new PromotionException();
5010
              this.pex.read(iprot);
5011
            } else { 
5012
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5013
            }
5014
            break;
5015
          default:
5016
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5017
        }
5018
        iprot.readFieldEnd();
5019
      }
5020
      iprot.readStructEnd();
5021
      validate();
5022
    }
5023
 
5024
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
5025
      oprot.writeStructBegin(STRUCT_DESC);
5026
 
5027
      if (this.isSetSuccess()) {
5028
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
5029
        oprot.writeBool(this.success);
5030
        oprot.writeFieldEnd();
5031
      } else if (this.isSetPex()) {
5032
        oprot.writeFieldBegin(PEX_FIELD_DESC);
5033
        this.pex.write(oprot);
5034
        oprot.writeFieldEnd();
5035
      }
5036
      oprot.writeFieldStop();
5037
      oprot.writeStructEnd();
5038
    }
5039
 
5040
    @Override
5041
    public String toString() {
5042
      StringBuilder sb = new StringBuilder("isGiftVoucher_result(");
5043
      boolean first = true;
5044
 
5045
      sb.append("success:");
5046
      sb.append(this.success);
5047
      first = false;
5048
      if (!first) sb.append(", ");
5049
      sb.append("pex:");
5050
      if (this.pex == null) {
5051
        sb.append("null");
5052
      } else {
5053
        sb.append(this.pex);
5054
      }
5055
      first = false;
5056
      sb.append(")");
5057
      return sb.toString();
5058
    }
5059
 
5060
    public void validate() throws org.apache.thrift.TException {
5061
      // check for required fields
5062
    }
5063
 
5064
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5065
      try {
5066
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5067
      } catch (org.apache.thrift.TException te) {
5068
        throw new java.io.IOException(te);
5069
      }
5070
    }
5071
 
5072
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5073
      try {
5074
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5075
      } catch (org.apache.thrift.TException te) {
5076
        throw new java.io.IOException(te);
5077
      }
5078
    }
5079
 
5080
  }
5081
 
6356 amit.gupta 5082
  public static class isCodApplicable_args implements org.apache.thrift.TBase<isCodApplicable_args, isCodApplicable_args._Fields>, java.io.Serializable, Cloneable   {
5083
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isCodApplicable_args");
5084
 
5085
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)1);
5086
 
5087
    private String couponCode; // required
5088
 
5089
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
5090
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
5091
      COUPON_CODE((short)1, "couponCode");
5092
 
5093
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5094
 
5095
      static {
5096
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5097
          byName.put(field.getFieldName(), field);
5098
        }
5099
      }
5100
 
5101
      /**
5102
       * Find the _Fields constant that matches fieldId, or null if its not found.
5103
       */
5104
      public static _Fields findByThriftId(int fieldId) {
5105
        switch(fieldId) {
5106
          case 1: // COUPON_CODE
5107
            return COUPON_CODE;
5108
          default:
5109
            return null;
5110
        }
5111
      }
5112
 
5113
      /**
5114
       * Find the _Fields constant that matches fieldId, throwing an exception
5115
       * if it is not found.
5116
       */
5117
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5118
        _Fields fields = findByThriftId(fieldId);
5119
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5120
        return fields;
5121
      }
5122
 
5123
      /**
5124
       * Find the _Fields constant that matches name, or null if its not found.
5125
       */
5126
      public static _Fields findByName(String name) {
5127
        return byName.get(name);
5128
      }
5129
 
5130
      private final short _thriftId;
5131
      private final String _fieldName;
5132
 
5133
      _Fields(short thriftId, String fieldName) {
5134
        _thriftId = thriftId;
5135
        _fieldName = fieldName;
5136
      }
5137
 
5138
      public short getThriftFieldId() {
5139
        return _thriftId;
5140
      }
5141
 
5142
      public String getFieldName() {
5143
        return _fieldName;
5144
      }
5145
    }
5146
 
5147
    // isset id assignments
5148
 
5149
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
5150
    static {
5151
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5152
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5153
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
5154
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5155
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isCodApplicable_args.class, metaDataMap);
5156
    }
5157
 
5158
    public isCodApplicable_args() {
5159
    }
5160
 
5161
    public isCodApplicable_args(
5162
      String couponCode)
5163
    {
5164
      this();
5165
      this.couponCode = couponCode;
5166
    }
5167
 
5168
    /**
5169
     * Performs a deep copy on <i>other</i>.
5170
     */
5171
    public isCodApplicable_args(isCodApplicable_args other) {
5172
      if (other.isSetCouponCode()) {
5173
        this.couponCode = other.couponCode;
5174
      }
5175
    }
5176
 
5177
    public isCodApplicable_args deepCopy() {
5178
      return new isCodApplicable_args(this);
5179
    }
5180
 
5181
    @Override
5182
    public void clear() {
5183
      this.couponCode = null;
5184
    }
5185
 
5186
    public String getCouponCode() {
5187
      return this.couponCode;
5188
    }
5189
 
5190
    public void setCouponCode(String couponCode) {
5191
      this.couponCode = couponCode;
5192
    }
5193
 
5194
    public void unsetCouponCode() {
5195
      this.couponCode = null;
5196
    }
5197
 
5198
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
5199
    public boolean isSetCouponCode() {
5200
      return this.couponCode != null;
5201
    }
5202
 
5203
    public void setCouponCodeIsSet(boolean value) {
5204
      if (!value) {
5205
        this.couponCode = null;
5206
      }
5207
    }
5208
 
5209
    public void setFieldValue(_Fields field, Object value) {
5210
      switch (field) {
5211
      case COUPON_CODE:
5212
        if (value == null) {
5213
          unsetCouponCode();
5214
        } else {
5215
          setCouponCode((String)value);
5216
        }
5217
        break;
5218
 
5219
      }
5220
    }
5221
 
5222
    public Object getFieldValue(_Fields field) {
5223
      switch (field) {
5224
      case COUPON_CODE:
5225
        return getCouponCode();
5226
 
5227
      }
5228
      throw new IllegalStateException();
5229
    }
5230
 
5231
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5232
    public boolean isSet(_Fields field) {
5233
      if (field == null) {
5234
        throw new IllegalArgumentException();
5235
      }
5236
 
5237
      switch (field) {
5238
      case COUPON_CODE:
5239
        return isSetCouponCode();
5240
      }
5241
      throw new IllegalStateException();
5242
    }
5243
 
5244
    @Override
5245
    public boolean equals(Object that) {
5246
      if (that == null)
5247
        return false;
5248
      if (that instanceof isCodApplicable_args)
5249
        return this.equals((isCodApplicable_args)that);
5250
      return false;
5251
    }
5252
 
5253
    public boolean equals(isCodApplicable_args that) {
5254
      if (that == null)
5255
        return false;
5256
 
5257
      boolean this_present_couponCode = true && this.isSetCouponCode();
5258
      boolean that_present_couponCode = true && that.isSetCouponCode();
5259
      if (this_present_couponCode || that_present_couponCode) {
5260
        if (!(this_present_couponCode && that_present_couponCode))
5261
          return false;
5262
        if (!this.couponCode.equals(that.couponCode))
5263
          return false;
5264
      }
5265
 
5266
      return true;
5267
    }
5268
 
5269
    @Override
5270
    public int hashCode() {
5271
      return 0;
5272
    }
5273
 
5274
    public int compareTo(isCodApplicable_args other) {
5275
      if (!getClass().equals(other.getClass())) {
5276
        return getClass().getName().compareTo(other.getClass().getName());
5277
      }
5278
 
5279
      int lastComparison = 0;
5280
      isCodApplicable_args typedOther = (isCodApplicable_args)other;
5281
 
5282
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
5283
      if (lastComparison != 0) {
5284
        return lastComparison;
5285
      }
5286
      if (isSetCouponCode()) {
5287
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
5288
        if (lastComparison != 0) {
5289
          return lastComparison;
5290
        }
5291
      }
5292
      return 0;
5293
    }
5294
 
5295
    public _Fields fieldForId(int fieldId) {
5296
      return _Fields.findByThriftId(fieldId);
5297
    }
5298
 
5299
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5300
      org.apache.thrift.protocol.TField field;
5301
      iprot.readStructBegin();
5302
      while (true)
5303
      {
5304
        field = iprot.readFieldBegin();
5305
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
5306
          break;
5307
        }
5308
        switch (field.id) {
5309
          case 1: // COUPON_CODE
5310
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
5311
              this.couponCode = iprot.readString();
5312
            } else { 
5313
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5314
            }
5315
            break;
5316
          default:
5317
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5318
        }
5319
        iprot.readFieldEnd();
5320
      }
5321
      iprot.readStructEnd();
5322
      validate();
5323
    }
5324
 
5325
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
5326
      validate();
5327
 
5328
      oprot.writeStructBegin(STRUCT_DESC);
5329
      if (this.couponCode != null) {
5330
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
5331
        oprot.writeString(this.couponCode);
5332
        oprot.writeFieldEnd();
5333
      }
5334
      oprot.writeFieldStop();
5335
      oprot.writeStructEnd();
5336
    }
5337
 
5338
    @Override
5339
    public String toString() {
5340
      StringBuilder sb = new StringBuilder("isCodApplicable_args(");
5341
      boolean first = true;
5342
 
5343
      sb.append("couponCode:");
5344
      if (this.couponCode == null) {
5345
        sb.append("null");
5346
      } else {
5347
        sb.append(this.couponCode);
5348
      }
5349
      first = false;
5350
      sb.append(")");
5351
      return sb.toString();
5352
    }
5353
 
5354
    public void validate() throws org.apache.thrift.TException {
5355
      // check for required fields
5356
    }
5357
 
5358
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5359
      try {
5360
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5361
      } catch (org.apache.thrift.TException te) {
5362
        throw new java.io.IOException(te);
5363
      }
5364
    }
5365
 
5366
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5367
      try {
5368
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5369
      } catch (org.apache.thrift.TException te) {
5370
        throw new java.io.IOException(te);
5371
      }
5372
    }
5373
 
5374
  }
5375
 
5376
  public static class isCodApplicable_result implements org.apache.thrift.TBase<isCodApplicable_result, isCodApplicable_result._Fields>, java.io.Serializable, Cloneable   {
5377
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isCodApplicable_result");
5378
 
5379
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
5380
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
5381
 
5382
    private boolean success; // required
5383
    private PromotionException pex; // required
5384
 
5385
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
5386
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
5387
      SUCCESS((short)0, "success"),
5388
      PEX((short)1, "pex");
5389
 
5390
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5391
 
5392
      static {
5393
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5394
          byName.put(field.getFieldName(), field);
5395
        }
5396
      }
5397
 
5398
      /**
5399
       * Find the _Fields constant that matches fieldId, or null if its not found.
5400
       */
5401
      public static _Fields findByThriftId(int fieldId) {
5402
        switch(fieldId) {
5403
          case 0: // SUCCESS
5404
            return SUCCESS;
5405
          case 1: // PEX
5406
            return PEX;
5407
          default:
5408
            return null;
5409
        }
5410
      }
5411
 
5412
      /**
5413
       * Find the _Fields constant that matches fieldId, throwing an exception
5414
       * if it is not found.
5415
       */
5416
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5417
        _Fields fields = findByThriftId(fieldId);
5418
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5419
        return fields;
5420
      }
5421
 
5422
      /**
5423
       * Find the _Fields constant that matches name, or null if its not found.
5424
       */
5425
      public static _Fields findByName(String name) {
5426
        return byName.get(name);
5427
      }
5428
 
5429
      private final short _thriftId;
5430
      private final String _fieldName;
5431
 
5432
      _Fields(short thriftId, String fieldName) {
5433
        _thriftId = thriftId;
5434
        _fieldName = fieldName;
5435
      }
5436
 
5437
      public short getThriftFieldId() {
5438
        return _thriftId;
5439
      }
5440
 
5441
      public String getFieldName() {
5442
        return _fieldName;
5443
      }
5444
    }
5445
 
5446
    // isset id assignments
5447
    private static final int __SUCCESS_ISSET_ID = 0;
5448
    private BitSet __isset_bit_vector = new BitSet(1);
5449
 
5450
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
5451
    static {
5452
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5453
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5454
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
5455
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
5456
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
5457
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5458
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isCodApplicable_result.class, metaDataMap);
5459
    }
5460
 
5461
    public isCodApplicable_result() {
5462
    }
5463
 
5464
    public isCodApplicable_result(
5465
      boolean success,
5466
      PromotionException pex)
5467
    {
5468
      this();
5469
      this.success = success;
5470
      setSuccessIsSet(true);
5471
      this.pex = pex;
5472
    }
5473
 
5474
    /**
5475
     * Performs a deep copy on <i>other</i>.
5476
     */
5477
    public isCodApplicable_result(isCodApplicable_result other) {
5478
      __isset_bit_vector.clear();
5479
      __isset_bit_vector.or(other.__isset_bit_vector);
5480
      this.success = other.success;
5481
      if (other.isSetPex()) {
5482
        this.pex = new PromotionException(other.pex);
5483
      }
5484
    }
5485
 
5486
    public isCodApplicable_result deepCopy() {
5487
      return new isCodApplicable_result(this);
5488
    }
5489
 
5490
    @Override
5491
    public void clear() {
5492
      setSuccessIsSet(false);
5493
      this.success = false;
5494
      this.pex = null;
5495
    }
5496
 
5497
    public boolean isSuccess() {
5498
      return this.success;
5499
    }
5500
 
5501
    public void setSuccess(boolean success) {
5502
      this.success = success;
5503
      setSuccessIsSet(true);
5504
    }
5505
 
5506
    public void unsetSuccess() {
5507
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
5508
    }
5509
 
5510
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
5511
    public boolean isSetSuccess() {
5512
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
5513
    }
5514
 
5515
    public void setSuccessIsSet(boolean value) {
5516
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
5517
    }
5518
 
5519
    public PromotionException getPex() {
5520
      return this.pex;
5521
    }
5522
 
5523
    public void setPex(PromotionException pex) {
5524
      this.pex = pex;
5525
    }
5526
 
5527
    public void unsetPex() {
5528
      this.pex = null;
5529
    }
5530
 
5531
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
5532
    public boolean isSetPex() {
5533
      return this.pex != null;
5534
    }
5535
 
5536
    public void setPexIsSet(boolean value) {
5537
      if (!value) {
5538
        this.pex = null;
5539
      }
5540
    }
5541
 
5542
    public void setFieldValue(_Fields field, Object value) {
5543
      switch (field) {
5544
      case SUCCESS:
5545
        if (value == null) {
5546
          unsetSuccess();
5547
        } else {
5548
          setSuccess((Boolean)value);
5549
        }
5550
        break;
5551
 
5552
      case PEX:
5553
        if (value == null) {
5554
          unsetPex();
5555
        } else {
5556
          setPex((PromotionException)value);
5557
        }
5558
        break;
5559
 
5560
      }
5561
    }
5562
 
5563
    public Object getFieldValue(_Fields field) {
5564
      switch (field) {
5565
      case SUCCESS:
5566
        return Boolean.valueOf(isSuccess());
5567
 
5568
      case PEX:
5569
        return getPex();
5570
 
5571
      }
5572
      throw new IllegalStateException();
5573
    }
5574
 
5575
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5576
    public boolean isSet(_Fields field) {
5577
      if (field == null) {
5578
        throw new IllegalArgumentException();
5579
      }
5580
 
5581
      switch (field) {
5582
      case SUCCESS:
5583
        return isSetSuccess();
5584
      case PEX:
5585
        return isSetPex();
5586
      }
5587
      throw new IllegalStateException();
5588
    }
5589
 
5590
    @Override
5591
    public boolean equals(Object that) {
5592
      if (that == null)
5593
        return false;
5594
      if (that instanceof isCodApplicable_result)
5595
        return this.equals((isCodApplicable_result)that);
5596
      return false;
5597
    }
5598
 
5599
    public boolean equals(isCodApplicable_result that) {
5600
      if (that == null)
5601
        return false;
5602
 
5603
      boolean this_present_success = true;
5604
      boolean that_present_success = true;
5605
      if (this_present_success || that_present_success) {
5606
        if (!(this_present_success && that_present_success))
5607
          return false;
5608
        if (this.success != that.success)
5609
          return false;
5610
      }
5611
 
5612
      boolean this_present_pex = true && this.isSetPex();
5613
      boolean that_present_pex = true && that.isSetPex();
5614
      if (this_present_pex || that_present_pex) {
5615
        if (!(this_present_pex && that_present_pex))
5616
          return false;
5617
        if (!this.pex.equals(that.pex))
5618
          return false;
5619
      }
5620
 
5621
      return true;
5622
    }
5623
 
5624
    @Override
5625
    public int hashCode() {
5626
      return 0;
5627
    }
5628
 
5629
    public int compareTo(isCodApplicable_result other) {
5630
      if (!getClass().equals(other.getClass())) {
5631
        return getClass().getName().compareTo(other.getClass().getName());
5632
      }
5633
 
5634
      int lastComparison = 0;
5635
      isCodApplicable_result typedOther = (isCodApplicable_result)other;
5636
 
5637
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
5638
      if (lastComparison != 0) {
5639
        return lastComparison;
5640
      }
5641
      if (isSetSuccess()) {
5642
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
5643
        if (lastComparison != 0) {
5644
          return lastComparison;
5645
        }
5646
      }
5647
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
5648
      if (lastComparison != 0) {
5649
        return lastComparison;
5650
      }
5651
      if (isSetPex()) {
5652
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
5653
        if (lastComparison != 0) {
5654
          return lastComparison;
5655
        }
5656
      }
5657
      return 0;
5658
    }
5659
 
5660
    public _Fields fieldForId(int fieldId) {
5661
      return _Fields.findByThriftId(fieldId);
5662
    }
5663
 
5664
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5665
      org.apache.thrift.protocol.TField field;
5666
      iprot.readStructBegin();
5667
      while (true)
5668
      {
5669
        field = iprot.readFieldBegin();
5670
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
5671
          break;
5672
        }
5673
        switch (field.id) {
5674
          case 0: // SUCCESS
5675
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
5676
              this.success = iprot.readBool();
5677
              setSuccessIsSet(true);
5678
            } else { 
5679
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5680
            }
5681
            break;
5682
          case 1: // PEX
5683
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
5684
              this.pex = new PromotionException();
5685
              this.pex.read(iprot);
5686
            } else { 
5687
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5688
            }
5689
            break;
5690
          default:
5691
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
5692
        }
5693
        iprot.readFieldEnd();
5694
      }
5695
      iprot.readStructEnd();
5696
      validate();
5697
    }
5698
 
5699
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
5700
      oprot.writeStructBegin(STRUCT_DESC);
5701
 
5702
      if (this.isSetSuccess()) {
5703
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
5704
        oprot.writeBool(this.success);
5705
        oprot.writeFieldEnd();
5706
      } else if (this.isSetPex()) {
5707
        oprot.writeFieldBegin(PEX_FIELD_DESC);
5708
        this.pex.write(oprot);
5709
        oprot.writeFieldEnd();
5710
      }
5711
      oprot.writeFieldStop();
5712
      oprot.writeStructEnd();
5713
    }
5714
 
5715
    @Override
5716
    public String toString() {
5717
      StringBuilder sb = new StringBuilder("isCodApplicable_result(");
5718
      boolean first = true;
5719
 
5720
      sb.append("success:");
5721
      sb.append(this.success);
5722
      first = false;
5723
      if (!first) sb.append(", ");
5724
      sb.append("pex:");
5725
      if (this.pex == null) {
5726
        sb.append("null");
5727
      } else {
5728
        sb.append(this.pex);
5729
      }
5730
      first = false;
5731
      sb.append(")");
5732
      return sb.toString();
5733
    }
5734
 
5735
    public void validate() throws org.apache.thrift.TException {
5736
      // check for required fields
5737
    }
5738
 
5739
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5740
      try {
5741
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5742
      } catch (org.apache.thrift.TException te) {
5743
        throw new java.io.IOException(te);
5744
      }
5745
    }
5746
 
5747
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5748
      try {
5749
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5750
      } catch (org.apache.thrift.TException te) {
5751
        throw new java.io.IOException(te);
5752
      }
5753
    }
5754
 
5755
  }
5756
 
3430 rajveer 5757
  public static class getAllPromotions_args implements org.apache.thrift.TBase<getAllPromotions_args, getAllPromotions_args._Fields>, java.io.Serializable, Cloneable   {
5758
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_args");
1982 varun.gupt 5759
 
5760
 
5761
 
5762
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5763
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5764
;
5765
 
5766
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5767
 
5768
      static {
5769
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5770
          byName.put(field.getFieldName(), field);
5771
        }
5772
      }
5773
 
5774
      /**
5775
       * Find the _Fields constant that matches fieldId, or null if its not found.
5776
       */
5777
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5778
        switch(fieldId) {
5779
          default:
5780
            return null;
5781
        }
1982 varun.gupt 5782
      }
5783
 
5784
      /**
5785
       * Find the _Fields constant that matches fieldId, throwing an exception
5786
       * if it is not found.
5787
       */
5788
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5789
        _Fields fields = findByThriftId(fieldId);
5790
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
5791
        return fields;
5792
      }
5793
 
5794
      /**
5795
       * Find the _Fields constant that matches name, or null if its not found.
5796
       */
5797
      public static _Fields findByName(String name) {
5798
        return byName.get(name);
5799
      }
5800
 
5801
      private final short _thriftId;
5802
      private final String _fieldName;
5803
 
5804
      _Fields(short thriftId, String fieldName) {
5805
        _thriftId = thriftId;
5806
        _fieldName = fieldName;
5807
      }
5808
 
5809
      public short getThriftFieldId() {
5810
        return _thriftId;
5811
      }
5812
 
5813
      public String getFieldName() {
5814
        return _fieldName;
5815
      }
5816
    }
3430 rajveer 5817
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 5818
    static {
3430 rajveer 5819
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
5820
      metaDataMap = Collections.unmodifiableMap(tmpMap);
5821
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_args.class, metaDataMap);
1982 varun.gupt 5822
    }
5823
 
5824
    public getAllPromotions_args() {
5825
    }
5826
 
5827
    /**
5828
     * Performs a deep copy on <i>other</i>.
5829
     */
5830
    public getAllPromotions_args(getAllPromotions_args other) {
5831
    }
5832
 
5833
    public getAllPromotions_args deepCopy() {
5834
      return new getAllPromotions_args(this);
5835
    }
5836
 
3430 rajveer 5837
    @Override
5838
    public void clear() {
1982 varun.gupt 5839
    }
5840
 
5841
    public void setFieldValue(_Fields field, Object value) {
5842
      switch (field) {
5843
      }
5844
    }
5845
 
5846
    public Object getFieldValue(_Fields field) {
5847
      switch (field) {
5848
      }
5849
      throw new IllegalStateException();
5850
    }
5851
 
3430 rajveer 5852
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
5853
    public boolean isSet(_Fields field) {
5854
      if (field == null) {
5855
        throw new IllegalArgumentException();
5856
      }
1982 varun.gupt 5857
 
5858
      switch (field) {
5859
      }
5860
      throw new IllegalStateException();
5861
    }
5862
 
5863
    @Override
5864
    public boolean equals(Object that) {
5865
      if (that == null)
5866
        return false;
5867
      if (that instanceof getAllPromotions_args)
5868
        return this.equals((getAllPromotions_args)that);
5869
      return false;
5870
    }
5871
 
5872
    public boolean equals(getAllPromotions_args that) {
5873
      if (that == null)
5874
        return false;
5875
 
5876
      return true;
5877
    }
5878
 
5879
    @Override
5880
    public int hashCode() {
5881
      return 0;
5882
    }
5883
 
5884
    public int compareTo(getAllPromotions_args other) {
5885
      if (!getClass().equals(other.getClass())) {
5886
        return getClass().getName().compareTo(other.getClass().getName());
5887
      }
5888
 
5889
      int lastComparison = 0;
5890
      getAllPromotions_args typedOther = (getAllPromotions_args)other;
5891
 
5892
      return 0;
5893
    }
5894
 
3430 rajveer 5895
    public _Fields fieldForId(int fieldId) {
5896
      return _Fields.findByThriftId(fieldId);
5897
    }
5898
 
5899
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
5900
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 5901
      iprot.readStructBegin();
5902
      while (true)
5903
      {
5904
        field = iprot.readFieldBegin();
3430 rajveer 5905
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 5906
          break;
5907
        }
3430 rajveer 5908
        switch (field.id) {
5909
          default:
5910
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 5911
        }
3430 rajveer 5912
        iprot.readFieldEnd();
1982 varun.gupt 5913
      }
5914
      iprot.readStructEnd();
5915
      validate();
5916
    }
5917
 
3430 rajveer 5918
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 5919
      validate();
5920
 
5921
      oprot.writeStructBegin(STRUCT_DESC);
5922
      oprot.writeFieldStop();
5923
      oprot.writeStructEnd();
5924
    }
5925
 
5926
    @Override
5927
    public String toString() {
5928
      StringBuilder sb = new StringBuilder("getAllPromotions_args(");
5929
      boolean first = true;
5930
 
5931
      sb.append(")");
5932
      return sb.toString();
5933
    }
5934
 
3430 rajveer 5935
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 5936
      // check for required fields
5937
    }
5938
 
3430 rajveer 5939
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
5940
      try {
5941
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
5942
      } catch (org.apache.thrift.TException te) {
5943
        throw new java.io.IOException(te);
5944
      }
5945
    }
5946
 
5947
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
5948
      try {
5949
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
5950
      } catch (org.apache.thrift.TException te) {
5951
        throw new java.io.IOException(te);
5952
      }
5953
    }
5954
 
1982 varun.gupt 5955
  }
5956
 
3430 rajveer 5957
  public static class getAllPromotions_result implements org.apache.thrift.TBase<getAllPromotions_result, getAllPromotions_result._Fields>, java.io.Serializable, Cloneable   {
5958
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllPromotions_result");
1982 varun.gupt 5959
 
3430 rajveer 5960
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
5961
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
1982 varun.gupt 5962
 
3430 rajveer 5963
    private List<Promotion> success; // required
5964
    private PromotionException pex; // required
1982 varun.gupt 5965
 
5966
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 5967
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 5968
      SUCCESS((short)0, "success"),
5969
      PEX((short)1, "pex");
5970
 
5971
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
5972
 
5973
      static {
5974
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
5975
          byName.put(field.getFieldName(), field);
5976
        }
5977
      }
5978
 
5979
      /**
5980
       * Find the _Fields constant that matches fieldId, or null if its not found.
5981
       */
5982
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 5983
        switch(fieldId) {
5984
          case 0: // SUCCESS
5985
            return SUCCESS;
5986
          case 1: // PEX
5987
            return PEX;
5988
          default:
5989
            return null;
5990
        }
1982 varun.gupt 5991
      }
5992
 
5993
      /**
5994
       * Find the _Fields constant that matches fieldId, throwing an exception
5995
       * if it is not found.
5996
       */
5997
      public static _Fields findByThriftIdOrThrow(int fieldId) {
5998
        _Fields fields = findByThriftId(fieldId);
5999
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6000
        return fields;
6001
      }
6002
 
6003
      /**
6004
       * Find the _Fields constant that matches name, or null if its not found.
6005
       */
6006
      public static _Fields findByName(String name) {
6007
        return byName.get(name);
6008
      }
6009
 
6010
      private final short _thriftId;
6011
      private final String _fieldName;
6012
 
6013
      _Fields(short thriftId, String fieldName) {
6014
        _thriftId = thriftId;
6015
        _fieldName = fieldName;
6016
      }
6017
 
6018
      public short getThriftFieldId() {
6019
        return _thriftId;
6020
      }
6021
 
6022
      public String getFieldName() {
6023
        return _fieldName;
6024
      }
6025
    }
6026
 
6027
    // isset id assignments
6028
 
3430 rajveer 6029
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6030
    static {
3430 rajveer 6031
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6032
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6033
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
6034
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class))));
6035
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6036
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
6037
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6038
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllPromotions_result.class, metaDataMap);
1982 varun.gupt 6039
    }
6040
 
6041
    public getAllPromotions_result() {
6042
    }
6043
 
6044
    public getAllPromotions_result(
6045
      List<Promotion> success,
6046
      PromotionException pex)
6047
    {
6048
      this();
6049
      this.success = success;
6050
      this.pex = pex;
6051
    }
6052
 
6053
    /**
6054
     * Performs a deep copy on <i>other</i>.
6055
     */
6056
    public getAllPromotions_result(getAllPromotions_result other) {
6057
      if (other.isSetSuccess()) {
6058
        List<Promotion> __this__success = new ArrayList<Promotion>();
6059
        for (Promotion other_element : other.success) {
6060
          __this__success.add(new Promotion(other_element));
6061
        }
6062
        this.success = __this__success;
6063
      }
6064
      if (other.isSetPex()) {
6065
        this.pex = new PromotionException(other.pex);
6066
      }
6067
    }
6068
 
6069
    public getAllPromotions_result deepCopy() {
6070
      return new getAllPromotions_result(this);
6071
    }
6072
 
3430 rajveer 6073
    @Override
6074
    public void clear() {
6075
      this.success = null;
6076
      this.pex = null;
1982 varun.gupt 6077
    }
6078
 
6079
    public int getSuccessSize() {
6080
      return (this.success == null) ? 0 : this.success.size();
6081
    }
6082
 
6083
    public java.util.Iterator<Promotion> getSuccessIterator() {
6084
      return (this.success == null) ? null : this.success.iterator();
6085
    }
6086
 
6087
    public void addToSuccess(Promotion elem) {
6088
      if (this.success == null) {
6089
        this.success = new ArrayList<Promotion>();
6090
      }
6091
      this.success.add(elem);
6092
    }
6093
 
6094
    public List<Promotion> getSuccess() {
6095
      return this.success;
6096
    }
6097
 
3430 rajveer 6098
    public void setSuccess(List<Promotion> success) {
1982 varun.gupt 6099
      this.success = success;
6100
    }
6101
 
6102
    public void unsetSuccess() {
6103
      this.success = null;
6104
    }
6105
 
3430 rajveer 6106
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6107
    public boolean isSetSuccess() {
6108
      return this.success != null;
6109
    }
6110
 
6111
    public void setSuccessIsSet(boolean value) {
6112
      if (!value) {
6113
        this.success = null;
6114
      }
6115
    }
6116
 
6117
    public PromotionException getPex() {
6118
      return this.pex;
6119
    }
6120
 
3430 rajveer 6121
    public void setPex(PromotionException pex) {
1982 varun.gupt 6122
      this.pex = pex;
6123
    }
6124
 
6125
    public void unsetPex() {
6126
      this.pex = null;
6127
    }
6128
 
3430 rajveer 6129
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6130
    public boolean isSetPex() {
6131
      return this.pex != null;
6132
    }
6133
 
6134
    public void setPexIsSet(boolean value) {
6135
      if (!value) {
6136
        this.pex = null;
6137
      }
6138
    }
6139
 
6140
    public void setFieldValue(_Fields field, Object value) {
6141
      switch (field) {
6142
      case SUCCESS:
6143
        if (value == null) {
6144
          unsetSuccess();
6145
        } else {
6146
          setSuccess((List<Promotion>)value);
6147
        }
6148
        break;
6149
 
6150
      case PEX:
6151
        if (value == null) {
6152
          unsetPex();
6153
        } else {
6154
          setPex((PromotionException)value);
6155
        }
6156
        break;
6157
 
6158
      }
6159
    }
6160
 
6161
    public Object getFieldValue(_Fields field) {
6162
      switch (field) {
6163
      case SUCCESS:
6164
        return getSuccess();
6165
 
6166
      case PEX:
6167
        return getPex();
6168
 
6169
      }
6170
      throw new IllegalStateException();
6171
    }
6172
 
3430 rajveer 6173
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6174
    public boolean isSet(_Fields field) {
6175
      if (field == null) {
6176
        throw new IllegalArgumentException();
6177
      }
1982 varun.gupt 6178
 
6179
      switch (field) {
6180
      case SUCCESS:
6181
        return isSetSuccess();
6182
      case PEX:
6183
        return isSetPex();
6184
      }
6185
      throw new IllegalStateException();
6186
    }
6187
 
6188
    @Override
6189
    public boolean equals(Object that) {
6190
      if (that == null)
6191
        return false;
6192
      if (that instanceof getAllPromotions_result)
6193
        return this.equals((getAllPromotions_result)that);
6194
      return false;
6195
    }
6196
 
6197
    public boolean equals(getAllPromotions_result that) {
6198
      if (that == null)
6199
        return false;
6200
 
6201
      boolean this_present_success = true && this.isSetSuccess();
6202
      boolean that_present_success = true && that.isSetSuccess();
6203
      if (this_present_success || that_present_success) {
6204
        if (!(this_present_success && that_present_success))
6205
          return false;
6206
        if (!this.success.equals(that.success))
6207
          return false;
6208
      }
6209
 
6210
      boolean this_present_pex = true && this.isSetPex();
6211
      boolean that_present_pex = true && that.isSetPex();
6212
      if (this_present_pex || that_present_pex) {
6213
        if (!(this_present_pex && that_present_pex))
6214
          return false;
6215
        if (!this.pex.equals(that.pex))
6216
          return false;
6217
      }
6218
 
6219
      return true;
6220
    }
6221
 
6222
    @Override
6223
    public int hashCode() {
6224
      return 0;
6225
    }
6226
 
6227
    public int compareTo(getAllPromotions_result other) {
6228
      if (!getClass().equals(other.getClass())) {
6229
        return getClass().getName().compareTo(other.getClass().getName());
6230
      }
6231
 
6232
      int lastComparison = 0;
6233
      getAllPromotions_result typedOther = (getAllPromotions_result)other;
6234
 
3430 rajveer 6235
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 6236
      if (lastComparison != 0) {
6237
        return lastComparison;
6238
      }
3430 rajveer 6239
      if (isSetSuccess()) {
6240
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
6241
        if (lastComparison != 0) {
6242
          return lastComparison;
6243
        }
1982 varun.gupt 6244
      }
3430 rajveer 6245
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 6246
      if (lastComparison != 0) {
6247
        return lastComparison;
6248
      }
3430 rajveer 6249
      if (isSetPex()) {
6250
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
6251
        if (lastComparison != 0) {
6252
          return lastComparison;
6253
        }
1982 varun.gupt 6254
      }
6255
      return 0;
6256
    }
6257
 
3430 rajveer 6258
    public _Fields fieldForId(int fieldId) {
6259
      return _Fields.findByThriftId(fieldId);
6260
    }
6261
 
6262
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6263
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6264
      iprot.readStructBegin();
6265
      while (true)
6266
      {
6267
        field = iprot.readFieldBegin();
3430 rajveer 6268
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6269
          break;
6270
        }
3430 rajveer 6271
        switch (field.id) {
6272
          case 0: // SUCCESS
6273
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
6274
              {
5327 rajveer 6275
                org.apache.thrift.protocol.TList _list12 = iprot.readListBegin();
6276
                this.success = new ArrayList<Promotion>(_list12.size);
6277
                for (int _i13 = 0; _i13 < _list12.size; ++_i13)
1982 varun.gupt 6278
                {
5327 rajveer 6279
                  Promotion _elem14; // required
6280
                  _elem14 = new Promotion();
6281
                  _elem14.read(iprot);
6282
                  this.success.add(_elem14);
1982 varun.gupt 6283
                }
3430 rajveer 6284
                iprot.readListEnd();
1982 varun.gupt 6285
              }
3430 rajveer 6286
            } else { 
6287
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6288
            }
6289
            break;
6290
          case 1: // PEX
6291
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6292
              this.pex = new PromotionException();
6293
              this.pex.read(iprot);
6294
            } else { 
6295
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6296
            }
6297
            break;
6298
          default:
6299
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6300
        }
3430 rajveer 6301
        iprot.readFieldEnd();
1982 varun.gupt 6302
      }
6303
      iprot.readStructEnd();
6304
      validate();
6305
    }
6306
 
3430 rajveer 6307
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6308
      oprot.writeStructBegin(STRUCT_DESC);
6309
 
6310
      if (this.isSetSuccess()) {
6311
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
6312
        {
3430 rajveer 6313
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
5327 rajveer 6314
          for (Promotion _iter15 : this.success)
1982 varun.gupt 6315
          {
5327 rajveer 6316
            _iter15.write(oprot);
1982 varun.gupt 6317
          }
6318
          oprot.writeListEnd();
6319
        }
6320
        oprot.writeFieldEnd();
6321
      } else if (this.isSetPex()) {
6322
        oprot.writeFieldBegin(PEX_FIELD_DESC);
6323
        this.pex.write(oprot);
6324
        oprot.writeFieldEnd();
6325
      }
6326
      oprot.writeFieldStop();
6327
      oprot.writeStructEnd();
6328
    }
6329
 
6330
    @Override
6331
    public String toString() {
6332
      StringBuilder sb = new StringBuilder("getAllPromotions_result(");
6333
      boolean first = true;
6334
 
6335
      sb.append("success:");
6336
      if (this.success == null) {
6337
        sb.append("null");
6338
      } else {
6339
        sb.append(this.success);
6340
      }
6341
      first = false;
6342
      if (!first) sb.append(", ");
6343
      sb.append("pex:");
6344
      if (this.pex == null) {
6345
        sb.append("null");
6346
      } else {
6347
        sb.append(this.pex);
6348
      }
6349
      first = false;
6350
      sb.append(")");
6351
      return sb.toString();
6352
    }
6353
 
3430 rajveer 6354
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6355
      // check for required fields
6356
    }
6357
 
3430 rajveer 6358
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6359
      try {
6360
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6361
      } catch (org.apache.thrift.TException te) {
6362
        throw new java.io.IOException(te);
6363
      }
6364
    }
6365
 
6366
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6367
      try {
6368
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6369
      } catch (org.apache.thrift.TException te) {
6370
        throw new java.io.IOException(te);
6371
      }
6372
    }
6373
 
1982 varun.gupt 6374
  }
6375
 
3430 rajveer 6376
  public static class getPromotionById_args implements org.apache.thrift.TBase<getPromotionById_args, getPromotionById_args._Fields>, java.io.Serializable, Cloneable   {
6377
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_args");
1982 varun.gupt 6378
 
3430 rajveer 6379
    private static final org.apache.thrift.protocol.TField PROMOTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("promotionId", org.apache.thrift.protocol.TType.I64, (short)1);
1982 varun.gupt 6380
 
3430 rajveer 6381
    private long promotionId; // required
1982 varun.gupt 6382
 
6383
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6384
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6385
      PROMOTION_ID((short)1, "promotionId");
6386
 
6387
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6388
 
6389
      static {
6390
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6391
          byName.put(field.getFieldName(), field);
6392
        }
6393
      }
6394
 
6395
      /**
6396
       * Find the _Fields constant that matches fieldId, or null if its not found.
6397
       */
6398
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6399
        switch(fieldId) {
6400
          case 1: // PROMOTION_ID
6401
            return PROMOTION_ID;
6402
          default:
6403
            return null;
6404
        }
1982 varun.gupt 6405
      }
6406
 
6407
      /**
6408
       * Find the _Fields constant that matches fieldId, throwing an exception
6409
       * if it is not found.
6410
       */
6411
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6412
        _Fields fields = findByThriftId(fieldId);
6413
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6414
        return fields;
6415
      }
6416
 
6417
      /**
6418
       * Find the _Fields constant that matches name, or null if its not found.
6419
       */
6420
      public static _Fields findByName(String name) {
6421
        return byName.get(name);
6422
      }
6423
 
6424
      private final short _thriftId;
6425
      private final String _fieldName;
6426
 
6427
      _Fields(short thriftId, String fieldName) {
6428
        _thriftId = thriftId;
6429
        _fieldName = fieldName;
6430
      }
6431
 
6432
      public short getThriftFieldId() {
6433
        return _thriftId;
6434
      }
6435
 
6436
      public String getFieldName() {
6437
        return _fieldName;
6438
      }
6439
    }
6440
 
6441
    // isset id assignments
6442
    private static final int __PROMOTIONID_ISSET_ID = 0;
6443
    private BitSet __isset_bit_vector = new BitSet(1);
6444
 
3430 rajveer 6445
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6446
    static {
3430 rajveer 6447
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6448
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6449
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6450
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6451
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_args.class, metaDataMap);
1982 varun.gupt 6452
    }
6453
 
6454
    public getPromotionById_args() {
6455
    }
6456
 
6457
    public getPromotionById_args(
6458
      long promotionId)
6459
    {
6460
      this();
6461
      this.promotionId = promotionId;
6462
      setPromotionIdIsSet(true);
6463
    }
6464
 
6465
    /**
6466
     * Performs a deep copy on <i>other</i>.
6467
     */
6468
    public getPromotionById_args(getPromotionById_args other) {
6469
      __isset_bit_vector.clear();
6470
      __isset_bit_vector.or(other.__isset_bit_vector);
6471
      this.promotionId = other.promotionId;
6472
    }
6473
 
6474
    public getPromotionById_args deepCopy() {
6475
      return new getPromotionById_args(this);
6476
    }
6477
 
3430 rajveer 6478
    @Override
6479
    public void clear() {
6480
      setPromotionIdIsSet(false);
6481
      this.promotionId = 0;
1982 varun.gupt 6482
    }
6483
 
6484
    public long getPromotionId() {
6485
      return this.promotionId;
6486
    }
6487
 
3430 rajveer 6488
    public void setPromotionId(long promotionId) {
1982 varun.gupt 6489
      this.promotionId = promotionId;
6490
      setPromotionIdIsSet(true);
6491
    }
6492
 
6493
    public void unsetPromotionId() {
6494
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
6495
    }
6496
 
3430 rajveer 6497
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6498
    public boolean isSetPromotionId() {
6499
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
6500
    }
6501
 
6502
    public void setPromotionIdIsSet(boolean value) {
6503
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
6504
    }
6505
 
6506
    public void setFieldValue(_Fields field, Object value) {
6507
      switch (field) {
6508
      case PROMOTION_ID:
6509
        if (value == null) {
6510
          unsetPromotionId();
6511
        } else {
6512
          setPromotionId((Long)value);
6513
        }
6514
        break;
6515
 
6516
      }
6517
    }
6518
 
6519
    public Object getFieldValue(_Fields field) {
6520
      switch (field) {
6521
      case PROMOTION_ID:
3430 rajveer 6522
        return Long.valueOf(getPromotionId());
1982 varun.gupt 6523
 
6524
      }
6525
      throw new IllegalStateException();
6526
    }
6527
 
3430 rajveer 6528
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6529
    public boolean isSet(_Fields field) {
6530
      if (field == null) {
6531
        throw new IllegalArgumentException();
6532
      }
1982 varun.gupt 6533
 
6534
      switch (field) {
6535
      case PROMOTION_ID:
6536
        return isSetPromotionId();
6537
      }
6538
      throw new IllegalStateException();
6539
    }
6540
 
6541
    @Override
6542
    public boolean equals(Object that) {
6543
      if (that == null)
6544
        return false;
6545
      if (that instanceof getPromotionById_args)
6546
        return this.equals((getPromotionById_args)that);
6547
      return false;
6548
    }
6549
 
6550
    public boolean equals(getPromotionById_args that) {
6551
      if (that == null)
6552
        return false;
6553
 
6554
      boolean this_present_promotionId = true;
6555
      boolean that_present_promotionId = true;
6556
      if (this_present_promotionId || that_present_promotionId) {
6557
        if (!(this_present_promotionId && that_present_promotionId))
6558
          return false;
6559
        if (this.promotionId != that.promotionId)
6560
          return false;
6561
      }
6562
 
6563
      return true;
6564
    }
6565
 
6566
    @Override
6567
    public int hashCode() {
6568
      return 0;
6569
    }
6570
 
6571
    public int compareTo(getPromotionById_args other) {
6572
      if (!getClass().equals(other.getClass())) {
6573
        return getClass().getName().compareTo(other.getClass().getName());
6574
      }
6575
 
6576
      int lastComparison = 0;
6577
      getPromotionById_args typedOther = (getPromotionById_args)other;
6578
 
3430 rajveer 6579
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 6580
      if (lastComparison != 0) {
6581
        return lastComparison;
6582
      }
3430 rajveer 6583
      if (isSetPromotionId()) {
6584
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
6585
        if (lastComparison != 0) {
6586
          return lastComparison;
6587
        }
1982 varun.gupt 6588
      }
6589
      return 0;
6590
    }
6591
 
3430 rajveer 6592
    public _Fields fieldForId(int fieldId) {
6593
      return _Fields.findByThriftId(fieldId);
6594
    }
6595
 
6596
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6597
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6598
      iprot.readStructBegin();
6599
      while (true)
6600
      {
6601
        field = iprot.readFieldBegin();
3430 rajveer 6602
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6603
          break;
6604
        }
3430 rajveer 6605
        switch (field.id) {
6606
          case 1: // PROMOTION_ID
6607
            if (field.type == org.apache.thrift.protocol.TType.I64) {
6608
              this.promotionId = iprot.readI64();
6609
              setPromotionIdIsSet(true);
6610
            } else { 
6611
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6612
            }
6613
            break;
6614
          default:
6615
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6616
        }
3430 rajveer 6617
        iprot.readFieldEnd();
1982 varun.gupt 6618
      }
6619
      iprot.readStructEnd();
6620
      validate();
6621
    }
6622
 
3430 rajveer 6623
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6624
      validate();
6625
 
6626
      oprot.writeStructBegin(STRUCT_DESC);
6627
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
6628
      oprot.writeI64(this.promotionId);
6629
      oprot.writeFieldEnd();
6630
      oprot.writeFieldStop();
6631
      oprot.writeStructEnd();
6632
    }
6633
 
6634
    @Override
6635
    public String toString() {
6636
      StringBuilder sb = new StringBuilder("getPromotionById_args(");
6637
      boolean first = true;
6638
 
6639
      sb.append("promotionId:");
6640
      sb.append(this.promotionId);
6641
      first = false;
6642
      sb.append(")");
6643
      return sb.toString();
6644
    }
6645
 
3430 rajveer 6646
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 6647
      // check for required fields
6648
    }
6649
 
3430 rajveer 6650
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
6651
      try {
6652
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
6653
      } catch (org.apache.thrift.TException te) {
6654
        throw new java.io.IOException(te);
6655
      }
6656
    }
6657
 
6658
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
6659
      try {
6660
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
6661
        __isset_bit_vector = new BitSet(1);
6662
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
6663
      } catch (org.apache.thrift.TException te) {
6664
        throw new java.io.IOException(te);
6665
      }
6666
    }
6667
 
1982 varun.gupt 6668
  }
6669
 
3430 rajveer 6670
  public static class getPromotionById_result implements org.apache.thrift.TBase<getPromotionById_result, getPromotionById_result._Fields>, java.io.Serializable, Cloneable   {
6671
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getPromotionById_result");
1982 varun.gupt 6672
 
3430 rajveer 6673
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
6674
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
1982 varun.gupt 6675
 
3430 rajveer 6676
    private Promotion success; // required
6677
    private PromotionException pex; // required
1982 varun.gupt 6678
 
6679
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 6680
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 6681
      SUCCESS((short)0, "success"),
6682
      PEX((short)1, "pex");
6683
 
6684
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
6685
 
6686
      static {
6687
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
6688
          byName.put(field.getFieldName(), field);
6689
        }
6690
      }
6691
 
6692
      /**
6693
       * Find the _Fields constant that matches fieldId, or null if its not found.
6694
       */
6695
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 6696
        switch(fieldId) {
6697
          case 0: // SUCCESS
6698
            return SUCCESS;
6699
          case 1: // PEX
6700
            return PEX;
6701
          default:
6702
            return null;
6703
        }
1982 varun.gupt 6704
      }
6705
 
6706
      /**
6707
       * Find the _Fields constant that matches fieldId, throwing an exception
6708
       * if it is not found.
6709
       */
6710
      public static _Fields findByThriftIdOrThrow(int fieldId) {
6711
        _Fields fields = findByThriftId(fieldId);
6712
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
6713
        return fields;
6714
      }
6715
 
6716
      /**
6717
       * Find the _Fields constant that matches name, or null if its not found.
6718
       */
6719
      public static _Fields findByName(String name) {
6720
        return byName.get(name);
6721
      }
6722
 
6723
      private final short _thriftId;
6724
      private final String _fieldName;
6725
 
6726
      _Fields(short thriftId, String fieldName) {
6727
        _thriftId = thriftId;
6728
        _fieldName = fieldName;
6729
      }
6730
 
6731
      public short getThriftFieldId() {
6732
        return _thriftId;
6733
      }
6734
 
6735
      public String getFieldName() {
6736
        return _fieldName;
6737
      }
6738
    }
6739
 
6740
    // isset id assignments
6741
 
3430 rajveer 6742
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 6743
    static {
3430 rajveer 6744
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
6745
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6746
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class)));
6747
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6748
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
6749
      metaDataMap = Collections.unmodifiableMap(tmpMap);
6750
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getPromotionById_result.class, metaDataMap);
1982 varun.gupt 6751
    }
6752
 
6753
    public getPromotionById_result() {
6754
    }
6755
 
6756
    public getPromotionById_result(
6757
      Promotion success,
6758
      PromotionException pex)
6759
    {
6760
      this();
6761
      this.success = success;
6762
      this.pex = pex;
6763
    }
6764
 
6765
    /**
6766
     * Performs a deep copy on <i>other</i>.
6767
     */
6768
    public getPromotionById_result(getPromotionById_result other) {
6769
      if (other.isSetSuccess()) {
6770
        this.success = new Promotion(other.success);
6771
      }
6772
      if (other.isSetPex()) {
6773
        this.pex = new PromotionException(other.pex);
6774
      }
6775
    }
6776
 
6777
    public getPromotionById_result deepCopy() {
6778
      return new getPromotionById_result(this);
6779
    }
6780
 
3430 rajveer 6781
    @Override
6782
    public void clear() {
6783
      this.success = null;
6784
      this.pex = null;
1982 varun.gupt 6785
    }
6786
 
6787
    public Promotion getSuccess() {
6788
      return this.success;
6789
    }
6790
 
3430 rajveer 6791
    public void setSuccess(Promotion success) {
1982 varun.gupt 6792
      this.success = success;
6793
    }
6794
 
6795
    public void unsetSuccess() {
6796
      this.success = null;
6797
    }
6798
 
3430 rajveer 6799
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6800
    public boolean isSetSuccess() {
6801
      return this.success != null;
6802
    }
6803
 
6804
    public void setSuccessIsSet(boolean value) {
6805
      if (!value) {
6806
        this.success = null;
6807
      }
6808
    }
6809
 
6810
    public PromotionException getPex() {
6811
      return this.pex;
6812
    }
6813
 
3430 rajveer 6814
    public void setPex(PromotionException pex) {
1982 varun.gupt 6815
      this.pex = pex;
6816
    }
6817
 
6818
    public void unsetPex() {
6819
      this.pex = null;
6820
    }
6821
 
3430 rajveer 6822
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 6823
    public boolean isSetPex() {
6824
      return this.pex != null;
6825
    }
6826
 
6827
    public void setPexIsSet(boolean value) {
6828
      if (!value) {
6829
        this.pex = null;
6830
      }
6831
    }
6832
 
6833
    public void setFieldValue(_Fields field, Object value) {
6834
      switch (field) {
6835
      case SUCCESS:
6836
        if (value == null) {
6837
          unsetSuccess();
6838
        } else {
6839
          setSuccess((Promotion)value);
6840
        }
6841
        break;
6842
 
6843
      case PEX:
6844
        if (value == null) {
6845
          unsetPex();
6846
        } else {
6847
          setPex((PromotionException)value);
6848
        }
6849
        break;
6850
 
6851
      }
6852
    }
6853
 
6854
    public Object getFieldValue(_Fields field) {
6855
      switch (field) {
6856
      case SUCCESS:
6857
        return getSuccess();
6858
 
6859
      case PEX:
6860
        return getPex();
6861
 
6862
      }
6863
      throw new IllegalStateException();
6864
    }
6865
 
3430 rajveer 6866
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
6867
    public boolean isSet(_Fields field) {
6868
      if (field == null) {
6869
        throw new IllegalArgumentException();
6870
      }
1982 varun.gupt 6871
 
6872
      switch (field) {
6873
      case SUCCESS:
6874
        return isSetSuccess();
6875
      case PEX:
6876
        return isSetPex();
6877
      }
6878
      throw new IllegalStateException();
6879
    }
6880
 
6881
    @Override
6882
    public boolean equals(Object that) {
6883
      if (that == null)
6884
        return false;
6885
      if (that instanceof getPromotionById_result)
6886
        return this.equals((getPromotionById_result)that);
6887
      return false;
6888
    }
6889
 
6890
    public boolean equals(getPromotionById_result that) {
6891
      if (that == null)
6892
        return false;
6893
 
6894
      boolean this_present_success = true && this.isSetSuccess();
6895
      boolean that_present_success = true && that.isSetSuccess();
6896
      if (this_present_success || that_present_success) {
6897
        if (!(this_present_success && that_present_success))
6898
          return false;
6899
        if (!this.success.equals(that.success))
6900
          return false;
6901
      }
6902
 
6903
      boolean this_present_pex = true && this.isSetPex();
6904
      boolean that_present_pex = true && that.isSetPex();
6905
      if (this_present_pex || that_present_pex) {
6906
        if (!(this_present_pex && that_present_pex))
6907
          return false;
6908
        if (!this.pex.equals(that.pex))
6909
          return false;
6910
      }
6911
 
6912
      return true;
6913
    }
6914
 
6915
    @Override
6916
    public int hashCode() {
6917
      return 0;
6918
    }
6919
 
6920
    public int compareTo(getPromotionById_result other) {
6921
      if (!getClass().equals(other.getClass())) {
6922
        return getClass().getName().compareTo(other.getClass().getName());
6923
      }
6924
 
6925
      int lastComparison = 0;
6926
      getPromotionById_result typedOther = (getPromotionById_result)other;
6927
 
3430 rajveer 6928
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 6929
      if (lastComparison != 0) {
6930
        return lastComparison;
6931
      }
3430 rajveer 6932
      if (isSetSuccess()) {
6933
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
6934
        if (lastComparison != 0) {
6935
          return lastComparison;
6936
        }
1982 varun.gupt 6937
      }
3430 rajveer 6938
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 6939
      if (lastComparison != 0) {
6940
        return lastComparison;
6941
      }
3430 rajveer 6942
      if (isSetPex()) {
6943
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
6944
        if (lastComparison != 0) {
6945
          return lastComparison;
6946
        }
1982 varun.gupt 6947
      }
6948
      return 0;
6949
    }
6950
 
3430 rajveer 6951
    public _Fields fieldForId(int fieldId) {
6952
      return _Fields.findByThriftId(fieldId);
6953
    }
6954
 
6955
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
6956
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 6957
      iprot.readStructBegin();
6958
      while (true)
6959
      {
6960
        field = iprot.readFieldBegin();
3430 rajveer 6961
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 6962
          break;
6963
        }
3430 rajveer 6964
        switch (field.id) {
6965
          case 0: // SUCCESS
6966
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6967
              this.success = new Promotion();
6968
              this.success.read(iprot);
6969
            } else { 
6970
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6971
            }
6972
            break;
6973
          case 1: // PEX
6974
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
6975
              this.pex = new PromotionException();
6976
              this.pex.read(iprot);
6977
            } else { 
6978
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
6979
            }
6980
            break;
6981
          default:
6982
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 6983
        }
3430 rajveer 6984
        iprot.readFieldEnd();
1982 varun.gupt 6985
      }
6986
      iprot.readStructEnd();
6987
      validate();
6988
    }
6989
 
3430 rajveer 6990
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 6991
      oprot.writeStructBegin(STRUCT_DESC);
6992
 
6993
      if (this.isSetSuccess()) {
6994
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
6995
        this.success.write(oprot);
6996
        oprot.writeFieldEnd();
6997
      } else if (this.isSetPex()) {
6998
        oprot.writeFieldBegin(PEX_FIELD_DESC);
6999
        this.pex.write(oprot);
7000
        oprot.writeFieldEnd();
7001
      }
7002
      oprot.writeFieldStop();
7003
      oprot.writeStructEnd();
7004
    }
7005
 
7006
    @Override
7007
    public String toString() {
7008
      StringBuilder sb = new StringBuilder("getPromotionById_result(");
7009
      boolean first = true;
7010
 
7011
      sb.append("success:");
7012
      if (this.success == null) {
7013
        sb.append("null");
7014
      } else {
7015
        sb.append(this.success);
7016
      }
7017
      first = false;
7018
      if (!first) sb.append(", ");
7019
      sb.append("pex:");
7020
      if (this.pex == null) {
7021
        sb.append("null");
7022
      } else {
7023
        sb.append(this.pex);
7024
      }
7025
      first = false;
7026
      sb.append(")");
7027
      return sb.toString();
7028
    }
7029
 
3430 rajveer 7030
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7031
      // check for required fields
7032
    }
7033
 
3430 rajveer 7034
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7035
      try {
7036
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7037
      } catch (org.apache.thrift.TException te) {
7038
        throw new java.io.IOException(te);
7039
      }
7040
    }
7041
 
7042
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7043
      try {
7044
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7045
      } catch (org.apache.thrift.TException te) {
7046
        throw new java.io.IOException(te);
7047
      }
7048
    }
7049
 
1982 varun.gupt 7050
  }
7051
 
3430 rajveer 7052
  public static class generateCouponsForPromotion_args implements org.apache.thrift.TBase<generateCouponsForPromotion_args, generateCouponsForPromotion_args._Fields>, java.io.Serializable, Cloneable   {
7053
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_args");
1982 varun.gupt 7054
 
3430 rajveer 7055
    private static final org.apache.thrift.protocol.TField PROMOTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("promotionId", org.apache.thrift.protocol.TType.I64, (short)1);
7056
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)2);
1982 varun.gupt 7057
 
3430 rajveer 7058
    private long promotionId; // required
7059
    private String couponCode; // required
1982 varun.gupt 7060
 
7061
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7062
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 7063
      PROMOTION_ID((short)1, "promotionId"),
7064
      COUPON_CODE((short)2, "couponCode");
7065
 
7066
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7067
 
7068
      static {
7069
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7070
          byName.put(field.getFieldName(), field);
7071
        }
7072
      }
7073
 
7074
      /**
7075
       * Find the _Fields constant that matches fieldId, or null if its not found.
7076
       */
7077
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7078
        switch(fieldId) {
7079
          case 1: // PROMOTION_ID
7080
            return PROMOTION_ID;
7081
          case 2: // COUPON_CODE
7082
            return COUPON_CODE;
7083
          default:
7084
            return null;
7085
        }
1982 varun.gupt 7086
      }
7087
 
7088
      /**
7089
       * Find the _Fields constant that matches fieldId, throwing an exception
7090
       * if it is not found.
7091
       */
7092
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7093
        _Fields fields = findByThriftId(fieldId);
7094
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7095
        return fields;
7096
      }
7097
 
7098
      /**
7099
       * Find the _Fields constant that matches name, or null if its not found.
7100
       */
7101
      public static _Fields findByName(String name) {
7102
        return byName.get(name);
7103
      }
7104
 
7105
      private final short _thriftId;
7106
      private final String _fieldName;
7107
 
7108
      _Fields(short thriftId, String fieldName) {
7109
        _thriftId = thriftId;
7110
        _fieldName = fieldName;
7111
      }
7112
 
7113
      public short getThriftFieldId() {
7114
        return _thriftId;
7115
      }
7116
 
7117
      public String getFieldName() {
7118
        return _fieldName;
7119
      }
7120
    }
7121
 
7122
    // isset id assignments
7123
    private static final int __PROMOTIONID_ISSET_ID = 0;
7124
    private BitSet __isset_bit_vector = new BitSet(1);
7125
 
3430 rajveer 7126
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 7127
    static {
3430 rajveer 7128
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7129
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7130
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7131
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7132
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
7133
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7134
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_args.class, metaDataMap);
1982 varun.gupt 7135
    }
7136
 
7137
    public generateCouponsForPromotion_args() {
7138
    }
7139
 
7140
    public generateCouponsForPromotion_args(
7141
      long promotionId,
7142
      String couponCode)
7143
    {
7144
      this();
7145
      this.promotionId = promotionId;
7146
      setPromotionIdIsSet(true);
7147
      this.couponCode = couponCode;
7148
    }
7149
 
7150
    /**
7151
     * Performs a deep copy on <i>other</i>.
7152
     */
7153
    public generateCouponsForPromotion_args(generateCouponsForPromotion_args other) {
7154
      __isset_bit_vector.clear();
7155
      __isset_bit_vector.or(other.__isset_bit_vector);
7156
      this.promotionId = other.promotionId;
7157
      if (other.isSetCouponCode()) {
7158
        this.couponCode = other.couponCode;
7159
      }
7160
    }
7161
 
7162
    public generateCouponsForPromotion_args deepCopy() {
7163
      return new generateCouponsForPromotion_args(this);
7164
    }
7165
 
3430 rajveer 7166
    @Override
7167
    public void clear() {
7168
      setPromotionIdIsSet(false);
7169
      this.promotionId = 0;
7170
      this.couponCode = null;
1982 varun.gupt 7171
    }
7172
 
7173
    public long getPromotionId() {
7174
      return this.promotionId;
7175
    }
7176
 
3430 rajveer 7177
    public void setPromotionId(long promotionId) {
1982 varun.gupt 7178
      this.promotionId = promotionId;
7179
      setPromotionIdIsSet(true);
7180
    }
7181
 
7182
    public void unsetPromotionId() {
7183
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
7184
    }
7185
 
3430 rajveer 7186
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7187
    public boolean isSetPromotionId() {
7188
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
7189
    }
7190
 
7191
    public void setPromotionIdIsSet(boolean value) {
7192
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
7193
    }
7194
 
7195
    public String getCouponCode() {
7196
      return this.couponCode;
7197
    }
7198
 
3430 rajveer 7199
    public void setCouponCode(String couponCode) {
1982 varun.gupt 7200
      this.couponCode = couponCode;
7201
    }
7202
 
7203
    public void unsetCouponCode() {
7204
      this.couponCode = null;
7205
    }
7206
 
3430 rajveer 7207
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7208
    public boolean isSetCouponCode() {
7209
      return this.couponCode != null;
7210
    }
7211
 
7212
    public void setCouponCodeIsSet(boolean value) {
7213
      if (!value) {
7214
        this.couponCode = null;
7215
      }
7216
    }
7217
 
7218
    public void setFieldValue(_Fields field, Object value) {
7219
      switch (field) {
7220
      case PROMOTION_ID:
7221
        if (value == null) {
7222
          unsetPromotionId();
7223
        } else {
7224
          setPromotionId((Long)value);
7225
        }
7226
        break;
7227
 
7228
      case COUPON_CODE:
7229
        if (value == null) {
7230
          unsetCouponCode();
7231
        } else {
7232
          setCouponCode((String)value);
7233
        }
7234
        break;
7235
 
7236
      }
7237
    }
7238
 
7239
    public Object getFieldValue(_Fields field) {
7240
      switch (field) {
7241
      case PROMOTION_ID:
3430 rajveer 7242
        return Long.valueOf(getPromotionId());
1982 varun.gupt 7243
 
7244
      case COUPON_CODE:
7245
        return getCouponCode();
7246
 
7247
      }
7248
      throw new IllegalStateException();
7249
    }
7250
 
3430 rajveer 7251
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7252
    public boolean isSet(_Fields field) {
7253
      if (field == null) {
7254
        throw new IllegalArgumentException();
7255
      }
1982 varun.gupt 7256
 
7257
      switch (field) {
7258
      case PROMOTION_ID:
7259
        return isSetPromotionId();
7260
      case COUPON_CODE:
7261
        return isSetCouponCode();
7262
      }
7263
      throw new IllegalStateException();
7264
    }
7265
 
7266
    @Override
7267
    public boolean equals(Object that) {
7268
      if (that == null)
7269
        return false;
7270
      if (that instanceof generateCouponsForPromotion_args)
7271
        return this.equals((generateCouponsForPromotion_args)that);
7272
      return false;
7273
    }
7274
 
7275
    public boolean equals(generateCouponsForPromotion_args that) {
7276
      if (that == null)
7277
        return false;
7278
 
7279
      boolean this_present_promotionId = true;
7280
      boolean that_present_promotionId = true;
7281
      if (this_present_promotionId || that_present_promotionId) {
7282
        if (!(this_present_promotionId && that_present_promotionId))
7283
          return false;
7284
        if (this.promotionId != that.promotionId)
7285
          return false;
7286
      }
7287
 
7288
      boolean this_present_couponCode = true && this.isSetCouponCode();
7289
      boolean that_present_couponCode = true && that.isSetCouponCode();
7290
      if (this_present_couponCode || that_present_couponCode) {
7291
        if (!(this_present_couponCode && that_present_couponCode))
7292
          return false;
7293
        if (!this.couponCode.equals(that.couponCode))
7294
          return false;
7295
      }
7296
 
7297
      return true;
7298
    }
7299
 
7300
    @Override
7301
    public int hashCode() {
7302
      return 0;
7303
    }
7304
 
7305
    public int compareTo(generateCouponsForPromotion_args other) {
7306
      if (!getClass().equals(other.getClass())) {
7307
        return getClass().getName().compareTo(other.getClass().getName());
7308
      }
7309
 
7310
      int lastComparison = 0;
7311
      generateCouponsForPromotion_args typedOther = (generateCouponsForPromotion_args)other;
7312
 
3430 rajveer 7313
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
1982 varun.gupt 7314
      if (lastComparison != 0) {
7315
        return lastComparison;
7316
      }
3430 rajveer 7317
      if (isSetPromotionId()) {
7318
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
7319
        if (lastComparison != 0) {
7320
          return lastComparison;
7321
        }
1982 varun.gupt 7322
      }
3430 rajveer 7323
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 7324
      if (lastComparison != 0) {
7325
        return lastComparison;
7326
      }
3430 rajveer 7327
      if (isSetCouponCode()) {
7328
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
7329
        if (lastComparison != 0) {
7330
          return lastComparison;
7331
        }
1982 varun.gupt 7332
      }
7333
      return 0;
7334
    }
7335
 
3430 rajveer 7336
    public _Fields fieldForId(int fieldId) {
7337
      return _Fields.findByThriftId(fieldId);
7338
    }
7339
 
7340
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7341
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 7342
      iprot.readStructBegin();
7343
      while (true)
7344
      {
7345
        field = iprot.readFieldBegin();
3430 rajveer 7346
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 7347
          break;
7348
        }
3430 rajveer 7349
        switch (field.id) {
7350
          case 1: // PROMOTION_ID
7351
            if (field.type == org.apache.thrift.protocol.TType.I64) {
7352
              this.promotionId = iprot.readI64();
7353
              setPromotionIdIsSet(true);
7354
            } else { 
7355
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7356
            }
7357
            break;
7358
          case 2: // COUPON_CODE
7359
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
7360
              this.couponCode = iprot.readString();
7361
            } else { 
7362
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7363
            }
7364
            break;
7365
          default:
7366
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 7367
        }
3430 rajveer 7368
        iprot.readFieldEnd();
1982 varun.gupt 7369
      }
7370
      iprot.readStructEnd();
7371
      validate();
7372
    }
7373
 
3430 rajveer 7374
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 7375
      validate();
7376
 
7377
      oprot.writeStructBegin(STRUCT_DESC);
7378
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
7379
      oprot.writeI64(this.promotionId);
7380
      oprot.writeFieldEnd();
7381
      if (this.couponCode != null) {
7382
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
7383
        oprot.writeString(this.couponCode);
7384
        oprot.writeFieldEnd();
7385
      }
7386
      oprot.writeFieldStop();
7387
      oprot.writeStructEnd();
7388
    }
7389
 
7390
    @Override
7391
    public String toString() {
7392
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_args(");
7393
      boolean first = true;
7394
 
7395
      sb.append("promotionId:");
7396
      sb.append(this.promotionId);
7397
      first = false;
7398
      if (!first) sb.append(", ");
7399
      sb.append("couponCode:");
7400
      if (this.couponCode == null) {
7401
        sb.append("null");
7402
      } else {
7403
        sb.append(this.couponCode);
7404
      }
7405
      first = false;
7406
      sb.append(")");
7407
      return sb.toString();
7408
    }
7409
 
3430 rajveer 7410
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7411
      // check for required fields
7412
    }
7413
 
3430 rajveer 7414
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7415
      try {
7416
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7417
      } catch (org.apache.thrift.TException te) {
7418
        throw new java.io.IOException(te);
7419
      }
7420
    }
7421
 
7422
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7423
      try {
7424
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
7425
        __isset_bit_vector = new BitSet(1);
7426
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7427
      } catch (org.apache.thrift.TException te) {
7428
        throw new java.io.IOException(te);
7429
      }
7430
    }
7431
 
1982 varun.gupt 7432
  }
7433
 
3430 rajveer 7434
  public static class generateCouponsForPromotion_result implements org.apache.thrift.TBase<generateCouponsForPromotion_result, generateCouponsForPromotion_result._Fields>, java.io.Serializable, Cloneable   {
7435
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("generateCouponsForPromotion_result");
1982 varun.gupt 7436
 
3430 rajveer 7437
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
1982 varun.gupt 7438
 
3430 rajveer 7439
    private PromotionException pex; // required
1982 varun.gupt 7440
 
7441
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7442
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 7443
      PEX((short)1, "pex");
7444
 
7445
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7446
 
7447
      static {
7448
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7449
          byName.put(field.getFieldName(), field);
7450
        }
7451
      }
7452
 
7453
      /**
7454
       * Find the _Fields constant that matches fieldId, or null if its not found.
7455
       */
7456
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7457
        switch(fieldId) {
7458
          case 1: // PEX
7459
            return PEX;
7460
          default:
7461
            return null;
7462
        }
1982 varun.gupt 7463
      }
7464
 
7465
      /**
7466
       * Find the _Fields constant that matches fieldId, throwing an exception
7467
       * if it is not found.
7468
       */
7469
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7470
        _Fields fields = findByThriftId(fieldId);
7471
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7472
        return fields;
7473
      }
7474
 
7475
      /**
7476
       * Find the _Fields constant that matches name, or null if its not found.
7477
       */
7478
      public static _Fields findByName(String name) {
7479
        return byName.get(name);
7480
      }
7481
 
7482
      private final short _thriftId;
7483
      private final String _fieldName;
7484
 
7485
      _Fields(short thriftId, String fieldName) {
7486
        _thriftId = thriftId;
7487
        _fieldName = fieldName;
7488
      }
7489
 
7490
      public short getThriftFieldId() {
7491
        return _thriftId;
7492
      }
7493
 
7494
      public String getFieldName() {
7495
        return _fieldName;
7496
      }
7497
    }
7498
 
7499
    // isset id assignments
7500
 
3430 rajveer 7501
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 7502
    static {
3430 rajveer 7503
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7504
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7505
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
7506
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7507
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(generateCouponsForPromotion_result.class, metaDataMap);
1982 varun.gupt 7508
    }
7509
 
7510
    public generateCouponsForPromotion_result() {
7511
    }
7512
 
7513
    public generateCouponsForPromotion_result(
7514
      PromotionException pex)
7515
    {
7516
      this();
7517
      this.pex = pex;
7518
    }
7519
 
7520
    /**
7521
     * Performs a deep copy on <i>other</i>.
7522
     */
7523
    public generateCouponsForPromotion_result(generateCouponsForPromotion_result other) {
7524
      if (other.isSetPex()) {
7525
        this.pex = new PromotionException(other.pex);
7526
      }
7527
    }
7528
 
7529
    public generateCouponsForPromotion_result deepCopy() {
7530
      return new generateCouponsForPromotion_result(this);
7531
    }
7532
 
3430 rajveer 7533
    @Override
7534
    public void clear() {
7535
      this.pex = null;
1982 varun.gupt 7536
    }
7537
 
7538
    public PromotionException getPex() {
7539
      return this.pex;
7540
    }
7541
 
3430 rajveer 7542
    public void setPex(PromotionException pex) {
1982 varun.gupt 7543
      this.pex = pex;
7544
    }
7545
 
7546
    public void unsetPex() {
7547
      this.pex = null;
7548
    }
7549
 
3430 rajveer 7550
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7551
    public boolean isSetPex() {
7552
      return this.pex != null;
7553
    }
7554
 
7555
    public void setPexIsSet(boolean value) {
7556
      if (!value) {
7557
        this.pex = null;
7558
      }
7559
    }
7560
 
7561
    public void setFieldValue(_Fields field, Object value) {
7562
      switch (field) {
7563
      case PEX:
7564
        if (value == null) {
7565
          unsetPex();
7566
        } else {
7567
          setPex((PromotionException)value);
7568
        }
7569
        break;
7570
 
7571
      }
7572
    }
7573
 
7574
    public Object getFieldValue(_Fields field) {
7575
      switch (field) {
7576
      case PEX:
7577
        return getPex();
7578
 
7579
      }
7580
      throw new IllegalStateException();
7581
    }
7582
 
3430 rajveer 7583
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7584
    public boolean isSet(_Fields field) {
7585
      if (field == null) {
7586
        throw new IllegalArgumentException();
7587
      }
1982 varun.gupt 7588
 
7589
      switch (field) {
7590
      case PEX:
7591
        return isSetPex();
7592
      }
7593
      throw new IllegalStateException();
7594
    }
7595
 
7596
    @Override
7597
    public boolean equals(Object that) {
7598
      if (that == null)
7599
        return false;
7600
      if (that instanceof generateCouponsForPromotion_result)
7601
        return this.equals((generateCouponsForPromotion_result)that);
7602
      return false;
7603
    }
7604
 
7605
    public boolean equals(generateCouponsForPromotion_result that) {
7606
      if (that == null)
7607
        return false;
7608
 
7609
      boolean this_present_pex = true && this.isSetPex();
7610
      boolean that_present_pex = true && that.isSetPex();
7611
      if (this_present_pex || that_present_pex) {
7612
        if (!(this_present_pex && that_present_pex))
7613
          return false;
7614
        if (!this.pex.equals(that.pex))
7615
          return false;
7616
      }
7617
 
7618
      return true;
7619
    }
7620
 
7621
    @Override
7622
    public int hashCode() {
7623
      return 0;
7624
    }
7625
 
7626
    public int compareTo(generateCouponsForPromotion_result other) {
7627
      if (!getClass().equals(other.getClass())) {
7628
        return getClass().getName().compareTo(other.getClass().getName());
7629
      }
7630
 
7631
      int lastComparison = 0;
7632
      generateCouponsForPromotion_result typedOther = (generateCouponsForPromotion_result)other;
7633
 
3430 rajveer 7634
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 7635
      if (lastComparison != 0) {
7636
        return lastComparison;
7637
      }
3430 rajveer 7638
      if (isSetPex()) {
7639
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
7640
        if (lastComparison != 0) {
7641
          return lastComparison;
7642
        }
1982 varun.gupt 7643
      }
7644
      return 0;
7645
    }
7646
 
3430 rajveer 7647
    public _Fields fieldForId(int fieldId) {
7648
      return _Fields.findByThriftId(fieldId);
7649
    }
7650
 
7651
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
7652
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 7653
      iprot.readStructBegin();
7654
      while (true)
7655
      {
7656
        field = iprot.readFieldBegin();
3430 rajveer 7657
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 7658
          break;
7659
        }
3430 rajveer 7660
        switch (field.id) {
7661
          case 1: // PEX
7662
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
7663
              this.pex = new PromotionException();
7664
              this.pex.read(iprot);
7665
            } else { 
7666
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
7667
            }
7668
            break;
7669
          default:
7670
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 7671
        }
3430 rajveer 7672
        iprot.readFieldEnd();
1982 varun.gupt 7673
      }
7674
      iprot.readStructEnd();
7675
      validate();
7676
    }
7677
 
3430 rajveer 7678
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 7679
      oprot.writeStructBegin(STRUCT_DESC);
7680
 
7681
      if (this.isSetPex()) {
7682
        oprot.writeFieldBegin(PEX_FIELD_DESC);
7683
        this.pex.write(oprot);
7684
        oprot.writeFieldEnd();
7685
      }
7686
      oprot.writeFieldStop();
7687
      oprot.writeStructEnd();
7688
    }
7689
 
7690
    @Override
7691
    public String toString() {
7692
      StringBuilder sb = new StringBuilder("generateCouponsForPromotion_result(");
7693
      boolean first = true;
7694
 
7695
      sb.append("pex:");
7696
      if (this.pex == null) {
7697
        sb.append("null");
7698
      } else {
7699
        sb.append(this.pex);
7700
      }
7701
      first = false;
7702
      sb.append(")");
7703
      return sb.toString();
7704
    }
7705
 
3430 rajveer 7706
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 7707
      // check for required fields
7708
    }
7709
 
3430 rajveer 7710
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
7711
      try {
7712
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
7713
      } catch (org.apache.thrift.TException te) {
7714
        throw new java.io.IOException(te);
7715
      }
7716
    }
7717
 
7718
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
7719
      try {
7720
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
7721
      } catch (org.apache.thrift.TException te) {
7722
        throw new java.io.IOException(te);
7723
      }
7724
    }
7725
 
1982 varun.gupt 7726
  }
7727
 
3430 rajveer 7728
  public static class applyCoupon_args implements org.apache.thrift.TBase<applyCoupon_args, applyCoupon_args._Fields>, java.io.Serializable, Cloneable   {
7729
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_args");
1982 varun.gupt 7730
 
3430 rajveer 7731
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)1);
7732
    private static final org.apache.thrift.protocol.TField CART_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("cartId", org.apache.thrift.protocol.TType.I64, (short)2);
1982 varun.gupt 7733
 
3430 rajveer 7734
    private String couponCode; // required
7735
    private long cartId; // required
1982 varun.gupt 7736
 
7737
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 7738
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 7739
      COUPON_CODE((short)1, "couponCode"),
7740
      CART_ID((short)2, "cartId");
7741
 
7742
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
7743
 
7744
      static {
7745
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
7746
          byName.put(field.getFieldName(), field);
7747
        }
7748
      }
7749
 
7750
      /**
7751
       * Find the _Fields constant that matches fieldId, or null if its not found.
7752
       */
7753
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 7754
        switch(fieldId) {
7755
          case 1: // COUPON_CODE
7756
            return COUPON_CODE;
7757
          case 2: // CART_ID
7758
            return CART_ID;
7759
          default:
7760
            return null;
7761
        }
1982 varun.gupt 7762
      }
7763
 
7764
      /**
7765
       * Find the _Fields constant that matches fieldId, throwing an exception
7766
       * if it is not found.
7767
       */
7768
      public static _Fields findByThriftIdOrThrow(int fieldId) {
7769
        _Fields fields = findByThriftId(fieldId);
7770
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
7771
        return fields;
7772
      }
7773
 
7774
      /**
7775
       * Find the _Fields constant that matches name, or null if its not found.
7776
       */
7777
      public static _Fields findByName(String name) {
7778
        return byName.get(name);
7779
      }
7780
 
7781
      private final short _thriftId;
7782
      private final String _fieldName;
7783
 
7784
      _Fields(short thriftId, String fieldName) {
7785
        _thriftId = thriftId;
7786
        _fieldName = fieldName;
7787
      }
7788
 
7789
      public short getThriftFieldId() {
7790
        return _thriftId;
7791
      }
7792
 
7793
      public String getFieldName() {
7794
        return _fieldName;
7795
      }
7796
    }
7797
 
7798
    // isset id assignments
7799
    private static final int __CARTID_ISSET_ID = 0;
7800
    private BitSet __isset_bit_vector = new BitSet(1);
7801
 
3430 rajveer 7802
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 7803
    static {
3430 rajveer 7804
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
7805
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7806
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
7807
      tmpMap.put(_Fields.CART_ID, new org.apache.thrift.meta_data.FieldMetaData("cartId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
7808
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
7809
      metaDataMap = Collections.unmodifiableMap(tmpMap);
7810
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_args.class, metaDataMap);
1982 varun.gupt 7811
    }
7812
 
7813
    public applyCoupon_args() {
7814
    }
7815
 
7816
    public applyCoupon_args(
7817
      String couponCode,
7818
      long cartId)
7819
    {
7820
      this();
7821
      this.couponCode = couponCode;
7822
      this.cartId = cartId;
7823
      setCartIdIsSet(true);
7824
    }
7825
 
7826
    /**
7827
     * Performs a deep copy on <i>other</i>.
7828
     */
7829
    public applyCoupon_args(applyCoupon_args other) {
7830
      __isset_bit_vector.clear();
7831
      __isset_bit_vector.or(other.__isset_bit_vector);
7832
      if (other.isSetCouponCode()) {
7833
        this.couponCode = other.couponCode;
7834
      }
7835
      this.cartId = other.cartId;
7836
    }
7837
 
7838
    public applyCoupon_args deepCopy() {
7839
      return new applyCoupon_args(this);
7840
    }
7841
 
3430 rajveer 7842
    @Override
7843
    public void clear() {
7844
      this.couponCode = null;
7845
      setCartIdIsSet(false);
7846
      this.cartId = 0;
1982 varun.gupt 7847
    }
7848
 
7849
    public String getCouponCode() {
7850
      return this.couponCode;
7851
    }
7852
 
3430 rajveer 7853
    public void setCouponCode(String couponCode) {
1982 varun.gupt 7854
      this.couponCode = couponCode;
7855
    }
7856
 
7857
    public void unsetCouponCode() {
7858
      this.couponCode = null;
7859
    }
7860
 
3430 rajveer 7861
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7862
    public boolean isSetCouponCode() {
7863
      return this.couponCode != null;
7864
    }
7865
 
7866
    public void setCouponCodeIsSet(boolean value) {
7867
      if (!value) {
7868
        this.couponCode = null;
7869
      }
7870
    }
7871
 
7872
    public long getCartId() {
7873
      return this.cartId;
7874
    }
7875
 
3430 rajveer 7876
    public void setCartId(long cartId) {
1982 varun.gupt 7877
      this.cartId = cartId;
7878
      setCartIdIsSet(true);
7879
    }
7880
 
7881
    public void unsetCartId() {
7882
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
7883
    }
7884
 
3430 rajveer 7885
    /** Returns true if field cartId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 7886
    public boolean isSetCartId() {
7887
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
7888
    }
7889
 
7890
    public void setCartIdIsSet(boolean value) {
7891
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
7892
    }
7893
 
7894
    public void setFieldValue(_Fields field, Object value) {
7895
      switch (field) {
7896
      case COUPON_CODE:
7897
        if (value == null) {
7898
          unsetCouponCode();
7899
        } else {
7900
          setCouponCode((String)value);
7901
        }
7902
        break;
7903
 
7904
      case CART_ID:
7905
        if (value == null) {
7906
          unsetCartId();
7907
        } else {
7908
          setCartId((Long)value);
7909
        }
7910
        break;
7911
 
7912
      }
7913
    }
7914
 
7915
    public Object getFieldValue(_Fields field) {
7916
      switch (field) {
7917
      case COUPON_CODE:
7918
        return getCouponCode();
7919
 
7920
      case CART_ID:
3430 rajveer 7921
        return Long.valueOf(getCartId());
1982 varun.gupt 7922
 
7923
      }
7924
      throw new IllegalStateException();
7925
    }
7926
 
3430 rajveer 7927
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
7928
    public boolean isSet(_Fields field) {
7929
      if (field == null) {
7930
        throw new IllegalArgumentException();
7931
      }
1982 varun.gupt 7932
 
7933
      switch (field) {
7934
      case COUPON_CODE:
7935
        return isSetCouponCode();
7936
      case CART_ID:
7937
        return isSetCartId();
7938
      }
7939
      throw new IllegalStateException();
7940
    }
7941
 
7942
    @Override
7943
    public boolean equals(Object that) {
7944
      if (that == null)
7945
        return false;
7946
      if (that instanceof applyCoupon_args)
7947
        return this.equals((applyCoupon_args)that);
7948
      return false;
7949
    }
7950
 
7951
    public boolean equals(applyCoupon_args that) {
7952
      if (that == null)
7953
        return false;
7954
 
7955
      boolean this_present_couponCode = true && this.isSetCouponCode();
7956
      boolean that_present_couponCode = true && that.isSetCouponCode();
7957
      if (this_present_couponCode || that_present_couponCode) {
7958
        if (!(this_present_couponCode && that_present_couponCode))
7959
          return false;
7960
        if (!this.couponCode.equals(that.couponCode))
7961
          return false;
7962
      }
7963
 
7964
      boolean this_present_cartId = true;
7965
      boolean that_present_cartId = true;
7966
      if (this_present_cartId || that_present_cartId) {
7967
        if (!(this_present_cartId && that_present_cartId))
7968
          return false;
7969
        if (this.cartId != that.cartId)
7970
          return false;
7971
      }
7972
 
7973
      return true;
7974
    }
7975
 
7976
    @Override
7977
    public int hashCode() {
7978
      return 0;
7979
    }
7980
 
7981
    public int compareTo(applyCoupon_args other) {
7982
      if (!getClass().equals(other.getClass())) {
7983
        return getClass().getName().compareTo(other.getClass().getName());
7984
      }
7985
 
7986
      int lastComparison = 0;
7987
      applyCoupon_args typedOther = (applyCoupon_args)other;
7988
 
3430 rajveer 7989
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 7990
      if (lastComparison != 0) {
7991
        return lastComparison;
7992
      }
3430 rajveer 7993
      if (isSetCouponCode()) {
7994
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
7995
        if (lastComparison != 0) {
7996
          return lastComparison;
7997
        }
1982 varun.gupt 7998
      }
3430 rajveer 7999
      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(typedOther.isSetCartId());
1982 varun.gupt 8000
      if (lastComparison != 0) {
8001
        return lastComparison;
8002
      }
3430 rajveer 8003
      if (isSetCartId()) {
8004
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cartId, typedOther.cartId);
8005
        if (lastComparison != 0) {
8006
          return lastComparison;
8007
        }
1982 varun.gupt 8008
      }
8009
      return 0;
8010
    }
8011
 
3430 rajveer 8012
    public _Fields fieldForId(int fieldId) {
8013
      return _Fields.findByThriftId(fieldId);
8014
    }
8015
 
8016
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8017
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 8018
      iprot.readStructBegin();
8019
      while (true)
8020
      {
8021
        field = iprot.readFieldBegin();
3430 rajveer 8022
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 8023
          break;
8024
        }
3430 rajveer 8025
        switch (field.id) {
8026
          case 1: // COUPON_CODE
8027
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
8028
              this.couponCode = iprot.readString();
8029
            } else { 
8030
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8031
            }
8032
            break;
8033
          case 2: // CART_ID
8034
            if (field.type == org.apache.thrift.protocol.TType.I64) {
8035
              this.cartId = iprot.readI64();
8036
              setCartIdIsSet(true);
8037
            } else { 
8038
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8039
            }
8040
            break;
8041
          default:
8042
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 8043
        }
3430 rajveer 8044
        iprot.readFieldEnd();
1982 varun.gupt 8045
      }
8046
      iprot.readStructEnd();
8047
      validate();
8048
    }
8049
 
3430 rajveer 8050
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 8051
      validate();
8052
 
8053
      oprot.writeStructBegin(STRUCT_DESC);
8054
      if (this.couponCode != null) {
8055
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
8056
        oprot.writeString(this.couponCode);
8057
        oprot.writeFieldEnd();
8058
      }
8059
      oprot.writeFieldBegin(CART_ID_FIELD_DESC);
8060
      oprot.writeI64(this.cartId);
8061
      oprot.writeFieldEnd();
8062
      oprot.writeFieldStop();
8063
      oprot.writeStructEnd();
8064
    }
8065
 
8066
    @Override
8067
    public String toString() {
8068
      StringBuilder sb = new StringBuilder("applyCoupon_args(");
8069
      boolean first = true;
8070
 
8071
      sb.append("couponCode:");
8072
      if (this.couponCode == null) {
8073
        sb.append("null");
8074
      } else {
8075
        sb.append(this.couponCode);
8076
      }
8077
      first = false;
8078
      if (!first) sb.append(", ");
8079
      sb.append("cartId:");
8080
      sb.append(this.cartId);
8081
      first = false;
8082
      sb.append(")");
8083
      return sb.toString();
8084
    }
8085
 
3430 rajveer 8086
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 8087
      // check for required fields
8088
    }
8089
 
3430 rajveer 8090
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8091
      try {
8092
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8093
      } catch (org.apache.thrift.TException te) {
8094
        throw new java.io.IOException(te);
8095
      }
8096
    }
8097
 
8098
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8099
      try {
8100
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
8101
        __isset_bit_vector = new BitSet(1);
8102
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8103
      } catch (org.apache.thrift.TException te) {
8104
        throw new java.io.IOException(te);
8105
      }
8106
    }
8107
 
1982 varun.gupt 8108
  }
8109
 
3430 rajveer 8110
  public static class applyCoupon_result implements org.apache.thrift.TBase<applyCoupon_result, applyCoupon_result._Fields>, java.io.Serializable, Cloneable   {
8111
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyCoupon_result");
1982 varun.gupt 8112
 
3430 rajveer 8113
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
8114
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
1982 varun.gupt 8115
 
3430 rajveer 8116
    private Cart success; // required
8117
    private PromotionException pex; // required
1982 varun.gupt 8118
 
8119
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 8120
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 8121
      SUCCESS((short)0, "success"),
8122
      PEX((short)1, "pex");
8123
 
8124
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8125
 
8126
      static {
8127
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8128
          byName.put(field.getFieldName(), field);
8129
        }
8130
      }
8131
 
8132
      /**
8133
       * Find the _Fields constant that matches fieldId, or null if its not found.
8134
       */
8135
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 8136
        switch(fieldId) {
8137
          case 0: // SUCCESS
8138
            return SUCCESS;
8139
          case 1: // PEX
8140
            return PEX;
8141
          default:
8142
            return null;
8143
        }
1982 varun.gupt 8144
      }
8145
 
8146
      /**
8147
       * Find the _Fields constant that matches fieldId, throwing an exception
8148
       * if it is not found.
8149
       */
8150
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8151
        _Fields fields = findByThriftId(fieldId);
8152
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8153
        return fields;
8154
      }
8155
 
8156
      /**
8157
       * Find the _Fields constant that matches name, or null if its not found.
8158
       */
8159
      public static _Fields findByName(String name) {
8160
        return byName.get(name);
8161
      }
8162
 
8163
      private final short _thriftId;
8164
      private final String _fieldName;
8165
 
8166
      _Fields(short thriftId, String fieldName) {
8167
        _thriftId = thriftId;
8168
        _fieldName = fieldName;
8169
      }
8170
 
8171
      public short getThriftFieldId() {
8172
        return _thriftId;
8173
      }
8174
 
8175
      public String getFieldName() {
8176
        return _fieldName;
8177
      }
8178
    }
8179
 
8180
    // isset id assignments
8181
 
3430 rajveer 8182
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 8183
    static {
3430 rajveer 8184
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8185
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8186
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Cart.class)));
8187
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8188
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
8189
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8190
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyCoupon_result.class, metaDataMap);
1982 varun.gupt 8191
    }
8192
 
8193
    public applyCoupon_result() {
8194
    }
8195
 
8196
    public applyCoupon_result(
8197
      Cart success,
8198
      PromotionException pex)
8199
    {
8200
      this();
8201
      this.success = success;
8202
      this.pex = pex;
8203
    }
8204
 
8205
    /**
8206
     * Performs a deep copy on <i>other</i>.
8207
     */
8208
    public applyCoupon_result(applyCoupon_result other) {
8209
      if (other.isSetSuccess()) {
8210
        this.success = new Cart(other.success);
8211
      }
8212
      if (other.isSetPex()) {
8213
        this.pex = new PromotionException(other.pex);
8214
      }
8215
    }
8216
 
8217
    public applyCoupon_result deepCopy() {
8218
      return new applyCoupon_result(this);
8219
    }
8220
 
3430 rajveer 8221
    @Override
8222
    public void clear() {
8223
      this.success = null;
8224
      this.pex = null;
1982 varun.gupt 8225
    }
8226
 
8227
    public Cart getSuccess() {
8228
      return this.success;
8229
    }
8230
 
3430 rajveer 8231
    public void setSuccess(Cart success) {
1982 varun.gupt 8232
      this.success = success;
8233
    }
8234
 
8235
    public void unsetSuccess() {
8236
      this.success = null;
8237
    }
8238
 
3430 rajveer 8239
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 8240
    public boolean isSetSuccess() {
8241
      return this.success != null;
8242
    }
8243
 
8244
    public void setSuccessIsSet(boolean value) {
8245
      if (!value) {
8246
        this.success = null;
8247
      }
8248
    }
8249
 
8250
    public PromotionException getPex() {
8251
      return this.pex;
8252
    }
8253
 
3430 rajveer 8254
    public void setPex(PromotionException pex) {
1982 varun.gupt 8255
      this.pex = pex;
8256
    }
8257
 
8258
    public void unsetPex() {
8259
      this.pex = null;
8260
    }
8261
 
3430 rajveer 8262
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 8263
    public boolean isSetPex() {
8264
      return this.pex != null;
8265
    }
8266
 
8267
    public void setPexIsSet(boolean value) {
8268
      if (!value) {
8269
        this.pex = null;
8270
      }
8271
    }
8272
 
8273
    public void setFieldValue(_Fields field, Object value) {
8274
      switch (field) {
8275
      case SUCCESS:
8276
        if (value == null) {
8277
          unsetSuccess();
8278
        } else {
8279
          setSuccess((Cart)value);
8280
        }
8281
        break;
8282
 
8283
      case PEX:
8284
        if (value == null) {
8285
          unsetPex();
8286
        } else {
8287
          setPex((PromotionException)value);
8288
        }
8289
        break;
8290
 
8291
      }
8292
    }
8293
 
8294
    public Object getFieldValue(_Fields field) {
8295
      switch (field) {
8296
      case SUCCESS:
8297
        return getSuccess();
8298
 
8299
      case PEX:
8300
        return getPex();
8301
 
8302
      }
8303
      throw new IllegalStateException();
8304
    }
8305
 
3430 rajveer 8306
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8307
    public boolean isSet(_Fields field) {
8308
      if (field == null) {
8309
        throw new IllegalArgumentException();
8310
      }
1982 varun.gupt 8311
 
8312
      switch (field) {
8313
      case SUCCESS:
8314
        return isSetSuccess();
8315
      case PEX:
8316
        return isSetPex();
8317
      }
8318
      throw new IllegalStateException();
8319
    }
8320
 
8321
    @Override
8322
    public boolean equals(Object that) {
8323
      if (that == null)
8324
        return false;
8325
      if (that instanceof applyCoupon_result)
8326
        return this.equals((applyCoupon_result)that);
8327
      return false;
8328
    }
8329
 
8330
    public boolean equals(applyCoupon_result that) {
8331
      if (that == null)
8332
        return false;
8333
 
8334
      boolean this_present_success = true && this.isSetSuccess();
8335
      boolean that_present_success = true && that.isSetSuccess();
8336
      if (this_present_success || that_present_success) {
8337
        if (!(this_present_success && that_present_success))
8338
          return false;
8339
        if (!this.success.equals(that.success))
8340
          return false;
8341
      }
8342
 
8343
      boolean this_present_pex = true && this.isSetPex();
8344
      boolean that_present_pex = true && that.isSetPex();
8345
      if (this_present_pex || that_present_pex) {
8346
        if (!(this_present_pex && that_present_pex))
8347
          return false;
8348
        if (!this.pex.equals(that.pex))
8349
          return false;
8350
      }
8351
 
8352
      return true;
8353
    }
8354
 
8355
    @Override
8356
    public int hashCode() {
8357
      return 0;
8358
    }
8359
 
8360
    public int compareTo(applyCoupon_result other) {
8361
      if (!getClass().equals(other.getClass())) {
8362
        return getClass().getName().compareTo(other.getClass().getName());
8363
      }
8364
 
8365
      int lastComparison = 0;
8366
      applyCoupon_result typedOther = (applyCoupon_result)other;
8367
 
3430 rajveer 8368
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 8369
      if (lastComparison != 0) {
8370
        return lastComparison;
8371
      }
3430 rajveer 8372
      if (isSetSuccess()) {
8373
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
8374
        if (lastComparison != 0) {
8375
          return lastComparison;
8376
        }
1982 varun.gupt 8377
      }
3430 rajveer 8378
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 8379
      if (lastComparison != 0) {
8380
        return lastComparison;
8381
      }
3430 rajveer 8382
      if (isSetPex()) {
8383
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
8384
        if (lastComparison != 0) {
8385
          return lastComparison;
8386
        }
1982 varun.gupt 8387
      }
8388
      return 0;
8389
    }
8390
 
3430 rajveer 8391
    public _Fields fieldForId(int fieldId) {
8392
      return _Fields.findByThriftId(fieldId);
8393
    }
8394
 
8395
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8396
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 8397
      iprot.readStructBegin();
8398
      while (true)
8399
      {
8400
        field = iprot.readFieldBegin();
3430 rajveer 8401
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 8402
          break;
8403
        }
3430 rajveer 8404
        switch (field.id) {
8405
          case 0: // SUCCESS
8406
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
8407
              this.success = new Cart();
8408
              this.success.read(iprot);
8409
            } else { 
8410
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8411
            }
8412
            break;
8413
          case 1: // PEX
8414
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
8415
              this.pex = new PromotionException();
8416
              this.pex.read(iprot);
8417
            } else { 
8418
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8419
            }
8420
            break;
8421
          default:
8422
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 8423
        }
3430 rajveer 8424
        iprot.readFieldEnd();
1982 varun.gupt 8425
      }
8426
      iprot.readStructEnd();
8427
      validate();
8428
    }
8429
 
3430 rajveer 8430
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 8431
      oprot.writeStructBegin(STRUCT_DESC);
8432
 
8433
      if (this.isSetSuccess()) {
8434
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
8435
        this.success.write(oprot);
8436
        oprot.writeFieldEnd();
8437
      } else if (this.isSetPex()) {
8438
        oprot.writeFieldBegin(PEX_FIELD_DESC);
8439
        this.pex.write(oprot);
8440
        oprot.writeFieldEnd();
8441
      }
8442
      oprot.writeFieldStop();
8443
      oprot.writeStructEnd();
8444
    }
8445
 
8446
    @Override
8447
    public String toString() {
8448
      StringBuilder sb = new StringBuilder("applyCoupon_result(");
8449
      boolean first = true;
8450
 
8451
      sb.append("success:");
8452
      if (this.success == null) {
8453
        sb.append("null");
8454
      } else {
8455
        sb.append(this.success);
8456
      }
8457
      first = false;
8458
      if (!first) sb.append(", ");
8459
      sb.append("pex:");
8460
      if (this.pex == null) {
8461
        sb.append("null");
8462
      } else {
8463
        sb.append(this.pex);
8464
      }
8465
      first = false;
8466
      sb.append(")");
8467
      return sb.toString();
8468
    }
8469
 
3430 rajveer 8470
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 8471
      // check for required fields
8472
    }
8473
 
3430 rajveer 8474
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8475
      try {
8476
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8477
      } catch (org.apache.thrift.TException te) {
8478
        throw new java.io.IOException(te);
8479
      }
8480
    }
8481
 
8482
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8483
      try {
8484
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8485
      } catch (org.apache.thrift.TException te) {
8486
        throw new java.io.IOException(te);
8487
      }
8488
    }
8489
 
1982 varun.gupt 8490
  }
8491
 
6736 amit.gupta 8492
  public static class getEmiDiscount_args implements org.apache.thrift.TBase<getEmiDiscount_args, getEmiDiscount_args._Fields>, java.io.Serializable, Cloneable   {
8493
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getEmiDiscount_args");
8494
 
8495
    private static final org.apache.thrift.protocol.TField CART_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("cartId", org.apache.thrift.protocol.TType.I64, (short)1);
8496
 
8497
    private long cartId; // required
8498
 
8499
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8500
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
8501
      CART_ID((short)1, "cartId");
8502
 
8503
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8504
 
8505
      static {
8506
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8507
          byName.put(field.getFieldName(), field);
8508
        }
8509
      }
8510
 
8511
      /**
8512
       * Find the _Fields constant that matches fieldId, or null if its not found.
8513
       */
8514
      public static _Fields findByThriftId(int fieldId) {
8515
        switch(fieldId) {
8516
          case 1: // CART_ID
8517
            return CART_ID;
8518
          default:
8519
            return null;
8520
        }
8521
      }
8522
 
8523
      /**
8524
       * Find the _Fields constant that matches fieldId, throwing an exception
8525
       * if it is not found.
8526
       */
8527
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8528
        _Fields fields = findByThriftId(fieldId);
8529
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8530
        return fields;
8531
      }
8532
 
8533
      /**
8534
       * Find the _Fields constant that matches name, or null if its not found.
8535
       */
8536
      public static _Fields findByName(String name) {
8537
        return byName.get(name);
8538
      }
8539
 
8540
      private final short _thriftId;
8541
      private final String _fieldName;
8542
 
8543
      _Fields(short thriftId, String fieldName) {
8544
        _thriftId = thriftId;
8545
        _fieldName = fieldName;
8546
      }
8547
 
8548
      public short getThriftFieldId() {
8549
        return _thriftId;
8550
      }
8551
 
8552
      public String getFieldName() {
8553
        return _fieldName;
8554
      }
8555
    }
8556
 
8557
    // isset id assignments
8558
    private static final int __CARTID_ISSET_ID = 0;
8559
    private BitSet __isset_bit_vector = new BitSet(1);
8560
 
8561
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
8562
    static {
8563
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8564
      tmpMap.put(_Fields.CART_ID, new org.apache.thrift.meta_data.FieldMetaData("cartId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8565
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
8566
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8567
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getEmiDiscount_args.class, metaDataMap);
8568
    }
8569
 
8570
    public getEmiDiscount_args() {
8571
    }
8572
 
8573
    public getEmiDiscount_args(
8574
      long cartId)
8575
    {
8576
      this();
8577
      this.cartId = cartId;
8578
      setCartIdIsSet(true);
8579
    }
8580
 
8581
    /**
8582
     * Performs a deep copy on <i>other</i>.
8583
     */
8584
    public getEmiDiscount_args(getEmiDiscount_args other) {
8585
      __isset_bit_vector.clear();
8586
      __isset_bit_vector.or(other.__isset_bit_vector);
8587
      this.cartId = other.cartId;
8588
    }
8589
 
8590
    public getEmiDiscount_args deepCopy() {
8591
      return new getEmiDiscount_args(this);
8592
    }
8593
 
8594
    @Override
8595
    public void clear() {
8596
      setCartIdIsSet(false);
8597
      this.cartId = 0;
8598
    }
8599
 
8600
    public long getCartId() {
8601
      return this.cartId;
8602
    }
8603
 
8604
    public void setCartId(long cartId) {
8605
      this.cartId = cartId;
8606
      setCartIdIsSet(true);
8607
    }
8608
 
8609
    public void unsetCartId() {
8610
      __isset_bit_vector.clear(__CARTID_ISSET_ID);
8611
    }
8612
 
8613
    /** Returns true if field cartId is set (has been assigned a value) and false otherwise */
8614
    public boolean isSetCartId() {
8615
      return __isset_bit_vector.get(__CARTID_ISSET_ID);
8616
    }
8617
 
8618
    public void setCartIdIsSet(boolean value) {
8619
      __isset_bit_vector.set(__CARTID_ISSET_ID, value);
8620
    }
8621
 
8622
    public void setFieldValue(_Fields field, Object value) {
8623
      switch (field) {
8624
      case CART_ID:
8625
        if (value == null) {
8626
          unsetCartId();
8627
        } else {
8628
          setCartId((Long)value);
8629
        }
8630
        break;
8631
 
8632
      }
8633
    }
8634
 
8635
    public Object getFieldValue(_Fields field) {
8636
      switch (field) {
8637
      case CART_ID:
8638
        return Long.valueOf(getCartId());
8639
 
8640
      }
8641
      throw new IllegalStateException();
8642
    }
8643
 
8644
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
8645
    public boolean isSet(_Fields field) {
8646
      if (field == null) {
8647
        throw new IllegalArgumentException();
8648
      }
8649
 
8650
      switch (field) {
8651
      case CART_ID:
8652
        return isSetCartId();
8653
      }
8654
      throw new IllegalStateException();
8655
    }
8656
 
8657
    @Override
8658
    public boolean equals(Object that) {
8659
      if (that == null)
8660
        return false;
8661
      if (that instanceof getEmiDiscount_args)
8662
        return this.equals((getEmiDiscount_args)that);
8663
      return false;
8664
    }
8665
 
8666
    public boolean equals(getEmiDiscount_args that) {
8667
      if (that == null)
8668
        return false;
8669
 
8670
      boolean this_present_cartId = true;
8671
      boolean that_present_cartId = true;
8672
      if (this_present_cartId || that_present_cartId) {
8673
        if (!(this_present_cartId && that_present_cartId))
8674
          return false;
8675
        if (this.cartId != that.cartId)
8676
          return false;
8677
      }
8678
 
8679
      return true;
8680
    }
8681
 
8682
    @Override
8683
    public int hashCode() {
8684
      return 0;
8685
    }
8686
 
8687
    public int compareTo(getEmiDiscount_args other) {
8688
      if (!getClass().equals(other.getClass())) {
8689
        return getClass().getName().compareTo(other.getClass().getName());
8690
      }
8691
 
8692
      int lastComparison = 0;
8693
      getEmiDiscount_args typedOther = (getEmiDiscount_args)other;
8694
 
8695
      lastComparison = Boolean.valueOf(isSetCartId()).compareTo(typedOther.isSetCartId());
8696
      if (lastComparison != 0) {
8697
        return lastComparison;
8698
      }
8699
      if (isSetCartId()) {
8700
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cartId, typedOther.cartId);
8701
        if (lastComparison != 0) {
8702
          return lastComparison;
8703
        }
8704
      }
8705
      return 0;
8706
    }
8707
 
8708
    public _Fields fieldForId(int fieldId) {
8709
      return _Fields.findByThriftId(fieldId);
8710
    }
8711
 
8712
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
8713
      org.apache.thrift.protocol.TField field;
8714
      iprot.readStructBegin();
8715
      while (true)
8716
      {
8717
        field = iprot.readFieldBegin();
8718
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
8719
          break;
8720
        }
8721
        switch (field.id) {
8722
          case 1: // CART_ID
8723
            if (field.type == org.apache.thrift.protocol.TType.I64) {
8724
              this.cartId = iprot.readI64();
8725
              setCartIdIsSet(true);
8726
            } else { 
8727
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8728
            }
8729
            break;
8730
          default:
8731
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
8732
        }
8733
        iprot.readFieldEnd();
8734
      }
8735
      iprot.readStructEnd();
8736
      validate();
8737
    }
8738
 
8739
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
8740
      validate();
8741
 
8742
      oprot.writeStructBegin(STRUCT_DESC);
8743
      oprot.writeFieldBegin(CART_ID_FIELD_DESC);
8744
      oprot.writeI64(this.cartId);
8745
      oprot.writeFieldEnd();
8746
      oprot.writeFieldStop();
8747
      oprot.writeStructEnd();
8748
    }
8749
 
8750
    @Override
8751
    public String toString() {
8752
      StringBuilder sb = new StringBuilder("getEmiDiscount_args(");
8753
      boolean first = true;
8754
 
8755
      sb.append("cartId:");
8756
      sb.append(this.cartId);
8757
      first = false;
8758
      sb.append(")");
8759
      return sb.toString();
8760
    }
8761
 
8762
    public void validate() throws org.apache.thrift.TException {
8763
      // check for required fields
8764
    }
8765
 
8766
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
8767
      try {
8768
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
8769
      } catch (org.apache.thrift.TException te) {
8770
        throw new java.io.IOException(te);
8771
      }
8772
    }
8773
 
8774
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
8775
      try {
8776
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
8777
        __isset_bit_vector = new BitSet(1);
8778
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
8779
      } catch (org.apache.thrift.TException te) {
8780
        throw new java.io.IOException(te);
8781
      }
8782
    }
8783
 
8784
  }
8785
 
8786
  public static class getEmiDiscount_result implements org.apache.thrift.TBase<getEmiDiscount_result, getEmiDiscount_result._Fields>, java.io.Serializable, Cloneable   {
8787
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getEmiDiscount_result");
8788
 
8789
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0);
8790
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
8791
 
8792
    private Map<Long,Double> success; // required
8793
    private PromotionException pex; // required
8794
 
8795
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
8796
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
8797
      SUCCESS((short)0, "success"),
8798
      PEX((short)1, "pex");
8799
 
8800
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
8801
 
8802
      static {
8803
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
8804
          byName.put(field.getFieldName(), field);
8805
        }
8806
      }
8807
 
8808
      /**
8809
       * Find the _Fields constant that matches fieldId, or null if its not found.
8810
       */
8811
      public static _Fields findByThriftId(int fieldId) {
8812
        switch(fieldId) {
8813
          case 0: // SUCCESS
8814
            return SUCCESS;
8815
          case 1: // PEX
8816
            return PEX;
8817
          default:
8818
            return null;
8819
        }
8820
      }
8821
 
8822
      /**
8823
       * Find the _Fields constant that matches fieldId, throwing an exception
8824
       * if it is not found.
8825
       */
8826
      public static _Fields findByThriftIdOrThrow(int fieldId) {
8827
        _Fields fields = findByThriftId(fieldId);
8828
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
8829
        return fields;
8830
      }
8831
 
8832
      /**
8833
       * Find the _Fields constant that matches name, or null if its not found.
8834
       */
8835
      public static _Fields findByName(String name) {
8836
        return byName.get(name);
8837
      }
8838
 
8839
      private final short _thriftId;
8840
      private final String _fieldName;
8841
 
8842
      _Fields(short thriftId, String fieldName) {
8843
        _thriftId = thriftId;
8844
        _fieldName = fieldName;
8845
      }
8846
 
8847
      public short getThriftFieldId() {
8848
        return _thriftId;
8849
      }
8850
 
8851
      public String getFieldName() {
8852
        return _fieldName;
8853
      }
8854
    }
8855
 
8856
    // isset id assignments
8857
 
8858
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
8859
    static {
8860
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
8861
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8862
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
8863
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), 
8864
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
8865
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
8866
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
8867
      metaDataMap = Collections.unmodifiableMap(tmpMap);
8868
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getEmiDiscount_result.class, metaDataMap);
8869
    }
8870
 
8871
    public getEmiDiscount_result() {
8872
    }
8873
 
8874
    public getEmiDiscount_result(
8875
      Map<Long,Double> success,
8876
      PromotionException pex)
8877
    {
8878
      this();
8879
      this.success = success;
8880
      this.pex = pex;
8881
    }
8882
 
8883
    /**
8884
     * Performs a deep copy on <i>other</i>.
8885
     */
8886
    public getEmiDiscount_result(getEmiDiscount_result other) {
8887
      if (other.isSetSuccess()) {
8888
        Map<Long,Double> __this__success = new HashMap<Long,Double>();
8889
        for (Map.Entry<Long, Double> other_element : other.success.entrySet()) {
8890
 
8891
          Long other_element_key = other_element.getKey();
8892
          Double other_element_value = other_element.getValue();
8893
 
8894
          Long __this__success_copy_key = other_element_key;
8895
 
8896
          Double __this__success_copy_value = other_element_value;
8897
 
8898
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
8899
        }
8900
        this.success = __this__success;
8901
      }
8902
      if (other.isSetPex()) {
8903
        this.pex = new PromotionException(other.pex);
8904
      }
8905
    }
8906
 
8907
    public getEmiDiscount_result deepCopy() {
8908
      return new getEmiDiscount_result(this);
8909
    }
8910
 
8911
    @Override
8912
    public void clear() {
8913
      this.success = null;
8914
      this.pex = null;
8915
    }
8916
 
8917
    public int getSuccessSize() {
8918
      return (this.success == null) ? 0 : this.success.size();
8919
    }
8920
 
8921
    public void putToSuccess(long key, double val) {
8922
      if (this.success == null) {
8923
        this.success = new HashMap<Long,Double>();
8924
      }
8925
      this.success.put(key, val);
8926
    }
8927
 
8928
    public Map<Long,Double> getSuccess() {
8929
      return this.success;
8930
    }
8931
 
8932
    public void setSuccess(Map<Long,Double> success) {
8933
      this.success = success;
8934
    }
8935
 
8936
    public void unsetSuccess() {
8937
      this.success = null;
8938
    }
8939
 
8940
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
8941
    public boolean isSetSuccess() {
8942
      return this.success != null;
8943
    }
8944
 
8945
    public void setSuccessIsSet(boolean value) {
8946
      if (!value) {
8947
        this.success = null;
8948
      }
8949
    }
8950
 
8951
    public PromotionException getPex() {
8952
      return this.pex;
8953
    }
8954
 
8955
    public void setPex(PromotionException pex) {
8956
      this.pex = pex;
8957
    }
8958
 
8959
    public void unsetPex() {
8960
      this.pex = null;
8961
    }
8962
 
8963
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
8964
    public boolean isSetPex() {
8965
      return this.pex != null;
8966
    }
8967
 
8968
    public void setPexIsSet(boolean value) {
8969
      if (!value) {
8970
        this.pex = null;
8971
      }
8972
    }
8973
 
8974
    public void setFieldValue(_Fields field, Object value) {
8975
      switch (field) {
8976
      case SUCCESS:
8977
        if (value == null) {
8978
          unsetSuccess();
8979
        } else {
8980
          setSuccess((Map<Long,Double>)value);
8981
        }
8982
        break;
8983
 
8984
      case PEX:
8985
        if (value == null) {
8986
          unsetPex();
8987
        } else {
8988
          setPex((PromotionException)value);
8989
        }
8990
        break;
8991
 
8992
      }
8993
    }
8994
 
8995
    public Object getFieldValue(_Fields field) {
8996
      switch (field) {
8997
      case SUCCESS:
8998
        return getSuccess();
8999
 
9000
      case PEX:
9001
        return getPex();
9002
 
9003
      }
9004
      throw new IllegalStateException();
9005
    }
9006
 
9007
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9008
    public boolean isSet(_Fields field) {
9009
      if (field == null) {
9010
        throw new IllegalArgumentException();
9011
      }
9012
 
9013
      switch (field) {
9014
      case SUCCESS:
9015
        return isSetSuccess();
9016
      case PEX:
9017
        return isSetPex();
9018
      }
9019
      throw new IllegalStateException();
9020
    }
9021
 
9022
    @Override
9023
    public boolean equals(Object that) {
9024
      if (that == null)
9025
        return false;
9026
      if (that instanceof getEmiDiscount_result)
9027
        return this.equals((getEmiDiscount_result)that);
9028
      return false;
9029
    }
9030
 
9031
    public boolean equals(getEmiDiscount_result that) {
9032
      if (that == null)
9033
        return false;
9034
 
9035
      boolean this_present_success = true && this.isSetSuccess();
9036
      boolean that_present_success = true && that.isSetSuccess();
9037
      if (this_present_success || that_present_success) {
9038
        if (!(this_present_success && that_present_success))
9039
          return false;
9040
        if (!this.success.equals(that.success))
9041
          return false;
9042
      }
9043
 
9044
      boolean this_present_pex = true && this.isSetPex();
9045
      boolean that_present_pex = true && that.isSetPex();
9046
      if (this_present_pex || that_present_pex) {
9047
        if (!(this_present_pex && that_present_pex))
9048
          return false;
9049
        if (!this.pex.equals(that.pex))
9050
          return false;
9051
      }
9052
 
9053
      return true;
9054
    }
9055
 
9056
    @Override
9057
    public int hashCode() {
9058
      return 0;
9059
    }
9060
 
9061
    public int compareTo(getEmiDiscount_result other) {
9062
      if (!getClass().equals(other.getClass())) {
9063
        return getClass().getName().compareTo(other.getClass().getName());
9064
      }
9065
 
9066
      int lastComparison = 0;
9067
      getEmiDiscount_result typedOther = (getEmiDiscount_result)other;
9068
 
9069
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
9070
      if (lastComparison != 0) {
9071
        return lastComparison;
9072
      }
9073
      if (isSetSuccess()) {
9074
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
9075
        if (lastComparison != 0) {
9076
          return lastComparison;
9077
        }
9078
      }
9079
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
9080
      if (lastComparison != 0) {
9081
        return lastComparison;
9082
      }
9083
      if (isSetPex()) {
9084
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
9085
        if (lastComparison != 0) {
9086
          return lastComparison;
9087
        }
9088
      }
9089
      return 0;
9090
    }
9091
 
9092
    public _Fields fieldForId(int fieldId) {
9093
      return _Fields.findByThriftId(fieldId);
9094
    }
9095
 
9096
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9097
      org.apache.thrift.protocol.TField field;
9098
      iprot.readStructBegin();
9099
      while (true)
9100
      {
9101
        field = iprot.readFieldBegin();
9102
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
9103
          break;
9104
        }
9105
        switch (field.id) {
9106
          case 0: // SUCCESS
9107
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
9108
              {
9109
                org.apache.thrift.protocol.TMap _map16 = iprot.readMapBegin();
9110
                this.success = new HashMap<Long,Double>(2*_map16.size);
9111
                for (int _i17 = 0; _i17 < _map16.size; ++_i17)
9112
                {
9113
                  long _key18; // required
9114
                  double _val19; // required
9115
                  _key18 = iprot.readI64();
9116
                  _val19 = iprot.readDouble();
9117
                  this.success.put(_key18, _val19);
9118
                }
9119
                iprot.readMapEnd();
9120
              }
9121
            } else { 
9122
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9123
            }
9124
            break;
9125
          case 1: // PEX
9126
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
9127
              this.pex = new PromotionException();
9128
              this.pex.read(iprot);
9129
            } else { 
9130
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9131
            }
9132
            break;
9133
          default:
9134
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9135
        }
9136
        iprot.readFieldEnd();
9137
      }
9138
      iprot.readStructEnd();
9139
      validate();
9140
    }
9141
 
9142
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
9143
      oprot.writeStructBegin(STRUCT_DESC);
9144
 
9145
      if (this.isSetSuccess()) {
9146
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
9147
        {
9148
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.DOUBLE, this.success.size()));
9149
          for (Map.Entry<Long, Double> _iter20 : this.success.entrySet())
9150
          {
9151
            oprot.writeI64(_iter20.getKey());
9152
            oprot.writeDouble(_iter20.getValue());
9153
          }
9154
          oprot.writeMapEnd();
9155
        }
9156
        oprot.writeFieldEnd();
9157
      } else if (this.isSetPex()) {
9158
        oprot.writeFieldBegin(PEX_FIELD_DESC);
9159
        this.pex.write(oprot);
9160
        oprot.writeFieldEnd();
9161
      }
9162
      oprot.writeFieldStop();
9163
      oprot.writeStructEnd();
9164
    }
9165
 
9166
    @Override
9167
    public String toString() {
9168
      StringBuilder sb = new StringBuilder("getEmiDiscount_result(");
9169
      boolean first = true;
9170
 
9171
      sb.append("success:");
9172
      if (this.success == null) {
9173
        sb.append("null");
9174
      } else {
9175
        sb.append(this.success);
9176
      }
9177
      first = false;
9178
      if (!first) sb.append(", ");
9179
      sb.append("pex:");
9180
      if (this.pex == null) {
9181
        sb.append("null");
9182
      } else {
9183
        sb.append(this.pex);
9184
      }
9185
      first = false;
9186
      sb.append(")");
9187
      return sb.toString();
9188
    }
9189
 
9190
    public void validate() throws org.apache.thrift.TException {
9191
      // check for required fields
9192
    }
9193
 
9194
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9195
      try {
9196
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9197
      } catch (org.apache.thrift.TException te) {
9198
        throw new java.io.IOException(te);
9199
      }
9200
    }
9201
 
9202
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9203
      try {
9204
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9205
      } catch (org.apache.thrift.TException te) {
9206
        throw new java.io.IOException(te);
9207
      }
9208
    }
9209
 
9210
  }
9211
 
6433 anupam.sin 9212
  public static class applyRechargeCoupon_args implements org.apache.thrift.TBase<applyRechargeCoupon_args, applyRechargeCoupon_args._Fields>, java.io.Serializable, Cloneable   {
9213
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyRechargeCoupon_args");
9214
 
9215
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)1);
9216
    private static final org.apache.thrift.protocol.TField TOTAL_AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("totalAmount", org.apache.thrift.protocol.TType.I64, (short)2);
9217
    private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.I64, (short)3);
9218
 
9219
    private String couponCode; // required
9220
    private long totalAmount; // required
9221
    private long userId; // required
9222
 
9223
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9224
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
9225
      COUPON_CODE((short)1, "couponCode"),
9226
      TOTAL_AMOUNT((short)2, "totalAmount"),
9227
      USER_ID((short)3, "userId");
9228
 
9229
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9230
 
9231
      static {
9232
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9233
          byName.put(field.getFieldName(), field);
9234
        }
9235
      }
9236
 
9237
      /**
9238
       * Find the _Fields constant that matches fieldId, or null if its not found.
9239
       */
9240
      public static _Fields findByThriftId(int fieldId) {
9241
        switch(fieldId) {
9242
          case 1: // COUPON_CODE
9243
            return COUPON_CODE;
9244
          case 2: // TOTAL_AMOUNT
9245
            return TOTAL_AMOUNT;
9246
          case 3: // USER_ID
9247
            return USER_ID;
9248
          default:
9249
            return null;
9250
        }
9251
      }
9252
 
9253
      /**
9254
       * Find the _Fields constant that matches fieldId, throwing an exception
9255
       * if it is not found.
9256
       */
9257
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9258
        _Fields fields = findByThriftId(fieldId);
9259
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9260
        return fields;
9261
      }
9262
 
9263
      /**
9264
       * Find the _Fields constant that matches name, or null if its not found.
9265
       */
9266
      public static _Fields findByName(String name) {
9267
        return byName.get(name);
9268
      }
9269
 
9270
      private final short _thriftId;
9271
      private final String _fieldName;
9272
 
9273
      _Fields(short thriftId, String fieldName) {
9274
        _thriftId = thriftId;
9275
        _fieldName = fieldName;
9276
      }
9277
 
9278
      public short getThriftFieldId() {
9279
        return _thriftId;
9280
      }
9281
 
9282
      public String getFieldName() {
9283
        return _fieldName;
9284
      }
9285
    }
9286
 
9287
    // isset id assignments
9288
    private static final int __TOTALAMOUNT_ISSET_ID = 0;
9289
    private static final int __USERID_ISSET_ID = 1;
9290
    private BitSet __isset_bit_vector = new BitSet(2);
9291
 
9292
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
9293
    static {
9294
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9295
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9296
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
9297
      tmpMap.put(_Fields.TOTAL_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("totalAmount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9298
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9299
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9300
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
9301
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9302
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyRechargeCoupon_args.class, metaDataMap);
9303
    }
9304
 
9305
    public applyRechargeCoupon_args() {
9306
    }
9307
 
9308
    public applyRechargeCoupon_args(
9309
      String couponCode,
9310
      long totalAmount,
9311
      long userId)
9312
    {
9313
      this();
9314
      this.couponCode = couponCode;
9315
      this.totalAmount = totalAmount;
9316
      setTotalAmountIsSet(true);
9317
      this.userId = userId;
9318
      setUserIdIsSet(true);
9319
    }
9320
 
9321
    /**
9322
     * Performs a deep copy on <i>other</i>.
9323
     */
9324
    public applyRechargeCoupon_args(applyRechargeCoupon_args other) {
9325
      __isset_bit_vector.clear();
9326
      __isset_bit_vector.or(other.__isset_bit_vector);
9327
      if (other.isSetCouponCode()) {
9328
        this.couponCode = other.couponCode;
9329
      }
9330
      this.totalAmount = other.totalAmount;
9331
      this.userId = other.userId;
9332
    }
9333
 
9334
    public applyRechargeCoupon_args deepCopy() {
9335
      return new applyRechargeCoupon_args(this);
9336
    }
9337
 
9338
    @Override
9339
    public void clear() {
9340
      this.couponCode = null;
9341
      setTotalAmountIsSet(false);
9342
      this.totalAmount = 0;
9343
      setUserIdIsSet(false);
9344
      this.userId = 0;
9345
    }
9346
 
9347
    public String getCouponCode() {
9348
      return this.couponCode;
9349
    }
9350
 
9351
    public void setCouponCode(String couponCode) {
9352
      this.couponCode = couponCode;
9353
    }
9354
 
9355
    public void unsetCouponCode() {
9356
      this.couponCode = null;
9357
    }
9358
 
9359
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
9360
    public boolean isSetCouponCode() {
9361
      return this.couponCode != null;
9362
    }
9363
 
9364
    public void setCouponCodeIsSet(boolean value) {
9365
      if (!value) {
9366
        this.couponCode = null;
9367
      }
9368
    }
9369
 
9370
    public long getTotalAmount() {
9371
      return this.totalAmount;
9372
    }
9373
 
9374
    public void setTotalAmount(long totalAmount) {
9375
      this.totalAmount = totalAmount;
9376
      setTotalAmountIsSet(true);
9377
    }
9378
 
9379
    public void unsetTotalAmount() {
9380
      __isset_bit_vector.clear(__TOTALAMOUNT_ISSET_ID);
9381
    }
9382
 
9383
    /** Returns true if field totalAmount is set (has been assigned a value) and false otherwise */
9384
    public boolean isSetTotalAmount() {
9385
      return __isset_bit_vector.get(__TOTALAMOUNT_ISSET_ID);
9386
    }
9387
 
9388
    public void setTotalAmountIsSet(boolean value) {
9389
      __isset_bit_vector.set(__TOTALAMOUNT_ISSET_ID, value);
9390
    }
9391
 
9392
    public long getUserId() {
9393
      return this.userId;
9394
    }
9395
 
9396
    public void setUserId(long userId) {
9397
      this.userId = userId;
9398
      setUserIdIsSet(true);
9399
    }
9400
 
9401
    public void unsetUserId() {
9402
      __isset_bit_vector.clear(__USERID_ISSET_ID);
9403
    }
9404
 
9405
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
9406
    public boolean isSetUserId() {
9407
      return __isset_bit_vector.get(__USERID_ISSET_ID);
9408
    }
9409
 
9410
    public void setUserIdIsSet(boolean value) {
9411
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
9412
    }
9413
 
9414
    public void setFieldValue(_Fields field, Object value) {
9415
      switch (field) {
9416
      case COUPON_CODE:
9417
        if (value == null) {
9418
          unsetCouponCode();
9419
        } else {
9420
          setCouponCode((String)value);
9421
        }
9422
        break;
9423
 
9424
      case TOTAL_AMOUNT:
9425
        if (value == null) {
9426
          unsetTotalAmount();
9427
        } else {
9428
          setTotalAmount((Long)value);
9429
        }
9430
        break;
9431
 
9432
      case USER_ID:
9433
        if (value == null) {
9434
          unsetUserId();
9435
        } else {
9436
          setUserId((Long)value);
9437
        }
9438
        break;
9439
 
9440
      }
9441
    }
9442
 
9443
    public Object getFieldValue(_Fields field) {
9444
      switch (field) {
9445
      case COUPON_CODE:
9446
        return getCouponCode();
9447
 
9448
      case TOTAL_AMOUNT:
9449
        return Long.valueOf(getTotalAmount());
9450
 
9451
      case USER_ID:
9452
        return Long.valueOf(getUserId());
9453
 
9454
      }
9455
      throw new IllegalStateException();
9456
    }
9457
 
9458
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9459
    public boolean isSet(_Fields field) {
9460
      if (field == null) {
9461
        throw new IllegalArgumentException();
9462
      }
9463
 
9464
      switch (field) {
9465
      case COUPON_CODE:
9466
        return isSetCouponCode();
9467
      case TOTAL_AMOUNT:
9468
        return isSetTotalAmount();
9469
      case USER_ID:
9470
        return isSetUserId();
9471
      }
9472
      throw new IllegalStateException();
9473
    }
9474
 
9475
    @Override
9476
    public boolean equals(Object that) {
9477
      if (that == null)
9478
        return false;
9479
      if (that instanceof applyRechargeCoupon_args)
9480
        return this.equals((applyRechargeCoupon_args)that);
9481
      return false;
9482
    }
9483
 
9484
    public boolean equals(applyRechargeCoupon_args that) {
9485
      if (that == null)
9486
        return false;
9487
 
9488
      boolean this_present_couponCode = true && this.isSetCouponCode();
9489
      boolean that_present_couponCode = true && that.isSetCouponCode();
9490
      if (this_present_couponCode || that_present_couponCode) {
9491
        if (!(this_present_couponCode && that_present_couponCode))
9492
          return false;
9493
        if (!this.couponCode.equals(that.couponCode))
9494
          return false;
9495
      }
9496
 
9497
      boolean this_present_totalAmount = true;
9498
      boolean that_present_totalAmount = true;
9499
      if (this_present_totalAmount || that_present_totalAmount) {
9500
        if (!(this_present_totalAmount && that_present_totalAmount))
9501
          return false;
9502
        if (this.totalAmount != that.totalAmount)
9503
          return false;
9504
      }
9505
 
9506
      boolean this_present_userId = true;
9507
      boolean that_present_userId = true;
9508
      if (this_present_userId || that_present_userId) {
9509
        if (!(this_present_userId && that_present_userId))
9510
          return false;
9511
        if (this.userId != that.userId)
9512
          return false;
9513
      }
9514
 
9515
      return true;
9516
    }
9517
 
9518
    @Override
9519
    public int hashCode() {
9520
      return 0;
9521
    }
9522
 
9523
    public int compareTo(applyRechargeCoupon_args other) {
9524
      if (!getClass().equals(other.getClass())) {
9525
        return getClass().getName().compareTo(other.getClass().getName());
9526
      }
9527
 
9528
      int lastComparison = 0;
9529
      applyRechargeCoupon_args typedOther = (applyRechargeCoupon_args)other;
9530
 
9531
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
9532
      if (lastComparison != 0) {
9533
        return lastComparison;
9534
      }
9535
      if (isSetCouponCode()) {
9536
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
9537
        if (lastComparison != 0) {
9538
          return lastComparison;
9539
        }
9540
      }
9541
      lastComparison = Boolean.valueOf(isSetTotalAmount()).compareTo(typedOther.isSetTotalAmount());
9542
      if (lastComparison != 0) {
9543
        return lastComparison;
9544
      }
9545
      if (isSetTotalAmount()) {
9546
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.totalAmount, typedOther.totalAmount);
9547
        if (lastComparison != 0) {
9548
          return lastComparison;
9549
        }
9550
      }
9551
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
9552
      if (lastComparison != 0) {
9553
        return lastComparison;
9554
      }
9555
      if (isSetUserId()) {
9556
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
9557
        if (lastComparison != 0) {
9558
          return lastComparison;
9559
        }
9560
      }
9561
      return 0;
9562
    }
9563
 
9564
    public _Fields fieldForId(int fieldId) {
9565
      return _Fields.findByThriftId(fieldId);
9566
    }
9567
 
9568
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9569
      org.apache.thrift.protocol.TField field;
9570
      iprot.readStructBegin();
9571
      while (true)
9572
      {
9573
        field = iprot.readFieldBegin();
9574
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
9575
          break;
9576
        }
9577
        switch (field.id) {
9578
          case 1: // COUPON_CODE
9579
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
9580
              this.couponCode = iprot.readString();
9581
            } else { 
9582
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9583
            }
9584
            break;
9585
          case 2: // TOTAL_AMOUNT
9586
            if (field.type == org.apache.thrift.protocol.TType.I64) {
9587
              this.totalAmount = iprot.readI64();
9588
              setTotalAmountIsSet(true);
9589
            } else { 
9590
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9591
            }
9592
            break;
9593
          case 3: // USER_ID
9594
            if (field.type == org.apache.thrift.protocol.TType.I64) {
9595
              this.userId = iprot.readI64();
9596
              setUserIdIsSet(true);
9597
            } else { 
9598
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9599
            }
9600
            break;
9601
          default:
9602
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
9603
        }
9604
        iprot.readFieldEnd();
9605
      }
9606
      iprot.readStructEnd();
9607
      validate();
9608
    }
9609
 
9610
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
9611
      validate();
9612
 
9613
      oprot.writeStructBegin(STRUCT_DESC);
9614
      if (this.couponCode != null) {
9615
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
9616
        oprot.writeString(this.couponCode);
9617
        oprot.writeFieldEnd();
9618
      }
9619
      oprot.writeFieldBegin(TOTAL_AMOUNT_FIELD_DESC);
9620
      oprot.writeI64(this.totalAmount);
9621
      oprot.writeFieldEnd();
9622
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
9623
      oprot.writeI64(this.userId);
9624
      oprot.writeFieldEnd();
9625
      oprot.writeFieldStop();
9626
      oprot.writeStructEnd();
9627
    }
9628
 
9629
    @Override
9630
    public String toString() {
9631
      StringBuilder sb = new StringBuilder("applyRechargeCoupon_args(");
9632
      boolean first = true;
9633
 
9634
      sb.append("couponCode:");
9635
      if (this.couponCode == null) {
9636
        sb.append("null");
9637
      } else {
9638
        sb.append(this.couponCode);
9639
      }
9640
      first = false;
9641
      if (!first) sb.append(", ");
9642
      sb.append("totalAmount:");
9643
      sb.append(this.totalAmount);
9644
      first = false;
9645
      if (!first) sb.append(", ");
9646
      sb.append("userId:");
9647
      sb.append(this.userId);
9648
      first = false;
9649
      sb.append(")");
9650
      return sb.toString();
9651
    }
9652
 
9653
    public void validate() throws org.apache.thrift.TException {
9654
      // check for required fields
9655
    }
9656
 
9657
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
9658
      try {
9659
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
9660
      } catch (org.apache.thrift.TException te) {
9661
        throw new java.io.IOException(te);
9662
      }
9663
    }
9664
 
9665
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
9666
      try {
9667
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
9668
        __isset_bit_vector = new BitSet(1);
9669
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
9670
      } catch (org.apache.thrift.TException te) {
9671
        throw new java.io.IOException(te);
9672
      }
9673
    }
9674
 
9675
  }
9676
 
9677
  public static class applyRechargeCoupon_result implements org.apache.thrift.TBase<applyRechargeCoupon_result, applyRechargeCoupon_result._Fields>, java.io.Serializable, Cloneable   {
9678
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("applyRechargeCoupon_result");
9679
 
9680
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0);
9681
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
9682
 
9683
    private Map<Long,String> success; // required
9684
    private PromotionException pex; // required
9685
 
9686
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
9687
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
9688
      SUCCESS((short)0, "success"),
9689
      PEX((short)1, "pex");
9690
 
9691
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
9692
 
9693
      static {
9694
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
9695
          byName.put(field.getFieldName(), field);
9696
        }
9697
      }
9698
 
9699
      /**
9700
       * Find the _Fields constant that matches fieldId, or null if its not found.
9701
       */
9702
      public static _Fields findByThriftId(int fieldId) {
9703
        switch(fieldId) {
9704
          case 0: // SUCCESS
9705
            return SUCCESS;
9706
          case 1: // PEX
9707
            return PEX;
9708
          default:
9709
            return null;
9710
        }
9711
      }
9712
 
9713
      /**
9714
       * Find the _Fields constant that matches fieldId, throwing an exception
9715
       * if it is not found.
9716
       */
9717
      public static _Fields findByThriftIdOrThrow(int fieldId) {
9718
        _Fields fields = findByThriftId(fieldId);
9719
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
9720
        return fields;
9721
      }
9722
 
9723
      /**
9724
       * Find the _Fields constant that matches name, or null if its not found.
9725
       */
9726
      public static _Fields findByName(String name) {
9727
        return byName.get(name);
9728
      }
9729
 
9730
      private final short _thriftId;
9731
      private final String _fieldName;
9732
 
9733
      _Fields(short thriftId, String fieldName) {
9734
        _thriftId = thriftId;
9735
        _fieldName = fieldName;
9736
      }
9737
 
9738
      public short getThriftFieldId() {
9739
        return _thriftId;
9740
      }
9741
 
9742
      public String getFieldName() {
9743
        return _fieldName;
9744
      }
9745
    }
9746
 
9747
    // isset id assignments
9748
 
9749
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
9750
    static {
9751
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
9752
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9753
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
9754
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64), 
9755
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
9756
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
9757
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
9758
      metaDataMap = Collections.unmodifiableMap(tmpMap);
9759
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(applyRechargeCoupon_result.class, metaDataMap);
9760
    }
9761
 
9762
    public applyRechargeCoupon_result() {
9763
    }
9764
 
9765
    public applyRechargeCoupon_result(
9766
      Map<Long,String> success,
9767
      PromotionException pex)
9768
    {
9769
      this();
9770
      this.success = success;
9771
      this.pex = pex;
9772
    }
9773
 
9774
    /**
9775
     * Performs a deep copy on <i>other</i>.
9776
     */
9777
    public applyRechargeCoupon_result(applyRechargeCoupon_result other) {
9778
      if (other.isSetSuccess()) {
9779
        Map<Long,String> __this__success = new HashMap<Long,String>();
9780
        for (Map.Entry<Long, String> other_element : other.success.entrySet()) {
9781
 
9782
          Long other_element_key = other_element.getKey();
9783
          String other_element_value = other_element.getValue();
9784
 
9785
          Long __this__success_copy_key = other_element_key;
9786
 
9787
          String __this__success_copy_value = other_element_value;
9788
 
9789
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
9790
        }
9791
        this.success = __this__success;
9792
      }
9793
      if (other.isSetPex()) {
9794
        this.pex = new PromotionException(other.pex);
9795
      }
9796
    }
9797
 
9798
    public applyRechargeCoupon_result deepCopy() {
9799
      return new applyRechargeCoupon_result(this);
9800
    }
9801
 
9802
    @Override
9803
    public void clear() {
9804
      this.success = null;
9805
      this.pex = null;
9806
    }
9807
 
9808
    public int getSuccessSize() {
9809
      return (this.success == null) ? 0 : this.success.size();
9810
    }
9811
 
9812
    public void putToSuccess(long key, String val) {
9813
      if (this.success == null) {
9814
        this.success = new HashMap<Long,String>();
9815
      }
9816
      this.success.put(key, val);
9817
    }
9818
 
9819
    public Map<Long,String> getSuccess() {
9820
      return this.success;
9821
    }
9822
 
9823
    public void setSuccess(Map<Long,String> success) {
9824
      this.success = success;
9825
    }
9826
 
9827
    public void unsetSuccess() {
9828
      this.success = null;
9829
    }
9830
 
9831
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
9832
    public boolean isSetSuccess() {
9833
      return this.success != null;
9834
    }
9835
 
9836
    public void setSuccessIsSet(boolean value) {
9837
      if (!value) {
9838
        this.success = null;
9839
      }
9840
    }
9841
 
9842
    public PromotionException getPex() {
9843
      return this.pex;
9844
    }
9845
 
9846
    public void setPex(PromotionException pex) {
9847
      this.pex = pex;
9848
    }
9849
 
9850
    public void unsetPex() {
9851
      this.pex = null;
9852
    }
9853
 
9854
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
9855
    public boolean isSetPex() {
9856
      return this.pex != null;
9857
    }
9858
 
9859
    public void setPexIsSet(boolean value) {
9860
      if (!value) {
9861
        this.pex = null;
9862
      }
9863
    }
9864
 
9865
    public void setFieldValue(_Fields field, Object value) {
9866
      switch (field) {
9867
      case SUCCESS:
9868
        if (value == null) {
9869
          unsetSuccess();
9870
        } else {
9871
          setSuccess((Map<Long,String>)value);
9872
        }
9873
        break;
9874
 
9875
      case PEX:
9876
        if (value == null) {
9877
          unsetPex();
9878
        } else {
9879
          setPex((PromotionException)value);
9880
        }
9881
        break;
9882
 
9883
      }
9884
    }
9885
 
9886
    public Object getFieldValue(_Fields field) {
9887
      switch (field) {
9888
      case SUCCESS:
9889
        return getSuccess();
9890
 
9891
      case PEX:
9892
        return getPex();
9893
 
9894
      }
9895
      throw new IllegalStateException();
9896
    }
9897
 
9898
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
9899
    public boolean isSet(_Fields field) {
9900
      if (field == null) {
9901
        throw new IllegalArgumentException();
9902
      }
9903
 
9904
      switch (field) {
9905
      case SUCCESS:
9906
        return isSetSuccess();
9907
      case PEX:
9908
        return isSetPex();
9909
      }
9910
      throw new IllegalStateException();
9911
    }
9912
 
9913
    @Override
9914
    public boolean equals(Object that) {
9915
      if (that == null)
9916
        return false;
9917
      if (that instanceof applyRechargeCoupon_result)
9918
        return this.equals((applyRechargeCoupon_result)that);
9919
      return false;
9920
    }
9921
 
9922
    public boolean equals(applyRechargeCoupon_result that) {
9923
      if (that == null)
9924
        return false;
9925
 
9926
      boolean this_present_success = true && this.isSetSuccess();
9927
      boolean that_present_success = true && that.isSetSuccess();
9928
      if (this_present_success || that_present_success) {
9929
        if (!(this_present_success && that_present_success))
9930
          return false;
9931
        if (!this.success.equals(that.success))
9932
          return false;
9933
      }
9934
 
9935
      boolean this_present_pex = true && this.isSetPex();
9936
      boolean that_present_pex = true && that.isSetPex();
9937
      if (this_present_pex || that_present_pex) {
9938
        if (!(this_present_pex && that_present_pex))
9939
          return false;
9940
        if (!this.pex.equals(that.pex))
9941
          return false;
9942
      }
9943
 
9944
      return true;
9945
    }
9946
 
9947
    @Override
9948
    public int hashCode() {
9949
      return 0;
9950
    }
9951
 
9952
    public int compareTo(applyRechargeCoupon_result other) {
9953
      if (!getClass().equals(other.getClass())) {
9954
        return getClass().getName().compareTo(other.getClass().getName());
9955
      }
9956
 
9957
      int lastComparison = 0;
9958
      applyRechargeCoupon_result typedOther = (applyRechargeCoupon_result)other;
9959
 
9960
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
9961
      if (lastComparison != 0) {
9962
        return lastComparison;
9963
      }
9964
      if (isSetSuccess()) {
9965
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
9966
        if (lastComparison != 0) {
9967
          return lastComparison;
9968
        }
9969
      }
9970
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
9971
      if (lastComparison != 0) {
9972
        return lastComparison;
9973
      }
9974
      if (isSetPex()) {
9975
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
9976
        if (lastComparison != 0) {
9977
          return lastComparison;
9978
        }
9979
      }
9980
      return 0;
9981
    }
9982
 
9983
    public _Fields fieldForId(int fieldId) {
9984
      return _Fields.findByThriftId(fieldId);
9985
    }
9986
 
9987
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
9988
      org.apache.thrift.protocol.TField field;
9989
      iprot.readStructBegin();
9990
      while (true)
9991
      {
9992
        field = iprot.readFieldBegin();
9993
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
9994
          break;
9995
        }
9996
        switch (field.id) {
9997
          case 0: // SUCCESS
9998
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
9999
              {
6736 amit.gupta 10000
                org.apache.thrift.protocol.TMap _map21 = iprot.readMapBegin();
10001
                this.success = new HashMap<Long,String>(2*_map21.size);
10002
                for (int _i22 = 0; _i22 < _map21.size; ++_i22)
6433 anupam.sin 10003
                {
6736 amit.gupta 10004
                  long _key23; // required
10005
                  String _val24; // required
10006
                  _key23 = iprot.readI64();
10007
                  _val24 = iprot.readString();
10008
                  this.success.put(_key23, _val24);
6433 anupam.sin 10009
                }
10010
                iprot.readMapEnd();
10011
              }
10012
            } else { 
10013
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10014
            }
10015
            break;
10016
          case 1: // PEX
10017
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
10018
              this.pex = new PromotionException();
10019
              this.pex.read(iprot);
10020
            } else { 
10021
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10022
            }
10023
            break;
10024
          default:
10025
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10026
        }
10027
        iprot.readFieldEnd();
10028
      }
10029
      iprot.readStructEnd();
10030
      validate();
10031
    }
10032
 
10033
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
10034
      oprot.writeStructBegin(STRUCT_DESC);
10035
 
10036
      if (this.isSetSuccess()) {
10037
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
10038
        {
10039
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I64, org.apache.thrift.protocol.TType.STRING, this.success.size()));
6736 amit.gupta 10040
          for (Map.Entry<Long, String> _iter25 : this.success.entrySet())
6433 anupam.sin 10041
          {
6736 amit.gupta 10042
            oprot.writeI64(_iter25.getKey());
10043
            oprot.writeString(_iter25.getValue());
6433 anupam.sin 10044
          }
10045
          oprot.writeMapEnd();
10046
        }
10047
        oprot.writeFieldEnd();
10048
      } else if (this.isSetPex()) {
10049
        oprot.writeFieldBegin(PEX_FIELD_DESC);
10050
        this.pex.write(oprot);
10051
        oprot.writeFieldEnd();
10052
      }
10053
      oprot.writeFieldStop();
10054
      oprot.writeStructEnd();
10055
    }
10056
 
10057
    @Override
10058
    public String toString() {
10059
      StringBuilder sb = new StringBuilder("applyRechargeCoupon_result(");
10060
      boolean first = true;
10061
 
10062
      sb.append("success:");
10063
      if (this.success == null) {
10064
        sb.append("null");
10065
      } else {
10066
        sb.append(this.success);
10067
      }
10068
      first = false;
10069
      if (!first) sb.append(", ");
10070
      sb.append("pex:");
10071
      if (this.pex == null) {
10072
        sb.append("null");
10073
      } else {
10074
        sb.append(this.pex);
10075
      }
10076
      first = false;
10077
      sb.append(")");
10078
      return sb.toString();
10079
    }
10080
 
10081
    public void validate() throws org.apache.thrift.TException {
10082
      // check for required fields
10083
    }
10084
 
10085
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10086
      try {
10087
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10088
      } catch (org.apache.thrift.TException te) {
10089
        throw new java.io.IOException(te);
10090
      }
10091
    }
10092
 
10093
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10094
      try {
10095
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10096
      } catch (org.apache.thrift.TException te) {
10097
        throw new java.io.IOException(te);
10098
      }
10099
    }
10100
 
10101
  }
10102
 
3430 rajveer 10103
  public static class trackCouponUsage_args implements org.apache.thrift.TBase<trackCouponUsage_args, trackCouponUsage_args._Fields>, java.io.Serializable, Cloneable   {
10104
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_args");
1982 varun.gupt 10105
 
3430 rajveer 10106
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)1);
10107
    private static final org.apache.thrift.protocol.TField TRANSACTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("transactionId", org.apache.thrift.protocol.TType.I64, (short)2);
10108
    private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.I64, (short)3);
1982 varun.gupt 10109
 
3430 rajveer 10110
    private String couponCode; // required
10111
    private long transactionId; // required
10112
    private long userId; // required
1982 varun.gupt 10113
 
10114
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 10115
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 10116
      COUPON_CODE((short)1, "couponCode"),
10117
      TRANSACTION_ID((short)2, "transactionId"),
10118
      USER_ID((short)3, "userId");
10119
 
10120
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10121
 
10122
      static {
10123
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10124
          byName.put(field.getFieldName(), field);
10125
        }
10126
      }
10127
 
10128
      /**
10129
       * Find the _Fields constant that matches fieldId, or null if its not found.
10130
       */
10131
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 10132
        switch(fieldId) {
10133
          case 1: // COUPON_CODE
10134
            return COUPON_CODE;
10135
          case 2: // TRANSACTION_ID
10136
            return TRANSACTION_ID;
10137
          case 3: // USER_ID
10138
            return USER_ID;
10139
          default:
10140
            return null;
10141
        }
1982 varun.gupt 10142
      }
10143
 
10144
      /**
10145
       * Find the _Fields constant that matches fieldId, throwing an exception
10146
       * if it is not found.
10147
       */
10148
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10149
        _Fields fields = findByThriftId(fieldId);
10150
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10151
        return fields;
10152
      }
10153
 
10154
      /**
10155
       * Find the _Fields constant that matches name, or null if its not found.
10156
       */
10157
      public static _Fields findByName(String name) {
10158
        return byName.get(name);
10159
      }
10160
 
10161
      private final short _thriftId;
10162
      private final String _fieldName;
10163
 
10164
      _Fields(short thriftId, String fieldName) {
10165
        _thriftId = thriftId;
10166
        _fieldName = fieldName;
10167
      }
10168
 
10169
      public short getThriftFieldId() {
10170
        return _thriftId;
10171
      }
10172
 
10173
      public String getFieldName() {
10174
        return _fieldName;
10175
      }
10176
    }
10177
 
10178
    // isset id assignments
10179
    private static final int __TRANSACTIONID_ISSET_ID = 0;
10180
    private static final int __USERID_ISSET_ID = 1;
10181
    private BitSet __isset_bit_vector = new BitSet(2);
10182
 
3430 rajveer 10183
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 10184
    static {
3430 rajveer 10185
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10186
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10187
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
10188
      tmpMap.put(_Fields.TRANSACTION_ID, new org.apache.thrift.meta_data.FieldMetaData("transactionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10189
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
10190
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10191
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
10192
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10193
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_args.class, metaDataMap);
1982 varun.gupt 10194
    }
10195
 
10196
    public trackCouponUsage_args() {
10197
    }
10198
 
10199
    public trackCouponUsage_args(
10200
      String couponCode,
10201
      long transactionId,
10202
      long userId)
10203
    {
10204
      this();
10205
      this.couponCode = couponCode;
10206
      this.transactionId = transactionId;
10207
      setTransactionIdIsSet(true);
10208
      this.userId = userId;
10209
      setUserIdIsSet(true);
10210
    }
10211
 
10212
    /**
10213
     * Performs a deep copy on <i>other</i>.
10214
     */
10215
    public trackCouponUsage_args(trackCouponUsage_args other) {
10216
      __isset_bit_vector.clear();
10217
      __isset_bit_vector.or(other.__isset_bit_vector);
10218
      if (other.isSetCouponCode()) {
10219
        this.couponCode = other.couponCode;
10220
      }
10221
      this.transactionId = other.transactionId;
10222
      this.userId = other.userId;
10223
    }
10224
 
10225
    public trackCouponUsage_args deepCopy() {
10226
      return new trackCouponUsage_args(this);
10227
    }
10228
 
3430 rajveer 10229
    @Override
10230
    public void clear() {
10231
      this.couponCode = null;
10232
      setTransactionIdIsSet(false);
10233
      this.transactionId = 0;
10234
      setUserIdIsSet(false);
10235
      this.userId = 0;
1982 varun.gupt 10236
    }
10237
 
10238
    public String getCouponCode() {
10239
      return this.couponCode;
10240
    }
10241
 
3430 rajveer 10242
    public void setCouponCode(String couponCode) {
1982 varun.gupt 10243
      this.couponCode = couponCode;
10244
    }
10245
 
10246
    public void unsetCouponCode() {
10247
      this.couponCode = null;
10248
    }
10249
 
3430 rajveer 10250
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 10251
    public boolean isSetCouponCode() {
10252
      return this.couponCode != null;
10253
    }
10254
 
10255
    public void setCouponCodeIsSet(boolean value) {
10256
      if (!value) {
10257
        this.couponCode = null;
10258
      }
10259
    }
10260
 
10261
    public long getTransactionId() {
10262
      return this.transactionId;
10263
    }
10264
 
3430 rajveer 10265
    public void setTransactionId(long transactionId) {
1982 varun.gupt 10266
      this.transactionId = transactionId;
10267
      setTransactionIdIsSet(true);
10268
    }
10269
 
10270
    public void unsetTransactionId() {
10271
      __isset_bit_vector.clear(__TRANSACTIONID_ISSET_ID);
10272
    }
10273
 
3430 rajveer 10274
    /** Returns true if field transactionId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 10275
    public boolean isSetTransactionId() {
10276
      return __isset_bit_vector.get(__TRANSACTIONID_ISSET_ID);
10277
    }
10278
 
10279
    public void setTransactionIdIsSet(boolean value) {
10280
      __isset_bit_vector.set(__TRANSACTIONID_ISSET_ID, value);
10281
    }
10282
 
10283
    public long getUserId() {
10284
      return this.userId;
10285
    }
10286
 
3430 rajveer 10287
    public void setUserId(long userId) {
1982 varun.gupt 10288
      this.userId = userId;
10289
      setUserIdIsSet(true);
10290
    }
10291
 
10292
    public void unsetUserId() {
10293
      __isset_bit_vector.clear(__USERID_ISSET_ID);
10294
    }
10295
 
3430 rajveer 10296
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 10297
    public boolean isSetUserId() {
10298
      return __isset_bit_vector.get(__USERID_ISSET_ID);
10299
    }
10300
 
10301
    public void setUserIdIsSet(boolean value) {
10302
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
10303
    }
10304
 
10305
    public void setFieldValue(_Fields field, Object value) {
10306
      switch (field) {
10307
      case COUPON_CODE:
10308
        if (value == null) {
10309
          unsetCouponCode();
10310
        } else {
10311
          setCouponCode((String)value);
10312
        }
10313
        break;
10314
 
10315
      case TRANSACTION_ID:
10316
        if (value == null) {
10317
          unsetTransactionId();
10318
        } else {
10319
          setTransactionId((Long)value);
10320
        }
10321
        break;
10322
 
10323
      case USER_ID:
10324
        if (value == null) {
10325
          unsetUserId();
10326
        } else {
10327
          setUserId((Long)value);
10328
        }
10329
        break;
10330
 
10331
      }
10332
    }
10333
 
10334
    public Object getFieldValue(_Fields field) {
10335
      switch (field) {
10336
      case COUPON_CODE:
10337
        return getCouponCode();
10338
 
10339
      case TRANSACTION_ID:
3430 rajveer 10340
        return Long.valueOf(getTransactionId());
1982 varun.gupt 10341
 
10342
      case USER_ID:
3430 rajveer 10343
        return Long.valueOf(getUserId());
1982 varun.gupt 10344
 
10345
      }
10346
      throw new IllegalStateException();
10347
    }
10348
 
3430 rajveer 10349
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10350
    public boolean isSet(_Fields field) {
10351
      if (field == null) {
10352
        throw new IllegalArgumentException();
10353
      }
1982 varun.gupt 10354
 
10355
      switch (field) {
10356
      case COUPON_CODE:
10357
        return isSetCouponCode();
10358
      case TRANSACTION_ID:
10359
        return isSetTransactionId();
10360
      case USER_ID:
10361
        return isSetUserId();
10362
      }
10363
      throw new IllegalStateException();
10364
    }
10365
 
10366
    @Override
10367
    public boolean equals(Object that) {
10368
      if (that == null)
10369
        return false;
10370
      if (that instanceof trackCouponUsage_args)
10371
        return this.equals((trackCouponUsage_args)that);
10372
      return false;
10373
    }
10374
 
10375
    public boolean equals(trackCouponUsage_args that) {
10376
      if (that == null)
10377
        return false;
10378
 
10379
      boolean this_present_couponCode = true && this.isSetCouponCode();
10380
      boolean that_present_couponCode = true && that.isSetCouponCode();
10381
      if (this_present_couponCode || that_present_couponCode) {
10382
        if (!(this_present_couponCode && that_present_couponCode))
10383
          return false;
10384
        if (!this.couponCode.equals(that.couponCode))
10385
          return false;
10386
      }
10387
 
10388
      boolean this_present_transactionId = true;
10389
      boolean that_present_transactionId = true;
10390
      if (this_present_transactionId || that_present_transactionId) {
10391
        if (!(this_present_transactionId && that_present_transactionId))
10392
          return false;
10393
        if (this.transactionId != that.transactionId)
10394
          return false;
10395
      }
10396
 
10397
      boolean this_present_userId = true;
10398
      boolean that_present_userId = true;
10399
      if (this_present_userId || that_present_userId) {
10400
        if (!(this_present_userId && that_present_userId))
10401
          return false;
10402
        if (this.userId != that.userId)
10403
          return false;
10404
      }
10405
 
10406
      return true;
10407
    }
10408
 
10409
    @Override
10410
    public int hashCode() {
10411
      return 0;
10412
    }
10413
 
10414
    public int compareTo(trackCouponUsage_args other) {
10415
      if (!getClass().equals(other.getClass())) {
10416
        return getClass().getName().compareTo(other.getClass().getName());
10417
      }
10418
 
10419
      int lastComparison = 0;
10420
      trackCouponUsage_args typedOther = (trackCouponUsage_args)other;
10421
 
3430 rajveer 10422
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 10423
      if (lastComparison != 0) {
10424
        return lastComparison;
10425
      }
3430 rajveer 10426
      if (isSetCouponCode()) {
10427
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
10428
        if (lastComparison != 0) {
10429
          return lastComparison;
10430
        }
1982 varun.gupt 10431
      }
3430 rajveer 10432
      lastComparison = Boolean.valueOf(isSetTransactionId()).compareTo(typedOther.isSetTransactionId());
1982 varun.gupt 10433
      if (lastComparison != 0) {
10434
        return lastComparison;
10435
      }
3430 rajveer 10436
      if (isSetTransactionId()) {
10437
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transactionId, typedOther.transactionId);
10438
        if (lastComparison != 0) {
10439
          return lastComparison;
10440
        }
1982 varun.gupt 10441
      }
3430 rajveer 10442
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 10443
      if (lastComparison != 0) {
10444
        return lastComparison;
10445
      }
3430 rajveer 10446
      if (isSetUserId()) {
10447
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
10448
        if (lastComparison != 0) {
10449
          return lastComparison;
10450
        }
1982 varun.gupt 10451
      }
10452
      return 0;
10453
    }
10454
 
3430 rajveer 10455
    public _Fields fieldForId(int fieldId) {
10456
      return _Fields.findByThriftId(fieldId);
10457
    }
10458
 
10459
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10460
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 10461
      iprot.readStructBegin();
10462
      while (true)
10463
      {
10464
        field = iprot.readFieldBegin();
3430 rajveer 10465
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 10466
          break;
10467
        }
3430 rajveer 10468
        switch (field.id) {
10469
          case 1: // COUPON_CODE
10470
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
10471
              this.couponCode = iprot.readString();
10472
            } else { 
10473
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10474
            }
10475
            break;
10476
          case 2: // TRANSACTION_ID
10477
            if (field.type == org.apache.thrift.protocol.TType.I64) {
10478
              this.transactionId = iprot.readI64();
10479
              setTransactionIdIsSet(true);
10480
            } else { 
10481
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10482
            }
10483
            break;
10484
          case 3: // USER_ID
10485
            if (field.type == org.apache.thrift.protocol.TType.I64) {
10486
              this.userId = iprot.readI64();
10487
              setUserIdIsSet(true);
10488
            } else { 
10489
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10490
            }
10491
            break;
10492
          default:
10493
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 10494
        }
3430 rajveer 10495
        iprot.readFieldEnd();
1982 varun.gupt 10496
      }
10497
      iprot.readStructEnd();
10498
      validate();
10499
    }
10500
 
3430 rajveer 10501
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 10502
      validate();
10503
 
10504
      oprot.writeStructBegin(STRUCT_DESC);
10505
      if (this.couponCode != null) {
10506
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
10507
        oprot.writeString(this.couponCode);
10508
        oprot.writeFieldEnd();
10509
      }
10510
      oprot.writeFieldBegin(TRANSACTION_ID_FIELD_DESC);
10511
      oprot.writeI64(this.transactionId);
10512
      oprot.writeFieldEnd();
10513
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
10514
      oprot.writeI64(this.userId);
10515
      oprot.writeFieldEnd();
10516
      oprot.writeFieldStop();
10517
      oprot.writeStructEnd();
10518
    }
10519
 
10520
    @Override
10521
    public String toString() {
10522
      StringBuilder sb = new StringBuilder("trackCouponUsage_args(");
10523
      boolean first = true;
10524
 
10525
      sb.append("couponCode:");
10526
      if (this.couponCode == null) {
10527
        sb.append("null");
10528
      } else {
10529
        sb.append(this.couponCode);
10530
      }
10531
      first = false;
10532
      if (!first) sb.append(", ");
10533
      sb.append("transactionId:");
10534
      sb.append(this.transactionId);
10535
      first = false;
10536
      if (!first) sb.append(", ");
10537
      sb.append("userId:");
10538
      sb.append(this.userId);
10539
      first = false;
10540
      sb.append(")");
10541
      return sb.toString();
10542
    }
10543
 
3430 rajveer 10544
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 10545
      // check for required fields
10546
    }
10547
 
3430 rajveer 10548
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10549
      try {
10550
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10551
      } catch (org.apache.thrift.TException te) {
10552
        throw new java.io.IOException(te);
10553
      }
10554
    }
10555
 
10556
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10557
      try {
10558
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
10559
        __isset_bit_vector = new BitSet(1);
10560
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10561
      } catch (org.apache.thrift.TException te) {
10562
        throw new java.io.IOException(te);
10563
      }
10564
    }
10565
 
1982 varun.gupt 10566
  }
10567
 
3430 rajveer 10568
  public static class trackCouponUsage_result implements org.apache.thrift.TBase<trackCouponUsage_result, trackCouponUsage_result._Fields>, java.io.Serializable, Cloneable   {
10569
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("trackCouponUsage_result");
1982 varun.gupt 10570
 
3430 rajveer 10571
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
1982 varun.gupt 10572
 
3430 rajveer 10573
    private PromotionException pex; // required
1982 varun.gupt 10574
 
10575
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 10576
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 10577
      PEX((short)1, "pex");
10578
 
10579
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10580
 
10581
      static {
10582
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10583
          byName.put(field.getFieldName(), field);
10584
        }
10585
      }
10586
 
10587
      /**
10588
       * Find the _Fields constant that matches fieldId, or null if its not found.
10589
       */
10590
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 10591
        switch(fieldId) {
10592
          case 1: // PEX
10593
            return PEX;
10594
          default:
10595
            return null;
10596
        }
1982 varun.gupt 10597
      }
10598
 
10599
      /**
10600
       * Find the _Fields constant that matches fieldId, throwing an exception
10601
       * if it is not found.
10602
       */
10603
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10604
        _Fields fields = findByThriftId(fieldId);
10605
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10606
        return fields;
10607
      }
10608
 
10609
      /**
10610
       * Find the _Fields constant that matches name, or null if its not found.
10611
       */
10612
      public static _Fields findByName(String name) {
10613
        return byName.get(name);
10614
      }
10615
 
10616
      private final short _thriftId;
10617
      private final String _fieldName;
10618
 
10619
      _Fields(short thriftId, String fieldName) {
10620
        _thriftId = thriftId;
10621
        _fieldName = fieldName;
10622
      }
10623
 
10624
      public short getThriftFieldId() {
10625
        return _thriftId;
10626
      }
10627
 
10628
      public String getFieldName() {
10629
        return _fieldName;
10630
      }
10631
    }
10632
 
10633
    // isset id assignments
10634
 
3430 rajveer 10635
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 10636
    static {
3430 rajveer 10637
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10638
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10639
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
10640
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10641
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(trackCouponUsage_result.class, metaDataMap);
1982 varun.gupt 10642
    }
10643
 
10644
    public trackCouponUsage_result() {
10645
    }
10646
 
10647
    public trackCouponUsage_result(
10648
      PromotionException pex)
10649
    {
10650
      this();
10651
      this.pex = pex;
10652
    }
10653
 
10654
    /**
10655
     * Performs a deep copy on <i>other</i>.
10656
     */
10657
    public trackCouponUsage_result(trackCouponUsage_result other) {
10658
      if (other.isSetPex()) {
10659
        this.pex = new PromotionException(other.pex);
10660
      }
10661
    }
10662
 
10663
    public trackCouponUsage_result deepCopy() {
10664
      return new trackCouponUsage_result(this);
10665
    }
10666
 
3430 rajveer 10667
    @Override
10668
    public void clear() {
10669
      this.pex = null;
1982 varun.gupt 10670
    }
10671
 
10672
    public PromotionException getPex() {
10673
      return this.pex;
10674
    }
10675
 
3430 rajveer 10676
    public void setPex(PromotionException pex) {
1982 varun.gupt 10677
      this.pex = pex;
10678
    }
10679
 
10680
    public void unsetPex() {
10681
      this.pex = null;
10682
    }
10683
 
3430 rajveer 10684
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 10685
    public boolean isSetPex() {
10686
      return this.pex != null;
10687
    }
10688
 
10689
    public void setPexIsSet(boolean value) {
10690
      if (!value) {
10691
        this.pex = null;
10692
      }
10693
    }
10694
 
10695
    public void setFieldValue(_Fields field, Object value) {
10696
      switch (field) {
10697
      case PEX:
10698
        if (value == null) {
10699
          unsetPex();
10700
        } else {
10701
          setPex((PromotionException)value);
10702
        }
10703
        break;
10704
 
10705
      }
10706
    }
10707
 
10708
    public Object getFieldValue(_Fields field) {
10709
      switch (field) {
10710
      case PEX:
10711
        return getPex();
10712
 
10713
      }
10714
      throw new IllegalStateException();
10715
    }
10716
 
3430 rajveer 10717
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
10718
    public boolean isSet(_Fields field) {
10719
      if (field == null) {
10720
        throw new IllegalArgumentException();
10721
      }
1982 varun.gupt 10722
 
10723
      switch (field) {
10724
      case PEX:
10725
        return isSetPex();
10726
      }
10727
      throw new IllegalStateException();
10728
    }
10729
 
10730
    @Override
10731
    public boolean equals(Object that) {
10732
      if (that == null)
10733
        return false;
10734
      if (that instanceof trackCouponUsage_result)
10735
        return this.equals((trackCouponUsage_result)that);
10736
      return false;
10737
    }
10738
 
10739
    public boolean equals(trackCouponUsage_result that) {
10740
      if (that == null)
10741
        return false;
10742
 
10743
      boolean this_present_pex = true && this.isSetPex();
10744
      boolean that_present_pex = true && that.isSetPex();
10745
      if (this_present_pex || that_present_pex) {
10746
        if (!(this_present_pex && that_present_pex))
10747
          return false;
10748
        if (!this.pex.equals(that.pex))
10749
          return false;
10750
      }
10751
 
10752
      return true;
10753
    }
10754
 
10755
    @Override
10756
    public int hashCode() {
10757
      return 0;
10758
    }
10759
 
10760
    public int compareTo(trackCouponUsage_result other) {
10761
      if (!getClass().equals(other.getClass())) {
10762
        return getClass().getName().compareTo(other.getClass().getName());
10763
      }
10764
 
10765
      int lastComparison = 0;
10766
      trackCouponUsage_result typedOther = (trackCouponUsage_result)other;
10767
 
3430 rajveer 10768
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 10769
      if (lastComparison != 0) {
10770
        return lastComparison;
10771
      }
3430 rajveer 10772
      if (isSetPex()) {
10773
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
10774
        if (lastComparison != 0) {
10775
          return lastComparison;
10776
        }
1982 varun.gupt 10777
      }
10778
      return 0;
10779
    }
10780
 
3430 rajveer 10781
    public _Fields fieldForId(int fieldId) {
10782
      return _Fields.findByThriftId(fieldId);
10783
    }
10784
 
10785
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
10786
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 10787
      iprot.readStructBegin();
10788
      while (true)
10789
      {
10790
        field = iprot.readFieldBegin();
3430 rajveer 10791
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 10792
          break;
10793
        }
3430 rajveer 10794
        switch (field.id) {
10795
          case 1: // PEX
10796
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
10797
              this.pex = new PromotionException();
10798
              this.pex.read(iprot);
10799
            } else { 
10800
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
10801
            }
10802
            break;
10803
          default:
10804
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 10805
        }
3430 rajveer 10806
        iprot.readFieldEnd();
1982 varun.gupt 10807
      }
10808
      iprot.readStructEnd();
10809
      validate();
10810
    }
10811
 
3430 rajveer 10812
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 10813
      oprot.writeStructBegin(STRUCT_DESC);
10814
 
10815
      if (this.isSetPex()) {
10816
        oprot.writeFieldBegin(PEX_FIELD_DESC);
10817
        this.pex.write(oprot);
10818
        oprot.writeFieldEnd();
10819
      }
10820
      oprot.writeFieldStop();
10821
      oprot.writeStructEnd();
10822
    }
10823
 
10824
    @Override
10825
    public String toString() {
10826
      StringBuilder sb = new StringBuilder("trackCouponUsage_result(");
10827
      boolean first = true;
10828
 
10829
      sb.append("pex:");
10830
      if (this.pex == null) {
10831
        sb.append("null");
10832
      } else {
10833
        sb.append(this.pex);
10834
      }
10835
      first = false;
10836
      sb.append(")");
10837
      return sb.toString();
10838
    }
10839
 
3430 rajveer 10840
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 10841
      // check for required fields
10842
    }
10843
 
3430 rajveer 10844
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
10845
      try {
10846
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
10847
      } catch (org.apache.thrift.TException te) {
10848
        throw new java.io.IOException(te);
10849
      }
10850
    }
10851
 
10852
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
10853
      try {
10854
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
10855
      } catch (org.apache.thrift.TException te) {
10856
        throw new java.io.IOException(te);
10857
      }
10858
    }
10859
 
1982 varun.gupt 10860
  }
10861
 
3430 rajveer 10862
  public static class getCouponUsageCountByUser_args implements org.apache.thrift.TBase<getCouponUsageCountByUser_args, getCouponUsageCountByUser_args._Fields>, java.io.Serializable, Cloneable   {
10863
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_args");
1982 varun.gupt 10864
 
3430 rajveer 10865
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)1);
10866
    private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.I64, (short)2);
1982 varun.gupt 10867
 
3430 rajveer 10868
    private String couponCode; // required
10869
    private long userId; // required
1982 varun.gupt 10870
 
10871
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 10872
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 10873
      COUPON_CODE((short)1, "couponCode"),
10874
      USER_ID((short)2, "userId");
10875
 
10876
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
10877
 
10878
      static {
10879
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
10880
          byName.put(field.getFieldName(), field);
10881
        }
10882
      }
10883
 
10884
      /**
10885
       * Find the _Fields constant that matches fieldId, or null if its not found.
10886
       */
10887
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 10888
        switch(fieldId) {
10889
          case 1: // COUPON_CODE
10890
            return COUPON_CODE;
10891
          case 2: // USER_ID
10892
            return USER_ID;
10893
          default:
10894
            return null;
10895
        }
1982 varun.gupt 10896
      }
10897
 
10898
      /**
10899
       * Find the _Fields constant that matches fieldId, throwing an exception
10900
       * if it is not found.
10901
       */
10902
      public static _Fields findByThriftIdOrThrow(int fieldId) {
10903
        _Fields fields = findByThriftId(fieldId);
10904
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
10905
        return fields;
10906
      }
10907
 
10908
      /**
10909
       * Find the _Fields constant that matches name, or null if its not found.
10910
       */
10911
      public static _Fields findByName(String name) {
10912
        return byName.get(name);
10913
      }
10914
 
10915
      private final short _thriftId;
10916
      private final String _fieldName;
10917
 
10918
      _Fields(short thriftId, String fieldName) {
10919
        _thriftId = thriftId;
10920
        _fieldName = fieldName;
10921
      }
10922
 
10923
      public short getThriftFieldId() {
10924
        return _thriftId;
10925
      }
10926
 
10927
      public String getFieldName() {
10928
        return _fieldName;
10929
      }
10930
    }
10931
 
10932
    // isset id assignments
10933
    private static final int __USERID_ISSET_ID = 0;
10934
    private BitSet __isset_bit_vector = new BitSet(1);
10935
 
3430 rajveer 10936
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 10937
    static {
3430 rajveer 10938
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
10939
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10940
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
10941
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
10942
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
10943
      metaDataMap = Collections.unmodifiableMap(tmpMap);
10944
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_args.class, metaDataMap);
1982 varun.gupt 10945
    }
10946
 
10947
    public getCouponUsageCountByUser_args() {
10948
    }
10949
 
10950
    public getCouponUsageCountByUser_args(
10951
      String couponCode,
10952
      long userId)
10953
    {
10954
      this();
10955
      this.couponCode = couponCode;
10956
      this.userId = userId;
10957
      setUserIdIsSet(true);
10958
    }
10959
 
10960
    /**
10961
     * Performs a deep copy on <i>other</i>.
10962
     */
10963
    public getCouponUsageCountByUser_args(getCouponUsageCountByUser_args other) {
10964
      __isset_bit_vector.clear();
10965
      __isset_bit_vector.or(other.__isset_bit_vector);
10966
      if (other.isSetCouponCode()) {
10967
        this.couponCode = other.couponCode;
10968
      }
10969
      this.userId = other.userId;
10970
    }
10971
 
10972
    public getCouponUsageCountByUser_args deepCopy() {
10973
      return new getCouponUsageCountByUser_args(this);
10974
    }
10975
 
3430 rajveer 10976
    @Override
10977
    public void clear() {
10978
      this.couponCode = null;
10979
      setUserIdIsSet(false);
10980
      this.userId = 0;
1982 varun.gupt 10981
    }
10982
 
10983
    public String getCouponCode() {
10984
      return this.couponCode;
10985
    }
10986
 
3430 rajveer 10987
    public void setCouponCode(String couponCode) {
1982 varun.gupt 10988
      this.couponCode = couponCode;
10989
    }
10990
 
10991
    public void unsetCouponCode() {
10992
      this.couponCode = null;
10993
    }
10994
 
3430 rajveer 10995
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
1982 varun.gupt 10996
    public boolean isSetCouponCode() {
10997
      return this.couponCode != null;
10998
    }
10999
 
11000
    public void setCouponCodeIsSet(boolean value) {
11001
      if (!value) {
11002
        this.couponCode = null;
11003
      }
11004
    }
11005
 
11006
    public long getUserId() {
11007
      return this.userId;
11008
    }
11009
 
3430 rajveer 11010
    public void setUserId(long userId) {
1982 varun.gupt 11011
      this.userId = userId;
11012
      setUserIdIsSet(true);
11013
    }
11014
 
11015
    public void unsetUserId() {
11016
      __isset_bit_vector.clear(__USERID_ISSET_ID);
11017
    }
11018
 
3430 rajveer 11019
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
1982 varun.gupt 11020
    public boolean isSetUserId() {
11021
      return __isset_bit_vector.get(__USERID_ISSET_ID);
11022
    }
11023
 
11024
    public void setUserIdIsSet(boolean value) {
11025
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
11026
    }
11027
 
11028
    public void setFieldValue(_Fields field, Object value) {
11029
      switch (field) {
11030
      case COUPON_CODE:
11031
        if (value == null) {
11032
          unsetCouponCode();
11033
        } else {
11034
          setCouponCode((String)value);
11035
        }
11036
        break;
11037
 
11038
      case USER_ID:
11039
        if (value == null) {
11040
          unsetUserId();
11041
        } else {
11042
          setUserId((Long)value);
11043
        }
11044
        break;
11045
 
11046
      }
11047
    }
11048
 
11049
    public Object getFieldValue(_Fields field) {
11050
      switch (field) {
11051
      case COUPON_CODE:
11052
        return getCouponCode();
11053
 
11054
      case USER_ID:
3430 rajveer 11055
        return Long.valueOf(getUserId());
1982 varun.gupt 11056
 
11057
      }
11058
      throw new IllegalStateException();
11059
    }
11060
 
3430 rajveer 11061
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11062
    public boolean isSet(_Fields field) {
11063
      if (field == null) {
11064
        throw new IllegalArgumentException();
11065
      }
1982 varun.gupt 11066
 
11067
      switch (field) {
11068
      case COUPON_CODE:
11069
        return isSetCouponCode();
11070
      case USER_ID:
11071
        return isSetUserId();
11072
      }
11073
      throw new IllegalStateException();
11074
    }
11075
 
11076
    @Override
11077
    public boolean equals(Object that) {
11078
      if (that == null)
11079
        return false;
11080
      if (that instanceof getCouponUsageCountByUser_args)
11081
        return this.equals((getCouponUsageCountByUser_args)that);
11082
      return false;
11083
    }
11084
 
11085
    public boolean equals(getCouponUsageCountByUser_args that) {
11086
      if (that == null)
11087
        return false;
11088
 
11089
      boolean this_present_couponCode = true && this.isSetCouponCode();
11090
      boolean that_present_couponCode = true && that.isSetCouponCode();
11091
      if (this_present_couponCode || that_present_couponCode) {
11092
        if (!(this_present_couponCode && that_present_couponCode))
11093
          return false;
11094
        if (!this.couponCode.equals(that.couponCode))
11095
          return false;
11096
      }
11097
 
11098
      boolean this_present_userId = true;
11099
      boolean that_present_userId = true;
11100
      if (this_present_userId || that_present_userId) {
11101
        if (!(this_present_userId && that_present_userId))
11102
          return false;
11103
        if (this.userId != that.userId)
11104
          return false;
11105
      }
11106
 
11107
      return true;
11108
    }
11109
 
11110
    @Override
11111
    public int hashCode() {
11112
      return 0;
11113
    }
11114
 
11115
    public int compareTo(getCouponUsageCountByUser_args other) {
11116
      if (!getClass().equals(other.getClass())) {
11117
        return getClass().getName().compareTo(other.getClass().getName());
11118
      }
11119
 
11120
      int lastComparison = 0;
11121
      getCouponUsageCountByUser_args typedOther = (getCouponUsageCountByUser_args)other;
11122
 
3430 rajveer 11123
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
1982 varun.gupt 11124
      if (lastComparison != 0) {
11125
        return lastComparison;
11126
      }
3430 rajveer 11127
      if (isSetCouponCode()) {
11128
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
11129
        if (lastComparison != 0) {
11130
          return lastComparison;
11131
        }
1982 varun.gupt 11132
      }
3430 rajveer 11133
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
1982 varun.gupt 11134
      if (lastComparison != 0) {
11135
        return lastComparison;
11136
      }
3430 rajveer 11137
      if (isSetUserId()) {
11138
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
11139
        if (lastComparison != 0) {
11140
          return lastComparison;
11141
        }
1982 varun.gupt 11142
      }
11143
      return 0;
11144
    }
11145
 
3430 rajveer 11146
    public _Fields fieldForId(int fieldId) {
11147
      return _Fields.findByThriftId(fieldId);
11148
    }
11149
 
11150
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11151
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 11152
      iprot.readStructBegin();
11153
      while (true)
11154
      {
11155
        field = iprot.readFieldBegin();
3430 rajveer 11156
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 11157
          break;
11158
        }
3430 rajveer 11159
        switch (field.id) {
11160
          case 1: // COUPON_CODE
11161
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
11162
              this.couponCode = iprot.readString();
11163
            } else { 
11164
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11165
            }
11166
            break;
11167
          case 2: // USER_ID
11168
            if (field.type == org.apache.thrift.protocol.TType.I64) {
11169
              this.userId = iprot.readI64();
11170
              setUserIdIsSet(true);
11171
            } else { 
11172
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11173
            }
11174
            break;
11175
          default:
11176
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 11177
        }
3430 rajveer 11178
        iprot.readFieldEnd();
1982 varun.gupt 11179
      }
11180
      iprot.readStructEnd();
11181
      validate();
11182
    }
11183
 
3430 rajveer 11184
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 11185
      validate();
11186
 
11187
      oprot.writeStructBegin(STRUCT_DESC);
11188
      if (this.couponCode != null) {
11189
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
11190
        oprot.writeString(this.couponCode);
11191
        oprot.writeFieldEnd();
11192
      }
11193
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
11194
      oprot.writeI64(this.userId);
11195
      oprot.writeFieldEnd();
11196
      oprot.writeFieldStop();
11197
      oprot.writeStructEnd();
11198
    }
11199
 
11200
    @Override
11201
    public String toString() {
11202
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_args(");
11203
      boolean first = true;
11204
 
11205
      sb.append("couponCode:");
11206
      if (this.couponCode == null) {
11207
        sb.append("null");
11208
      } else {
11209
        sb.append(this.couponCode);
11210
      }
11211
      first = false;
11212
      if (!first) sb.append(", ");
11213
      sb.append("userId:");
11214
      sb.append(this.userId);
11215
      first = false;
11216
      sb.append(")");
11217
      return sb.toString();
11218
    }
11219
 
3430 rajveer 11220
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 11221
      // check for required fields
11222
    }
11223
 
3430 rajveer 11224
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11225
      try {
11226
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11227
      } catch (org.apache.thrift.TException te) {
11228
        throw new java.io.IOException(te);
11229
      }
11230
    }
11231
 
11232
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11233
      try {
11234
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
11235
        __isset_bit_vector = new BitSet(1);
11236
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11237
      } catch (org.apache.thrift.TException te) {
11238
        throw new java.io.IOException(te);
11239
      }
11240
    }
11241
 
1982 varun.gupt 11242
  }
11243
 
3430 rajveer 11244
  public static class getCouponUsageCountByUser_result implements org.apache.thrift.TBase<getCouponUsageCountByUser_result, getCouponUsageCountByUser_result._Fields>, java.io.Serializable, Cloneable   {
11245
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getCouponUsageCountByUser_result");
1982 varun.gupt 11246
 
3430 rajveer 11247
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0);
11248
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
1982 varun.gupt 11249
 
3430 rajveer 11250
    private long success; // required
11251
    private PromotionException pex; // required
1982 varun.gupt 11252
 
11253
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 11254
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1982 varun.gupt 11255
      SUCCESS((short)0, "success"),
11256
      PEX((short)1, "pex");
11257
 
11258
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11259
 
11260
      static {
11261
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11262
          byName.put(field.getFieldName(), field);
11263
        }
11264
      }
11265
 
11266
      /**
11267
       * Find the _Fields constant that matches fieldId, or null if its not found.
11268
       */
11269
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 11270
        switch(fieldId) {
11271
          case 0: // SUCCESS
11272
            return SUCCESS;
11273
          case 1: // PEX
11274
            return PEX;
11275
          default:
11276
            return null;
11277
        }
1982 varun.gupt 11278
      }
11279
 
11280
      /**
11281
       * Find the _Fields constant that matches fieldId, throwing an exception
11282
       * if it is not found.
11283
       */
11284
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11285
        _Fields fields = findByThriftId(fieldId);
11286
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11287
        return fields;
11288
      }
11289
 
11290
      /**
11291
       * Find the _Fields constant that matches name, or null if its not found.
11292
       */
11293
      public static _Fields findByName(String name) {
11294
        return byName.get(name);
11295
      }
11296
 
11297
      private final short _thriftId;
11298
      private final String _fieldName;
11299
 
11300
      _Fields(short thriftId, String fieldName) {
11301
        _thriftId = thriftId;
11302
        _fieldName = fieldName;
11303
      }
11304
 
11305
      public short getThriftFieldId() {
11306
        return _thriftId;
11307
      }
11308
 
11309
      public String getFieldName() {
11310
        return _fieldName;
11311
      }
11312
    }
11313
 
11314
    // isset id assignments
11315
    private static final int __SUCCESS_ISSET_ID = 0;
11316
    private BitSet __isset_bit_vector = new BitSet(1);
11317
 
3430 rajveer 11318
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1982 varun.gupt 11319
    static {
3430 rajveer 11320
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11321
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11322
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
11323
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11324
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
11325
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11326
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getCouponUsageCountByUser_result.class, metaDataMap);
1982 varun.gupt 11327
    }
11328
 
11329
    public getCouponUsageCountByUser_result() {
11330
    }
11331
 
11332
    public getCouponUsageCountByUser_result(
11333
      long success,
11334
      PromotionException pex)
11335
    {
11336
      this();
11337
      this.success = success;
11338
      setSuccessIsSet(true);
11339
      this.pex = pex;
11340
    }
11341
 
11342
    /**
11343
     * Performs a deep copy on <i>other</i>.
11344
     */
11345
    public getCouponUsageCountByUser_result(getCouponUsageCountByUser_result other) {
11346
      __isset_bit_vector.clear();
11347
      __isset_bit_vector.or(other.__isset_bit_vector);
11348
      this.success = other.success;
11349
      if (other.isSetPex()) {
11350
        this.pex = new PromotionException(other.pex);
11351
      }
11352
    }
11353
 
11354
    public getCouponUsageCountByUser_result deepCopy() {
11355
      return new getCouponUsageCountByUser_result(this);
11356
    }
11357
 
3430 rajveer 11358
    @Override
11359
    public void clear() {
11360
      setSuccessIsSet(false);
11361
      this.success = 0;
11362
      this.pex = null;
1982 varun.gupt 11363
    }
11364
 
11365
    public long getSuccess() {
11366
      return this.success;
11367
    }
11368
 
3430 rajveer 11369
    public void setSuccess(long success) {
1982 varun.gupt 11370
      this.success = success;
11371
      setSuccessIsSet(true);
11372
    }
11373
 
11374
    public void unsetSuccess() {
11375
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
11376
    }
11377
 
3430 rajveer 11378
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
1982 varun.gupt 11379
    public boolean isSetSuccess() {
11380
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
11381
    }
11382
 
11383
    public void setSuccessIsSet(boolean value) {
11384
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
11385
    }
11386
 
11387
    public PromotionException getPex() {
11388
      return this.pex;
11389
    }
11390
 
3430 rajveer 11391
    public void setPex(PromotionException pex) {
1982 varun.gupt 11392
      this.pex = pex;
11393
    }
11394
 
11395
    public void unsetPex() {
11396
      this.pex = null;
11397
    }
11398
 
3430 rajveer 11399
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
1982 varun.gupt 11400
    public boolean isSetPex() {
11401
      return this.pex != null;
11402
    }
11403
 
11404
    public void setPexIsSet(boolean value) {
11405
      if (!value) {
11406
        this.pex = null;
11407
      }
11408
    }
11409
 
11410
    public void setFieldValue(_Fields field, Object value) {
11411
      switch (field) {
11412
      case SUCCESS:
11413
        if (value == null) {
11414
          unsetSuccess();
11415
        } else {
11416
          setSuccess((Long)value);
11417
        }
11418
        break;
11419
 
11420
      case PEX:
11421
        if (value == null) {
11422
          unsetPex();
11423
        } else {
11424
          setPex((PromotionException)value);
11425
        }
11426
        break;
11427
 
11428
      }
11429
    }
11430
 
11431
    public Object getFieldValue(_Fields field) {
11432
      switch (field) {
11433
      case SUCCESS:
3430 rajveer 11434
        return Long.valueOf(getSuccess());
1982 varun.gupt 11435
 
11436
      case PEX:
11437
        return getPex();
11438
 
11439
      }
11440
      throw new IllegalStateException();
11441
    }
11442
 
3430 rajveer 11443
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11444
    public boolean isSet(_Fields field) {
11445
      if (field == null) {
11446
        throw new IllegalArgumentException();
11447
      }
1982 varun.gupt 11448
 
11449
      switch (field) {
11450
      case SUCCESS:
11451
        return isSetSuccess();
11452
      case PEX:
11453
        return isSetPex();
11454
      }
11455
      throw new IllegalStateException();
11456
    }
11457
 
11458
    @Override
11459
    public boolean equals(Object that) {
11460
      if (that == null)
11461
        return false;
11462
      if (that instanceof getCouponUsageCountByUser_result)
11463
        return this.equals((getCouponUsageCountByUser_result)that);
11464
      return false;
11465
    }
11466
 
11467
    public boolean equals(getCouponUsageCountByUser_result that) {
11468
      if (that == null)
11469
        return false;
11470
 
11471
      boolean this_present_success = true;
11472
      boolean that_present_success = true;
11473
      if (this_present_success || that_present_success) {
11474
        if (!(this_present_success && that_present_success))
11475
          return false;
11476
        if (this.success != that.success)
11477
          return false;
11478
      }
11479
 
11480
      boolean this_present_pex = true && this.isSetPex();
11481
      boolean that_present_pex = true && that.isSetPex();
11482
      if (this_present_pex || that_present_pex) {
11483
        if (!(this_present_pex && that_present_pex))
11484
          return false;
11485
        if (!this.pex.equals(that.pex))
11486
          return false;
11487
      }
11488
 
11489
      return true;
11490
    }
11491
 
11492
    @Override
11493
    public int hashCode() {
11494
      return 0;
11495
    }
11496
 
11497
    public int compareTo(getCouponUsageCountByUser_result other) {
11498
      if (!getClass().equals(other.getClass())) {
11499
        return getClass().getName().compareTo(other.getClass().getName());
11500
      }
11501
 
11502
      int lastComparison = 0;
11503
      getCouponUsageCountByUser_result typedOther = (getCouponUsageCountByUser_result)other;
11504
 
3430 rajveer 11505
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
1982 varun.gupt 11506
      if (lastComparison != 0) {
11507
        return lastComparison;
11508
      }
3430 rajveer 11509
      if (isSetSuccess()) {
11510
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
11511
        if (lastComparison != 0) {
11512
          return lastComparison;
11513
        }
1982 varun.gupt 11514
      }
3430 rajveer 11515
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
1982 varun.gupt 11516
      if (lastComparison != 0) {
11517
        return lastComparison;
11518
      }
3430 rajveer 11519
      if (isSetPex()) {
11520
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
11521
        if (lastComparison != 0) {
11522
          return lastComparison;
11523
        }
1982 varun.gupt 11524
      }
11525
      return 0;
11526
    }
11527
 
3430 rajveer 11528
    public _Fields fieldForId(int fieldId) {
11529
      return _Fields.findByThriftId(fieldId);
11530
    }
11531
 
11532
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11533
      org.apache.thrift.protocol.TField field;
1982 varun.gupt 11534
      iprot.readStructBegin();
11535
      while (true)
11536
      {
11537
        field = iprot.readFieldBegin();
3430 rajveer 11538
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1982 varun.gupt 11539
          break;
11540
        }
3430 rajveer 11541
        switch (field.id) {
11542
          case 0: // SUCCESS
11543
            if (field.type == org.apache.thrift.protocol.TType.I64) {
11544
              this.success = iprot.readI64();
11545
              setSuccessIsSet(true);
11546
            } else { 
11547
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11548
            }
11549
            break;
11550
          case 1: // PEX
11551
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
11552
              this.pex = new PromotionException();
11553
              this.pex.read(iprot);
11554
            } else { 
11555
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11556
            }
11557
            break;
11558
          default:
11559
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1982 varun.gupt 11560
        }
3430 rajveer 11561
        iprot.readFieldEnd();
1982 varun.gupt 11562
      }
11563
      iprot.readStructEnd();
11564
      validate();
11565
    }
11566
 
3430 rajveer 11567
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1982 varun.gupt 11568
      oprot.writeStructBegin(STRUCT_DESC);
11569
 
11570
      if (this.isSetSuccess()) {
11571
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
11572
        oprot.writeI64(this.success);
11573
        oprot.writeFieldEnd();
11574
      } else if (this.isSetPex()) {
11575
        oprot.writeFieldBegin(PEX_FIELD_DESC);
11576
        this.pex.write(oprot);
11577
        oprot.writeFieldEnd();
11578
      }
11579
      oprot.writeFieldStop();
11580
      oprot.writeStructEnd();
11581
    }
11582
 
11583
    @Override
11584
    public String toString() {
11585
      StringBuilder sb = new StringBuilder("getCouponUsageCountByUser_result(");
11586
      boolean first = true;
11587
 
11588
      sb.append("success:");
11589
      sb.append(this.success);
11590
      first = false;
11591
      if (!first) sb.append(", ");
11592
      sb.append("pex:");
11593
      if (this.pex == null) {
11594
        sb.append("null");
11595
      } else {
11596
        sb.append(this.pex);
11597
      }
11598
      first = false;
11599
      sb.append(")");
11600
      return sb.toString();
11601
    }
11602
 
3430 rajveer 11603
    public void validate() throws org.apache.thrift.TException {
1982 varun.gupt 11604
      // check for required fields
11605
    }
11606
 
3430 rajveer 11607
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11608
      try {
11609
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11610
      } catch (org.apache.thrift.TException te) {
11611
        throw new java.io.IOException(te);
11612
      }
11613
    }
11614
 
11615
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11616
      try {
11617
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11618
      } catch (org.apache.thrift.TException te) {
11619
        throw new java.io.IOException(te);
11620
      }
11621
    }
11622
 
1982 varun.gupt 11623
  }
11624
 
6497 amit.gupta 11625
  public static class getActiveCodes_args implements org.apache.thrift.TBase<getActiveCodes_args, getActiveCodes_args._Fields>, java.io.Serializable, Cloneable   {
11626
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCodes_args");
11627
 
11628
    private static final org.apache.thrift.protocol.TField PROMOTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("promotionId", org.apache.thrift.protocol.TType.I64, (short)1);
11629
 
11630
    private long promotionId; // required
11631
 
11632
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11633
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11634
      PROMOTION_ID((short)1, "promotionId");
11635
 
11636
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11637
 
11638
      static {
11639
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11640
          byName.put(field.getFieldName(), field);
11641
        }
11642
      }
11643
 
11644
      /**
11645
       * Find the _Fields constant that matches fieldId, or null if its not found.
11646
       */
11647
      public static _Fields findByThriftId(int fieldId) {
11648
        switch(fieldId) {
11649
          case 1: // PROMOTION_ID
11650
            return PROMOTION_ID;
11651
          default:
11652
            return null;
11653
        }
11654
      }
11655
 
11656
      /**
11657
       * Find the _Fields constant that matches fieldId, throwing an exception
11658
       * if it is not found.
11659
       */
11660
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11661
        _Fields fields = findByThriftId(fieldId);
11662
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11663
        return fields;
11664
      }
11665
 
11666
      /**
11667
       * Find the _Fields constant that matches name, or null if its not found.
11668
       */
11669
      public static _Fields findByName(String name) {
11670
        return byName.get(name);
11671
      }
11672
 
11673
      private final short _thriftId;
11674
      private final String _fieldName;
11675
 
11676
      _Fields(short thriftId, String fieldName) {
11677
        _thriftId = thriftId;
11678
        _fieldName = fieldName;
11679
      }
11680
 
11681
      public short getThriftFieldId() {
11682
        return _thriftId;
11683
      }
11684
 
11685
      public String getFieldName() {
11686
        return _fieldName;
11687
      }
11688
    }
11689
 
11690
    // isset id assignments
11691
    private static final int __PROMOTIONID_ISSET_ID = 0;
11692
    private BitSet __isset_bit_vector = new BitSet(1);
11693
 
11694
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
11695
    static {
11696
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11697
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11698
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
11699
      metaDataMap = Collections.unmodifiableMap(tmpMap);
11700
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCodes_args.class, metaDataMap);
11701
    }
11702
 
11703
    public getActiveCodes_args() {
11704
    }
11705
 
11706
    public getActiveCodes_args(
11707
      long promotionId)
11708
    {
11709
      this();
11710
      this.promotionId = promotionId;
11711
      setPromotionIdIsSet(true);
11712
    }
11713
 
11714
    /**
11715
     * Performs a deep copy on <i>other</i>.
11716
     */
11717
    public getActiveCodes_args(getActiveCodes_args other) {
11718
      __isset_bit_vector.clear();
11719
      __isset_bit_vector.or(other.__isset_bit_vector);
11720
      this.promotionId = other.promotionId;
11721
    }
11722
 
11723
    public getActiveCodes_args deepCopy() {
11724
      return new getActiveCodes_args(this);
11725
    }
11726
 
11727
    @Override
11728
    public void clear() {
11729
      setPromotionIdIsSet(false);
11730
      this.promotionId = 0;
11731
    }
11732
 
11733
    public long getPromotionId() {
11734
      return this.promotionId;
11735
    }
11736
 
11737
    public void setPromotionId(long promotionId) {
11738
      this.promotionId = promotionId;
11739
      setPromotionIdIsSet(true);
11740
    }
11741
 
11742
    public void unsetPromotionId() {
11743
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
11744
    }
11745
 
11746
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
11747
    public boolean isSetPromotionId() {
11748
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
11749
    }
11750
 
11751
    public void setPromotionIdIsSet(boolean value) {
11752
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
11753
    }
11754
 
11755
    public void setFieldValue(_Fields field, Object value) {
11756
      switch (field) {
11757
      case PROMOTION_ID:
11758
        if (value == null) {
11759
          unsetPromotionId();
11760
        } else {
11761
          setPromotionId((Long)value);
11762
        }
11763
        break;
11764
 
11765
      }
11766
    }
11767
 
11768
    public Object getFieldValue(_Fields field) {
11769
      switch (field) {
11770
      case PROMOTION_ID:
11771
        return Long.valueOf(getPromotionId());
11772
 
11773
      }
11774
      throw new IllegalStateException();
11775
    }
11776
 
11777
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
11778
    public boolean isSet(_Fields field) {
11779
      if (field == null) {
11780
        throw new IllegalArgumentException();
11781
      }
11782
 
11783
      switch (field) {
11784
      case PROMOTION_ID:
11785
        return isSetPromotionId();
11786
      }
11787
      throw new IllegalStateException();
11788
    }
11789
 
11790
    @Override
11791
    public boolean equals(Object that) {
11792
      if (that == null)
11793
        return false;
11794
      if (that instanceof getActiveCodes_args)
11795
        return this.equals((getActiveCodes_args)that);
11796
      return false;
11797
    }
11798
 
11799
    public boolean equals(getActiveCodes_args that) {
11800
      if (that == null)
11801
        return false;
11802
 
11803
      boolean this_present_promotionId = true;
11804
      boolean that_present_promotionId = true;
11805
      if (this_present_promotionId || that_present_promotionId) {
11806
        if (!(this_present_promotionId && that_present_promotionId))
11807
          return false;
11808
        if (this.promotionId != that.promotionId)
11809
          return false;
11810
      }
11811
 
11812
      return true;
11813
    }
11814
 
11815
    @Override
11816
    public int hashCode() {
11817
      return 0;
11818
    }
11819
 
11820
    public int compareTo(getActiveCodes_args other) {
11821
      if (!getClass().equals(other.getClass())) {
11822
        return getClass().getName().compareTo(other.getClass().getName());
11823
      }
11824
 
11825
      int lastComparison = 0;
11826
      getActiveCodes_args typedOther = (getActiveCodes_args)other;
11827
 
11828
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
11829
      if (lastComparison != 0) {
11830
        return lastComparison;
11831
      }
11832
      if (isSetPromotionId()) {
11833
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
11834
        if (lastComparison != 0) {
11835
          return lastComparison;
11836
        }
11837
      }
11838
      return 0;
11839
    }
11840
 
11841
    public _Fields fieldForId(int fieldId) {
11842
      return _Fields.findByThriftId(fieldId);
11843
    }
11844
 
11845
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
11846
      org.apache.thrift.protocol.TField field;
11847
      iprot.readStructBegin();
11848
      while (true)
11849
      {
11850
        field = iprot.readFieldBegin();
11851
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
11852
          break;
11853
        }
11854
        switch (field.id) {
11855
          case 1: // PROMOTION_ID
11856
            if (field.type == org.apache.thrift.protocol.TType.I64) {
11857
              this.promotionId = iprot.readI64();
11858
              setPromotionIdIsSet(true);
11859
            } else { 
11860
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11861
            }
11862
            break;
11863
          default:
11864
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
11865
        }
11866
        iprot.readFieldEnd();
11867
      }
11868
      iprot.readStructEnd();
11869
      validate();
11870
    }
11871
 
11872
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
11873
      validate();
11874
 
11875
      oprot.writeStructBegin(STRUCT_DESC);
11876
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
11877
      oprot.writeI64(this.promotionId);
11878
      oprot.writeFieldEnd();
11879
      oprot.writeFieldStop();
11880
      oprot.writeStructEnd();
11881
    }
11882
 
11883
    @Override
11884
    public String toString() {
11885
      StringBuilder sb = new StringBuilder("getActiveCodes_args(");
11886
      boolean first = true;
11887
 
11888
      sb.append("promotionId:");
11889
      sb.append(this.promotionId);
11890
      first = false;
11891
      sb.append(")");
11892
      return sb.toString();
11893
    }
11894
 
11895
    public void validate() throws org.apache.thrift.TException {
11896
      // check for required fields
11897
    }
11898
 
11899
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
11900
      try {
11901
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
11902
      } catch (org.apache.thrift.TException te) {
11903
        throw new java.io.IOException(te);
11904
      }
11905
    }
11906
 
11907
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
11908
      try {
11909
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
11910
        __isset_bit_vector = new BitSet(1);
11911
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
11912
      } catch (org.apache.thrift.TException te) {
11913
        throw new java.io.IOException(te);
11914
      }
11915
    }
11916
 
11917
  }
11918
 
11919
  public static class getActiveCodes_result implements org.apache.thrift.TBase<getActiveCodes_result, getActiveCodes_result._Fields>, java.io.Serializable, Cloneable   {
11920
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCodes_result");
11921
 
11922
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
11923
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
11924
 
11925
    private List<Coupon> success; // required
11926
    private PromotionException pex; // required
11927
 
11928
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
11929
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
11930
      SUCCESS((short)0, "success"),
11931
      PEX((short)1, "pex");
11932
 
11933
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
11934
 
11935
      static {
11936
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
11937
          byName.put(field.getFieldName(), field);
11938
        }
11939
      }
11940
 
11941
      /**
11942
       * Find the _Fields constant that matches fieldId, or null if its not found.
11943
       */
11944
      public static _Fields findByThriftId(int fieldId) {
11945
        switch(fieldId) {
11946
          case 0: // SUCCESS
11947
            return SUCCESS;
11948
          case 1: // PEX
11949
            return PEX;
11950
          default:
11951
            return null;
11952
        }
11953
      }
11954
 
11955
      /**
11956
       * Find the _Fields constant that matches fieldId, throwing an exception
11957
       * if it is not found.
11958
       */
11959
      public static _Fields findByThriftIdOrThrow(int fieldId) {
11960
        _Fields fields = findByThriftId(fieldId);
11961
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
11962
        return fields;
11963
      }
11964
 
11965
      /**
11966
       * Find the _Fields constant that matches name, or null if its not found.
11967
       */
11968
      public static _Fields findByName(String name) {
11969
        return byName.get(name);
11970
      }
11971
 
11972
      private final short _thriftId;
11973
      private final String _fieldName;
11974
 
11975
      _Fields(short thriftId, String fieldName) {
11976
        _thriftId = thriftId;
11977
        _fieldName = fieldName;
11978
      }
11979
 
11980
      public short getThriftFieldId() {
11981
        return _thriftId;
11982
      }
11983
 
11984
      public String getFieldName() {
11985
        return _fieldName;
11986
      }
11987
    }
11988
 
11989
    // isset id assignments
11990
 
11991
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
11992
    static {
11993
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
11994
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11995
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
11996
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
11997
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
11998
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
11999
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12000
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCodes_result.class, metaDataMap);
12001
    }
12002
 
12003
    public getActiveCodes_result() {
12004
    }
12005
 
12006
    public getActiveCodes_result(
12007
      List<Coupon> success,
12008
      PromotionException pex)
12009
    {
12010
      this();
12011
      this.success = success;
12012
      this.pex = pex;
12013
    }
12014
 
12015
    /**
12016
     * Performs a deep copy on <i>other</i>.
12017
     */
12018
    public getActiveCodes_result(getActiveCodes_result other) {
12019
      if (other.isSetSuccess()) {
12020
        List<Coupon> __this__success = new ArrayList<Coupon>();
12021
        for (Coupon other_element : other.success) {
12022
          __this__success.add(new Coupon(other_element));
12023
        }
12024
        this.success = __this__success;
12025
      }
12026
      if (other.isSetPex()) {
12027
        this.pex = new PromotionException(other.pex);
12028
      }
12029
    }
12030
 
12031
    public getActiveCodes_result deepCopy() {
12032
      return new getActiveCodes_result(this);
12033
    }
12034
 
12035
    @Override
12036
    public void clear() {
12037
      this.success = null;
12038
      this.pex = null;
12039
    }
12040
 
12041
    public int getSuccessSize() {
12042
      return (this.success == null) ? 0 : this.success.size();
12043
    }
12044
 
12045
    public java.util.Iterator<Coupon> getSuccessIterator() {
12046
      return (this.success == null) ? null : this.success.iterator();
12047
    }
12048
 
12049
    public void addToSuccess(Coupon elem) {
12050
      if (this.success == null) {
12051
        this.success = new ArrayList<Coupon>();
12052
      }
12053
      this.success.add(elem);
12054
    }
12055
 
12056
    public List<Coupon> getSuccess() {
12057
      return this.success;
12058
    }
12059
 
12060
    public void setSuccess(List<Coupon> success) {
12061
      this.success = success;
12062
    }
12063
 
12064
    public void unsetSuccess() {
12065
      this.success = null;
12066
    }
12067
 
12068
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
12069
    public boolean isSetSuccess() {
12070
      return this.success != null;
12071
    }
12072
 
12073
    public void setSuccessIsSet(boolean value) {
12074
      if (!value) {
12075
        this.success = null;
12076
      }
12077
    }
12078
 
12079
    public PromotionException getPex() {
12080
      return this.pex;
12081
    }
12082
 
12083
    public void setPex(PromotionException pex) {
12084
      this.pex = pex;
12085
    }
12086
 
12087
    public void unsetPex() {
12088
      this.pex = null;
12089
    }
12090
 
12091
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
12092
    public boolean isSetPex() {
12093
      return this.pex != null;
12094
    }
12095
 
12096
    public void setPexIsSet(boolean value) {
12097
      if (!value) {
12098
        this.pex = null;
12099
      }
12100
    }
12101
 
12102
    public void setFieldValue(_Fields field, Object value) {
12103
      switch (field) {
12104
      case SUCCESS:
12105
        if (value == null) {
12106
          unsetSuccess();
12107
        } else {
12108
          setSuccess((List<Coupon>)value);
12109
        }
12110
        break;
12111
 
12112
      case PEX:
12113
        if (value == null) {
12114
          unsetPex();
12115
        } else {
12116
          setPex((PromotionException)value);
12117
        }
12118
        break;
12119
 
12120
      }
12121
    }
12122
 
12123
    public Object getFieldValue(_Fields field) {
12124
      switch (field) {
12125
      case SUCCESS:
12126
        return getSuccess();
12127
 
12128
      case PEX:
12129
        return getPex();
12130
 
12131
      }
12132
      throw new IllegalStateException();
12133
    }
12134
 
12135
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12136
    public boolean isSet(_Fields field) {
12137
      if (field == null) {
12138
        throw new IllegalArgumentException();
12139
      }
12140
 
12141
      switch (field) {
12142
      case SUCCESS:
12143
        return isSetSuccess();
12144
      case PEX:
12145
        return isSetPex();
12146
      }
12147
      throw new IllegalStateException();
12148
    }
12149
 
12150
    @Override
12151
    public boolean equals(Object that) {
12152
      if (that == null)
12153
        return false;
12154
      if (that instanceof getActiveCodes_result)
12155
        return this.equals((getActiveCodes_result)that);
12156
      return false;
12157
    }
12158
 
12159
    public boolean equals(getActiveCodes_result that) {
12160
      if (that == null)
12161
        return false;
12162
 
12163
      boolean this_present_success = true && this.isSetSuccess();
12164
      boolean that_present_success = true && that.isSetSuccess();
12165
      if (this_present_success || that_present_success) {
12166
        if (!(this_present_success && that_present_success))
12167
          return false;
12168
        if (!this.success.equals(that.success))
12169
          return false;
12170
      }
12171
 
12172
      boolean this_present_pex = true && this.isSetPex();
12173
      boolean that_present_pex = true && that.isSetPex();
12174
      if (this_present_pex || that_present_pex) {
12175
        if (!(this_present_pex && that_present_pex))
12176
          return false;
12177
        if (!this.pex.equals(that.pex))
12178
          return false;
12179
      }
12180
 
12181
      return true;
12182
    }
12183
 
12184
    @Override
12185
    public int hashCode() {
12186
      return 0;
12187
    }
12188
 
12189
    public int compareTo(getActiveCodes_result other) {
12190
      if (!getClass().equals(other.getClass())) {
12191
        return getClass().getName().compareTo(other.getClass().getName());
12192
      }
12193
 
12194
      int lastComparison = 0;
12195
      getActiveCodes_result typedOther = (getActiveCodes_result)other;
12196
 
12197
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
12198
      if (lastComparison != 0) {
12199
        return lastComparison;
12200
      }
12201
      if (isSetSuccess()) {
12202
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
12203
        if (lastComparison != 0) {
12204
          return lastComparison;
12205
        }
12206
      }
12207
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
12208
      if (lastComparison != 0) {
12209
        return lastComparison;
12210
      }
12211
      if (isSetPex()) {
12212
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
12213
        if (lastComparison != 0) {
12214
          return lastComparison;
12215
        }
12216
      }
12217
      return 0;
12218
    }
12219
 
12220
    public _Fields fieldForId(int fieldId) {
12221
      return _Fields.findByThriftId(fieldId);
12222
    }
12223
 
12224
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12225
      org.apache.thrift.protocol.TField field;
12226
      iprot.readStructBegin();
12227
      while (true)
12228
      {
12229
        field = iprot.readFieldBegin();
12230
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12231
          break;
12232
        }
12233
        switch (field.id) {
12234
          case 0: // SUCCESS
12235
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
12236
              {
6736 amit.gupta 12237
                org.apache.thrift.protocol.TList _list26 = iprot.readListBegin();
12238
                this.success = new ArrayList<Coupon>(_list26.size);
12239
                for (int _i27 = 0; _i27 < _list26.size; ++_i27)
6497 amit.gupta 12240
                {
6736 amit.gupta 12241
                  Coupon _elem28; // required
12242
                  _elem28 = new Coupon();
12243
                  _elem28.read(iprot);
12244
                  this.success.add(_elem28);
6497 amit.gupta 12245
                }
12246
                iprot.readListEnd();
12247
              }
12248
            } else { 
12249
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12250
            }
12251
            break;
12252
          case 1: // PEX
12253
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
12254
              this.pex = new PromotionException();
12255
              this.pex.read(iprot);
12256
            } else { 
12257
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12258
            }
12259
            break;
12260
          default:
12261
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12262
        }
12263
        iprot.readFieldEnd();
12264
      }
12265
      iprot.readStructEnd();
12266
      validate();
12267
    }
12268
 
12269
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12270
      oprot.writeStructBegin(STRUCT_DESC);
12271
 
12272
      if (this.isSetSuccess()) {
12273
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
12274
        {
12275
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
6736 amit.gupta 12276
          for (Coupon _iter29 : this.success)
6497 amit.gupta 12277
          {
6736 amit.gupta 12278
            _iter29.write(oprot);
6497 amit.gupta 12279
          }
12280
          oprot.writeListEnd();
12281
        }
12282
        oprot.writeFieldEnd();
12283
      } else if (this.isSetPex()) {
12284
        oprot.writeFieldBegin(PEX_FIELD_DESC);
12285
        this.pex.write(oprot);
12286
        oprot.writeFieldEnd();
12287
      }
12288
      oprot.writeFieldStop();
12289
      oprot.writeStructEnd();
12290
    }
12291
 
12292
    @Override
12293
    public String toString() {
12294
      StringBuilder sb = new StringBuilder("getActiveCodes_result(");
12295
      boolean first = true;
12296
 
12297
      sb.append("success:");
12298
      if (this.success == null) {
12299
        sb.append("null");
12300
      } else {
12301
        sb.append(this.success);
12302
      }
12303
      first = false;
12304
      if (!first) sb.append(", ");
12305
      sb.append("pex:");
12306
      if (this.pex == null) {
12307
        sb.append("null");
12308
      } else {
12309
        sb.append(this.pex);
12310
      }
12311
      first = false;
12312
      sb.append(")");
12313
      return sb.toString();
12314
    }
12315
 
12316
    public void validate() throws org.apache.thrift.TException {
12317
      // check for required fields
12318
    }
12319
 
12320
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12321
      try {
12322
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12323
      } catch (org.apache.thrift.TException te) {
12324
        throw new java.io.IOException(te);
12325
      }
12326
    }
12327
 
12328
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12329
      try {
12330
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12331
      } catch (org.apache.thrift.TException te) {
12332
        throw new java.io.IOException(te);
12333
      }
12334
    }
12335
 
12336
  }
12337
 
12338
  public static class deleteCoupon_args implements org.apache.thrift.TBase<deleteCoupon_args, deleteCoupon_args._Fields>, java.io.Serializable, Cloneable   {
12339
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteCoupon_args");
12340
 
12341
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)1);
12342
 
12343
    private String couponCode; // required
12344
 
12345
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12346
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12347
      COUPON_CODE((short)1, "couponCode");
12348
 
12349
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12350
 
12351
      static {
12352
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12353
          byName.put(field.getFieldName(), field);
12354
        }
12355
      }
12356
 
12357
      /**
12358
       * Find the _Fields constant that matches fieldId, or null if its not found.
12359
       */
12360
      public static _Fields findByThriftId(int fieldId) {
12361
        switch(fieldId) {
12362
          case 1: // COUPON_CODE
12363
            return COUPON_CODE;
12364
          default:
12365
            return null;
12366
        }
12367
      }
12368
 
12369
      /**
12370
       * Find the _Fields constant that matches fieldId, throwing an exception
12371
       * if it is not found.
12372
       */
12373
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12374
        _Fields fields = findByThriftId(fieldId);
12375
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12376
        return fields;
12377
      }
12378
 
12379
      /**
12380
       * Find the _Fields constant that matches name, or null if its not found.
12381
       */
12382
      public static _Fields findByName(String name) {
12383
        return byName.get(name);
12384
      }
12385
 
12386
      private final short _thriftId;
12387
      private final String _fieldName;
12388
 
12389
      _Fields(short thriftId, String fieldName) {
12390
        _thriftId = thriftId;
12391
        _fieldName = fieldName;
12392
      }
12393
 
12394
      public short getThriftFieldId() {
12395
        return _thriftId;
12396
      }
12397
 
12398
      public String getFieldName() {
12399
        return _fieldName;
12400
      }
12401
    }
12402
 
12403
    // isset id assignments
12404
 
12405
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12406
    static {
12407
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12408
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12409
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
12410
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12411
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteCoupon_args.class, metaDataMap);
12412
    }
12413
 
12414
    public deleteCoupon_args() {
12415
    }
12416
 
12417
    public deleteCoupon_args(
12418
      String couponCode)
12419
    {
12420
      this();
12421
      this.couponCode = couponCode;
12422
    }
12423
 
12424
    /**
12425
     * Performs a deep copy on <i>other</i>.
12426
     */
12427
    public deleteCoupon_args(deleteCoupon_args other) {
12428
      if (other.isSetCouponCode()) {
12429
        this.couponCode = other.couponCode;
12430
      }
12431
    }
12432
 
12433
    public deleteCoupon_args deepCopy() {
12434
      return new deleteCoupon_args(this);
12435
    }
12436
 
12437
    @Override
12438
    public void clear() {
12439
      this.couponCode = null;
12440
    }
12441
 
12442
    public String getCouponCode() {
12443
      return this.couponCode;
12444
    }
12445
 
12446
    public void setCouponCode(String couponCode) {
12447
      this.couponCode = couponCode;
12448
    }
12449
 
12450
    public void unsetCouponCode() {
12451
      this.couponCode = null;
12452
    }
12453
 
12454
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
12455
    public boolean isSetCouponCode() {
12456
      return this.couponCode != null;
12457
    }
12458
 
12459
    public void setCouponCodeIsSet(boolean value) {
12460
      if (!value) {
12461
        this.couponCode = null;
12462
      }
12463
    }
12464
 
12465
    public void setFieldValue(_Fields field, Object value) {
12466
      switch (field) {
12467
      case COUPON_CODE:
12468
        if (value == null) {
12469
          unsetCouponCode();
12470
        } else {
12471
          setCouponCode((String)value);
12472
        }
12473
        break;
12474
 
12475
      }
12476
    }
12477
 
12478
    public Object getFieldValue(_Fields field) {
12479
      switch (field) {
12480
      case COUPON_CODE:
12481
        return getCouponCode();
12482
 
12483
      }
12484
      throw new IllegalStateException();
12485
    }
12486
 
12487
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12488
    public boolean isSet(_Fields field) {
12489
      if (field == null) {
12490
        throw new IllegalArgumentException();
12491
      }
12492
 
12493
      switch (field) {
12494
      case COUPON_CODE:
12495
        return isSetCouponCode();
12496
      }
12497
      throw new IllegalStateException();
12498
    }
12499
 
12500
    @Override
12501
    public boolean equals(Object that) {
12502
      if (that == null)
12503
        return false;
12504
      if (that instanceof deleteCoupon_args)
12505
        return this.equals((deleteCoupon_args)that);
12506
      return false;
12507
    }
12508
 
12509
    public boolean equals(deleteCoupon_args that) {
12510
      if (that == null)
12511
        return false;
12512
 
12513
      boolean this_present_couponCode = true && this.isSetCouponCode();
12514
      boolean that_present_couponCode = true && that.isSetCouponCode();
12515
      if (this_present_couponCode || that_present_couponCode) {
12516
        if (!(this_present_couponCode && that_present_couponCode))
12517
          return false;
12518
        if (!this.couponCode.equals(that.couponCode))
12519
          return false;
12520
      }
12521
 
12522
      return true;
12523
    }
12524
 
12525
    @Override
12526
    public int hashCode() {
12527
      return 0;
12528
    }
12529
 
12530
    public int compareTo(deleteCoupon_args other) {
12531
      if (!getClass().equals(other.getClass())) {
12532
        return getClass().getName().compareTo(other.getClass().getName());
12533
      }
12534
 
12535
      int lastComparison = 0;
12536
      deleteCoupon_args typedOther = (deleteCoupon_args)other;
12537
 
12538
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
12539
      if (lastComparison != 0) {
12540
        return lastComparison;
12541
      }
12542
      if (isSetCouponCode()) {
12543
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
12544
        if (lastComparison != 0) {
12545
          return lastComparison;
12546
        }
12547
      }
12548
      return 0;
12549
    }
12550
 
12551
    public _Fields fieldForId(int fieldId) {
12552
      return _Fields.findByThriftId(fieldId);
12553
    }
12554
 
12555
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12556
      org.apache.thrift.protocol.TField field;
12557
      iprot.readStructBegin();
12558
      while (true)
12559
      {
12560
        field = iprot.readFieldBegin();
12561
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12562
          break;
12563
        }
12564
        switch (field.id) {
12565
          case 1: // COUPON_CODE
12566
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
12567
              this.couponCode = iprot.readString();
12568
            } else { 
12569
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12570
            }
12571
            break;
12572
          default:
12573
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12574
        }
12575
        iprot.readFieldEnd();
12576
      }
12577
      iprot.readStructEnd();
12578
      validate();
12579
    }
12580
 
12581
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12582
      validate();
12583
 
12584
      oprot.writeStructBegin(STRUCT_DESC);
12585
      if (this.couponCode != null) {
12586
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
12587
        oprot.writeString(this.couponCode);
12588
        oprot.writeFieldEnd();
12589
      }
12590
      oprot.writeFieldStop();
12591
      oprot.writeStructEnd();
12592
    }
12593
 
12594
    @Override
12595
    public String toString() {
12596
      StringBuilder sb = new StringBuilder("deleteCoupon_args(");
12597
      boolean first = true;
12598
 
12599
      sb.append("couponCode:");
12600
      if (this.couponCode == null) {
12601
        sb.append("null");
12602
      } else {
12603
        sb.append(this.couponCode);
12604
      }
12605
      first = false;
12606
      sb.append(")");
12607
      return sb.toString();
12608
    }
12609
 
12610
    public void validate() throws org.apache.thrift.TException {
12611
      // check for required fields
12612
    }
12613
 
12614
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12615
      try {
12616
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12617
      } catch (org.apache.thrift.TException te) {
12618
        throw new java.io.IOException(te);
12619
      }
12620
    }
12621
 
12622
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12623
      try {
12624
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12625
      } catch (org.apache.thrift.TException te) {
12626
        throw new java.io.IOException(te);
12627
      }
12628
    }
12629
 
12630
  }
12631
 
12632
  public static class deleteCoupon_result implements org.apache.thrift.TBase<deleteCoupon_result, deleteCoupon_result._Fields>, java.io.Serializable, Cloneable   {
12633
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteCoupon_result");
12634
 
12635
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
12636
 
12637
    private PromotionException pex; // required
12638
 
12639
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12640
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12641
      PEX((short)1, "pex");
12642
 
12643
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12644
 
12645
      static {
12646
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12647
          byName.put(field.getFieldName(), field);
12648
        }
12649
      }
12650
 
12651
      /**
12652
       * Find the _Fields constant that matches fieldId, or null if its not found.
12653
       */
12654
      public static _Fields findByThriftId(int fieldId) {
12655
        switch(fieldId) {
12656
          case 1: // PEX
12657
            return PEX;
12658
          default:
12659
            return null;
12660
        }
12661
      }
12662
 
12663
      /**
12664
       * Find the _Fields constant that matches fieldId, throwing an exception
12665
       * if it is not found.
12666
       */
12667
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12668
        _Fields fields = findByThriftId(fieldId);
12669
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12670
        return fields;
12671
      }
12672
 
12673
      /**
12674
       * Find the _Fields constant that matches name, or null if its not found.
12675
       */
12676
      public static _Fields findByName(String name) {
12677
        return byName.get(name);
12678
      }
12679
 
12680
      private final short _thriftId;
12681
      private final String _fieldName;
12682
 
12683
      _Fields(short thriftId, String fieldName) {
12684
        _thriftId = thriftId;
12685
        _fieldName = fieldName;
12686
      }
12687
 
12688
      public short getThriftFieldId() {
12689
        return _thriftId;
12690
      }
12691
 
12692
      public String getFieldName() {
12693
        return _fieldName;
12694
      }
12695
    }
12696
 
12697
    // isset id assignments
12698
 
12699
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12700
    static {
12701
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12702
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12703
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
12704
      metaDataMap = Collections.unmodifiableMap(tmpMap);
12705
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteCoupon_result.class, metaDataMap);
12706
    }
12707
 
12708
    public deleteCoupon_result() {
12709
    }
12710
 
12711
    public deleteCoupon_result(
12712
      PromotionException pex)
12713
    {
12714
      this();
12715
      this.pex = pex;
12716
    }
12717
 
12718
    /**
12719
     * Performs a deep copy on <i>other</i>.
12720
     */
12721
    public deleteCoupon_result(deleteCoupon_result other) {
12722
      if (other.isSetPex()) {
12723
        this.pex = new PromotionException(other.pex);
12724
      }
12725
    }
12726
 
12727
    public deleteCoupon_result deepCopy() {
12728
      return new deleteCoupon_result(this);
12729
    }
12730
 
12731
    @Override
12732
    public void clear() {
12733
      this.pex = null;
12734
    }
12735
 
12736
    public PromotionException getPex() {
12737
      return this.pex;
12738
    }
12739
 
12740
    public void setPex(PromotionException pex) {
12741
      this.pex = pex;
12742
    }
12743
 
12744
    public void unsetPex() {
12745
      this.pex = null;
12746
    }
12747
 
12748
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
12749
    public boolean isSetPex() {
12750
      return this.pex != null;
12751
    }
12752
 
12753
    public void setPexIsSet(boolean value) {
12754
      if (!value) {
12755
        this.pex = null;
12756
      }
12757
    }
12758
 
12759
    public void setFieldValue(_Fields field, Object value) {
12760
      switch (field) {
12761
      case PEX:
12762
        if (value == null) {
12763
          unsetPex();
12764
        } else {
12765
          setPex((PromotionException)value);
12766
        }
12767
        break;
12768
 
12769
      }
12770
    }
12771
 
12772
    public Object getFieldValue(_Fields field) {
12773
      switch (field) {
12774
      case PEX:
12775
        return getPex();
12776
 
12777
      }
12778
      throw new IllegalStateException();
12779
    }
12780
 
12781
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
12782
    public boolean isSet(_Fields field) {
12783
      if (field == null) {
12784
        throw new IllegalArgumentException();
12785
      }
12786
 
12787
      switch (field) {
12788
      case PEX:
12789
        return isSetPex();
12790
      }
12791
      throw new IllegalStateException();
12792
    }
12793
 
12794
    @Override
12795
    public boolean equals(Object that) {
12796
      if (that == null)
12797
        return false;
12798
      if (that instanceof deleteCoupon_result)
12799
        return this.equals((deleteCoupon_result)that);
12800
      return false;
12801
    }
12802
 
12803
    public boolean equals(deleteCoupon_result that) {
12804
      if (that == null)
12805
        return false;
12806
 
12807
      boolean this_present_pex = true && this.isSetPex();
12808
      boolean that_present_pex = true && that.isSetPex();
12809
      if (this_present_pex || that_present_pex) {
12810
        if (!(this_present_pex && that_present_pex))
12811
          return false;
12812
        if (!this.pex.equals(that.pex))
12813
          return false;
12814
      }
12815
 
12816
      return true;
12817
    }
12818
 
12819
    @Override
12820
    public int hashCode() {
12821
      return 0;
12822
    }
12823
 
12824
    public int compareTo(deleteCoupon_result other) {
12825
      if (!getClass().equals(other.getClass())) {
12826
        return getClass().getName().compareTo(other.getClass().getName());
12827
      }
12828
 
12829
      int lastComparison = 0;
12830
      deleteCoupon_result typedOther = (deleteCoupon_result)other;
12831
 
12832
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
12833
      if (lastComparison != 0) {
12834
        return lastComparison;
12835
      }
12836
      if (isSetPex()) {
12837
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
12838
        if (lastComparison != 0) {
12839
          return lastComparison;
12840
        }
12841
      }
12842
      return 0;
12843
    }
12844
 
12845
    public _Fields fieldForId(int fieldId) {
12846
      return _Fields.findByThriftId(fieldId);
12847
    }
12848
 
12849
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
12850
      org.apache.thrift.protocol.TField field;
12851
      iprot.readStructBegin();
12852
      while (true)
12853
      {
12854
        field = iprot.readFieldBegin();
12855
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
12856
          break;
12857
        }
12858
        switch (field.id) {
12859
          case 1: // PEX
12860
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
12861
              this.pex = new PromotionException();
12862
              this.pex.read(iprot);
12863
            } else { 
12864
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12865
            }
12866
            break;
12867
          default:
12868
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
12869
        }
12870
        iprot.readFieldEnd();
12871
      }
12872
      iprot.readStructEnd();
12873
      validate();
12874
    }
12875
 
12876
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
12877
      oprot.writeStructBegin(STRUCT_DESC);
12878
 
12879
      if (this.isSetPex()) {
12880
        oprot.writeFieldBegin(PEX_FIELD_DESC);
12881
        this.pex.write(oprot);
12882
        oprot.writeFieldEnd();
12883
      }
12884
      oprot.writeFieldStop();
12885
      oprot.writeStructEnd();
12886
    }
12887
 
12888
    @Override
12889
    public String toString() {
12890
      StringBuilder sb = new StringBuilder("deleteCoupon_result(");
12891
      boolean first = true;
12892
 
12893
      sb.append("pex:");
12894
      if (this.pex == null) {
12895
        sb.append("null");
12896
      } else {
12897
        sb.append(this.pex);
12898
      }
12899
      first = false;
12900
      sb.append(")");
12901
      return sb.toString();
12902
    }
12903
 
12904
    public void validate() throws org.apache.thrift.TException {
12905
      // check for required fields
12906
    }
12907
 
12908
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
12909
      try {
12910
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
12911
      } catch (org.apache.thrift.TException te) {
12912
        throw new java.io.IOException(te);
12913
      }
12914
    }
12915
 
12916
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
12917
      try {
12918
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
12919
      } catch (org.apache.thrift.TException te) {
12920
        throw new java.io.IOException(te);
12921
      }
12922
    }
12923
 
12924
  }
12925
 
7092 amit.gupta 12926
  public static class getAllCouponsByPromotionId_args implements org.apache.thrift.TBase<getAllCouponsByPromotionId_args, getAllCouponsByPromotionId_args._Fields>, java.io.Serializable, Cloneable   {
12927
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllCouponsByPromotionId_args");
12928
 
12929
    private static final org.apache.thrift.protocol.TField PROMOTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("promotionId", org.apache.thrift.protocol.TType.I64, (short)1);
12930
 
12931
    private long promotionId; // required
12932
 
12933
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
12934
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
12935
      PROMOTION_ID((short)1, "promotionId");
12936
 
12937
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
12938
 
12939
      static {
12940
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
12941
          byName.put(field.getFieldName(), field);
12942
        }
12943
      }
12944
 
12945
      /**
12946
       * Find the _Fields constant that matches fieldId, or null if its not found.
12947
       */
12948
      public static _Fields findByThriftId(int fieldId) {
12949
        switch(fieldId) {
12950
          case 1: // PROMOTION_ID
12951
            return PROMOTION_ID;
12952
          default:
12953
            return null;
12954
        }
12955
      }
12956
 
12957
      /**
12958
       * Find the _Fields constant that matches fieldId, throwing an exception
12959
       * if it is not found.
12960
       */
12961
      public static _Fields findByThriftIdOrThrow(int fieldId) {
12962
        _Fields fields = findByThriftId(fieldId);
12963
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
12964
        return fields;
12965
      }
12966
 
12967
      /**
12968
       * Find the _Fields constant that matches name, or null if its not found.
12969
       */
12970
      public static _Fields findByName(String name) {
12971
        return byName.get(name);
12972
      }
12973
 
12974
      private final short _thriftId;
12975
      private final String _fieldName;
12976
 
12977
      _Fields(short thriftId, String fieldName) {
12978
        _thriftId = thriftId;
12979
        _fieldName = fieldName;
12980
      }
12981
 
12982
      public short getThriftFieldId() {
12983
        return _thriftId;
12984
      }
12985
 
12986
      public String getFieldName() {
12987
        return _fieldName;
12988
      }
12989
    }
12990
 
12991
    // isset id assignments
12992
    private static final int __PROMOTIONID_ISSET_ID = 0;
12993
    private BitSet __isset_bit_vector = new BitSet(1);
12994
 
12995
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
12996
    static {
12997
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
12998
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
12999
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
13000
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13001
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllCouponsByPromotionId_args.class, metaDataMap);
13002
    }
13003
 
13004
    public getAllCouponsByPromotionId_args() {
13005
    }
13006
 
13007
    public getAllCouponsByPromotionId_args(
13008
      long promotionId)
13009
    {
13010
      this();
13011
      this.promotionId = promotionId;
13012
      setPromotionIdIsSet(true);
13013
    }
13014
 
13015
    /**
13016
     * Performs a deep copy on <i>other</i>.
13017
     */
13018
    public getAllCouponsByPromotionId_args(getAllCouponsByPromotionId_args other) {
13019
      __isset_bit_vector.clear();
13020
      __isset_bit_vector.or(other.__isset_bit_vector);
13021
      this.promotionId = other.promotionId;
13022
    }
13023
 
13024
    public getAllCouponsByPromotionId_args deepCopy() {
13025
      return new getAllCouponsByPromotionId_args(this);
13026
    }
13027
 
13028
    @Override
13029
    public void clear() {
13030
      setPromotionIdIsSet(false);
13031
      this.promotionId = 0;
13032
    }
13033
 
13034
    public long getPromotionId() {
13035
      return this.promotionId;
13036
    }
13037
 
13038
    public void setPromotionId(long promotionId) {
13039
      this.promotionId = promotionId;
13040
      setPromotionIdIsSet(true);
13041
    }
13042
 
13043
    public void unsetPromotionId() {
13044
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
13045
    }
13046
 
13047
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
13048
    public boolean isSetPromotionId() {
13049
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
13050
    }
13051
 
13052
    public void setPromotionIdIsSet(boolean value) {
13053
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
13054
    }
13055
 
13056
    public void setFieldValue(_Fields field, Object value) {
13057
      switch (field) {
13058
      case PROMOTION_ID:
13059
        if (value == null) {
13060
          unsetPromotionId();
13061
        } else {
13062
          setPromotionId((Long)value);
13063
        }
13064
        break;
13065
 
13066
      }
13067
    }
13068
 
13069
    public Object getFieldValue(_Fields field) {
13070
      switch (field) {
13071
      case PROMOTION_ID:
13072
        return Long.valueOf(getPromotionId());
13073
 
13074
      }
13075
      throw new IllegalStateException();
13076
    }
13077
 
13078
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13079
    public boolean isSet(_Fields field) {
13080
      if (field == null) {
13081
        throw new IllegalArgumentException();
13082
      }
13083
 
13084
      switch (field) {
13085
      case PROMOTION_ID:
13086
        return isSetPromotionId();
13087
      }
13088
      throw new IllegalStateException();
13089
    }
13090
 
13091
    @Override
13092
    public boolean equals(Object that) {
13093
      if (that == null)
13094
        return false;
13095
      if (that instanceof getAllCouponsByPromotionId_args)
13096
        return this.equals((getAllCouponsByPromotionId_args)that);
13097
      return false;
13098
    }
13099
 
13100
    public boolean equals(getAllCouponsByPromotionId_args that) {
13101
      if (that == null)
13102
        return false;
13103
 
13104
      boolean this_present_promotionId = true;
13105
      boolean that_present_promotionId = true;
13106
      if (this_present_promotionId || that_present_promotionId) {
13107
        if (!(this_present_promotionId && that_present_promotionId))
13108
          return false;
13109
        if (this.promotionId != that.promotionId)
13110
          return false;
13111
      }
13112
 
13113
      return true;
13114
    }
13115
 
13116
    @Override
13117
    public int hashCode() {
13118
      return 0;
13119
    }
13120
 
13121
    public int compareTo(getAllCouponsByPromotionId_args other) {
13122
      if (!getClass().equals(other.getClass())) {
13123
        return getClass().getName().compareTo(other.getClass().getName());
13124
      }
13125
 
13126
      int lastComparison = 0;
13127
      getAllCouponsByPromotionId_args typedOther = (getAllCouponsByPromotionId_args)other;
13128
 
13129
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
13130
      if (lastComparison != 0) {
13131
        return lastComparison;
13132
      }
13133
      if (isSetPromotionId()) {
13134
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
13135
        if (lastComparison != 0) {
13136
          return lastComparison;
13137
        }
13138
      }
13139
      return 0;
13140
    }
13141
 
13142
    public _Fields fieldForId(int fieldId) {
13143
      return _Fields.findByThriftId(fieldId);
13144
    }
13145
 
13146
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13147
      org.apache.thrift.protocol.TField field;
13148
      iprot.readStructBegin();
13149
      while (true)
13150
      {
13151
        field = iprot.readFieldBegin();
13152
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
13153
          break;
13154
        }
13155
        switch (field.id) {
13156
          case 1: // PROMOTION_ID
13157
            if (field.type == org.apache.thrift.protocol.TType.I64) {
13158
              this.promotionId = iprot.readI64();
13159
              setPromotionIdIsSet(true);
13160
            } else { 
13161
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13162
            }
13163
            break;
13164
          default:
13165
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13166
        }
13167
        iprot.readFieldEnd();
13168
      }
13169
      iprot.readStructEnd();
13170
      validate();
13171
    }
13172
 
13173
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
13174
      validate();
13175
 
13176
      oprot.writeStructBegin(STRUCT_DESC);
13177
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
13178
      oprot.writeI64(this.promotionId);
13179
      oprot.writeFieldEnd();
13180
      oprot.writeFieldStop();
13181
      oprot.writeStructEnd();
13182
    }
13183
 
13184
    @Override
13185
    public String toString() {
13186
      StringBuilder sb = new StringBuilder("getAllCouponsByPromotionId_args(");
13187
      boolean first = true;
13188
 
13189
      sb.append("promotionId:");
13190
      sb.append(this.promotionId);
13191
      first = false;
13192
      sb.append(")");
13193
      return sb.toString();
13194
    }
13195
 
13196
    public void validate() throws org.apache.thrift.TException {
13197
      // check for required fields
13198
    }
13199
 
13200
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13201
      try {
13202
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13203
      } catch (org.apache.thrift.TException te) {
13204
        throw new java.io.IOException(te);
13205
      }
13206
    }
13207
 
13208
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13209
      try {
13210
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
13211
        __isset_bit_vector = new BitSet(1);
13212
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13213
      } catch (org.apache.thrift.TException te) {
13214
        throw new java.io.IOException(te);
13215
      }
13216
    }
13217
 
13218
  }
13219
 
13220
  public static class getAllCouponsByPromotionId_result implements org.apache.thrift.TBase<getAllCouponsByPromotionId_result, getAllCouponsByPromotionId_result._Fields>, java.io.Serializable, Cloneable   {
13221
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllCouponsByPromotionId_result");
13222
 
13223
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
13224
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
13225
 
13226
    private List<Coupon> success; // required
13227
    private PromotionException pex; // required
13228
 
13229
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
13230
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
13231
      SUCCESS((short)0, "success"),
13232
      PEX((short)1, "pex");
13233
 
13234
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13235
 
13236
      static {
13237
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13238
          byName.put(field.getFieldName(), field);
13239
        }
13240
      }
13241
 
13242
      /**
13243
       * Find the _Fields constant that matches fieldId, or null if its not found.
13244
       */
13245
      public static _Fields findByThriftId(int fieldId) {
13246
        switch(fieldId) {
13247
          case 0: // SUCCESS
13248
            return SUCCESS;
13249
          case 1: // PEX
13250
            return PEX;
13251
          default:
13252
            return null;
13253
        }
13254
      }
13255
 
13256
      /**
13257
       * Find the _Fields constant that matches fieldId, throwing an exception
13258
       * if it is not found.
13259
       */
13260
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13261
        _Fields fields = findByThriftId(fieldId);
13262
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13263
        return fields;
13264
      }
13265
 
13266
      /**
13267
       * Find the _Fields constant that matches name, or null if its not found.
13268
       */
13269
      public static _Fields findByName(String name) {
13270
        return byName.get(name);
13271
      }
13272
 
13273
      private final short _thriftId;
13274
      private final String _fieldName;
13275
 
13276
      _Fields(short thriftId, String fieldName) {
13277
        _thriftId = thriftId;
13278
        _fieldName = fieldName;
13279
      }
13280
 
13281
      public short getThriftFieldId() {
13282
        return _thriftId;
13283
      }
13284
 
13285
      public String getFieldName() {
13286
        return _fieldName;
13287
      }
13288
    }
13289
 
13290
    // isset id assignments
13291
 
13292
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
13293
    static {
13294
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13295
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13296
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
13297
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
13298
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13299
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
13300
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13301
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllCouponsByPromotionId_result.class, metaDataMap);
13302
    }
13303
 
13304
    public getAllCouponsByPromotionId_result() {
13305
    }
13306
 
13307
    public getAllCouponsByPromotionId_result(
13308
      List<Coupon> success,
13309
      PromotionException pex)
13310
    {
13311
      this();
13312
      this.success = success;
13313
      this.pex = pex;
13314
    }
13315
 
13316
    /**
13317
     * Performs a deep copy on <i>other</i>.
13318
     */
13319
    public getAllCouponsByPromotionId_result(getAllCouponsByPromotionId_result other) {
13320
      if (other.isSetSuccess()) {
13321
        List<Coupon> __this__success = new ArrayList<Coupon>();
13322
        for (Coupon other_element : other.success) {
13323
          __this__success.add(new Coupon(other_element));
13324
        }
13325
        this.success = __this__success;
13326
      }
13327
      if (other.isSetPex()) {
13328
        this.pex = new PromotionException(other.pex);
13329
      }
13330
    }
13331
 
13332
    public getAllCouponsByPromotionId_result deepCopy() {
13333
      return new getAllCouponsByPromotionId_result(this);
13334
    }
13335
 
13336
    @Override
13337
    public void clear() {
13338
      this.success = null;
13339
      this.pex = null;
13340
    }
13341
 
13342
    public int getSuccessSize() {
13343
      return (this.success == null) ? 0 : this.success.size();
13344
    }
13345
 
13346
    public java.util.Iterator<Coupon> getSuccessIterator() {
13347
      return (this.success == null) ? null : this.success.iterator();
13348
    }
13349
 
13350
    public void addToSuccess(Coupon elem) {
13351
      if (this.success == null) {
13352
        this.success = new ArrayList<Coupon>();
13353
      }
13354
      this.success.add(elem);
13355
    }
13356
 
13357
    public List<Coupon> getSuccess() {
13358
      return this.success;
13359
    }
13360
 
13361
    public void setSuccess(List<Coupon> success) {
13362
      this.success = success;
13363
    }
13364
 
13365
    public void unsetSuccess() {
13366
      this.success = null;
13367
    }
13368
 
13369
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
13370
    public boolean isSetSuccess() {
13371
      return this.success != null;
13372
    }
13373
 
13374
    public void setSuccessIsSet(boolean value) {
13375
      if (!value) {
13376
        this.success = null;
13377
      }
13378
    }
13379
 
13380
    public PromotionException getPex() {
13381
      return this.pex;
13382
    }
13383
 
13384
    public void setPex(PromotionException pex) {
13385
      this.pex = pex;
13386
    }
13387
 
13388
    public void unsetPex() {
13389
      this.pex = null;
13390
    }
13391
 
13392
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
13393
    public boolean isSetPex() {
13394
      return this.pex != null;
13395
    }
13396
 
13397
    public void setPexIsSet(boolean value) {
13398
      if (!value) {
13399
        this.pex = null;
13400
      }
13401
    }
13402
 
13403
    public void setFieldValue(_Fields field, Object value) {
13404
      switch (field) {
13405
      case SUCCESS:
13406
        if (value == null) {
13407
          unsetSuccess();
13408
        } else {
13409
          setSuccess((List<Coupon>)value);
13410
        }
13411
        break;
13412
 
13413
      case PEX:
13414
        if (value == null) {
13415
          unsetPex();
13416
        } else {
13417
          setPex((PromotionException)value);
13418
        }
13419
        break;
13420
 
13421
      }
13422
    }
13423
 
13424
    public Object getFieldValue(_Fields field) {
13425
      switch (field) {
13426
      case SUCCESS:
13427
        return getSuccess();
13428
 
13429
      case PEX:
13430
        return getPex();
13431
 
13432
      }
13433
      throw new IllegalStateException();
13434
    }
13435
 
13436
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13437
    public boolean isSet(_Fields field) {
13438
      if (field == null) {
13439
        throw new IllegalArgumentException();
13440
      }
13441
 
13442
      switch (field) {
13443
      case SUCCESS:
13444
        return isSetSuccess();
13445
      case PEX:
13446
        return isSetPex();
13447
      }
13448
      throw new IllegalStateException();
13449
    }
13450
 
13451
    @Override
13452
    public boolean equals(Object that) {
13453
      if (that == null)
13454
        return false;
13455
      if (that instanceof getAllCouponsByPromotionId_result)
13456
        return this.equals((getAllCouponsByPromotionId_result)that);
13457
      return false;
13458
    }
13459
 
13460
    public boolean equals(getAllCouponsByPromotionId_result that) {
13461
      if (that == null)
13462
        return false;
13463
 
13464
      boolean this_present_success = true && this.isSetSuccess();
13465
      boolean that_present_success = true && that.isSetSuccess();
13466
      if (this_present_success || that_present_success) {
13467
        if (!(this_present_success && that_present_success))
13468
          return false;
13469
        if (!this.success.equals(that.success))
13470
          return false;
13471
      }
13472
 
13473
      boolean this_present_pex = true && this.isSetPex();
13474
      boolean that_present_pex = true && that.isSetPex();
13475
      if (this_present_pex || that_present_pex) {
13476
        if (!(this_present_pex && that_present_pex))
13477
          return false;
13478
        if (!this.pex.equals(that.pex))
13479
          return false;
13480
      }
13481
 
13482
      return true;
13483
    }
13484
 
13485
    @Override
13486
    public int hashCode() {
13487
      return 0;
13488
    }
13489
 
13490
    public int compareTo(getAllCouponsByPromotionId_result other) {
13491
      if (!getClass().equals(other.getClass())) {
13492
        return getClass().getName().compareTo(other.getClass().getName());
13493
      }
13494
 
13495
      int lastComparison = 0;
13496
      getAllCouponsByPromotionId_result typedOther = (getAllCouponsByPromotionId_result)other;
13497
 
13498
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
13499
      if (lastComparison != 0) {
13500
        return lastComparison;
13501
      }
13502
      if (isSetSuccess()) {
13503
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
13504
        if (lastComparison != 0) {
13505
          return lastComparison;
13506
        }
13507
      }
13508
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
13509
      if (lastComparison != 0) {
13510
        return lastComparison;
13511
      }
13512
      if (isSetPex()) {
13513
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
13514
        if (lastComparison != 0) {
13515
          return lastComparison;
13516
        }
13517
      }
13518
      return 0;
13519
    }
13520
 
13521
    public _Fields fieldForId(int fieldId) {
13522
      return _Fields.findByThriftId(fieldId);
13523
    }
13524
 
13525
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13526
      org.apache.thrift.protocol.TField field;
13527
      iprot.readStructBegin();
13528
      while (true)
13529
      {
13530
        field = iprot.readFieldBegin();
13531
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
13532
          break;
13533
        }
13534
        switch (field.id) {
13535
          case 0: // SUCCESS
13536
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
13537
              {
13538
                org.apache.thrift.protocol.TList _list30 = iprot.readListBegin();
13539
                this.success = new ArrayList<Coupon>(_list30.size);
13540
                for (int _i31 = 0; _i31 < _list30.size; ++_i31)
13541
                {
13542
                  Coupon _elem32; // required
13543
                  _elem32 = new Coupon();
13544
                  _elem32.read(iprot);
13545
                  this.success.add(_elem32);
13546
                }
13547
                iprot.readListEnd();
13548
              }
13549
            } else { 
13550
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13551
            }
13552
            break;
13553
          case 1: // PEX
13554
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
13555
              this.pex = new PromotionException();
13556
              this.pex.read(iprot);
13557
            } else { 
13558
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13559
            }
13560
            break;
13561
          default:
13562
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
13563
        }
13564
        iprot.readFieldEnd();
13565
      }
13566
      iprot.readStructEnd();
13567
      validate();
13568
    }
13569
 
13570
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
13571
      oprot.writeStructBegin(STRUCT_DESC);
13572
 
13573
      if (this.isSetSuccess()) {
13574
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
13575
        {
13576
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
13577
          for (Coupon _iter33 : this.success)
13578
          {
13579
            _iter33.write(oprot);
13580
          }
13581
          oprot.writeListEnd();
13582
        }
13583
        oprot.writeFieldEnd();
13584
      } else if (this.isSetPex()) {
13585
        oprot.writeFieldBegin(PEX_FIELD_DESC);
13586
        this.pex.write(oprot);
13587
        oprot.writeFieldEnd();
13588
      }
13589
      oprot.writeFieldStop();
13590
      oprot.writeStructEnd();
13591
    }
13592
 
13593
    @Override
13594
    public String toString() {
13595
      StringBuilder sb = new StringBuilder("getAllCouponsByPromotionId_result(");
13596
      boolean first = true;
13597
 
13598
      sb.append("success:");
13599
      if (this.success == null) {
13600
        sb.append("null");
13601
      } else {
13602
        sb.append(this.success);
13603
      }
13604
      first = false;
13605
      if (!first) sb.append(", ");
13606
      sb.append("pex:");
13607
      if (this.pex == null) {
13608
        sb.append("null");
13609
      } else {
13610
        sb.append(this.pex);
13611
      }
13612
      first = false;
13613
      sb.append(")");
13614
      return sb.toString();
13615
    }
13616
 
13617
    public void validate() throws org.apache.thrift.TException {
13618
      // check for required fields
13619
    }
13620
 
13621
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13622
      try {
13623
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13624
      } catch (org.apache.thrift.TException te) {
13625
        throw new java.io.IOException(te);
13626
      }
13627
    }
13628
 
13629
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13630
      try {
13631
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13632
      } catch (org.apache.thrift.TException te) {
13633
        throw new java.io.IOException(te);
13634
      }
13635
    }
13636
 
13637
  }
13638
 
3430 rajveer 13639
  public static class getActiveCoupons_args implements org.apache.thrift.TBase<getActiveCoupons_args, getActiveCoupons_args._Fields>, java.io.Serializable, Cloneable   {
13640
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_args");
3385 varun.gupt 13641
 
13642
 
13643
 
13644
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 13645
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 13646
;
13647
 
13648
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13649
 
13650
      static {
13651
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13652
          byName.put(field.getFieldName(), field);
13653
        }
13654
      }
13655
 
13656
      /**
13657
       * Find the _Fields constant that matches fieldId, or null if its not found.
13658
       */
13659
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 13660
        switch(fieldId) {
13661
          default:
13662
            return null;
13663
        }
3385 varun.gupt 13664
      }
13665
 
13666
      /**
13667
       * Find the _Fields constant that matches fieldId, throwing an exception
13668
       * if it is not found.
13669
       */
13670
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13671
        _Fields fields = findByThriftId(fieldId);
13672
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13673
        return fields;
13674
      }
13675
 
13676
      /**
13677
       * Find the _Fields constant that matches name, or null if its not found.
13678
       */
13679
      public static _Fields findByName(String name) {
13680
        return byName.get(name);
13681
      }
13682
 
13683
      private final short _thriftId;
13684
      private final String _fieldName;
13685
 
13686
      _Fields(short thriftId, String fieldName) {
13687
        _thriftId = thriftId;
13688
        _fieldName = fieldName;
13689
      }
13690
 
13691
      public short getThriftFieldId() {
13692
        return _thriftId;
13693
      }
13694
 
13695
      public String getFieldName() {
13696
        return _fieldName;
13697
      }
13698
    }
3430 rajveer 13699
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 13700
    static {
3430 rajveer 13701
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13702
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13703
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_args.class, metaDataMap);
3385 varun.gupt 13704
    }
13705
 
13706
    public getActiveCoupons_args() {
13707
    }
13708
 
13709
    /**
13710
     * Performs a deep copy on <i>other</i>.
13711
     */
13712
    public getActiveCoupons_args(getActiveCoupons_args other) {
13713
    }
13714
 
13715
    public getActiveCoupons_args deepCopy() {
13716
      return new getActiveCoupons_args(this);
13717
    }
13718
 
3430 rajveer 13719
    @Override
13720
    public void clear() {
3385 varun.gupt 13721
    }
13722
 
13723
    public void setFieldValue(_Fields field, Object value) {
13724
      switch (field) {
13725
      }
13726
    }
13727
 
13728
    public Object getFieldValue(_Fields field) {
13729
      switch (field) {
13730
      }
13731
      throw new IllegalStateException();
13732
    }
13733
 
3430 rajveer 13734
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
13735
    public boolean isSet(_Fields field) {
13736
      if (field == null) {
13737
        throw new IllegalArgumentException();
13738
      }
3385 varun.gupt 13739
 
13740
      switch (field) {
13741
      }
13742
      throw new IllegalStateException();
13743
    }
13744
 
13745
    @Override
13746
    public boolean equals(Object that) {
13747
      if (that == null)
13748
        return false;
13749
      if (that instanceof getActiveCoupons_args)
13750
        return this.equals((getActiveCoupons_args)that);
13751
      return false;
13752
    }
13753
 
13754
    public boolean equals(getActiveCoupons_args that) {
13755
      if (that == null)
13756
        return false;
13757
 
13758
      return true;
13759
    }
13760
 
13761
    @Override
13762
    public int hashCode() {
13763
      return 0;
13764
    }
13765
 
13766
    public int compareTo(getActiveCoupons_args other) {
13767
      if (!getClass().equals(other.getClass())) {
13768
        return getClass().getName().compareTo(other.getClass().getName());
13769
      }
13770
 
13771
      int lastComparison = 0;
13772
      getActiveCoupons_args typedOther = (getActiveCoupons_args)other;
13773
 
13774
      return 0;
13775
    }
13776
 
3430 rajveer 13777
    public _Fields fieldForId(int fieldId) {
13778
      return _Fields.findByThriftId(fieldId);
13779
    }
13780
 
13781
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
13782
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 13783
      iprot.readStructBegin();
13784
      while (true)
13785
      {
13786
        field = iprot.readFieldBegin();
3430 rajveer 13787
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 13788
          break;
13789
        }
3430 rajveer 13790
        switch (field.id) {
13791
          default:
13792
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 13793
        }
3430 rajveer 13794
        iprot.readFieldEnd();
3385 varun.gupt 13795
      }
13796
      iprot.readStructEnd();
13797
      validate();
13798
    }
13799
 
3430 rajveer 13800
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 13801
      validate();
13802
 
13803
      oprot.writeStructBegin(STRUCT_DESC);
13804
      oprot.writeFieldStop();
13805
      oprot.writeStructEnd();
13806
    }
13807
 
13808
    @Override
13809
    public String toString() {
13810
      StringBuilder sb = new StringBuilder("getActiveCoupons_args(");
13811
      boolean first = true;
13812
 
13813
      sb.append(")");
13814
      return sb.toString();
13815
    }
13816
 
3430 rajveer 13817
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 13818
      // check for required fields
13819
    }
13820
 
3430 rajveer 13821
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
13822
      try {
13823
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
13824
      } catch (org.apache.thrift.TException te) {
13825
        throw new java.io.IOException(te);
13826
      }
13827
    }
13828
 
13829
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
13830
      try {
13831
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
13832
      } catch (org.apache.thrift.TException te) {
13833
        throw new java.io.IOException(te);
13834
      }
13835
    }
13836
 
3385 varun.gupt 13837
  }
13838
 
3430 rajveer 13839
  public static class getActiveCoupons_result implements org.apache.thrift.TBase<getActiveCoupons_result, getActiveCoupons_result._Fields>, java.io.Serializable, Cloneable   {
13840
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getActiveCoupons_result");
3385 varun.gupt 13841
 
3430 rajveer 13842
    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
13843
    private static final org.apache.thrift.protocol.TField PEX_FIELD_DESC = new org.apache.thrift.protocol.TField("pex", org.apache.thrift.protocol.TType.STRUCT, (short)1);
3385 varun.gupt 13844
 
3430 rajveer 13845
    private List<Coupon> success; // required
13846
    private PromotionException pex; // required
3385 varun.gupt 13847
 
13848
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 13849
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 13850
      SUCCESS((short)0, "success"),
13851
      PEX((short)1, "pex");
13852
 
13853
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
13854
 
13855
      static {
13856
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
13857
          byName.put(field.getFieldName(), field);
13858
        }
13859
      }
13860
 
13861
      /**
13862
       * Find the _Fields constant that matches fieldId, or null if its not found.
13863
       */
13864
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 13865
        switch(fieldId) {
13866
          case 0: // SUCCESS
13867
            return SUCCESS;
13868
          case 1: // PEX
13869
            return PEX;
13870
          default:
13871
            return null;
13872
        }
3385 varun.gupt 13873
      }
13874
 
13875
      /**
13876
       * Find the _Fields constant that matches fieldId, throwing an exception
13877
       * if it is not found.
13878
       */
13879
      public static _Fields findByThriftIdOrThrow(int fieldId) {
13880
        _Fields fields = findByThriftId(fieldId);
13881
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
13882
        return fields;
13883
      }
13884
 
13885
      /**
13886
       * Find the _Fields constant that matches name, or null if its not found.
13887
       */
13888
      public static _Fields findByName(String name) {
13889
        return byName.get(name);
13890
      }
13891
 
13892
      private final short _thriftId;
13893
      private final String _fieldName;
13894
 
13895
      _Fields(short thriftId, String fieldName) {
13896
        _thriftId = thriftId;
13897
        _fieldName = fieldName;
13898
      }
13899
 
13900
      public short getThriftFieldId() {
13901
        return _thriftId;
13902
      }
13903
 
13904
      public String getFieldName() {
13905
        return _fieldName;
13906
      }
13907
    }
13908
 
13909
    // isset id assignments
13910
 
3430 rajveer 13911
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 13912
    static {
3430 rajveer 13913
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
13914
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13915
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
13916
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Coupon.class))));
13917
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
13918
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
13919
      metaDataMap = Collections.unmodifiableMap(tmpMap);
13920
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getActiveCoupons_result.class, metaDataMap);
3385 varun.gupt 13921
    }
13922
 
13923
    public getActiveCoupons_result() {
13924
    }
13925
 
13926
    public getActiveCoupons_result(
13927
      List<Coupon> success,
13928
      PromotionException pex)
13929
    {
13930
      this();
13931
      this.success = success;
13932
      this.pex = pex;
13933
    }
13934
 
13935
    /**
13936
     * Performs a deep copy on <i>other</i>.
13937
     */
13938
    public getActiveCoupons_result(getActiveCoupons_result other) {
13939
      if (other.isSetSuccess()) {
13940
        List<Coupon> __this__success = new ArrayList<Coupon>();
13941
        for (Coupon other_element : other.success) {
13942
          __this__success.add(new Coupon(other_element));
13943
        }
13944
        this.success = __this__success;
13945
      }
13946
      if (other.isSetPex()) {
13947
        this.pex = new PromotionException(other.pex);
13948
      }
13949
    }
13950
 
13951
    public getActiveCoupons_result deepCopy() {
13952
      return new getActiveCoupons_result(this);
13953
    }
13954
 
3430 rajveer 13955
    @Override
13956
    public void clear() {
13957
      this.success = null;
13958
      this.pex = null;
3385 varun.gupt 13959
    }
13960
 
13961
    public int getSuccessSize() {
13962
      return (this.success == null) ? 0 : this.success.size();
13963
    }
13964
 
13965
    public java.util.Iterator<Coupon> getSuccessIterator() {
13966
      return (this.success == null) ? null : this.success.iterator();
13967
    }
13968
 
13969
    public void addToSuccess(Coupon elem) {
13970
      if (this.success == null) {
13971
        this.success = new ArrayList<Coupon>();
13972
      }
13973
      this.success.add(elem);
13974
    }
13975
 
13976
    public List<Coupon> getSuccess() {
13977
      return this.success;
13978
    }
13979
 
3430 rajveer 13980
    public void setSuccess(List<Coupon> success) {
3385 varun.gupt 13981
      this.success = success;
13982
    }
13983
 
13984
    public void unsetSuccess() {
13985
      this.success = null;
13986
    }
13987
 
3430 rajveer 13988
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 13989
    public boolean isSetSuccess() {
13990
      return this.success != null;
13991
    }
13992
 
13993
    public void setSuccessIsSet(boolean value) {
13994
      if (!value) {
13995
        this.success = null;
13996
      }
13997
    }
13998
 
13999
    public PromotionException getPex() {
14000
      return this.pex;
14001
    }
14002
 
3430 rajveer 14003
    public void setPex(PromotionException pex) {
3385 varun.gupt 14004
      this.pex = pex;
14005
    }
14006
 
14007
    public void unsetPex() {
14008
      this.pex = null;
14009
    }
14010
 
3430 rajveer 14011
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 14012
    public boolean isSetPex() {
14013
      return this.pex != null;
14014
    }
14015
 
14016
    public void setPexIsSet(boolean value) {
14017
      if (!value) {
14018
        this.pex = null;
14019
      }
14020
    }
14021
 
14022
    public void setFieldValue(_Fields field, Object value) {
14023
      switch (field) {
14024
      case SUCCESS:
14025
        if (value == null) {
14026
          unsetSuccess();
14027
        } else {
14028
          setSuccess((List<Coupon>)value);
14029
        }
14030
        break;
14031
 
14032
      case PEX:
14033
        if (value == null) {
14034
          unsetPex();
14035
        } else {
14036
          setPex((PromotionException)value);
14037
        }
14038
        break;
14039
 
14040
      }
14041
    }
14042
 
14043
    public Object getFieldValue(_Fields field) {
14044
      switch (field) {
14045
      case SUCCESS:
14046
        return getSuccess();
14047
 
14048
      case PEX:
14049
        return getPex();
14050
 
14051
      }
14052
      throw new IllegalStateException();
14053
    }
14054
 
3430 rajveer 14055
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14056
    public boolean isSet(_Fields field) {
14057
      if (field == null) {
14058
        throw new IllegalArgumentException();
14059
      }
3385 varun.gupt 14060
 
14061
      switch (field) {
14062
      case SUCCESS:
14063
        return isSetSuccess();
14064
      case PEX:
14065
        return isSetPex();
14066
      }
14067
      throw new IllegalStateException();
14068
    }
14069
 
14070
    @Override
14071
    public boolean equals(Object that) {
14072
      if (that == null)
14073
        return false;
14074
      if (that instanceof getActiveCoupons_result)
14075
        return this.equals((getActiveCoupons_result)that);
14076
      return false;
14077
    }
14078
 
14079
    public boolean equals(getActiveCoupons_result that) {
14080
      if (that == null)
14081
        return false;
14082
 
14083
      boolean this_present_success = true && this.isSetSuccess();
14084
      boolean that_present_success = true && that.isSetSuccess();
14085
      if (this_present_success || that_present_success) {
14086
        if (!(this_present_success && that_present_success))
14087
          return false;
14088
        if (!this.success.equals(that.success))
14089
          return false;
14090
      }
14091
 
14092
      boolean this_present_pex = true && this.isSetPex();
14093
      boolean that_present_pex = true && that.isSetPex();
14094
      if (this_present_pex || that_present_pex) {
14095
        if (!(this_present_pex && that_present_pex))
14096
          return false;
14097
        if (!this.pex.equals(that.pex))
14098
          return false;
14099
      }
14100
 
14101
      return true;
14102
    }
14103
 
14104
    @Override
14105
    public int hashCode() {
14106
      return 0;
14107
    }
14108
 
14109
    public int compareTo(getActiveCoupons_result other) {
14110
      if (!getClass().equals(other.getClass())) {
14111
        return getClass().getName().compareTo(other.getClass().getName());
14112
      }
14113
 
14114
      int lastComparison = 0;
14115
      getActiveCoupons_result typedOther = (getActiveCoupons_result)other;
14116
 
3430 rajveer 14117
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 14118
      if (lastComparison != 0) {
14119
        return lastComparison;
14120
      }
3430 rajveer 14121
      if (isSetSuccess()) {
14122
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
14123
        if (lastComparison != 0) {
14124
          return lastComparison;
14125
        }
3385 varun.gupt 14126
      }
3430 rajveer 14127
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 14128
      if (lastComparison != 0) {
14129
        return lastComparison;
14130
      }
3430 rajveer 14131
      if (isSetPex()) {
14132
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
14133
        if (lastComparison != 0) {
14134
          return lastComparison;
14135
        }
3385 varun.gupt 14136
      }
14137
      return 0;
14138
    }
14139
 
3430 rajveer 14140
    public _Fields fieldForId(int fieldId) {
14141
      return _Fields.findByThriftId(fieldId);
14142
    }
14143
 
14144
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14145
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 14146
      iprot.readStructBegin();
14147
      while (true)
14148
      {
14149
        field = iprot.readFieldBegin();
3430 rajveer 14150
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 14151
          break;
14152
        }
3430 rajveer 14153
        switch (field.id) {
14154
          case 0: // SUCCESS
14155
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
14156
              {
7092 amit.gupta 14157
                org.apache.thrift.protocol.TList _list34 = iprot.readListBegin();
14158
                this.success = new ArrayList<Coupon>(_list34.size);
14159
                for (int _i35 = 0; _i35 < _list34.size; ++_i35)
3385 varun.gupt 14160
                {
7092 amit.gupta 14161
                  Coupon _elem36; // required
14162
                  _elem36 = new Coupon();
14163
                  _elem36.read(iprot);
14164
                  this.success.add(_elem36);
3385 varun.gupt 14165
                }
3430 rajveer 14166
                iprot.readListEnd();
3385 varun.gupt 14167
              }
3430 rajveer 14168
            } else { 
14169
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14170
            }
14171
            break;
14172
          case 1: // PEX
14173
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
14174
              this.pex = new PromotionException();
14175
              this.pex.read(iprot);
14176
            } else { 
14177
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14178
            }
14179
            break;
14180
          default:
14181
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 14182
        }
3430 rajveer 14183
        iprot.readFieldEnd();
3385 varun.gupt 14184
      }
14185
      iprot.readStructEnd();
14186
      validate();
14187
    }
14188
 
3430 rajveer 14189
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 14190
      oprot.writeStructBegin(STRUCT_DESC);
14191
 
14192
      if (this.isSetSuccess()) {
14193
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
14194
        {
3430 rajveer 14195
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
7092 amit.gupta 14196
          for (Coupon _iter37 : this.success)
3385 varun.gupt 14197
          {
7092 amit.gupta 14198
            _iter37.write(oprot);
3385 varun.gupt 14199
          }
14200
          oprot.writeListEnd();
14201
        }
14202
        oprot.writeFieldEnd();
14203
      } else if (this.isSetPex()) {
14204
        oprot.writeFieldBegin(PEX_FIELD_DESC);
14205
        this.pex.write(oprot);
14206
        oprot.writeFieldEnd();
14207
      }
14208
      oprot.writeFieldStop();
14209
      oprot.writeStructEnd();
14210
    }
14211
 
14212
    @Override
14213
    public String toString() {
14214
      StringBuilder sb = new StringBuilder("getActiveCoupons_result(");
14215
      boolean first = true;
14216
 
14217
      sb.append("success:");
14218
      if (this.success == null) {
14219
        sb.append("null");
14220
      } else {
14221
        sb.append(this.success);
14222
      }
14223
      first = false;
14224
      if (!first) sb.append(", ");
14225
      sb.append("pex:");
14226
      if (this.pex == null) {
14227
        sb.append("null");
14228
      } else {
14229
        sb.append(this.pex);
14230
      }
14231
      first = false;
14232
      sb.append(")");
14233
      return sb.toString();
14234
    }
14235
 
3430 rajveer 14236
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 14237
      // check for required fields
14238
    }
14239
 
3430 rajveer 14240
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14241
      try {
14242
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14243
      } catch (org.apache.thrift.TException te) {
14244
        throw new java.io.IOException(te);
14245
      }
14246
    }
14247
 
14248
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14249
      try {
14250
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14251
      } catch (org.apache.thrift.TException te) {
14252
        throw new java.io.IOException(te);
14253
      }
14254
    }
14255
 
3385 varun.gupt 14256
  }
14257
 
6250 amit.gupta 14258
  public static class createCoupon_args implements org.apache.thrift.TBase<createCoupon_args, createCoupon_args._Fields>, java.io.Serializable, Cloneable   {
14259
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_args");
14260
 
14261
    private static final org.apache.thrift.protocol.TField PROMOTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("promotionId", org.apache.thrift.protocol.TType.I64, (short)1);
6730 anupam.sin 14262
    private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)2);
14263
    private static final org.apache.thrift.protocol.TField ARGUMENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("arguments", org.apache.thrift.protocol.TType.STRING, (short)3);
14264
    private static final org.apache.thrift.protocol.TField IS_COD_FIELD_DESC = new org.apache.thrift.protocol.TField("isCod", org.apache.thrift.protocol.TType.BOOL, (short)4);
14265
    private static final org.apache.thrift.protocol.TField PREFIX_FIELD_DESC = new org.apache.thrift.protocol.TField("prefix", org.apache.thrift.protocol.TType.STRING, (short)5);
6250 amit.gupta 14266
 
14267
    private long promotionId; // required
6730 anupam.sin 14268
    private String couponCode; // required
6679 anupam.sin 14269
    private String arguments; // required
6356 amit.gupta 14270
    private boolean isCod; // required
6561 amit.gupta 14271
    private String prefix; // required
6250 amit.gupta 14272
 
14273
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14274
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
14275
      PROMOTION_ID((short)1, "promotionId"),
6730 anupam.sin 14276
      COUPON_CODE((short)2, "couponCode"),
14277
      ARGUMENTS((short)3, "arguments"),
14278
      IS_COD((short)4, "isCod"),
14279
      PREFIX((short)5, "prefix");
6250 amit.gupta 14280
 
14281
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14282
 
14283
      static {
14284
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14285
          byName.put(field.getFieldName(), field);
14286
        }
14287
      }
14288
 
14289
      /**
14290
       * Find the _Fields constant that matches fieldId, or null if its not found.
14291
       */
14292
      public static _Fields findByThriftId(int fieldId) {
14293
        switch(fieldId) {
14294
          case 1: // PROMOTION_ID
14295
            return PROMOTION_ID;
6730 anupam.sin 14296
          case 2: // COUPON_CODE
14297
            return COUPON_CODE;
14298
          case 3: // ARGUMENTS
6679 anupam.sin 14299
            return ARGUMENTS;
6730 anupam.sin 14300
          case 4: // IS_COD
6356 amit.gupta 14301
            return IS_COD;
6730 anupam.sin 14302
          case 5: // PREFIX
6561 amit.gupta 14303
            return PREFIX;
6250 amit.gupta 14304
          default:
14305
            return null;
14306
        }
14307
      }
14308
 
14309
      /**
14310
       * Find the _Fields constant that matches fieldId, throwing an exception
14311
       * if it is not found.
14312
       */
14313
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14314
        _Fields fields = findByThriftId(fieldId);
14315
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14316
        return fields;
14317
      }
14318
 
14319
      /**
14320
       * Find the _Fields constant that matches name, or null if its not found.
14321
       */
14322
      public static _Fields findByName(String name) {
14323
        return byName.get(name);
14324
      }
14325
 
14326
      private final short _thriftId;
14327
      private final String _fieldName;
14328
 
14329
      _Fields(short thriftId, String fieldName) {
14330
        _thriftId = thriftId;
14331
        _fieldName = fieldName;
14332
      }
14333
 
14334
      public short getThriftFieldId() {
14335
        return _thriftId;
14336
      }
14337
 
14338
      public String getFieldName() {
14339
        return _fieldName;
14340
      }
14341
    }
14342
 
14343
    // isset id assignments
14344
    private static final int __PROMOTIONID_ISSET_ID = 0;
6679 anupam.sin 14345
    private static final int __ISCOD_ISSET_ID = 1;
14346
    private BitSet __isset_bit_vector = new BitSet(2);
6250 amit.gupta 14347
 
14348
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
14349
    static {
14350
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
14351
      tmpMap.put(_Fields.PROMOTION_ID, new org.apache.thrift.meta_data.FieldMetaData("promotionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14352
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
6730 anupam.sin 14353
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14354
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6679 anupam.sin 14355
      tmpMap.put(_Fields.ARGUMENTS, new org.apache.thrift.meta_data.FieldMetaData("arguments", org.apache.thrift.TFieldRequirementType.DEFAULT, 
6250 amit.gupta 14356
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6356 amit.gupta 14357
      tmpMap.put(_Fields.IS_COD, new org.apache.thrift.meta_data.FieldMetaData("isCod", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14358
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
6561 amit.gupta 14359
      tmpMap.put(_Fields.PREFIX, new org.apache.thrift.meta_data.FieldMetaData("prefix", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14360
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
6250 amit.gupta 14361
      metaDataMap = Collections.unmodifiableMap(tmpMap);
14362
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_args.class, metaDataMap);
14363
    }
14364
 
14365
    public createCoupon_args() {
14366
    }
14367
 
14368
    public createCoupon_args(
14369
      long promotionId,
6730 anupam.sin 14370
      String couponCode,
6679 anupam.sin 14371
      String arguments,
6356 amit.gupta 14372
      boolean isCod,
6561 amit.gupta 14373
      String prefix)
6250 amit.gupta 14374
    {
14375
      this();
14376
      this.promotionId = promotionId;
14377
      setPromotionIdIsSet(true);
6730 anupam.sin 14378
      this.couponCode = couponCode;
6679 anupam.sin 14379
      this.arguments = arguments;
6356 amit.gupta 14380
      this.isCod = isCod;
14381
      setIsCodIsSet(true);
6561 amit.gupta 14382
      this.prefix = prefix;
6250 amit.gupta 14383
    }
14384
 
14385
    /**
14386
     * Performs a deep copy on <i>other</i>.
14387
     */
14388
    public createCoupon_args(createCoupon_args other) {
14389
      __isset_bit_vector.clear();
14390
      __isset_bit_vector.or(other.__isset_bit_vector);
14391
      this.promotionId = other.promotionId;
6730 anupam.sin 14392
      if (other.isSetCouponCode()) {
14393
        this.couponCode = other.couponCode;
14394
      }
6679 anupam.sin 14395
      if (other.isSetArguments()) {
14396
        this.arguments = other.arguments;
6250 amit.gupta 14397
      }
6356 amit.gupta 14398
      this.isCod = other.isCod;
6561 amit.gupta 14399
      if (other.isSetPrefix()) {
14400
        this.prefix = other.prefix;
14401
      }
6250 amit.gupta 14402
    }
14403
 
14404
    public createCoupon_args deepCopy() {
14405
      return new createCoupon_args(this);
14406
    }
14407
 
14408
    @Override
14409
    public void clear() {
14410
      setPromotionIdIsSet(false);
14411
      this.promotionId = 0;
6730 anupam.sin 14412
      this.couponCode = null;
6679 anupam.sin 14413
      this.arguments = null;
6356 amit.gupta 14414
      setIsCodIsSet(false);
14415
      this.isCod = false;
6561 amit.gupta 14416
      this.prefix = null;
6250 amit.gupta 14417
    }
14418
 
14419
    public long getPromotionId() {
14420
      return this.promotionId;
14421
    }
14422
 
14423
    public void setPromotionId(long promotionId) {
14424
      this.promotionId = promotionId;
14425
      setPromotionIdIsSet(true);
14426
    }
14427
 
14428
    public void unsetPromotionId() {
14429
      __isset_bit_vector.clear(__PROMOTIONID_ISSET_ID);
14430
    }
14431
 
14432
    /** Returns true if field promotionId is set (has been assigned a value) and false otherwise */
14433
    public boolean isSetPromotionId() {
14434
      return __isset_bit_vector.get(__PROMOTIONID_ISSET_ID);
14435
    }
14436
 
14437
    public void setPromotionIdIsSet(boolean value) {
14438
      __isset_bit_vector.set(__PROMOTIONID_ISSET_ID, value);
14439
    }
14440
 
6730 anupam.sin 14441
    public String getCouponCode() {
14442
      return this.couponCode;
14443
    }
14444
 
14445
    public void setCouponCode(String couponCode) {
14446
      this.couponCode = couponCode;
14447
    }
14448
 
14449
    public void unsetCouponCode() {
14450
      this.couponCode = null;
14451
    }
14452
 
14453
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
14454
    public boolean isSetCouponCode() {
14455
      return this.couponCode != null;
14456
    }
14457
 
14458
    public void setCouponCodeIsSet(boolean value) {
14459
      if (!value) {
14460
        this.couponCode = null;
14461
      }
14462
    }
14463
 
6679 anupam.sin 14464
    public String getArguments() {
14465
      return this.arguments;
6250 amit.gupta 14466
    }
14467
 
6679 anupam.sin 14468
    public void setArguments(String arguments) {
14469
      this.arguments = arguments;
6250 amit.gupta 14470
    }
14471
 
6679 anupam.sin 14472
    public void unsetArguments() {
14473
      this.arguments = null;
6250 amit.gupta 14474
    }
14475
 
6679 anupam.sin 14476
    /** Returns true if field arguments is set (has been assigned a value) and false otherwise */
14477
    public boolean isSetArguments() {
14478
      return this.arguments != null;
6250 amit.gupta 14479
    }
14480
 
6679 anupam.sin 14481
    public void setArgumentsIsSet(boolean value) {
6250 amit.gupta 14482
      if (!value) {
6679 anupam.sin 14483
        this.arguments = null;
6250 amit.gupta 14484
      }
14485
    }
14486
 
6356 amit.gupta 14487
    public boolean isIsCod() {
14488
      return this.isCod;
14489
    }
14490
 
14491
    public void setIsCod(boolean isCod) {
14492
      this.isCod = isCod;
14493
      setIsCodIsSet(true);
14494
    }
14495
 
14496
    public void unsetIsCod() {
14497
      __isset_bit_vector.clear(__ISCOD_ISSET_ID);
14498
    }
14499
 
14500
    /** Returns true if field isCod is set (has been assigned a value) and false otherwise */
14501
    public boolean isSetIsCod() {
14502
      return __isset_bit_vector.get(__ISCOD_ISSET_ID);
14503
    }
14504
 
14505
    public void setIsCodIsSet(boolean value) {
14506
      __isset_bit_vector.set(__ISCOD_ISSET_ID, value);
14507
    }
14508
 
6561 amit.gupta 14509
    public String getPrefix() {
14510
      return this.prefix;
14511
    }
14512
 
14513
    public void setPrefix(String prefix) {
14514
      this.prefix = prefix;
14515
    }
14516
 
14517
    public void unsetPrefix() {
14518
      this.prefix = null;
14519
    }
14520
 
14521
    /** Returns true if field prefix is set (has been assigned a value) and false otherwise */
14522
    public boolean isSetPrefix() {
14523
      return this.prefix != null;
14524
    }
14525
 
14526
    public void setPrefixIsSet(boolean value) {
14527
      if (!value) {
14528
        this.prefix = null;
14529
      }
14530
    }
14531
 
6250 amit.gupta 14532
    public void setFieldValue(_Fields field, Object value) {
14533
      switch (field) {
14534
      case PROMOTION_ID:
14535
        if (value == null) {
14536
          unsetPromotionId();
14537
        } else {
14538
          setPromotionId((Long)value);
14539
        }
14540
        break;
14541
 
6730 anupam.sin 14542
      case COUPON_CODE:
14543
        if (value == null) {
14544
          unsetCouponCode();
14545
        } else {
14546
          setCouponCode((String)value);
14547
        }
14548
        break;
14549
 
6679 anupam.sin 14550
      case ARGUMENTS:
6250 amit.gupta 14551
        if (value == null) {
6679 anupam.sin 14552
          unsetArguments();
6250 amit.gupta 14553
        } else {
6679 anupam.sin 14554
          setArguments((String)value);
6250 amit.gupta 14555
        }
14556
        break;
14557
 
6356 amit.gupta 14558
      case IS_COD:
14559
        if (value == null) {
14560
          unsetIsCod();
14561
        } else {
14562
          setIsCod((Boolean)value);
14563
        }
14564
        break;
14565
 
6561 amit.gupta 14566
      case PREFIX:
14567
        if (value == null) {
14568
          unsetPrefix();
14569
        } else {
14570
          setPrefix((String)value);
14571
        }
14572
        break;
14573
 
6250 amit.gupta 14574
      }
14575
    }
14576
 
14577
    public Object getFieldValue(_Fields field) {
14578
      switch (field) {
14579
      case PROMOTION_ID:
14580
        return Long.valueOf(getPromotionId());
14581
 
6730 anupam.sin 14582
      case COUPON_CODE:
14583
        return getCouponCode();
14584
 
6679 anupam.sin 14585
      case ARGUMENTS:
14586
        return getArguments();
6250 amit.gupta 14587
 
6356 amit.gupta 14588
      case IS_COD:
14589
        return Boolean.valueOf(isIsCod());
14590
 
6561 amit.gupta 14591
      case PREFIX:
14592
        return getPrefix();
14593
 
6250 amit.gupta 14594
      }
14595
      throw new IllegalStateException();
14596
    }
14597
 
14598
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
14599
    public boolean isSet(_Fields field) {
14600
      if (field == null) {
14601
        throw new IllegalArgumentException();
14602
      }
14603
 
14604
      switch (field) {
14605
      case PROMOTION_ID:
14606
        return isSetPromotionId();
6730 anupam.sin 14607
      case COUPON_CODE:
14608
        return isSetCouponCode();
6679 anupam.sin 14609
      case ARGUMENTS:
14610
        return isSetArguments();
6356 amit.gupta 14611
      case IS_COD:
14612
        return isSetIsCod();
6561 amit.gupta 14613
      case PREFIX:
14614
        return isSetPrefix();
6250 amit.gupta 14615
      }
14616
      throw new IllegalStateException();
14617
    }
14618
 
14619
    @Override
14620
    public boolean equals(Object that) {
14621
      if (that == null)
14622
        return false;
14623
      if (that instanceof createCoupon_args)
14624
        return this.equals((createCoupon_args)that);
14625
      return false;
14626
    }
14627
 
14628
    public boolean equals(createCoupon_args that) {
14629
      if (that == null)
14630
        return false;
14631
 
14632
      boolean this_present_promotionId = true;
14633
      boolean that_present_promotionId = true;
14634
      if (this_present_promotionId || that_present_promotionId) {
14635
        if (!(this_present_promotionId && that_present_promotionId))
14636
          return false;
14637
        if (this.promotionId != that.promotionId)
14638
          return false;
14639
      }
14640
 
6730 anupam.sin 14641
      boolean this_present_couponCode = true && this.isSetCouponCode();
14642
      boolean that_present_couponCode = true && that.isSetCouponCode();
14643
      if (this_present_couponCode || that_present_couponCode) {
14644
        if (!(this_present_couponCode && that_present_couponCode))
14645
          return false;
14646
        if (!this.couponCode.equals(that.couponCode))
14647
          return false;
14648
      }
14649
 
6679 anupam.sin 14650
      boolean this_present_arguments = true && this.isSetArguments();
14651
      boolean that_present_arguments = true && that.isSetArguments();
14652
      if (this_present_arguments || that_present_arguments) {
14653
        if (!(this_present_arguments && that_present_arguments))
6250 amit.gupta 14654
          return false;
6679 anupam.sin 14655
        if (!this.arguments.equals(that.arguments))
6250 amit.gupta 14656
          return false;
14657
      }
14658
 
6356 amit.gupta 14659
      boolean this_present_isCod = true;
14660
      boolean that_present_isCod = true;
14661
      if (this_present_isCod || that_present_isCod) {
14662
        if (!(this_present_isCod && that_present_isCod))
14663
          return false;
14664
        if (this.isCod != that.isCod)
14665
          return false;
14666
      }
14667
 
6561 amit.gupta 14668
      boolean this_present_prefix = true && this.isSetPrefix();
14669
      boolean that_present_prefix = true && that.isSetPrefix();
14670
      if (this_present_prefix || that_present_prefix) {
14671
        if (!(this_present_prefix && that_present_prefix))
14672
          return false;
14673
        if (!this.prefix.equals(that.prefix))
14674
          return false;
14675
      }
14676
 
6250 amit.gupta 14677
      return true;
14678
    }
14679
 
14680
    @Override
14681
    public int hashCode() {
14682
      return 0;
14683
    }
14684
 
14685
    public int compareTo(createCoupon_args other) {
14686
      if (!getClass().equals(other.getClass())) {
14687
        return getClass().getName().compareTo(other.getClass().getName());
14688
      }
14689
 
14690
      int lastComparison = 0;
14691
      createCoupon_args typedOther = (createCoupon_args)other;
14692
 
14693
      lastComparison = Boolean.valueOf(isSetPromotionId()).compareTo(typedOther.isSetPromotionId());
14694
      if (lastComparison != 0) {
14695
        return lastComparison;
14696
      }
14697
      if (isSetPromotionId()) {
14698
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.promotionId, typedOther.promotionId);
14699
        if (lastComparison != 0) {
14700
          return lastComparison;
14701
        }
14702
      }
6730 anupam.sin 14703
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
14704
      if (lastComparison != 0) {
14705
        return lastComparison;
14706
      }
14707
      if (isSetCouponCode()) {
14708
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
14709
        if (lastComparison != 0) {
14710
          return lastComparison;
14711
        }
14712
      }
6679 anupam.sin 14713
      lastComparison = Boolean.valueOf(isSetArguments()).compareTo(typedOther.isSetArguments());
6250 amit.gupta 14714
      if (lastComparison != 0) {
14715
        return lastComparison;
14716
      }
6679 anupam.sin 14717
      if (isSetArguments()) {
14718
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.arguments, typedOther.arguments);
6250 amit.gupta 14719
        if (lastComparison != 0) {
14720
          return lastComparison;
14721
        }
14722
      }
6356 amit.gupta 14723
      lastComparison = Boolean.valueOf(isSetIsCod()).compareTo(typedOther.isSetIsCod());
14724
      if (lastComparison != 0) {
14725
        return lastComparison;
14726
      }
14727
      if (isSetIsCod()) {
14728
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isCod, typedOther.isCod);
14729
        if (lastComparison != 0) {
14730
          return lastComparison;
14731
        }
14732
      }
6561 amit.gupta 14733
      lastComparison = Boolean.valueOf(isSetPrefix()).compareTo(typedOther.isSetPrefix());
14734
      if (lastComparison != 0) {
14735
        return lastComparison;
14736
      }
14737
      if (isSetPrefix()) {
14738
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.prefix, typedOther.prefix);
14739
        if (lastComparison != 0) {
14740
          return lastComparison;
14741
        }
14742
      }
6250 amit.gupta 14743
      return 0;
14744
    }
14745
 
14746
    public _Fields fieldForId(int fieldId) {
14747
      return _Fields.findByThriftId(fieldId);
14748
    }
14749
 
14750
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
14751
      org.apache.thrift.protocol.TField field;
14752
      iprot.readStructBegin();
14753
      while (true)
14754
      {
14755
        field = iprot.readFieldBegin();
14756
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
14757
          break;
14758
        }
14759
        switch (field.id) {
14760
          case 1: // PROMOTION_ID
14761
            if (field.type == org.apache.thrift.protocol.TType.I64) {
14762
              this.promotionId = iprot.readI64();
14763
              setPromotionIdIsSet(true);
14764
            } else { 
14765
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14766
            }
14767
            break;
6730 anupam.sin 14768
          case 2: // COUPON_CODE
6250 amit.gupta 14769
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
6730 anupam.sin 14770
              this.couponCode = iprot.readString();
14771
            } else { 
14772
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14773
            }
14774
            break;
14775
          case 3: // ARGUMENTS
14776
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
6679 anupam.sin 14777
              this.arguments = iprot.readString();
6250 amit.gupta 14778
            } else { 
14779
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14780
            }
14781
            break;
6730 anupam.sin 14782
          case 4: // IS_COD
6356 amit.gupta 14783
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
14784
              this.isCod = iprot.readBool();
14785
              setIsCodIsSet(true);
14786
            } else { 
14787
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14788
            }
14789
            break;
6730 anupam.sin 14790
          case 5: // PREFIX
6561 amit.gupta 14791
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
14792
              this.prefix = iprot.readString();
14793
            } else { 
14794
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14795
            }
14796
            break;
6250 amit.gupta 14797
          default:
14798
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
14799
        }
14800
        iprot.readFieldEnd();
14801
      }
14802
      iprot.readStructEnd();
14803
      validate();
14804
    }
14805
 
14806
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
14807
      validate();
14808
 
14809
      oprot.writeStructBegin(STRUCT_DESC);
14810
      oprot.writeFieldBegin(PROMOTION_ID_FIELD_DESC);
14811
      oprot.writeI64(this.promotionId);
14812
      oprot.writeFieldEnd();
6730 anupam.sin 14813
      if (this.couponCode != null) {
14814
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
14815
        oprot.writeString(this.couponCode);
14816
        oprot.writeFieldEnd();
14817
      }
6679 anupam.sin 14818
      if (this.arguments != null) {
14819
        oprot.writeFieldBegin(ARGUMENTS_FIELD_DESC);
14820
        oprot.writeString(this.arguments);
6250 amit.gupta 14821
        oprot.writeFieldEnd();
14822
      }
6356 amit.gupta 14823
      oprot.writeFieldBegin(IS_COD_FIELD_DESC);
14824
      oprot.writeBool(this.isCod);
14825
      oprot.writeFieldEnd();
6561 amit.gupta 14826
      if (this.prefix != null) {
14827
        oprot.writeFieldBegin(PREFIX_FIELD_DESC);
14828
        oprot.writeString(this.prefix);
14829
        oprot.writeFieldEnd();
14830
      }
6250 amit.gupta 14831
      oprot.writeFieldStop();
14832
      oprot.writeStructEnd();
14833
    }
14834
 
14835
    @Override
14836
    public String toString() {
14837
      StringBuilder sb = new StringBuilder("createCoupon_args(");
14838
      boolean first = true;
14839
 
14840
      sb.append("promotionId:");
14841
      sb.append(this.promotionId);
14842
      first = false;
14843
      if (!first) sb.append(", ");
6730 anupam.sin 14844
      sb.append("couponCode:");
14845
      if (this.couponCode == null) {
14846
        sb.append("null");
14847
      } else {
14848
        sb.append(this.couponCode);
14849
      }
14850
      first = false;
14851
      if (!first) sb.append(", ");
6679 anupam.sin 14852
      sb.append("arguments:");
14853
      if (this.arguments == null) {
6250 amit.gupta 14854
        sb.append("null");
14855
      } else {
6679 anupam.sin 14856
        sb.append(this.arguments);
6250 amit.gupta 14857
      }
14858
      first = false;
14859
      if (!first) sb.append(", ");
6356 amit.gupta 14860
      sb.append("isCod:");
14861
      sb.append(this.isCod);
14862
      first = false;
14863
      if (!first) sb.append(", ");
6561 amit.gupta 14864
      sb.append("prefix:");
14865
      if (this.prefix == null) {
14866
        sb.append("null");
14867
      } else {
14868
        sb.append(this.prefix);
14869
      }
14870
      first = false;
6250 amit.gupta 14871
      sb.append(")");
14872
      return sb.toString();
14873
    }
14874
 
14875
    public void validate() throws org.apache.thrift.TException {
14876
      // check for required fields
14877
    }
14878
 
14879
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
14880
      try {
14881
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
14882
      } catch (org.apache.thrift.TException te) {
14883
        throw new java.io.IOException(te);
14884
      }
14885
    }
14886
 
14887
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
14888
      try {
14889
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
14890
      } catch (org.apache.thrift.TException te) {
14891
        throw new java.io.IOException(te);
14892
      }
14893
    }
14894
 
14895
  }
14896
 
14897
  public static class createCoupon_result implements org.apache.thrift.TBase<createCoupon_result, createCoupon_result._Fields>, java.io.Serializable, Cloneable   {
14898
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createCoupon_result");
14899
 
14900
    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);
14901
    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);
14902
 
14903
    private String success; // required
14904
    private PromotionException pex; // required
14905
 
14906
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
14907
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
14908
      SUCCESS((short)0, "success"),
14909
      PEX((short)1, "pex");
14910
 
14911
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
14912
 
14913
      static {
14914
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
14915
          byName.put(field.getFieldName(), field);
14916
        }
14917
      }
14918
 
14919
      /**
14920
       * Find the _Fields constant that matches fieldId, or null if its not found.
14921
       */
14922
      public static _Fields findByThriftId(int fieldId) {
14923
        switch(fieldId) {
14924
          case 0: // SUCCESS
14925
            return SUCCESS;
14926
          case 1: // PEX
14927
            return PEX;
14928
          default:
14929
            return null;
14930
        }
14931
      }
14932
 
14933
      /**
14934
       * Find the _Fields constant that matches fieldId, throwing an exception
14935
       * if it is not found.
14936
       */
14937
      public static _Fields findByThriftIdOrThrow(int fieldId) {
14938
        _Fields fields = findByThriftId(fieldId);
14939
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
14940
        return fields;
14941
      }
14942
 
14943
      /**
14944
       * Find the _Fields constant that matches name, or null if its not found.
14945
       */
14946
      public static _Fields findByName(String name) {
14947
        return byName.get(name);
14948
      }
14949
 
14950
      private final short _thriftId;
14951
      private final String _fieldName;
14952
 
14953
      _Fields(short thriftId, String fieldName) {
14954
        _thriftId = thriftId;
14955
        _fieldName = fieldName;
14956
      }
14957
 
14958
      public short getThriftFieldId() {
14959
        return _thriftId;
14960
      }
14961
 
14962
      public String getFieldName() {
14963
        return _fieldName;
14964
      }
14965
    }
14966
 
14967
    // isset id assignments
14968
 
14969
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
14970
    static {
14971
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
14972
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14973
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
14974
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
14975
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
14976
      metaDataMap = Collections.unmodifiableMap(tmpMap);
14977
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createCoupon_result.class, metaDataMap);
14978
    }
14979
 
14980
    public createCoupon_result() {
14981
    }
14982
 
14983
    public createCoupon_result(
14984
      String success,
14985
      PromotionException pex)
14986
    {
14987
      this();
14988
      this.success = success;
14989
      this.pex = pex;
14990
    }
14991
 
14992
    /**
14993
     * Performs a deep copy on <i>other</i>.
14994
     */
14995
    public createCoupon_result(createCoupon_result other) {
14996
      if (other.isSetSuccess()) {
14997
        this.success = other.success;
14998
      }
14999
      if (other.isSetPex()) {
15000
        this.pex = new PromotionException(other.pex);
15001
      }
15002
    }
15003
 
15004
    public createCoupon_result deepCopy() {
15005
      return new createCoupon_result(this);
15006
    }
15007
 
15008
    @Override
15009
    public void clear() {
15010
      this.success = null;
15011
      this.pex = null;
15012
    }
15013
 
15014
    public String getSuccess() {
15015
      return this.success;
15016
    }
15017
 
15018
    public void setSuccess(String success) {
15019
      this.success = success;
15020
    }
15021
 
15022
    public void unsetSuccess() {
15023
      this.success = null;
15024
    }
15025
 
15026
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
15027
    public boolean isSetSuccess() {
15028
      return this.success != null;
15029
    }
15030
 
15031
    public void setSuccessIsSet(boolean value) {
15032
      if (!value) {
15033
        this.success = null;
15034
      }
15035
    }
15036
 
15037
    public PromotionException getPex() {
15038
      return this.pex;
15039
    }
15040
 
15041
    public void setPex(PromotionException pex) {
15042
      this.pex = pex;
15043
    }
15044
 
15045
    public void unsetPex() {
15046
      this.pex = null;
15047
    }
15048
 
15049
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
15050
    public boolean isSetPex() {
15051
      return this.pex != null;
15052
    }
15053
 
15054
    public void setPexIsSet(boolean value) {
15055
      if (!value) {
15056
        this.pex = null;
15057
      }
15058
    }
15059
 
15060
    public void setFieldValue(_Fields field, Object value) {
15061
      switch (field) {
15062
      case SUCCESS:
15063
        if (value == null) {
15064
          unsetSuccess();
15065
        } else {
15066
          setSuccess((String)value);
15067
        }
15068
        break;
15069
 
15070
      case PEX:
15071
        if (value == null) {
15072
          unsetPex();
15073
        } else {
15074
          setPex((PromotionException)value);
15075
        }
15076
        break;
15077
 
15078
      }
15079
    }
15080
 
15081
    public Object getFieldValue(_Fields field) {
15082
      switch (field) {
15083
      case SUCCESS:
15084
        return getSuccess();
15085
 
15086
      case PEX:
15087
        return getPex();
15088
 
15089
      }
15090
      throw new IllegalStateException();
15091
    }
15092
 
15093
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15094
    public boolean isSet(_Fields field) {
15095
      if (field == null) {
15096
        throw new IllegalArgumentException();
15097
      }
15098
 
15099
      switch (field) {
15100
      case SUCCESS:
15101
        return isSetSuccess();
15102
      case PEX:
15103
        return isSetPex();
15104
      }
15105
      throw new IllegalStateException();
15106
    }
15107
 
15108
    @Override
15109
    public boolean equals(Object that) {
15110
      if (that == null)
15111
        return false;
15112
      if (that instanceof createCoupon_result)
15113
        return this.equals((createCoupon_result)that);
15114
      return false;
15115
    }
15116
 
15117
    public boolean equals(createCoupon_result that) {
15118
      if (that == null)
15119
        return false;
15120
 
15121
      boolean this_present_success = true && this.isSetSuccess();
15122
      boolean that_present_success = true && that.isSetSuccess();
15123
      if (this_present_success || that_present_success) {
15124
        if (!(this_present_success && that_present_success))
15125
          return false;
15126
        if (!this.success.equals(that.success))
15127
          return false;
15128
      }
15129
 
15130
      boolean this_present_pex = true && this.isSetPex();
15131
      boolean that_present_pex = true && that.isSetPex();
15132
      if (this_present_pex || that_present_pex) {
15133
        if (!(this_present_pex && that_present_pex))
15134
          return false;
15135
        if (!this.pex.equals(that.pex))
15136
          return false;
15137
      }
15138
 
15139
      return true;
15140
    }
15141
 
15142
    @Override
15143
    public int hashCode() {
15144
      return 0;
15145
    }
15146
 
15147
    public int compareTo(createCoupon_result other) {
15148
      if (!getClass().equals(other.getClass())) {
15149
        return getClass().getName().compareTo(other.getClass().getName());
15150
      }
15151
 
15152
      int lastComparison = 0;
15153
      createCoupon_result typedOther = (createCoupon_result)other;
15154
 
15155
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
15156
      if (lastComparison != 0) {
15157
        return lastComparison;
15158
      }
15159
      if (isSetSuccess()) {
15160
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
15161
        if (lastComparison != 0) {
15162
          return lastComparison;
15163
        }
15164
      }
15165
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
15166
      if (lastComparison != 0) {
15167
        return lastComparison;
15168
      }
15169
      if (isSetPex()) {
15170
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
15171
        if (lastComparison != 0) {
15172
          return lastComparison;
15173
        }
15174
      }
15175
      return 0;
15176
    }
15177
 
15178
    public _Fields fieldForId(int fieldId) {
15179
      return _Fields.findByThriftId(fieldId);
15180
    }
15181
 
15182
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15183
      org.apache.thrift.protocol.TField field;
15184
      iprot.readStructBegin();
15185
      while (true)
15186
      {
15187
        field = iprot.readFieldBegin();
15188
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
15189
          break;
15190
        }
15191
        switch (field.id) {
15192
          case 0: // SUCCESS
15193
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
15194
              this.success = iprot.readString();
15195
            } else { 
15196
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15197
            }
15198
            break;
15199
          case 1: // PEX
15200
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
15201
              this.pex = new PromotionException();
15202
              this.pex.read(iprot);
15203
            } else { 
15204
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15205
            }
15206
            break;
15207
          default:
15208
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15209
        }
15210
        iprot.readFieldEnd();
15211
      }
15212
      iprot.readStructEnd();
15213
      validate();
15214
    }
15215
 
15216
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
15217
      oprot.writeStructBegin(STRUCT_DESC);
15218
 
15219
      if (this.isSetSuccess()) {
15220
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
15221
        oprot.writeString(this.success);
15222
        oprot.writeFieldEnd();
15223
      } else if (this.isSetPex()) {
15224
        oprot.writeFieldBegin(PEX_FIELD_DESC);
15225
        this.pex.write(oprot);
15226
        oprot.writeFieldEnd();
15227
      }
15228
      oprot.writeFieldStop();
15229
      oprot.writeStructEnd();
15230
    }
15231
 
15232
    @Override
15233
    public String toString() {
15234
      StringBuilder sb = new StringBuilder("createCoupon_result(");
15235
      boolean first = true;
15236
 
15237
      sb.append("success:");
15238
      if (this.success == null) {
15239
        sb.append("null");
15240
      } else {
15241
        sb.append(this.success);
15242
      }
15243
      first = false;
15244
      if (!first) sb.append(", ");
15245
      sb.append("pex:");
15246
      if (this.pex == null) {
15247
        sb.append("null");
15248
      } else {
15249
        sb.append(this.pex);
15250
      }
15251
      first = false;
15252
      sb.append(")");
15253
      return sb.toString();
15254
    }
15255
 
15256
    public void validate() throws org.apache.thrift.TException {
15257
      // check for required fields
15258
    }
15259
 
15260
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15261
      try {
15262
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15263
      } catch (org.apache.thrift.TException te) {
15264
        throw new java.io.IOException(te);
15265
      }
15266
    }
15267
 
15268
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15269
      try {
15270
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15271
      } catch (org.apache.thrift.TException te) {
15272
        throw new java.io.IOException(te);
15273
      }
15274
    }
15275
 
15276
  }
15277
 
3430 rajveer 15278
  public static class getSuccessfulPaymentCountForCoupon_args implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_args, getSuccessfulPaymentCountForCoupon_args._Fields>, java.io.Serializable, Cloneable   {
15279
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_args");
3385 varun.gupt 15280
 
3430 rajveer 15281
    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 15282
 
3430 rajveer 15283
    private String couponCode; // required
3385 varun.gupt 15284
 
15285
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 15286
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 15287
      COUPON_CODE((short)1, "couponCode");
15288
 
15289
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15290
 
15291
      static {
15292
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15293
          byName.put(field.getFieldName(), field);
15294
        }
15295
      }
15296
 
15297
      /**
15298
       * Find the _Fields constant that matches fieldId, or null if its not found.
15299
       */
15300
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 15301
        switch(fieldId) {
15302
          case 1: // COUPON_CODE
15303
            return COUPON_CODE;
15304
          default:
15305
            return null;
15306
        }
3385 varun.gupt 15307
      }
15308
 
15309
      /**
15310
       * Find the _Fields constant that matches fieldId, throwing an exception
15311
       * if it is not found.
15312
       */
15313
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15314
        _Fields fields = findByThriftId(fieldId);
15315
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15316
        return fields;
15317
      }
15318
 
15319
      /**
15320
       * Find the _Fields constant that matches name, or null if its not found.
15321
       */
15322
      public static _Fields findByName(String name) {
15323
        return byName.get(name);
15324
      }
15325
 
15326
      private final short _thriftId;
15327
      private final String _fieldName;
15328
 
15329
      _Fields(short thriftId, String fieldName) {
15330
        _thriftId = thriftId;
15331
        _fieldName = fieldName;
15332
      }
15333
 
15334
      public short getThriftFieldId() {
15335
        return _thriftId;
15336
      }
15337
 
15338
      public String getFieldName() {
15339
        return _fieldName;
15340
      }
15341
    }
15342
 
15343
    // isset id assignments
15344
 
3430 rajveer 15345
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 15346
    static {
3430 rajveer 15347
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15348
      tmpMap.put(_Fields.COUPON_CODE, new org.apache.thrift.meta_data.FieldMetaData("couponCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15349
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
15350
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15351
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_args.class, metaDataMap);
3385 varun.gupt 15352
    }
15353
 
15354
    public getSuccessfulPaymentCountForCoupon_args() {
15355
    }
15356
 
15357
    public getSuccessfulPaymentCountForCoupon_args(
15358
      String couponCode)
15359
    {
15360
      this();
15361
      this.couponCode = couponCode;
15362
    }
15363
 
15364
    /**
15365
     * Performs a deep copy on <i>other</i>.
15366
     */
15367
    public getSuccessfulPaymentCountForCoupon_args(getSuccessfulPaymentCountForCoupon_args other) {
15368
      if (other.isSetCouponCode()) {
15369
        this.couponCode = other.couponCode;
15370
      }
15371
    }
15372
 
15373
    public getSuccessfulPaymentCountForCoupon_args deepCopy() {
15374
      return new getSuccessfulPaymentCountForCoupon_args(this);
15375
    }
15376
 
3430 rajveer 15377
    @Override
15378
    public void clear() {
15379
      this.couponCode = null;
3385 varun.gupt 15380
    }
15381
 
15382
    public String getCouponCode() {
15383
      return this.couponCode;
15384
    }
15385
 
3430 rajveer 15386
    public void setCouponCode(String couponCode) {
3385 varun.gupt 15387
      this.couponCode = couponCode;
15388
    }
15389
 
15390
    public void unsetCouponCode() {
15391
      this.couponCode = null;
15392
    }
15393
 
3430 rajveer 15394
    /** Returns true if field couponCode is set (has been assigned a value) and false otherwise */
3385 varun.gupt 15395
    public boolean isSetCouponCode() {
15396
      return this.couponCode != null;
15397
    }
15398
 
15399
    public void setCouponCodeIsSet(boolean value) {
15400
      if (!value) {
15401
        this.couponCode = null;
15402
      }
15403
    }
15404
 
15405
    public void setFieldValue(_Fields field, Object value) {
15406
      switch (field) {
15407
      case COUPON_CODE:
15408
        if (value == null) {
15409
          unsetCouponCode();
15410
        } else {
15411
          setCouponCode((String)value);
15412
        }
15413
        break;
15414
 
15415
      }
15416
    }
15417
 
15418
    public Object getFieldValue(_Fields field) {
15419
      switch (field) {
15420
      case COUPON_CODE:
15421
        return getCouponCode();
15422
 
15423
      }
15424
      throw new IllegalStateException();
15425
    }
15426
 
3430 rajveer 15427
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15428
    public boolean isSet(_Fields field) {
15429
      if (field == null) {
15430
        throw new IllegalArgumentException();
15431
      }
3385 varun.gupt 15432
 
15433
      switch (field) {
15434
      case COUPON_CODE:
15435
        return isSetCouponCode();
15436
      }
15437
      throw new IllegalStateException();
15438
    }
15439
 
15440
    @Override
15441
    public boolean equals(Object that) {
15442
      if (that == null)
15443
        return false;
15444
      if (that instanceof getSuccessfulPaymentCountForCoupon_args)
15445
        return this.equals((getSuccessfulPaymentCountForCoupon_args)that);
15446
      return false;
15447
    }
15448
 
15449
    public boolean equals(getSuccessfulPaymentCountForCoupon_args that) {
15450
      if (that == null)
15451
        return false;
15452
 
15453
      boolean this_present_couponCode = true && this.isSetCouponCode();
15454
      boolean that_present_couponCode = true && that.isSetCouponCode();
15455
      if (this_present_couponCode || that_present_couponCode) {
15456
        if (!(this_present_couponCode && that_present_couponCode))
15457
          return false;
15458
        if (!this.couponCode.equals(that.couponCode))
15459
          return false;
15460
      }
15461
 
15462
      return true;
15463
    }
15464
 
15465
    @Override
15466
    public int hashCode() {
15467
      return 0;
15468
    }
15469
 
15470
    public int compareTo(getSuccessfulPaymentCountForCoupon_args other) {
15471
      if (!getClass().equals(other.getClass())) {
15472
        return getClass().getName().compareTo(other.getClass().getName());
15473
      }
15474
 
15475
      int lastComparison = 0;
15476
      getSuccessfulPaymentCountForCoupon_args typedOther = (getSuccessfulPaymentCountForCoupon_args)other;
15477
 
3430 rajveer 15478
      lastComparison = Boolean.valueOf(isSetCouponCode()).compareTo(typedOther.isSetCouponCode());
3385 varun.gupt 15479
      if (lastComparison != 0) {
15480
        return lastComparison;
15481
      }
3430 rajveer 15482
      if (isSetCouponCode()) {
15483
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.couponCode, typedOther.couponCode);
15484
        if (lastComparison != 0) {
15485
          return lastComparison;
15486
        }
3385 varun.gupt 15487
      }
15488
      return 0;
15489
    }
15490
 
3430 rajveer 15491
    public _Fields fieldForId(int fieldId) {
15492
      return _Fields.findByThriftId(fieldId);
15493
    }
15494
 
15495
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15496
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 15497
      iprot.readStructBegin();
15498
      while (true)
15499
      {
15500
        field = iprot.readFieldBegin();
3430 rajveer 15501
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 15502
          break;
15503
        }
3430 rajveer 15504
        switch (field.id) {
15505
          case 1: // COUPON_CODE
15506
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
15507
              this.couponCode = iprot.readString();
15508
            } else { 
15509
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15510
            }
15511
            break;
15512
          default:
15513
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 15514
        }
3430 rajveer 15515
        iprot.readFieldEnd();
3385 varun.gupt 15516
      }
15517
      iprot.readStructEnd();
15518
      validate();
15519
    }
15520
 
3430 rajveer 15521
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 15522
      validate();
15523
 
15524
      oprot.writeStructBegin(STRUCT_DESC);
15525
      if (this.couponCode != null) {
15526
        oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
15527
        oprot.writeString(this.couponCode);
15528
        oprot.writeFieldEnd();
15529
      }
15530
      oprot.writeFieldStop();
15531
      oprot.writeStructEnd();
15532
    }
15533
 
15534
    @Override
15535
    public String toString() {
15536
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_args(");
15537
      boolean first = true;
15538
 
15539
      sb.append("couponCode:");
15540
      if (this.couponCode == null) {
15541
        sb.append("null");
15542
      } else {
15543
        sb.append(this.couponCode);
15544
      }
15545
      first = false;
15546
      sb.append(")");
15547
      return sb.toString();
15548
    }
15549
 
3430 rajveer 15550
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 15551
      // check for required fields
15552
    }
15553
 
3430 rajveer 15554
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15555
      try {
15556
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15557
      } catch (org.apache.thrift.TException te) {
15558
        throw new java.io.IOException(te);
15559
      }
15560
    }
15561
 
15562
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15563
      try {
15564
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15565
      } catch (org.apache.thrift.TException te) {
15566
        throw new java.io.IOException(te);
15567
      }
15568
    }
15569
 
3385 varun.gupt 15570
  }
15571
 
3430 rajveer 15572
  public static class getSuccessfulPaymentCountForCoupon_result implements org.apache.thrift.TBase<getSuccessfulPaymentCountForCoupon_result, getSuccessfulPaymentCountForCoupon_result._Fields>, java.io.Serializable, Cloneable   {
15573
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSuccessfulPaymentCountForCoupon_result");
3385 varun.gupt 15574
 
3430 rajveer 15575
    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);
15576
    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 15577
 
3430 rajveer 15578
    private long success; // required
15579
    private PromotionException pex; // required
3385 varun.gupt 15580
 
15581
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 15582
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 15583
      SUCCESS((short)0, "success"),
15584
      PEX((short)1, "pex");
15585
 
15586
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15587
 
15588
      static {
15589
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15590
          byName.put(field.getFieldName(), field);
15591
        }
15592
      }
15593
 
15594
      /**
15595
       * Find the _Fields constant that matches fieldId, or null if its not found.
15596
       */
15597
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 15598
        switch(fieldId) {
15599
          case 0: // SUCCESS
15600
            return SUCCESS;
15601
          case 1: // PEX
15602
            return PEX;
15603
          default:
15604
            return null;
15605
        }
3385 varun.gupt 15606
      }
15607
 
15608
      /**
15609
       * Find the _Fields constant that matches fieldId, throwing an exception
15610
       * if it is not found.
15611
       */
15612
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15613
        _Fields fields = findByThriftId(fieldId);
15614
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15615
        return fields;
15616
      }
15617
 
15618
      /**
15619
       * Find the _Fields constant that matches name, or null if its not found.
15620
       */
15621
      public static _Fields findByName(String name) {
15622
        return byName.get(name);
15623
      }
15624
 
15625
      private final short _thriftId;
15626
      private final String _fieldName;
15627
 
15628
      _Fields(short thriftId, String fieldName) {
15629
        _thriftId = thriftId;
15630
        _fieldName = fieldName;
15631
      }
15632
 
15633
      public short getThriftFieldId() {
15634
        return _thriftId;
15635
      }
15636
 
15637
      public String getFieldName() {
15638
        return _fieldName;
15639
      }
15640
    }
15641
 
15642
    // isset id assignments
15643
    private static final int __SUCCESS_ISSET_ID = 0;
15644
    private BitSet __isset_bit_vector = new BitSet(1);
15645
 
3430 rajveer 15646
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 15647
    static {
3430 rajveer 15648
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
15649
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15650
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
15651
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
15652
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
15653
      metaDataMap = Collections.unmodifiableMap(tmpMap);
15654
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSuccessfulPaymentCountForCoupon_result.class, metaDataMap);
3385 varun.gupt 15655
    }
15656
 
15657
    public getSuccessfulPaymentCountForCoupon_result() {
15658
    }
15659
 
15660
    public getSuccessfulPaymentCountForCoupon_result(
15661
      long success,
15662
      PromotionException pex)
15663
    {
15664
      this();
15665
      this.success = success;
15666
      setSuccessIsSet(true);
15667
      this.pex = pex;
15668
    }
15669
 
15670
    /**
15671
     * Performs a deep copy on <i>other</i>.
15672
     */
15673
    public getSuccessfulPaymentCountForCoupon_result(getSuccessfulPaymentCountForCoupon_result other) {
15674
      __isset_bit_vector.clear();
15675
      __isset_bit_vector.or(other.__isset_bit_vector);
15676
      this.success = other.success;
15677
      if (other.isSetPex()) {
15678
        this.pex = new PromotionException(other.pex);
15679
      }
15680
    }
15681
 
15682
    public getSuccessfulPaymentCountForCoupon_result deepCopy() {
15683
      return new getSuccessfulPaymentCountForCoupon_result(this);
15684
    }
15685
 
3430 rajveer 15686
    @Override
15687
    public void clear() {
15688
      setSuccessIsSet(false);
15689
      this.success = 0;
15690
      this.pex = null;
3385 varun.gupt 15691
    }
15692
 
15693
    public long getSuccess() {
15694
      return this.success;
15695
    }
15696
 
3430 rajveer 15697
    public void setSuccess(long success) {
3385 varun.gupt 15698
      this.success = success;
15699
      setSuccessIsSet(true);
15700
    }
15701
 
15702
    public void unsetSuccess() {
15703
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
15704
    }
15705
 
3430 rajveer 15706
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 15707
    public boolean isSetSuccess() {
15708
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
15709
    }
15710
 
15711
    public void setSuccessIsSet(boolean value) {
15712
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
15713
    }
15714
 
15715
    public PromotionException getPex() {
15716
      return this.pex;
15717
    }
15718
 
3430 rajveer 15719
    public void setPex(PromotionException pex) {
3385 varun.gupt 15720
      this.pex = pex;
15721
    }
15722
 
15723
    public void unsetPex() {
15724
      this.pex = null;
15725
    }
15726
 
3430 rajveer 15727
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
3385 varun.gupt 15728
    public boolean isSetPex() {
15729
      return this.pex != null;
15730
    }
15731
 
15732
    public void setPexIsSet(boolean value) {
15733
      if (!value) {
15734
        this.pex = null;
15735
      }
15736
    }
15737
 
15738
    public void setFieldValue(_Fields field, Object value) {
15739
      switch (field) {
15740
      case SUCCESS:
15741
        if (value == null) {
15742
          unsetSuccess();
15743
        } else {
15744
          setSuccess((Long)value);
15745
        }
15746
        break;
15747
 
15748
      case PEX:
15749
        if (value == null) {
15750
          unsetPex();
15751
        } else {
15752
          setPex((PromotionException)value);
15753
        }
15754
        break;
15755
 
15756
      }
15757
    }
15758
 
15759
    public Object getFieldValue(_Fields field) {
15760
      switch (field) {
15761
      case SUCCESS:
3430 rajveer 15762
        return Long.valueOf(getSuccess());
3385 varun.gupt 15763
 
15764
      case PEX:
15765
        return getPex();
15766
 
15767
      }
15768
      throw new IllegalStateException();
15769
    }
15770
 
3430 rajveer 15771
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
15772
    public boolean isSet(_Fields field) {
15773
      if (field == null) {
15774
        throw new IllegalArgumentException();
15775
      }
3385 varun.gupt 15776
 
15777
      switch (field) {
15778
      case SUCCESS:
15779
        return isSetSuccess();
15780
      case PEX:
15781
        return isSetPex();
15782
      }
15783
      throw new IllegalStateException();
15784
    }
15785
 
15786
    @Override
15787
    public boolean equals(Object that) {
15788
      if (that == null)
15789
        return false;
15790
      if (that instanceof getSuccessfulPaymentCountForCoupon_result)
15791
        return this.equals((getSuccessfulPaymentCountForCoupon_result)that);
15792
      return false;
15793
    }
15794
 
15795
    public boolean equals(getSuccessfulPaymentCountForCoupon_result that) {
15796
      if (that == null)
15797
        return false;
15798
 
15799
      boolean this_present_success = true;
15800
      boolean that_present_success = true;
15801
      if (this_present_success || that_present_success) {
15802
        if (!(this_present_success && that_present_success))
15803
          return false;
15804
        if (this.success != that.success)
15805
          return false;
15806
      }
15807
 
15808
      boolean this_present_pex = true && this.isSetPex();
15809
      boolean that_present_pex = true && that.isSetPex();
15810
      if (this_present_pex || that_present_pex) {
15811
        if (!(this_present_pex && that_present_pex))
15812
          return false;
15813
        if (!this.pex.equals(that.pex))
15814
          return false;
15815
      }
15816
 
15817
      return true;
15818
    }
15819
 
15820
    @Override
15821
    public int hashCode() {
15822
      return 0;
15823
    }
15824
 
15825
    public int compareTo(getSuccessfulPaymentCountForCoupon_result other) {
15826
      if (!getClass().equals(other.getClass())) {
15827
        return getClass().getName().compareTo(other.getClass().getName());
15828
      }
15829
 
15830
      int lastComparison = 0;
15831
      getSuccessfulPaymentCountForCoupon_result typedOther = (getSuccessfulPaymentCountForCoupon_result)other;
15832
 
3430 rajveer 15833
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 15834
      if (lastComparison != 0) {
15835
        return lastComparison;
15836
      }
3430 rajveer 15837
      if (isSetSuccess()) {
15838
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
15839
        if (lastComparison != 0) {
15840
          return lastComparison;
15841
        }
3385 varun.gupt 15842
      }
3430 rajveer 15843
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
3385 varun.gupt 15844
      if (lastComparison != 0) {
15845
        return lastComparison;
15846
      }
3430 rajveer 15847
      if (isSetPex()) {
15848
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
15849
        if (lastComparison != 0) {
15850
          return lastComparison;
15851
        }
3385 varun.gupt 15852
      }
15853
      return 0;
15854
    }
15855
 
3430 rajveer 15856
    public _Fields fieldForId(int fieldId) {
15857
      return _Fields.findByThriftId(fieldId);
15858
    }
15859
 
15860
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
15861
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 15862
      iprot.readStructBegin();
15863
      while (true)
15864
      {
15865
        field = iprot.readFieldBegin();
3430 rajveer 15866
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 15867
          break;
15868
        }
3430 rajveer 15869
        switch (field.id) {
15870
          case 0: // SUCCESS
15871
            if (field.type == org.apache.thrift.protocol.TType.I64) {
15872
              this.success = iprot.readI64();
15873
              setSuccessIsSet(true);
15874
            } else { 
15875
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15876
            }
15877
            break;
15878
          case 1: // PEX
15879
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
15880
              this.pex = new PromotionException();
15881
              this.pex.read(iprot);
15882
            } else { 
15883
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
15884
            }
15885
            break;
15886
          default:
15887
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 15888
        }
3430 rajveer 15889
        iprot.readFieldEnd();
3385 varun.gupt 15890
      }
15891
      iprot.readStructEnd();
15892
      validate();
15893
    }
15894
 
3430 rajveer 15895
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 15896
      oprot.writeStructBegin(STRUCT_DESC);
15897
 
15898
      if (this.isSetSuccess()) {
15899
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
15900
        oprot.writeI64(this.success);
15901
        oprot.writeFieldEnd();
15902
      } else if (this.isSetPex()) {
15903
        oprot.writeFieldBegin(PEX_FIELD_DESC);
15904
        this.pex.write(oprot);
15905
        oprot.writeFieldEnd();
15906
      }
15907
      oprot.writeFieldStop();
15908
      oprot.writeStructEnd();
15909
    }
15910
 
15911
    @Override
15912
    public String toString() {
15913
      StringBuilder sb = new StringBuilder("getSuccessfulPaymentCountForCoupon_result(");
15914
      boolean first = true;
15915
 
15916
      sb.append("success:");
15917
      sb.append(this.success);
15918
      first = false;
15919
      if (!first) sb.append(", ");
15920
      sb.append("pex:");
15921
      if (this.pex == null) {
15922
        sb.append("null");
15923
      } else {
15924
        sb.append(this.pex);
15925
      }
15926
      first = false;
15927
      sb.append(")");
15928
      return sb.toString();
15929
    }
15930
 
3430 rajveer 15931
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 15932
      // check for required fields
15933
    }
15934
 
3430 rajveer 15935
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
15936
      try {
15937
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
15938
      } catch (org.apache.thrift.TException te) {
15939
        throw new java.io.IOException(te);
15940
      }
15941
    }
15942
 
15943
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
15944
      try {
15945
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
15946
      } catch (org.apache.thrift.TException te) {
15947
        throw new java.io.IOException(te);
15948
      }
15949
    }
15950
 
3385 varun.gupt 15951
  }
15952
 
3430 rajveer 15953
  public static class getRuleDocString_args implements org.apache.thrift.TBase<getRuleDocString_args, getRuleDocString_args._Fields>, java.io.Serializable, Cloneable   {
15954
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_args");
3385 varun.gupt 15955
 
3430 rajveer 15956
    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 15957
 
3430 rajveer 15958
    private String ruleName; // required
3385 varun.gupt 15959
 
15960
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 15961
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 15962
      RULE_NAME((short)1, "ruleName");
15963
 
15964
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
15965
 
15966
      static {
15967
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
15968
          byName.put(field.getFieldName(), field);
15969
        }
15970
      }
15971
 
15972
      /**
15973
       * Find the _Fields constant that matches fieldId, or null if its not found.
15974
       */
15975
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 15976
        switch(fieldId) {
15977
          case 1: // RULE_NAME
15978
            return RULE_NAME;
15979
          default:
15980
            return null;
15981
        }
3385 varun.gupt 15982
      }
15983
 
15984
      /**
15985
       * Find the _Fields constant that matches fieldId, throwing an exception
15986
       * if it is not found.
15987
       */
15988
      public static _Fields findByThriftIdOrThrow(int fieldId) {
15989
        _Fields fields = findByThriftId(fieldId);
15990
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
15991
        return fields;
15992
      }
15993
 
15994
      /**
15995
       * Find the _Fields constant that matches name, or null if its not found.
15996
       */
15997
      public static _Fields findByName(String name) {
15998
        return byName.get(name);
15999
      }
16000
 
16001
      private final short _thriftId;
16002
      private final String _fieldName;
16003
 
16004
      _Fields(short thriftId, String fieldName) {
16005
        _thriftId = thriftId;
16006
        _fieldName = fieldName;
16007
      }
16008
 
16009
      public short getThriftFieldId() {
16010
        return _thriftId;
16011
      }
16012
 
16013
      public String getFieldName() {
16014
        return _fieldName;
16015
      }
16016
    }
16017
 
16018
    // isset id assignments
16019
 
3430 rajveer 16020
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 16021
    static {
3430 rajveer 16022
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16023
      tmpMap.put(_Fields.RULE_NAME, new org.apache.thrift.meta_data.FieldMetaData("ruleName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16024
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
16025
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16026
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_args.class, metaDataMap);
3385 varun.gupt 16027
    }
16028
 
16029
    public getRuleDocString_args() {
16030
    }
16031
 
16032
    public getRuleDocString_args(
16033
      String ruleName)
16034
    {
16035
      this();
16036
      this.ruleName = ruleName;
16037
    }
16038
 
16039
    /**
16040
     * Performs a deep copy on <i>other</i>.
16041
     */
16042
    public getRuleDocString_args(getRuleDocString_args other) {
16043
      if (other.isSetRuleName()) {
16044
        this.ruleName = other.ruleName;
16045
      }
16046
    }
16047
 
16048
    public getRuleDocString_args deepCopy() {
16049
      return new getRuleDocString_args(this);
16050
    }
16051
 
3430 rajveer 16052
    @Override
16053
    public void clear() {
16054
      this.ruleName = null;
3385 varun.gupt 16055
    }
16056
 
16057
    public String getRuleName() {
16058
      return this.ruleName;
16059
    }
16060
 
3430 rajveer 16061
    public void setRuleName(String ruleName) {
3385 varun.gupt 16062
      this.ruleName = ruleName;
16063
    }
16064
 
16065
    public void unsetRuleName() {
16066
      this.ruleName = null;
16067
    }
16068
 
3430 rajveer 16069
    /** Returns true if field ruleName is set (has been assigned a value) and false otherwise */
3385 varun.gupt 16070
    public boolean isSetRuleName() {
16071
      return this.ruleName != null;
16072
    }
16073
 
16074
    public void setRuleNameIsSet(boolean value) {
16075
      if (!value) {
16076
        this.ruleName = null;
16077
      }
16078
    }
16079
 
16080
    public void setFieldValue(_Fields field, Object value) {
16081
      switch (field) {
16082
      case RULE_NAME:
16083
        if (value == null) {
16084
          unsetRuleName();
16085
        } else {
16086
          setRuleName((String)value);
16087
        }
16088
        break;
16089
 
16090
      }
16091
    }
16092
 
16093
    public Object getFieldValue(_Fields field) {
16094
      switch (field) {
16095
      case RULE_NAME:
16096
        return getRuleName();
16097
 
16098
      }
16099
      throw new IllegalStateException();
16100
    }
16101
 
3430 rajveer 16102
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16103
    public boolean isSet(_Fields field) {
16104
      if (field == null) {
16105
        throw new IllegalArgumentException();
16106
      }
3385 varun.gupt 16107
 
16108
      switch (field) {
16109
      case RULE_NAME:
16110
        return isSetRuleName();
16111
      }
16112
      throw new IllegalStateException();
16113
    }
16114
 
16115
    @Override
16116
    public boolean equals(Object that) {
16117
      if (that == null)
16118
        return false;
16119
      if (that instanceof getRuleDocString_args)
16120
        return this.equals((getRuleDocString_args)that);
16121
      return false;
16122
    }
16123
 
16124
    public boolean equals(getRuleDocString_args that) {
16125
      if (that == null)
16126
        return false;
16127
 
16128
      boolean this_present_ruleName = true && this.isSetRuleName();
16129
      boolean that_present_ruleName = true && that.isSetRuleName();
16130
      if (this_present_ruleName || that_present_ruleName) {
16131
        if (!(this_present_ruleName && that_present_ruleName))
16132
          return false;
16133
        if (!this.ruleName.equals(that.ruleName))
16134
          return false;
16135
      }
16136
 
16137
      return true;
16138
    }
16139
 
16140
    @Override
16141
    public int hashCode() {
16142
      return 0;
16143
    }
16144
 
16145
    public int compareTo(getRuleDocString_args other) {
16146
      if (!getClass().equals(other.getClass())) {
16147
        return getClass().getName().compareTo(other.getClass().getName());
16148
      }
16149
 
16150
      int lastComparison = 0;
16151
      getRuleDocString_args typedOther = (getRuleDocString_args)other;
16152
 
3430 rajveer 16153
      lastComparison = Boolean.valueOf(isSetRuleName()).compareTo(typedOther.isSetRuleName());
3385 varun.gupt 16154
      if (lastComparison != 0) {
16155
        return lastComparison;
16156
      }
3430 rajveer 16157
      if (isSetRuleName()) {
16158
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ruleName, typedOther.ruleName);
16159
        if (lastComparison != 0) {
16160
          return lastComparison;
16161
        }
3385 varun.gupt 16162
      }
16163
      return 0;
16164
    }
16165
 
3430 rajveer 16166
    public _Fields fieldForId(int fieldId) {
16167
      return _Fields.findByThriftId(fieldId);
16168
    }
16169
 
16170
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16171
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 16172
      iprot.readStructBegin();
16173
      while (true)
16174
      {
16175
        field = iprot.readFieldBegin();
3430 rajveer 16176
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 16177
          break;
16178
        }
3430 rajveer 16179
        switch (field.id) {
16180
          case 1: // RULE_NAME
16181
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
16182
              this.ruleName = iprot.readString();
16183
            } else { 
16184
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16185
            }
16186
            break;
16187
          default:
16188
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 16189
        }
3430 rajveer 16190
        iprot.readFieldEnd();
3385 varun.gupt 16191
      }
16192
      iprot.readStructEnd();
16193
      validate();
16194
    }
16195
 
3430 rajveer 16196
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 16197
      validate();
16198
 
16199
      oprot.writeStructBegin(STRUCT_DESC);
16200
      if (this.ruleName != null) {
16201
        oprot.writeFieldBegin(RULE_NAME_FIELD_DESC);
16202
        oprot.writeString(this.ruleName);
16203
        oprot.writeFieldEnd();
16204
      }
16205
      oprot.writeFieldStop();
16206
      oprot.writeStructEnd();
16207
    }
16208
 
16209
    @Override
16210
    public String toString() {
16211
      StringBuilder sb = new StringBuilder("getRuleDocString_args(");
16212
      boolean first = true;
16213
 
16214
      sb.append("ruleName:");
16215
      if (this.ruleName == null) {
16216
        sb.append("null");
16217
      } else {
16218
        sb.append(this.ruleName);
16219
      }
16220
      first = false;
16221
      sb.append(")");
16222
      return sb.toString();
16223
    }
16224
 
3430 rajveer 16225
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 16226
      // check for required fields
16227
    }
16228
 
3430 rajveer 16229
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16230
      try {
16231
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16232
      } catch (org.apache.thrift.TException te) {
16233
        throw new java.io.IOException(te);
16234
      }
16235
    }
16236
 
16237
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16238
      try {
16239
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16240
      } catch (org.apache.thrift.TException te) {
16241
        throw new java.io.IOException(te);
16242
      }
16243
    }
16244
 
3385 varun.gupt 16245
  }
16246
 
3430 rajveer 16247
  public static class getRuleDocString_result implements org.apache.thrift.TBase<getRuleDocString_result, getRuleDocString_result._Fields>, java.io.Serializable, Cloneable   {
16248
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRuleDocString_result");
3385 varun.gupt 16249
 
3430 rajveer 16250
    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 16251
 
3430 rajveer 16252
    private String success; // required
3385 varun.gupt 16253
 
16254
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 16255
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
3385 varun.gupt 16256
      SUCCESS((short)0, "success");
16257
 
16258
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16259
 
16260
      static {
16261
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16262
          byName.put(field.getFieldName(), field);
16263
        }
16264
      }
16265
 
16266
      /**
16267
       * Find the _Fields constant that matches fieldId, or null if its not found.
16268
       */
16269
      public static _Fields findByThriftId(int fieldId) {
3430 rajveer 16270
        switch(fieldId) {
16271
          case 0: // SUCCESS
16272
            return SUCCESS;
16273
          default:
16274
            return null;
16275
        }
3385 varun.gupt 16276
      }
16277
 
16278
      /**
16279
       * Find the _Fields constant that matches fieldId, throwing an exception
16280
       * if it is not found.
16281
       */
16282
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16283
        _Fields fields = findByThriftId(fieldId);
16284
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16285
        return fields;
16286
      }
16287
 
16288
      /**
16289
       * Find the _Fields constant that matches name, or null if its not found.
16290
       */
16291
      public static _Fields findByName(String name) {
16292
        return byName.get(name);
16293
      }
16294
 
16295
      private final short _thriftId;
16296
      private final String _fieldName;
16297
 
16298
      _Fields(short thriftId, String fieldName) {
16299
        _thriftId = thriftId;
16300
        _fieldName = fieldName;
16301
      }
16302
 
16303
      public short getThriftFieldId() {
16304
        return _thriftId;
16305
      }
16306
 
16307
      public String getFieldName() {
16308
        return _fieldName;
16309
      }
16310
    }
16311
 
16312
    // isset id assignments
16313
 
3430 rajveer 16314
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
3385 varun.gupt 16315
    static {
3430 rajveer 16316
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16317
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16318
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
16319
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16320
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRuleDocString_result.class, metaDataMap);
3385 varun.gupt 16321
    }
16322
 
16323
    public getRuleDocString_result() {
16324
    }
16325
 
16326
    public getRuleDocString_result(
16327
      String success)
16328
    {
16329
      this();
16330
      this.success = success;
16331
    }
16332
 
16333
    /**
16334
     * Performs a deep copy on <i>other</i>.
16335
     */
16336
    public getRuleDocString_result(getRuleDocString_result other) {
16337
      if (other.isSetSuccess()) {
16338
        this.success = other.success;
16339
      }
16340
    }
16341
 
16342
    public getRuleDocString_result deepCopy() {
16343
      return new getRuleDocString_result(this);
16344
    }
16345
 
3430 rajveer 16346
    @Override
16347
    public void clear() {
16348
      this.success = null;
3385 varun.gupt 16349
    }
16350
 
16351
    public String getSuccess() {
16352
      return this.success;
16353
    }
16354
 
3430 rajveer 16355
    public void setSuccess(String success) {
3385 varun.gupt 16356
      this.success = success;
16357
    }
16358
 
16359
    public void unsetSuccess() {
16360
      this.success = null;
16361
    }
16362
 
3430 rajveer 16363
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
3385 varun.gupt 16364
    public boolean isSetSuccess() {
16365
      return this.success != null;
16366
    }
16367
 
16368
    public void setSuccessIsSet(boolean value) {
16369
      if (!value) {
16370
        this.success = null;
16371
      }
16372
    }
16373
 
16374
    public void setFieldValue(_Fields field, Object value) {
16375
      switch (field) {
16376
      case SUCCESS:
16377
        if (value == null) {
16378
          unsetSuccess();
16379
        } else {
16380
          setSuccess((String)value);
16381
        }
16382
        break;
16383
 
16384
      }
16385
    }
16386
 
16387
    public Object getFieldValue(_Fields field) {
16388
      switch (field) {
16389
      case SUCCESS:
16390
        return getSuccess();
16391
 
16392
      }
16393
      throw new IllegalStateException();
16394
    }
16395
 
3430 rajveer 16396
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16397
    public boolean isSet(_Fields field) {
16398
      if (field == null) {
16399
        throw new IllegalArgumentException();
16400
      }
3385 varun.gupt 16401
 
16402
      switch (field) {
16403
      case SUCCESS:
16404
        return isSetSuccess();
16405
      }
16406
      throw new IllegalStateException();
16407
    }
16408
 
16409
    @Override
16410
    public boolean equals(Object that) {
16411
      if (that == null)
16412
        return false;
16413
      if (that instanceof getRuleDocString_result)
16414
        return this.equals((getRuleDocString_result)that);
16415
      return false;
16416
    }
16417
 
16418
    public boolean equals(getRuleDocString_result that) {
16419
      if (that == null)
16420
        return false;
16421
 
16422
      boolean this_present_success = true && this.isSetSuccess();
16423
      boolean that_present_success = true && that.isSetSuccess();
16424
      if (this_present_success || that_present_success) {
16425
        if (!(this_present_success && that_present_success))
16426
          return false;
16427
        if (!this.success.equals(that.success))
16428
          return false;
16429
      }
16430
 
16431
      return true;
16432
    }
16433
 
16434
    @Override
16435
    public int hashCode() {
16436
      return 0;
16437
    }
16438
 
16439
    public int compareTo(getRuleDocString_result other) {
16440
      if (!getClass().equals(other.getClass())) {
16441
        return getClass().getName().compareTo(other.getClass().getName());
16442
      }
16443
 
16444
      int lastComparison = 0;
16445
      getRuleDocString_result typedOther = (getRuleDocString_result)other;
16446
 
3430 rajveer 16447
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
3385 varun.gupt 16448
      if (lastComparison != 0) {
16449
        return lastComparison;
16450
      }
3430 rajveer 16451
      if (isSetSuccess()) {
16452
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
16453
        if (lastComparison != 0) {
16454
          return lastComparison;
16455
        }
3385 varun.gupt 16456
      }
16457
      return 0;
16458
    }
16459
 
3430 rajveer 16460
    public _Fields fieldForId(int fieldId) {
16461
      return _Fields.findByThriftId(fieldId);
16462
    }
16463
 
16464
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16465
      org.apache.thrift.protocol.TField field;
3385 varun.gupt 16466
      iprot.readStructBegin();
16467
      while (true)
16468
      {
16469
        field = iprot.readFieldBegin();
3430 rajveer 16470
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
3385 varun.gupt 16471
          break;
16472
        }
3430 rajveer 16473
        switch (field.id) {
16474
          case 0: // SUCCESS
16475
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
16476
              this.success = iprot.readString();
16477
            } else { 
16478
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16479
            }
16480
            break;
16481
          default:
16482
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
3385 varun.gupt 16483
        }
3430 rajveer 16484
        iprot.readFieldEnd();
3385 varun.gupt 16485
      }
16486
      iprot.readStructEnd();
16487
      validate();
16488
    }
16489
 
3430 rajveer 16490
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
3385 varun.gupt 16491
      oprot.writeStructBegin(STRUCT_DESC);
16492
 
16493
      if (this.isSetSuccess()) {
16494
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
16495
        oprot.writeString(this.success);
16496
        oprot.writeFieldEnd();
16497
      }
16498
      oprot.writeFieldStop();
16499
      oprot.writeStructEnd();
16500
    }
16501
 
16502
    @Override
16503
    public String toString() {
16504
      StringBuilder sb = new StringBuilder("getRuleDocString_result(");
16505
      boolean first = true;
16506
 
16507
      sb.append("success:");
16508
      if (this.success == null) {
16509
        sb.append("null");
16510
      } else {
16511
        sb.append(this.success);
16512
      }
16513
      first = false;
16514
      sb.append(")");
16515
      return sb.toString();
16516
    }
16517
 
3430 rajveer 16518
    public void validate() throws org.apache.thrift.TException {
3385 varun.gupt 16519
      // check for required fields
16520
    }
16521
 
3430 rajveer 16522
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16523
      try {
16524
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16525
      } catch (org.apache.thrift.TException te) {
16526
        throw new java.io.IOException(te);
16527
      }
16528
    }
16529
 
16530
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16531
      try {
16532
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16533
      } catch (org.apache.thrift.TException te) {
16534
        throw new java.io.IOException(te);
16535
      }
16536
    }
16537
 
3385 varun.gupt 16538
  }
16539
 
4189 varun.gupt 16540
  public static class getItemDiscountMap_args implements org.apache.thrift.TBase<getItemDiscountMap_args, getItemDiscountMap_args._Fields>, java.io.Serializable, Cloneable   {
16541
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_args");
16542
 
16543
    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);
16544
 
16545
    private List<Long> itemIds; // required
16546
 
16547
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
16548
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
16549
      ITEM_IDS((short)1, "itemIds");
16550
 
16551
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16552
 
16553
      static {
16554
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16555
          byName.put(field.getFieldName(), field);
16556
        }
16557
      }
16558
 
16559
      /**
16560
       * Find the _Fields constant that matches fieldId, or null if its not found.
16561
       */
16562
      public static _Fields findByThriftId(int fieldId) {
16563
        switch(fieldId) {
16564
          case 1: // ITEM_IDS
16565
            return ITEM_IDS;
16566
          default:
16567
            return null;
16568
        }
16569
      }
16570
 
16571
      /**
16572
       * Find the _Fields constant that matches fieldId, throwing an exception
16573
       * if it is not found.
16574
       */
16575
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16576
        _Fields fields = findByThriftId(fieldId);
16577
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16578
        return fields;
16579
      }
16580
 
16581
      /**
16582
       * Find the _Fields constant that matches name, or null if its not found.
16583
       */
16584
      public static _Fields findByName(String name) {
16585
        return byName.get(name);
16586
      }
16587
 
16588
      private final short _thriftId;
16589
      private final String _fieldName;
16590
 
16591
      _Fields(short thriftId, String fieldName) {
16592
        _thriftId = thriftId;
16593
        _fieldName = fieldName;
16594
      }
16595
 
16596
      public short getThriftFieldId() {
16597
        return _thriftId;
16598
      }
16599
 
16600
      public String getFieldName() {
16601
        return _fieldName;
16602
      }
16603
    }
16604
 
16605
    // isset id assignments
16606
 
16607
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
16608
    static {
16609
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16610
      tmpMap.put(_Fields.ITEM_IDS, new org.apache.thrift.meta_data.FieldMetaData("itemIds", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16611
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
16612
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
16613
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16614
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_args.class, metaDataMap);
16615
    }
16616
 
16617
    public getItemDiscountMap_args() {
16618
    }
16619
 
16620
    public getItemDiscountMap_args(
16621
      List<Long> itemIds)
16622
    {
16623
      this();
16624
      this.itemIds = itemIds;
16625
    }
16626
 
16627
    /**
16628
     * Performs a deep copy on <i>other</i>.
16629
     */
16630
    public getItemDiscountMap_args(getItemDiscountMap_args other) {
16631
      if (other.isSetItemIds()) {
16632
        List<Long> __this__itemIds = new ArrayList<Long>();
16633
        for (Long other_element : other.itemIds) {
16634
          __this__itemIds.add(other_element);
16635
        }
16636
        this.itemIds = __this__itemIds;
16637
      }
16638
    }
16639
 
16640
    public getItemDiscountMap_args deepCopy() {
16641
      return new getItemDiscountMap_args(this);
16642
    }
16643
 
16644
    @Override
16645
    public void clear() {
16646
      this.itemIds = null;
16647
    }
16648
 
16649
    public int getItemIdsSize() {
16650
      return (this.itemIds == null) ? 0 : this.itemIds.size();
16651
    }
16652
 
16653
    public java.util.Iterator<Long> getItemIdsIterator() {
16654
      return (this.itemIds == null) ? null : this.itemIds.iterator();
16655
    }
16656
 
16657
    public void addToItemIds(long elem) {
16658
      if (this.itemIds == null) {
16659
        this.itemIds = new ArrayList<Long>();
16660
      }
16661
      this.itemIds.add(elem);
16662
    }
16663
 
16664
    public List<Long> getItemIds() {
16665
      return this.itemIds;
16666
    }
16667
 
16668
    public void setItemIds(List<Long> itemIds) {
16669
      this.itemIds = itemIds;
16670
    }
16671
 
16672
    public void unsetItemIds() {
16673
      this.itemIds = null;
16674
    }
16675
 
16676
    /** Returns true if field itemIds is set (has been assigned a value) and false otherwise */
16677
    public boolean isSetItemIds() {
16678
      return this.itemIds != null;
16679
    }
16680
 
16681
    public void setItemIdsIsSet(boolean value) {
16682
      if (!value) {
16683
        this.itemIds = null;
16684
      }
16685
    }
16686
 
16687
    public void setFieldValue(_Fields field, Object value) {
16688
      switch (field) {
16689
      case ITEM_IDS:
16690
        if (value == null) {
16691
          unsetItemIds();
16692
        } else {
16693
          setItemIds((List<Long>)value);
16694
        }
16695
        break;
16696
 
16697
      }
16698
    }
16699
 
16700
    public Object getFieldValue(_Fields field) {
16701
      switch (field) {
16702
      case ITEM_IDS:
16703
        return getItemIds();
16704
 
16705
      }
16706
      throw new IllegalStateException();
16707
    }
16708
 
16709
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
16710
    public boolean isSet(_Fields field) {
16711
      if (field == null) {
16712
        throw new IllegalArgumentException();
16713
      }
16714
 
16715
      switch (field) {
16716
      case ITEM_IDS:
16717
        return isSetItemIds();
16718
      }
16719
      throw new IllegalStateException();
16720
    }
16721
 
16722
    @Override
16723
    public boolean equals(Object that) {
16724
      if (that == null)
16725
        return false;
16726
      if (that instanceof getItemDiscountMap_args)
16727
        return this.equals((getItemDiscountMap_args)that);
16728
      return false;
16729
    }
16730
 
16731
    public boolean equals(getItemDiscountMap_args that) {
16732
      if (that == null)
16733
        return false;
16734
 
16735
      boolean this_present_itemIds = true && this.isSetItemIds();
16736
      boolean that_present_itemIds = true && that.isSetItemIds();
16737
      if (this_present_itemIds || that_present_itemIds) {
16738
        if (!(this_present_itemIds && that_present_itemIds))
16739
          return false;
16740
        if (!this.itemIds.equals(that.itemIds))
16741
          return false;
16742
      }
16743
 
16744
      return true;
16745
    }
16746
 
16747
    @Override
16748
    public int hashCode() {
16749
      return 0;
16750
    }
16751
 
16752
    public int compareTo(getItemDiscountMap_args other) {
16753
      if (!getClass().equals(other.getClass())) {
16754
        return getClass().getName().compareTo(other.getClass().getName());
16755
      }
16756
 
16757
      int lastComparison = 0;
16758
      getItemDiscountMap_args typedOther = (getItemDiscountMap_args)other;
16759
 
16760
      lastComparison = Boolean.valueOf(isSetItemIds()).compareTo(typedOther.isSetItemIds());
16761
      if (lastComparison != 0) {
16762
        return lastComparison;
16763
      }
16764
      if (isSetItemIds()) {
16765
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemIds, typedOther.itemIds);
16766
        if (lastComparison != 0) {
16767
          return lastComparison;
16768
        }
16769
      }
16770
      return 0;
16771
    }
16772
 
16773
    public _Fields fieldForId(int fieldId) {
16774
      return _Fields.findByThriftId(fieldId);
16775
    }
16776
 
16777
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
16778
      org.apache.thrift.protocol.TField field;
16779
      iprot.readStructBegin();
16780
      while (true)
16781
      {
16782
        field = iprot.readFieldBegin();
16783
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
16784
          break;
16785
        }
16786
        switch (field.id) {
16787
          case 1: // ITEM_IDS
16788
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
16789
              {
7092 amit.gupta 16790
                org.apache.thrift.protocol.TList _list38 = iprot.readListBegin();
16791
                this.itemIds = new ArrayList<Long>(_list38.size);
16792
                for (int _i39 = 0; _i39 < _list38.size; ++_i39)
4189 varun.gupt 16793
                {
7092 amit.gupta 16794
                  long _elem40; // required
16795
                  _elem40 = iprot.readI64();
16796
                  this.itemIds.add(_elem40);
4189 varun.gupt 16797
                }
16798
                iprot.readListEnd();
16799
              }
16800
            } else { 
16801
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16802
            }
16803
            break;
16804
          default:
16805
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
16806
        }
16807
        iprot.readFieldEnd();
16808
      }
16809
      iprot.readStructEnd();
16810
      validate();
16811
    }
16812
 
16813
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
16814
      validate();
16815
 
16816
      oprot.writeStructBegin(STRUCT_DESC);
16817
      if (this.itemIds != null) {
16818
        oprot.writeFieldBegin(ITEM_IDS_FIELD_DESC);
16819
        {
16820
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.itemIds.size()));
7092 amit.gupta 16821
          for (long _iter41 : this.itemIds)
4189 varun.gupt 16822
          {
7092 amit.gupta 16823
            oprot.writeI64(_iter41);
4189 varun.gupt 16824
          }
16825
          oprot.writeListEnd();
16826
        }
16827
        oprot.writeFieldEnd();
16828
      }
16829
      oprot.writeFieldStop();
16830
      oprot.writeStructEnd();
16831
    }
16832
 
16833
    @Override
16834
    public String toString() {
16835
      StringBuilder sb = new StringBuilder("getItemDiscountMap_args(");
16836
      boolean first = true;
16837
 
16838
      sb.append("itemIds:");
16839
      if (this.itemIds == null) {
16840
        sb.append("null");
16841
      } else {
16842
        sb.append(this.itemIds);
16843
      }
16844
      first = false;
16845
      sb.append(")");
16846
      return sb.toString();
16847
    }
16848
 
16849
    public void validate() throws org.apache.thrift.TException {
16850
      // check for required fields
16851
    }
16852
 
16853
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
16854
      try {
16855
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
16856
      } catch (org.apache.thrift.TException te) {
16857
        throw new java.io.IOException(te);
16858
      }
16859
    }
16860
 
16861
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
16862
      try {
16863
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
16864
      } catch (org.apache.thrift.TException te) {
16865
        throw new java.io.IOException(te);
16866
      }
16867
    }
16868
 
16869
  }
16870
 
16871
  public static class getItemDiscountMap_result implements org.apache.thrift.TBase<getItemDiscountMap_result, getItemDiscountMap_result._Fields>, java.io.Serializable, Cloneable   {
16872
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemDiscountMap_result");
16873
 
16874
    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);
16875
    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);
16876
 
16877
    private List<ItemCouponDiscount> success; // required
16878
    private PromotionException pex; // required
16879
 
16880
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
16881
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
16882
      SUCCESS((short)0, "success"),
16883
      PEX((short)1, "pex");
16884
 
16885
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
16886
 
16887
      static {
16888
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
16889
          byName.put(field.getFieldName(), field);
16890
        }
16891
      }
16892
 
16893
      /**
16894
       * Find the _Fields constant that matches fieldId, or null if its not found.
16895
       */
16896
      public static _Fields findByThriftId(int fieldId) {
16897
        switch(fieldId) {
16898
          case 0: // SUCCESS
16899
            return SUCCESS;
16900
          case 1: // PEX
16901
            return PEX;
16902
          default:
16903
            return null;
16904
        }
16905
      }
16906
 
16907
      /**
16908
       * Find the _Fields constant that matches fieldId, throwing an exception
16909
       * if it is not found.
16910
       */
16911
      public static _Fields findByThriftIdOrThrow(int fieldId) {
16912
        _Fields fields = findByThriftId(fieldId);
16913
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
16914
        return fields;
16915
      }
16916
 
16917
      /**
16918
       * Find the _Fields constant that matches name, or null if its not found.
16919
       */
16920
      public static _Fields findByName(String name) {
16921
        return byName.get(name);
16922
      }
16923
 
16924
      private final short _thriftId;
16925
      private final String _fieldName;
16926
 
16927
      _Fields(short thriftId, String fieldName) {
16928
        _thriftId = thriftId;
16929
        _fieldName = fieldName;
16930
      }
16931
 
16932
      public short getThriftFieldId() {
16933
        return _thriftId;
16934
      }
16935
 
16936
      public String getFieldName() {
16937
        return _fieldName;
16938
      }
16939
    }
16940
 
16941
    // isset id assignments
16942
 
16943
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
16944
    static {
16945
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
16946
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16947
          new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
16948
              new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ItemCouponDiscount.class))));
16949
      tmpMap.put(_Fields.PEX, new org.apache.thrift.meta_data.FieldMetaData("pex", org.apache.thrift.TFieldRequirementType.DEFAULT, 
16950
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
16951
      metaDataMap = Collections.unmodifiableMap(tmpMap);
16952
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemDiscountMap_result.class, metaDataMap);
16953
    }
16954
 
16955
    public getItemDiscountMap_result() {
16956
    }
16957
 
16958
    public getItemDiscountMap_result(
16959
      List<ItemCouponDiscount> success,
16960
      PromotionException pex)
16961
    {
16962
      this();
16963
      this.success = success;
16964
      this.pex = pex;
16965
    }
16966
 
16967
    /**
16968
     * Performs a deep copy on <i>other</i>.
16969
     */
16970
    public getItemDiscountMap_result(getItemDiscountMap_result other) {
16971
      if (other.isSetSuccess()) {
16972
        List<ItemCouponDiscount> __this__success = new ArrayList<ItemCouponDiscount>();
16973
        for (ItemCouponDiscount other_element : other.success) {
16974
          __this__success.add(new ItemCouponDiscount(other_element));
16975
        }
16976
        this.success = __this__success;
16977
      }
16978
      if (other.isSetPex()) {
16979
        this.pex = new PromotionException(other.pex);
16980
      }
16981
    }
16982
 
16983
    public getItemDiscountMap_result deepCopy() {
16984
      return new getItemDiscountMap_result(this);
16985
    }
16986
 
16987
    @Override
16988
    public void clear() {
16989
      this.success = null;
16990
      this.pex = null;
16991
    }
16992
 
16993
    public int getSuccessSize() {
16994
      return (this.success == null) ? 0 : this.success.size();
16995
    }
16996
 
16997
    public java.util.Iterator<ItemCouponDiscount> getSuccessIterator() {
16998
      return (this.success == null) ? null : this.success.iterator();
16999
    }
17000
 
17001
    public void addToSuccess(ItemCouponDiscount elem) {
17002
      if (this.success == null) {
17003
        this.success = new ArrayList<ItemCouponDiscount>();
17004
      }
17005
      this.success.add(elem);
17006
    }
17007
 
17008
    public List<ItemCouponDiscount> getSuccess() {
17009
      return this.success;
17010
    }
17011
 
17012
    public void setSuccess(List<ItemCouponDiscount> success) {
17013
      this.success = success;
17014
    }
17015
 
17016
    public void unsetSuccess() {
17017
      this.success = null;
17018
    }
17019
 
17020
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
17021
    public boolean isSetSuccess() {
17022
      return this.success != null;
17023
    }
17024
 
17025
    public void setSuccessIsSet(boolean value) {
17026
      if (!value) {
17027
        this.success = null;
17028
      }
17029
    }
17030
 
17031
    public PromotionException getPex() {
17032
      return this.pex;
17033
    }
17034
 
17035
    public void setPex(PromotionException pex) {
17036
      this.pex = pex;
17037
    }
17038
 
17039
    public void unsetPex() {
17040
      this.pex = null;
17041
    }
17042
 
17043
    /** Returns true if field pex is set (has been assigned a value) and false otherwise */
17044
    public boolean isSetPex() {
17045
      return this.pex != null;
17046
    }
17047
 
17048
    public void setPexIsSet(boolean value) {
17049
      if (!value) {
17050
        this.pex = null;
17051
      }
17052
    }
17053
 
17054
    public void setFieldValue(_Fields field, Object value) {
17055
      switch (field) {
17056
      case SUCCESS:
17057
        if (value == null) {
17058
          unsetSuccess();
17059
        } else {
17060
          setSuccess((List<ItemCouponDiscount>)value);
17061
        }
17062
        break;
17063
 
17064
      case PEX:
17065
        if (value == null) {
17066
          unsetPex();
17067
        } else {
17068
          setPex((PromotionException)value);
17069
        }
17070
        break;
17071
 
17072
      }
17073
    }
17074
 
17075
    public Object getFieldValue(_Fields field) {
17076
      switch (field) {
17077
      case SUCCESS:
17078
        return getSuccess();
17079
 
17080
      case PEX:
17081
        return getPex();
17082
 
17083
      }
17084
      throw new IllegalStateException();
17085
    }
17086
 
17087
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
17088
    public boolean isSet(_Fields field) {
17089
      if (field == null) {
17090
        throw new IllegalArgumentException();
17091
      }
17092
 
17093
      switch (field) {
17094
      case SUCCESS:
17095
        return isSetSuccess();
17096
      case PEX:
17097
        return isSetPex();
17098
      }
17099
      throw new IllegalStateException();
17100
    }
17101
 
17102
    @Override
17103
    public boolean equals(Object that) {
17104
      if (that == null)
17105
        return false;
17106
      if (that instanceof getItemDiscountMap_result)
17107
        return this.equals((getItemDiscountMap_result)that);
17108
      return false;
17109
    }
17110
 
17111
    public boolean equals(getItemDiscountMap_result that) {
17112
      if (that == null)
17113
        return false;
17114
 
17115
      boolean this_present_success = true && this.isSetSuccess();
17116
      boolean that_present_success = true && that.isSetSuccess();
17117
      if (this_present_success || that_present_success) {
17118
        if (!(this_present_success && that_present_success))
17119
          return false;
17120
        if (!this.success.equals(that.success))
17121
          return false;
17122
      }
17123
 
17124
      boolean this_present_pex = true && this.isSetPex();
17125
      boolean that_present_pex = true && that.isSetPex();
17126
      if (this_present_pex || that_present_pex) {
17127
        if (!(this_present_pex && that_present_pex))
17128
          return false;
17129
        if (!this.pex.equals(that.pex))
17130
          return false;
17131
      }
17132
 
17133
      return true;
17134
    }
17135
 
17136
    @Override
17137
    public int hashCode() {
17138
      return 0;
17139
    }
17140
 
17141
    public int compareTo(getItemDiscountMap_result other) {
17142
      if (!getClass().equals(other.getClass())) {
17143
        return getClass().getName().compareTo(other.getClass().getName());
17144
      }
17145
 
17146
      int lastComparison = 0;
17147
      getItemDiscountMap_result typedOther = (getItemDiscountMap_result)other;
17148
 
17149
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
17150
      if (lastComparison != 0) {
17151
        return lastComparison;
17152
      }
17153
      if (isSetSuccess()) {
17154
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
17155
        if (lastComparison != 0) {
17156
          return lastComparison;
17157
        }
17158
      }
17159
      lastComparison = Boolean.valueOf(isSetPex()).compareTo(typedOther.isSetPex());
17160
      if (lastComparison != 0) {
17161
        return lastComparison;
17162
      }
17163
      if (isSetPex()) {
17164
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pex, typedOther.pex);
17165
        if (lastComparison != 0) {
17166
          return lastComparison;
17167
        }
17168
      }
17169
      return 0;
17170
    }
17171
 
17172
    public _Fields fieldForId(int fieldId) {
17173
      return _Fields.findByThriftId(fieldId);
17174
    }
17175
 
17176
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17177
      org.apache.thrift.protocol.TField field;
17178
      iprot.readStructBegin();
17179
      while (true)
17180
      {
17181
        field = iprot.readFieldBegin();
17182
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17183
          break;
17184
        }
17185
        switch (field.id) {
17186
          case 0: // SUCCESS
17187
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
17188
              {
7092 amit.gupta 17189
                org.apache.thrift.protocol.TList _list42 = iprot.readListBegin();
17190
                this.success = new ArrayList<ItemCouponDiscount>(_list42.size);
17191
                for (int _i43 = 0; _i43 < _list42.size; ++_i43)
4189 varun.gupt 17192
                {
7092 amit.gupta 17193
                  ItemCouponDiscount _elem44; // required
17194
                  _elem44 = new ItemCouponDiscount();
17195
                  _elem44.read(iprot);
17196
                  this.success.add(_elem44);
4189 varun.gupt 17197
                }
17198
                iprot.readListEnd();
17199
              }
17200
            } else { 
17201
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17202
            }
17203
            break;
17204
          case 1: // PEX
17205
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
17206
              this.pex = new PromotionException();
17207
              this.pex.read(iprot);
17208
            } else { 
17209
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17210
            }
17211
            break;
17212
          default:
17213
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17214
        }
17215
        iprot.readFieldEnd();
17216
      }
17217
      iprot.readStructEnd();
17218
      validate();
17219
    }
17220
 
17221
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17222
      oprot.writeStructBegin(STRUCT_DESC);
17223
 
17224
      if (this.isSetSuccess()) {
17225
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
17226
        {
17227
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size()));
7092 amit.gupta 17228
          for (ItemCouponDiscount _iter45 : this.success)
4189 varun.gupt 17229
          {
7092 amit.gupta 17230
            _iter45.write(oprot);
4189 varun.gupt 17231
          }
17232
          oprot.writeListEnd();
17233
        }
17234
        oprot.writeFieldEnd();
17235
      } else if (this.isSetPex()) {
17236
        oprot.writeFieldBegin(PEX_FIELD_DESC);
17237
        this.pex.write(oprot);
17238
        oprot.writeFieldEnd();
17239
      }
17240
      oprot.writeFieldStop();
17241
      oprot.writeStructEnd();
17242
    }
17243
 
17244
    @Override
17245
    public String toString() {
17246
      StringBuilder sb = new StringBuilder("getItemDiscountMap_result(");
17247
      boolean first = true;
17248
 
17249
      sb.append("success:");
17250
      if (this.success == null) {
17251
        sb.append("null");
17252
      } else {
17253
        sb.append(this.success);
17254
      }
17255
      first = false;
17256
      if (!first) sb.append(", ");
17257
      sb.append("pex:");
17258
      if (this.pex == null) {
17259
        sb.append("null");
17260
      } else {
17261
        sb.append(this.pex);
17262
      }
17263
      first = false;
17264
      sb.append(")");
17265
      return sb.toString();
17266
    }
17267
 
17268
    public void validate() throws org.apache.thrift.TException {
17269
      // check for required fields
17270
    }
17271
 
17272
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17273
      try {
17274
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17275
      } catch (org.apache.thrift.TException te) {
17276
        throw new java.io.IOException(te);
17277
      }
17278
    }
17279
 
17280
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
17281
      try {
17282
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
17283
      } catch (org.apache.thrift.TException te) {
17284
        throw new java.io.IOException(te);
17285
      }
17286
    }
17287
 
17288
  }
17289
 
4494 varun.gupt 17290
  public static class getDiscountsForEntity_args implements org.apache.thrift.TBase<getDiscountsForEntity_args, getDiscountsForEntity_args._Fields>, java.io.Serializable, Cloneable   {
17291
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_args");
17292
 
17293
    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);
17294
 
17295
    private long entityId; // required
17296
 
17297
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
17298
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
17299
      ENTITY_ID((short)1, "entityId");
17300
 
17301
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
17302
 
17303
      static {
17304
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
17305
          byName.put(field.getFieldName(), field);
17306
        }
17307
      }
17308
 
17309
      /**
17310
       * Find the _Fields constant that matches fieldId, or null if its not found.
17311
       */
17312
      public static _Fields findByThriftId(int fieldId) {
17313
        switch(fieldId) {
17314
          case 1: // ENTITY_ID
17315
            return ENTITY_ID;
17316
          default:
17317
            return null;
17318
        }
17319
      }
17320
 
17321
      /**
17322
       * Find the _Fields constant that matches fieldId, throwing an exception
17323
       * if it is not found.
17324
       */
17325
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17326
        _Fields fields = findByThriftId(fieldId);
17327
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17328
        return fields;
17329
      }
17330
 
17331
      /**
17332
       * Find the _Fields constant that matches name, or null if its not found.
17333
       */
17334
      public static _Fields findByName(String name) {
17335
        return byName.get(name);
17336
      }
17337
 
17338
      private final short _thriftId;
17339
      private final String _fieldName;
17340
 
17341
      _Fields(short thriftId, String fieldName) {
17342
        _thriftId = thriftId;
17343
        _fieldName = fieldName;
17344
      }
17345
 
17346
      public short getThriftFieldId() {
17347
        return _thriftId;
17348
      }
17349
 
17350
      public String getFieldName() {
17351
        return _fieldName;
17352
      }
17353
    }
17354
 
17355
    // isset id assignments
17356
    private static final int __ENTITYID_ISSET_ID = 0;
17357
    private BitSet __isset_bit_vector = new BitSet(1);
17358
 
17359
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
17360
    static {
17361
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
17362
      tmpMap.put(_Fields.ENTITY_ID, new org.apache.thrift.meta_data.FieldMetaData("entityId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17363
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
17364
      metaDataMap = Collections.unmodifiableMap(tmpMap);
17365
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_args.class, metaDataMap);
17366
    }
17367
 
17368
    public getDiscountsForEntity_args() {
17369
    }
17370
 
17371
    public getDiscountsForEntity_args(
17372
      long entityId)
17373
    {
17374
      this();
17375
      this.entityId = entityId;
17376
      setEntityIdIsSet(true);
17377
    }
17378
 
17379
    /**
17380
     * Performs a deep copy on <i>other</i>.
17381
     */
17382
    public getDiscountsForEntity_args(getDiscountsForEntity_args other) {
17383
      __isset_bit_vector.clear();
17384
      __isset_bit_vector.or(other.__isset_bit_vector);
17385
      this.entityId = other.entityId;
17386
    }
17387
 
17388
    public getDiscountsForEntity_args deepCopy() {
17389
      return new getDiscountsForEntity_args(this);
17390
    }
17391
 
17392
    @Override
17393
    public void clear() {
17394
      setEntityIdIsSet(false);
17395
      this.entityId = 0;
17396
    }
17397
 
17398
    public long getEntityId() {
17399
      return this.entityId;
17400
    }
17401
 
17402
    public void setEntityId(long entityId) {
17403
      this.entityId = entityId;
17404
      setEntityIdIsSet(true);
17405
    }
17406
 
17407
    public void unsetEntityId() {
17408
      __isset_bit_vector.clear(__ENTITYID_ISSET_ID);
17409
    }
17410
 
17411
    /** Returns true if field entityId is set (has been assigned a value) and false otherwise */
17412
    public boolean isSetEntityId() {
17413
      return __isset_bit_vector.get(__ENTITYID_ISSET_ID);
17414
    }
17415
 
17416
    public void setEntityIdIsSet(boolean value) {
17417
      __isset_bit_vector.set(__ENTITYID_ISSET_ID, value);
17418
    }
17419
 
17420
    public void setFieldValue(_Fields field, Object value) {
17421
      switch (field) {
17422
      case ENTITY_ID:
17423
        if (value == null) {
17424
          unsetEntityId();
17425
        } else {
17426
          setEntityId((Long)value);
17427
        }
17428
        break;
17429
 
17430
      }
17431
    }
17432
 
17433
    public Object getFieldValue(_Fields field) {
17434
      switch (field) {
17435
      case ENTITY_ID:
17436
        return Long.valueOf(getEntityId());
17437
 
17438
      }
17439
      throw new IllegalStateException();
17440
    }
17441
 
17442
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
17443
    public boolean isSet(_Fields field) {
17444
      if (field == null) {
17445
        throw new IllegalArgumentException();
17446
      }
17447
 
17448
      switch (field) {
17449
      case ENTITY_ID:
17450
        return isSetEntityId();
17451
      }
17452
      throw new IllegalStateException();
17453
    }
17454
 
17455
    @Override
17456
    public boolean equals(Object that) {
17457
      if (that == null)
17458
        return false;
17459
      if (that instanceof getDiscountsForEntity_args)
17460
        return this.equals((getDiscountsForEntity_args)that);
17461
      return false;
17462
    }
17463
 
17464
    public boolean equals(getDiscountsForEntity_args that) {
17465
      if (that == null)
17466
        return false;
17467
 
17468
      boolean this_present_entityId = true;
17469
      boolean that_present_entityId = true;
17470
      if (this_present_entityId || that_present_entityId) {
17471
        if (!(this_present_entityId && that_present_entityId))
17472
          return false;
17473
        if (this.entityId != that.entityId)
17474
          return false;
17475
      }
17476
 
17477
      return true;
17478
    }
17479
 
17480
    @Override
17481
    public int hashCode() {
17482
      return 0;
17483
    }
17484
 
17485
    public int compareTo(getDiscountsForEntity_args other) {
17486
      if (!getClass().equals(other.getClass())) {
17487
        return getClass().getName().compareTo(other.getClass().getName());
17488
      }
17489
 
17490
      int lastComparison = 0;
17491
      getDiscountsForEntity_args typedOther = (getDiscountsForEntity_args)other;
17492
 
17493
      lastComparison = Boolean.valueOf(isSetEntityId()).compareTo(typedOther.isSetEntityId());
17494
      if (lastComparison != 0) {
17495
        return lastComparison;
17496
      }
17497
      if (isSetEntityId()) {
17498
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityId, typedOther.entityId);
17499
        if (lastComparison != 0) {
17500
          return lastComparison;
17501
        }
17502
      }
17503
      return 0;
17504
    }
17505
 
17506
    public _Fields fieldForId(int fieldId) {
17507
      return _Fields.findByThriftId(fieldId);
17508
    }
17509
 
17510
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17511
      org.apache.thrift.protocol.TField field;
17512
      iprot.readStructBegin();
17513
      while (true)
17514
      {
17515
        field = iprot.readFieldBegin();
17516
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17517
          break;
17518
        }
17519
        switch (field.id) {
17520
          case 1: // ENTITY_ID
17521
            if (field.type == org.apache.thrift.protocol.TType.I64) {
17522
              this.entityId = iprot.readI64();
17523
              setEntityIdIsSet(true);
17524
            } else { 
17525
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17526
            }
17527
            break;
17528
          default:
17529
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17530
        }
17531
        iprot.readFieldEnd();
17532
      }
17533
      iprot.readStructEnd();
17534
      validate();
17535
    }
17536
 
17537
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17538
      validate();
17539
 
17540
      oprot.writeStructBegin(STRUCT_DESC);
17541
      oprot.writeFieldBegin(ENTITY_ID_FIELD_DESC);
17542
      oprot.writeI64(this.entityId);
17543
      oprot.writeFieldEnd();
17544
      oprot.writeFieldStop();
17545
      oprot.writeStructEnd();
17546
    }
17547
 
17548
    @Override
17549
    public String toString() {
17550
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_args(");
17551
      boolean first = true;
17552
 
17553
      sb.append("entityId:");
17554
      sb.append(this.entityId);
17555
      first = false;
17556
      sb.append(")");
17557
      return sb.toString();
17558
    }
17559
 
17560
    public void validate() throws org.apache.thrift.TException {
17561
      // check for required fields
17562
    }
17563
 
17564
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17565
      try {
17566
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17567
      } catch (org.apache.thrift.TException te) {
17568
        throw new java.io.IOException(te);
17569
      }
17570
    }
17571
 
17572
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
17573
      try {
17574
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
17575
        __isset_bit_vector = new BitSet(1);
17576
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
17577
      } catch (org.apache.thrift.TException te) {
17578
        throw new java.io.IOException(te);
17579
      }
17580
    }
17581
 
17582
  }
17583
 
17584
  public static class getDiscountsForEntity_result implements org.apache.thrift.TBase<getDiscountsForEntity_result, getDiscountsForEntity_result._Fields>, java.io.Serializable, Cloneable   {
17585
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDiscountsForEntity_result");
17586
 
17587
    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);
17588
 
17589
    private Map<String,Double> success; // required
17590
 
17591
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
17592
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
17593
      SUCCESS((short)0, "success");
17594
 
17595
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
17596
 
17597
      static {
17598
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
17599
          byName.put(field.getFieldName(), field);
17600
        }
17601
      }
17602
 
17603
      /**
17604
       * Find the _Fields constant that matches fieldId, or null if its not found.
17605
       */
17606
      public static _Fields findByThriftId(int fieldId) {
17607
        switch(fieldId) {
17608
          case 0: // SUCCESS
17609
            return SUCCESS;
17610
          default:
17611
            return null;
17612
        }
17613
      }
17614
 
17615
      /**
17616
       * Find the _Fields constant that matches fieldId, throwing an exception
17617
       * if it is not found.
17618
       */
17619
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17620
        _Fields fields = findByThriftId(fieldId);
17621
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17622
        return fields;
17623
      }
17624
 
17625
      /**
17626
       * Find the _Fields constant that matches name, or null if its not found.
17627
       */
17628
      public static _Fields findByName(String name) {
17629
        return byName.get(name);
17630
      }
17631
 
17632
      private final short _thriftId;
17633
      private final String _fieldName;
17634
 
17635
      _Fields(short thriftId, String fieldName) {
17636
        _thriftId = thriftId;
17637
        _fieldName = fieldName;
17638
      }
17639
 
17640
      public short getThriftFieldId() {
17641
        return _thriftId;
17642
      }
17643
 
17644
      public String getFieldName() {
17645
        return _fieldName;
17646
      }
17647
    }
17648
 
17649
    // isset id assignments
17650
 
17651
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
17652
    static {
17653
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
17654
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17655
          new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
17656
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
17657
              new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))));
17658
      metaDataMap = Collections.unmodifiableMap(tmpMap);
17659
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getDiscountsForEntity_result.class, metaDataMap);
17660
    }
17661
 
17662
    public getDiscountsForEntity_result() {
17663
    }
17664
 
17665
    public getDiscountsForEntity_result(
17666
      Map<String,Double> success)
17667
    {
17668
      this();
17669
      this.success = success;
17670
    }
17671
 
17672
    /**
17673
     * Performs a deep copy on <i>other</i>.
17674
     */
17675
    public getDiscountsForEntity_result(getDiscountsForEntity_result other) {
17676
      if (other.isSetSuccess()) {
17677
        Map<String,Double> __this__success = new HashMap<String,Double>();
17678
        for (Map.Entry<String, Double> other_element : other.success.entrySet()) {
17679
 
17680
          String other_element_key = other_element.getKey();
17681
          Double other_element_value = other_element.getValue();
17682
 
17683
          String __this__success_copy_key = other_element_key;
17684
 
17685
          Double __this__success_copy_value = other_element_value;
17686
 
17687
          __this__success.put(__this__success_copy_key, __this__success_copy_value);
17688
        }
17689
        this.success = __this__success;
17690
      }
17691
    }
17692
 
17693
    public getDiscountsForEntity_result deepCopy() {
17694
      return new getDiscountsForEntity_result(this);
17695
    }
17696
 
17697
    @Override
17698
    public void clear() {
17699
      this.success = null;
17700
    }
17701
 
17702
    public int getSuccessSize() {
17703
      return (this.success == null) ? 0 : this.success.size();
17704
    }
17705
 
17706
    public void putToSuccess(String key, double val) {
17707
      if (this.success == null) {
17708
        this.success = new HashMap<String,Double>();
17709
      }
17710
      this.success.put(key, val);
17711
    }
17712
 
17713
    public Map<String,Double> getSuccess() {
17714
      return this.success;
17715
    }
17716
 
17717
    public void setSuccess(Map<String,Double> success) {
17718
      this.success = success;
17719
    }
17720
 
17721
    public void unsetSuccess() {
17722
      this.success = null;
17723
    }
17724
 
17725
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
17726
    public boolean isSetSuccess() {
17727
      return this.success != null;
17728
    }
17729
 
17730
    public void setSuccessIsSet(boolean value) {
17731
      if (!value) {
17732
        this.success = null;
17733
      }
17734
    }
17735
 
17736
    public void setFieldValue(_Fields field, Object value) {
17737
      switch (field) {
17738
      case SUCCESS:
17739
        if (value == null) {
17740
          unsetSuccess();
17741
        } else {
17742
          setSuccess((Map<String,Double>)value);
17743
        }
17744
        break;
17745
 
17746
      }
17747
    }
17748
 
17749
    public Object getFieldValue(_Fields field) {
17750
      switch (field) {
17751
      case SUCCESS:
17752
        return getSuccess();
17753
 
17754
      }
17755
      throw new IllegalStateException();
17756
    }
17757
 
17758
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
17759
    public boolean isSet(_Fields field) {
17760
      if (field == null) {
17761
        throw new IllegalArgumentException();
17762
      }
17763
 
17764
      switch (field) {
17765
      case SUCCESS:
17766
        return isSetSuccess();
17767
      }
17768
      throw new IllegalStateException();
17769
    }
17770
 
17771
    @Override
17772
    public boolean equals(Object that) {
17773
      if (that == null)
17774
        return false;
17775
      if (that instanceof getDiscountsForEntity_result)
17776
        return this.equals((getDiscountsForEntity_result)that);
17777
      return false;
17778
    }
17779
 
17780
    public boolean equals(getDiscountsForEntity_result that) {
17781
      if (that == null)
17782
        return false;
17783
 
17784
      boolean this_present_success = true && this.isSetSuccess();
17785
      boolean that_present_success = true && that.isSetSuccess();
17786
      if (this_present_success || that_present_success) {
17787
        if (!(this_present_success && that_present_success))
17788
          return false;
17789
        if (!this.success.equals(that.success))
17790
          return false;
17791
      }
17792
 
17793
      return true;
17794
    }
17795
 
17796
    @Override
17797
    public int hashCode() {
17798
      return 0;
17799
    }
17800
 
17801
    public int compareTo(getDiscountsForEntity_result other) {
17802
      if (!getClass().equals(other.getClass())) {
17803
        return getClass().getName().compareTo(other.getClass().getName());
17804
      }
17805
 
17806
      int lastComparison = 0;
17807
      getDiscountsForEntity_result typedOther = (getDiscountsForEntity_result)other;
17808
 
17809
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
17810
      if (lastComparison != 0) {
17811
        return lastComparison;
17812
      }
17813
      if (isSetSuccess()) {
17814
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
17815
        if (lastComparison != 0) {
17816
          return lastComparison;
17817
        }
17818
      }
17819
      return 0;
17820
    }
17821
 
17822
    public _Fields fieldForId(int fieldId) {
17823
      return _Fields.findByThriftId(fieldId);
17824
    }
17825
 
17826
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
17827
      org.apache.thrift.protocol.TField field;
17828
      iprot.readStructBegin();
17829
      while (true)
17830
      {
17831
        field = iprot.readFieldBegin();
17832
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
17833
          break;
17834
        }
17835
        switch (field.id) {
17836
          case 0: // SUCCESS
17837
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
17838
              {
7092 amit.gupta 17839
                org.apache.thrift.protocol.TMap _map46 = iprot.readMapBegin();
17840
                this.success = new HashMap<String,Double>(2*_map46.size);
17841
                for (int _i47 = 0; _i47 < _map46.size; ++_i47)
4494 varun.gupt 17842
                {
7092 amit.gupta 17843
                  String _key48; // required
17844
                  double _val49; // required
17845
                  _key48 = iprot.readString();
17846
                  _val49 = iprot.readDouble();
17847
                  this.success.put(_key48, _val49);
4494 varun.gupt 17848
                }
17849
                iprot.readMapEnd();
17850
              }
17851
            } else { 
17852
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17853
            }
17854
            break;
17855
          default:
17856
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
17857
        }
17858
        iprot.readFieldEnd();
17859
      }
17860
      iprot.readStructEnd();
17861
      validate();
17862
    }
17863
 
17864
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
17865
      oprot.writeStructBegin(STRUCT_DESC);
17866
 
17867
      if (this.isSetSuccess()) {
17868
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
17869
        {
17870
          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 17871
          for (Map.Entry<String, Double> _iter50 : this.success.entrySet())
4494 varun.gupt 17872
          {
7092 amit.gupta 17873
            oprot.writeString(_iter50.getKey());
17874
            oprot.writeDouble(_iter50.getValue());
4494 varun.gupt 17875
          }
17876
          oprot.writeMapEnd();
17877
        }
17878
        oprot.writeFieldEnd();
17879
      }
17880
      oprot.writeFieldStop();
17881
      oprot.writeStructEnd();
17882
    }
17883
 
17884
    @Override
17885
    public String toString() {
17886
      StringBuilder sb = new StringBuilder("getDiscountsForEntity_result(");
17887
      boolean first = true;
17888
 
17889
      sb.append("success:");
17890
      if (this.success == null) {
17891
        sb.append("null");
17892
      } else {
17893
        sb.append(this.success);
17894
      }
17895
      first = false;
17896
      sb.append(")");
17897
      return sb.toString();
17898
    }
17899
 
17900
    public void validate() throws org.apache.thrift.TException {
17901
      // check for required fields
17902
    }
17903
 
17904
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
17905
      try {
17906
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
17907
      } catch (org.apache.thrift.TException te) {
17908
        throw new java.io.IOException(te);
17909
      }
17910
    }
17911
 
17912
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
17913
      try {
17914
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
17915
      } catch (org.apache.thrift.TException te) {
17916
        throw new java.io.IOException(te);
17917
      }
17918
    }
17919
 
17920
  }
17921
 
5469 rajveer 17922
  public static class addVoucher_args implements org.apache.thrift.TBase<addVoucher_args, addVoucher_args._Fields>, java.io.Serializable, Cloneable   {
17923
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_args");
17924
 
17925
    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);
17926
 
17927
    private Voucher voucher; // required
17928
 
17929
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
17930
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
17931
      VOUCHER((short)1, "voucher");
17932
 
17933
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
17934
 
17935
      static {
17936
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
17937
          byName.put(field.getFieldName(), field);
17938
        }
17939
      }
17940
 
17941
      /**
17942
       * Find the _Fields constant that matches fieldId, or null if its not found.
17943
       */
17944
      public static _Fields findByThriftId(int fieldId) {
17945
        switch(fieldId) {
17946
          case 1: // VOUCHER
17947
            return VOUCHER;
17948
          default:
17949
            return null;
17950
        }
17951
      }
17952
 
17953
      /**
17954
       * Find the _Fields constant that matches fieldId, throwing an exception
17955
       * if it is not found.
17956
       */
17957
      public static _Fields findByThriftIdOrThrow(int fieldId) {
17958
        _Fields fields = findByThriftId(fieldId);
17959
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
17960
        return fields;
17961
      }
17962
 
17963
      /**
17964
       * Find the _Fields constant that matches name, or null if its not found.
17965
       */
17966
      public static _Fields findByName(String name) {
17967
        return byName.get(name);
17968
      }
17969
 
17970
      private final short _thriftId;
17971
      private final String _fieldName;
17972
 
17973
      _Fields(short thriftId, String fieldName) {
17974
        _thriftId = thriftId;
17975
        _fieldName = fieldName;
17976
      }
17977
 
17978
      public short getThriftFieldId() {
17979
        return _thriftId;
17980
      }
17981
 
17982
      public String getFieldName() {
17983
        return _fieldName;
17984
      }
17985
    }
17986
 
17987
    // isset id assignments
17988
 
17989
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
17990
    static {
17991
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
17992
      tmpMap.put(_Fields.VOUCHER, new org.apache.thrift.meta_data.FieldMetaData("voucher", org.apache.thrift.TFieldRequirementType.DEFAULT, 
17993
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
17994
      metaDataMap = Collections.unmodifiableMap(tmpMap);
17995
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_args.class, metaDataMap);
17996
    }
17997
 
17998
    public addVoucher_args() {
17999
    }
18000
 
18001
    public addVoucher_args(
18002
      Voucher voucher)
18003
    {
18004
      this();
18005
      this.voucher = voucher;
18006
    }
18007
 
18008
    /**
18009
     * Performs a deep copy on <i>other</i>.
18010
     */
18011
    public addVoucher_args(addVoucher_args other) {
18012
      if (other.isSetVoucher()) {
18013
        this.voucher = new Voucher(other.voucher);
18014
      }
18015
    }
18016
 
18017
    public addVoucher_args deepCopy() {
18018
      return new addVoucher_args(this);
18019
    }
18020
 
18021
    @Override
18022
    public void clear() {
18023
      this.voucher = null;
18024
    }
18025
 
18026
    public Voucher getVoucher() {
18027
      return this.voucher;
18028
    }
18029
 
18030
    public void setVoucher(Voucher voucher) {
18031
      this.voucher = voucher;
18032
    }
18033
 
18034
    public void unsetVoucher() {
18035
      this.voucher = null;
18036
    }
18037
 
18038
    /** Returns true if field voucher is set (has been assigned a value) and false otherwise */
18039
    public boolean isSetVoucher() {
18040
      return this.voucher != null;
18041
    }
18042
 
18043
    public void setVoucherIsSet(boolean value) {
18044
      if (!value) {
18045
        this.voucher = null;
18046
      }
18047
    }
18048
 
18049
    public void setFieldValue(_Fields field, Object value) {
18050
      switch (field) {
18051
      case VOUCHER:
18052
        if (value == null) {
18053
          unsetVoucher();
18054
        } else {
18055
          setVoucher((Voucher)value);
18056
        }
18057
        break;
18058
 
18059
      }
18060
    }
18061
 
18062
    public Object getFieldValue(_Fields field) {
18063
      switch (field) {
18064
      case VOUCHER:
18065
        return getVoucher();
18066
 
18067
      }
18068
      throw new IllegalStateException();
18069
    }
18070
 
18071
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
18072
    public boolean isSet(_Fields field) {
18073
      if (field == null) {
18074
        throw new IllegalArgumentException();
18075
      }
18076
 
18077
      switch (field) {
18078
      case VOUCHER:
18079
        return isSetVoucher();
18080
      }
18081
      throw new IllegalStateException();
18082
    }
18083
 
18084
    @Override
18085
    public boolean equals(Object that) {
18086
      if (that == null)
18087
        return false;
18088
      if (that instanceof addVoucher_args)
18089
        return this.equals((addVoucher_args)that);
18090
      return false;
18091
    }
18092
 
18093
    public boolean equals(addVoucher_args that) {
18094
      if (that == null)
18095
        return false;
18096
 
18097
      boolean this_present_voucher = true && this.isSetVoucher();
18098
      boolean that_present_voucher = true && that.isSetVoucher();
18099
      if (this_present_voucher || that_present_voucher) {
18100
        if (!(this_present_voucher && that_present_voucher))
18101
          return false;
18102
        if (!this.voucher.equals(that.voucher))
18103
          return false;
18104
      }
18105
 
18106
      return true;
18107
    }
18108
 
18109
    @Override
18110
    public int hashCode() {
18111
      return 0;
18112
    }
18113
 
18114
    public int compareTo(addVoucher_args other) {
18115
      if (!getClass().equals(other.getClass())) {
18116
        return getClass().getName().compareTo(other.getClass().getName());
18117
      }
18118
 
18119
      int lastComparison = 0;
18120
      addVoucher_args typedOther = (addVoucher_args)other;
18121
 
18122
      lastComparison = Boolean.valueOf(isSetVoucher()).compareTo(typedOther.isSetVoucher());
18123
      if (lastComparison != 0) {
18124
        return lastComparison;
18125
      }
18126
      if (isSetVoucher()) {
18127
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucher, typedOther.voucher);
18128
        if (lastComparison != 0) {
18129
          return lastComparison;
18130
        }
18131
      }
18132
      return 0;
18133
    }
18134
 
18135
    public _Fields fieldForId(int fieldId) {
18136
      return _Fields.findByThriftId(fieldId);
18137
    }
18138
 
18139
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
18140
      org.apache.thrift.protocol.TField field;
18141
      iprot.readStructBegin();
18142
      while (true)
18143
      {
18144
        field = iprot.readFieldBegin();
18145
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
18146
          break;
18147
        }
18148
        switch (field.id) {
18149
          case 1: // VOUCHER
18150
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
18151
              this.voucher = new Voucher();
18152
              this.voucher.read(iprot);
18153
            } else { 
18154
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18155
            }
18156
            break;
18157
          default:
18158
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18159
        }
18160
        iprot.readFieldEnd();
18161
      }
18162
      iprot.readStructEnd();
18163
      validate();
18164
    }
18165
 
18166
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
18167
      validate();
18168
 
18169
      oprot.writeStructBegin(STRUCT_DESC);
18170
      if (this.voucher != null) {
18171
        oprot.writeFieldBegin(VOUCHER_FIELD_DESC);
18172
        this.voucher.write(oprot);
18173
        oprot.writeFieldEnd();
18174
      }
18175
      oprot.writeFieldStop();
18176
      oprot.writeStructEnd();
18177
    }
18178
 
18179
    @Override
18180
    public String toString() {
18181
      StringBuilder sb = new StringBuilder("addVoucher_args(");
18182
      boolean first = true;
18183
 
18184
      sb.append("voucher:");
18185
      if (this.voucher == null) {
18186
        sb.append("null");
18187
      } else {
18188
        sb.append(this.voucher);
18189
      }
18190
      first = false;
18191
      sb.append(")");
18192
      return sb.toString();
18193
    }
18194
 
18195
    public void validate() throws org.apache.thrift.TException {
18196
      // check for required fields
18197
    }
18198
 
18199
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
18200
      try {
18201
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
18202
      } catch (org.apache.thrift.TException te) {
18203
        throw new java.io.IOException(te);
18204
      }
18205
    }
18206
 
18207
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
18208
      try {
18209
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
18210
      } catch (org.apache.thrift.TException te) {
18211
        throw new java.io.IOException(te);
18212
      }
18213
    }
18214
 
18215
  }
18216
 
18217
  public static class addVoucher_result implements org.apache.thrift.TBase<addVoucher_result, addVoucher_result._Fields>, java.io.Serializable, Cloneable   {
18218
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addVoucher_result");
18219
 
18220
 
18221
 
18222
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
18223
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
18224
;
18225
 
18226
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
18227
 
18228
      static {
18229
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
18230
          byName.put(field.getFieldName(), field);
18231
        }
18232
      }
18233
 
18234
      /**
18235
       * Find the _Fields constant that matches fieldId, or null if its not found.
18236
       */
18237
      public static _Fields findByThriftId(int fieldId) {
18238
        switch(fieldId) {
18239
          default:
18240
            return null;
18241
        }
18242
      }
18243
 
18244
      /**
18245
       * Find the _Fields constant that matches fieldId, throwing an exception
18246
       * if it is not found.
18247
       */
18248
      public static _Fields findByThriftIdOrThrow(int fieldId) {
18249
        _Fields fields = findByThriftId(fieldId);
18250
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
18251
        return fields;
18252
      }
18253
 
18254
      /**
18255
       * Find the _Fields constant that matches name, or null if its not found.
18256
       */
18257
      public static _Fields findByName(String name) {
18258
        return byName.get(name);
18259
      }
18260
 
18261
      private final short _thriftId;
18262
      private final String _fieldName;
18263
 
18264
      _Fields(short thriftId, String fieldName) {
18265
        _thriftId = thriftId;
18266
        _fieldName = fieldName;
18267
      }
18268
 
18269
      public short getThriftFieldId() {
18270
        return _thriftId;
18271
      }
18272
 
18273
      public String getFieldName() {
18274
        return _fieldName;
18275
      }
18276
    }
18277
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
18278
    static {
18279
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
18280
      metaDataMap = Collections.unmodifiableMap(tmpMap);
18281
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addVoucher_result.class, metaDataMap);
18282
    }
18283
 
18284
    public addVoucher_result() {
18285
    }
18286
 
18287
    /**
18288
     * Performs a deep copy on <i>other</i>.
18289
     */
18290
    public addVoucher_result(addVoucher_result other) {
18291
    }
18292
 
18293
    public addVoucher_result deepCopy() {
18294
      return new addVoucher_result(this);
18295
    }
18296
 
18297
    @Override
18298
    public void clear() {
18299
    }
18300
 
18301
    public void setFieldValue(_Fields field, Object value) {
18302
      switch (field) {
18303
      }
18304
    }
18305
 
18306
    public Object getFieldValue(_Fields field) {
18307
      switch (field) {
18308
      }
18309
      throw new IllegalStateException();
18310
    }
18311
 
18312
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
18313
    public boolean isSet(_Fields field) {
18314
      if (field == null) {
18315
        throw new IllegalArgumentException();
18316
      }
18317
 
18318
      switch (field) {
18319
      }
18320
      throw new IllegalStateException();
18321
    }
18322
 
18323
    @Override
18324
    public boolean equals(Object that) {
18325
      if (that == null)
18326
        return false;
18327
      if (that instanceof addVoucher_result)
18328
        return this.equals((addVoucher_result)that);
18329
      return false;
18330
    }
18331
 
18332
    public boolean equals(addVoucher_result that) {
18333
      if (that == null)
18334
        return false;
18335
 
18336
      return true;
18337
    }
18338
 
18339
    @Override
18340
    public int hashCode() {
18341
      return 0;
18342
    }
18343
 
18344
    public int compareTo(addVoucher_result other) {
18345
      if (!getClass().equals(other.getClass())) {
18346
        return getClass().getName().compareTo(other.getClass().getName());
18347
      }
18348
 
18349
      int lastComparison = 0;
18350
      addVoucher_result typedOther = (addVoucher_result)other;
18351
 
18352
      return 0;
18353
    }
18354
 
18355
    public _Fields fieldForId(int fieldId) {
18356
      return _Fields.findByThriftId(fieldId);
18357
    }
18358
 
18359
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
18360
      org.apache.thrift.protocol.TField field;
18361
      iprot.readStructBegin();
18362
      while (true)
18363
      {
18364
        field = iprot.readFieldBegin();
18365
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
18366
          break;
18367
        }
18368
        switch (field.id) {
18369
          default:
18370
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18371
        }
18372
        iprot.readFieldEnd();
18373
      }
18374
      iprot.readStructEnd();
18375
      validate();
18376
    }
18377
 
18378
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
18379
      oprot.writeStructBegin(STRUCT_DESC);
18380
 
18381
      oprot.writeFieldStop();
18382
      oprot.writeStructEnd();
18383
    }
18384
 
18385
    @Override
18386
    public String toString() {
18387
      StringBuilder sb = new StringBuilder("addVoucher_result(");
18388
      boolean first = true;
18389
 
18390
      sb.append(")");
18391
      return sb.toString();
18392
    }
18393
 
18394
    public void validate() throws org.apache.thrift.TException {
18395
      // check for required fields
18396
    }
18397
 
18398
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
18399
      try {
18400
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
18401
      } catch (org.apache.thrift.TException te) {
18402
        throw new java.io.IOException(te);
18403
      }
18404
    }
18405
 
18406
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
18407
      try {
18408
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
18409
      } catch (org.apache.thrift.TException te) {
18410
        throw new java.io.IOException(te);
18411
      }
18412
    }
18413
 
18414
  }
18415
 
18416
  public static class assignVoucher_args implements org.apache.thrift.TBase<assignVoucher_args, assignVoucher_args._Fields>, java.io.Serializable, Cloneable   {
18417
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_args");
18418
 
18419
    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);
18420
    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);
18421
    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);
18422
    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);
18423
 
18424
    private long userId; // required
18425
    private String userEmail; // required
18426
    private VoucherType voucherType; // required
18427
    private long amount; // required
18428
 
18429
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
18430
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
18431
      USER_ID((short)1, "userId"),
18432
      USER_EMAIL((short)2, "userEmail"),
18433
      /**
18434
       * 
18435
       * @see VoucherType
18436
       */
18437
      VOUCHER_TYPE((short)3, "voucherType"),
18438
      AMOUNT((short)4, "amount");
18439
 
18440
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
18441
 
18442
      static {
18443
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
18444
          byName.put(field.getFieldName(), field);
18445
        }
18446
      }
18447
 
18448
      /**
18449
       * Find the _Fields constant that matches fieldId, or null if its not found.
18450
       */
18451
      public static _Fields findByThriftId(int fieldId) {
18452
        switch(fieldId) {
18453
          case 1: // USER_ID
18454
            return USER_ID;
18455
          case 2: // USER_EMAIL
18456
            return USER_EMAIL;
18457
          case 3: // VOUCHER_TYPE
18458
            return VOUCHER_TYPE;
18459
          case 4: // AMOUNT
18460
            return AMOUNT;
18461
          default:
18462
            return null;
18463
        }
18464
      }
18465
 
18466
      /**
18467
       * Find the _Fields constant that matches fieldId, throwing an exception
18468
       * if it is not found.
18469
       */
18470
      public static _Fields findByThriftIdOrThrow(int fieldId) {
18471
        _Fields fields = findByThriftId(fieldId);
18472
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
18473
        return fields;
18474
      }
18475
 
18476
      /**
18477
       * Find the _Fields constant that matches name, or null if its not found.
18478
       */
18479
      public static _Fields findByName(String name) {
18480
        return byName.get(name);
18481
      }
18482
 
18483
      private final short _thriftId;
18484
      private final String _fieldName;
18485
 
18486
      _Fields(short thriftId, String fieldName) {
18487
        _thriftId = thriftId;
18488
        _fieldName = fieldName;
18489
      }
18490
 
18491
      public short getThriftFieldId() {
18492
        return _thriftId;
18493
      }
18494
 
18495
      public String getFieldName() {
18496
        return _fieldName;
18497
      }
18498
    }
18499
 
18500
    // isset id assignments
18501
    private static final int __USERID_ISSET_ID = 0;
18502
    private static final int __AMOUNT_ISSET_ID = 1;
18503
    private BitSet __isset_bit_vector = new BitSet(2);
18504
 
18505
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
18506
    static {
18507
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
18508
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18509
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
18510
      tmpMap.put(_Fields.USER_EMAIL, new org.apache.thrift.meta_data.FieldMetaData("userEmail", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18511
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
18512
      tmpMap.put(_Fields.VOUCHER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("voucherType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18513
          new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, VoucherType.class)));
18514
      tmpMap.put(_Fields.AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("amount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
18515
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
18516
      metaDataMap = Collections.unmodifiableMap(tmpMap);
18517
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_args.class, metaDataMap);
18518
    }
18519
 
18520
    public assignVoucher_args() {
18521
    }
18522
 
18523
    public assignVoucher_args(
18524
      long userId,
18525
      String userEmail,
18526
      VoucherType voucherType,
18527
      long amount)
18528
    {
18529
      this();
18530
      this.userId = userId;
18531
      setUserIdIsSet(true);
18532
      this.userEmail = userEmail;
18533
      this.voucherType = voucherType;
18534
      this.amount = amount;
18535
      setAmountIsSet(true);
18536
    }
18537
 
18538
    /**
18539
     * Performs a deep copy on <i>other</i>.
18540
     */
18541
    public assignVoucher_args(assignVoucher_args other) {
18542
      __isset_bit_vector.clear();
18543
      __isset_bit_vector.or(other.__isset_bit_vector);
18544
      this.userId = other.userId;
18545
      if (other.isSetUserEmail()) {
18546
        this.userEmail = other.userEmail;
18547
      }
18548
      if (other.isSetVoucherType()) {
18549
        this.voucherType = other.voucherType;
18550
      }
18551
      this.amount = other.amount;
18552
    }
18553
 
18554
    public assignVoucher_args deepCopy() {
18555
      return new assignVoucher_args(this);
18556
    }
18557
 
18558
    @Override
18559
    public void clear() {
18560
      setUserIdIsSet(false);
18561
      this.userId = 0;
18562
      this.userEmail = null;
18563
      this.voucherType = null;
18564
      setAmountIsSet(false);
18565
      this.amount = 0;
18566
    }
18567
 
18568
    public long getUserId() {
18569
      return this.userId;
18570
    }
18571
 
18572
    public void setUserId(long userId) {
18573
      this.userId = userId;
18574
      setUserIdIsSet(true);
18575
    }
18576
 
18577
    public void unsetUserId() {
18578
      __isset_bit_vector.clear(__USERID_ISSET_ID);
18579
    }
18580
 
18581
    /** Returns true if field userId is set (has been assigned a value) and false otherwise */
18582
    public boolean isSetUserId() {
18583
      return __isset_bit_vector.get(__USERID_ISSET_ID);
18584
    }
18585
 
18586
    public void setUserIdIsSet(boolean value) {
18587
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
18588
    }
18589
 
18590
    public String getUserEmail() {
18591
      return this.userEmail;
18592
    }
18593
 
18594
    public void setUserEmail(String userEmail) {
18595
      this.userEmail = userEmail;
18596
    }
18597
 
18598
    public void unsetUserEmail() {
18599
      this.userEmail = null;
18600
    }
18601
 
18602
    /** Returns true if field userEmail is set (has been assigned a value) and false otherwise */
18603
    public boolean isSetUserEmail() {
18604
      return this.userEmail != null;
18605
    }
18606
 
18607
    public void setUserEmailIsSet(boolean value) {
18608
      if (!value) {
18609
        this.userEmail = null;
18610
      }
18611
    }
18612
 
18613
    /**
18614
     * 
18615
     * @see VoucherType
18616
     */
18617
    public VoucherType getVoucherType() {
18618
      return this.voucherType;
18619
    }
18620
 
18621
    /**
18622
     * 
18623
     * @see VoucherType
18624
     */
18625
    public void setVoucherType(VoucherType voucherType) {
18626
      this.voucherType = voucherType;
18627
    }
18628
 
18629
    public void unsetVoucherType() {
18630
      this.voucherType = null;
18631
    }
18632
 
18633
    /** Returns true if field voucherType is set (has been assigned a value) and false otherwise */
18634
    public boolean isSetVoucherType() {
18635
      return this.voucherType != null;
18636
    }
18637
 
18638
    public void setVoucherTypeIsSet(boolean value) {
18639
      if (!value) {
18640
        this.voucherType = null;
18641
      }
18642
    }
18643
 
18644
    public long getAmount() {
18645
      return this.amount;
18646
    }
18647
 
18648
    public void setAmount(long amount) {
18649
      this.amount = amount;
18650
      setAmountIsSet(true);
18651
    }
18652
 
18653
    public void unsetAmount() {
18654
      __isset_bit_vector.clear(__AMOUNT_ISSET_ID);
18655
    }
18656
 
18657
    /** Returns true if field amount is set (has been assigned a value) and false otherwise */
18658
    public boolean isSetAmount() {
18659
      return __isset_bit_vector.get(__AMOUNT_ISSET_ID);
18660
    }
18661
 
18662
    public void setAmountIsSet(boolean value) {
18663
      __isset_bit_vector.set(__AMOUNT_ISSET_ID, value);
18664
    }
18665
 
18666
    public void setFieldValue(_Fields field, Object value) {
18667
      switch (field) {
18668
      case USER_ID:
18669
        if (value == null) {
18670
          unsetUserId();
18671
        } else {
18672
          setUserId((Long)value);
18673
        }
18674
        break;
18675
 
18676
      case USER_EMAIL:
18677
        if (value == null) {
18678
          unsetUserEmail();
18679
        } else {
18680
          setUserEmail((String)value);
18681
        }
18682
        break;
18683
 
18684
      case VOUCHER_TYPE:
18685
        if (value == null) {
18686
          unsetVoucherType();
18687
        } else {
18688
          setVoucherType((VoucherType)value);
18689
        }
18690
        break;
18691
 
18692
      case AMOUNT:
18693
        if (value == null) {
18694
          unsetAmount();
18695
        } else {
18696
          setAmount((Long)value);
18697
        }
18698
        break;
18699
 
18700
      }
18701
    }
18702
 
18703
    public Object getFieldValue(_Fields field) {
18704
      switch (field) {
18705
      case USER_ID:
18706
        return Long.valueOf(getUserId());
18707
 
18708
      case USER_EMAIL:
18709
        return getUserEmail();
18710
 
18711
      case VOUCHER_TYPE:
18712
        return getVoucherType();
18713
 
18714
      case AMOUNT:
18715
        return Long.valueOf(getAmount());
18716
 
18717
      }
18718
      throw new IllegalStateException();
18719
    }
18720
 
18721
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
18722
    public boolean isSet(_Fields field) {
18723
      if (field == null) {
18724
        throw new IllegalArgumentException();
18725
      }
18726
 
18727
      switch (field) {
18728
      case USER_ID:
18729
        return isSetUserId();
18730
      case USER_EMAIL:
18731
        return isSetUserEmail();
18732
      case VOUCHER_TYPE:
18733
        return isSetVoucherType();
18734
      case AMOUNT:
18735
        return isSetAmount();
18736
      }
18737
      throw new IllegalStateException();
18738
    }
18739
 
18740
    @Override
18741
    public boolean equals(Object that) {
18742
      if (that == null)
18743
        return false;
18744
      if (that instanceof assignVoucher_args)
18745
        return this.equals((assignVoucher_args)that);
18746
      return false;
18747
    }
18748
 
18749
    public boolean equals(assignVoucher_args that) {
18750
      if (that == null)
18751
        return false;
18752
 
18753
      boolean this_present_userId = true;
18754
      boolean that_present_userId = true;
18755
      if (this_present_userId || that_present_userId) {
18756
        if (!(this_present_userId && that_present_userId))
18757
          return false;
18758
        if (this.userId != that.userId)
18759
          return false;
18760
      }
18761
 
18762
      boolean this_present_userEmail = true && this.isSetUserEmail();
18763
      boolean that_present_userEmail = true && that.isSetUserEmail();
18764
      if (this_present_userEmail || that_present_userEmail) {
18765
        if (!(this_present_userEmail && that_present_userEmail))
18766
          return false;
18767
        if (!this.userEmail.equals(that.userEmail))
18768
          return false;
18769
      }
18770
 
18771
      boolean this_present_voucherType = true && this.isSetVoucherType();
18772
      boolean that_present_voucherType = true && that.isSetVoucherType();
18773
      if (this_present_voucherType || that_present_voucherType) {
18774
        if (!(this_present_voucherType && that_present_voucherType))
18775
          return false;
18776
        if (!this.voucherType.equals(that.voucherType))
18777
          return false;
18778
      }
18779
 
18780
      boolean this_present_amount = true;
18781
      boolean that_present_amount = true;
18782
      if (this_present_amount || that_present_amount) {
18783
        if (!(this_present_amount && that_present_amount))
18784
          return false;
18785
        if (this.amount != that.amount)
18786
          return false;
18787
      }
18788
 
18789
      return true;
18790
    }
18791
 
18792
    @Override
18793
    public int hashCode() {
18794
      return 0;
18795
    }
18796
 
18797
    public int compareTo(assignVoucher_args other) {
18798
      if (!getClass().equals(other.getClass())) {
18799
        return getClass().getName().compareTo(other.getClass().getName());
18800
      }
18801
 
18802
      int lastComparison = 0;
18803
      assignVoucher_args typedOther = (assignVoucher_args)other;
18804
 
18805
      lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
18806
      if (lastComparison != 0) {
18807
        return lastComparison;
18808
      }
18809
      if (isSetUserId()) {
18810
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
18811
        if (lastComparison != 0) {
18812
          return lastComparison;
18813
        }
18814
      }
18815
      lastComparison = Boolean.valueOf(isSetUserEmail()).compareTo(typedOther.isSetUserEmail());
18816
      if (lastComparison != 0) {
18817
        return lastComparison;
18818
      }
18819
      if (isSetUserEmail()) {
18820
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userEmail, typedOther.userEmail);
18821
        if (lastComparison != 0) {
18822
          return lastComparison;
18823
        }
18824
      }
18825
      lastComparison = Boolean.valueOf(isSetVoucherType()).compareTo(typedOther.isSetVoucherType());
18826
      if (lastComparison != 0) {
18827
        return lastComparison;
18828
      }
18829
      if (isSetVoucherType()) {
18830
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherType, typedOther.voucherType);
18831
        if (lastComparison != 0) {
18832
          return lastComparison;
18833
        }
18834
      }
18835
      lastComparison = Boolean.valueOf(isSetAmount()).compareTo(typedOther.isSetAmount());
18836
      if (lastComparison != 0) {
18837
        return lastComparison;
18838
      }
18839
      if (isSetAmount()) {
18840
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amount, typedOther.amount);
18841
        if (lastComparison != 0) {
18842
          return lastComparison;
18843
        }
18844
      }
18845
      return 0;
18846
    }
18847
 
18848
    public _Fields fieldForId(int fieldId) {
18849
      return _Fields.findByThriftId(fieldId);
18850
    }
18851
 
18852
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
18853
      org.apache.thrift.protocol.TField field;
18854
      iprot.readStructBegin();
18855
      while (true)
18856
      {
18857
        field = iprot.readFieldBegin();
18858
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
18859
          break;
18860
        }
18861
        switch (field.id) {
18862
          case 1: // USER_ID
18863
            if (field.type == org.apache.thrift.protocol.TType.I64) {
18864
              this.userId = iprot.readI64();
18865
              setUserIdIsSet(true);
18866
            } else { 
18867
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18868
            }
18869
            break;
18870
          case 2: // USER_EMAIL
18871
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
18872
              this.userEmail = iprot.readString();
18873
            } else { 
18874
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18875
            }
18876
            break;
18877
          case 3: // VOUCHER_TYPE
18878
            if (field.type == org.apache.thrift.protocol.TType.I32) {
18879
              this.voucherType = VoucherType.findByValue(iprot.readI32());
18880
            } else { 
18881
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18882
            }
18883
            break;
18884
          case 4: // AMOUNT
18885
            if (field.type == org.apache.thrift.protocol.TType.I64) {
18886
              this.amount = iprot.readI64();
18887
              setAmountIsSet(true);
18888
            } else { 
18889
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18890
            }
18891
            break;
18892
          default:
18893
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
18894
        }
18895
        iprot.readFieldEnd();
18896
      }
18897
      iprot.readStructEnd();
18898
      validate();
18899
    }
18900
 
18901
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
18902
      validate();
18903
 
18904
      oprot.writeStructBegin(STRUCT_DESC);
18905
      oprot.writeFieldBegin(USER_ID_FIELD_DESC);
18906
      oprot.writeI64(this.userId);
18907
      oprot.writeFieldEnd();
18908
      if (this.userEmail != null) {
18909
        oprot.writeFieldBegin(USER_EMAIL_FIELD_DESC);
18910
        oprot.writeString(this.userEmail);
18911
        oprot.writeFieldEnd();
18912
      }
18913
      if (this.voucherType != null) {
18914
        oprot.writeFieldBegin(VOUCHER_TYPE_FIELD_DESC);
18915
        oprot.writeI32(this.voucherType.getValue());
18916
        oprot.writeFieldEnd();
18917
      }
18918
      oprot.writeFieldBegin(AMOUNT_FIELD_DESC);
18919
      oprot.writeI64(this.amount);
18920
      oprot.writeFieldEnd();
18921
      oprot.writeFieldStop();
18922
      oprot.writeStructEnd();
18923
    }
18924
 
18925
    @Override
18926
    public String toString() {
18927
      StringBuilder sb = new StringBuilder("assignVoucher_args(");
18928
      boolean first = true;
18929
 
18930
      sb.append("userId:");
18931
      sb.append(this.userId);
18932
      first = false;
18933
      if (!first) sb.append(", ");
18934
      sb.append("userEmail:");
18935
      if (this.userEmail == null) {
18936
        sb.append("null");
18937
      } else {
18938
        sb.append(this.userEmail);
18939
      }
18940
      first = false;
18941
      if (!first) sb.append(", ");
18942
      sb.append("voucherType:");
18943
      if (this.voucherType == null) {
18944
        sb.append("null");
18945
      } else {
18946
        sb.append(this.voucherType);
18947
      }
18948
      first = false;
18949
      if (!first) sb.append(", ");
18950
      sb.append("amount:");
18951
      sb.append(this.amount);
18952
      first = false;
18953
      sb.append(")");
18954
      return sb.toString();
18955
    }
18956
 
18957
    public void validate() throws org.apache.thrift.TException {
18958
      // check for required fields
18959
    }
18960
 
18961
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
18962
      try {
18963
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
18964
      } catch (org.apache.thrift.TException te) {
18965
        throw new java.io.IOException(te);
18966
      }
18967
    }
18968
 
18969
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
18970
      try {
18971
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
18972
        __isset_bit_vector = new BitSet(1);
18973
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
18974
      } catch (org.apache.thrift.TException te) {
18975
        throw new java.io.IOException(te);
18976
      }
18977
    }
18978
 
18979
  }
18980
 
18981
  public static class assignVoucher_result implements org.apache.thrift.TBase<assignVoucher_result, assignVoucher_result._Fields>, java.io.Serializable, Cloneable   {
18982
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("assignVoucher_result");
18983
 
18984
    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);
18985
 
18986
    private Voucher success; // required
18987
 
18988
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
18989
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
18990
      SUCCESS((short)0, "success");
18991
 
18992
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
18993
 
18994
      static {
18995
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
18996
          byName.put(field.getFieldName(), field);
18997
        }
18998
      }
18999
 
19000
      /**
19001
       * Find the _Fields constant that matches fieldId, or null if its not found.
19002
       */
19003
      public static _Fields findByThriftId(int fieldId) {
19004
        switch(fieldId) {
19005
          case 0: // SUCCESS
19006
            return SUCCESS;
19007
          default:
19008
            return null;
19009
        }
19010
      }
19011
 
19012
      /**
19013
       * Find the _Fields constant that matches fieldId, throwing an exception
19014
       * if it is not found.
19015
       */
19016
      public static _Fields findByThriftIdOrThrow(int fieldId) {
19017
        _Fields fields = findByThriftId(fieldId);
19018
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
19019
        return fields;
19020
      }
19021
 
19022
      /**
19023
       * Find the _Fields constant that matches name, or null if its not found.
19024
       */
19025
      public static _Fields findByName(String name) {
19026
        return byName.get(name);
19027
      }
19028
 
19029
      private final short _thriftId;
19030
      private final String _fieldName;
19031
 
19032
      _Fields(short thriftId, String fieldName) {
19033
        _thriftId = thriftId;
19034
        _fieldName = fieldName;
19035
      }
19036
 
19037
      public short getThriftFieldId() {
19038
        return _thriftId;
19039
      }
19040
 
19041
      public String getFieldName() {
19042
        return _fieldName;
19043
      }
19044
    }
19045
 
19046
    // isset id assignments
19047
 
19048
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
19049
    static {
19050
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
19051
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
19052
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Voucher.class)));
19053
      metaDataMap = Collections.unmodifiableMap(tmpMap);
19054
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(assignVoucher_result.class, metaDataMap);
19055
    }
19056
 
19057
    public assignVoucher_result() {
19058
    }
19059
 
19060
    public assignVoucher_result(
19061
      Voucher success)
19062
    {
19063
      this();
19064
      this.success = success;
19065
    }
19066
 
19067
    /**
19068
     * Performs a deep copy on <i>other</i>.
19069
     */
19070
    public assignVoucher_result(assignVoucher_result other) {
19071
      if (other.isSetSuccess()) {
19072
        this.success = new Voucher(other.success);
19073
      }
19074
    }
19075
 
19076
    public assignVoucher_result deepCopy() {
19077
      return new assignVoucher_result(this);
19078
    }
19079
 
19080
    @Override
19081
    public void clear() {
19082
      this.success = null;
19083
    }
19084
 
19085
    public Voucher getSuccess() {
19086
      return this.success;
19087
    }
19088
 
19089
    public void setSuccess(Voucher success) {
19090
      this.success = success;
19091
    }
19092
 
19093
    public void unsetSuccess() {
19094
      this.success = null;
19095
    }
19096
 
19097
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
19098
    public boolean isSetSuccess() {
19099
      return this.success != null;
19100
    }
19101
 
19102
    public void setSuccessIsSet(boolean value) {
19103
      if (!value) {
19104
        this.success = null;
19105
      }
19106
    }
19107
 
19108
    public void setFieldValue(_Fields field, Object value) {
19109
      switch (field) {
19110
      case SUCCESS:
19111
        if (value == null) {
19112
          unsetSuccess();
19113
        } else {
19114
          setSuccess((Voucher)value);
19115
        }
19116
        break;
19117
 
19118
      }
19119
    }
19120
 
19121
    public Object getFieldValue(_Fields field) {
19122
      switch (field) {
19123
      case SUCCESS:
19124
        return getSuccess();
19125
 
19126
      }
19127
      throw new IllegalStateException();
19128
    }
19129
 
19130
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
19131
    public boolean isSet(_Fields field) {
19132
      if (field == null) {
19133
        throw new IllegalArgumentException();
19134
      }
19135
 
19136
      switch (field) {
19137
      case SUCCESS:
19138
        return isSetSuccess();
19139
      }
19140
      throw new IllegalStateException();
19141
    }
19142
 
19143
    @Override
19144
    public boolean equals(Object that) {
19145
      if (that == null)
19146
        return false;
19147
      if (that instanceof assignVoucher_result)
19148
        return this.equals((assignVoucher_result)that);
19149
      return false;
19150
    }
19151
 
19152
    public boolean equals(assignVoucher_result that) {
19153
      if (that == null)
19154
        return false;
19155
 
19156
      boolean this_present_success = true && this.isSetSuccess();
19157
      boolean that_present_success = true && that.isSetSuccess();
19158
      if (this_present_success || that_present_success) {
19159
        if (!(this_present_success && that_present_success))
19160
          return false;
19161
        if (!this.success.equals(that.success))
19162
          return false;
19163
      }
19164
 
19165
      return true;
19166
    }
19167
 
19168
    @Override
19169
    public int hashCode() {
19170
      return 0;
19171
    }
19172
 
19173
    public int compareTo(assignVoucher_result other) {
19174
      if (!getClass().equals(other.getClass())) {
19175
        return getClass().getName().compareTo(other.getClass().getName());
19176
      }
19177
 
19178
      int lastComparison = 0;
19179
      assignVoucher_result typedOther = (assignVoucher_result)other;
19180
 
19181
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
19182
      if (lastComparison != 0) {
19183
        return lastComparison;
19184
      }
19185
      if (isSetSuccess()) {
19186
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
19187
        if (lastComparison != 0) {
19188
          return lastComparison;
19189
        }
19190
      }
19191
      return 0;
19192
    }
19193
 
19194
    public _Fields fieldForId(int fieldId) {
19195
      return _Fields.findByThriftId(fieldId);
19196
    }
19197
 
19198
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
19199
      org.apache.thrift.protocol.TField field;
19200
      iprot.readStructBegin();
19201
      while (true)
19202
      {
19203
        field = iprot.readFieldBegin();
19204
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
19205
          break;
19206
        }
19207
        switch (field.id) {
19208
          case 0: // SUCCESS
19209
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
19210
              this.success = new Voucher();
19211
              this.success.read(iprot);
19212
            } else { 
19213
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19214
            }
19215
            break;
19216
          default:
19217
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19218
        }
19219
        iprot.readFieldEnd();
19220
      }
19221
      iprot.readStructEnd();
19222
      validate();
19223
    }
19224
 
19225
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
19226
      oprot.writeStructBegin(STRUCT_DESC);
19227
 
19228
      if (this.isSetSuccess()) {
19229
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
19230
        this.success.write(oprot);
19231
        oprot.writeFieldEnd();
19232
      }
19233
      oprot.writeFieldStop();
19234
      oprot.writeStructEnd();
19235
    }
19236
 
19237
    @Override
19238
    public String toString() {
19239
      StringBuilder sb = new StringBuilder("assignVoucher_result(");
19240
      boolean first = true;
19241
 
19242
      sb.append("success:");
19243
      if (this.success == null) {
19244
        sb.append("null");
19245
      } else {
19246
        sb.append(this.success);
19247
      }
19248
      first = false;
19249
      sb.append(")");
19250
      return sb.toString();
19251
    }
19252
 
19253
    public void validate() throws org.apache.thrift.TException {
19254
      // check for required fields
19255
    }
19256
 
19257
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
19258
      try {
19259
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
19260
      } catch (org.apache.thrift.TException te) {
19261
        throw new java.io.IOException(te);
19262
      }
19263
    }
19264
 
19265
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
19266
      try {
19267
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
19268
      } catch (org.apache.thrift.TException te) {
19269
        throw new java.io.IOException(te);
19270
      }
19271
    }
19272
 
19273
  }
19274
 
19275
  public static class markVoucherAsRedeemed_args implements org.apache.thrift.TBase<markVoucherAsRedeemed_args, markVoucherAsRedeemed_args._Fields>, java.io.Serializable, Cloneable   {
19276
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_args");
19277
 
19278
    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);
19279
    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);
19280
 
19281
    private String voucherCode; // required
19282
    private long redeemedOn; // required
19283
 
19284
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
19285
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
19286
      VOUCHER_CODE((short)1, "voucherCode"),
19287
      REDEEMED_ON((short)2, "redeemedOn");
19288
 
19289
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
19290
 
19291
      static {
19292
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
19293
          byName.put(field.getFieldName(), field);
19294
        }
19295
      }
19296
 
19297
      /**
19298
       * Find the _Fields constant that matches fieldId, or null if its not found.
19299
       */
19300
      public static _Fields findByThriftId(int fieldId) {
19301
        switch(fieldId) {
19302
          case 1: // VOUCHER_CODE
19303
            return VOUCHER_CODE;
19304
          case 2: // REDEEMED_ON
19305
            return REDEEMED_ON;
19306
          default:
19307
            return null;
19308
        }
19309
      }
19310
 
19311
      /**
19312
       * Find the _Fields constant that matches fieldId, throwing an exception
19313
       * if it is not found.
19314
       */
19315
      public static _Fields findByThriftIdOrThrow(int fieldId) {
19316
        _Fields fields = findByThriftId(fieldId);
19317
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
19318
        return fields;
19319
      }
19320
 
19321
      /**
19322
       * Find the _Fields constant that matches name, or null if its not found.
19323
       */
19324
      public static _Fields findByName(String name) {
19325
        return byName.get(name);
19326
      }
19327
 
19328
      private final short _thriftId;
19329
      private final String _fieldName;
19330
 
19331
      _Fields(short thriftId, String fieldName) {
19332
        _thriftId = thriftId;
19333
        _fieldName = fieldName;
19334
      }
19335
 
19336
      public short getThriftFieldId() {
19337
        return _thriftId;
19338
      }
19339
 
19340
      public String getFieldName() {
19341
        return _fieldName;
19342
      }
19343
    }
19344
 
19345
    // isset id assignments
19346
    private static final int __REDEEMEDON_ISSET_ID = 0;
19347
    private BitSet __isset_bit_vector = new BitSet(1);
19348
 
19349
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
19350
    static {
19351
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
19352
      tmpMap.put(_Fields.VOUCHER_CODE, new org.apache.thrift.meta_data.FieldMetaData("voucherCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
19353
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
19354
      tmpMap.put(_Fields.REDEEMED_ON, new org.apache.thrift.meta_data.FieldMetaData("redeemedOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
19355
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
19356
      metaDataMap = Collections.unmodifiableMap(tmpMap);
19357
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_args.class, metaDataMap);
19358
    }
19359
 
19360
    public markVoucherAsRedeemed_args() {
19361
    }
19362
 
19363
    public markVoucherAsRedeemed_args(
19364
      String voucherCode,
19365
      long redeemedOn)
19366
    {
19367
      this();
19368
      this.voucherCode = voucherCode;
19369
      this.redeemedOn = redeemedOn;
19370
      setRedeemedOnIsSet(true);
19371
    }
19372
 
19373
    /**
19374
     * Performs a deep copy on <i>other</i>.
19375
     */
19376
    public markVoucherAsRedeemed_args(markVoucherAsRedeemed_args other) {
19377
      __isset_bit_vector.clear();
19378
      __isset_bit_vector.or(other.__isset_bit_vector);
19379
      if (other.isSetVoucherCode()) {
19380
        this.voucherCode = other.voucherCode;
19381
      }
19382
      this.redeemedOn = other.redeemedOn;
19383
    }
19384
 
19385
    public markVoucherAsRedeemed_args deepCopy() {
19386
      return new markVoucherAsRedeemed_args(this);
19387
    }
19388
 
19389
    @Override
19390
    public void clear() {
19391
      this.voucherCode = null;
19392
      setRedeemedOnIsSet(false);
19393
      this.redeemedOn = 0;
19394
    }
19395
 
19396
    public String getVoucherCode() {
19397
      return this.voucherCode;
19398
    }
19399
 
19400
    public void setVoucherCode(String voucherCode) {
19401
      this.voucherCode = voucherCode;
19402
    }
19403
 
19404
    public void unsetVoucherCode() {
19405
      this.voucherCode = null;
19406
    }
19407
 
19408
    /** Returns true if field voucherCode is set (has been assigned a value) and false otherwise */
19409
    public boolean isSetVoucherCode() {
19410
      return this.voucherCode != null;
19411
    }
19412
 
19413
    public void setVoucherCodeIsSet(boolean value) {
19414
      if (!value) {
19415
        this.voucherCode = null;
19416
      }
19417
    }
19418
 
19419
    public long getRedeemedOn() {
19420
      return this.redeemedOn;
19421
    }
19422
 
19423
    public void setRedeemedOn(long redeemedOn) {
19424
      this.redeemedOn = redeemedOn;
19425
      setRedeemedOnIsSet(true);
19426
    }
19427
 
19428
    public void unsetRedeemedOn() {
19429
      __isset_bit_vector.clear(__REDEEMEDON_ISSET_ID);
19430
    }
19431
 
19432
    /** Returns true if field redeemedOn is set (has been assigned a value) and false otherwise */
19433
    public boolean isSetRedeemedOn() {
19434
      return __isset_bit_vector.get(__REDEEMEDON_ISSET_ID);
19435
    }
19436
 
19437
    public void setRedeemedOnIsSet(boolean value) {
19438
      __isset_bit_vector.set(__REDEEMEDON_ISSET_ID, value);
19439
    }
19440
 
19441
    public void setFieldValue(_Fields field, Object value) {
19442
      switch (field) {
19443
      case VOUCHER_CODE:
19444
        if (value == null) {
19445
          unsetVoucherCode();
19446
        } else {
19447
          setVoucherCode((String)value);
19448
        }
19449
        break;
19450
 
19451
      case REDEEMED_ON:
19452
        if (value == null) {
19453
          unsetRedeemedOn();
19454
        } else {
19455
          setRedeemedOn((Long)value);
19456
        }
19457
        break;
19458
 
19459
      }
19460
    }
19461
 
19462
    public Object getFieldValue(_Fields field) {
19463
      switch (field) {
19464
      case VOUCHER_CODE:
19465
        return getVoucherCode();
19466
 
19467
      case REDEEMED_ON:
19468
        return Long.valueOf(getRedeemedOn());
19469
 
19470
      }
19471
      throw new IllegalStateException();
19472
    }
19473
 
19474
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
19475
    public boolean isSet(_Fields field) {
19476
      if (field == null) {
19477
        throw new IllegalArgumentException();
19478
      }
19479
 
19480
      switch (field) {
19481
      case VOUCHER_CODE:
19482
        return isSetVoucherCode();
19483
      case REDEEMED_ON:
19484
        return isSetRedeemedOn();
19485
      }
19486
      throw new IllegalStateException();
19487
    }
19488
 
19489
    @Override
19490
    public boolean equals(Object that) {
19491
      if (that == null)
19492
        return false;
19493
      if (that instanceof markVoucherAsRedeemed_args)
19494
        return this.equals((markVoucherAsRedeemed_args)that);
19495
      return false;
19496
    }
19497
 
19498
    public boolean equals(markVoucherAsRedeemed_args that) {
19499
      if (that == null)
19500
        return false;
19501
 
19502
      boolean this_present_voucherCode = true && this.isSetVoucherCode();
19503
      boolean that_present_voucherCode = true && that.isSetVoucherCode();
19504
      if (this_present_voucherCode || that_present_voucherCode) {
19505
        if (!(this_present_voucherCode && that_present_voucherCode))
19506
          return false;
19507
        if (!this.voucherCode.equals(that.voucherCode))
19508
          return false;
19509
      }
19510
 
19511
      boolean this_present_redeemedOn = true;
19512
      boolean that_present_redeemedOn = true;
19513
      if (this_present_redeemedOn || that_present_redeemedOn) {
19514
        if (!(this_present_redeemedOn && that_present_redeemedOn))
19515
          return false;
19516
        if (this.redeemedOn != that.redeemedOn)
19517
          return false;
19518
      }
19519
 
19520
      return true;
19521
    }
19522
 
19523
    @Override
19524
    public int hashCode() {
19525
      return 0;
19526
    }
19527
 
19528
    public int compareTo(markVoucherAsRedeemed_args other) {
19529
      if (!getClass().equals(other.getClass())) {
19530
        return getClass().getName().compareTo(other.getClass().getName());
19531
      }
19532
 
19533
      int lastComparison = 0;
19534
      markVoucherAsRedeemed_args typedOther = (markVoucherAsRedeemed_args)other;
19535
 
19536
      lastComparison = Boolean.valueOf(isSetVoucherCode()).compareTo(typedOther.isSetVoucherCode());
19537
      if (lastComparison != 0) {
19538
        return lastComparison;
19539
      }
19540
      if (isSetVoucherCode()) {
19541
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.voucherCode, typedOther.voucherCode);
19542
        if (lastComparison != 0) {
19543
          return lastComparison;
19544
        }
19545
      }
19546
      lastComparison = Boolean.valueOf(isSetRedeemedOn()).compareTo(typedOther.isSetRedeemedOn());
19547
      if (lastComparison != 0) {
19548
        return lastComparison;
19549
      }
19550
      if (isSetRedeemedOn()) {
19551
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.redeemedOn, typedOther.redeemedOn);
19552
        if (lastComparison != 0) {
19553
          return lastComparison;
19554
        }
19555
      }
19556
      return 0;
19557
    }
19558
 
19559
    public _Fields fieldForId(int fieldId) {
19560
      return _Fields.findByThriftId(fieldId);
19561
    }
19562
 
19563
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
19564
      org.apache.thrift.protocol.TField field;
19565
      iprot.readStructBegin();
19566
      while (true)
19567
      {
19568
        field = iprot.readFieldBegin();
19569
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
19570
          break;
19571
        }
19572
        switch (field.id) {
19573
          case 1: // VOUCHER_CODE
19574
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
19575
              this.voucherCode = iprot.readString();
19576
            } else { 
19577
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19578
            }
19579
            break;
19580
          case 2: // REDEEMED_ON
19581
            if (field.type == org.apache.thrift.protocol.TType.I64) {
19582
              this.redeemedOn = iprot.readI64();
19583
              setRedeemedOnIsSet(true);
19584
            } else { 
19585
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19586
            }
19587
            break;
19588
          default:
19589
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19590
        }
19591
        iprot.readFieldEnd();
19592
      }
19593
      iprot.readStructEnd();
19594
      validate();
19595
    }
19596
 
19597
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
19598
      validate();
19599
 
19600
      oprot.writeStructBegin(STRUCT_DESC);
19601
      if (this.voucherCode != null) {
19602
        oprot.writeFieldBegin(VOUCHER_CODE_FIELD_DESC);
19603
        oprot.writeString(this.voucherCode);
19604
        oprot.writeFieldEnd();
19605
      }
19606
      oprot.writeFieldBegin(REDEEMED_ON_FIELD_DESC);
19607
      oprot.writeI64(this.redeemedOn);
19608
      oprot.writeFieldEnd();
19609
      oprot.writeFieldStop();
19610
      oprot.writeStructEnd();
19611
    }
19612
 
19613
    @Override
19614
    public String toString() {
19615
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_args(");
19616
      boolean first = true;
19617
 
19618
      sb.append("voucherCode:");
19619
      if (this.voucherCode == null) {
19620
        sb.append("null");
19621
      } else {
19622
        sb.append(this.voucherCode);
19623
      }
19624
      first = false;
19625
      if (!first) sb.append(", ");
19626
      sb.append("redeemedOn:");
19627
      sb.append(this.redeemedOn);
19628
      first = false;
19629
      sb.append(")");
19630
      return sb.toString();
19631
    }
19632
 
19633
    public void validate() throws org.apache.thrift.TException {
19634
      // check for required fields
19635
    }
19636
 
19637
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
19638
      try {
19639
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
19640
      } catch (org.apache.thrift.TException te) {
19641
        throw new java.io.IOException(te);
19642
      }
19643
    }
19644
 
19645
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
19646
      try {
19647
        // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
19648
        __isset_bit_vector = new BitSet(1);
19649
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
19650
      } catch (org.apache.thrift.TException te) {
19651
        throw new java.io.IOException(te);
19652
      }
19653
    }
19654
 
19655
  }
19656
 
19657
  public static class markVoucherAsRedeemed_result implements org.apache.thrift.TBase<markVoucherAsRedeemed_result, markVoucherAsRedeemed_result._Fields>, java.io.Serializable, Cloneable   {
19658
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("markVoucherAsRedeemed_result");
19659
 
19660
    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);
19661
 
19662
    private boolean success; // required
19663
 
19664
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
19665
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
19666
      SUCCESS((short)0, "success");
19667
 
19668
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
19669
 
19670
      static {
19671
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
19672
          byName.put(field.getFieldName(), field);
19673
        }
19674
      }
19675
 
19676
      /**
19677
       * Find the _Fields constant that matches fieldId, or null if its not found.
19678
       */
19679
      public static _Fields findByThriftId(int fieldId) {
19680
        switch(fieldId) {
19681
          case 0: // SUCCESS
19682
            return SUCCESS;
19683
          default:
19684
            return null;
19685
        }
19686
      }
19687
 
19688
      /**
19689
       * Find the _Fields constant that matches fieldId, throwing an exception
19690
       * if it is not found.
19691
       */
19692
      public static _Fields findByThriftIdOrThrow(int fieldId) {
19693
        _Fields fields = findByThriftId(fieldId);
19694
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
19695
        return fields;
19696
      }
19697
 
19698
      /**
19699
       * Find the _Fields constant that matches name, or null if its not found.
19700
       */
19701
      public static _Fields findByName(String name) {
19702
        return byName.get(name);
19703
      }
19704
 
19705
      private final short _thriftId;
19706
      private final String _fieldName;
19707
 
19708
      _Fields(short thriftId, String fieldName) {
19709
        _thriftId = thriftId;
19710
        _fieldName = fieldName;
19711
      }
19712
 
19713
      public short getThriftFieldId() {
19714
        return _thriftId;
19715
      }
19716
 
19717
      public String getFieldName() {
19718
        return _fieldName;
19719
      }
19720
    }
19721
 
19722
    // isset id assignments
19723
    private static final int __SUCCESS_ISSET_ID = 0;
19724
    private BitSet __isset_bit_vector = new BitSet(1);
19725
 
19726
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
19727
    static {
19728
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
19729
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
19730
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
19731
      metaDataMap = Collections.unmodifiableMap(tmpMap);
19732
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(markVoucherAsRedeemed_result.class, metaDataMap);
19733
    }
19734
 
19735
    public markVoucherAsRedeemed_result() {
19736
    }
19737
 
19738
    public markVoucherAsRedeemed_result(
19739
      boolean success)
19740
    {
19741
      this();
19742
      this.success = success;
19743
      setSuccessIsSet(true);
19744
    }
19745
 
19746
    /**
19747
     * Performs a deep copy on <i>other</i>.
19748
     */
19749
    public markVoucherAsRedeemed_result(markVoucherAsRedeemed_result other) {
19750
      __isset_bit_vector.clear();
19751
      __isset_bit_vector.or(other.__isset_bit_vector);
19752
      this.success = other.success;
19753
    }
19754
 
19755
    public markVoucherAsRedeemed_result deepCopy() {
19756
      return new markVoucherAsRedeemed_result(this);
19757
    }
19758
 
19759
    @Override
19760
    public void clear() {
19761
      setSuccessIsSet(false);
19762
      this.success = false;
19763
    }
19764
 
19765
    public boolean isSuccess() {
19766
      return this.success;
19767
    }
19768
 
19769
    public void setSuccess(boolean success) {
19770
      this.success = success;
19771
      setSuccessIsSet(true);
19772
    }
19773
 
19774
    public void unsetSuccess() {
19775
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
19776
    }
19777
 
19778
    /** Returns true if field success is set (has been assigned a value) and false otherwise */
19779
    public boolean isSetSuccess() {
19780
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
19781
    }
19782
 
19783
    public void setSuccessIsSet(boolean value) {
19784
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
19785
    }
19786
 
19787
    public void setFieldValue(_Fields field, Object value) {
19788
      switch (field) {
19789
      case SUCCESS:
19790
        if (value == null) {
19791
          unsetSuccess();
19792
        } else {
19793
          setSuccess((Boolean)value);
19794
        }
19795
        break;
19796
 
19797
      }
19798
    }
19799
 
19800
    public Object getFieldValue(_Fields field) {
19801
      switch (field) {
19802
      case SUCCESS:
19803
        return Boolean.valueOf(isSuccess());
19804
 
19805
      }
19806
      throw new IllegalStateException();
19807
    }
19808
 
19809
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
19810
    public boolean isSet(_Fields field) {
19811
      if (field == null) {
19812
        throw new IllegalArgumentException();
19813
      }
19814
 
19815
      switch (field) {
19816
      case SUCCESS:
19817
        return isSetSuccess();
19818
      }
19819
      throw new IllegalStateException();
19820
    }
19821
 
19822
    @Override
19823
    public boolean equals(Object that) {
19824
      if (that == null)
19825
        return false;
19826
      if (that instanceof markVoucherAsRedeemed_result)
19827
        return this.equals((markVoucherAsRedeemed_result)that);
19828
      return false;
19829
    }
19830
 
19831
    public boolean equals(markVoucherAsRedeemed_result that) {
19832
      if (that == null)
19833
        return false;
19834
 
19835
      boolean this_present_success = true;
19836
      boolean that_present_success = true;
19837
      if (this_present_success || that_present_success) {
19838
        if (!(this_present_success && that_present_success))
19839
          return false;
19840
        if (this.success != that.success)
19841
          return false;
19842
      }
19843
 
19844
      return true;
19845
    }
19846
 
19847
    @Override
19848
    public int hashCode() {
19849
      return 0;
19850
    }
19851
 
19852
    public int compareTo(markVoucherAsRedeemed_result other) {
19853
      if (!getClass().equals(other.getClass())) {
19854
        return getClass().getName().compareTo(other.getClass().getName());
19855
      }
19856
 
19857
      int lastComparison = 0;
19858
      markVoucherAsRedeemed_result typedOther = (markVoucherAsRedeemed_result)other;
19859
 
19860
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
19861
      if (lastComparison != 0) {
19862
        return lastComparison;
19863
      }
19864
      if (isSetSuccess()) {
19865
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
19866
        if (lastComparison != 0) {
19867
          return lastComparison;
19868
        }
19869
      }
19870
      return 0;
19871
    }
19872
 
19873
    public _Fields fieldForId(int fieldId) {
19874
      return _Fields.findByThriftId(fieldId);
19875
    }
19876
 
19877
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
19878
      org.apache.thrift.protocol.TField field;
19879
      iprot.readStructBegin();
19880
      while (true)
19881
      {
19882
        field = iprot.readFieldBegin();
19883
        if (field.type == org.apache.thrift.protocol.TType.STOP) { 
19884
          break;
19885
        }
19886
        switch (field.id) {
19887
          case 0: // SUCCESS
19888
            if (field.type == org.apache.thrift.protocol.TType.BOOL) {
19889
              this.success = iprot.readBool();
19890
              setSuccessIsSet(true);
19891
            } else { 
19892
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19893
            }
19894
            break;
19895
          default:
19896
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
19897
        }
19898
        iprot.readFieldEnd();
19899
      }
19900
      iprot.readStructEnd();
19901
      validate();
19902
    }
19903
 
19904
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
19905
      oprot.writeStructBegin(STRUCT_DESC);
19906
 
19907
      if (this.isSetSuccess()) {
19908
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
19909
        oprot.writeBool(this.success);
19910
        oprot.writeFieldEnd();
19911
      }
19912
      oprot.writeFieldStop();
19913
      oprot.writeStructEnd();
19914
    }
19915
 
19916
    @Override
19917
    public String toString() {
19918
      StringBuilder sb = new StringBuilder("markVoucherAsRedeemed_result(");
19919
      boolean first = true;
19920
 
19921
      sb.append("success:");
19922
      sb.append(this.success);
19923
      first = false;
19924
      sb.append(")");
19925
      return sb.toString();
19926
    }
19927
 
19928
    public void validate() throws org.apache.thrift.TException {
19929
      // check for required fields
19930
    }
19931
 
19932
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
19933
      try {
19934
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
19935
      } catch (org.apache.thrift.TException te) {
19936
        throw new java.io.IOException(te);
19937
      }
19938
    }
19939
 
19940
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
19941
      try {
19942
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
19943
      } catch (org.apache.thrift.TException te) {
19944
        throw new java.io.IOException(te);
19945
      }
19946
    }
19947
 
19948
  }
19949
 
1982 varun.gupt 19950
}